21 #include "art_root_io/TFileService.h" 26 #include "canvas/Persistency/Common/FindOne.h" 27 #include "canvas/Persistency/Common/FindOneP.h" 28 #include "canvas/Persistency/Common/FindMany.h" 29 #include "canvas/Persistency/Common/FindManyP.h" 57 #include "MCCheater/BackTracker.h" 60 #include "nurandom/RandomUtils/NuRandomService.h" 62 #include "CoreUtils/ServiceUtil.h" 66 #include "TDatabasePDG.h" 67 #include "TParticlePDG.h" 71 #include "CLHEP/Random/RandFlat.h" 75 #include <unordered_map> 91 typedef pair<float, string>
P;
107 virtual void endJob()
override;
125 float& forwardIonVal,
float& backwardIonVal);
127 float ionizeTruncate);
130 {
return a.first < b.first;}
278 fGeo = providerFrom<geo::GeometryGAr>();
314 consumesMany<vector<simb::MCTruth> >();
315 consumesMany<vector<simb::GTruth> >();
318 consumes<Assns<simb::MCTruth, simb::MCParticle> >(
fGeantLabel);
320 consumes<vector<sdp::EnergyDeposit> >(
fGeantLabel);
321 InputTag ecalgeanttag(fGeantLabel, fGeantInstanceCalo);
322 consumes<vector<sdp::CaloDeposit> >(ecalgeanttag);
330 consumes<Assns<rec::Track, rec::Vertex> >(
fVertexLabel);
332 consumes<Assns<rec::Track, rec::Vee> >(
fVeeLabel);
334 consumes<Assns<rec::TrackIoniz, rec::Track>>(
fTrackLabel);
337 if(fAnaMode ==
"readout"){
341 consumes<vector<raw::RawDigit> >(tpcrawtag);
344 InputTag ecalrawtag(fCalDigitLabel, fCalDigitInstance);
345 consumes<vector<raw::CaloRawDigit> >(ecalrawtag);
349 InputTag murawtag(fCalDigitLabel, fMuDigitInstance);
350 consumes<vector<raw::CaloRawDigit> >(murawtag);
354 InputTag ecalhittag(fCaloHitLabel, fCaloHitInstanceCalo);
355 consumes<vector<rec::CaloHit> >(ecalhittag);
359 InputTag muidgeanttag(fGeantLabel, fGeantInstanceMuID);
360 consumes<vector<sdp::CaloDeposit> >(muidgeanttag);
362 InputTag muidhittag(fCaloHitLabel, fCaloHitInstanceMuID);
363 consumes<vector<rec::CaloHit> >(muidhittag);
386 fHeaderTree = tfs->make<TTree>(
"headerTree",
"sample provenance information");
396 fGenTree = tfs->make<TTree>(
"genTree",
"generator level info");
403 fG4Tree = tfs->make<TTree>(
"g4Tree",
"GEANT4 level info");
420 fDisplayTree = tfs->make<TTree>(
"displayTree",
"truth/reco level traj points for event display");
430 fDetTree = tfs->make<TTree>(
"detTree",
"detector readout level info");
442 fRecoTree = tfs->make<TTree>(
"recoTree",
"reconstruction level info");
472 string filename =
"${DUNE_PARDATA_DIR}/MPD/dedxPID/dedxpidmatrices8kevcm.root";
473 TFile
infile(filename.c_str(),
"READ");
477 for (
int q = 0; q < 501; ++q)
479 sprintf(str,
"%d", q);
484 m_pidinterp.insert( std::make_pair(q, (TH2F*)
infile.Get(s.c_str())->Clone(
"pidinterp")) );
498 {
"CryostatEndcap", 6 },
513 auto const&
ID = run.
id();
516 if (!summaryHandle) {
517 MF_LOG_DEBUG(
"anatree") <<
" No sumdata::POTSummary branch for run " <<
ID 518 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
527 <<
" The number of spills is " <<
fNSpills;
557 mf::LogDebug(
"StructuredTree") <<
"fill truth level info";
579 mf::LogDebug(
"StructuredTree") <<
"fill base level reco info";
584 mf::LogDebug(
"StructuredTree") <<
"fill high level reco info";
685 auto mcthandlelist = e.
getMany<vector<simb::MCTruth> >();
686 auto gthandlelist = e.
getMany<vector<simb::GTruth> >();
688 vector<string> genInstances;
691 for (
size_t imcthl = 0; imcthl < mcthandlelist.size(); ++imcthl) {
693 auto mcthandle = mcthandlelist.at(imcthl);
694 string instance = mcthandle.provenance()->productInstanceName();
695 if( std::find(genInstances.begin(),genInstances.end(),
instance) == genInstances.end()) {
697 <<
"found new generator instance, '" << instance <<
"'";
698 genInstances.push_back(instance);
702 <<
"found repeated generator instance, '" << instance <<
"'";
705 <<
"processing " << mcthandle->size() <<
" MCTruths";
708 for (
size_t imct = 0; imct < mcthandle->size(); imct++) {
710 auto const& mct = mcthandle->at(imct);
723 for (
auto const& gth : gthandlelist) {
725 auto const&
gt = (*gth).at(0);
731 <<
"more than 1 GTruth in MCTruth! (" 733 << (*gth).size() <<
")";
743 <<
"filled vector with " <<
fGTruth.size() <<
" GTruths";
753 for(
int imcp = 0; imcp<mct.NParticles(); imcp++) {
755 auto const& mcp = mct.GetParticle(imcp);
756 if(mcp.StatusCode() == 1){
759 <<
"FS particle with trackID " << (
int)mcp.TrackId() <<
", PDG " 760 << mcp.PdgCode() <<
", " <<
"4-position (" << mcp.Position(0).X() <<
", " 761 << mcp.Position(0).Y() <<
", " << mcp.Position(0).Z() <<
", " 762 << mcp.Position(0).T() <<
"), and " 763 << (
int)mcp.NumberTrajectoryPoints() <<
" trajectory points";
771 <<
"Processed MCTruth with " << mct.NParticles() <<
" particles of which " 772 <<
fFSParticles.back().size() <<
" are in the final state";
787 for (
auto mcp : *MCPHandle ) {
796 int parentPdg = INT_MAX;
797 int progenitorId = INT_MAX;
798 int progenitorPdg = INT_MAX;
799 vector<pair<TLorentzVector,TLorentzVector>> positions;
800 vector<pair<TLorentzVector,TLorentzVector>> momenta;
802 vector<size_t> npointsPerRegion;
807 progenitorId = progenitor->
TrackId();
808 progenitorPdg = progenitor->PdgCode();
812 mf::LogDebug(
"StructuredTree") <<
"G4 primary with trackID " << mcp.TrackId() <<
", PDG " << mcp.PdgCode()
813 <<
", initial 4-position (" << mcp.Position(0).X()
814 <<
"," << mcp.Position(0).Y() <<
"," 815 << mcp.Position(0).Z() <<
", " << mcp.Position(0).T() <<
")" ;
824 TLorentzVector *pEnter=0, *pExit=0, *xEnter=0, *xExit=0;
825 for(
size_t ipt = 0; ipt < mcp.NumberTrajectoryPoints(); ipt++){
835 bool last = (ipt==mcp.NumberTrajectoryPoints()-1);
837 if(!last) nextName =
PointToRegion(mcp.Position(ipt+1).Vect());
845 pEnter =
new TLorentzVector(mcp.Momentum(ipt));
846 xEnter =
new TLorentzVector(mcp.Position(ipt));
850 if(regionName != nextName) {
855 momenta.push_back({*pEnter,*pExit});
856 positions.push_back({*xEnter,*xExit});
857 npointsPerRegion.push_back(nptsreg);
876 regionName != nextName ) ) ) {
890 pExit =
new TLorentzVector(mcp.Momentum(ipt));
891 xExit =
new TLorentzVector(mcp.Position(ipt));
893 momenta.push_back({*pEnter,*pExit});
894 positions.push_back({*xEnter,*xExit});
895 npointsPerRegion.push_back(nptsreg);
905 if(momenta.size()!=positions.size()) std::cout <<
"G4Particle: positions-momenta size mismatch" <<
std::endl;
906 if(momenta.size()!=regions.
size()) std::cout <<
"G4Particle: positions/momenta - regions size mismatch" <<
std::endl;
929 for(
size_t i=0; i<
fMCTruths.size(); i++){
934 bool foundfs =
false;
954 <<
"no MCTruth found for MCParticle";
975 auto TPCSimHitHandle = e.
getValidHandle< vector<sdp::EnergyDeposit> >(geanttag);
976 auto CalSimHitHandle = e.
getValidHandle< vector<sdp::CaloDeposit> >(calgeanttag);
990 bool hasmatched =
false;
995 for(
auto const&
hit : *TPCSimHitHandle ){
1003 for (
auto const&
hit : *CalSimHitHandle ) {
1014 auto MuSimHitHandle = e.
getValidHandle< vector<sdp::CaloDeposit> >(mugeanttag);
1017 for (
auto const&
hit : *MuSimHitHandle ) {
1033 <<
" found " << nnomatch <<
" G4Particle(s) with no matching SimHit." 1034 <<
" SimHit -> G4Particle associations corrupted!";
1050 auto TPCDigitHandle = e.
getValidHandle< vector<raw::RawDigit> >(tpcdigittag);
1051 auto CalDigitHandle = e.
getValidHandle< vector<raw::CaloRawDigit> >(caldigittag);
1054 for(
auto const& digit : *TPCDigitHandle)
1058 for (
auto const& digit : *CalDigitHandle ) {
1066 auto MuDigitHandle = e.
getValidHandle< vector<raw::CaloRawDigit> >(mudigittag);
1068 for (
auto const& digit : *MuDigitHandle ) {
1083 auto TPCHitHandle = e.
getValidHandle< vector<rec::Hit> >(tpchittag);
1084 auto CalHitHandle = e.
getValidHandle< vector<rec::CaloHit> >(calhittag);
1087 for (
auto const&
hit : *TPCHitHandle ) {
1093 for (
auto const&
hit : *CalHitHandle ) {
1101 auto MuHitHandle = e.
getValidHandle< vector<rec::CaloHit> >(muhittag);
1103 for (
auto const&
hit : *MuHitHandle ) {
1112 auto TPCClusterHandle = e.
getValidHandle< vector<rec::TPCCluster> >(tpcclustertag);
1121 for (
auto const& TPCCluster : (*TPCClusterHandle) ) {
1156 auto TrackHandle = e.
getValidHandle< vector<rec::Track> >(tracktag);
1158 auto VertexHandle = e.
getValidHandle< vector<rec::Vertex> >(verttag);
1160 auto CalClusterHandle = e.
getValidHandle< vector<rec::Cluster> >(calclustertag);
1163 art::FindOneP<rec::TrackIoniz>* findIonization = NULL;
1164 findIonization =
new art::FindOneP<rec::TrackIoniz>(TrackHandle,
e,
fTrackLabel);
1167 art::FindManyP<rec::Track, rec::TrackEnd>* findManyTrackEnd = NULL;
1168 findManyTrackEnd =
new art::FindManyP<rec::Track, rec::TrackEnd>(VertexHandle,
e,
fVertexLabel);
1171 art::FindManyP<rec::Track, rec::TrackEnd>* findManyVeeTrackEnd = NULL;
1172 findManyVeeTrackEnd =
new art::FindManyP<rec::Track, rec::TrackEnd>(VeeHandle,
e,
fVeeLabel);
1176 art::FindManyP<
rec::Track>* findManyCalTrackEnd = NULL;
1183 vector<size_t> trackIDs;
1184 for (
auto track : *TrackHandle ) {
1190 for(
auto const& mcpe : trackmcps){
1194 if( mcpe.first->TrackId() ==
fG4Particles[i].TrackID())
1195 indices.push_back(i);
1203 vector< pair<int, float> > pidF =
processPIDInfo( track.Momentum_beg() );
1204 vector< pair<int, float> > pidB =
processPIDInfo( track.Momentum_end() );
1207 float avgIonF = 0., avgIonB=0.;
1208 if (findIonization->isValid()) {
1215 TVector3 trkVtx(track.Vertex()[0],track.Vertex()[1],track.Vertex()[2]);
1217 std::sort(hits.begin(),hits.end(),
1219 TVector3 rhitl(hl->Position()[0],hl->Position()[1],hl->Position()[2]);
1220 TVector3 rhitr(
hr->Position()[0],
hr->Position()[1],
hr->Position()[2]);
1221 return (trkVtx-rhitl).Mag() < (trkVtx-rhitr).Mag();
1227 vector<pair<UInt_t,TLorentzVector>> truePosBeg, trueMomBeg, truePosEnd, trueMomEnd;
1228 vector<std::pair<int,float>> trueEnergy;
1230 for(
auto const& ide : hitIdesBeg) {
1231 truePosBeg.push_back(std::make_pair(ide.trackID , ide.position));
1232 trueMomBeg.push_back(std::make_pair(ide.trackID , ide.momentum));
1236 for(
auto const& ide : hitIdesEnd) {
1237 truePosEnd.push_back(std::make_pair(ide.trackID , ide.position));
1238 trueMomEnd.push_back(std::make_pair(ide.trackID , ide.momentum));
1243 for(
auto const& mcpfrac : trkmcps) {
1244 trueEnergy.push_back(std::make_pair(mcpfrac.first->TrackId(),etot*mcpfrac.second));
1248 trackIDs.push_back(track.getIDNumber());
1249 fTracks.push_back(
MakeAnaTrack(track, pidF, pidB, avgIonF, avgIonB,truePosBeg,truePosEnd,trueMomBeg,
1250 trueMomEnd, trueEnergy) );
1258 for (
auto const&
vertex : *VertexHandle ) {
1265 int nVertexedTracks = 0;
1266 if ( findManyTrackEnd->isValid() ) {
1267 nVertexedTracks = findManyTrackEnd->at(iVertex).size();
1272 for (
int iVertexedTrack=0; iVertexedTrack<nVertexedTracks; ++iVertexedTrack) {
1275 rec::Track track = *(findManyTrackEnd->at(iVertex).at(iVertexedTrack));
1276 rec::TrackEnd fee = *(findManyTrackEnd->data(iVertex).at(iVertexedTrack));
1279 for(
size_t itrk=0; itrk<
fTracks.size(); itrk++){
1301 for (
auto const& vee : *VeeHandle ) {
1308 if ( findManyVeeTrackEnd->isValid() ) {
1309 nVeeTracks = findManyVeeTrackEnd->at(iVee).size();
1312 for (
int iVeeTrack=0; iVeeTrack<nVeeTracks; ++iVeeTrack) {
1315 rec::Track track = *(findManyVeeTrackEnd->at(iVee).at(iVeeTrack));
1316 rec::TrackEnd fee = *(findManyVeeTrackEnd->data(iVee).at(iVeeTrack));
1319 for(
size_t itrk=0; itrk<
fTracks.size(); itrk++){
1332 size_t iCluster = 0;
1334 for (
auto cluster : *CalClusterHandle ) {
1337 vector<std::pair<int,float>> edeps;
1343 for(
auto const&
hit : hits) {
1346 if(ides.size()==0) n0ide++;
1347 for(
auto const& ide : ides) {
1349 std::pair<int,float> trkdep = std::make_pair(ide.trackID,ide.energyTot);
1350 if(std::find(edeps.begin(),edeps.end(),trkdep) == edeps.end()) {
1351 edeps.push_back(trkdep);
1354 (*(std::find(edeps.begin(),edeps.end(),trkdep))).
second+=trkdep.second;
1361 if(hits.size()!=0 && n0ide>0)
mf::LogDebug(
"FillHighLevelReco")
1362 <<
" hits with no IDEs: " << n0ide <<
" of " << hits.size()
1363 <<
" hits affected (" << 100.0*(hits.size()-n0ide)/hits.size()
1366 if(edeps.size()==0) {
1367 mf::LogDebug(
"FillHighLevelReco") <<
"have a cluster, but edeps is empty!";
1368 edeps.push_back({-1,-1});
1379 if ( findManyCalTrackEnd->isValid() ) {
1380 nMatch = findManyCalTrackEnd->at(iCluster).size();
1382 for (
size_t itrk=0; itrk<nMatch; itrk++) {
1383 rec::Track track = *(findManyCalTrackEnd->at(iCluster).at(itrk));
1387 for(
size_t imatch=0; imatch<
fTracks.size(); imatch++){
1402 for(
size_t imcp=0; imcp<clustToMCPs.size(); imcp++) {
1460 if(volName.find(
"1")!=std::string::npos)
1462 else if(volName.find(
"2")!=std::string::npos)
1465 region =
"GArInactive";
1471 else if ( volName ==
"volCryostat" )
1472 region =
"Cryostat";
1474 else if ( volName ==
"volEndcapCryostat" )
1475 region =
"EndcapCryostat";
1477 else if ( volName ==
"volYokeBarrel" )
1478 region =
"YokeBarrel";
1480 else if ( volName ==
"volYokeEndcap" )
1481 region =
"YokeEndcap";
1489 float& forwardIonVal,
float& backwardIonVal) {
1493 std::vector<std::pair<float,float>> SigData = ion.
getFWD_dSigdXs();
1505 float ionizeTruncate) {
1507 std::vector<std::pair<float,float>> dEvsX;
1515 if (SigData.size()==0)
return 0.0;
1516 float distAlongTrack = 0;
1517 std::vector<std::pair<float,float>>
::iterator littlebit = SigData.begin();
1518 for (; littlebit<(SigData.end()-1); ++littlebit) {
1519 float dE = std::get<0>(*littlebit);
1522 float dX = std::get<1>(*littlebit);
1523 distAlongTrack += dX;
1525 dX += std::get<1>(*(littlebit+1));
1526 float dEdX = dE/(0.5*dX);
1528 std::pair pushme = std::make_pair(dEdX,distAlongTrack);
1529 dEvsX.push_back( pushme );
1536 int goUpTo = ionizeTruncate * dEvsX.size() +0.5;
1537 if (goUpTo > (
int)dEvsX.size()) goUpTo = dEvsX.size();
1538 int i = 1;
float returnvalue = 0;
1539 littlebit = dEvsX.begin();
1540 for (; littlebit<dEvsX.end(); ++littlebit) {
1541 returnvalue += std::get<0>(*littlebit);
1543 if (i>goUpTo)
break;
1545 returnvalue /= goUpTo;
1554 vector<string> recopnamelist = {
"#pi",
"#mu",
"p",
"K",
"d",
"e"};
1555 vector<int> pdg_charged = {211, 13, 2212, 321, 1000010020, 11};
1556 vector< pair<int, float> >
pid;
1560 float dist = 100000000.;
1561 CLHEP::RandFlat FlatRand(
fEngine);
1563 for (
int q = 0; q < 501; ++q)
1567 unsigned first = fulltitle.find(
"=");
1568 unsigned last = fulltitle.find(
"GeV");
1569 string substr = fulltitle.substr(first+1, last - first-1);
1570 float pidinterp_mom = std::atof(substr.c_str());
1572 float disttemp =
std::abs(pidinterp_mom - p);
1574 if( disttemp < dist ){
1582 for (
int pidm = 0; pidm < 6; ++pidm)
1585 vector< pair<float, string> > v_prob;
1588 for (
int pidr = 0; pidr < 6; ++pidr)
1590 string recoparticlename =
m_pidinterp[qclosest]->GetYaxis()->GetBinLabel(pidr+1);
1591 float prob =
m_pidinterp[qclosest]->GetBinContent(pidm+1, pidr+1);
1593 v_prob.push_back( std::make_pair(prob, recoparticlename) );
1597 if(v_prob.size() > 1)
1600 std::sort(v_prob.begin(), v_prob.end());
1602 float random_number = FlatRand.fire();
1604 std::partial_sum(v_prob.begin(), v_prob.end(), v_prob.begin(), [](
const P& _x,
const P& _y){
return P(_x.first + _y.first, _y.second);});
1606 for(
size_t ivec = 0; ivec < v_prob.size()-1; ivec++)
1608 if( random_number < v_prob.at(ivec+1).first && random_number >= v_prob.at(ivec).first )
1610 pid.push_back( std::make_pair(pdg_charged.at(
std::distance( recopnamelist.begin(), std::find(recopnamelist.begin(), recopnamelist.end(), v_prob.at(ivec+1).second) ) ), v_prob.at(ivec+1).first) );
1616 pid.push_back( std::make_pair(pdg_charged.at(
std::distance( recopnamelist.begin(), std::find(recopnamelist.begin(), recopnamelist.end(), v_prob.at(0).second) ) ), v_prob.at(0).first) );
vector< vector< sdp::CaloDeposit > > fSimCalHits
base_engine_t & createEngine(seed_t seed)
std::vector< CalIDE > CaloHitToCalIDEs(art::Ptr< rec::CaloHit > const &hit) const
string fVeeLabel
module label for conversion/decay vertexes rec:Vee
StructuredTree & operator=(StructuredTree const &)=delete
vector< vector< UInt_t > > fVeeTrackIndices
index of fTracks associated with fVees
void FillDetTree(Event const &e)
extracts readout sim products
string fCaloHitLabel
module label for reco calo hits rec::CaloHit
std::vector< art::Ptr< rec::Hit > > const TrackToHits(rec::Track *const t)
art::Ptr< simb::MCTruth > const ParticleToMCTruth(simb::MCParticle *const p) const
string fECALAssnLabel
module label for track-clusters associations
string fGeantLabel
module label for geant4 simulated hits
Handle< PROD > getHandle(SelectorBase const &) const
bool PointInECALEndcap(TVector3 const &point) const
vector< const simb::MCTruth * > fMCTruths
virtual void beginJob() override
bool PointInGArTPC(TVector3 const &point) const
garana::FSParticle MakeFSParticle(const simb::MCParticle &mcp)
bool PointInMPD(TVector3 const &point) const
std::unordered_map< int, TH2F * > m_pidinterp
virtual void endRun(art::Run const &run) override
void ClearVectors()
clear all vectors and reset counters
void FillRecoInfo(Event const &e)
extracts base level reco products
const std::string instance
float TPCXCent() const
Returns the X location of the center of the TPC in cm.
std::pair< float, std::string > P
string fMuDigitInstance
Instance name MuID for raw::CaloRawDigit.
Description of geometry of one entire detector.
vector< vector< UInt_t > > fVertTrackIndices
index of fTracks associated with fVertices
string fClusterLabel
module label for calo clusters rec::Cluster
Int_t fRun
number of the run being processed
string fGeantInstanceMuID
Instance name MuID for sdp::CaloDeposit.
vector< vector< Int_t > > fVertTrackEnds
which fTrack end belongs to this vertex
Cluster finding and building.
EDAnalyzer(fhicl::ParameterSet const &pset)
vector< vector< sdp::CaloDeposit > > fSimMuHits
string fCalDigitInstance
Instance name ECAL for raw::CaloRawDigit.
vector< rec::CaloHit > fMuHits
vector< vector< Int_t > > fVeeTrackEnds
track end associated with fVees
vector< vector< sdp::EnergyDeposit > > fSimTPCHits
several "hits" per MCParticle
garana::Vee MakeAnaVee(const rec::Vee &vee)
vector< raw::CaloRawDigit > fCaloDigits
double dEdX(double KE, const simb::MCParticle *part)
double const & TotalPOT() const
garana::CaloCluster MakeAnaCalCluster(const rec::Cluster &clust, const int ®ion, const std::vector< std::pair< int, float >> &edeps)
vector< rec::CaloHit > fCalHits
string fVertexLabel
module label for vertexes rec:Vertex
std::vector< std::pair< simb::MCParticle *, float > > ClusterToMCParticles(rec::Cluster *const c)
string fTPCClusterLabel
module label for TPC Clusters rec::TPCCluster
vector< vector< garana::FSParticle > > fFSParticles
FS particles/4-vecs.
CLHEP::HepRandomEngine & fEngine
random engine
int PdgCode(Resonance_t res, int Q)
(resonance id, charge) -> PDG code
#define DEFINE_ART_MODULE(klass)
Int_t fEvent
number of the event being processed
float TPCRadius() const
Returns the radius of the TPC (y or z direction)
vector< raw::CaloRawDigit > fMuDigits
vector< garana::Vertex > fVertices
reco TPC vertices
garana::Vertex MakeAnaVtx(const rec::Vertex &vtx)
Int_t fSubRun
number of the sub-run being processed
std::string GDMLFile() const
Returns the full directory path to the GDML file source.
vector< vector< UInt_t > > fCalG4PIndices
index of fG4Particles associated with fCalClusters
garana::G4Particle MakeG4Particle(const simb::MCParticle &mcp, int parentPdg, int progenitorPdg, int progenitorTrackId, const vector< pair< TLorentzVector, TLorentzVector >> &positions, const vector< pair< TLorentzVector, TLorentzVector >> &momenta, const vector< int > ®ions, const vector< size_t > &nptsPerRegion)
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const
T get(std::string const &key) const
simb::MCParticle * FindMother(simb::MCParticle *const p) const
vector< garana::CaloCluster > fCalClusters
reco ECal clusters
constexpr std::array< std::size_t, geo::vect::dimension< Vector >)> indices()
Returns a sequence of indices valid for a vector of the specified type.
void FillG4Tree(Event const &e)
extracts G4(truth) level sim products
TLorentzVector fTpcCenter
void processIonizationInfo(rec::TrackIoniz &ion, float ionizeTruncate, float &forwardIonVal, float &backwardIonVal)
vector< const simb::MCParticle * > fMCParticles
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
string fTPCDigitLabel
module label for digitized TPC hits raw::RawDigit
bool fWriteDisplay
include sim/reco traj points for event display, default=false
float TPCZCent() const
Returns the Z location of the center of the TPC in cm.
SubRunNumber_t subRun() const
vector< rec::Hit > fTPCHits
bool PointInECALBarrel(TVector3 const &point) const
std::vector< HitIDE > HitToHitIDEs(art::Ptr< rec::Hit > const &hit) const
Definition of basic calo raw digits.
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
#define MF_LOG_INFO(category)
vector< vector< UInt_t > > fCalTrackIndices
index of fTracks associated with fCalClusters
vector< garana::CaloCluster > fMuClusters
reco MuID clusters
simb::MCParticle * FindEve(simb::MCParticle *const p) const
vector< raw::RawDigit > fTPCDigits
vector< garana::Vee > fVees
reco Vees (reco 4-mom, 4-pos from decay vertex)
Detector simulation of raw signals on wires.
const geo::GeometryCore * fGeo
pointer to the geometry service
vector< Int_t > fGIndex
index of GTruth object associated with MCTruth in this row (-1 if not associated, e...
double TrackToTotalEnergy(rec::Track *const t)
vector< garana::G4Particle > fG4Particles
'condensed' MCParticles from G4
General GArSoft Utilities.
vector< UInt_t > fG4TruthIndex
index of GTruth objects matched to this particle
vector< garana::Track > fTracks
reco TPC tracks
string fCaloHitInstanceMuID
Instance name MuID for rec::CaloHit.
garana::GTruth MakeAnaGTruth(const simb::GTruth >, const int &vtxregion)
void analyze(Event const &e) override
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
vector< garana::GTruth > fGTruth
GENIE interction-level info.
vector< UInt_t > fG4FSIndex
index of FSParticle objects matched to this particle
float TPCYCent() const
Returns the Y location of the center of the TPC in cm.
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
float fIonizTruncate
Default=1.00;.
std::vector< std::pair< simb::MCParticle *, float > > TrackToMCParticles(rec::Track *const t)
bool HasMuonDetector() const
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
vector< rec::TPCCluster > fTPCClusters
reco TPC clusters
std::map< std::string, int > fRegionNameToID
string fHitLabel
module label for reco TPC hits rec::Hit
EventNumber_t event() const
void FillGenTree(Event const &e)
extracts generator(truth) level sim products
float TPCLength() const
Returns the length of the TPC (x direction)
cheat::BackTrackerCore * fBt
const std::string VolumeName(TVector3 const &point) const
Returns the name of the deepest volume containing specified point.
gar::rec::IDNumber getIDNumber() const
string fAnaMode
analysis configs: (gen)eral, (reco) R&D or (readout) sim R&D, default="gen"
vector< vector< Int_t > > fCalTrackEnds
Track end associated with the cluster.
const std::vector< std::pair< float, float > > getBAK_dSigdXs() const
std::string PointToRegion(const TVector3 &point)
string fTrackLabel
module label for TPC Tracks rec:Track
std::vector< art::Ptr< rec::CaloHit > > const ClusterToCaloHits(rec::Cluster *const c)
second_as<> second
Type of time stored in seconds, in double precision.
const std::vector< std::pair< float, float > > getFWD_dSigdXs() const
art framework interface to geometry description
unsigned int const & TotalSpills() const
vector< vector< UInt_t > > fTrackG4PIndices
index of fG4Particles associated with fTracks
static bool lessThan_byE(std::pair< float, float > a, std::pair< float, float > b)
string fCaloHitInstanceCalo
Instance name ECAL for rec::CaloHit.
virtual void endJob() override
const garana::Track MakeAnaTrack(const rec::Track &trk, const vector< pair< int, float >> &pidf, const vector< pair< int, float >> &pidb, float ionf, float ionb, const vector< pair< UInt_t, TLorentzVector >> &posBeg, const vector< pair< UInt_t, TLorentzVector >> &posEnd, const vector< pair< UInt_t, TLorentzVector >> &momBeg, const vector< pair< UInt_t, TLorentzVector >> &momEnd, const vector< pair< int, float >> &edeps)
string fCalDigitLabel
module label for digitized calo/muID hits raw::CaloRawDigit
string fTreeType
"structured" (in our case yes) or "flat" (no)
cet::coded_exception< error, detail::translate > exception
QTextStream & endl(QTextStream &s)
QCString & append(const char *s)
string fGeantInstanceCalo
Instance name ECAL for sdp::CaloDeposit.
string fPFLabel
module label for reco particles rec::PFParticle
void FillHighLevelRecoInfo(Event const &e)
extracts high level reco products
float processOneDirection(vector< pair< float, float >> SigData, float ionizeTruncate)
vector< rec::TrackTrajectory > fRecoDisplay
reconstructed track trajectory points
StructuredTree(fhicl::ParameterSet const &p)
vector< pair< int, float > > processPIDInfo(float p)