36 #include "art_root_io/TFileService.h" 105 fHitResidualAll = tfs->make<TH1F>(
"fHitResidualAll",
"Hit Residual All", 1600, -400, 400);
106 fHitResidualAllAlt = tfs->make<TH1F>(
"fHitResidualAllAlt",
"Hit Residual All", 1600, -400, 400);
108 tfs->make<TH1F>(
"fNumberOfHitsPerEvent",
"Number of Hits in Each Event", 10000, 0, 10000);
110 tfs->make<TH2F>(
"fPeakTimeVsWire",
"Peak Time vs Wire Number", 3200, 0, 3200, 9500, 0, 9500);
112 fHTree = tfs->make<TTree>(
"HTree",
"HTree");
113 fHTree->Branch(
"Evt", &
fEvt,
"Evt/I");
114 fHTree->Branch(
"Run", &
fRun,
"Run/I");
118 fHTree->Branch(
"nHits", &
fnHits,
"nHits/I");
119 fHTree->Branch(
"Wire", &
fWire,
"Wire[nHits]/I");
120 fHTree->Branch(
"StartTime", &
fStartTime,
"fStartTime[nHits]/F");
121 fHTree->Branch(
"EndTime", &
fEndTime,
"fEndTime[nHits]/F");
122 fHTree->Branch(
"PeakTime", &
fPeakTime,
"fPeakTime[nHits]/F");
123 fHTree->Branch(
"PeakTimeUncert", &
fPeakTimeUncert,
"fPeakTimeUncert[nHits]/F");
124 fHTree->Branch(
"Charge", &
fCharge,
"fCharge[nHits]/F");
125 fHTree->Branch(
"ChargeUncert", &
fChargeUncert,
"fChargeUncert[nHits]/F");
126 fHTree->Branch(
"Multiplicity", &
fMultiplicity,
"fMultiplicity[nHits]/I");
127 fHTree->Branch(
"GOF", &
fGOF,
"fGOF[nHits]/F");
133 fHTree->Branch(
"TruePeakPos", &
fTruePeakPos,
"fTruePeakPos[nHits]/F");
144 auto const clock_data =
146 auto const det_prop =
153 float TotWireCharge = 0;
155 for (
size_t wireIter = 0; wireIter < wireVecHandle->size(); wireIter++) {
157 std::vector<float> signal(wire->
Signal());
159 for (
auto timeIter = signal.begin(); timeIter + 2 < signal.end(); timeIter++) {
161 if (*timeIter < 2) {
continue; }
163 TotWireCharge += *timeIter;
173 std::vector<art::Ptr<recob::Hit>>
hits;
178 fnHits = hitHandle->size();
181 for (
size_t numHit = 0; numHit < hitHandle->size(); ++numHit) {
204 Float_t TruthHitTime = 0, TruthHitCalculated = 0;
208 double drift_velocity = det_prop.DriftVelocity(det_prop.Efield(), det_prop.Temperature());
210 for (
size_t nh = 0; nh < hitHandle->size(); nh++) {
218 std::vector<sim::TrackIDE> trackides;
219 std::vector<double> xyz;
223 xyz = bt_serv->
HitToXYZ(clock_data, hitPoint);
226 mf::LogWarning(
"GausHitFinderAna") <<
"BackTrackerService Failed";
237 TruthHitTime = det_prop.ConvertXToTicks(xyz[0], planeID);
244 double planePos_timeCorr = (pos.X() / drift_velocity) * (1. / time_tick) + 60;
247 TruthHitCalculated = ((xyz[0]) / (drift_velocity * time_tick)) + planePos_timeCorr;
Float_t fPeakTime[kMaxHits]
std::vector< sim::TrackIDE > HitToTrackIDEs(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
Declaration of signal hit object.
float SigmaIntegral() const
Initial tdc tick for hit.
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.
geo::WireID const & WireID() const
Initial tdc tick for hit.
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.
Float_t fPeakTimeUncert[kMaxHits]
TH1F * fHitResidualAllAlt
PlaneGeo const & Plane(PlaneID const &planeid) const
Returns the specified wire.
std::string fCalDataModuleLabel
Point_t GetBoxCenter() const
Returns the centre of the box representing the plane.
#define DEFINE_ART_MODULE(klass)
Float_t fCharge[kMaxHits]
T get(std::string const &key) const
GausHitFinderAna(fhicl::ParameterSet const &pset)
constexpr PlaneID const & asPlaneID() const
Conversion to PlaneID (for convenience of notation).
TH1F * fNumberOfHitsPerEvent
float PeakTimeMinusRMS(float sigmas=+1.) const
Returns a time sigmas RMS away from the peak time.
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.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
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)
Float_t fChargeUncert[kMaxHits]
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
void analyze(const art::Event &evt) override
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception