217 std::vector<art::Ptr<recob::Track> > tracklist;
218 std::vector<art::Ptr<recob::PFParticle> > pfplist;
223 auto PFPListHandle = evt.
getHandle< std::vector<recob::PFParticle> >(
"pandora");
226 std::vector<art::Ptr<recob::Hit>> hitlist;
231 art::FindManyP<recob::Hit, recob::TrackHitMeta> fmthm(trackListHandle, evt,
fTrackModuleLabel);
233 art::FindManyP<anab::T0> trk_t0_assn_v(PFPListHandle, evt ,
"pandora");
234 art::FindManyP<recob::PFParticle> pfp_trk_assn(trackListHandle,evt,
"pandoraTrack");
235 art::FindManyP<anab::T0> fmT0(trackListHandle, evt ,
"pmtrack");
249 for(
int k=0;
k < 6;
k++)
253 for(
int k=0;
k < 6;
k++)
260 size_t NTracks = tracklist.size();
261 for(
size_t i=0; i<NTracks;++i){
280 if(track.
Length()<300)
continue;
286 if(TMath::Abs(
end.X()-
pos.X())<330 ||TMath::Abs(
end.X()-
pos.X())>1500 )
continue;
287 double theta_xz = std::atan2(dir_start.X(), dir_start.Z());
288 double theta_yz = std::atan2(dir_start.Y(), dir_start.Z());
308 cout<<
"fmthm is valid "<<fmthm.isValid()<<
endl;
310 auto vhit=fmthm.at(i);
311 auto vmeta=fmthm.data(i);
312 cout<<
"vhit vmetadata"<<
endl;
313 for (
size_t ii = 0; ii<vhit.size(); ++ii){
314 bool fBadhit =
false;
317 cout<<
"fBadHit"<<fBadhit<<
endl;
320 cout<<
"first ii"<<ii<<
endl;
321 if (vmeta[ii]->
Index()>=tracklist[i]->NumberTrajectoryPoints()){
322 throw cet::exception(
"Calorimetry_module.cc") <<
"Requested track trajectory index "<<vmeta[ii]->Index()<<
" exceeds the total number of trajectory points "<<tracklist[i]->NumberTrajectoryPoints()<<
" for track index "<<i<<
". Something is wrong with the track reconstruction. Please contact tjyang@fnal.gov!!";
324 cout<<
"second ii"<<ii<<
endl;
325 if (!tracklist[i]->HasValidPoint(vmeta[ii]->
Index())){
327 cout<<
"had valid point "<<fBadhit<<
endl;
330 cout<<
"3rd ii"<<ii<<
endl;
332 auto loc = tracklist[i]->LocationAtPoint(vmeta[ii]->
Index());
337 cout<<
"x, y, z "<<xpos<<
" "<<ypos<<
" "<<zpos<<
endl;
338 cout<<
"BadHit"<<fBadhit<<
endl;
339 if (fBadhit)
continue;
340 if (zpos<-100)
continue;
341 planenum=vhit[ii]->WireID().Plane;
342 cout<<
"plane num "<<planenum;
347 int k=vhit[ii]->PeakTime();
348 cout<<
"int k"<<k<<
endl;
349 cout<<
"peakT"<<vhit[ii]->PeakTime();
356 cout<<vhit[ii]->WireID().Wire;
357 cout<<
"peakT"<<vhit[ii]->PeakTime();
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
Int_t hit_channel[kMaxTracks][3][3000]
constexpr std::uint32_t timeLow() const
Handle< PROD > getHandle(SelectorBase const &) const
constexpr std::uint32_t timeHigh() const
ProtoDUNEDataUtils fDataUtils
Vector_t VertexDirection() const
std::string fTrackModuleLabel
Float_t trackthetaxz[kMaxTracks]
Float_t trkstartz[kMaxTracks]
Float_t trkhity[kMaxTracks][3][3000]
Float_t trkdq_int[kMaxTracks][3][3000]
Float_t trkendz[kMaxTracks]
Float_t trklen[kMaxTracks]
Int_t ntrkhits[kMaxTracks][3]
Float_t trackthetayz[kMaxTracks]
Float_t trkendx[kMaxTracks]
double Length(size_t p=0) const
Access to various track properties.
Float_t hit_peakT[kMaxTracks][3][3000]
Point_t const & Vertex() const
Float_t trkhitz[kMaxTracks][3][3000]
SubRunNumber_t subRun() const
Float_t trkhitx[kMaxTracks][3][3000]
static int max(int a, int b)
Float_t trkendy[kMaxTracks]
std::string fHitsModuleLabel
Float_t trkstartx[kMaxTracks]
Float_t xprojectedlen[kMaxTracks]
int GetNActiveFembsForAPA(art::Event const &evt, int apa) const
Get number of active fembs in an APA.
Float_t trkdq_amp[kMaxTracks][3][3000]
EventNumber_t event() const
Point_t const & End() const
Int_t hit_tpc[kMaxTracks][3][3000]
Int_t hit_wire[kMaxTracks][3][3000]
Float_t trkstarty[kMaxTracks]
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)