Public Member Functions | Private Member Functions | Private Attributes | List of all members
protoana::ProtoDUNEPizeroAnaTree Class Reference
Inheritance diagram for protoana::ProtoDUNEPizeroAnaTree:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 ProtoDUNEPizeroAnaTree (fhicl::ParameterSet const &p)
 
 ProtoDUNEPizeroAnaTree (ProtoDUNEPizeroAnaTree const &)=delete
 
 ProtoDUNEPizeroAnaTree (ProtoDUNEPizeroAnaTree &&)=delete
 
ProtoDUNEPizeroAnaTreeoperator= (ProtoDUNEPizeroAnaTree const &)=delete
 
ProtoDUNEPizeroAnaTreeoperator= (ProtoDUNEPizeroAnaTree &&)=delete
 
virtual void beginJob () override
 
virtual void endJob () override
 
void analyze (art::Event const &evt) override
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Member Functions

void Initialise ()
 
void ResetPi0Vars ()
 
void FillPrimaryPFParticle (art::Event const &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const recob::PFParticle *particle)
 
void FillAPA3Object (art::Event const &evt, art::Handle< std::vector< recob::PFParticle >> pfpHandle)
 
void setPiZeroInfo (art::Event const &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::vector< const simb::MCParticle * > &pi0s)
 

Private Attributes

protoana::ProtoDUNEDataUtils dataUtil
 
protoana::ProtoDUNEPFParticleUtils pfpUtil
 
protoana::ProtoDUNETrackUtils trackUtil
 
protoana::ProtoDUNETruthUtils truthUtil
 
protoana::ProtoDUNEShowerUtils showerUtil
 
protoana::ProtoDUNEBeamlineUtils beamlineUtil
 
art::ServiceHandle< cheat::BackTrackerServicebt_serv
 
const art::InputTag fBeamModuleLabel
 
std::string fSimulationTag
 
std::string fCalorimetryTag
 
calo::CalorimetryAlg fCalorimetryAlg
 
std::string fParticleIDTag
 
std::string fTrackTag
 
std::string fShowerTag
 
std::string fShowerCaloTag
 
std::string fPFParticleTag
 
std::string fGeneratorTag
 
std::string fHitTag
 
int fVerbose
 
TTree * fPandoraBeam
 
int fRun
 
int fSubRun
 
int fevent
 
double fTimeStamp
 
int fNactivefembs [6]
 
int fbeamtrigger
 
int fbeamCheckIsMatched
 
double ftof
 
int fcerenkovStatus [2]
 
double fcerenkovTime [2]
 
double fcerenkovPressure [2]
 
double fbeamtrackMomentum
 
double fbeamtrackEnergy
 
double fbeamtrackPos [3]
 
double fbeamtrackEndPos [3]
 
double fbeamtrackDir [3]
 
double fbeamtrackTime
 
int fbeam_ntrjPoints
 
int fbeamtrackPdg
 
int fbeamtrackID
 
double fbeamtrackPos_at [1000][3]
 
double fbeamtrackMom_at [1000][4]
 
std::vector< std::stringfbeamtrackEndProcess
 
int fbeamtrackNDaughters
 
double fprimaryVertex [3]
 
int fprimaryIstrack
 
int fprimaryIsshower
 
double fprimaryBDTScore
 
double fprimaryCNNScore
 
int fprimaryNHits
 
double fprimaryTheta
 
double fprimaryPhi
 
double fprimaryLength
 
double fprimaryMomentum
 
double fprimaryEndMomentum
 
double fprimaryEndPosition [3]
 
double fprimaryStartPosition [3]
 
double fprimaryEndDirection [3]
 
double fprimaryStartDirection [3]
 
double fprimaryOpeningAngle
 
int fprimaryShowerBestPlane
 
double fprimaryShowerEnergy
 
double fprimaryShowerCharge
 
double fprimaryShowerMIPEnergy
 
double fprimaryMomentumByRangeProton
 
int fprimaryIsBeamparticle
 
int fprimaryTruth_trkID
 
int fprimaryTruth_pdg
 
double fprimaryTruth_E
 
double fprimaryTruth_vtx [3]
 
double fprimaryKineticEnergy [3]
 
double fprimaryRange [3]
 
int fprimarynCal
 
double fprimarydEdx [NMAXHITS]
 
double fprimarydQdx [NMAXHITS]
 
double fprimary_cal_pos [NMAXHITS][3]
 
double fprimary_cal_pitch [NMAXHITS]
 
double fprimaryResidualRange [NMAXHITS]
 
int fprimaryShower_nHits
 
int fprimaryShower_hit_w [NMAXHITS]
 
double fprimaryShower_hit_q [NMAXHITS]
 
double fprimaryShower_hit_t [NMAXHITS]
 
double fprimaryShower_hit_pos [NMAXHITS][3]
 
int fprimaryID
 
double fprimaryT0
 
int fprimaryNDaughters
 
int fprimaryDaughterID [NMAXDAUGHTERS]
 
int fprimaryDaughterIstrack [NMAXDAUGHTERS]
 
int fprimaryDaughterIsshower [NMAXDAUGHTERS]
 
double fprimaryDaughterBDTScore [NMAXDAUGHTERS]
 
double fprimaryDaughterCNNScore [NMAXDAUGHTERS]
 
int fprimaryDaughterNCollHits [NMAXDAUGHTERS]
 
int fprimaryDaughterNHits [NMAXDAUGHTERS]
 
double fprimaryDaughterEnergy [NMAXDAUGHTERS]
 
double fprimaryDaughterEnergyFromHits [NMAXDAUGHTERS]
 
double fprimaryDaughterMomentum [NMAXDAUGHTERS]
 
double fprimaryDaughterEndMomentum [NMAXDAUGHTERS]
 
double fprimaryDaughterLength [NMAXDAUGHTERS]
 
double fprimaryDaughterStartPosition [NMAXDAUGHTERS][3]
 
double fprimaryDaughterEndPosition [NMAXDAUGHTERS][3]
 
double fprimaryDaughterStartDirection [NMAXDAUGHTERS][3]
 
double fprimaryDaughterEndDirection [NMAXDAUGHTERS][3]
 
int fprimaryDaughterParentPdg [NMAXDAUGHTERS]
 
int fprimaryDaughterGrandparentPdg [NMAXDAUGHTERS]
 
int fprimaryDaughterParentID [NMAXDAUGHTERS]
 
int fprimaryDaughterGrandparentID [NMAXDAUGHTERS]
 
double fprimaryDaughterParentE [NMAXDAUGHTERS]
 
double fprimaryDaughterGrandparentE [NMAXDAUGHTERS]
 
double fprimaryDaughterParentStart [NMAXDAUGHTERS][3]
 
double fprimaryDaughterGrandparentStart [NMAXDAUGHTERS][3]
 
double fprimaryDaughterParentEnd [NMAXDAUGHTERS][3]
 
double fprimaryDaughterGrandparentEnd [NMAXDAUGHTERS][3]
 
int fprimaryDaughterParentEndProcess [NMAXDAUGHTERS]
 
double fprimaryDaughterCaloHitdQdx [NMAXDAUGHTERS][NMAXHITS]
 
double fprimaryDaughterCaloHitPitch [NMAXDAUGHTERS][NMAXHITS]
 
double fprimaryDaughterOwnHitPitch [NMAXDAUGHTERS][NMAXHITS]
 
double fprimaryDaughterHitCharge [NMAXDAUGHTERS][NMAXHITS]
 
int fprimaryDaughterHitWire [NMAXDAUGHTERS][NMAXHITS]
 
double fprimaryDaughterHitTime [NMAXDAUGHTERS][NMAXHITS]
 
double fprimaryDaughterHitPosition [NMAXDAUGHTERS][NMAXHITS][3]
 
int fMCPi0ID [NMAXPIZEROS]
 
double fMCPi0Energy [NMAXPIZEROS]
 
double fMCPi0StartPosition [NMAXPIZEROS][3]
 
double fMCPi0EndPosition [NMAXPIZEROS][3]
 
int fMCPhoton1ID [NMAXPIZEROS]
 
int fMCPhoton2ID [NMAXPIZEROS]
 
double fMCPhoton1Energy [NMAXPIZEROS]
 
double fMCPhoton2Energy [NMAXPIZEROS]
 
double fMCPhoton1StartPosition [NMAXPIZEROS][3]
 
double fMCPhoton2StartPosition [NMAXPIZEROS][3]
 
double fMCPhoton1EndPosition [NMAXPIZEROS][3]
 
double fMCPhoton2EndPosition [NMAXPIZEROS][3]
 
int fMCPhoton1NumHits [NMAXPIZEROS]
 
int fMCPhoton2NumHits [NMAXPIZEROS]
 
int fMCPhoton1_hit_w [NMAXPIZEROS][NMAXHITS]
 
int fMCPhoton2_hit_w [NMAXPIZEROS][NMAXHITS]
 
double fMCPhoton1_hit_t [NMAXPIZEROS][NMAXHITS]
 
double fMCPhoton2_hit_t [NMAXPIZEROS][NMAXHITS]
 
double fMCPhoton1_hit_q [NMAXPIZEROS][NMAXHITS]
 
double fMCPhoton2_hit_q [NMAXPIZEROS][NMAXHITS]
 
double fMCPhoton1_hit_pos [NMAXPIZEROS][NMAXHITS][3]
 
double fMCPhoton2_hit_pos [NMAXPIZEROS][NMAXHITS][3]
 
int fShower1ID [NMAXPIZEROS]
 
int fShower2ID [NMAXPIZEROS]
 
double fShower1StartPosition [NMAXPIZEROS][3]
 
double fShower2StartPosition [NMAXPIZEROS][3]
 
double fShower1Direction [NMAXPIZEROS][3]
 
double fShower2Direction [NMAXPIZEROS][3]
 
double fShower1Length [NMAXPIZEROS]
 
double fShower2Length [NMAXPIZEROS]
 
double fShower1Completeness [NMAXPIZEROS]
 
double fShower2Completeness [NMAXPIZEROS]
 
double fShower1Purity [NMAXPIZEROS]
 
double fShower2Purity [NMAXPIZEROS]
 
int fShower1NumHits [NMAXPIZEROS]
 
double fShower1_cnn_sc [NMAXPIZEROS][NMAXHITS]
 
double fShower2_cnn_sc [NMAXPIZEROS][NMAXHITS]
 
int fShower2NumHits [NMAXPIZEROS]
 
double fShower1_cal_pos [NMAXPIZEROS][NMAXHITS][3]
 
double fShower2_cal_pos [NMAXPIZEROS][NMAXHITS][3]
 
double fShower1_cal_E [NMAXPIZEROS]
 
double fShower2_cal_E [NMAXPIZEROS]
 
double fShower1Energy [NMAXPIZEROS]
 
double fShower2Energy [NMAXPIZEROS]
 
double fShower1EnergyFromHits [NMAXPIZEROS]
 
double fShower2EnergyFromHits [NMAXPIZEROS]
 
int fShower1HasBeamParent [NMAXPIZEROS]
 
int fShower2HasBeamParent [NMAXPIZEROS]
 
int fShower1HasBeamGrandparent [NMAXPIZEROS]
 
int fShower2HasBeamGrandparent [NMAXPIZEROS]
 
double fShower1_cal_pitch [NMAXPIZEROS][NMAXHITS]
 
double fShower2_cal_pitch [NMAXPIZEROS][NMAXHITS]
 
double fShower1_cal_dEdx [NMAXPIZEROS][NMAXHITS]
 
double fShower2_cal_dEdx [NMAXPIZEROS][NMAXHITS]
 
double fShower1_cal_dQdx [NMAXPIZEROS][NMAXHITS]
 
double fShower2_cal_dQdx [NMAXPIZEROS][NMAXHITS]
 
geo::GeometryCore const * fGeometryService
 
spacecharge::SpaceChargeService::provider_type const * fSCEService
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 92 of file ProtoDUNEPizeroAnaTree_module.cc.

Constructor & Destructor Documentation

protoana::ProtoDUNEPizeroAnaTree::ProtoDUNEPizeroAnaTree ( fhicl::ParameterSet const &  p)
explicit

Definition at line 357 of file ProtoDUNEPizeroAnaTree_module.cc.

358  :
359  EDAnalyzer(p),
360  dataUtil(p.get<fhicl::ParameterSet>("DataUtils")),
361  beamlineUtil(p.get<fhicl::ParameterSet>("BeamLineUtils")),
362  fBeamModuleLabel(p.get< art::InputTag >("BeamModuleLabel")),
363  fSimulationTag(p.get<std::string>("SimulationTag")),
364  fCalorimetryTag(p.get<std::string>("CalorimetryTag")),
365  fCalorimetryAlg(p.get<fhicl::ParameterSet>("CalorimetryAlg")),
366  fParticleIDTag(p.get<std::string>("ParticleIDTag")),
367  fTrackTag(p.get<std::string>("TrackTag")),
368  fShowerTag(p.get<std::string>("ShowerTag")),
369  fShowerCaloTag(p.get<std::string>("ShowerCalorimetryTag")),
370  fPFParticleTag(p.get<std::string>("PFParticleTag")),
371  fGeneratorTag(p.get<std::string>("GeneratorTag")),
372  fHitTag(p.get<std::string>("HitTag")),
373  fVerbose(p.get<int>("Verbose")) {
374  // Get a pointer to the geometry service provider.
375  fGeometryService = lar::providerFrom<geo::Geometry>();
376  fSCEService = lar::providerFrom<spacecharge::SpaceChargeService>();
377 }
std::string string
Definition: nybbler.cc:12
spacecharge::SpaceChargeService::provider_type const * fSCEService
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
p
Definition: test.py:223
protoana::ProtoDUNEBeamlineUtils beamlineUtil
protoana::ProtoDUNEPizeroAnaTree::ProtoDUNEPizeroAnaTree ( ProtoDUNEPizeroAnaTree const &  )
delete
protoana::ProtoDUNEPizeroAnaTree::ProtoDUNEPizeroAnaTree ( ProtoDUNEPizeroAnaTree &&  )
delete

Member Function Documentation

void protoana::ProtoDUNEPizeroAnaTree::analyze ( art::Event const &  evt)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 576 of file ProtoDUNEPizeroAnaTree_module.cc.

576  {
577  // Initialise tree parameters
578  Initialise();
579  fRun = evt.run();
580  fSubRun = evt.subRun();
581  fevent = evt.id().event();
582  art::Timestamp ts = evt.time();
583  if (ts.timeHigh() == 0){
584  TTimeStamp ts2(ts.timeLow());
585  fTimeStamp = ts2.AsDouble();
586  }
587  else{
588  TTimeStamp ts2(ts.timeHigh(), ts.timeLow());
589  fTimeStamp = ts2.AsDouble();
590  }
591 
592  // Get number of active fembs
593  if(!evt.isRealData()){
594  for(int k=0; k < 6; k++)
595  fNactivefembs[k] = 20;
596  }
597  else{
598  for(int k=0; k < 6; k++)
600  }
601 
602  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService>()->DataFor(evt);
603  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService>()->DataFor(evt, clockData);
604 
605  //check for reco pandora stuff
606  auto recoParticleHandle = evt.getHandle<std::vector<recob::PFParticle>>(fPFParticleTag);
607  if( !recoParticleHandle ) return;
608 
609  // Get all of the PFParticles, by default from the "pandora" product
610  // auto recoParticles = evt.getValidHandle<std::vector<recob::PFParticle>>(fPFParticleTag);
611 
612  // We'd like to find the beam particle. Pandora tries to do this for us, so let's use the PFParticle utility
613  // to look for it. Pandora reconstructs slices containing one (or sometimes more) primary PFParticles. These
614  // are tagged as either beam or cosmic for ProtoDUNE. This function automatically considers only those
615  // PFParticles considered as primary
616  std::vector<const recob::PFParticle*> pfParticles = pfpUtil.GetPFParticlesFromBeamSlice(evt,fPFParticleTag);
617  for(const recob::PFParticle* particle : pfParticles){
618 
619  FillPrimaryPFParticle(evt, clockData, detProp, particle);
620  const TVector3 vtx = pfpUtil.GetPFParticleVertex(*particle,evt,fPFParticleTag,fTrackTag);
621  // std::cout << "Primary PFParticle ID: " << particle->Self() << '\n';
622 
623  fprimaryVertex[0] = vtx.X(); fprimaryVertex[1] = vtx.Y(); fprimaryVertex[2] = vtx.Z();
624  const TVector3 interactionVtx = pfpUtil.GetPFParticleSecondaryVertex(*particle,evt,fPFParticleTag,fTrackTag);
625 
626  // For now only consider the first primary track. Need a proper treatment if more than one primary particles are found.
627  break;
628  }
629 
630  // // Look at all the reconstructed particles that are fully contained in APA3.
631  // FillAPA3Object(evt, recoParticleHandle);
632 
633  bool beamTriggerEvent = false;
634  if(!evt.isRealData()){
635  // Firstly we need to get the list of MCTruth objects from the generator. The standard protoDUNE
636  auto mcTruths = evt.getValidHandle<std::vector<simb::MCTruth>>(fGeneratorTag);
637  // Define and fill a handle to point to a vector of the MCParticles
638  auto MCParticleHandle = evt.getHandle<std::vector<simb::MCParticle>>(fSimulationTag);
639  if (!MCParticleHandle) {
640  // Handle no simb::MCParticles.
641  throw cet::exception("ProtoDUNEPizeroAnaTree")
642  << " No simb::MCParticle objects in this event - "
643  << " Line " << __LINE__ << " in file " << __FILE__ << std::endl;
644  }
645  std::map<int, const simb::MCParticle*> MCPmap;
646  for(const simb::MCParticle& mcp : *MCParticleHandle) {
647  MCPmap[mcp.TrackId()] = &mcp;
648  }
649 
650  // Also get the reconstructed beam information in the MC - TO DO
651  const simb::MCParticle* geantGoodParticle = truthUtil.GetGeantGoodParticle((*mcTruths)[0],evt);
653  if(geantGoodParticle != 0x0){
654  beamTriggerEvent = true;
655  fbeamtrigger = 12;
656  fbeamtrackPos[0] = geantGoodParticle->Vx();
657  fbeamtrackPos[1] = geantGoodParticle->Vy();
658  fbeamtrackPos[2] = geantGoodParticle->Vz();
659  fbeamtrackEndPos[0]= geantGoodParticle->EndX();
660  fbeamtrackEndPos[1]= geantGoodParticle->EndY();
661  fbeamtrackEndPos[2]= geantGoodParticle->EndZ();
662  fbeamtrackMomentum = geantGoodParticle->P();
663  fbeamtrackEnergy = geantGoodParticle->E();
664  fbeamtrackPdg = geantGoodParticle->PdgCode();
665  fbeamtrackTime = geantGoodParticle->T();
666  fbeamtrackID = geantGoodParticle->TrackId();
667  fbeamtrackEndProcess.push_back(geantGoodParticle->EndProcess());
668  fbeam_ntrjPoints = std::min(geantGoodParticle->NumberTrajectoryPoints(), (unsigned)1000);
669  fbeamtrackNDaughters = geantGoodParticle->NumberDaughters();
670  for( size_t i=0; i<geantGoodParticle->NumberTrajectoryPoints() && i<1000; ++i){
671  fbeamtrackPos_at[i][0] = geantGoodParticle->Position(i).X();
672  fbeamtrackPos_at[i][1] = geantGoodParticle->Position(i).Y();
673  fbeamtrackPos_at[i][2] = geantGoodParticle->Position(i).Z();
674  fbeamtrackMom_at[i][0] = geantGoodParticle->Momentum(i).Px();
675  fbeamtrackMom_at[i][1] = geantGoodParticle->Momentum(i).Py();
676  fbeamtrackMom_at[i][2] = geantGoodParticle->Momentum(i).Pz();
677  fbeamtrackMom_at[i][3] = geantGoodParticle->Momentum(i).E();
678  }
679 
680  std::cout << "Primary beam particle PDG code: " << fbeamtrackPdg << " and E: "
681  << fbeamtrackEnergy << '\n';
682 
683  std::vector<const simb::MCParticle*> pi0s;
684 
685  // Search for daughter pi0s if the primary particle is a pion.
686  if(abs(fbeamtrackPdg) == 211) {
687  std::cout << "Found a pion! (ID " << fbeamtrackID << ", PDG "
688  << fbeamtrackPdg << ")\n";
689 
690  std::cout << "Pion has pi0 daughters:\n";
691  std::vector<const simb::MCParticle*> daughters;
692  daughters.push_back(geantGoodParticle);
693  while(daughters.size()) {
694  const simb::MCParticle* parent = daughters[0];
695  for(int di = 0; di < parent->NumberDaughters(); ++di) {
696  const int daughter_ID = parent->Daughter(di);
697  const simb::MCParticle* daughter = MCPmap[daughter_ID];
698  daughters.push_back(daughter);
699  if(daughter->PdgCode() == 111) {
700  std::cout << " ID " << daughter_ID << ", PDG " << daughter->PdgCode()
701  << ", P " << daughter->P() << '\n';
702  pi0s.push_back(daughter);
703  }
704  }
705  daughters.erase(daughters.begin());
706  }
707  }
708 
709  // Record MC and shower information
710  setPiZeroInfo(evt, clockData, detProp, pi0s);
711 
712  } //geantGoodParticle
713  } // MC
714  else { //data
715  // For data we can see if this event comes from a beam trigger
716  beamTriggerEvent = dataUtil.IsBeamTrigger(evt);
717  if( !beamTriggerEvent ) return;
718 
719  std::vector< art::Ptr<beam::ProtoDUNEBeamEvent> > beaminfo;
720  auto pdbeamHandle = evt.getHandle< std::vector<beam::ProtoDUNEBeamEvent> >(fBeamModuleLabel);
721  if (pdbeamHandle)
722  art::fill_ptr_vector(beaminfo, pdbeamHandle);
723  else{
724  std::cout<<"No beam information from "<<fBeamModuleLabel<<std::endl;
725  }
726 
727  if(beaminfo.size()){
729  fbeamCheckIsMatched = beaminfo[0]->CheckIsMatched();
730  fbeamtrigger = beaminfo[0]->GetTimingTrigger();
731  // if TOFChan == -1, then there was not a successful match, if it's
732  // 0, 1, 2, or 3, then there was a good match corresponding to the
733  // different pair-wise combinations of the upstream and downstream
734  // channels
735  if(beaminfo[0]->GetTOFChan() != -1){
736  ftof = beaminfo[0]->GetTOF();
737  }
738  // If possible PIDs contain pion, set PDG code to pion.
739  std::vector<int> PIDs = beamlineUtil.GetPID(evt, 6);
740  if(std::find(PIDs.begin(), PIDs.end(), 211) != PIDs.end() && fprimaryIsshower != 1) {
741  fbeamtrackPdg = 211;
742  } else if(std::find(PIDs.begin(), PIDs.end(), 2212) != PIDs.end() && fprimaryIsshower != 1) {
743  fbeamtrackPdg = 2212;
744  } else if(std::find(PIDs.begin(), PIDs.end(), 321) != PIDs.end() && fprimaryIsshower != 1) {
745  fbeamtrackPdg = 321;
746  }
747  std::cout << "Set PDG to " << fbeamtrackPdg << '\n';
748  // Get Cerenkov
749  fcerenkovStatus[0] = beaminfo[0]->GetCKov0Status();
750  fcerenkovStatus[1] = beaminfo[0]->GetCKov1Status();
751  fcerenkovTime[0] = beaminfo[0]->GetCKov0Time();
752  fcerenkovTime[1] = beaminfo[0]->GetCKov1Time();
753  fcerenkovPressure[0] = beaminfo[0]->GetCKov0Pressure();
754  fcerenkovPressure[1] = beaminfo[0]->GetCKov1Pressure();
755  auto & tracks = beaminfo[0]->GetBeamTracks();
756  if(!tracks.empty()){
757  fbeamtrackPos[0] = tracks[0].Start().X();
758  fbeamtrackPos[1] = tracks[0].Start().Y();
759  fbeamtrackPos[2] = tracks[0].Start().Z();
760  fbeamtrackEndPos[0] = tracks[0].End().X();
761  fbeamtrackEndPos[1] = tracks[0].End().Y();
762  fbeamtrackEndPos[2] = tracks[0].End().Z();
763  fbeamtrackDir[0] = tracks[0].StartDirection().X();
764  fbeamtrackDir[1] = tracks[0].StartDirection().Y();
765  fbeamtrackDir[2] = tracks[0].StartDirection().Z();
766  }
767  auto & beammom = beaminfo[0]->GetRecoBeamMomenta();
768  if(!beammom.empty()) fbeamtrackMomentum = beammom[0];
769 
770  // Record pi0s reconstructed from showers
771  // Make recob::Showers accessible
772  auto rShowerHandle = evt.getHandle<std::vector<recob::Shower>>(fShowerTag);
773  if (!rShowerHandle) {
774  // Handle no recob::Showers.
775  throw cet::exception("PiZeroExtract")
776  << " No recob::Shower objects in this event - "
777  << " Line " << __LINE__ << " in file " << __FILE__ << std::endl;
778  }
779  // // Loop through showers
780  // for(const recob::Shower& shower : *rShowerHandle) {
781  // pizero::PiZeroProcess recopzproc(shower, evt, fShowerTag);
782  // // Only record if the showers come somewhat close
783  // if(!recopzproc.allRecoSet()) continue;
784  // const double shdist = pizero::ClosestDistance(recopzproc.shower1(), recopzproc.shower2());
785  // if(shdist > 0 && shdist < 100) {
786  // setPiZeroInfo(evt, recopzproc);
787  // break;
788  // }
789  // }
790  } //good beam trigger
791  } //good beaminfo
792  }//for data
793 
794  // Fill tree if event came from beam trigger.
795  if(beamTriggerEvent) fPandoraBeam->Fill();
796 
797  // Put some space between events.
798  std::cout << "\n\n";
799 }
double E(const int i=0) const
Definition: MCParticle.h:233
unsigned int NumberTrajectoryPoints() const
Definition: MCParticle.h:218
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:219
int PdgCode() const
Definition: MCParticle.h:212
constexpr std::uint32_t timeLow() const
Definition: Timestamp.h:29
unsigned int event
Definition: DataStructs.h:636
const simb::MCParticle * GetGeantGoodParticle(const simb::MCTruth &genTruth, const art::Event &evt) const
double EndZ() const
Definition: MCParticle.h:228
unsigned int run
Definition: DataStructs.h:637
void setPiZeroInfo(art::Event const &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::vector< const simb::MCParticle * > &pi0s)
constexpr std::uint32_t timeHigh() const
Definition: Timestamp.h:34
const TVector3 GetPFParticleVertex(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string trackLabel) const
Function to find the interaction vertex of a primary PFParticle.
double EndY() const
Definition: MCParticle.h:227
int NumberDaughters() const
Definition: MCParticle.h:217
int TrackId() const
Definition: MCParticle.h:210
int Daughter(const int i) const
Definition: MCParticle.cxx:112
T abs(T value)
std::string EndProcess() const
Definition: MCParticle.h:216
double P(const int i=0) const
Definition: MCParticle.h:234
double T(const int i=0) const
Definition: MCParticle.h:224
const std::vector< const recob::PFParticle * > GetPFParticlesFromBeamSlice(art::Event const &evt, const std::string particleLabel) const
Return the pointers for the PFParticles in the beam slice. Returns an empty vector is no beam slice w...
bool IsGoodBeamlineTrigger(art::Event const &evt) const
protoana::ProtoDUNEBeamlineUtils beamlineUtil
void FillPrimaryPFParticle(art::Event const &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const recob::PFParticle *particle)
Definition: tracks.py:1
double Vx(const int i=0) const
Definition: MCParticle.h:221
std::vector< int > GetPID(beam::ProtoDUNEBeamEvent const &beamevt, double nominal_momentum)
protoana::ProtoDUNEPFParticleUtils pfpUtil
Hierarchical representation of particle flow.
Definition: PFParticle.h:44
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
int GetNActiveFembsForAPA(art::Event const &evt, int apa) const
Get number of active fembs in an APA.
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:220
double Vz(const int i=0) const
Definition: MCParticle.h:223
const TVector3 GetPFParticleSecondaryVertex(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string trackLabel) const
Function to find the secondary interaction vertex of a primary PFParticle.
unsigned int subRun
Definition: DataStructs.h:638
TCEvent evt
Definition: DataStructs.cxx:7
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
double EndX() const
Definition: MCParticle.h:226
def parent(G, child, parent_type)
Definition: graph.py:67
double Vy(const int i=0) const
Definition: MCParticle.h:222
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
QTextStream & endl(QTextStream &s)
bool IsBeamTrigger(art::Event const &evt) const
void protoana::ProtoDUNEPizeroAnaTree::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 379 of file ProtoDUNEPizeroAnaTree_module.cc.

379  {
380 
382 
383  fPandoraBeam = tfs->make<TTree>("PandoraBeam", "Beam events reconstructed with Pandora");
384  fPandoraBeam->Branch("run", &fRun, "run/I");
385  fPandoraBeam->Branch("subrun", &fSubRun, "subrun/I");
386  fPandoraBeam->Branch("event", &fevent, "event/I");
387  fPandoraBeam->Branch("timestamp", &fTimeStamp, "timestamp/D");
388  fPandoraBeam->Branch("Nactivefembs", &fNactivefembs, "Nactivefembs[5]/I");
389 
390  fPandoraBeam->Branch("beamtrigger", &fbeamtrigger, "beamtrigger/I");
391  fPandoraBeam->Branch("beamCheckIsMatched", &fbeamCheckIsMatched, "beamCheckIsMatched/I");
392  fPandoraBeam->Branch("tof", &ftof, "tof/D");
393  fPandoraBeam->Branch("cerenkovStatus", &fcerenkovStatus, "cerenkovStatus[2]/I");
394  fPandoraBeam->Branch("cerenkovTime", &fcerenkovTime, "cerenkovTime[2]/D");
395  fPandoraBeam->Branch("cerenkovPressure", &fcerenkovPressure, "cerenkovPressure[2]/D");
396  fPandoraBeam->Branch("beamtrackMomentum", &fbeamtrackMomentum, "beamtrackMomentum/D");
397  fPandoraBeam->Branch("beamtrackEnergy", &fbeamtrackEnergy, "beamtrackEnergy/D");
398  fPandoraBeam->Branch("beamtrackPos", &fbeamtrackPos, "beamtrackPos[3]/D");
399  fPandoraBeam->Branch("beamtrackEndPos", &fbeamtrackEndPos, "beamtrackEndPos[3]/D");
400  fPandoraBeam->Branch("beamtrackDir", &fbeamtrackDir, "beamtrackDir[3]/D");
401  fPandoraBeam->Branch("beamtrackTime", &fbeamtrackTime, "beamtrackTime/D");
402  fPandoraBeam->Branch("beamtrackPdg", &fbeamtrackPdg, "beamtrackPdg/I");
403  fPandoraBeam->Branch("beamtrackID", &fbeamtrackID, "beamtrackID/I");
404  fPandoraBeam->Branch("beam_ntrjPoints", &fbeam_ntrjPoints, "beam_ntrjPoints/I");
405  fPandoraBeam->Branch("beamtrackNDaughters", &fbeamtrackNDaughters, "beamtrackNDaughters/I");
406  fPandoraBeam->Branch("beamtrackPos_at", &fbeamtrackPos_at, "beamtrackPos_at[beam_ntrjPoints][3]/D");
407  fPandoraBeam->Branch("beamtrackMom_at", &fbeamtrackMom_at, "beamtrackMom_at[beam_ntrjPoints][4]/D");
408  fPandoraBeam->Branch("beamtrackEndProcess", &fbeamtrackEndProcess);
409 
410  fPandoraBeam->Branch("primaryVertex", &fprimaryVertex, "primaryVertex[3]/D");
411  fPandoraBeam->Branch("primaryIsBeamparticle", &fprimaryIsBeamparticle, "primaryIsBeamparticle/I");
412  fPandoraBeam->Branch("primaryIstrack", &fprimaryIstrack, "primaryIstrack/I");
413  fPandoraBeam->Branch("primaryIsshower", &fprimaryIsshower, "primaryIsshower/I");
414  fPandoraBeam->Branch("primaryBDTScore", &fprimaryBDTScore, "primaryBDTScore/D");
415  fPandoraBeam->Branch("primaryCNNScore", &fprimaryCNNScore, "primaryCNNScore/D");
416  fPandoraBeam->Branch("primaryNHits", &fprimaryNHits, "primaryNHits/I");
417  fPandoraBeam->Branch("primaryTheta", &fprimaryTheta, "primaryTheta/D");
418  fPandoraBeam->Branch("primaryPhi", &fprimaryPhi, "primaryPhi/D");
419  fPandoraBeam->Branch("primaryLength", &fprimaryLength, "primaryLength/D");
420  fPandoraBeam->Branch("primaryMomentum", &fprimaryMomentum, "primaryMomentum/D");
421  fPandoraBeam->Branch("primaryEndMomentum", &fprimaryEndMomentum, "primaryEndMomentum/D");
422  fPandoraBeam->Branch("primaryEndPosition", &fprimaryEndPosition, "primaryEndPosition[3]/D");
423  fPandoraBeam->Branch("primaryStartPosition", &fprimaryStartPosition, "primaryStartPosition[3]/D");
424  fPandoraBeam->Branch("primaryEndDirection", &fprimaryEndDirection, "primaryEndDirection[3]/D");
425  fPandoraBeam->Branch("primaryStartDirection", &fprimaryStartDirection, "primaryStartDirection[3]/D");
426  fPandoraBeam->Branch("primaryOpeningAngle", &fprimaryOpeningAngle, "primaryOpeningAngle/D");
427  fPandoraBeam->Branch("primaryID", &fprimaryID, "primaryID/I");
428  fPandoraBeam->Branch("primaryTruth_E", &fprimaryTruth_E, "primaryTruth_E/D");
429  fPandoraBeam->Branch("primaryTruth_vtx", &fprimaryTruth_vtx, "primaryTruth_vtx[3]/D");
430  fPandoraBeam->Branch("primaryTruth_pdg", &fprimaryTruth_pdg, "primaryTruth_pdg/I");
431  fPandoraBeam->Branch("primaryTruth_trkID", &fprimaryTruth_trkID, "primaryTruth_trkID/I");
432  fPandoraBeam->Branch("primaryShowerBestPlane", &fprimaryShowerBestPlane, "primaryShowerBestPlane/I");
433  fPandoraBeam->Branch("primaryShowerCharge", &fprimaryShowerCharge, "primaryShowerCharge/D");
434  fPandoraBeam->Branch("primaryShowerEnergy", &fprimaryShowerEnergy, "primaryShowerEnergy/D");
435  fPandoraBeam->Branch("primaryShowerMIPEnergy", &fprimaryShowerMIPEnergy, "primaryShowerMIPEnergy/D");
436 
437  fPandoraBeam->Branch("primaryKineticEnergy", &fprimaryKineticEnergy, "primaryKineticEnergy[3]/D");
438  fPandoraBeam->Branch("primaryRange", &fprimaryRange, "primaryRange[3]/D");
439  fPandoraBeam->Branch("primarynCal", &fprimarynCal, "primarynCal/I");
440  fPandoraBeam->Branch("primarydQdx", &fprimarydQdx, "primarydQdx[primarynCal]/D");
441  fPandoraBeam->Branch("primary_cal_pos", &fprimary_cal_pos, "primary_cal_pos[primarynCal][3]/D");
442  fPandoraBeam->Branch("primary_cal_pitch", &fprimary_cal_pitch, "primary_cal_pitch[primarynCal]/D");
443  fPandoraBeam->Branch("primarydEdx", &fprimarydEdx, "primarydEdx[primarynCal]/D");
444  fPandoraBeam->Branch("primaryResidualRange", &fprimaryResidualRange, "primaryResidualRange[primarynCal]/D");
445  fPandoraBeam->Branch("primaryT0", &fprimaryT0, "primaryT0/D");
446  fPandoraBeam->Branch("primaryNDaughters", &fprimaryNDaughters, "primaryNDaughters/I");
447 
448  fPandoraBeam->Branch("primaryDaughterID", &fprimaryDaughterID, "primaryDaughterID[primaryNDaughters]/I");
449  fPandoraBeam->Branch("primaryDaughterIstrack", &fprimaryDaughterIstrack, "primaryDaughterIstrack[primaryNDaughters]/I");
450  fPandoraBeam->Branch("primaryDaughterIsshower", &fprimaryDaughterIsshower, "primaryDaughterIsshower[primaryNDaughters]/I");
451  fPandoraBeam->Branch("primaryDaughterBDTScore", &fprimaryDaughterBDTScore, "primaryDaughterBDTScore[primaryNDaughters]/D");
452  fPandoraBeam->Branch("primaryDaughterCNNScore", &fprimaryDaughterCNNScore, "primaryDaughterCNNScore[primaryNDaughters]/D");
453  fPandoraBeam->Branch("primaryDaughterNCollHits", &fprimaryDaughterNCollHits, "primaryDaughterNCollHits[primaryNDaughters]/I");
454  fPandoraBeam->Branch("primaryDaughterNHits", &fprimaryDaughterNHits, "primaryDaughterNHits[primaryNDaughters]/I");
455  fPandoraBeam->Branch("primaryDaughterEnergy", &fprimaryDaughterEnergy, "primaryDaughterEnergy[primaryNDaughters]/D");
456  fPandoraBeam->Branch("primaryDaughterEnergyFromHits", &fprimaryDaughterEnergyFromHits, "primaryDaughterEnergyFromHits[primaryNDaughters]/D");
457  fPandoraBeam->Branch("primaryDaughterMomentum", &fprimaryDaughterMomentum, "primaryDaughterMomentum[primaryNDaughters]/D");
458  fPandoraBeam->Branch("primaryDaughterEndMomentum", &fprimaryDaughterEndMomentum, "primaryDaughterEndMomentum[primaryNDaughters]/D");
459  fPandoraBeam->Branch("primaryDaughterLength", &fprimaryDaughterLength, "primaryDaughterLength[primaryNDaughters]/D");
460  fPandoraBeam->Branch("primaryDaughterStartPosition", &fprimaryDaughterStartPosition, "primaryDaughterStartPosition[primaryNDaughters][3]/D");
461  fPandoraBeam->Branch("primaryDaughterEndPosition", &fprimaryDaughterEndPosition, "primaryDaughterEndPosition[primaryNDaughters][3]/D");
462  fPandoraBeam->Branch("primaryDaughterStartDirection", &fprimaryDaughterStartDirection, "primaryDaughterStartDirection[primaryNDaughters][3]/D");
463  fPandoraBeam->Branch("primaryDaughterEndDirection", &fprimaryDaughterEndDirection, "primaryDaughterEndDirection[primaryNDaughters][3]/D");
464  fPandoraBeam->Branch("primaryDaughterParentPdg", &fprimaryDaughterParentPdg, "primaryDaughterParentPdg[primaryNDaughters]/I");
465  fPandoraBeam->Branch("primaryDaughterGrandparentPdg", &fprimaryDaughterGrandparentPdg, "primaryDaughterGrandparentPdg[primaryNDaughters]/I");
466  fPandoraBeam->Branch("primaryDaughterParentID", &fprimaryDaughterParentID, "primaryDaughterParentID[primaryNDaughters]/I");
467  fPandoraBeam->Branch("primaryDaughterGrandparentID", &fprimaryDaughterGrandparentID, "primaryDaughterGrandparentID[primaryNDaughters]/I");
468  fPandoraBeam->Branch("primaryDaughterParentE", &fprimaryDaughterParentE, "primaryDaughterParentE[primaryNDaughters]/D");
469  fPandoraBeam->Branch("primaryDaughterGrandparentE", &fprimaryDaughterGrandparentE, "primaryDaughterGrandparentE[primaryNDaughters]/D");
470  fPandoraBeam->Branch("primaryDaughterParentStart", &fprimaryDaughterParentStart, "primaryDaughterParentStart[primaryNDaughters][3]/D");
471  fPandoraBeam->Branch("primaryDaughterGrandparentStart", &fprimaryDaughterGrandparentStart, "primaryDaughterGrandparentStart[primaryNDaughters][3]/D");
472  fPandoraBeam->Branch("primaryDaughterParentEnd", &fprimaryDaughterParentEnd, "primaryDaughterParentEnd[primaryNDaughters][3]/D");
473  fPandoraBeam->Branch("primaryDaughterGrandparentEnd", &fprimaryDaughterGrandparentEnd, "primaryDaughterGrandparentEnd[primaryNDaughters][3]/D");
474  fPandoraBeam->Branch("primaryDaughterParentEndProcess", &fprimaryDaughterParentEndProcess, "primaryDaughterParentEndProcess[primaryNDaughters]/I");
475  fPandoraBeam->Branch("primaryDaughterHitPosition", &fprimaryDaughterHitPosition, ("primaryDaughterHitPosition[primaryNDaughters][" + std::to_string(NMAXHITS) + "][3]/D").c_str());
476  // fPandoraBeam->Branch("primaryDaughterCaloHitPosition", &fprimaryDaughterCaloHitPosition, ("primaryDaughterCaloHitPosition[primaryNDaughters][" + std::to_string(NMAXHITS) + "][3]/D").c_str());
477  fPandoraBeam->Branch("primaryDaughterHitCharge", &fprimaryDaughterHitCharge, ("primaryDaughterHitCharge[primaryNDaughters][" + std::to_string(NMAXHITS) + "]/D").c_str());
478  // fPandoraBeam->Branch("primaryDaughterHitdEdxArea", &fprimaryDaughterHitdEdxArea, ("primaryDaughterHitdEdxArea[primaryNDaughters][" + std::to_string(NMAXHITS) + "]/D").c_str());
479  // fPandoraBeam->Branch("primaryDaughterHitdQdx", &fprimaryDaughterHitdQdx, ("primaryDaughterHitdQdx[primaryNDaughters][" + std::to_string(NMAXHITS) + "]/D").c_str());
480  fPandoraBeam->Branch("primaryDaughterCaloHitdQdx", &fprimaryDaughterCaloHitdQdx, ("primaryDaughterCaloHitdQdx[primaryNDaughters][" + std::to_string(NMAXHITS) + "]/D").c_str());
481  fPandoraBeam->Branch("primaryDaughterCaloHitPitch", &fprimaryDaughterCaloHitPitch, ("primaryDaughterCaloHitPitch[primaryNDaughters][" + std::to_string(NMAXHITS) + "]/D").c_str());
482  fPandoraBeam->Branch("primaryDaughterOwnHitPitch", &fprimaryDaughterOwnHitPitch, ("primaryDaughterOwnHitPitch[primaryNDaughters][" + std::to_string(NMAXHITS) + "]/D").c_str());
483  fPandoraBeam->Branch("primaryDaughterHitWire", &fprimaryDaughterHitWire, ("primaryDaughterHitWire[primaryNDaughters][" + std::to_string(NMAXHITS) + "]/I").c_str());
484  fPandoraBeam->Branch("primaryDaughterHitTime", &fprimaryDaughterHitTime, ("primaryDaughterHitTime[primaryNDaughters][" + std::to_string(NMAXHITS) + "]/D").c_str());
485 
486  // fPandoraBeam->Branch("ObjID", &fObjID, ("ObjID[" + std::to_string(NMAXOBJECTS) + "]/I").c_str());
487  // fPandoraBeam->Branch("ObjIsTrack", &fObjIsTrack, ("ObjIsTrack[" + std::to_string(NMAXOBJECTS) + "]/I").c_str());
488  // fPandoraBeam->Branch("ObjIsShower", &fObjIsShower, ("ObjIsShower[" + std::to_string(NMAXOBJECTS) + "]/I").c_str());
489  // fPandoraBeam->Branch("ObjIsPrimaryDaughter", &fObjIsPrimaryDaughter, ("ObjIsPrimaryDaughter[" + std::to_string(NMAXOBJECTS) + "]/I").c_str());
490  // fPandoraBeam->Branch("ObjBDTscore", &fObjBDTscore, ("ObjBDTscore[" + std::to_string(NMAXOBJECTS) + "]/D").c_str());
491  // fPandoraBeam->Branch("ObjCNNscore", &fObjCNNscore, ("ObjCNNscore[" + std::to_string(NMAXOBJECTS) + "]/D").c_str());
492  // fPandoraBeam->Branch("ObjMomentum", &fObjMomentum, ("ObjMomentum[" + std::to_string(NMAXOBJECTS) + "]/D").c_str());
493  // fPandoraBeam->Branch("ObjEndMomentum", &fObjEndMomentum, ("ObjEndMomentum[" + std::to_string(NMAXOBJECTS) + "]/D").c_str());
494  // fPandoraBeam->Branch("ObjLength", &fObjLength, ("ObjLength[" + std::to_string(NMAXOBJECTS) + "]/D").c_str());
495  // fPandoraBeam->Branch("ObjStartPosition", &fObjStartPosition, ("ObjStartPosition[" + std::to_string(NMAXOBJECTS) + "][3]/D").c_str());
496  // fPandoraBeam->Branch("ObjEndPosition", &fObjEndPosition, ("ObjEndPosition[" + std::to_string(NMAXOBJECTS) + "][3]/D").c_str());
497  // fPandoraBeam->Branch("ObjStartDirection", &fObjStartDirection, ("ObjStartDirection[" + std::to_string(NMAXOBJECTS) + "][3]/D").c_str());
498  // fPandoraBeam->Branch("ObjEndDirection", &fObjEndDirection, ("ObjEndDirection[" + std::to_string(NMAXOBJECTS) + "][3]/D").c_str());
499  // fPandoraBeam->Branch("ObjParentPdg", &fObjMCParentPdg, ("ObjParentPdg[" + std::to_string(NMAXOBJECTS) + "]/I").c_str());
500  // fPandoraBeam->Branch("ObjGrandparentPdg", &fObjMCGrandparentPdg, ("ObjGrandparentPdg[" + std::to_string(NMAXOBJECTS) + "]/I").c_str());
501  // fPandoraBeam->Branch("ObjParentID", &fObjMCParentID, ("ObjParentID[" + std::to_string(NMAXOBJECTS) + "]/I").c_str());
502  // fPandoraBeam->Branch("ObjGrandparentID", &fObjMCGrandparentID, ("ObjGrandparentID[" + std::to_string(NMAXOBJECTS) + "]/I").c_str());
503  // // Object hit information.
504  // fPandoraBeam->Branch("ObjNumHits", &fObjNumHits, ("ObjNumHits[" + std::to_string(NMAXOBJECTS) + "]/I").c_str());
505  // fPandoraBeam->Branch("ObjHitPosition", &fObjHitPosition, ("ObjHitPosition[" + std::to_string(NMAXOBJECTS) + "][" + std::to_string(NMAXHITS) + "][3]/D").c_str());
506  // fPandoraBeam->Branch("ObjHitTime", &fObjHitTime, ("ObjHitTime[" + std::to_string(NMAXOBJECTS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
507  // fPandoraBeam->Branch("ObjHitWire", &fObjHitWire, ("ObjHitWire[" + std::to_string(NMAXOBJECTS) + "][" + std::to_string(NMAXHITS) + "]/I").c_str());
508  // fPandoraBeam->Branch("ObjHitCharge", &fObjHitCharge, ("ObjHitCharge[" + std::to_string(NMAXOBJECTS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
509  // fPandoraBeam->Branch("ObjHitPitch", &fObjHitPitch, ("ObjHitPitch[" + std::to_string(NMAXOBJECTS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
510  // fPandoraBeam->Branch("ObjHitdEdx", &fObjHitdEdx, ("ObjHitdEdx[" + std::to_string(NMAXOBJECTS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
511  // fPandoraBeam->Branch("ObjHitdQdx", &fObjHitdQdx, ("ObjHitdQdx[" + std::to_string(NMAXOBJECTS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
512 
513  // MC pi0 variables
514  // fPandoraBeam->Branch("MCPi0ID", &fMCPi0ID, ("MCPi0ID[" + std::to_string(NMAXPIZEROS) + "]/I").c_str());
515  // fPandoraBeam->Branch("MCPi0Energy", &fMCPi0Energy, ("MCPi0Energy[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
516  // fPandoraBeam->Branch("MCPi0StartPosition", &fMCPi0StartPosition, ("MCPi0StartPosition[" + std::to_string(NMAXPIZEROS) + "][3]/D").c_str());
517  // fPandoraBeam->Branch("MCPi0EndPosition", &fMCPi0EndPosition, ("MCPi0EndPosition[" + std::to_string(NMAXPIZEROS) + "][3]/D").c_str());
518  // fPandoraBeam->Branch("MCPhoton1ID", &fMCPhoton1ID, ("MCPhoton1ID[" + std::to_string(NMAXPIZEROS) + "]/I").c_str());
519  // fPandoraBeam->Branch("MCPhoton2ID", &fMCPhoton2ID, ("MCPhoton2ID[" + std::to_string(NMAXPIZEROS) + "]/I").c_str());
520  // fPandoraBeam->Branch("MCPhoton1Energy", &fMCPhoton1Energy, ("MCPhoton1Energy[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
521  // fPandoraBeam->Branch("MCPhoton2Energy", &fMCPhoton2Energy, ("MCPhoton2Energy[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
522  // fPandoraBeam->Branch("MCPhoton1StartPosition", &fMCPhoton1StartPosition, ("MCPhoton1StartPosition[" + std::to_string(NMAXPIZEROS) + "][3]/D").c_str());
523  // fPandoraBeam->Branch("MCPhoton2StartPosition", &fMCPhoton2StartPosition, ("MCPhoton2StartPosition[" + std::to_string(NMAXPIZEROS) + "][3]/D").c_str());
524  // fPandoraBeam->Branch("MCPhoton1EndPosition", &fMCPhoton1EndPosition, ("MCPhoton1EndPosition[" + std::to_string(NMAXPIZEROS) + "][3]/D").c_str());
525  // fPandoraBeam->Branch("MCPhoton2EndPosition", &fMCPhoton2EndPosition, ("MCPhoton2EndPosition[" + std::to_string(NMAXPIZEROS) + "][3]/D").c_str());
526  // // Reco hits related to photons
527  // fPandoraBeam->Branch("MCPhoton1NumHits", &fMCPhoton1NumHits, ("MCPhoton1NumHits[" + std::to_string(NMAXPIZEROS) + "]/I").c_str());
528  // fPandoraBeam->Branch("MCPhoton2NumHits", &fMCPhoton2NumHits, ("MCPhoton2NumHits[" + std::to_string(NMAXPIZEROS) + "]/I").c_str());
529  // fPandoraBeam->Branch("MCPhoton1_hit_w", &fMCPhoton1_hit_w, ("MCPhoton1_hit_w[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/I").c_str());
530  // fPandoraBeam->Branch("MCPhoton2_hit_w", &fMCPhoton2_hit_w, ("MCPhoton2_hit_w[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/I").c_str());
531  // fPandoraBeam->Branch("MCPhoton1_hit_q", &fMCPhoton1_hit_q, ("MCPhoton1_hit_q[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
532  // fPandoraBeam->Branch("MCPhoton2_hit_q", &fMCPhoton2_hit_q, ("MCPhoton2_hit_q[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
533  // fPandoraBeam->Branch("MCPhoton1_hit_t", &fMCPhoton1_hit_t, ("MCPhoton1_hit_t[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
534  // fPandoraBeam->Branch("MCPhoton2_hit_t", &fMCPhoton2_hit_t, ("MCPhoton2_hit_t[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
535  // fPandoraBeam->Branch("MCPhoton1_hit_pos", &fMCPhoton1_hit_pos, ("MCPhoton1_hit_pos[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "][3]/D").c_str());
536  // fPandoraBeam->Branch("MCPhoton2_hit_pos", &fMCPhoton2_hit_pos, ("MCPhoton2_hit_pos[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "][3]/D").c_str());
537 
538  // // Shower variables
539  // fPandoraBeam->Branch("Shower1ID", &fShower1ID, ("Shower1ID[" + std::to_string(NMAXPIZEROS) + "]/I").c_str());
540  // fPandoraBeam->Branch("Shower2ID", &fShower2ID, ("Shower2ID[" + std::to_string(NMAXPIZEROS) + "]/I").c_str());
541  // fPandoraBeam->Branch("Shower1StartPosition", &fShower1StartPosition, ("Shower1StartPosition[" + std::to_string(NMAXPIZEROS) + "][3]/D").c_str());
542  // fPandoraBeam->Branch("Shower2StartPosition", &fShower2StartPosition, ("Shower2StartPosition[" + std::to_string(NMAXPIZEROS) + "][3]/D").c_str());
543  // fPandoraBeam->Branch("Shower1Direction", &fShower1Direction, ("Shower1Direction[" + std::to_string(NMAXPIZEROS) + "][3]/D").c_str());
544  // fPandoraBeam->Branch("Shower2Direction", &fShower2Direction, ("Shower2Direction[" + std::to_string(NMAXPIZEROS) + "][3]/D").c_str());
545  // fPandoraBeam->Branch("Shower1Length", &fShower1Length, ("Shower1Length[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
546  // fPandoraBeam->Branch("Shower2Length", &fShower2Length, ("Shower2Length[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
547  // fPandoraBeam->Branch("Shower1Completeness", &fShower1Completeness, ("Shower1Completeness[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
548  // fPandoraBeam->Branch("Shower2Completeness", &fShower2Completeness, ("Shower2Completeness[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
549  // fPandoraBeam->Branch("Shower1Purity", &fShower1Purity, ("Shower1Purity[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
550  // fPandoraBeam->Branch("Shower2Purity", &fShower2Purity, ("Shower2Purity[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
551  // // Reco hits related to showers
552  // fPandoraBeam->Branch("Shower1NumHits", &fShower1NumHits, ("Shower1NumHits[" + std::to_string(NMAXPIZEROS) + "]/I").c_str());
553  // fPandoraBeam->Branch("Shower2NumHits", &fShower2NumHits, ("Shower2NumHits[" + std::to_string(NMAXPIZEROS) + "]/I").c_str());
554  // fPandoraBeam->Branch("Shower1_cnn_sc", &fShower1_cnn_sc, ("Shower1_cnn_sc[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
555  // fPandoraBeam->Branch("Shower2_cnn_sc", &fShower2_cnn_sc, ("Shower2_cnn_sc[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
556  // fPandoraBeam->Branch("Shower1_cal_pos", &fShower1_cal_pos, ("Shower1_cal_pos[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "][3]/D").c_str());
557  // fPandoraBeam->Branch("Shower2_cal_pos", &fShower2_cal_pos, ("Shower2_cal_pos[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "][3]/D").c_str());
558  // fPandoraBeam->Branch("Shower1_cal_E", &fShower1_cal_E, ("Shower1_cal_E[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
559  // fPandoraBeam->Branch("Shower2_cal_E", &fShower2_cal_E, ("Shower2_cal_E[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
560  // fPandoraBeam->Branch("Shower1Energy", &fShower1Energy, ("Shower1Energy[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
561  // fPandoraBeam->Branch("Shower2Energy", &fShower2Energy, ("Shower2Energy[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
562  // fPandoraBeam->Branch("Shower1EnergyFromHits", &fShower1EnergyFromHits, ("Shower1EnergyFromHits[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
563  // fPandoraBeam->Branch("Shower2EnergyFromHits", &fShower2EnergyFromHits, ("Shower2EnergyFromHits[" + std::to_string(NMAXPIZEROS) + "]/D").c_str());
564  // fPandoraBeam->Branch("Shower1HasBeamParent", &fShower1HasBeamParent, ("Shower1HasBeamParent[" + std::to_string(NMAXPIZEROS) + "]/I").c_str());
565  // fPandoraBeam->Branch("Shower2HasBeamParent", &fShower2HasBeamParent, ("Shower2HasBeamParent[" + std::to_string(NMAXPIZEROS) + "]/I").c_str());
566  // fPandoraBeam->Branch("Shower1HasBeamGrandparent", &fShower1HasBeamGrandparent, ("Shower1HasBeamGrandparent[" + std::to_string(NMAXPIZEROS) + "]/I").c_str());
567  // fPandoraBeam->Branch("Shower2HasBeamGrandparent", &fShower2HasBeamGrandparent, ("Shower2HasBeamGrandparent[" + std::to_string(NMAXPIZEROS) + "]/I").c_str());
568  // fPandoraBeam->Branch("Shower1_cal_pitch", &fShower1_cal_pitch, ("Shower1_cal_pitch[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
569  // fPandoraBeam->Branch("Shower2_cal_pitch", &fShower2_cal_pitch, ("Shower2_cal_pitch[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
570  // fPandoraBeam->Branch("Shower1_cal_dEdx", &fShower1_cal_dEdx, ("Shower1_cal_dEdx[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
571  // fPandoraBeam->Branch("Shower2_cal_dEdx", &fShower2_cal_dEdx, ("Shower2_cal_dEdx[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
572  // fPandoraBeam->Branch("Shower1_cal_dQdx", &fShower1_cal_dQdx, ("Shower1_cal_dQdx[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
573  // fPandoraBeam->Branch("Shower2_cal_dQdx", &fShower2_cal_dQdx, ("Shower2_cal_dQdx[" + std::to_string(NMAXPIZEROS) + "][" + std::to_string(NMAXHITS) + "]/D").c_str());
574 }
double fprimaryDaughterStartDirection[NMAXDAUGHTERS][3]
double fprimaryDaughterCaloHitdQdx[NMAXDAUGHTERS][NMAXHITS]
double fprimaryDaughterCaloHitPitch[NMAXDAUGHTERS][NMAXHITS]
double fprimaryDaughterHitTime[NMAXDAUGHTERS][NMAXHITS]
const int NMAXHITS
double fprimaryDaughterHitPosition[NMAXDAUGHTERS][NMAXHITS][3]
int fprimaryDaughterHitWire[NMAXDAUGHTERS][NMAXHITS]
double fprimaryDaughterOwnHitPitch[NMAXDAUGHTERS][NMAXHITS]
double fprimaryDaughterHitCharge[NMAXDAUGHTERS][NMAXHITS]
double fprimaryDaughterGrandparentEnd[NMAXDAUGHTERS][3]
double fprimaryDaughterStartPosition[NMAXDAUGHTERS][3]
std::string to_string(ModuleType const mt)
Definition: ModuleType.h:34
double fprimaryDaughterGrandparentStart[NMAXDAUGHTERS][3]
void protoana::ProtoDUNEPizeroAnaTree::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 802 of file ProtoDUNEPizeroAnaTree_module.cc.

802  {
803 
804 }
void protoana::ProtoDUNEPizeroAnaTree::FillAPA3Object ( art::Event const &  evt,
art::Handle< std::vector< recob::PFParticle >>  pfpHandle 
)
private
void protoana::ProtoDUNEPizeroAnaTree::FillPrimaryPFParticle ( art::Event const &  evt,
detinfo::DetectorClocksData const &  clockData,
detinfo::DetectorPropertiesData const &  detProp,
const recob::PFParticle particle 
)
private

Definition at line 808 of file ProtoDUNEPizeroAnaTree_module.cc.

811  {
812 
813  // Pandora's BDT beam-cosmic score
815 
816  // "particle" is the pointer to our beam particle. The recob::Track or recob::Shower object
817  // of this particle might be more helpful. These return null pointers if not track-like / shower-like
818  const recob::Track* thisTrack = pfpUtil.GetPFParticleTrack(*particle, evt,fPFParticleTag,fTrackTag);
819  const recob::Shower* thisShower = pfpUtil.GetPFParticleShower(*particle,evt,fPFParticleTag,fShowerTag);
820  auto recoTracks = evt.getValidHandle<std::vector<recob::Track>>(fTrackTag);
821  auto recoShowers = evt.getValidHandle<std::vector<recob::Shower>>(fShowerTag);
822  art::FindManyP<recob::Hit> findHitsFromShowers(recoShowers,evt,fShowerTag);
823  art::FindManyP<recob::Hit> findHitsFromTracks(recoTracks,evt,fTrackTag);
824  // Set some common variables that have different access methods.
825  std::vector<art::Ptr<recob::Hit>> pfpHits;
826  std::vector<anab::Calorimetry> calovector;
827  const simb::MCParticle* mcparticle = NULL;
828  if(thisTrack != 0x0) {
829  pfpHits = findHitsFromTracks.at(thisTrack->ID());
830  calovector = trackUtil.GetRecoTrackCalorimetry(*thisTrack, evt, fTrackTag, fCalorimetryTag);
831  mcparticle = truthUtil.GetMCParticleFromRecoTrack(clockData, *thisTrack, evt, fTrackTag);
832  } else if(thisShower != 0x0) {
833  pfpHits = findHitsFromShowers.at(thisShower->ID());
834  calovector = showerUtil.GetRecoShowerCalorimetry(*thisShower, evt, fShowerTag, fShowerCaloTag);
835  mcparticle = truthUtil.GetMCParticleFromRecoShower(clockData, *thisShower, evt, fShowerTag);
836  }
837  // NHits associated with this pfParticle.
838  fprimaryNHits = pfpHits.size();
839 
840  if(mcparticle){
841  fprimaryTruth_pdg = mcparticle->PdgCode();
842  fprimaryTruth_trkID = mcparticle->TrackId();
843  fprimaryTruth_vtx[0] = mcparticle->Vx();
844  fprimaryTruth_vtx[1] = mcparticle->Vy();
845  fprimaryTruth_vtx[2] = mcparticle->Vx();
846  fprimaryTruth_E = mcparticle->E();
847  if( fbeamtrackID != -999 && fbeamtrackID == fprimaryTruth_trkID ) {
849  }
850  }
851 
852  // Calorimetry only collection plane
853  for(size_t k = 0; k < calovector.size() && k<3; k++){
854  int plane = calovector[k].PlaneID().Plane;
855  if(plane !=2 ) continue;
856  fprimaryKineticEnergy[plane] = calovector[k].KineticEnergy();
857  fprimaryRange[plane] = calovector[k].Range();
858  fprimarynCal = std::min(calovector[k].dEdx().size(), (size_t)NMAXHITS);
859  for(size_t l=0; l<calovector[k].dEdx().size() && l<NMAXHITS; ++l){
860  fprimarydEdx[l]= calovector[k].dEdx()[l];
861  fprimarydQdx[l]= calovector[k].dQdx()[l];
862  fprimaryResidualRange[l]= calovector[k].ResidualRange()[l];
863  const auto &pos=(calovector[k].XYZ())[l];
864  fprimary_cal_pos[l][0] = pos.X();
865  fprimary_cal_pos[l][1] = pos.Y();
866  fprimary_cal_pos[l][2] = pos.Z();
867  fprimary_cal_pitch[l] =calovector[k].TrkPitchVec()[l];
868  }
869  }
870 
871  // Get the CNN score for the primary particle.
872  anab::MVAReader<recob::Hit,4> hitResults(evt, "emtrkmichelid:emtrkmichel" );
873  fprimaryCNNScore = 0;
874  for(const art::Ptr<recob::Hit>& hit : pfpHits) {
875  std::array<float,4> cnn_out = hitResults.getOutput( hit );
876  const double p_trk_or_sh = cnn_out[ hitResults.getIndex("track") ]+ cnn_out[ hitResults.getIndex("em") ];
877  const double cnn_score = cnn_out[ hitResults.getIndex("em") ]/p_trk_or_sh;
878  fprimaryCNNScore += cnn_score;
879  }
881  std::cout << "Got primary CNN score " << fprimaryCNNScore << ", true PDG code: " << fprimaryTruth_pdg << '\n';
882  std::cout << "Pandora track: " << thisTrack << ", shower: " << thisShower << '\n';
883 
884  // Get the T0 for this pfParticle
885  std::vector<anab::T0> pfT0vec = pfpUtil.GetPFParticleT0(*particle,evt,fPFParticleTag);
886  if(!pfT0vec.empty())
887  fprimaryT0 = pfT0vec[0].Time();
888 
889  if(thisTrack != 0x0){
890 
891  fprimaryIstrack = 1;
892  fprimaryIsshower = 0;
893  fprimaryID = thisTrack->ParticleId();
894  fprimaryTheta = thisTrack->Theta();
895  fprimaryPhi = thisTrack->Phi();
896  fprimaryLength = thisTrack->Length();
897  fprimaryMomentum = thisTrack->StartMomentum();
898  fprimaryEndMomentum = thisTrack->EndMomentum();
899  fprimaryEndPosition[0] = thisTrack->Trajectory().End().X();
900  fprimaryEndPosition[1] = thisTrack->Trajectory().End().Y();
901  fprimaryEndPosition[2] = thisTrack->Trajectory().End().Z();
902  fprimaryStartPosition[0] = thisTrack->Trajectory().Start().X();
903  fprimaryStartPosition[1] = thisTrack->Trajectory().Start().Y();
904  fprimaryStartPosition[2] = thisTrack->Trajectory().Start().Z();
905  fprimaryEndDirection[0] = thisTrack->Trajectory().EndDirection().X();
906  fprimaryEndDirection[1] = thisTrack->Trajectory().EndDirection().Y();
907  fprimaryEndDirection[2] = thisTrack->Trajectory().EndDirection().Z();
908  fprimaryStartDirection[0] = thisTrack->Trajectory().StartDirection().X();
909  fprimaryStartDirection[1] = thisTrack->Trajectory().StartDirection().Y();
910  fprimaryStartDirection[2] = thisTrack->Trajectory().StartDirection().Z();
911 
912  } // end is track
913  else if(thisShower != 0x0){
914 
915  fprimaryIstrack = 0;
916  fprimaryIsshower = 1;
917  fprimaryID = thisShower->ID();
918  fprimaryLength = thisShower->Length();
919  fprimaryShowerBestPlane = thisShower->best_plane();
920  fprimaryOpeningAngle = thisShower->OpenAngle();
921  fprimaryStartPosition[0] = thisShower->ShowerStart().X();
922  fprimaryStartPosition[1] = thisShower->ShowerStart().Y();
923  fprimaryStartPosition[2] = thisShower->ShowerStart().Z();
924  fprimaryStartDirection[0] = thisShower->Direction().X();
925  fprimaryStartDirection[1] = thisShower->Direction().Y();
926  fprimaryStartDirection[2] = thisShower->Direction().Z();
927 
928  } // end is shower
929 
930  // Record children of primary track
931  auto recoParticleHandle = evt.getHandle<std::vector<recob::PFParticle>>(fPFParticleTag);
932  if( !recoParticleHandle ) return;
933 
935  for(int di = 0; di < fprimaryNDaughters; ++di) {
936  fprimaryDaughterID[di] = particle->Daughter(di);
937  const recob::PFParticle* daughter = &recoParticleHandle->at(fprimaryDaughterID[di]);
938  if(daughter == 0x0) continue;
939 
940  const recob::Track* daughterTrack = pfpUtil.GetPFParticleTrack(*daughter, evt,fPFParticleTag,fTrackTag);
941  const recob::Shower* daughterShower = pfpUtil.GetPFParticleShower(*daughter,evt,fPFParticleTag,fShowerTag);
942 
943  // Pandora's BDT beam-cosmic score
945  // Hits and calorimetry associated with this pfParticle
946  std::vector<art::Ptr<recob::Hit>> pfpDHits;
947  std::vector<anab::Calorimetry> dcalovector;
948  if(daughterTrack != 0x0) {
949  pfpDHits = findHitsFromTracks.at( daughterTrack->ID() );
950  dcalovector = trackUtil.GetRecoTrackCalorimetry(*daughterTrack, evt, fTrackTag, fCalorimetryTag);
951  } else if(daughterShower != 0x0) {
952  pfpDHits = findHitsFromShowers.at( daughterShower->ID() );
953  dcalovector = showerUtil.GetRecoShowerCalorimetry(*daughterShower, evt, fShowerTag, fShowerCaloTag);
954  }
955  if(dcalovector.size() != 3 && fVerbose > 0) {
956  std::cerr << "WARNING::Calorimetry vector size for track is = " << dcalovector.size() << std::endl;
957  }
958 
959  // Loop over calorimetry.
960  std::map<int, double> calo_hit_dQdx;
961  std::map<int, double> calo_hit_pitch;
962  for(size_t k = 0; k < dcalovector.size() && k<3; k++){
963  int plane = dcalovector[k].PlaneID().Plane;
964  if(plane !=2 ) continue;
965  for(size_t l=0; l<dcalovector[k].dEdx().size() && l<NMAXHITS; ++l){
966  // fprimaryDaughterHitdEdx[di][l]= dcalovector[k].dEdx()[l];
967  // fprimaryDaughterCaloHitdQdx[di][l]= dcalovector[k].dQdx()[l];
968  calo_hit_dQdx[dcalovector[k].TpIndices()[l]] = dcalovector[k].dQdx()[l];
969  calo_hit_pitch[dcalovector[k].TpIndices()[l]] = dcalovector[k].TrkPitchVec()[l];
970  // tmp_dQdx.push_back(fprimaryDaughterCaloHitdQdx[di][l]);
971  // fprimaryDaughterResidualRange[l]= dcalovector[k].ResidualRange()[l];
972  const geo::Point_t &pos=(dcalovector[k].XYZ())[l];
973  if(daughterShower != 0) {
974  const TVector3 hitvec(pos.X(), pos.Y(), pos.Z());
975  }
976  // fprimaryDaughterCaloHitPosition[di][l][0] = pos.X();
977  // fprimaryDaughterCaloHitPosition[di][l][1] = pos.Y();
978  // fprimaryDaughterCaloHitPosition[di][l][2] = pos.Z();
979  // fprimaryDaughterHitPitch[di][l] = dcalovector[k].TrkPitchVec()[l];
980  } // Loop over calorimetry hits.
981  } // Loop over calorimetry.
982 
983  // Loop over hits, record Aidan's CNN shower-like score.
984  art::FindManyP<recob::SpacePoint> spFromHits(pfpDHits, evt, fHitTag);
985  fprimaryDaughterCNNScore[di] = 0;
986  unsigned rec_hiti = 0;
987  for( unsigned i = 0; i < pfpDHits.size() && rec_hiti < NMAXHITS; ++i){
988  if(pfpDHits[i]->WireID().Plane != 2) continue;
989 
990  const geo::WireGeo* pwire = fGeometryService->WirePtr(pfpDHits[i]->WireID());
991  TVector3 xyzWire = pwire->GetCenter<TVector3>();
992  fprimaryDaughterHitWire[di][rec_hiti] = pfpDHits[i]->WireID().Wire;
993  fprimaryDaughterHitTime[di][rec_hiti] = pfpDHits[i]->PeakTime();
994  fprimaryDaughterHitPosition[di][rec_hiti][0] = detProp.ConvertTicksToX(pfpDHits[i]->PeakTime(),pfpDHits[i]->WireID().Plane,pfpDHits[i]->WireID().TPC,0);
995  fprimaryDaughterHitPosition[di][rec_hiti][2] = xyzWire.Z();
996  std::vector<art::Ptr<recob::SpacePoint>> sps = spFromHits.at(i);
997  if(!sps.empty()) {
998  fprimaryDaughterHitPosition[di][rec_hiti][1] = sps[0]->XYZ()[1];
999  }
1000  TVector3 hitpos(fprimaryDaughterHitPosition[di][rec_hiti][0],
1001  fprimaryDaughterHitPosition[di][rec_hiti][1],
1002  fprimaryDaughterHitPosition[di][rec_hiti][2]);
1003 
1004  std::array<float,4> cnn_out = hitResults.getOutput( pfpDHits[i] );
1005  const double p_trk_or_sh = cnn_out[ hitResults.getIndex("track") ]+ cnn_out[ hitResults.getIndex("em") ];
1006  const double cnn_score = cnn_out[ hitResults.getIndex("em") ]/p_trk_or_sh;
1007  fprimaryDaughterCNNScore[di] += cnn_score;
1008  // Record general hit information.
1009  fprimaryDaughterHitCharge[di][rec_hiti] = pfpDHits[i]->Integral();
1010  // Determine own hit pitch with SCE corrections.
1011  const double wirePitch = fGeometryService->WirePitch(pfpDHits[i]->WireID().planeID());
1012  TVector3 objdir(0,0,0);
1013  if(daughterTrack != 0x0) {
1014  objdir = {daughterTrack->Trajectory().StartDirection().X(),
1015  daughterTrack->Trajectory().StartDirection().Y(),
1016  daughterTrack->Trajectory().StartDirection().Z()};
1017  } else if(daughterShower != 0x0) {
1018  objdir = daughterShower->Direction();
1019  }
1020  TVector3 hitdir = objdir.Unit();
1021  if(objdir.Mag2() != 0 && hitpos[1] != -999.0) {
1022  // Here we have the object's direction and full hit position.
1023  // Set hit end to point on next wire in object's direction.
1024  objdir = objdir.Unit();
1025  TVector3 hitend = hitpos + objdir * (wirePitch/objdir.Z());
1027  // Do SCE corrections on hitpos and hitend to get proper hit direction.
1028  // std::cout << "Doing SCE corrections.\n";
1029  const geo::Vector_t poscorr = fSCEService->GetCalPosOffsets(geo::Point_t(hitpos), pfpDHits[i]->WireID().TPC);
1030  const geo::Vector_t endcorr = fSCEService->GetCalPosOffsets(geo::Point_t(hitend), pfpDHits[i]->WireID().TPC);
1031  hitpos += TVector3(poscorr.X(), poscorr.Y(), poscorr.Z());
1032  hitend += TVector3(endcorr.X(), endcorr.Y(), endcorr.Z());
1033  }
1034  hitdir = (hitend-hitpos).Unit();
1035  } //else if(objdir.Mag2() != 0) {
1036  // std::cout << "Hit position incomplete: " << hitpos[0] << ',' << hitpos[1] << ',' << hitpos[2] << '\n';
1037  // } else if(hitpos[1] != -999) {
1038  // std::cout << "No object direction.\n";
1039  // } else { std::cout << "??????\n"; }
1040  fprimaryDaughterOwnHitPitch[di][rec_hiti] = wirePitch / abs(hitdir.Z());
1041  fprimaryDaughterCaloHitdQdx[di][rec_hiti] = calo_hit_dQdx[pfpDHits[i].key()];
1042  fprimaryDaughterCaloHitPitch[di][rec_hiti] = calo_hit_pitch[pfpDHits[i].key()];
1043  // std::cout << "Bare dx: " << wirePitch / abs(objdir.Z())
1044  // << ", own dx: " << fprimaryDaughterOwnHitPitch[di][rec_hiti]
1045  // << ", calo dx: " << fprimaryDaughterCaloHitPitch[di][rec_hiti] << '\n';
1046  ++rec_hiti;
1047  } // Loop over hits.
1048  fprimaryDaughterNCollHits[di] = rec_hiti;
1049  fprimaryDaughterNHits[di] = pfpDHits.size();
1050  fprimaryDaughterCNNScore[di] /= rec_hiti;
1051 
1052  if(daughterTrack != 0x0) {
1053  fprimaryDaughterIstrack[di] = 1;
1054  fprimaryDaughterIsshower[di] = 0;
1055 
1056  fprimaryDaughterMomentum[di] = daughterTrack->StartMomentum();
1057  fprimaryDaughterEndMomentum[di] = daughterTrack->EndMomentum();
1058  fprimaryDaughterLength[di] = daughterTrack->Length();
1059  fprimaryDaughterStartPosition[di][0] = daughterTrack->Trajectory().Start().X();
1060  fprimaryDaughterStartPosition[di][1] = daughterTrack->Trajectory().Start().Y();
1061  fprimaryDaughterStartPosition[di][2] = daughterTrack->Trajectory().Start().Z();
1062  fprimaryDaughterEndPosition[di][0] = daughterTrack->Trajectory().End().X();
1063  fprimaryDaughterEndPosition[di][1] = daughterTrack->Trajectory().End().Y();
1064  fprimaryDaughterEndPosition[di][2] = daughterTrack->Trajectory().End().Z();
1065  fprimaryDaughterStartDirection[di][0] = daughterTrack->Trajectory().StartDirection().X();
1066  fprimaryDaughterStartDirection[di][1] = daughterTrack->Trajectory().StartDirection().Y();
1067  fprimaryDaughterStartDirection[di][2] = daughterTrack->Trajectory().StartDirection().Z();
1068  fprimaryDaughterEndDirection[di][0] = daughterTrack->Trajectory().EndDirection().X();
1069  fprimaryDaughterEndDirection[di][1] = daughterTrack->Trajectory().EndDirection().Y();
1070  fprimaryDaughterEndDirection[di][2] = daughterTrack->Trajectory().EndDirection().Z();
1071  } else if(daughterShower != 0x0) {
1072  fprimaryDaughterIstrack[di] = 0;
1073  fprimaryDaughterIsshower[di] = 1;
1074 
1075  std::vector<const recob::Hit*> shHits = showerUtil.GetRecoShowerHits(*daughterShower, evt, fShowerTag);
1077  detProp,
1078  shHits,
1079  fCalorimetryAlg)[2];
1080  fprimaryDaughterLength[di] = daughterShower->Length();
1081  fprimaryDaughterStartDirection[di][0] = daughterShower->Direction().X();
1082  fprimaryDaughterStartDirection[di][1] = daughterShower->Direction().Y();
1083  fprimaryDaughterStartDirection[di][2] = daughterShower->Direction().Z();
1084  fprimaryDaughterStartPosition[di][0] = daughterShower->ShowerStart().X();
1085  fprimaryDaughterStartPosition[di][1] = daughterShower->ShowerStart().Y();
1086  fprimaryDaughterStartPosition[di][2] = daughterShower->ShowerStart().Z();
1087  }
1088 
1089  // Attempt to get the (grand)parent truth information of this daughter.
1091  const simb::MCParticle* parent = truthUtil.GetMCParticleFromReco(clockData, *daughter, evt, fPFParticleTag);
1092  if(parent != 0x0) {
1093  fprimaryDaughterParentPdg[di] = parent->PdgCode();
1094  // std::cout << "True parent PDG: " << fprimaryDaughterParentPdg[di] << '\n';
1095  fprimaryDaughterParentID[di] = parent->TrackId();
1096  // std::cout << "Daughter parent: " << fprimaryDaughterParentID[di] << '\n';
1097  fprimaryDaughterParentE[di] = parent->E();
1098  // std::cout << "True parent E: " << fprimaryDaughterParentE[di] << '\n';
1099  if(parent->EndProcess() == "conv") {
1101  } else if(parent->EndProcess() == "phot") {
1103  }
1104  parent->Position().Vect().GetXYZ(fprimaryDaughterParentStart[di]);
1105  parent->EndPosition().Vect().GetXYZ(fprimaryDaughterParentEnd[di]);
1106  if(parent->Mother() != 0) {
1107  const simb::MCParticle* gparent = pi_serv->TrackIdToParticle_P(parent->Mother());
1108  fprimaryDaughterGrandparentPdg[di] = gparent->PdgCode();
1109  fprimaryDaughterGrandparentID[di] = gparent->TrackId();
1110  fprimaryDaughterGrandparentE[di] = gparent->E();
1111  // std::cout << "True grandparent PDG: " << fprimaryDaughterGrandparentPdg[di] << '\n';
1112  gparent->Position().Vect().GetXYZ(fprimaryDaughterGrandparentStart[di]);
1113  gparent->EndPosition().Vect().GetXYZ(fprimaryDaughterGrandparentEnd[di]);
1114  }
1115  } // If MCParticle parent.
1116  } // for PFParticle daughters
1117 
1118 } // FillPrimaryPFParticle
double E(const int i=0) const
Definition: MCParticle.h:233
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:65
const TVector3 & ShowerStart() const
Definition: Shower.h:192
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:219
const std::vector< const recob::Hit * > GetRecoShowerHits(const recob::Shower &shower, art::Event const &evt, const std::string showerModule) const
Get the hits from a given reco shower.
double EndMomentum() const
Definition: Track.h:144
int PdgCode() const
Definition: MCParticle.h:212
std::vector< double > EstimateEnergyFromHitCharge(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::vector< const recob::Hit * > &hits, calo::CalorimetryAlg caloAlg)
double fprimaryDaughterStartDirection[NMAXDAUGHTERS][3]
std::vector< anab::T0 > GetPFParticleT0(const recob::PFParticle &particle, art::Event const &evt, std::string particleLabel) const
Get the T0(s) from a given PFParticle.
int NumDaughters() const
Returns the number of daughter particles flowing from this one.
Definition: PFParticle.h:89
const TLorentzVector & EndPosition() const
Definition: MCParticle.h:225
double Length() const
Definition: Shower.h:201
int ParticleId() const
Definition: Track.h:171
const recob::Shower * GetPFParticleShower(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string showerLabel) const
Get the shower associated to this particle. Returns a null pointer if not found.
spacecharge::SpaceChargeService::provider_type const * fSCEService
double fprimaryDaughterCaloHitdQdx[NMAXDAUGHTERS][NMAXHITS]
virtual geo::Vector_t GetCalPosOffsets(geo::Point_t const &point, int const &TPCid) const =0
const simb::MCParticle * TrackIdToParticle_P(int id) const
int Mother() const
Definition: MCParticle.h:213
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
Definition: Track.h:98
std::vector< anab::Calorimetry > GetRecoTrackCalorimetry(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string caloModule) const
Get the Calorimetry(s) from a given reco track.
std::vector< anab::Calorimetry > GetRecoShowerCalorimetry(const recob::Shower &shower, art::Event const &evt, const std::string showerModule, const std::string caloModule) const
Get shower calo info.
double fprimaryDaughterCaloHitPitch[NMAXDAUGHTERS][NMAXHITS]
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
Definition: geo_vectors.h:164
static QStrList * l
Definition: config.cpp:1044
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
double fprimaryDaughterHitTime[NMAXDAUGHTERS][NMAXHITS]
int TrackId() const
Definition: MCParticle.h:210
const int NMAXHITS
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
const simb::MCParticle * GetMCParticleFromReco(detinfo::DetectorClocksData const &clockData, const recob::PFParticle &pfpart, art::Event const &evt, std::string pfparticleModule) const
T abs(T value)
double dEdx(float dqdx, float Efield)
Definition: doAna.cpp:21
double Phi() const
Definition: Track.h:178
double Length(size_t p=0) const
Access to various track properties.
Definition: Track.h:167
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::string EndProcess() const
Definition: MCParticle.h:216
double Theta() const
Access to spherical or geographical angles at vertex or at any point.
Definition: Track.h:176
const recob::Track * GetPFParticleTrack(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string trackLabel) const
Get the track associated to this particle. Returns a null pointer if not found.
double fprimaryDaughterHitPosition[NMAXDAUGHTERS][NMAXHITS][3]
const simb::MCParticle * GetMCParticleFromRecoTrack(detinfo::DetectorClocksData const &clockData, const recob::Track &track, art::Event const &evt, std::string trackModule) const
const TVector3 & Direction() const
Definition: Shower.h:189
const int NMAXDAUGHTERS
int fprimaryDaughterHitWire[NMAXDAUGHTERS][NMAXHITS]
double fprimaryDaughterOwnHitPitch[NMAXDAUGHTERS][NMAXHITS]
Detector simulation of raw signals on wires.
double fprimaryDaughterHitCharge[NMAXDAUGHTERS][NMAXHITS]
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
Vector_t EndDirection() const
Returns the direction of the trajectory at the last point.
double Vx(const int i=0) const
Definition: MCParticle.h:221
int ID() const
Definition: Track.h:198
virtual bool EnableCalSpatialSCE() const =0
protoana::ProtoDUNEPFParticleUtils pfpUtil
double StartMomentum() const
Definition: Track.h:143
Hierarchical representation of particle flow.
Definition: PFParticle.h:44
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
Point_t const & End() const
Returns the position of the last valid point of the trajectory [cm].
double fprimaryDaughterGrandparentEnd[NMAXDAUGHTERS][3]
double fprimaryDaughterStartPosition[NMAXDAUGHTERS][3]
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
Definition: WireGeo.cxx:73
TCEvent evt
Definition: DataStructs.cxx:7
const simb::MCParticle * GetMCParticleFromRecoShower(detinfo::DetectorClocksData const &clockData, const recob::Shower &shower, art::Event const &evt, std::string showerModule) const
Vector_t StartDirection() const
Returns the direction of the trajectory at the first point.
recob::tracking::Plane Plane
Definition: TrackState.h:17
Point_t const & Start() const
Returns the position of the first valid point of the trajectory [cm].
int ID() const
Definition: Shower.h:187
float GetBeamCosmicScore(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
Access the BDT output used to decide if a slice is beam-like or cosmic-like.
def parent(G, child, parent_type)
Definition: graph.py:67
double Vy(const int i=0) const
Definition: MCParticle.h:222
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:49
QTextStream & endl(QTextStream &s)
double fprimaryDaughterGrandparentStart[NMAXDAUGHTERS][3]
size_t Daughter(size_t idx) const
Returns the ID of the specified daughter.
Definition: PFParticle.h:111
WireGeo const * WirePtr(geo::WireID const &wireid) const
Returns the specified wire.
void protoana::ProtoDUNEPizeroAnaTree::Initialise ( )
private

Definition at line 1558 of file ProtoDUNEPizeroAnaTree_module.cc.

1558  {
1559  fRun = -999;
1560  fSubRun = -999;
1561  fevent = -999;
1562  fTimeStamp = -999.0;
1563  for(int k=0; k < 5; k++)
1564  fNactivefembs[k] = -999;
1565 
1566  for(int k=0; k < 3; k++){
1567  fbeamtrackPos[k] = -999.0;
1568  fbeamtrackEndPos[k] = -999.0;
1569  fbeamtrackDir[k] = -999.0;
1570  fprimaryTruth_vtx[k]= -999.0;
1571  fprimaryVertex[k] = -999.0;
1572  fprimaryEndPosition[k] = -999.0;
1573  fprimaryStartPosition[k] = -999.0;
1574  fprimaryEndDirection[k] = -999.0;
1575  fprimaryStartDirection[k] = -999.0;
1576  fprimaryKineticEnergy[k] = -999.0;
1577  fprimaryRange[k] = -999.0;
1578  }
1579  for( int l=0; l<1000; l ++) {
1580  fbeamtrackPos_at[l][0] = -999.;
1581  fbeamtrackPos_at[l][1] = -999.;
1582  fbeamtrackPos_at[l][2] = -999.;
1583  fbeamtrackMom_at[l][0] = -999.;
1584  fbeamtrackMom_at[l][1] = -999.;
1585  fbeamtrackMom_at[l][2] = -999.;
1586  fbeamtrackMom_at[l][3] = -999.;
1587  }
1589  for( int m=0; m<NMAXHITS; m ++){
1590  fprimarydEdx[m]= -999.0;
1591  fprimarydQdx[m]= -999.0;
1592  fprimary_cal_pos[m][0] = -999.0;
1593  fprimary_cal_pos[m][1] = -999.0;
1594  fprimary_cal_pos[m][2] = -999.0;
1595  fprimary_cal_pitch[m]=-999.0;
1596  fprimaryResidualRange[m] = -999.0;
1597 
1598  fprimaryShower_hit_w[m] =-999.0;
1599  fprimaryShower_hit_q[m] =-999.0;
1600  fprimaryShower_hit_t[m] =-999.0;
1601  fprimaryShower_hit_pos[m][0] =-999.0;
1602  fprimaryShower_hit_pos[m][1] =-999.0;
1603  fprimaryShower_hit_pos[m][2] =-999.0;
1604  }
1605  fprimaryTruth_trkID =-999;
1606  fprimaryTruth_pdg = -999;
1607  fprimaryTruth_E = -999;
1608  fprimarynCal = 0;
1609  fbeamCheckIsMatched = -999;
1610  fbeamtrigger = -999;
1611  ftof = -999.0;
1612  for(int k=0; k < 2; k++){
1613  fcerenkovPressure[k] = -999.0;
1614  fcerenkovTime[k] = -999.0;
1615  fcerenkovStatus[k] = -999;
1616  }
1617  fbeamtrackMomentum = -999.0;
1618  fbeamtrackEnergy = 999.0;
1619  fbeamtrackPdg = -999;
1620  fbeamtrackTime = -999.0;
1621  fbeamtrackID = -999;
1622  fbeam_ntrjPoints =0;
1624  fprimaryIstrack = -999;
1625  fprimaryIsshower = -999;
1626 
1627  fprimaryBDTScore = -999.0;
1628  fprimaryCNNScore = -999.0;
1629  fprimaryNHits = 0;
1630  fprimaryTheta = -999.0;
1631  fprimaryPhi = -999.0;
1632  fprimaryLength = -999.0;
1633  fprimaryMomentum = -999.0;
1634  fprimaryEndMomentum = -999.0;
1635  fprimaryOpeningAngle = -999.0;
1636  fprimaryShowerBestPlane = -999;
1637  fprimaryShowerEnergy = -999.0;
1638  fprimaryShowerCharge = -999.0;
1639  fprimaryShowerMIPEnergy = -999.0;
1640  fprimaryID = -999;
1642  fprimaryT0 = -999.0;
1643  fprimaryNDaughters = 0;
1644 
1645  for(unsigned k = 0; k < NMAXDAUGHTERS; ++k) {
1646  fprimaryDaughterID[k] = -999;
1647  fprimaryDaughterIstrack[k] = -999;
1648  fprimaryDaughterIsshower[k] = -999;
1649  fprimaryDaughterBDTScore[k] = -999.0;
1650  fprimaryDaughterCNNScore[k] = -999.0;
1652  fprimaryDaughterNHits[k] = 0;
1653  fprimaryDaughterEnergy[k] = -999.0;
1655  fprimaryDaughterMomentum[k] = -999.0;
1656  fprimaryDaughterEndMomentum[k] = -999.0;
1657  fprimaryDaughterLength[k] = -999.0;
1658  for(unsigned l = 0; l < 3; ++l) {
1659  fprimaryDaughterStartPosition[k][l] = -999.0;
1660  fprimaryDaughterEndPosition[k][l] = -999.0;
1661  fprimaryDaughterStartDirection[k][l] = -999.0;
1662  fprimaryDaughterEndDirection[k][l] = -999.0;
1663  }
1664  fprimaryDaughterParentPdg[k] = -999;
1666  fprimaryDaughterParentID[k] = -999;
1668  fprimaryDaughterParentE[k] = -999.0;
1669  fprimaryDaughterGrandparentE[k] = -999.0;
1670  fprimaryDaughterParentStart[k][0] = -999.0;
1671  fprimaryDaughterParentStart[k][1] = -999.0;
1672  fprimaryDaughterParentStart[k][2] = -999.0;
1673  fprimaryDaughterGrandparentStart[k][0] = -999.0;
1674  fprimaryDaughterGrandparentStart[k][1] = -999.0;
1675  fprimaryDaughterGrandparentStart[k][2] = -999.0;
1676  fprimaryDaughterParentEnd[k][0] = -999.0;
1677  fprimaryDaughterParentEnd[k][1] = -999.0;
1678  fprimaryDaughterParentEnd[k][2] = -999.0;
1679  fprimaryDaughterGrandparentEnd[k][0] = -999.0;
1680  fprimaryDaughterGrandparentEnd[k][1] = -999.0;
1681  fprimaryDaughterGrandparentEnd[k][2] = -999.0;
1683  for(unsigned l = 0; l < NMAXHITS; ++l) {
1684  // fprimaryDaughterHitdQdx[k][l] = -999.0;
1685  fprimaryDaughterCaloHitdQdx[k][l] = -999.0;
1686  fprimaryDaughterCaloHitPitch[k][l] = -999.0;
1687  fprimaryDaughterOwnHitPitch[k][l] = -999.0;
1688  fprimaryDaughterHitCharge[k][l] = -999.0;
1689  // fprimaryDaughterHitdEdxArea[k][l] = -999.0;
1690  fprimaryDaughterHitWire[k][l] = -999;
1691  fprimaryDaughterHitTime[k][l] = -999.0;
1692  fprimaryDaughterHitPosition[k][l][0] = -999.0;
1693  fprimaryDaughterHitPosition[k][l][1] = -999.0;
1694  fprimaryDaughterHitPosition[k][l][2] = -999.0;
1695  // fprimaryDaughterCaloHitPosition[k][l][0] = -999.0;
1696  // fprimaryDaughterCaloHitPosition[k][l][1] = -999.0;
1697  // fprimaryDaughterCaloHitPosition[k][l][2] = -999.0;
1698  }
1699  }
1700 
1701  // // Instead of primary daughters, look at all objects in APA3
1702  // for(int obji = 0; obji < NMAXOBJECTS; ++obji) {
1703  // fObjID[obji] = -999;
1704  // fObjIsTrack[obji] = -999;
1705  // fObjIsShower[obji] = -999;
1706  // fObjIsPrimaryDaughter[obji] = -999;
1707  // fObjBDTscore[obji] = -999.0;
1708  // fObjCNNscore[obji] = -999.0;
1709  // fObjMomentum[obji] = -999.0;
1710  // fObjEndMomentum[obji] = -999.0;
1711  // fObjLength[obji] = -999.0;
1712  // for(int pi = 0; pi < 3; ++pi) {
1713  // fObjStartPosition[obji][pi] = -999.0;
1714  // fObjEndPosition[obji][pi] = -999.0;
1715  // fObjStartDirection[obji][pi] = -999.0;
1716  // fObjEndDirection[obji][pi] = -999.0;
1717  // }
1718  // fObjMCParentPdg[obji] = -999;
1719  // fObjMCGrandparentPdg[obji] = -999;
1720  // fObjMCParentID[obji] = -999;
1721  // fObjMCGrandparentID[obji] = -999;
1722  // // Hit information
1723  // fObjNumHits[obji] = -999;
1724  // for(int hiti = 0; hiti < NMAXHITS; ++hiti) {
1725  // fObjHitPosition[obji][hiti][0] = -999.0;
1726  // fObjHitPosition[obji][hiti][1] = -999.0;
1727  // fObjHitPosition[obji][hiti][2] = -999.0;
1728  // fObjHitTime[obji][hiti] = -999.0;
1729  // fObjHitWire[obji][hiti] = -999;
1730  // fObjHitCharge[obji][hiti] = -999.0;
1731  // fObjHitPitch[obji][hiti] = -999.0;
1732  // fObjHitdEdx[obji][hiti] = -999.0;
1733  // fObjHitdQdx[obji][hiti] = -999.0;
1734  // }
1735  // }
1736 
1737  ResetPi0Vars();
1738 } // Initialise
double fprimaryDaughterStartDirection[NMAXDAUGHTERS][3]
double fprimaryDaughterCaloHitdQdx[NMAXDAUGHTERS][NMAXHITS]
double fprimaryDaughterCaloHitPitch[NMAXDAUGHTERS][NMAXHITS]
static QStrList * l
Definition: config.cpp:1044
double fprimaryDaughterHitTime[NMAXDAUGHTERS][NMAXHITS]
const int NMAXHITS
double fprimaryDaughterHitPosition[NMAXDAUGHTERS][NMAXHITS][3]
const int NMAXDAUGHTERS
int fprimaryDaughterHitWire[NMAXDAUGHTERS][NMAXHITS]
double fprimaryDaughterOwnHitPitch[NMAXDAUGHTERS][NMAXHITS]
double fprimaryDaughterHitCharge[NMAXDAUGHTERS][NMAXHITS]
double fprimaryDaughterGrandparentEnd[NMAXDAUGHTERS][3]
double fprimaryDaughterStartPosition[NMAXDAUGHTERS][3]
double fprimaryDaughterGrandparentStart[NMAXDAUGHTERS][3]
ProtoDUNEPizeroAnaTree& protoana::ProtoDUNEPizeroAnaTree::operator= ( ProtoDUNEPizeroAnaTree const &  )
delete
ProtoDUNEPizeroAnaTree& protoana::ProtoDUNEPizeroAnaTree::operator= ( ProtoDUNEPizeroAnaTree &&  )
delete
void protoana::ProtoDUNEPizeroAnaTree::ResetPi0Vars ( )
private

Definition at line 1740 of file ProtoDUNEPizeroAnaTree_module.cc.

1740  {
1741  for(int pi0i = 0; pi0i < NMAXPIZEROS; ++pi0i) {
1742  // MC pi0 variables
1743  fMCPi0ID[pi0i] = -999;
1744  fMCPi0Energy[pi0i] = -999.0;
1745  for(int i=0; i<3; ++i) {
1746  fMCPi0StartPosition[pi0i][i] = -999.0;
1747  fMCPi0EndPosition[pi0i][i] = -999.0;
1748  }
1749  fMCPhoton1ID[pi0i] = -999;
1750  fMCPhoton2ID[pi0i] = -999;
1751  fMCPhoton1Energy[pi0i] = -999.0;
1752  fMCPhoton2Energy[pi0i] = -999.0;
1753  for(int i=0; i<3; ++i) {
1754  fMCPhoton1StartPosition[pi0i][i] = -999.0;
1755  fMCPhoton2StartPosition[pi0i][i] = -999.0;
1756  fMCPhoton1EndPosition[pi0i][i] = -999.0;
1757  fMCPhoton2EndPosition[pi0i][i] = -999.0;
1758  }
1759  // Reco hits related to photons
1760  fMCPhoton1NumHits[pi0i] = -999;
1761  fMCPhoton2NumHits[pi0i] = -999;
1762  for(int i=0; i < NMAXHITS; ++i) {
1763  fMCPhoton1_hit_w[pi0i][i] = -999;
1764  fMCPhoton2_hit_w[pi0i][i] = -999;
1765  fMCPhoton1_hit_t[pi0i][i] = -999.0;
1766  fMCPhoton2_hit_t[pi0i][i] = -999.0;
1767  fMCPhoton1_hit_q[pi0i][i] = -999.0;
1768  fMCPhoton2_hit_q[pi0i][i] = -999.0;
1769  fMCPhoton1_hit_pos[pi0i][i][0] = -999.0;
1770  fMCPhoton2_hit_pos[pi0i][i][0] = -999.0;
1771  fMCPhoton1_hit_pos[pi0i][i][1] = -999.0;
1772  fMCPhoton2_hit_pos[pi0i][i][1] = -999.0;
1773  fMCPhoton1_hit_pos[pi0i][i][2] = -999.0;
1774  fMCPhoton2_hit_pos[pi0i][i][2] = -999.0;
1775  }
1776 
1777  // Reco pi0 variables
1778  fShower1ID[pi0i] = -999;
1779  fShower2ID[pi0i] = -999;
1780  for(int i=0; i<3; ++i) {
1781  fShower1StartPosition[pi0i][i] = -999.0;
1782  fShower2StartPosition[pi0i][i] = -999.0;
1783  fShower1Direction[pi0i][i] = -999.0;
1784  fShower2Direction[pi0i][i] = -999.0;
1785  }
1786  fShower1Length[pi0i] = -999.0;
1787  fShower2Length[pi0i] = -999.0;
1788  fShower1Completeness[pi0i] = -999.0;
1789  fShower2Completeness[pi0i] = -999.0;
1790  fShower1Purity[pi0i] = -999.0;
1791  fShower2Purity[pi0i] = -999.0;
1792  // Reco hits related to showers
1793  fShower1NumHits[pi0i] = -999;
1794  fShower2NumHits[pi0i] = -999;
1795  fShower1_cal_E[pi0i] = -999.0;
1796  fShower2_cal_E[pi0i] = -999.0;
1797  fShower1Energy[pi0i] = -999.0;
1798  fShower2Energy[pi0i] = -999.0;
1799  fShower1EnergyFromHits[pi0i] = -999.0;
1800  fShower2EnergyFromHits[pi0i] = -999.0;
1801  fShower1HasBeamParent[pi0i] = -999;
1802  fShower2HasBeamParent[pi0i] = -999;
1803  fShower1HasBeamGrandparent[pi0i] = -999;
1804  fShower2HasBeamGrandparent[pi0i] = -999;
1805  for(int i=0; i<NMAXHITS; ++i) {
1806  fShower1_cnn_sc[pi0i][i] = -999.0;
1807  fShower2_cnn_sc[pi0i][i] = -999.0;
1808  fShower1_cal_pos[pi0i][i][0] = -999.0;
1809  fShower2_cal_pos[pi0i][i][0] = -999.0;
1810  fShower1_cal_pos[pi0i][i][1] = -999.0;
1811  fShower2_cal_pos[pi0i][i][1] = -999.0;
1812  fShower1_cal_pos[pi0i][i][2] = -999.0;
1813  fShower2_cal_pos[pi0i][i][2] = -999.0;
1814  fShower1_cal_pitch[pi0i][i] = -999.0;
1815  fShower2_cal_pitch[pi0i][i] = -999.0;
1816  fShower1_cal_dEdx[pi0i][i] = -999.0;
1817  fShower2_cal_dEdx[pi0i][i] = -999.0;
1818  fShower1_cal_dQdx[pi0i][i] = -999.0;
1819  fShower2_cal_dQdx[pi0i][i] = -999.0;
1820  }
1821  } // Loop over NMAXPIZEROS
1822 } // ResetPi0Vars
double fShower2_cal_dEdx[NMAXPIZEROS][NMAXHITS]
double fShower1_cal_pos[NMAXPIZEROS][NMAXHITS][3]
double fShower1_cal_pitch[NMAXPIZEROS][NMAXHITS]
double fShower2_cal_pitch[NMAXPIZEROS][NMAXHITS]
double fShower2_cal_dQdx[NMAXPIZEROS][NMAXHITS]
double fMCPhoton2_hit_pos[NMAXPIZEROS][NMAXHITS][3]
const int NMAXHITS
double fMCPhoton2_hit_q[NMAXPIZEROS][NMAXHITS]
const int NMAXPIZEROS
double fShower1_cal_dQdx[NMAXPIZEROS][NMAXHITS]
double fShower1_cal_dEdx[NMAXPIZEROS][NMAXHITS]
double fMCPhoton1_hit_t[NMAXPIZEROS][NMAXHITS]
double fMCPhoton2_hit_t[NMAXPIZEROS][NMAXHITS]
double fShower2_cal_pos[NMAXPIZEROS][NMAXHITS][3]
double fShower2_cnn_sc[NMAXPIZEROS][NMAXHITS]
double fShower1_cnn_sc[NMAXPIZEROS][NMAXHITS]
double fMCPhoton1_hit_pos[NMAXPIZEROS][NMAXHITS][3]
double fMCPhoton1_hit_q[NMAXPIZEROS][NMAXHITS]
void protoana::ProtoDUNEPizeroAnaTree::setPiZeroInfo ( art::Event const &  evt,
detinfo::DetectorClocksData const &  clockData,
detinfo::DetectorPropertiesData const &  detProp,
const std::vector< const simb::MCParticle * > &  pi0s 
)
private

Definition at line 1334 of file ProtoDUNEPizeroAnaTree_module.cc.

1337  {
1338  // Clean slate
1339  ResetPi0Vars();
1340 
1341  // Loop over all pi0s in the array by index.
1342  for(unsigned pi0i = 0; pi0i < NMAXPIZEROS && pi0i < pi0s.size(); ++pi0i) {
1343  pizero::PiZeroProcess pzproc(*(pi0s[pi0i]), evt, clockData, detProp, fShowerTag);
1344 
1345  // Set MC object variables
1346  if(pzproc.allMCSet()) {
1347 
1348  const simb::MCParticle* pi0 = pzproc.pi0();
1349  const simb::MCParticle* photon1 = pzproc.photon1();
1350  const simb::MCParticle* photon2 = pzproc.photon2();
1351 
1352  // MC pi0 variables
1353  fMCPi0ID[pi0i] = pi0->TrackId();
1354  fMCPi0Energy[pi0i] = pi0->E();
1355  pi0->Position().Vect().GetXYZ(fMCPi0StartPosition[pi0i]);
1356  pi0->EndPosition().Vect().GetXYZ(fMCPi0EndPosition[pi0i]);
1357  fMCPhoton1ID[pi0i] = photon1->TrackId();
1358  fMCPhoton2ID[pi0i] = photon2->TrackId();
1359  fMCPhoton1Energy[pi0i] = photon1->E();
1360  fMCPhoton2Energy[pi0i] = photon2->E();
1361  photon1->Position().Vect().GetXYZ(fMCPhoton1StartPosition[pi0i]);
1362  photon2->Position().Vect().GetXYZ(fMCPhoton2StartPosition[pi0i]);
1363  photon1->EndPosition().Vect().GetXYZ(fMCPhoton1EndPosition[pi0i]);
1364  photon2->EndPosition().Vect().GetXYZ(fMCPhoton2EndPosition[pi0i]);
1365  // Reco hits related to photons
1366  std::vector<const recob::Hit*> ph1hits = truthUtil.GetMCParticleHits(clockData, *photon1, evt, fHitTag);
1367  std::vector<const recob::Hit*> ph2hits = truthUtil.GetMCParticleHits(clockData, *photon2, evt, fHitTag);
1368  // Photon 1 hits
1369  art::FindManyP<recob::SpacePoint> ph1sps(ph1hits, evt, fPFParticleTag);
1370  unsigned phi1 = 0;
1371  for(unsigned i=0; i<ph1hits.size(); ++i) {
1372  if(ph1hits[i]->WireID().Plane != 2) continue;
1373  fMCPhoton1_hit_w[pi0i][phi1] = ph1hits[phi1]->WireID().Wire;
1374  fMCPhoton1_hit_t[pi0i][phi1] = ph1hits[phi1]->PeakTime();
1375  fMCPhoton1_hit_q[pi0i][phi1] = ph1hits[phi1]->Integral();
1376  std::vector<art::Ptr<recob::SpacePoint>> sps = ph1sps.at(i);
1377  if(!sps.empty()) {
1378  fMCPhoton1_hit_pos[pi0i][phi1][0] = sps[0]->XYZ()[0];
1379  fMCPhoton1_hit_pos[pi0i][phi1][1] = sps[0]->XYZ()[1];
1380  fMCPhoton1_hit_pos[pi0i][phi1][2] = sps[0]->XYZ()[2];
1381  }
1382  ++phi1;
1383  }
1384  // Photon 2 hits
1385  art::FindManyP<recob::SpacePoint> ph2sps(ph2hits, evt, fPFParticleTag);
1386  unsigned phi2 = 0;
1387  for(unsigned i=0; i<ph2hits.size(); ++i) {
1388  if(ph2hits[i]->WireID().Plane != 2) continue;
1389  fMCPhoton2_hit_w[pi0i][phi2] = ph2hits[phi2]->WireID().Wire;
1390  fMCPhoton2_hit_t[pi0i][phi2] = ph2hits[phi2]->PeakTime();
1391  fMCPhoton2_hit_q[pi0i][phi2] = ph2hits[phi2]->Integral();
1392  std::vector<art::Ptr<recob::SpacePoint>> sps = ph2sps.at(i);
1393  if(!sps.empty()) {
1394  fMCPhoton2_hit_pos[pi0i][phi2][0] = sps[0]->XYZ()[0];
1395  fMCPhoton2_hit_pos[pi0i][phi2][1] = sps[0]->XYZ()[1];
1396  fMCPhoton2_hit_pos[pi0i][phi2][2] = sps[0]->XYZ()[2];
1397  }
1398  ++phi2;
1399  }
1400  fMCPhoton1NumHits[pi0i] = phi1;
1401  fMCPhoton2NumHits[pi0i] = phi2;
1402 
1403  } // if MC set
1404 
1405  //This is how we get cnn score for now
1406  auto recoShowers = evt.getValidHandle< std::vector< recob::Shower > >(fShowerTag);
1407  auto recoTracks = evt.getValidHandle< std::vector< recob::Track > >(fTrackTag);
1408  art::FindManyP<recob::Hit> findHitsFromShowers(recoShowers,evt,fShowerTag);
1409  art::FindManyP<recob::Hit> findHitsFromTracks(recoTracks,evt,fTrackTag);
1410  anab::MVAReader<recob::Hit,4> hitResults(evt, "emtrkmichelid:emtrkmichel" );
1411 
1412  // First shower
1413  const recob::Shower* shower1 = pzproc.shower1();
1414  if(shower1 != 0x0) {
1415  fShower1ID[pi0i] = showerUtil.GetShowerIndex(*shower1, evt, fShowerTag);
1416  std::vector< art::Ptr< recob::Hit > > sh1_hits = findHitsFromShowers.at(fShower1ID[pi0i]);
1417  for( size_t i=0; i<sh1_hits.size(); ++i){
1418  std::array<float,4> cnn_out = hitResults.getOutput( sh1_hits[i] );
1419  double p_trk_or_sh = cnn_out[ hitResults.getIndex("track") ]+ cnn_out[ hitResults.getIndex("em") ];
1420  double cnn_score = cnn_out[ hitResults.getIndex("em") ]/p_trk_or_sh;
1421  fShower1_cnn_sc[pi0i][i] = cnn_score;
1422  }
1423  shower1->ShowerStart().GetXYZ(fShower1StartPosition[pi0i]);
1424  shower1->Direction().GetXYZ(fShower1Direction[pi0i]);
1425  fShower1Length[pi0i] = shower1->Length();
1426  unsigned numMChits = truthUtil.GetMCParticleHits(clockData, *pzproc.photon1(), evt, fHitTag).size();
1427  unsigned showerHits = showerUtil.GetRecoShowerHits(*shower1, evt, fShowerTag).size();
1428  unsigned sharedHits = truthUtil.GetSharedHits(clockData, *pzproc.photon1(), *shower1, evt, fShowerTag, true).size();
1429  fShower1Completeness[pi0i] = (double)sharedHits/numMChits;
1430  fShower1Purity[pi0i] = (double)sharedHits/showerHits;
1431  // Find out whether (grand)parent of shower was primary.
1432  // Go through all PFParticles until the right one is found.
1433  const recob::PFParticle* shpfp = 0x0;
1434  std::vector<const recob::PFParticle*> beamPFParticles = pfpUtil.GetPFParticlesFromBeamSlice(evt,fPFParticleTag);
1435  auto PFParticleHandle = evt.getHandle<std::vector<recob::PFParticle> >(fPFParticleTag);
1436  if (PFParticleHandle && beamPFParticles.size() != 0) {
1437  const recob::PFParticle* beampfp = beamPFParticles[0];
1438  for(const recob::PFParticle& pfp : *PFParticleHandle) {
1439  const recob::Shower* thish = pfpUtil.GetPFParticleShower(pfp,evt,fPFParticleTag,fShowerTag);
1440  if(thish == 0x0) continue;
1441  // Test whether it's the right shower by comparing lengths.
1442  if(thish->Length() - shower1->Length() < 1e-5) {
1443  shpfp = &pfp;
1444  break;
1445  }
1446  }
1447  // Is PFP's parent or PFP's grandparent the beam particle?
1448  const recob::PFParticle* parent = 0x0;
1449  const recob::PFParticle* gparent = 0x0;
1450  if(shpfp && shpfp->Parent() != 0 && shpfp->Parent() < PFParticleHandle->size())
1451  parent = &PFParticleHandle->at(shpfp->Parent());
1452  if(parent && parent->Parent() != 0 && parent->Parent() < PFParticleHandle->size()) gparent = &PFParticleHandle->at(parent->Parent());
1453 
1454  fShower1HasBeamParent[pi0i] = parent && parent->Self() == beampfp->Self()? 1: 0;
1455  fShower1HasBeamGrandparent[pi0i] = gparent && gparent->Self() == beampfp->Self()? 1: 0;
1456  } // if get pfparticles and beampfparticles
1457 
1458  // Calorimetry related to showers
1459  std::vector<anab::Calorimetry> sh1calo = showerUtil.GetRecoShowerCalorimetry(*shower1, evt, fShowerTag, fShowerCaloTag);
1460  for(unsigned k=0; k<sh1calo.size(); ++k) {
1461  if(sh1calo[k].PlaneID().Plane != 2) continue;
1462 
1463  fShower1NumHits[pi0i] = std::min((int)sh1calo[k].dEdx().size(), NMAXHITS);
1464  fShower1_cal_E[pi0i] = sh1calo[k].KineticEnergy();
1465  std::vector<const recob::Hit*> shHitPtrs = showerUtil.GetRecoShowerHits(
1466  *shower1, evt, fShowerTag);
1468  detProp,
1469  shHitPtrs,
1470  fCalorimetryAlg)[2];
1471 
1472  for(int i=0; i<fShower1NumHits[pi0i]; ++i) {
1473  const geo::Point_t& pos = sh1calo[k].XYZ()[i];
1474  fShower1_cal_pos[pi0i][i][0] = pos.X();
1475  fShower1_cal_pos[pi0i][i][1] = pos.Y();
1476  fShower1_cal_pos[pi0i][i][2] = pos.Z();
1477  fShower1_cal_pitch[pi0i][i] = sh1calo[k].TrkPitchVec()[i];
1478  fShower1_cal_dEdx[pi0i][i] = sh1calo[k].dEdx()[i];
1479  fShower1_cal_dQdx[pi0i][i] = sh1calo[k].dQdx()[i];
1480  }
1481  }
1482  } // if shower1 != 0x0
1483  // Second shower
1484  const recob::Shower* shower2 = pzproc.shower2();
1485  if(shower2 != 0x0) {
1486  // Reco pi0 variables
1487  fShower2ID[pi0i] = showerUtil.GetShowerIndex(*shower2, evt, fShowerTag);
1488  std::vector< art::Ptr< recob::Hit > > sh2_hits = findHitsFromShowers.at(fShower2ID[pi0i]);
1489  for( size_t i=0; i<sh2_hits.size(); ++i){
1490  std::array<float,4> cnn_out = hitResults.getOutput( sh2_hits[i] );
1491  double p_trk_or_sh = cnn_out[ hitResults.getIndex("track") ]+ cnn_out[ hitResults.getIndex("em") ];
1492  double cnn_score = cnn_out[ hitResults.getIndex("em") ]/p_trk_or_sh;
1493  fShower2_cnn_sc[pi0i][i] = cnn_score;
1494  }
1495  shower2->ShowerStart().GetXYZ(fShower2StartPosition[pi0i]);
1496  shower2->Direction().GetXYZ(fShower2Direction[pi0i]);
1497  fShower2Length[pi0i] = shower2->Length();
1498  unsigned numMChits = truthUtil.GetMCParticleHits(clockData, *pzproc.photon2(), evt, fHitTag).size();
1499  unsigned showerHits = showerUtil.GetRecoShowerHits(*shower2, evt, fShowerTag).size();
1500  unsigned sharedHits = truthUtil.GetSharedHits(clockData, *pzproc.photon2(), *shower2, evt, fShowerTag, true).size();
1501  fShower2Completeness[pi0i] = (double)sharedHits/numMChits;
1502  fShower2Purity[pi0i] = (double)sharedHits/showerHits;
1503  // Find out whether (grand)parent of shower was primary.
1504  // Go through all PFParticles until the right one is found.
1505  const recob::PFParticle* shpfp = 0x0;
1506  std::vector<const recob::PFParticle*> beamPFParticles = pfpUtil.GetPFParticlesFromBeamSlice(evt,fPFParticleTag);
1507  auto PFParticleHandle = evt.getHandle<std::vector<recob::PFParticle>>(fPFParticleTag);
1508  if (PFParticleHandle && beamPFParticles.size() != 0) {
1509  const recob::PFParticle* beampfp = beamPFParticles[0];
1510  for(const recob::PFParticle& pfp : *PFParticleHandle) {
1511  const recob::Shower* thish = pfpUtil.GetPFParticleShower(pfp,evt,fPFParticleTag,fShowerTag);
1512  if(thish == 0x0) continue;
1513  // Test whether it's the right shower by comparing lengths.
1514  if(thish->Length() - shower2->Length() < 1e-5) {
1515  shpfp = &pfp;
1516  break;
1517  }
1518  }
1519  // Is PFP's parent or PFP's grandparent the beam particle?
1520  const recob::PFParticle* parent = 0x0;
1521  const recob::PFParticle* gparent = 0x0;
1522  if(shpfp && shpfp->Parent() != 0 && shpfp->Parent() < PFParticleHandle->size()) parent = &PFParticleHandle->at(shpfp->Parent());
1523  if(parent && parent->Parent() != 0 && parent->Parent() < PFParticleHandle->size()) gparent = &PFParticleHandle->at(parent->Parent());
1524 
1525  fShower2HasBeamParent[pi0i] = parent && parent->Self() == beampfp->Self()? 1: 0;
1526  fShower2HasBeamGrandparent[pi0i] = gparent && gparent->Self() == beampfp->Self()? 1: 0;
1527  } // if get pfparticles and beampfparticles
1528 
1529  // Calorimetry related to showers
1530  std::vector<anab::Calorimetry> sh2calo = showerUtil.GetRecoShowerCalorimetry(*shower2, evt, fShowerTag, fShowerCaloTag);
1531  for(unsigned k=0; k<sh2calo.size(); ++k) {
1532  if(sh2calo[k].PlaneID().Plane != 2) continue;
1533 
1534  fShower2NumHits[pi0i] = std::min((int)sh2calo[k].dEdx().size(), NMAXHITS);
1535  fShower2_cal_E[pi0i] = sh2calo[k].KineticEnergy();
1536  std::vector<const recob::Hit*> shHitPtrs = showerUtil.GetRecoShowerHits(
1537  *shower2, evt, fShowerTag);
1539  shHitPtrs, fCalorimetryAlg)[2];
1540  for(int i=0; i<fShower2NumHits[pi0i]; ++i) {
1541  const geo::Point_t& pos = sh2calo[k].XYZ()[i];
1542  fShower2_cal_pos[pi0i][i][0] = pos.X();
1543  fShower2_cal_pos[pi0i][i][1] = pos.Y();
1544  fShower2_cal_pos[pi0i][i][2] = pos.Z();
1545  fShower2_cal_pitch[pi0i][i] = sh2calo[k].TrkPitchVec()[i];
1546  fShower2_cal_dEdx[pi0i][i] = sh2calo[k].dEdx()[i];
1547  fShower2_cal_dQdx[pi0i][i] = sh2calo[k].dQdx()[i];
1548  }
1549  }
1550  } // if shower2 != 0x0
1551  } // Loop over pi0s
1552 
1553 } // setPiZeroInfo
double E(const int i=0) const
Definition: MCParticle.h:233
double fShower2_cal_dEdx[NMAXPIZEROS][NMAXHITS]
const TVector3 & ShowerStart() const
Definition: Shower.h:192
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:219
const std::vector< const recob::Hit * > GetRecoShowerHits(const recob::Shower &shower, art::Event const &evt, const std::string showerModule) const
Get the hits from a given reco shower.
double fShower1_cal_pos[NMAXPIZEROS][NMAXHITS][3]
std::vector< double > EstimateEnergyFromHitCharge(detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::vector< const recob::Hit * > &hits, calo::CalorimetryAlg caloAlg)
double fShower1_cal_pitch[NMAXPIZEROS][NMAXHITS]
double fShower2_cal_pitch[NMAXPIZEROS][NMAXHITS]
const TLorentzVector & EndPosition() const
Definition: MCParticle.h:225
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:92
double Length() const
Definition: Shower.h:201
const recob::Shower * GetPFParticleShower(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, const std::string showerLabel) const
Get the shower associated to this particle. Returns a null pointer if not found.
std::vector< anab::Calorimetry > GetRecoShowerCalorimetry(const recob::Shower &shower, art::Event const &evt, const std::string showerModule, const std::string caloModule) const
Get shower calo info.
double fShower2_cal_dQdx[NMAXPIZEROS][NMAXHITS]
int TrackId() const
Definition: MCParticle.h:210
double fMCPhoton2_hit_pos[NMAXPIZEROS][NMAXHITS][3]
const int NMAXHITS
std::vector< const recob::Hit * > GetMCParticleHits(detinfo::DetectorClocksData const &clockData, const simb::MCParticle &mcpart, const art::Event &evt, std::string hitModule, bool use_eve=true) const
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
double fMCPhoton2_hit_q[NMAXPIZEROS][NMAXHITS]
double dEdx(float dqdx, float Efield)
Definition: doAna.cpp:21
const int NMAXPIZEROS
const double e
double fShower1_cal_dQdx[NMAXPIZEROS][NMAXHITS]
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
int GetShowerIndex(const recob::Shower &shower, art::Event const &evt, const std::string showerModule) const
If the shower.ID() isn&#39;t filled we must find the actual shower index ourselves.
double fShower1_cal_dEdx[NMAXPIZEROS][NMAXHITS]
size_t Parent() const
Definition: PFParticle.h:96
double fMCPhoton1_hit_t[NMAXPIZEROS][NMAXHITS]
const std::vector< const recob::PFParticle * > GetPFParticlesFromBeamSlice(art::Event const &evt, const std::string particleLabel) const
Return the pointers for the PFParticles in the beam slice. Returns an empty vector is no beam slice w...
const TVector3 & Direction() const
Definition: Shower.h:189
double fMCPhoton2_hit_t[NMAXPIZEROS][NMAXHITS]
double fShower2_cal_pos[NMAXPIZEROS][NMAXHITS][3]
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:184
protoana::ProtoDUNEPFParticleUtils pfpUtil
Hierarchical representation of particle flow.
Definition: PFParticle.h:44
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
double fShower2_cnn_sc[NMAXPIZEROS][NMAXHITS]
double fShower1_cnn_sc[NMAXPIZEROS][NMAXHITS]
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
TCEvent evt
Definition: DataStructs.cxx:7
double fMCPhoton1_hit_pos[NMAXPIZEROS][NMAXHITS][3]
std::vector< const recob::Hit * > GetSharedHits(detinfo::DetectorClocksData const &clockData, const simb::MCParticle &mcpart, const recob::PFParticle &pfpart, const art::Event &evt, std::string pfparticleModule, bool delta_ray=false) const
def parent(G, child, parent_type)
Definition: graph.py:67
double fMCPhoton1_hit_q[NMAXPIZEROS][NMAXHITS]

Member Data Documentation

protoana::ProtoDUNEBeamlineUtils protoana::ProtoDUNEPizeroAnaTree::beamlineUtil
private

Definition at line 116 of file ProtoDUNEPizeroAnaTree_module.cc.

art::ServiceHandle<cheat::BackTrackerService> protoana::ProtoDUNEPizeroAnaTree::bt_serv
private

Definition at line 117 of file ProtoDUNEPizeroAnaTree_module.cc.

protoana::ProtoDUNEDataUtils protoana::ProtoDUNEPizeroAnaTree::dataUtil
private

Definition at line 111 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fbeam_ntrjPoints
private

Definition at line 169 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fbeamCheckIsMatched
private

Definition at line 158 of file ProtoDUNEPizeroAnaTree_module.cc.

const art::InputTag protoana::ProtoDUNEPizeroAnaTree::fBeamModuleLabel
private

Definition at line 134 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fbeamtrackDir[3]
private

Definition at line 167 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fbeamtrackEndPos[3]
private

Definition at line 166 of file ProtoDUNEPizeroAnaTree_module.cc.

std::vector<std::string> protoana::ProtoDUNEPizeroAnaTree::fbeamtrackEndProcess
private

Definition at line 174 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fbeamtrackEnergy
private

Definition at line 164 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fbeamtrackID
private

Definition at line 171 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fbeamtrackMom_at[1000][4]
private

Definition at line 173 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fbeamtrackMomentum
private

Definition at line 163 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fbeamtrackNDaughters
private

Definition at line 175 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fbeamtrackPdg
private

Definition at line 170 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fbeamtrackPos[3]
private

Definition at line 165 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fbeamtrackPos_at[1000][3]
private

Definition at line 172 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fbeamtrackTime
private

Definition at line 168 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fbeamtrigger
private

Definition at line 157 of file ProtoDUNEPizeroAnaTree_module.cc.

calo::CalorimetryAlg protoana::ProtoDUNEPizeroAnaTree::fCalorimetryAlg
private

Definition at line 137 of file ProtoDUNEPizeroAnaTree_module.cc.

std::string protoana::ProtoDUNEPizeroAnaTree::fCalorimetryTag
private

Definition at line 136 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fcerenkovPressure[2]
private

Definition at line 162 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fcerenkovStatus[2]
private

Definition at line 160 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fcerenkovTime[2]
private

Definition at line 161 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fevent
private

Definition at line 152 of file ProtoDUNEPizeroAnaTree_module.cc.

std::string protoana::ProtoDUNEPizeroAnaTree::fGeneratorTag
private

Definition at line 143 of file ProtoDUNEPizeroAnaTree_module.cc.

geo::GeometryCore const* protoana::ProtoDUNEPizeroAnaTree::fGeometryService
private

Definition at line 352 of file ProtoDUNEPizeroAnaTree_module.cc.

std::string protoana::ProtoDUNEPizeroAnaTree::fHitTag
private

Definition at line 144 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPhoton1_hit_pos[NMAXPIZEROS][NMAXHITS][3]
private

Definition at line 310 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPhoton1_hit_q[NMAXPIZEROS][NMAXHITS]
private

Definition at line 308 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPhoton1_hit_t[NMAXPIZEROS][NMAXHITS]
private

Definition at line 306 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fMCPhoton1_hit_w[NMAXPIZEROS][NMAXHITS]
private

Definition at line 304 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPhoton1EndPosition[NMAXPIZEROS][3]
private

Definition at line 299 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPhoton1Energy[NMAXPIZEROS]
private

Definition at line 295 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fMCPhoton1ID[NMAXPIZEROS]
private

Definition at line 293 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fMCPhoton1NumHits[NMAXPIZEROS]
private

Definition at line 302 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPhoton1StartPosition[NMAXPIZEROS][3]
private

Definition at line 297 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPhoton2_hit_pos[NMAXPIZEROS][NMAXHITS][3]
private

Definition at line 311 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPhoton2_hit_q[NMAXPIZEROS][NMAXHITS]
private

Definition at line 309 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPhoton2_hit_t[NMAXPIZEROS][NMAXHITS]
private

Definition at line 307 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fMCPhoton2_hit_w[NMAXPIZEROS][NMAXHITS]
private

Definition at line 305 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPhoton2EndPosition[NMAXPIZEROS][3]
private

Definition at line 300 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPhoton2Energy[NMAXPIZEROS]
private

Definition at line 296 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fMCPhoton2ID[NMAXPIZEROS]
private

Definition at line 294 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fMCPhoton2NumHits[NMAXPIZEROS]
private

Definition at line 303 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPhoton2StartPosition[NMAXPIZEROS][3]
private

Definition at line 298 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPi0EndPosition[NMAXPIZEROS][3]
private

Definition at line 292 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPi0Energy[NMAXPIZEROS]
private

Definition at line 290 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fMCPi0ID[NMAXPIZEROS]
private

Definition at line 289 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fMCPi0StartPosition[NMAXPIZEROS][3]
private

Definition at line 291 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fNactivefembs[6]
private

Definition at line 154 of file ProtoDUNEPizeroAnaTree_module.cc.

TTree* protoana::ProtoDUNEPizeroAnaTree::fPandoraBeam
private

Definition at line 147 of file ProtoDUNEPizeroAnaTree_module.cc.

std::string protoana::ProtoDUNEPizeroAnaTree::fParticleIDTag
private

Definition at line 138 of file ProtoDUNEPizeroAnaTree_module.cc.

std::string protoana::ProtoDUNEPizeroAnaTree::fPFParticleTag
private

Definition at line 142 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimary_cal_pitch[NMAXHITS]
private

Definition at line 210 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimary_cal_pos[NMAXHITS][3]
private

Definition at line 209 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryBDTScore
private

Definition at line 181 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryCNNScore
private

Definition at line 182 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterBDTScore[NMAXDAUGHTERS]
private

Definition at line 225 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterCaloHitdQdx[NMAXDAUGHTERS][NMAXHITS]
private

Definition at line 250 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterCaloHitPitch[NMAXDAUGHTERS][NMAXHITS]
private

Definition at line 251 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterCNNScore[NMAXDAUGHTERS]
private

Definition at line 226 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterEndDirection[NMAXDAUGHTERS][3]
private

Definition at line 237 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterEndMomentum[NMAXDAUGHTERS]
private

Definition at line 232 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterEndPosition[NMAXDAUGHTERS][3]
private

Definition at line 235 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterEnergy[NMAXDAUGHTERS]
private

Definition at line 229 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterEnergyFromHits[NMAXDAUGHTERS]
private

Definition at line 230 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterGrandparentE[NMAXDAUGHTERS]
private

Definition at line 243 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterGrandparentEnd[NMAXDAUGHTERS][3]
private

Definition at line 247 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterGrandparentID[NMAXDAUGHTERS]
private

Definition at line 241 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterGrandparentPdg[NMAXDAUGHTERS]
private

Definition at line 239 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterGrandparentStart[NMAXDAUGHTERS][3]
private

Definition at line 245 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterHitCharge[NMAXDAUGHTERS][NMAXHITS]
private

Definition at line 253 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterHitPosition[NMAXDAUGHTERS][NMAXHITS][3]
private

Definition at line 257 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterHitTime[NMAXDAUGHTERS][NMAXHITS]
private

Definition at line 256 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterHitWire[NMAXDAUGHTERS][NMAXHITS]
private

Definition at line 255 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterID[NMAXDAUGHTERS]
private

Definition at line 222 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterIsshower[NMAXDAUGHTERS]
private

Definition at line 224 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterIstrack[NMAXDAUGHTERS]
private

Definition at line 223 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterLength[NMAXDAUGHTERS]
private

Definition at line 233 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterMomentum[NMAXDAUGHTERS]
private

Definition at line 231 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterNCollHits[NMAXDAUGHTERS]
private

Definition at line 227 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterNHits[NMAXDAUGHTERS]
private

Definition at line 228 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterOwnHitPitch[NMAXDAUGHTERS][NMAXHITS]
private

Definition at line 252 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterParentE[NMAXDAUGHTERS]
private

Definition at line 242 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterParentEnd[NMAXDAUGHTERS][3]
private

Definition at line 246 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterParentEndProcess[NMAXDAUGHTERS]
private

Definition at line 248 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterParentID[NMAXDAUGHTERS]
private

Definition at line 240 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterParentPdg[NMAXDAUGHTERS]
private

Definition at line 238 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterParentStart[NMAXDAUGHTERS][3]
private

Definition at line 244 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterStartDirection[NMAXDAUGHTERS][3]
private

Definition at line 236 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryDaughterStartPosition[NMAXDAUGHTERS][3]
private

Definition at line 234 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimarydEdx[NMAXHITS]
private

Definition at line 207 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimarydQdx[NMAXHITS]
private

Definition at line 208 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryEndDirection[3]
private

Definition at line 191 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryEndMomentum
private

Definition at line 188 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryEndPosition[3]
private

Definition at line 189 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryID
private

Definition at line 217 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryIsBeamparticle
private

Definition at line 199 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryIsshower
private

Definition at line 180 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryIstrack
private

Definition at line 179 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryKineticEnergy[3]
private

Definition at line 204 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryLength
private

Definition at line 186 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryMomentum
private

Definition at line 187 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryMomentumByRangeProton
private

Definition at line 198 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimarynCal
private

Definition at line 206 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryNDaughters
private

Definition at line 219 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryNHits
private

Definition at line 183 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryOpeningAngle
private

Definition at line 193 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryPhi
private

Definition at line 185 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryRange[3]
private

Definition at line 205 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryResidualRange[NMAXHITS]
private

Definition at line 211 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryShower_hit_pos[NMAXHITS][3]
private

Definition at line 216 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryShower_hit_q[NMAXHITS]
private

Definition at line 214 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryShower_hit_t[NMAXHITS]
private

Definition at line 215 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryShower_hit_w[NMAXHITS]
private

Definition at line 213 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryShower_nHits
private

Definition at line 212 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryShowerBestPlane
private

Definition at line 194 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryShowerCharge
private

Definition at line 196 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryShowerEnergy
private

Definition at line 195 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryShowerMIPEnergy
private

Definition at line 197 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryStartDirection[3]
private

Definition at line 192 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryStartPosition[3]
private

Definition at line 190 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryT0
private

Definition at line 218 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryTheta
private

Definition at line 184 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryTruth_E
private

Definition at line 202 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryTruth_pdg
private

Definition at line 201 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fprimaryTruth_trkID
private

Definition at line 200 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryTruth_vtx[3]
private

Definition at line 203 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fprimaryVertex[3]
private

Definition at line 178 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fRun
private

Definition at line 150 of file ProtoDUNEPizeroAnaTree_module.cc.

spacecharge::SpaceChargeService::provider_type const* protoana::ProtoDUNEPizeroAnaTree::fSCEService
private

Definition at line 353 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower1_cal_dEdx[NMAXPIZEROS][NMAXHITS]
private

Definition at line 346 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower1_cal_dQdx[NMAXPIZEROS][NMAXHITS]
private

Definition at line 348 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower1_cal_E[NMAXPIZEROS]
private

Definition at line 334 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower1_cal_pitch[NMAXPIZEROS][NMAXHITS]
private

Definition at line 344 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower1_cal_pos[NMAXPIZEROS][NMAXHITS][3]
private

Definition at line 332 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower1_cnn_sc[NMAXPIZEROS][NMAXHITS]
private

Definition at line 329 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower1Completeness[NMAXPIZEROS]
private

Definition at line 323 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower1Direction[NMAXPIZEROS][3]
private

Definition at line 319 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower1Energy[NMAXPIZEROS]
private

Definition at line 336 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower1EnergyFromHits[NMAXPIZEROS]
private

Definition at line 338 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fShower1HasBeamGrandparent[NMAXPIZEROS]
private

Definition at line 342 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fShower1HasBeamParent[NMAXPIZEROS]
private

Definition at line 340 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fShower1ID[NMAXPIZEROS]
private

Definition at line 315 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower1Length[NMAXPIZEROS]
private

Definition at line 321 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fShower1NumHits[NMAXPIZEROS]
private

Definition at line 328 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower1Purity[NMAXPIZEROS]
private

Definition at line 325 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower1StartPosition[NMAXPIZEROS][3]
private

Definition at line 317 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower2_cal_dEdx[NMAXPIZEROS][NMAXHITS]
private

Definition at line 347 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower2_cal_dQdx[NMAXPIZEROS][NMAXHITS]
private

Definition at line 349 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower2_cal_E[NMAXPIZEROS]
private

Definition at line 335 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower2_cal_pitch[NMAXPIZEROS][NMAXHITS]
private

Definition at line 345 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower2_cal_pos[NMAXPIZEROS][NMAXHITS][3]
private

Definition at line 333 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower2_cnn_sc[NMAXPIZEROS][NMAXHITS]
private

Definition at line 330 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower2Completeness[NMAXPIZEROS]
private

Definition at line 324 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower2Direction[NMAXPIZEROS][3]
private

Definition at line 320 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower2Energy[NMAXPIZEROS]
private

Definition at line 337 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower2EnergyFromHits[NMAXPIZEROS]
private

Definition at line 339 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fShower2HasBeamGrandparent[NMAXPIZEROS]
private

Definition at line 343 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fShower2HasBeamParent[NMAXPIZEROS]
private

Definition at line 341 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fShower2ID[NMAXPIZEROS]
private

Definition at line 316 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower2Length[NMAXPIZEROS]
private

Definition at line 322 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fShower2NumHits[NMAXPIZEROS]
private

Definition at line 331 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower2Purity[NMAXPIZEROS]
private

Definition at line 326 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fShower2StartPosition[NMAXPIZEROS][3]
private

Definition at line 318 of file ProtoDUNEPizeroAnaTree_module.cc.

std::string protoana::ProtoDUNEPizeroAnaTree::fShowerCaloTag
private

Definition at line 141 of file ProtoDUNEPizeroAnaTree_module.cc.

std::string protoana::ProtoDUNEPizeroAnaTree::fShowerTag
private

Definition at line 140 of file ProtoDUNEPizeroAnaTree_module.cc.

std::string protoana::ProtoDUNEPizeroAnaTree::fSimulationTag
private

Definition at line 135 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fSubRun
private

Definition at line 151 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::fTimeStamp
private

Definition at line 153 of file ProtoDUNEPizeroAnaTree_module.cc.

double protoana::ProtoDUNEPizeroAnaTree::ftof
private

Definition at line 159 of file ProtoDUNEPizeroAnaTree_module.cc.

std::string protoana::ProtoDUNEPizeroAnaTree::fTrackTag
private

Definition at line 139 of file ProtoDUNEPizeroAnaTree_module.cc.

int protoana::ProtoDUNEPizeroAnaTree::fVerbose
private

Definition at line 145 of file ProtoDUNEPizeroAnaTree_module.cc.

protoana::ProtoDUNEPFParticleUtils protoana::ProtoDUNEPizeroAnaTree::pfpUtil
private

Definition at line 112 of file ProtoDUNEPizeroAnaTree_module.cc.

protoana::ProtoDUNEShowerUtils protoana::ProtoDUNEPizeroAnaTree::showerUtil
private

Definition at line 115 of file ProtoDUNEPizeroAnaTree_module.cc.

protoana::ProtoDUNETrackUtils protoana::ProtoDUNEPizeroAnaTree::trackUtil
private

Definition at line 113 of file ProtoDUNEPizeroAnaTree_module.cc.

protoana::ProtoDUNETruthUtils protoana::ProtoDUNEPizeroAnaTree::truthUtil
private

Definition at line 114 of file ProtoDUNEPizeroAnaTree_module.cc.


The documentation for this class was generated from the following file: