103 const string myname =
"pddpana::TrackHitInfo::analyze: ";
109 cout<<myname<<
"The event contains "<< Tracks->size() <<
" tracks\n";
112 unsigned EventId =
e.id().event();
117 for (
unsigned itrk = 0; itrk < Tracks->size(); ++itrk) {
119 unsigned TrackId = itrk;
121 float TrackLen = track.
Length();
124 cout<<myname<<
"Track ID "<<TrackId<<
" has " 125 <<TrajPnts<<
" points and is "<<TrackLen<<
" cm long" 126 <<
"\n start at: ( " << track.
Vertex().X()
127 <<
" ; " << track.
Vertex().Y()
128 <<
" ; " << track.
Vertex().Z()
129 <<
"\n end at: ( " << track.
End().X()
130 <<
" ; " << track.
End().Y()
131 <<
" ; " << track.
End().Z()<<
" )"<<
endl;
137 for(
size_t i_plane = 0; i_plane<
fGeom->
Nplanes(); i_plane++) {
142 cout<<myname<<
"Hits in plane "<<i_plane<<
" "<<hits.size()<<
endl;
145 vector<unsigned> plane_hits_tpcid( hits.size() );
147 for(
size_t i_hit = 0; i_hit<hits.size(); i_hit++ ){
148 plane_hits_tpcid[i_hit] = hits[i_hit]->WireID().TPC;
152 auto start = plane_hits_tpcid.begin();
153 auto end = plane_hits_tpcid.end();
154 if( std::equal(start + 1,
end, start)) {
155 this_tpcid = (
int)(*start);
159 cout<<myname<<
"hits for the same plane have mixed TPC IDs. Skipping...\n";
162 if( this_tpcid < 0 ){
167 hitsTpcId[i_plane] = (unsigned)this_tpcid;
171 if( hitsTpcId.empty() )
continue;
173 auto start = hitsTpcId.begin();
174 auto end = hitsTpcId.end();
175 if( !std::equal(start + 1,
end, start)) {
177 cout<<myname<<
"mismatch in TPC ID for the initial hits: ";
178 cout<<
" event ID "<<EventId<<
"; hit TPC IDs ";
179 for(
auto const &v: hitsTpcId ){ cout<<v<<
" ";}
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
double Length(size_t p=0) const
Access to various track properties.
Point_t const & Vertex() const
const std::vector< const recob::Hit * > GetRecoTrackHitsFromPlane(const recob::Track &track, art::Event const &evt, const std::string trackModule, unsigned int planeID) const
Get the hits from a given reco track from a specific plane.
protoana::ProtoDUNETrackUtils trackUtil
Point_t const & End() const
const geo::Geometry * fGeom
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
QTextStream & endl(QTextStream &s)