5 #include "art_root_io/TFileService.h" 6 #include "art_root_io/TFileDirectory.h" 8 #include "canvas/Persistency/Common/FindManyP.h" 43 #include "TDirectory.h" 51 #include "TGraphErrors.h" 54 #include "TTimeStamp.h" 60 #include "TTimeStamp.h" 64 #include "TPaveStats.h" 130 fHitsModuleLabel (pset.
get<
std::
string >(
"HitsModuleLabel",
"") ),
131 fTrackModuleLabel (pset.
get<
std::
string >(
"TrackModuleLabel",
"") ),
132 fCalorimetryModuleLabel (pset.
get<
std::
string >(
"CalorimetryModuleLabel",
"") ),
133 fSaveCaloInfo (pset.
get<
bool>(
"SaveCaloInfo",false)),
134 fSaveTrackInfo (pset.
get<
bool>(
"SaveTrackInfo",false))
150 fEventTree = tfs->make<TTree>(
"Event",
"Event Tree from Reco");
201 std::vector<art::Ptr<recob::Track> > tracklist;
202 std::vector<art::Ptr<recob::PFParticle> > pfplist;
207 auto PFPListHandle = evt.
getHandle< std::vector<recob::PFParticle> >(
"pandora");
211 art::FindManyP<anab::T0> trk_t0_assn_v(PFPListHandle, evt ,
"pandora");
212 art::FindManyP<recob::PFParticle> pfp_trk_assn(trackListHandle,evt,
"pandoraTrack");
213 art::FindManyP<anab::T0> fmT0(trackListHandle, evt ,
"pmtrack");
238 size_t NTracks = tracklist.size();
239 for(
size_t i=0; i<NTracks;++i){
242 std::vector<art::Ptr<recob::PFParticle>> pfps=pfp_trk_assn.at(i);
243 if(!pfps.size())
continue;
244 std::vector<art::Ptr<anab::T0>> t0s=trk_t0_assn_v.at(pfps[0].
key());
245 if(!t0s.size())
continue;
250 std::vector<art::Ptr<anab::T0>> T0s=fmT0.at(i);
255 std::vector<art::Ptr<anab::Calorimetry>> calos=fmcal.at(i);
262 double theta_xz = std::atan2(dir_start.X(), dir_start.Z());
263 double theta_yz = std::atan2(dir_start.Y(), dir_start.Z());
276 TrkID[cross_trks-1]=track.
ID();
284 for(
size_t ical = 0; ical<calos.size(); ++ical){
285 if(!calos[ical])
continue;
286 if(!calos[ical]->
PlaneID().isValid)
continue;
287 int planenum = calos[ical]->PlaneID().Plane;
288 if(planenum<0||planenum>2)
continue;
289 const size_t NHits = calos[ical] ->
dEdx().size();
291 for(
size_t iHit = 0; iHit < NHits; ++iHit){
292 const auto& TrkPos = (calos[ical] -> XYZ())[iHit];
293 trkdqdx[cross_trks-1][planenum][iHit]=(calos[ical] -> dQdx())[iHit];
294 trkdedx[cross_trks-1][planenum][iHit]=(calos[ical] ->
dEdx())[iHit];
295 trkresrange[cross_trks-1][planenum][iHit]=(calos[ical]->ResidualRange())[iHit];
296 trkhitx[cross_trks-1][planenum][iHit]=TrkPos.X();
297 trkhity[cross_trks-1][planenum][iHit]=TrkPos.Y();
298 trkhitz[cross_trks-1][planenum][iHit]=TrkPos.Z();
336 for(
int j=0; j<3; j++){
337 for(
int k=0;
k<3000;
k++){
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...
Float_t trkendy[kMaxTracks]
constexpr std::uint32_t timeLow() const
Int_t ntrkhits[kMaxTracks][3]
Handle< PROD > getHandle(SelectorBase const &) const
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
Float_t trackthetayz[kMaxTracks]
Float_t trkhitz[kMaxTracks][3][3000]
std::string fTrackModuleLabel
constexpr std::uint32_t timeHigh() const
Float_t trkendx[kMaxTracks]
Vector_t VertexDirection() const
Float_t trkdqdx[kMaxTracks][3][3000]
Float_t trkendcosxyz[kMaxTracks][3]
Float_t trkstartx[kMaxTracks]
Float_t trkdedx[kMaxTracks][3][3000]
object containing MC flux information
Float_t trkstartcosxyz[kMaxTracks][3]
art framework interface to geometry description
Float_t trkstartz[kMaxTracks]
std::string fHitsModuleLabel
void analyze(const art::Event &evt)
std::string fCalorimetryModuleLabel
QTextStream & reset(QTextStream &s)
double dEdx(float dqdx, float Efield)
double Length(size_t p=0) const
Access to various track properties.
#define DEFINE_ART_MODULE(klass)
Float_t trkstarty[kMaxTracks]
Point_t const & Vertex() const
SubRunNumber_t subRun() const
Float_t trkhitx[kMaxTracks][3][3000]
Definition of data types for geometry description.
Float_t trklen[kMaxTracks]
Float_t trkhity[kMaxTracks][3][3000]
Declaration of signal hit object.
virtual ~XYZcalibration()
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Vector_t EndDirection() const
Float_t xprojectedlen[kMaxTracks]
Provides recob::Track data product.
Float_t trkendz[kMaxTracks]
EventNumber_t event() const
Point_t const & End() const
Declaration of basic channel signal object.
detail::Node< FrameID, bool > PlaneID
auto const & get(AssnsNode< L, R, D > const &r)
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
void beginRun(const art::Run &run)
Float_t trkresrange[kMaxTracks][3][3000]
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)
Event finding and building.
Float_t trackthetaxz[kMaxTracks]