36 #include "art_root_io/TFileService.h" 106 fHitResidualAll = tfs->make<TH1F>(
"fHitResidualAll",
"Hit Residual All", 1600, -400, 400);
107 fHitResidualAllAlt = tfs->make<TH1F>(
"fHitResidualAllAlt",
"Hit Residual All", 1600, -400, 400);
109 tfs->make<TH1F>(
"fNumberOfHitsPerEvent",
"Number of Hits in Each Event", 10000, 0, 10000);
111 tfs->make<TH2F>(
"fPeakTimeVsWire",
"Peak Time vs Wire Number", 3200, 0, 3200, 9500, 0, 9500);
113 fHTree = tfs->make<TTree>(
"HTree",
"HTree");
114 fHTree->Branch(
"Evt", &
fEvt,
"Evt/I");
115 fHTree->Branch(
"Run", &
fRun,
"Run/I");
119 fHTree->Branch(
"nHits", &
fnHits,
"nHits/I");
120 fHTree->Branch(
"Wire", &
fWire,
"Wire[nHits]/I");
121 fHTree->Branch(
"StartTime", &
fStartTime,
"fStartTime[nHits]/F");
122 fHTree->Branch(
"EndTime", &
fEndTime,
"fEndTime[nHits]/F");
123 fHTree->Branch(
"PeakTime", &
fPeakTime,
"fPeakTime[nHits]/F");
124 fHTree->Branch(
"PeakTimeUncert", &
fPeakTimeUncert,
"fPeakTimeUncert[nHits]/F");
125 fHTree->Branch(
"Charge", &
fCharge,
"fCharge[nHits]/F");
126 fHTree->Branch(
"ChargeUncert", &
fChargeUncert,
"fChargeUncert[nHits]/F");
127 fHTree->Branch(
"Multiplicity", &
fMultiplicity,
"fMultiplicity[nHits]/I");
128 fHTree->Branch(
"GOF", &
fGOF,
"fGOF[nHits]/F");
134 fHTree->Branch(
"TruePeakPos", &
fTruePeakPos,
"fTruePeakPos[nHits]/F");
146 auto const clock_data =
148 auto const det_prop =
155 float TotWireCharge = 0;
157 for (
size_t wireIter = 0; wireIter < wireVecHandle->size(); wireIter++) {
159 std::vector<float> signal(wire->
Signal());
161 for (
auto timeIter = signal.begin(); timeIter + 2 < signal.end(); timeIter++) {
163 if (*timeIter < 2) {
continue; }
165 TotWireCharge += *timeIter;
175 std::vector<art::Ptr<recob::Hit>> hits;
180 fnHits = hitHandle->size();
183 for (
size_t numHit = 0; numHit < hitHandle->size(); ++numHit) {
206 unsigned int plane = 0;
207 Float_t TruthHitTime = 0, TruthHitCalculated = 0;
211 double drift_velocity = det_prop.DriftVelocity(det_prop.Efield(), det_prop.Temperature());
213 for (
size_t nh = 0; nh < hitHandle->size(); nh++) {
221 std::vector<sim::TrackIDE> trackides;
222 std::vector<double> xyz;
226 xyz = bt_serv->
HitToXYZ(clock_data, hitPoint);
229 mf::LogWarning(
"GausHitFinderAna") <<
"BackTrackerService Failed";
240 TruthHitTime = det_prop.ConvertXToTicks(
247 const double origin[3] = {0.};
250 double planePos_timeCorr = (pos[0] / drift_velocity) * (1. / time_tick) + 60;
253 TruthHitCalculated = ((xyz[0]) / (drift_velocity * time_tick)) + planePos_timeCorr;
Float_t fPeakTime[kMaxHits]
PlaneGeo const & Plane(unsigned int const p, unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified wire.
std::vector< sim::TrackIDE > HitToTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
geo::WireID WireID() const
float SigmaIntegral() const
CryostatID_t Cryostat
Index of cryostat.
std::string fLArG4ModuleLabel
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
WireID_t Wire
Index of the wire within its plane.
std::vector< double > HitToXYZ(detinfo::DetectorClocksData const &clockData, const recob::Hit &hit) const
EDAnalyzer(fhicl::ParameterSet const &pset)
Int_t fMultiplicity[kMaxHits]
float GoodnessOfFit() const
Degrees of freedom in the determination of the hit signal shape (-1 by default)
short int Multiplicity() const
How many hits could this one be shared with.
art framework interface to geometry description
Float_t fPeakTimeUncert[kMaxHits]
TH1F * fHitResidualAllAlt
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
std::string fCalDataModuleLabel
#define DEFINE_ART_MODULE(klass)
Float_t fCharge[kMaxHits]
T get(std::string const &key) const
GausHitFinderAna(fhicl::ParameterSet const &pset)
TH1F * fNumberOfHitsPerEvent
PlaneID_t Plane
Index of the plane within its TPC.
float PeakTimeMinusRMS(float sigmas=+1.) const
Detector simulation of raw signals on wires.
std::vector< float > Signal() const
Return a zero-padded full length vector filled with RoI signal.
Float_t fTotalHitChargePerEvent
float PeakTime() const
Time of the signal peak, in tick units.
Declaration of signal hit object.
Float_t fEndTime[kMaxHits]
Encapsulate the construction of a single detector plane.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
EventNumber_t event() const
Declaration of basic channel signal object.
Base class for creation of raw signals on wires.
float SigmaPeakTime() const
Uncertainty for the signal peak, in tick units.
std::string fHitFinderModuleLabel
Float_t fTruePeakPos[kMaxHits]
float PeakTimePlusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
Float_t fStartTime[kMaxHits]
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
TPCID_t TPC
Index of the TPC within its cryostat.
Float_t fChargeUncert[kMaxHits]
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
void LocalToWorld(const double *plane, double *world) const
Transform point from local plane frame to world frame.
void analyze(const art::Event &evt) override
constexpr Point origin()
Returns a origin position with a point of the specified type.
cet::coded_exception< error, detail::translate > exception