14 #include "art_root_io/TFileService.h" 15 #include "art_root_io/TFileDirectory.h" 17 #include "canvas/Persistency/Common/FindManyP.h" 22 #include "dune/Protodune/singlephase/DataUtils/ProtoDUNEDataUtils.h" 61 #include "TDirectory.h" 69 #include "TGraphErrors.h" 72 #include "TTimeStamp.h" 78 #include "TTimeStamp.h" 82 #include "TPaveStats.h" 114 int fNactivefembs[6];
147 fDataUtils (pset.
get<
fhicl::ParameterSet>(
"DataUtils")),
148 fHitsModuleLabel (pset.
get<
std::
string >(
"HitsModuleLabel",
"") ),
149 fTrackModuleLabel (pset.
get<
std::
string >(
"TrackModuleLabel",
"") ),
150 fCalorimetryModuleLabel (pset.
get<
std::
string >(
"CalorimetryModuleLabel",
"") ),
151 fSaveTrackInfo (pset.
get<
bool>(
"SaveTrackInfo",false)),
152 fSaveCaloInfo (pset.
get<
bool>(
"SaveCaloInfo",false))
169 fEventTree = tfs->make<TTree>(
"Event",
"Event Tree from Reco");
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();
406 for(
int k=0;
k < 6;
k++)
423 for(
int j=0; j<3000; j++){
def analyze(root, level, gtrees, gbranches, doprint)
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
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
constexpr std::uint32_t timeHigh() const
ProtoDUNEDataUtils fDataUtils
Vector_t VertexDirection() const
void beginRun(const art::Run &run)
void analyze(const art::Event &evt)
std::string fTrackModuleLabel
Float_t trackthetaxz[kMaxTracks]
Float_t trkstartz[kMaxTracks]
Float_t trkhity[kMaxTracks][3][3000]
Float_t trkdq_int[kMaxTracks][3][3000]
object containing MC flux information
art framework interface to geometry description
Float_t trkendz[kMaxTracks]
Float_t trklen[kMaxTracks]
Int_t ntrkhits[kMaxTracks][3]
QTextStream & reset(QTextStream &s)
Float_t trackthetayz[kMaxTracks]
Float_t trkendx[kMaxTracks]
double Length(size_t p=0) const
Access to various track properties.
#define DEFINE_ART_MODULE(klass)
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]
Definition of data types for geometry description.
std::string fHitsModuleLabel
Float_t trkstartx[kMaxTracks]
Declaration of signal hit object.
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]
Provides recob::Track data product.
EventNumber_t event() const
Point_t const & End() const
Int_t hit_tpc[kMaxTracks][3][3000]
Declaration of basic channel signal object.
std::string fCalorimetryModuleLabel
Int_t hit_wire[kMaxTracks][3][3000]
Float_t trkstarty[kMaxTracks]
auto const & get(AssnsNode< L, R, D > const &r)
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)
Event finding and building.