23 #include "art_root_io/TFileService.h" 25 #include "canvas/Persistency/Common/FindManyP.h" 42 #include "dune/DuneObj/ProtoDUNEBeamEvent.h" 45 #include "dune/Calib/XYZCalib.h" 46 #include "dune/CalibServices/XYZCalibService.h" 47 #include "dune/CalibServices/XYZCalibServiceProtoDUNE.h" 56 #include "dune/Protodune/singlephase/DataUtils/ProtoDUNEDataUtils.h" 65 #include "TTimeStamp.h" 88 class ProtoDUNEPizeroAnaTree;
103 virtual void endJob()
override;
131 const std::vector<const simb::MCParticle*>& pi0s);
376 fSCEService = lar::providerFrom<spacecharge::SpaceChargeService>();
383 fPandoraBeam = tfs->make<TTree>(
"PandoraBeam",
"Beam events reconstructed with Pandora");
594 for(
int k=0;
k < 6;
k++)
598 for(
int k=0;
k < 6;
k++)
607 if( !recoParticleHandle )
return;
633 bool beamTriggerEvent =
false;
639 if (!MCParticleHandle) {
642 <<
" No simb::MCParticle objects in this event - " 643 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
645 std::map<int, const simb::MCParticle*> MCPmap;
647 MCPmap[mcp.TrackId()] = &mcp;
653 if(geantGoodParticle != 0x0){
654 beamTriggerEvent =
true;
680 std::cout <<
"Primary beam particle PDG code: " <<
fbeamtrackPdg <<
" and E: " 683 std::vector<const simb::MCParticle*> pi0s;
687 std::cout <<
"Found a pion! (ID " <<
fbeamtrackID <<
", PDG " 690 std::cout <<
"Pion has pi0 daughters:\n";
691 std::vector<const simb::MCParticle*> daughters;
692 daughters.push_back(geantGoodParticle);
693 while(daughters.size()) {
696 const int daughter_ID = parent->
Daughter(di);
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);
705 daughters.erase(daughters.begin());
717 if( !beamTriggerEvent )
return;
719 std::vector< art::Ptr<beam::ProtoDUNEBeamEvent> > beaminfo;
735 if(beaminfo[0]->GetTOFChan() != -1){
736 ftof = beaminfo[0]->GetTOF();
740 if(std::find(PIDs.begin(), PIDs.end(), 211) != PIDs.end() &&
fprimaryIsshower != 1) {
742 }
else if(std::find(PIDs.begin(), PIDs.end(), 2212) != PIDs.end() &&
fprimaryIsshower != 1) {
744 }
else if(std::find(PIDs.begin(), PIDs.end(), 321) != PIDs.end() &&
fprimaryIsshower != 1) {
755 auto &
tracks = beaminfo[0]->GetBeamTracks();
767 auto & beammom = beaminfo[0]->GetRecoBeamMomenta();
773 if (!rShowerHandle) {
776 <<
" No recob::Shower objects in this event - " 777 <<
" Line " << __LINE__ <<
" in file " << __FILE__ <<
std::endl;
822 art::FindManyP<recob::Hit> findHitsFromShowers(recoShowers,evt,
fShowerTag);
823 art::FindManyP<recob::Hit> findHitsFromTracks(recoTracks,evt,
fTrackTag);
825 std::vector<art::Ptr<recob::Hit>> pfpHits;
826 std::vector<anab::Calorimetry> calovector;
828 if(thisTrack != 0x0) {
829 pfpHits = findHitsFromTracks.at(thisTrack->
ID());
832 }
else if(thisShower != 0x0) {
833 pfpHits = findHitsFromShowers.at(thisShower->
ID());
853 for(
size_t k = 0;
k < calovector.size() &&
k<3;
k++){
854 int plane = calovector[
k].PlaneID().Plane;
855 if(plane !=2 )
continue;
859 for(
size_t l=0;
l<calovector[
k].dEdx().size() &&
l<
NMAXHITS; ++
l){
863 const auto &
pos=(calovector[
k].XYZ())[
l];
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;
882 std::cout <<
"Pandora track: " << thisTrack <<
", shower: " << thisShower <<
'\n';
889 if(thisTrack != 0x0){
913 else if(thisShower != 0x0){
932 if( !recoParticleHandle )
return;
938 if(daughter == 0x0)
continue;
946 std::vector<art::Ptr<recob::Hit>> pfpDHits;
947 std::vector<anab::Calorimetry> dcalovector;
948 if(daughterTrack != 0x0) {
949 pfpDHits = findHitsFromTracks.at( daughterTrack->
ID() );
951 }
else if(daughterShower != 0x0) {
952 pfpDHits = findHitsFromShowers.at( daughterShower->
ID() );
955 if(dcalovector.size() != 3 &&
fVerbose > 0) {
956 std::cerr <<
"WARNING::Calorimetry vector size for track is = " << dcalovector.size() <<
std::endl;
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){
968 calo_hit_dQdx[dcalovector[
k].TpIndices()[
l]] = dcalovector[
k].dQdx()[
l];
969 calo_hit_pitch[dcalovector[
k].TpIndices()[
l]] = dcalovector[
k].TrkPitchVec()[
l];
973 if(daughterShower != 0) {
974 const TVector3 hitvec(pos.X(), pos.Y(), pos.Z());
984 art::FindManyP<recob::SpacePoint> spFromHits(pfpDHits, evt,
fHitTag);
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;
991 TVector3 xyzWire = pwire->
GetCenter<TVector3>();
996 std::vector<art::Ptr<recob::SpacePoint>> sps = spFromHits.at(i);
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;
1012 TVector3 objdir(0,0,0);
1013 if(daughterTrack != 0x0) {
1017 }
else if(daughterShower != 0x0) {
1020 TVector3 hitdir = objdir.Unit();
1021 if(objdir.Mag2() != 0 && hitpos[1] != -999.0) {
1024 objdir = objdir.Unit();
1025 TVector3 hitend = hitpos + objdir * (wirePitch/objdir.Z());
1031 hitpos += TVector3(poscorr.X(), poscorr.Y(), poscorr.Z());
1032 hitend += TVector3(endcorr.X(), endcorr.Y(), endcorr.Z());
1034 hitdir = (hitend-hitpos).Unit();
1052 if(daughterTrack != 0x0) {
1071 }
else if(daughterShower != 0x0) {
1106 if(parent->
Mother() != 0) {
1337 const std::vector<const simb::MCParticle*>& pi0s) {
1342 for(
unsigned pi0i = 0; pi0i <
NMAXPIZEROS && pi0i < pi0s.size(); ++pi0i) {
1369 art::FindManyP<recob::SpacePoint> ph1sps(ph1hits, evt,
fPFParticleTag);
1371 for(
unsigned i=0; i<ph1hits.size(); ++i) {
1372 if(ph1hits[i]->
WireID().Plane != 2)
continue;
1376 std::vector<art::Ptr<recob::SpacePoint>> sps = ph1sps.at(i);
1385 art::FindManyP<recob::SpacePoint> ph2sps(ph2hits, evt,
fPFParticleTag);
1387 for(
unsigned i=0; i<ph2hits.size(); ++i) {
1388 if(ph2hits[i]->
WireID().Plane != 2)
continue;
1392 std::vector<art::Ptr<recob::SpacePoint>> sps = ph2sps.at(i);
1408 art::FindManyP<recob::Hit> findHitsFromShowers(recoShowers,evt,
fShowerTag);
1409 art::FindManyP<recob::Hit> findHitsFromTracks(recoTracks,evt,
fTrackTag);
1414 if(shower1 != 0x0) {
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;
1435 auto PFParticleHandle = evt.getHandle<std::vector<recob::PFParticle> >(
fPFParticleTag);
1436 if (PFParticleHandle && beamPFParticles.size() != 0) {
1440 if(thish == 0x0)
continue;
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());
1460 for(
unsigned k=0;
k<sh1calo.size(); ++
k) {
1461 if(sh1calo[
k].
PlaneID().Plane != 2)
continue;
1466 *shower1, evt, fShowerTag);
1485 if(shower2 != 0x0) {
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;
1507 auto PFParticleHandle = evt.getHandle<std::vector<recob::PFParticle>>(
fPFParticleTag);
1508 if (PFParticleHandle && beamPFParticles.size() != 0) {
1512 if(thish == 0x0)
continue;
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());
1531 for(
unsigned k=0;
k<sh2calo.size(); ++
k) {
1532 if(sh2calo[
k].
PlaneID().Plane != 2)
continue;
1537 *shower2, evt, fShowerTag);
1563 for(
int k=0;
k < 5;
k++)
1566 for(
int k=0;
k < 3;
k++){
1579 for(
int l=0;
l<1000;
l ++) {
1612 for(
int k=0;
k < 2;
k++){
1658 for(
unsigned l = 0;
l < 3; ++
l) {
1745 for(
int i=0; i<3; ++i) {
1753 for(
int i=0; i<3; ++i) {
1780 for(
int i=0; i<3; ++i) {
double E(const int i=0) const
int fprimaryDaughterIstrack[NMAXDAUGHTERS]
double fShower2_cal_dEdx[NMAXPIZEROS][NMAXHITS]
double fMCPhoton2Energy[NMAXPIZEROS]
std::string fSimulationTag
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
unsigned int NumberTrajectoryPoints() const
double fprimaryDaughterEnergy[NMAXDAUGHTERS]
const TVector3 & ShowerStart() const
double fprimaryShowerMIPEnergy
const TLorentzVector & Position(const int i=0) const
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
std::string fShowerCaloTag
constexpr std::uint32_t timeLow() const
double fShower1_cal_pos[NMAXPIZEROS][NMAXHITS][3]
std::vector< std::string > fbeamtrackEndProcess
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.
double fShower1_cal_pitch[NMAXPIZEROS][NMAXHITS]
double fMCPi0EndPosition[NMAXPIZEROS][3]
int fShower1ID[NMAXPIZEROS]
int NumDaughters() const
Returns the number of daughter particles flowing from this one.
double fprimaryEndDirection[3]
double fprimaryKineticEnergy[3]
double fprimaryDaughterEnergyFromHits[NMAXDAUGHTERS]
const simb::MCParticle * GetGeantGoodParticle(const simb::MCTruth &genTruth, const art::Event &evt) const
double fShower2_cal_pitch[NMAXPIZEROS][NMAXHITS]
int fMCPi0ID[NMAXPIZEROS]
geo::GeometryCore const * fGeometryService
const TLorentzVector & EndPosition() const
double fprimaryEndMomentum
size_t Self() const
Returns the index of this particle.
virtual void beginJob() override
int fShower2HasBeamParent[NMAXPIZEROS]
double fprimaryShower_hit_q[NMAXHITS]
double fprimaryShowerEnergy
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.
double fShower1StartPosition[NMAXPIZEROS][3]
Handle< PROD > getHandle(SelectorBase const &) const
void setPiZeroInfo(art::Event const &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const std::vector< const simb::MCParticle * > &pi0s)
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
double fShower2Length[NMAXPIZEROS]
int fprimaryShowerBestPlane
const simb::MCParticle * TrackIdToParticle_P(int id) const
int fprimaryDaughterNHits[NMAXDAUGHTERS]
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
virtual void endJob() override
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.
void FillAPA3Object(art::Event const &evt, art::Handle< std::vector< recob::PFParticle >> pfpHandle)
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.
std::string fCalorimetryTag
std::string fPFParticleTag
constexpr std::uint32_t timeHigh() const
int fShower2NumHits[NMAXPIZEROS]
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 fprimaryEndPosition[3]
int fShower1HasBeamParent[NMAXPIZEROS]
double fbeamtrackEndPos[3]
double fprimaryDaughterCaloHitPitch[NMAXDAUGHTERS][NMAXHITS]
int getIndex(const std::string &name) const
Index of column with given name, or -1 if name not found.
double fbeamtrackPos_at[1000][3]
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
double fShower1EnergyFromHits[NMAXPIZEROS]
int fMCPhoton1ID[NMAXPIZEROS]
double fShower2EnergyFromHits[NMAXPIZEROS]
EDAnalyzer(fhicl::ParameterSet const &pset)
int fprimaryDaughterParentEndProcess[NMAXDAUGHTERS]
int fShower2ID[NMAXPIZEROS]
double fprimaryDaughterParentEnd[NMAXDAUGHTERS][3]
double fShower1Completeness[NMAXPIZEROS]
double fShower2_cal_dQdx[NMAXPIZEROS][NMAXHITS]
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
double fprimaryStartDirection[3]
double fShower2Energy[NMAXPIZEROS]
int fprimaryDaughterGrandparentPdg[NMAXDAUGHTERS]
double fprimaryDaughterHitTime[NMAXDAUGHTERS][NMAXHITS]
int NumberDaughters() const
double fprimary_cal_pos[NMAXHITS][3]
double fprimaryShower_hit_t[NMAXHITS]
art framework interface to geometry description
int Daughter(const int i) const
double fprimaryDaughterParentE[NMAXDAUGHTERS]
double fMCPhoton2_hit_pos[NMAXPIZEROS][NMAXHITS][3]
double fShower1_cal_E[NMAXPIZEROS]
const recob::Shower * shower2() const
std::string fGeneratorTag
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
double fShower2_cal_E[NMAXPIZEROS]
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
const simb::MCParticle * GetMCParticleFromReco(detinfo::DetectorClocksData const &clockData, const recob::PFParticle &pfpart, art::Event const &evt, std::string pfparticleModule) const
protoana::ProtoDUNETrackUtils trackUtil
double fbeamtrackMomentum
double fMCPhoton2_hit_q[NMAXPIZEROS][NMAXHITS]
double fprimary_cal_pitch[NMAXHITS]
double dEdx(float dqdx, float Efield)
const simb::MCParticle * photon1() const
double Length(size_t p=0) const
Access to various track properties.
double fShower1_cal_dQdx[NMAXPIZEROS][NMAXHITS]
double fprimaryOpeningAngle
int fMCPhoton2ID[NMAXPIZEROS]
#define DEFINE_ART_MODULE(klass)
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::string EndProcess() const
int fprimaryDaughterParentPdg[NMAXDAUGHTERS]
const simb::MCParticle * pi0() const
double fShower2Completeness[NMAXPIZEROS]
int GetShowerIndex(const recob::Shower &shower, art::Event const &evt, const std::string showerModule) const
If the shower.ID() isn't filled we must find the actual shower index ourselves.
std::string fParticleIDTag
double fShower1_cal_dEdx[NMAXPIZEROS][NMAXHITS]
double fMCPhoton1Energy[NMAXPIZEROS]
int fprimaryDaughterParentID[NMAXDAUGHTERS]
double fprimaryDaughterEndPosition[NMAXDAUGHTERS][3]
double Theta() const
Access to spherical or geographical angles at vertex or at any point.
int fprimaryDaughterNCollHits[NMAXDAUGHTERS]
ProtoDUNEPizeroAnaTree & operator=(ProtoDUNEPizeroAnaTree const &)=delete
double fMCPhoton2EndPosition[NMAXPIZEROS][3]
double P(const int i=0) const
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]
double fMCPhoton1EndPosition[NMAXPIZEROS][3]
double T(const int i=0) const
int fprimaryIsBeamparticle
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
double fprimaryDaughterEndDirection[NMAXDAUGHTERS][3]
SubRunNumber_t subRun() const
double fMCPhoton1_hit_t[NMAXPIZEROS][NMAXHITS]
const simb::MCParticle * GetMCParticleFromRecoTrack(detinfo::DetectorClocksData const &clockData, const recob::Track &track, art::Event const &evt, std::string trackModule) const
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 art::InputTag fBeamModuleLabel
const TVector3 & Direction() const
bool IsGoodBeamlineTrigger(art::Event const &evt) const
double fMCPhoton2_hit_t[NMAXPIZEROS][NMAXHITS]
double fprimaryMomentumByRangeProton
int fprimaryDaughterHitWire[NMAXDAUGHTERS][NMAXHITS]
int fprimaryDaughterID[NMAXDAUGHTERS]
Description of geometry of one entire detector.
double fprimaryDaughterGrandparentE[NMAXDAUGHTERS]
protoana::ProtoDUNETruthUtils truthUtil
int fShower1HasBeamGrandparent[NMAXPIZEROS]
double fprimaryShower_hit_pos[NMAXHITS][3]
double fprimaryDaughterLength[NMAXDAUGHTERS]
double fprimaryDaughterCNNScore[NMAXDAUGHTERS]
int fMCPhoton1NumHits[NMAXPIZEROS]
double fprimaryDaughterOwnHitPitch[NMAXDAUGHTERS][NMAXHITS]
protoana::ProtoDUNEBeamlineUtils beamlineUtil
Detector simulation of raw signals on wires.
double fShower2_cal_pos[NMAXPIZEROS][NMAXHITS][3]
double fprimaryDaughterHitCharge[NMAXDAUGHTERS][NMAXHITS]
double ConvertTicksToX(double ticks, int p, int t, int c) const
art::ServiceHandle< cheat::BackTrackerService > bt_serv
void FillPrimaryPFParticle(art::Event const &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, const recob::PFParticle *particle)
double fbeamtrackMom_at[1000][4]
double fMCPhoton1StartPosition[NMAXPIZEROS][3]
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Vector_t EndDirection() const
Returns the direction of the trajectory at the last point.
const recob::Shower * shower1() const
double fprimaryResidualRange[NMAXHITS]
int fprimaryShower_hit_w[NMAXHITS]
double Vx(const int i=0) const
double fShower1Length[NMAXPIZEROS]
virtual bool EnableCalSpatialSCE() const =0
double fprimarydQdx[NMAXHITS]
Declaration of signal hit object.
std::vector< int > GetPID(beam::ProtoDUNEBeamEvent const &beamevt, double nominal_momentum)
protoana::ProtoDUNEPFParticleUtils pfpUtil
double StartMomentum() const
Hierarchical representation of particle flow.
double fMCPi0StartPosition[NMAXPIZEROS][3]
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
const simb::MCParticle * photon2() const
Contains all timing reference information for the detector.
int GetNActiveFembsForAPA(art::Event const &evt, int apa) const
Get number of active fembs in an APA.
double fShower2_cnn_sc[NMAXPIZEROS][NMAXHITS]
Point_t const & End() const
Returns the position of the last valid point of the trajectory [cm].
double fprimaryDaughterBDTScore[NMAXDAUGHTERS]
const TLorentzVector & Momentum(const int i=0) const
double fprimaryDaughterGrandparentEnd[NMAXDAUGHTERS][3]
int fprimaryDaughterIsshower[NMAXDAUGHTERS]
double fprimaryDaughterStartPosition[NMAXDAUGHTERS][3]
double fcerenkovPressure[2]
double fprimaryDaughterEndMomentum[NMAXDAUGHTERS]
Provides recob::Track data product.
protoana::ProtoDUNEShowerUtils showerUtil
double Vz(const int i=0) const
double fShower1Direction[NMAXPIZEROS][3]
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.
EventNumber_t event() const
double fShower1_cnn_sc[NMAXPIZEROS][NMAXHITS]
detail::Node< FrameID, bool > PlaneID
double fprimaryStartPosition[3]
double fShower1Purity[NMAXPIZEROS]
int fMCPhoton2_hit_w[NMAXPIZEROS][NMAXHITS]
int fMCPhoton2NumHits[NMAXPIZEROS]
int fMCPhoton1_hit_w[NMAXPIZEROS][NMAXHITS]
double fShower2Direction[NMAXPIZEROS][3]
double fprimaryTruth_vtx[3]
double fShower1Energy[NMAXPIZEROS]
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
int fShower2HasBeamGrandparent[NMAXPIZEROS]
const simb::MCParticle * GetMCParticleFromRecoShower(detinfo::DetectorClocksData const &clockData, const recob::Shower &shower, art::Event const &evt, std::string showerModule) const
auto const & get(AssnsNode< L, R, D > const &r)
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
double fprimaryShowerCharge
int fShower1NumHits[NMAXPIZEROS]
double fShower2StartPosition[NMAXPIZEROS][3]
Vector_t StartDirection() const
Returns the direction of the trajectory at the first point.
double fMCPhoton2StartPosition[NMAXPIZEROS][3]
recob::tracking::Plane Plane
double fprimaryDaughterMomentum[NMAXDAUGHTERS]
Point_t const & Start() const
Returns the position of the first valid point of the trajectory [cm].
ProtoDUNEPizeroAnaTree(fhicl::ParameterSet const &p)
protoana::ProtoDUNEDataUtils dataUtil
double fShower2Purity[NMAXPIZEROS]
std::array< float, N > getOutput(size_t key) const
Get copy of the MVA output vector at index "key".
double fMCPhoton1_hit_pos[NMAXPIZEROS][NMAXHITS][3]
std::string to_string(ModuleType const mt)
void analyze(art::Event const &evt) override
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
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.
int fprimaryDaughterGrandparentID[NMAXDAUGHTERS]
def parent(G, child, parent_type)
double Vy(const int i=0) const
calo::CalorimetryAlg fCalorimetryAlg
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
cet::coded_exception< error, detail::translate > exception
double fprimaryDaughterParentStart[NMAXDAUGHTERS][3]
QTextStream & endl(QTextStream &s)
bool IsBeamTrigger(art::Event const &evt) const
double fprimarydEdx[NMAXHITS]
double fMCPhoton1_hit_q[NMAXPIZEROS][NMAXHITS]
double fMCPi0Energy[NMAXPIZEROS]
double fprimaryDaughterGrandparentStart[NMAXDAUGHTERS][3]
size_t Daughter(size_t idx) const
Returns the ID of the specified daughter.
WireGeo const * WirePtr(geo::WireID const &wireid) const
Returns the specified wire.