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) {
187 fWire[hitCount] =
hit->WireID().Wire;
195 fGOF[hitCount] =
hit->GoodnessOfFit();
198 TotCharge +=
hit->Integral();
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++) {
216 plane = hitPoint->WireID().Plane;
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(
241 xyz[0], plane, hitPoint->WireID().TPC, hitPoint->WireID().Cryostat);
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;
257 double hitresid = ((TruthHitTime - hitPoint->PeakTime()) / hitPoint->SigmaPeakTime());
261 ((TruthHitCalculated - hitPoint->PeakTime()) / hitPoint->SigmaPeakTime());
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
std::vector< double > HitToXYZ(detinfo::DetectorClocksData const &clockData, const recob::Hit &hit) const
Int_t fMultiplicity[kMaxHits]
Float_t fPeakTimeUncert[kMaxHits]
TH1F * fHitResidualAllAlt
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
std::string fCalDataModuleLabel
Float_t fCharge[kMaxHits]
TH1F * fNumberOfHitsPerEvent
Detector simulation of raw signals on wires.
Float_t fTotalHitChargePerEvent
Float_t fEndTime[kMaxHits]
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
EventNumber_t event() const
std::string fHitFinderModuleLabel
Float_t fTruePeakPos[kMaxHits]
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 LocalToWorld(const double *plane, double *world) const
Transform point from local plane frame to world frame.
constexpr Point origin()
Returns a origin position with a point of the specified type.
cet::coded_exception< error, detail::translate > exception