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

Public Member Functions

 PionAnalyzer (fhicl::ParameterSet const &p)
 
 PionAnalyzer (PionAnalyzer const &)=delete
 
 PionAnalyzer (PionAnalyzer &&)=delete
 
PionAnalyzeroperator= (PionAnalyzer const &)=delete
 
PionAnalyzeroperator= (PionAnalyzer &&)=delete
 
void analyze (art::Event const &evt) override
 
void beginJob () override
 
void endJob () override
 
void reset ()
 
double lateralDist (TVector3 &n, TVector3 &x0, TVector3 &p)
 
- 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 ()
 
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 &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) 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

bool CreateRWTraj (const simb::MCParticle &part, const sim::ParticleList &plist, art::ServiceHandle< geo::Geometry > geo_serv, int event, G4ReweightTraj *theTraj)
 
std::vector< G4ReweightTraj * > CreateNRWTrajs (const simb::MCParticle &part, const sim::ParticleList &plist, art::ServiceHandle< geo::Geometry > geo_serv, int event)
 

Private Attributes

const art::InputTag fTrackModuleLabel
 
TTree * fTree
 
int run
 
int subrun
 
int event
 
int MC
 
int true_beam_PDG
 
int true_beam_ID
 
std::string true_beam_endProcess
 
double true_beam_endX
 
double true_beam_endY
 
double true_beam_endZ
 
double true_beam_startX
 
double true_beam_startY
 
double true_beam_startZ
 
double true_beam_startDirX
 
double true_beam_startDirY
 
double true_beam_startDirZ
 
double true_beam_startPx
 
double true_beam_startPy
 
double true_beam_startPz
 
double true_beam_startP
 
double true_beam_endPx
 
double true_beam_endPy
 
double true_beam_endPz
 
double true_beam_endP
 
int true_beam_nElasticScatters
 
int true_beam_nHits
 
std::vector< double > true_beam_elastic_costheta
 
std::vector< double > true_beam_elastic_X
 
std::vector< double > true_beam_elastic_Y
 
std::vector< double > true_beam_elastic_Z
 
std::vector< double > true_beam_elastic_deltaE
 
std::vector< double > true_beam_elastic_IDE_edep
 
double true_beam_IDE_totalDep
 
bool true_beam_IDE_found_in_recoVtx
 
std::vector< std::stringtrue_beam_processes
 
std::vector< int > true_beam_process_dSlice
 
std::vector< int > true_beam_process_slice
 
std::vector< int > true_beam_process_matched
 
std::vector< std::vector< int > > true_beam_reco_byHits_PFP_ID
 
std::vector< std::vector< int > > true_beam_reco_byHits_PFP_nHits
 
std::vector< std::vector< int > > true_beam_reco_byHits_allTrack_ID
 
std::vector< int > true_beam_daughter_PDG
 
std::vector< int > true_beam_daughter_ID
 
std::vector< double > true_beam_daughter_len
 
std::vector< std::stringtrue_beam_daughter_Process
 
std::vector< std::stringtrue_beam_daughter_endProcess
 
std::vector< double > true_beam_daughter_startX
 
std::vector< double > true_beam_daughter_startY
 
std::vector< double > true_beam_daughter_startZ
 
std::vector< double > true_beam_daughter_startP
 
std::vector< double > true_beam_daughter_startPx
 
std::vector< double > true_beam_daughter_startPy
 
std::vector< double > true_beam_daughter_startPz
 
std::vector< double > true_beam_daughter_endX
 
std::vector< double > true_beam_daughter_endY
 
std::vector< double > true_beam_daughter_endZ
 
std::vector< int > true_beam_daughter_nHits
 
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_PFP_ID
 
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_PFP_nHits
 
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_allTrack_ID
 
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_allShower_ID
 
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_PFP_trackScore
 
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startX
 
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startY
 
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startZ
 
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endX
 
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endY
 
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endZ
 
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_len
 
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startX
 
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startY
 
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startZ
 
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_len
 
std::vector< int > true_beam_Pi0_decay_PDG
 
std::vector< int > true_beam_Pi0_decay_ID
 
std::vector< int > true_beam_Pi0_decay_parID
 
std::vector< double > true_beam_Pi0_decay_startP
 
std::vector< double > true_beam_Pi0_decay_startPx
 
std::vector< double > true_beam_Pi0_decay_startPy
 
std::vector< double > true_beam_Pi0_decay_startPz
 
std::vector< double > true_beam_Pi0_decay_startX
 
std::vector< double > true_beam_Pi0_decay_startY
 
std::vector< double > true_beam_Pi0_decay_startZ
 
std::vector< int > true_beam_Pi0_decay_nHits
 
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_PFP_ID
 
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_PFP_nHits
 
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_allTrack_ID
 
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_allShower_ID
 
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_PFP_trackScore
 
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startX
 
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startY
 
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startZ
 
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endX
 
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endY
 
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endZ
 
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_len
 
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startX
 
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startY
 
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startZ
 
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_len
 
std::vector< double > true_beam_Pi0_decay_len
 
std::vector< int > true_beam_grand_daughter_PDG
 
std::vector< int > true_beam_grand_daughter_ID
 
std::vector< int > true_beam_grand_daughter_parID
 
std::vector< int > true_beam_grand_daughter_nHits
 
std::vector< std::stringtrue_beam_grand_daughter_Process
 
std::vector< std::stringtrue_beam_grand_daughter_endProcess
 
int true_daughter_nPiPlus
 
int true_daughter_nPiMinus
 
int true_daughter_nPi0
 
int true_daughter_nProton
 
int true_daughter_nNeutron
 
int true_daughter_nNucleus
 
int reco_beam_vertex_slice
 
double reco_beam_startX
 
double reco_beam_startY
 
double reco_beam_startZ
 
double reco_beam_endX
 
double reco_beam_endY
 
double reco_beam_endZ
 
double reco_beam_vtxX
 
double reco_beam_vtxY
 
double reco_beam_vtxZ
 
double reco_beam_len
 
double reco_beam_alt_len
 
double reco_beam_vertex_michel_score
 
int reco_beam_vertex_nHits
 
double reco_beam_calo_startX
 
double reco_beam_calo_startY
 
double reco_beam_calo_startZ
 
double reco_beam_calo_endX
 
double reco_beam_calo_endY
 
double reco_beam_calo_endZ
 
std::vector< double > reco_beam_calo_startDirX
 
std::vector< double > reco_beam_calo_endDirX
 
std::vector< double > reco_beam_calo_startDirY
 
std::vector< double > reco_beam_calo_endDirY
 
std::vector< double > reco_beam_calo_startDirZ
 
std::vector< double > reco_beam_calo_endDirZ
 
double reco_beam_trackDirX
 
double reco_beam_trackDirY
 
double reco_beam_trackDirZ
 
double reco_beam_trackEndDirX
 
double reco_beam_trackEndDirY
 
double reco_beam_trackEndDirZ
 
std::vector< double > reco_beam_dEdX
 
std::vector< double > reco_beam_dQdX
 
std::vector< double > reco_beam_resRange
 
std::vector< double > reco_beam_TrkPitch
 
std::vector< double > reco_beam_calo_wire
 
std::vector< double > reco_beam_calo_tick
 
std::vector< double > reco_beam_calo_wire_z
 
std::vector< int > reco_beam_calo_TPC
 
std::vector< double > reco_beam_calibrated_dEdX
 
std::vector< int > reco_beam_hit_true_ID
 
std::vector< int > reco_beam_hit_true_origin
 
std::vector< int > reco_beam_hit_true_slice
 
int reco_beam_trackID
 
bool reco_beam_flipped
 
bool reco_beam_passes_beam_cuts
 
int reco_beam_nTrackDaughters
 
int reco_beam_nShowerDaughters
 
int reco_beam_type
 
double reco_beam_Chi2_proton
 
int reco_beam_Chi2_ndof
 
std::vector< double > reco_beam_cosmic_candidate_upper_hits
 
std::vector< double > reco_beam_cosmic_candidate_lower_hits
 
std::vector< int > reco_beam_cosmic_candidate_ID
 
bool beam_has_cosmic_IDE
 
std::vector< int > cosmic_has_beam_IDE
 
int n_cosmics_with_beam_IDE
 
std::vector< double > reco_track_startX
 
std::vector< double > reco_track_startY
 
std::vector< double > reco_track_startZ
 
std::vector< double > reco_track_endX
 
std::vector< double > reco_track_endY
 
std::vector< double > reco_track_endZ
 
std::vector< double > reco_track_michel_score
 
std::vector< int > reco_track_ID
 
std::vector< int > reco_track_nHits
 
std::vector< double > g4rw_primary_weights
 
std::vector< double > g4rw_primary_plus_sigma_weight
 
std::vector< double > g4rw_primary_minus_sigma_weight
 
std::vector< std::stringg4rw_primary_var
 
std::vector< double > g4rw_alt_primary_plus_sigma_weight
 
std::vector< double > g4rw_alt_primary_minus_sigma_weight
 
std::string reco_beam_true_byE_endProcess
 
std::string reco_beam_true_byHits_endProcess
 
std::string reco_beam_true_byE_process
 
std::string reco_beam_true_byHits_process
 
int reco_beam_true_byE_PDG
 
int reco_beam_true_byHits_PDG
 
int reco_beam_true_byE_ID
 
int reco_beam_true_byHits_ID
 
bool reco_beam_true_byE_matched
 
bool reco_beam_true_byHits_matched
 
int reco_beam_true_byE_origin
 
int reco_beam_true_byHits_origin
 
double reco_beam_true_byE_endPx
 
double reco_beam_true_byHits_endPx
 
double reco_beam_true_byE_endPy
 
double reco_beam_true_byHits_endPy
 
double reco_beam_true_byE_endPz
 
double reco_beam_true_byHits_endPz
 
double reco_beam_true_byE_endE
 
double reco_beam_true_byHits_endE
 
double reco_beam_true_byE_endP
 
double reco_beam_true_byHits_endP
 
double reco_beam_true_byE_startPx
 
double reco_beam_true_byHits_startPx
 
double reco_beam_true_byE_startPy
 
double reco_beam_true_byHits_startPy
 
double reco_beam_true_byE_startPz
 
double reco_beam_true_byHits_startPz
 
double reco_beam_true_byE_startE
 
double reco_beam_true_byHits_startE
 
double reco_beam_true_byE_startP
 
double reco_beam_true_byHits_startP
 
double reco_beam_true_byHits_purity
 
std::vector< double > reco_beam_incidentEnergies
 
double reco_beam_interactingEnergy
 
std::vector< double > true_beam_incidentEnergies
 
std::vector< int > true_beam_slices
 
std::vector< int > true_beam_slices_found
 
std::vector< int > true_beam_slices_nIDEs
 
std::vector< double > true_beam_slices_deltaE
 
double true_beam_interactingEnergy
 
double em_energy
 
std::vector< double > true_beam_traj_X
 
std::vector< double > true_beam_traj_Y
 
std::vector< double > true_beam_traj_Z
 
std::vector< double > true_beam_traj_KE
 
int reco_beam_PFP_ID
 
int reco_beam_PFP_nHits
 
double reco_beam_PFP_trackScore
 
double reco_beam_PFP_emScore
 
double reco_beam_PFP_michelScore
 
double reco_beam_PFP_trackScore_collection
 
double reco_beam_PFP_emScore_collection
 
double reco_beam_PFP_michelScore_collection
 
int reco_beam_allTrack_ID
 
bool reco_beam_allTrack_beam_cuts
 
bool reco_beam_allTrack_flipped
 
double reco_beam_allTrack_len
 
double reco_beam_allTrack_startX
 
double reco_beam_allTrack_startY
 
double reco_beam_allTrack_startZ
 
double reco_beam_allTrack_endX
 
double reco_beam_allTrack_endY
 
double reco_beam_allTrack_endZ
 
double reco_beam_allTrack_trackDirX
 
double reco_beam_allTrack_trackDirY
 
double reco_beam_allTrack_trackDirZ
 
double reco_beam_allTrack_trackEndDirX
 
double reco_beam_allTrack_trackEndDirY
 
double reco_beam_allTrack_trackEndDirZ
 
std::vector< double > reco_beam_allTrack_resRange
 
std::vector< double > reco_beam_allTrack_calibrated_dEdX
 
double reco_beam_allTrack_Chi2_proton
 
int reco_beam_allTrack_Chi2_ndof
 
double data_BI_P
 
std::vector< double > data_BI_TOF
 
std::vector< int > data_BI_PDG_candidates
 
std::vector< int > data_BI_TOF_Chan
 
double data_BI_X
 
double data_BI_Y
 
double data_BI_Z
 
double data_BI_dirX
 
double data_BI_dirY
 
double data_BI_dirZ
 
int data_BI_nFibersP1
 
int data_BI_nFibersP2
 
int data_BI_nFibersP3
 
int data_BI_nTracks
 
int data_BI_nMomenta
 
bool quality_reco_view_0_hits_in_TPC5
 
bool quality_reco_view_1_hits_in_TPC5
 
bool quality_reco_view_2_hits_in_TPC5
 
std::vector< double > quality_reco_view_0_wire
 BR-MS. More...
 
std::vector< double > quality_reco_view_0_tick
 
std::vector< double > quality_reco_view_1_wire
 
std::vector< double > quality_reco_view_1_tick
 
std::vector< double > quality_reco_view_2_wire
 
std::vector< double > quality_reco_view_2_tick
 
std::vector< double > quality_reco_view_2_z
 
double quality_reco_view_0_max_segment
 
double quality_reco_view_1_max_segment
 
double quality_reco_view_2_max_segment
 
double quality_reco_view_0_wire_backtrack
 
double quality_reco_view_1_wire_backtrack
 
double quality_reco_view_2_wire_backtrack
 
double quality_reco_max_lateral
 
double quality_reco_max_segment
 
std::vector< int > reco_daughter_PFP_ID
 Add by hits? More...
 
std::vector< int > reco_daughter_PFP_nHits
 
std::vector< int > reco_daughter_PFP_nHits_collection
 
std::vector< double > reco_daughter_PFP_trackScore
 
std::vector< double > reco_daughter_PFP_emScore
 
std::vector< double > reco_daughter_PFP_michelScore
 
std::vector< double > reco_daughter_PFP_trackScore_collection
 
std::vector< double > reco_daughter_PFP_emScore_collection
 
std::vector< double > reco_daughter_PFP_michelScore_collection
 
std::vector< int > reco_daughter_PFP_true_byHits_PDG
 
std::vector< int > reco_daughter_PFP_true_byHits_ID
 
std::vector< int > reco_daughter_PFP_true_byHits_origin
 
std::vector< int > reco_daughter_PFP_true_byHits_parID
 
std::vector< int > reco_daughter_PFP_true_byHits_parPDG
 
std::vector< std::stringreco_daughter_PFP_true_byHits_process
 
std::vector< double > reco_daughter_PFP_true_byHits_purity
 
std::vector< size_t > reco_daughter_PFP_true_byHits_sharedHits
 EDIT: quality. More...
 
std::vector< size_t > reco_daughter_PFP_true_byHits_emHits
 
std::vector< double > reco_daughter_PFP_true_byHits_completeness
 
std::vector< double > reco_daughter_PFP_true_byHits_len
 
std::vector< double > reco_daughter_PFP_true_byHits_startX
 
std::vector< double > reco_daughter_PFP_true_byHits_startY
 
std::vector< double > reco_daughter_PFP_true_byHits_startZ
 
std::vector< double > reco_daughter_PFP_true_byHits_endX
 
std::vector< double > reco_daughter_PFP_true_byHits_endY
 
std::vector< double > reco_daughter_PFP_true_byHits_endZ
 
std::vector< double > reco_daughter_PFP_true_byHits_startPx
 
std::vector< double > reco_daughter_PFP_true_byHits_startPy
 
std::vector< double > reco_daughter_PFP_true_byHits_startPz
 
std::vector< double > reco_daughter_PFP_true_byHits_startE
 
std::vector< double > reco_daughter_PFP_true_byHits_startP
 
std::vector< std::stringreco_daughter_PFP_true_byHits_endProcess
 
std::vector< int > reco_daughter_PFP_true_byE_PDG
 
std::vector< double > reco_daughter_PFP_true_byE_len
 
std::vector< double > reco_daughter_PFP_true_byE_completeness
 
std::vector< double > reco_daughter_PFP_true_byE_purity
 
std::vector< int > reco_daughter_allTrack_ID
 
std::vector< double > reco_daughter_allTrack_Theta
 
std::vector< double > reco_daughter_allTrack_Phi
 
std::vector< std::vector< double > > reco_daughter_allTrack_dQdX_SCE
 
std::vector< std::vector< double > > reco_daughter_allTrack_dEdX_SCE
 
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_SCE
 
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE
 
std::vector< double > reco_daughter_allTrack_Chi2_proton
 
std::vector< int > reco_daughter_allTrack_Chi2_ndof
 
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE_plane0
 
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE_plane1
 
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_plane0
 
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_plane1
 
std::vector< double > reco_daughter_allTrack_Chi2_proton_plane0
 
std::vector< double > reco_daughter_allTrack_Chi2_proton_plane1
 
std::vector< int > reco_daughter_allTrack_Chi2_ndof_plane0
 
std::vector< int > reco_daughter_allTrack_Chi2_ndof_plane1
 
std::vector< double > reco_daughter_allTrack_startX
 
std::vector< double > reco_daughter_allTrack_endX
 
std::vector< double > reco_daughter_allTrack_startY
 
std::vector< double > reco_daughter_allTrack_endY
 
std::vector< double > reco_daughter_allTrack_startZ
 
std::vector< double > reco_daughter_allTrack_endZ
 
std::vector< double > reco_daughter_allTrack_dR
 
std::vector< double > reco_daughter_allTrack_len
 
std::vector< double > reco_daughter_allTrack_alt_len
 
std::vector< double > reco_daughter_allTrack_to_vertex
 
std::vector< double > reco_daughter_allTrack_vertex_michel_score
 
std::vector< int > reco_daughter_allTrack_vertex_nHits
 
std::vector< int > reco_daughter_allShower_ID
 
std::vector< double > reco_daughter_allShower_len
 
std::vector< double > reco_daughter_allShower_startX
 
std::vector< double > reco_daughter_allShower_startY
 
std::vector< double > reco_daughter_allShower_startZ
 
std::vector< double > reco_daughter_allShower_dirX
 
std::vector< double > reco_daughter_allShower_dirY
 
std::vector< double > reco_daughter_allShower_dirZ
 
std::vector< double > reco_daughter_allShower_energy
 
std::vector< double > reco_daughter_allTrack_momByRange_proton
 Reconstructed Daughter Info. More...
 
std::vector< double > reco_daughter_allTrack_momByRange_muon
 
double reco_beam_momByRange_proton
 
double reco_beam_momByRange_muon
 
std::vector< double > reco_daughter_allTrack_momByRange_alt_proton
 
std::vector< double > reco_daughter_allTrack_momByRange_alt_muon
 
double reco_beam_momByRange_alt_proton
 
double reco_beam_momByRange_alt_muon
 
std::vector< double > reco_beam_spacePts_X
 Reconstructed Daughter Info. More...
 
std::vector< double > reco_beam_spacePts_Y
 
std::vector< double > reco_beam_spacePts_Z
 
std::vector< std::vector< double > > reco_daughter_spacePts_X
 
std::vector< std::vector< double > > reco_daughter_spacePts_Y
 
std::vector< std::vector< double > > reco_daughter_spacePts_Z
 
std::vector< std::vector< double > > reco_daughter_shower_spacePts_X
 
std::vector< std::vector< double > > reco_daughter_shower_spacePts_Y
 
std::vector< std::vector< double > > reco_daughter_shower_spacePts_Z
 
std::map< int, TProfile * > templates
 
std::string fCalorimetryTag
 
std::string fPandora2CaloSCE
 
std::string fTrackerTag
 
std::string fHitTag
 
std::string fShowerTag
 
std::string fPFParticleTag
 
std::string fGeneratorTag
 
std::string fBeamModuleLabel
 
protoana::ProtoDUNEBeamlineUtils fBeamlineUtils
 
std::string dEdX_template_name
 
TFile dEdX_template_file
 
bool fVerbose
 
fhicl::ParameterSet BeamPars
 
fhicl::ParameterSet BeamCuts
 
protoana::ProtoDUNEBeamCuts beam_cuts
 
fhicl::ParameterSet CalibrationPars
 
protoana::ProtoDUNECalibration calibration
 
bool fSaveHits
 
bool fCheckCosmics
 
bool fTrueToReco
 
bool fDoReweight
 
bool fDoProtReweight
 
bool fMCHasBI
 
TFile * FracsFile
 
TFile * XSecFile
 
TFile * ProtFracsFile
 
TFile * ProtXSecFile
 
std::vector< fhicl::ParameterSetParSet
 
G4ReweightParameterMaker ParMaker
 
G4MultiReweighter * MultiRW
 
G4MultiReweighter * ProtMultiRW
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &paths, fhicl::ParameterSet const &config)
 
detail::ProcessAndEventSelectorsprocessAndEventSelectors ()
 
- 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 394 of file PionAnalyzer_module.cc.

Constructor & Destructor Documentation

pionana::PionAnalyzer::PionAnalyzer ( fhicl::ParameterSet const &  p)
explicit

Definition at line 968 of file PionAnalyzer_module.cc.

969  : EDAnalyzer{p} ,
970  fTrackModuleLabel(p.get< art::InputTag >("TrackModuleLabel")),
971 
972  fCalorimetryTag(p.get<std::string>("CalorimetryTag")),
973  fPandora2CaloSCE(p.get<std::string>("Pandora2CaloSCE")),
974  fTrackerTag(p.get<std::string>("TrackerTag")),
975  fHitTag(p.get<std::string>("HitTag")),
976  fShowerTag(p.get<std::string>("ShowerTag")),
977  fPFParticleTag(p.get<std::string>("PFParticleTag")),
978  fGeneratorTag(p.get<std::string>("GeneratorTag")),
979  fBeamModuleLabel(p.get<std::string>("BeamModuleLabel")),
980  fBeamlineUtils(p.get< fhicl::ParameterSet >("BeamlineUtils")),
981  dEdX_template_name(p.get<std::string>("dEdX_template_name")),
982  dEdX_template_file( dEdX_template_name.c_str(), "OPEN" ),
983  fVerbose(p.get<bool>("Verbose")),
984  BeamPars(p.get<fhicl::ParameterSet>("BeamPars")),
985  BeamCuts(p.get<fhicl::ParameterSet>("BeamCuts")),
986  CalibrationPars(p.get<fhicl::ParameterSet>("CalibrationPars")),
987  calibration(p.get<fhicl::ParameterSet>("CalibrationPars")),
988  fSaveHits( p.get<bool>( "SaveHits" ) ),
989  fCheckCosmics( p.get<bool>( "CheckCosmics" ) ),
990  fTrueToReco( p.get<bool>( "TrueToReco" ) ),
991  fDoReweight(p.get<bool>("DoReweight")),
992  fDoProtReweight(p.get<bool>("DoProtReweight")) {
993 
994  templates[ 211 ] = (TProfile*)dEdX_template_file.Get( "dedx_range_pi" );
995  templates[ 321 ] = (TProfile*)dEdX_template_file.Get( "dedx_range_ka" );
996  templates[ 13 ] = (TProfile*)dEdX_template_file.Get( "dedx_range_mu" );
997  templates[ 2212 ] = (TProfile*)dEdX_template_file.Get( "dedx_range_pro" );
998 
999  //calibration = protoana::ProtoDUNECalibration( CalibrationPars );
1001 
1002 
1003  //FracsFile( (p.get< std::string >( "FracsFile" )).c_str(), "OPEN" ),
1004  //XSecFile( (p.get< std::string >( "XSecFile" )).c_str(), "OPEN"),
1005  //ParSet(p.get<std::vector<fhicl::ParameterSet>>("ParameterSet")),
1006  //ParMaker(ParSet),
1007  //MultiRW(211, XSecFile, FracsFile, ParSet)
1008 
1009  if (fDoReweight) {
1010  FracsFile = new TFile((p.get< std::string >( "FracsFile" )).c_str(), "OPEN" );
1011  XSecFile = new TFile((p.get< std::string >( "XSecFile" )).c_str(), "OPEN");
1012  ParSet = p.get<std::vector<fhicl::ParameterSet>>("ParameterSet");
1013  ParMaker = G4ReweightParameterMaker(ParSet);
1014  MultiRW = new G4MultiReweighter(211, *XSecFile, *FracsFile, ParSet/*, 100, 0*/);
1015 
1016  //theRW = RWFactory.BuildReweighter( 211, XSecFile, FracsFile, ParMaker.GetFSHists(), ParMaker.GetElasticHist()/*, true*/ );
1017  }
1018  if (fDoProtReweight) {
1019  ProtFracsFile = new TFile((p.get<std::string>("ProtFracsFile")).c_str(),
1020  "OPEN");
1021  ProtXSecFile = new TFile((p.get<std::string>("ProtXSecFile")).c_str(),
1022  "OPEN");
1023  ParSet = p.get<std::vector<fhicl::ParameterSet>>("ParameterSet");
1024  ParMaker = G4ReweightParameterMaker(ParSet);
1025  ProtMultiRW = new G4MultiReweighter(2212, *ProtXSecFile, *ProtFracsFile,
1026  ParSet);
1027  }
1028 
1029  // Call appropriate consumes<>() for any products to be retrieved by this module.
1030 }
protoana::ProtoDUNEBeamCuts beam_cuts
protoana::ProtoDUNEBeamlineUtils fBeamlineUtils
std::string string
Definition: nybbler.cc:12
fhicl::ParameterSet BeamCuts
std::map< int, TProfile * > templates
protoana::ProtoDUNECalibration calibration
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:27
G4MultiReweighter * ProtMultiRW
G4MultiReweighter * MultiRW
fhicl::ParameterSet BeamPars
p
Definition: test.py:223
std::vector< fhicl::ParameterSet > ParSet
G4ReweightParameterMaker ParMaker
fhicl::ParameterSet CalibrationPars
const art::InputTag fTrackModuleLabel
pionana::PionAnalyzer::PionAnalyzer ( PionAnalyzer const &  )
delete
pionana::PionAnalyzer::PionAnalyzer ( PionAnalyzer &&  )
delete

Member Function Documentation

void pionana::PionAnalyzer::analyze ( art::Event const &  evt)
overridevirtual

Gets the beam pfparticle

Implements art::EDAnalyzer.

Definition at line 1032 of file PionAnalyzer_module.cc.

1032  {
1033 
1034  //reset containers
1035  reset();
1036 
1037 
1038  run = evt.run();
1039  subrun = evt.subRun();
1040  event = evt.id().event();
1041 
1042  if( !evt.isRealData() ) MC = 1;
1043  else MC = 0;
1044 
1045 
1046  // Get various utilities
1048  auto pfpVec = evt.getValidHandle< std::vector< recob::PFParticle > >( fPFParticleTag );
1050 
1051 /* //For attempting to get the beam PFParticle by-hand
1052  std::cout << "Got " << pfpVec->size() << " PFPs" << std::endl;
1053  //for (size_t i = 0; i < pfpVec->size(); ++i) {
1054  for (const recob::PFParticle & pfp : (*pfpVec)) {
1055  //const recob::PFParticle * pfp =
1056  std::cout << pfp.Self() << std::endl;
1057  const recob::Track* tempTrack = pfpUtil.GetPFParticleTrack(pfp, evt,
1058  fPFParticleTag,
1059  fTrackerTag);
1060  if (tempTrack) {
1061  double startX = tempTrack->Start().X();
1062  double startY = tempTrack->Start().Y();
1063  double startZ = tempTrack->Start().Z();
1064 
1065  double endX = tempTrack->End().X();
1066  double endY = tempTrack->End().Y();
1067  double endZ = tempTrack->End().Z();
1068 
1069  //Flipped
1070  if (startZ < endZ) {
1071  if (startZ < 40. && startZ > 20. &&
1072  startY < 475. && startY > 375. &&
1073  startX < 0. && startX > -40.) {
1074  std::cout << startX << " " << startY << " " << startZ << std::endl;
1075  protoana::MCParticleSharedHits match =
1076  truthUtil.GetMCParticleByHits( pfp, evt, fPFParticleTag, fHitTag );
1077  std::cout << match.particle->TrackId() << std::endl;
1078  }
1079  }
1080  else {
1081  if (endZ < 40. && endZ > 20. &&
1082  endY < 475. && endY > 375. &&
1083  endX < 0. && endX > -40.) {
1084  std::cout << endX << " " << endY << " " << endZ << std::endl;
1085  protoana::MCParticleSharedHits match =
1086  truthUtil.GetMCParticleByHits( pfp, evt, fPFParticleTag, fHitTag );
1087  std::cout << match.particle->TrackId() << std::endl;
1088  }
1089  }
1090  }
1091  }
1092  */
1093 
1096  for (const recob::PFParticle & pfp : (*pfpVec)) {
1097  //const recob::PFParticle * pfp =
1098  //std::cout << pfp.Self() << std::endl;
1099  const recob::Track* tempTrack = pfpUtil.GetPFParticleTrack(pfp, evt,
1101  fTrackerTag);
1102  if (tempTrack) {
1103  double startX = tempTrack->Start().X();
1104  double startY = tempTrack->Start().Y();
1105  double startZ = tempTrack->Start().Z();
1106 
1107  double endX = tempTrack->End().X();
1108  double endY = tempTrack->End().Y();
1109  double endZ = tempTrack->End().Z();
1110 
1111  double start[3] = {startX, startY, startZ};
1112  double end[3] = {endX, endY, endZ};
1113  int end_tpc = geom->FindTPCAtPosition(end).TPC;
1114  int start_tpc = geom->FindTPCAtPosition(start).TPC;
1115 
1116  if (!((end_tpc == 1 || end_tpc == 5) &&
1117  (start_tpc == 1 || start_tpc == 5)))
1118  continue;
1119 
1120  std::pair<double, int> vertex_michel_score =
1121  trackUtil.GetVertexMichelScore(*tempTrack, evt, fTrackerTag,
1122  fHitTag);
1123 
1124  reco_track_michel_score.push_back(vertex_michel_score.first);
1125  reco_track_nHits.push_back(vertex_michel_score.second);
1126  reco_track_ID.push_back(tempTrack->ID());
1127  reco_track_startX.push_back(startX);
1128  reco_track_startY.push_back(startY);
1129  reco_track_startZ.push_back(startZ);
1130  reco_track_endX.push_back(endX);
1131  reco_track_endY.push_back(endY);
1132  reco_track_endZ.push_back(endZ);
1133  }
1134  }
1135 
1136  protoana::ProtoDUNEShowerUtils showerUtil;
1139  const sim::ParticleList & plist = pi_serv->ParticleList();
1140 
1141  art::ServiceHandle < geo::Geometry > fGeometryService;
1142  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService>()->DataFor(evt);
1143  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService>()->DataFor(evt, clockData);
1144  trkf::TrackMomentumCalculator track_p_calc;
1145  ////////////////////////////////////////
1146 
1147 
1148  double z0 = geom->Wire( geo::WireID(0, 1, 2, 0) ).GetCenter().Z();
1149  double pitch = geom->WirePitch( 2, 1, 0);
1150  size_t nWires = geom->Nwires( 2, 1, 0 );
1151 
1152  if (fVerbose) {
1153  std::cout << "Z0: " << z0 << std::endl;
1154  std::cout << "Pitch: " << pitch << std::endl;
1155  std::cout << "nWires: " << nWires << std::endl;
1156 
1157  double z0_APA2 = geom->Wire(geo::WireID(0, 5, 2, 0)).GetCenter().Z();
1158  std::cout << "APA 2 Z0: " << z0_APA2 << std::endl;
1159  }
1160 
1161  // This gets the true beam particle that generated the event
1162  const simb::MCParticle* true_beam_particle = 0x0;
1163  if( !evt.isRealData() ){
1164  auto mcTruths = evt.getValidHandle<std::vector<simb::MCTruth>>(fGeneratorTag);
1165  true_beam_particle = truthUtil.GetGeantGoodParticle((*mcTruths)[0],evt);
1166  if( !true_beam_particle ){
1167  MF_LOG_WARNING("PionAnalyzer") << "No true beam particle" << std::endl;
1168  return;
1169  }
1170  if (fVerbose) {
1171  std::cout << "Got " << (*mcTruths)[0].NParticles() <<
1172  " particles in mcTruth" << std::endl;
1173  for (int i = 0; i < (*mcTruths)[0].NParticles(); ++i) {
1174  simb::MCParticle part = (*mcTruths)[0].GetParticle(i);
1175  std::cout << part.Process() << " " << part.TrackId() << " " <<
1176  part.PdgCode() << std::endl;
1177 
1178  }
1179  }
1180  }
1181  ////////////////////////////
1182 
1183 
1184  // Getting the BI from the data events
1185  if( evt.isRealData() ){
1186  auto beamHandle = evt.getValidHandle<std::vector<beam::ProtoDUNEBeamEvent>>(fBeamModuleLabel);
1187 
1188  std::vector<art::Ptr<beam::ProtoDUNEBeamEvent>> beamVec;
1189  if( beamHandle.isValid()){
1190  art::fill_ptr_vector(beamVec, beamHandle);
1191  }
1192 
1193  const beam::ProtoDUNEBeamEvent & beamEvent = *(beamVec.at(0)); //Should just have one
1194 
1196  MF_LOG_WARNING("PionAnalyzer") << "Failed quality check" << std::endl;
1197  return;
1198  }
1199 
1200  int nTracks = beamEvent.GetBeamTracks().size();
1201  std::vector< double > momenta = beamEvent.GetRecoBeamMomenta();
1202  int nMomenta = momenta.size();
1203 
1204  if( nMomenta > 0 )
1205  data_BI_P = momenta[0];
1206 
1207  const std::vector<double> the_tofs = beamEvent.GetTOFs();
1208  const std::vector<int> the_chans = beamEvent.GetTOFChans();
1209  for (size_t iTOF = 0; iTOF < the_tofs.size(); ++iTOF) {
1210  data_BI_TOF.push_back(the_tofs[iTOF]);
1211  data_BI_TOF_Chan.push_back(the_chans[iTOF]);
1212  }
1213 
1214  if( nTracks > 0 ){
1215  data_BI_X = beamEvent.GetBeamTracks()[0].Trajectory().End().X();
1216  data_BI_Y = beamEvent.GetBeamTracks()[0].Trajectory().End().Y();
1217  data_BI_Z = beamEvent.GetBeamTracks()[0].Trajectory().End().Z();
1218 
1219  data_BI_dirX = beamEvent.GetBeamTracks()[0].Trajectory().EndDirection().X();
1220  data_BI_dirY = beamEvent.GetBeamTracks()[0].Trajectory().EndDirection().Y();
1221  data_BI_dirZ = beamEvent.GetBeamTracks()[0].Trajectory().EndDirection().Z();
1222  }
1223 
1224  data_BI_nTracks = nTracks;
1225  data_BI_nMomenta = nMomenta;
1226 
1227  std::vector< int > pdg_cands = fBeamlineUtils.GetPID( beamEvent, 1. );
1228  data_BI_PDG_candidates.insert( data_BI_PDG_candidates.end(), pdg_cands.begin(), pdg_cands.end() );
1229 
1230  data_BI_nFibersP1 = beamEvent.GetActiveFibers( "XBPF022697" ).size();
1231  data_BI_nFibersP2 = beamEvent.GetActiveFibers( "XBPF022701" ).size();
1232  data_BI_nFibersP3 = beamEvent.GetActiveFibers( "XBPF022702" ).size();
1233  }
1234  else{ //For MC events
1235  try{
1236  auto beamHandle = evt.getValidHandle<std::vector<beam::ProtoDUNEBeamEvent>>("generator");
1237 
1238  std::vector<art::Ptr<beam::ProtoDUNEBeamEvent>> beamVec;
1239  if( beamHandle.isValid()){
1240  art::fill_ptr_vector(beamVec, beamHandle);
1241  }
1242 
1243  const beam::ProtoDUNEBeamEvent & beamEvent = *(beamVec.at(0)); //Should just have one
1244 
1245 
1246  int nTracks = beamEvent.GetBeamTracks().size();
1247  std::vector< double > momenta = beamEvent.GetRecoBeamMomenta();
1248  int nMomenta = momenta.size();
1249 
1250  if (fVerbose) {
1251  std::cout << "Got beam event" << std::endl;
1252  std::cout << "Got " << nTracks << " Tracks" << std::endl;
1253  std::cout << "Got " << nMomenta << " Momenta" << std::endl;
1254  }
1255 
1256  if( nMomenta > 0 ){
1257  data_BI_P = momenta[0];
1258  if (fVerbose) std::cout << "reco P " << data_BI_P << std::endl;
1259  }
1260 
1261  const std::vector<double> the_tofs = beamEvent.GetTOFs();
1262  const std::vector<int> the_chans = beamEvent.GetTOFChans();
1263  for (size_t iTOF = 0; iTOF < the_tofs.size(); ++iTOF) {
1264  data_BI_TOF.push_back(the_tofs[iTOF]);
1265  data_BI_TOF_Chan.push_back(the_tofs[iTOF]);
1266  }
1267 
1268  if( nTracks > 0 ){
1269  data_BI_X = beamEvent.GetBeamTracks()[0].Trajectory().End().X();
1270  data_BI_Y = beamEvent.GetBeamTracks()[0].Trajectory().End().Y();
1271  data_BI_Z = beamEvent.GetBeamTracks()[0].Trajectory().End().Z();
1272 
1273  data_BI_dirX = beamEvent.GetBeamTracks()[0].Trajectory().EndDirection().X();
1274  data_BI_dirY = beamEvent.GetBeamTracks()[0].Trajectory().EndDirection().Y();
1275  data_BI_dirZ = beamEvent.GetBeamTracks()[0].Trajectory().EndDirection().Z();
1276  }
1277 
1278  data_BI_nTracks = nTracks;
1279  data_BI_nMomenta = nMomenta;
1280 
1281  /*
1282  std::vector< int > pdg_cands = fBeamlineUtils.GetPID( beamEvent, 1. );
1283  data_BI_PDG_candidates.insert( data_BI_PDG_candidates.end(), pdg_cands.begin(), pdg_cands.end() );
1284  */
1285 
1286  data_BI_nFibersP1 = beamEvent.GetActiveFibers( "XBPF022697" ).size();
1287  data_BI_nFibersP2 = beamEvent.GetActiveFibers( "XBPF022701" ).size();
1288  data_BI_nFibersP3 = beamEvent.GetActiveFibers( "XBPF022702" ).size();
1289 
1290  fMCHasBI = true;
1291  }
1292  catch( const cet::exception &e ){
1293  MF_LOG_WARNING("PionAnalyzer") << "BeamEvent generator object not found, moving on" << std::endl;
1294  fMCHasBI = false;
1295  }
1296  }
1297  ////////////////////////////
1298 
1299 
1300  // Helper to get hits and the 4 associated CNN outputs
1301  // CNN Outputs: EM, Track, Michel, Empty
1302  // outputNames: track, em, none, michel
1303  anab::MVAReader<recob::Hit,4> hitResults(evt, "emtrkmichelid:emtrkmichel" );
1304 
1305  auto allHits = evt.getValidHandle<std::vector<recob::Hit> >(fHitTag);
1306 
1307  auto recoTracks = evt.getValidHandle<std::vector<recob::Track> >(fTrackerTag);
1308  art::FindManyP<recob::Hit> findHits(recoTracks,evt,fTrackerTag);
1309 
1310  auto recoShowers = evt.getValidHandle< std::vector< recob::Shower > >(fShowerTag);
1311  art::FindManyP<recob::Hit> findHitsFromShowers(recoShowers,evt,fShowerTag);
1312 
1313  std::map< int, std::vector< int > > trueToPFPs;
1314  if( fTrueToReco ){
1315  trueToPFPs = truthUtil.GetMapMCToPFPs_ByHits( clockData, evt, fPFParticleTag, fHitTag );
1316  }
1317 
1318 
1319  ///Gets the beam pfparticle
1320  std::vector<const recob::PFParticle*> beamParticles = pfpUtil.GetPFParticlesFromBeamSlice(evt,fPFParticleTag);
1321 
1322  if(beamParticles.size() == 0){
1323  std::cout << "We found no beam particles for this event... moving on" << std::endl;
1324  return;
1325  }
1326  else {
1327  std::cout << "Found " << beamParticles.size() << " particles" << std::endl;
1328  }
1329 
1330  // Get the reconstructed PFParticle tagged as beam by Pandora
1331  const recob::PFParticle* particle = beamParticles.at(0);
1332  //////////////////////////////////////////////////////////////////
1333 
1334 
1335  //If MC, attempt to match to some MCParticle
1336  const simb::MCParticle* trueParticle = 0x0;
1337  if( !evt.isRealData() ){
1338  protoana::MCParticleSharedHits beam_match = truthUtil.GetMCParticleByHits( clockData, *particle, evt, fPFParticleTag, fHitTag );
1339  if( beam_match.particle ){
1340  //Check that this is the correct true particle
1341  //if( beam_match.particle->TrackId() == true_beam_particle->TrackId() )
1342  // reco_beam_true_byHits_matched = true;
1343  reco_beam_true_byHits_matched = ( beam_match.particle->TrackId() == true_beam_particle->TrackId() );
1344  reco_beam_true_byHits_PDG = beam_match.particle->PdgCode();
1345  reco_beam_true_byHits_ID = beam_match.particle->TrackId();
1346 
1349  reco_beam_true_byHits_origin = pi_serv->TrackIdToMCTruth_P(beam_match.particle->TrackId())->Origin();
1350 
1351  reco_beam_true_byHits_startPx = beam_match.particle->Px();
1352  reco_beam_true_byHits_startPy = beam_match.particle->Py();
1353  reco_beam_true_byHits_startPz = beam_match.particle->Pz();
1357  reco_beam_true_byHits_startE = beam_match.particle->E();
1358 
1359  size_t np = beam_match.particle->NumberTrajectoryPoints();
1360  if( np > 1 ){
1361  reco_beam_true_byHits_endPx = beam_match.particle->Px( np - 2 );
1362  reco_beam_true_byHits_endPy = beam_match.particle->Py( np - 2 );
1363  reco_beam_true_byHits_endPz = beam_match.particle->Pz( np - 2 );
1367  reco_beam_true_byHits_endE = beam_match.particle->E( np - 2 );
1368  }
1369 
1370  auto list = truthUtil.GetMCParticleListByHits( clockData, *particle, evt, fPFParticleTag, fHitTag );
1371  double total = 0.;
1372  double matched_hits = 0.;
1373  for( size_t j = 0; j < list.size(); ++j ){
1374  // std::cout << "Contrib " << j << " " << list[j].first->TrackId() << " " << list[j].second << std::endl;
1375  //std::cout << "Contrib " << j << " " << list[j].particle->TrackId() << " " << list[j].particle->PdgCode()
1376  // << " " << pi_serv->TrackIdToMCTruth_P(list[j].particle->TrackId())->Origin()
1377  // << " " << list[j].nSharedHits << " " << list[j].nSharedDeltaRayHits << std::endl;
1378 
1379  if( list[j].particle == beam_match.particle ){
1380  matched_hits = list[j].nSharedHits + list[j].nSharedDeltaRayHits;
1381  }
1382 
1383  total += list[j].nSharedHits + list[j].nSharedDeltaRayHits;
1384  }
1385 
1386  reco_beam_true_byHits_purity = ( matched_hits / total );
1387 
1388  }
1389 
1390  trueParticle = truthUtil.GetMCParticleFromPFParticle(clockData, *particle, evt, fPFParticleTag);
1391  if( trueParticle ){
1392 
1393  //Check that this is the correct true particle
1394  if( trueParticle->TrackId() == true_beam_particle->TrackId() ){
1396  }
1397 
1398  reco_beam_true_byE_PDG = trueParticle->PdgCode();
1399  reco_beam_true_byE_ID = trueParticle->TrackId();
1400 
1401  reco_beam_true_byE_process = trueParticle->Process();
1402  reco_beam_true_byE_endProcess = trueParticle->EndProcess();
1403  reco_beam_true_byE_origin = pi_serv->TrackIdToMCTruth_P(trueParticle->TrackId())->Origin();
1404 
1405  reco_beam_true_byE_startPx = trueParticle->Px();
1406  reco_beam_true_byE_startPy = trueParticle->Py();
1407  reco_beam_true_byE_startPz = trueParticle->Pz();
1411  reco_beam_true_byE_startE = trueParticle->E();
1412 
1413  size_t np = trueParticle->NumberTrajectoryPoints();
1414  if( np > 1 ){
1415  reco_beam_true_byE_endPx = trueParticle->Px( np - 2 );
1416  reco_beam_true_byE_endPy = trueParticle->Py( np - 2 );
1417  reco_beam_true_byE_endPz = trueParticle->Pz( np - 2 );
1421  reco_beam_true_byE_endE = trueParticle->E( np - 2 );
1422  }
1423 
1424  }
1425 
1426  //Some truth information from the true particle we got above
1427  true_beam_endProcess = true_beam_particle->EndProcess();
1428 
1429  true_beam_PDG = true_beam_particle->PdgCode();
1430  true_beam_ID = true_beam_particle->TrackId();
1431  true_beam_endX = true_beam_particle->EndX();
1432  true_beam_endY = true_beam_particle->EndY();
1433  true_beam_endZ = true_beam_particle->EndZ();
1434  true_beam_startX = true_beam_particle->Position(0).X();
1435  true_beam_startY = true_beam_particle->Position(0).Y();
1436  true_beam_startZ = true_beam_particle->Position(0).Z();
1437 
1438  true_beam_startPx = true_beam_particle->Px();
1439  true_beam_startPy = true_beam_particle->Py();
1440  true_beam_startPz = true_beam_particle->Pz();
1441  true_beam_startP = true_beam_particle->P();
1442 
1443  size_t true_np = true_beam_particle->NumberTrajectoryPoints();
1444 
1445  true_beam_endPx = true_beam_particle->Px(true_np-2);
1446  true_beam_endPy = true_beam_particle->Py(true_np-2);
1447  true_beam_endPz = true_beam_particle->Pz(true_np-2);
1448  true_beam_endP = true_beam_particle->P(true_np-2);
1449 
1453 
1454  true_beam_nHits = truthUtil.GetMCParticleHits( clockData, *true_beam_particle, evt, fHitTag ).size();
1455 
1456  true_beam_reco_byHits_PFP_ID.push_back( std::vector< int >() );
1457  true_beam_reco_byHits_PFP_nHits.push_back( std::vector< int >() );
1458  true_beam_reco_byHits_allTrack_ID.push_back( std::vector< int >() );
1459  if( fTrueToReco ){
1460  for( size_t i = 0; i < trueToPFPs[ true_beam_ID ].size(); ++i ){
1461  true_beam_reco_byHits_PFP_ID.back().push_back( trueToPFPs[ true_beam_ID ][i] );
1462 
1463  const recob::PFParticle * thePFP = &(pfpVec->at( trueToPFPs[ true_beam_ID ][i] ));
1464  true_beam_reco_byHits_PFP_nHits.back().push_back(
1465  pfpUtil.GetPFParticleHits_Ptrs( *thePFP, evt, fPFParticleTag ).size()
1466  );
1467 
1468  const recob::Track* pandora2Track = 0x0;
1469 
1470  try{
1471  pandora2Track = pfpUtil.GetPFParticleTrack( *thePFP, evt, fPFParticleTag, "pandora2Track" );
1472  }
1473  catch( const cet::exception &e ){
1474  MF_LOG_WARNING("PionAnalyzer") << "pandora2Track object not found, moving on" << std::endl;
1475  }
1476 
1477  if( pandora2Track ){
1478  true_beam_reco_byHits_allTrack_ID.back().push_back( pandora2Track->ID() );
1479  }
1480  else{
1481  true_beam_reco_byHits_allTrack_ID.back().push_back( -1 );
1482  }
1483  }
1484  }
1485 
1486  //Truth thin slice info
1487  //Go through the true processes within the MCTrajectory
1488  const simb::MCTrajectory & true_beam_trajectory = true_beam_particle->Trajectory();
1489  auto true_beam_proc_map = true_beam_trajectory.TrajectoryProcesses();
1490  if (fVerbose) std::cout << "Processes: " << std::endl;
1491 
1492  for( auto itProc = true_beam_proc_map.begin(); itProc != true_beam_proc_map.end(); ++itProc ){
1493  int index = itProc->first;
1494  std::string process = true_beam_trajectory.KeyToProcess(itProc->second);
1495  if (fVerbose) std::cout << index << " " << process << std::endl;
1496 
1497  true_beam_processes.push_back( process );
1498 
1499  if( process == "hadElastic" ){
1500 
1502 
1503  double process_X = true_beam_trajectory.X( index );
1504  double process_Y = true_beam_trajectory.Y( index );
1505  double process_Z = true_beam_trajectory.Z( index );
1506 
1507  double PX = true_beam_trajectory.Px( index );
1508  double next_PX = true_beam_trajectory.Px( index + 1 );
1509  double PY = true_beam_trajectory.Py( index );
1510  double next_PY = true_beam_trajectory.Py( index + 1 );
1511  double PZ = true_beam_trajectory.Pz( index );
1512  double next_PZ = true_beam_trajectory.Pz( index + 1 );
1513 
1514  double total_P = sqrt( PX*PX + PY*PY + PZ*PZ );
1515  double total_next_P = sqrt( next_PX*next_PX + next_PY*next_PY + next_PZ*next_PZ );
1516 
1517  //Get the angle between the direction of this step and the next
1518  true_beam_elastic_costheta.push_back(
1519  ( ( PX * next_PX ) + ( PY * next_PY ) + ( PZ * next_PZ ) ) / ( total_P * total_next_P )
1520  );
1521 
1522  double mass = 139.57;
1523  if( true_beam_PDG == 2212 ) mass = 938.27;
1524  else if( abs(true_beam_PDG) == 211 ) mass = 139.57;
1525  else if( abs(true_beam_PDG) == 11 ) mass = .511;
1526  else if( abs(true_beam_PDG) == 321 ) mass = 321;
1527  else if( abs(true_beam_PDG) == 13 ) mass = 105.66;
1528 
1529  double total_E = sqrt(total_P*total_P*1.e6 + mass*mass);
1530  double total_next_E = sqrt(total_next_P*total_next_P*1.e6 + mass*mass);
1531 
1532  true_beam_elastic_X.push_back( process_X );
1533  true_beam_elastic_Y.push_back( process_Y );
1534  true_beam_elastic_Z.push_back( process_Z );
1535 
1536  true_beam_elastic_deltaE.push_back(total_E - total_next_E);
1537 
1538  std::vector<const sim::IDE *> ides_between_points =
1539  truthUtil.GetSimIDEsBetweenPoints(
1540  *true_beam_particle, true_beam_trajectory.Position(index),
1541  true_beam_trajectory.Position(index +1));
1542 
1543  double total_edep = 0.;
1544  for (size_t i = 0; i < ides_between_points.size(); ++i) {
1545  total_edep += ides_between_points[i]->energy;
1546  }
1547  true_beam_elastic_IDE_edep.push_back(total_edep);
1548 
1549  }
1550  }
1551  if( true_beam_endProcess.find( "Inelastic" ) == std::string::npos ){
1553  }
1554 
1555  if (fVerbose) std::cout << "Looking at IDEs" << std::endl;
1556 
1557  auto view2_IDEs = bt_serv->TrackIdToSimIDEs_Ps( true_beam_ID, geo::View_t(2) );
1558 
1559  if (fVerbose) std::cout << "N view2 IDEs: " << view2_IDEs.size() << std::endl;
1560 
1561  //Sort based on ide z-position
1562  std::sort( view2_IDEs.begin(), view2_IDEs.end(), sort_IDEs );
1563  std::cout << "Sorted" << std::endl;
1564 
1565  //This is an attempt to remove IDEs from things like delta-rays
1566  //that have a large gap in z to the previous
1567  size_t remove_index = 0;
1568  bool do_remove = false;
1569  if( view2_IDEs.size() ){
1570  for( size_t i = 1; i < view2_IDEs.size()-1; ++i ){
1571  const sim::IDE * prev_IDE = view2_IDEs[i-1];
1572  const sim::IDE * this_IDE = view2_IDEs[i];
1573 
1574  if (this_IDE->trackID < 0.) {
1575  em_energy += this_IDE->energy;
1576  }
1577 
1578 
1579  if( this_IDE->trackID < 0 && ( this_IDE->z - prev_IDE->z ) > 5 ){
1580  remove_index = i;
1581  do_remove = true;
1582  break;
1583  }
1584  }
1585  }
1586 
1587  if( do_remove ){
1588  view2_IDEs.erase( view2_IDEs.begin() + remove_index, view2_IDEs.end() );
1589  }
1590 
1591  //Get the mass for the beam particle
1592  double mass = 139.57;
1593  if( true_beam_PDG == 2212 ) mass = 938.27;
1594  else if( abs(true_beam_PDG) == 211 ) mass = 139.57;
1595  else if( abs(true_beam_PDG) == 11 ) mass = .511;
1596  else if( abs(true_beam_PDG) == 321 ) mass = 321;
1597  else if( abs(true_beam_PDG) == 13 ) mass = 105.66;
1598 
1599  double init_KE = sqrt( 1.e6 * true_beam_startP*true_beam_startP + mass*mass ) - mass;
1600  /* Old style of creating the Thin slices with the incident particle momentum
1601  true_beam_incidentEnergies.push_back( init_KE );
1602 
1603  double slice_end = pitch;
1604  double slice_edep = 0.;
1605  for( size_t i = 0; i < view2_IDEs.size(); ++i ){
1606 
1607  auto theIDE = view2_IDEs[i];
1608 
1609  if( theIDE->z < 0. ) continue;
1610 
1611  if( theIDE->z > slice_end ){
1612  true_beam_incidentEnergies.push_back( true_beam_incidentEnergies.back() - slice_edep );
1613  slice_edep = 0.;
1614  slice_end += pitch;
1615  }
1616 
1617  slice_edep += theIDE->energy;
1618  }
1619 
1620  //Remove the last. It's not considered an 'experiment'
1621  true_beam_incidentEnergies.pop_back();
1622  if( true_beam_incidentEnergies.size() ) true_beam_interactingEnergy = true_beam_incidentEnergies.back();
1623  */
1624 
1625  //slice up the view2_IDEs up by the wire pitch
1626  auto sliced_ides = slice_IDEs( view2_IDEs, z0, pitch, true_beam_endZ);
1627  //Get the momentum at the start of the slices.
1628  //Get the first slice
1629  if (fVerbose) std::cout << "size: " << sliced_ides.size() << std::endl;
1630  if (sliced_ides.size()) {
1631  auto first_slice = sliced_ides.begin();
1632  if (fVerbose) std::cout << "Got first slice" << std::endl;
1633 
1634  //Check it has any IDEs
1635  auto theIDEs = first_slice->second;
1636  if (fVerbose) std::cout << "Got ides" << std::endl;
1637  if (theIDEs.size()) {
1638  //Get the first ide z position
1639  double ide_z = theIDEs[0]->z;
1640 
1641  //Go through the trajectory position
1642  //and check for the position that comes immediately before the
1643  //first ide
1644  for (size_t i = 1; i < true_beam_trajectory.size(); ++i) {
1645  double z0 = true_beam_trajectory.Z(i-1);
1646  double z1 = true_beam_trajectory.Z(i);
1647 
1648  if (z0 < ide_z && z1 > ide_z) {
1649  init_KE = 1.e3 * true_beam_trajectory.E(i-1) - mass;
1650  if (fVerbose) {
1651  std::cout << "Found matching position" << z0 << " " << ide_z <<
1652  " " << z1 << std::endl;
1653  std::cout << "init KE: " << init_KE << std::endl;
1654  }
1655  break;
1656  }
1657  }
1658  }
1659  }
1660 
1661  //Go through the sliced up IDEs to create the thin targets
1662  true_beam_incidentEnergies.push_back( init_KE );
1663  for( auto it = sliced_ides.begin(); it != sliced_ides.end(); ++it ){
1664 
1665  auto theIDEs = it->second;
1666 
1667  true_beam_slices.push_back( it->first );
1668  true_beam_slices_nIDEs.push_back( theIDEs.size() );
1669 
1670  double deltaE = 0.;
1671  for( size_t i = 0; i < theIDEs.size(); ++i ){
1672  deltaE += theIDEs[i]->energy;
1673  }
1674 
1675  true_beam_slices_deltaE.push_back( deltaE );
1676  true_beam_incidentEnergies.push_back( true_beam_incidentEnergies.back() - deltaE );
1677  }
1678  true_beam_incidentEnergies.pop_back();
1680 
1681  //Save the trajectory points
1682  for (size_t i = 0; i < true_beam_trajectory.size(); ++i) {
1683  true_beam_traj_X.push_back(true_beam_trajectory.X(i));
1684  true_beam_traj_Y.push_back(true_beam_trajectory.Y(i));
1685  true_beam_traj_Z.push_back(true_beam_trajectory.Z(i));
1686 
1687  true_beam_traj_KE.push_back(true_beam_trajectory.E(i)*1.e3 - mass);
1688  }
1689 
1690  //Look through the daughters
1691  for( int i = 0; i < true_beam_particle->NumberDaughters(); ++i ){
1692  int daughterID = true_beam_particle->Daughter(i);
1693 
1694  if (fVerbose) std::cout << "Daughter " << i << " ID: " << daughterID << std::endl;
1695  auto part = plist[ daughterID ];
1696  int pid = part->PdgCode();
1697 
1698  std::string process = part->Process();
1699 
1700  if (process == "muIoni" || process == "hIoni")
1701  continue;
1702 
1703  true_beam_daughter_PDG.push_back(pid);
1704  true_beam_daughter_ID.push_back( part->TrackId() );
1705 
1706  true_beam_daughter_len.push_back( part->Trajectory().TotalLength() );
1707 
1708  true_beam_daughter_startX.push_back( part->Position(0).X() );
1709  true_beam_daughter_startY.push_back( part->Position(0).Y() );
1710  true_beam_daughter_startZ.push_back( part->Position(0).Z() );
1711 
1712  true_beam_daughter_endX.push_back( part->EndX() );
1713  true_beam_daughter_endY.push_back( part->EndY() );
1714  true_beam_daughter_endZ.push_back( part->EndZ() );
1715 
1716  true_beam_daughter_startPx.push_back( part->Px() );
1717  true_beam_daughter_startPy.push_back( part->Py() );
1718  true_beam_daughter_startPz.push_back( part->Pz() );
1719  true_beam_daughter_startP.push_back( part->P() );
1720 
1721  true_beam_daughter_Process.push_back( part->Process() );
1722  true_beam_daughter_endProcess.push_back( part->EndProcess() );
1723 
1724  if (fVerbose) {
1725  std::cout << "Process: " << part->Process() << std::endl;
1726  std::cout << "PID: " << pid << std::endl;
1727  std::cout << "Start: " << part->Position(0).X() << " " << part->Position(0).Y() << " " << part->Position(0).Z() << std::endl;
1728  std::cout << "End: " << part->EndPosition().X() << " " << part->EndPosition().Y() << " " << part->EndPosition().Z() << std::endl;
1729  std::cout << "Len: " << part->Trajectory().TotalLength() << std::endl;
1730  }
1731 
1732  if( part->Process().find( "Inelastic" ) != std::string::npos ){
1733  if( pid == 211 ) ++true_daughter_nPiPlus;
1734  if( pid == -211 ) ++true_daughter_nPiMinus;
1735  if( pid == 111 ) ++true_daughter_nPi0;
1736  if( pid == 2212 ) ++true_daughter_nProton;
1737  if( pid == 2112 ) ++true_daughter_nNeutron;
1738  if( pid > 2212 ) ++true_daughter_nNucleus;
1739  }
1740 
1741  //Look for the gammas coming out of the pi0s
1742  if( pid == 111 ){
1743  //std::cout << "Found pi0. Looking at true daughters" << std::endl;
1744  for( int j = 0; j < part->NumberDaughters(); ++j ){
1745  int pi0_decay_daughter_ID = part->Daughter(j);
1746  auto pi0_decay_part = plist[ pi0_decay_daughter_ID ];
1747  true_beam_Pi0_decay_PDG.push_back( pi0_decay_part->PdgCode() );
1748  true_beam_Pi0_decay_ID.push_back( pi0_decay_part->TrackId() );
1749  true_beam_Pi0_decay_startP.push_back( pi0_decay_part->P() );
1750  true_beam_Pi0_decay_startPx.push_back( pi0_decay_part->Px() );
1751  true_beam_Pi0_decay_startPy.push_back( pi0_decay_part->Py() );
1752  true_beam_Pi0_decay_startPz.push_back( pi0_decay_part->Pz() );
1753  true_beam_Pi0_decay_startX.push_back( pi0_decay_part->Position(0).X() );
1754  true_beam_Pi0_decay_startY.push_back( pi0_decay_part->Position(0).Y() );
1755  true_beam_Pi0_decay_startZ.push_back( pi0_decay_part->Position(0).Z() );
1756  true_beam_Pi0_decay_parID.push_back( pi0_decay_part->Mother() );
1757 
1758  true_beam_Pi0_decay_len.push_back( pi0_decay_part->Trajectory().TotalLength() );
1759  true_beam_Pi0_decay_nHits.push_back( truthUtil.GetMCParticleHits( clockData, *pi0_decay_part, evt, fHitTag ).size() );
1760 
1761  true_beam_Pi0_decay_reco_byHits_PFP_ID.push_back( std::vector<int>() );
1762  true_beam_Pi0_decay_reco_byHits_PFP_nHits.push_back( std::vector<int>() );
1763  true_beam_Pi0_decay_reco_byHits_PFP_trackScore.push_back( std::vector<double>() );
1764 
1765  true_beam_Pi0_decay_reco_byHits_allTrack_ID.push_back( std::vector<int>() );
1766  true_beam_Pi0_decay_reco_byHits_allTrack_startX.push_back( std::vector<double>() );
1767  true_beam_Pi0_decay_reco_byHits_allTrack_startY.push_back( std::vector<double>() );
1768  true_beam_Pi0_decay_reco_byHits_allTrack_startZ.push_back( std::vector<double>() );
1769  true_beam_Pi0_decay_reco_byHits_allTrack_len.push_back( std::vector<double>() );
1770  true_beam_Pi0_decay_reco_byHits_allTrack_endX.push_back( std::vector<double>() );
1771  true_beam_Pi0_decay_reco_byHits_allTrack_endY.push_back( std::vector<double>() );
1772  true_beam_Pi0_decay_reco_byHits_allTrack_endZ.push_back( std::vector<double>() );
1773  true_beam_Pi0_decay_reco_byHits_allShower_ID.push_back( std::vector<int>() );
1774  true_beam_Pi0_decay_reco_byHits_allShower_startX.push_back( std::vector<double>() );
1775  true_beam_Pi0_decay_reco_byHits_allShower_startY.push_back( std::vector<double>() );
1776  true_beam_Pi0_decay_reco_byHits_allShower_startZ.push_back( std::vector<double>() );
1777  true_beam_Pi0_decay_reco_byHits_allShower_len.push_back( std::vector<double>() );
1778 
1779  if( fTrueToReco ){
1780  for( size_t k = 0; k < trueToPFPs[ pi0_decay_part->TrackId() ].size(); ++k ){
1781  true_beam_Pi0_decay_reco_byHits_PFP_ID.back().push_back( trueToPFPs[ pi0_decay_part->TrackId() ][k] );
1782 
1783  const recob::PFParticle * thePFP = &(pfpVec->at( trueToPFPs[ pi0_decay_part->TrackId() ][k] ));
1785  pfpUtil.GetPFParticleHits_Ptrs( *thePFP, evt, fPFParticleTag ).size()
1786  );
1787 
1788  cnnOutput2D theCNNResults = GetCNNOutputFromPFParticle( *thePFP, evt, hitResults, pfpUtil, fPFParticleTag );
1789  true_beam_Pi0_decay_reco_byHits_PFP_trackScore.back().push_back( ( ( theCNNResults.nHits > 0 ) ? ( theCNNResults.track / theCNNResults.nHits ) : -999. ) );
1790 
1791  const recob::Track* pandora2Track = 0x0;
1792  try{
1793  pandora2Track = pfpUtil.GetPFParticleTrack( *thePFP, evt, fPFParticleTag, "pandora2Track" );
1794  }
1795  catch( const cet::exception &e ){
1796  MF_LOG_WARNING("PionAnalyzer") << "pandora2Track object not found, moving on" << std::endl;
1797  }
1798 
1799  if( pandora2Track ){
1800  true_beam_Pi0_decay_reco_byHits_allTrack_ID.back().push_back( pandora2Track->ID() );
1801  true_beam_Pi0_decay_reco_byHits_allTrack_startX.back().push_back( pandora2Track->Trajectory().Start().X() );
1802  true_beam_Pi0_decay_reco_byHits_allTrack_startY.back().push_back( pandora2Track->Trajectory().Start().Y() );
1803  true_beam_Pi0_decay_reco_byHits_allTrack_startZ.back().push_back( pandora2Track->Trajectory().Start().Z() );
1804  true_beam_Pi0_decay_reco_byHits_allTrack_endX.back().push_back( pandora2Track->Trajectory().End().X() );
1805  true_beam_Pi0_decay_reco_byHits_allTrack_endY.back().push_back( pandora2Track->Trajectory().End().Y() );
1806  true_beam_Pi0_decay_reco_byHits_allTrack_endZ.back().push_back( pandora2Track->Trajectory().End().Z() );
1807  true_beam_Pi0_decay_reco_byHits_allTrack_len.back().push_back( pandora2Track->Length() );
1808 
1809  }
1810  else{
1811  true_beam_Pi0_decay_reco_byHits_allTrack_ID.back().push_back( -1 );
1812  true_beam_Pi0_decay_reco_byHits_allTrack_startX.back().push_back( -999. );
1813  true_beam_Pi0_decay_reco_byHits_allTrack_startY.back().push_back( -999. );
1814  true_beam_Pi0_decay_reco_byHits_allTrack_startZ.back().push_back( -999. );
1815  true_beam_Pi0_decay_reco_byHits_allTrack_endX.back().push_back( -999. );
1816  true_beam_Pi0_decay_reco_byHits_allTrack_endY.back().push_back( -999. );
1817  true_beam_Pi0_decay_reco_byHits_allTrack_endZ.back().push_back( -999. );
1818  true_beam_Pi0_decay_reco_byHits_allTrack_len.back().push_back( -999. );
1819  }
1820 
1821  const recob::Shower* pandora2Shower = 0x0;
1822  try{
1823  pandora2Shower = pfpUtil.GetPFParticleShower( *thePFP, evt, fPFParticleTag, "pandora2Shower" );
1824  }
1825  catch( const cet::exception &e ){
1826  MF_LOG_WARNING("PionAnalyzer") << "pandora2Shower object not found, moving on" << std::endl;
1827  }
1828 
1829  if( pandora2Shower ){
1830  true_beam_Pi0_decay_reco_byHits_allShower_ID.back().push_back( pandora2Shower->ID() );
1831  true_beam_Pi0_decay_reco_byHits_allShower_startX.back().push_back( pandora2Shower->ShowerStart().X() );
1832  true_beam_Pi0_decay_reco_byHits_allShower_startY.back().push_back( pandora2Shower->ShowerStart().Y() );
1833  true_beam_Pi0_decay_reco_byHits_allShower_startZ.back().push_back( pandora2Shower->ShowerStart().Z() );
1834  true_beam_Pi0_decay_reco_byHits_allShower_len.back().push_back( pandora2Shower->Length() );
1835  }
1836  else{
1837  true_beam_Pi0_decay_reco_byHits_allShower_ID.back().push_back( -1 );
1838  true_beam_Pi0_decay_reco_byHits_allShower_startX.back().push_back( -999. );
1839  true_beam_Pi0_decay_reco_byHits_allShower_startY.back().push_back( -999. );
1840  true_beam_Pi0_decay_reco_byHits_allShower_startZ.back().push_back( -999. );
1841  true_beam_Pi0_decay_reco_byHits_allShower_len.back().push_back( -999. );
1842  }
1843 
1844  }
1845  }
1846 
1847  }
1848  }
1849 
1850  for( int j = 0; j < part->NumberDaughters(); ++j ){
1851  int grand_daughter_ID = part->Daughter(j);
1852  auto grand_daughter_part = plist[ grand_daughter_ID ];
1853  true_beam_grand_daughter_PDG.push_back( grand_daughter_part->PdgCode() );
1854  true_beam_grand_daughter_ID.push_back( grand_daughter_part->TrackId() );
1855  true_beam_grand_daughter_parID.push_back( part->TrackId() );
1856  true_beam_grand_daughter_nHits.push_back( truthUtil.GetMCParticleHits( clockData, *grand_daughter_part, evt, fHitTag ).size() );
1857  true_beam_grand_daughter_Process.push_back( grand_daughter_part->Process() );
1858  true_beam_grand_daughter_endProcess.push_back( grand_daughter_part->EndProcess() );
1859  }
1860 
1861 
1862  true_beam_daughter_reco_byHits_PFP_ID.push_back( std::vector<int>() );
1863  true_beam_daughter_reco_byHits_PFP_nHits.push_back( std::vector<int>() );
1864  true_beam_daughter_reco_byHits_PFP_trackScore.push_back( std::vector<double>() );
1865 
1866  true_beam_daughter_reco_byHits_allTrack_ID.push_back( std::vector<int>() );
1867  true_beam_daughter_reco_byHits_allTrack_startX.push_back( std::vector<double>() );
1868  true_beam_daughter_reco_byHits_allTrack_startY.push_back( std::vector<double>() );
1869  true_beam_daughter_reco_byHits_allTrack_startZ.push_back( std::vector<double>() );
1870  true_beam_daughter_reco_byHits_allTrack_len.push_back( std::vector<double>() );
1871  true_beam_daughter_reco_byHits_allTrack_endX.push_back( std::vector<double>() );
1872  true_beam_daughter_reco_byHits_allTrack_endY.push_back( std::vector<double>() );
1873  true_beam_daughter_reco_byHits_allTrack_endZ.push_back( std::vector<double>() );
1874  true_beam_daughter_reco_byHits_allShower_ID.push_back( std::vector<int>() );
1875  true_beam_daughter_reco_byHits_allShower_startX.push_back( std::vector<double>() );
1876  true_beam_daughter_reco_byHits_allShower_startY.push_back( std::vector<double>() );
1877  true_beam_daughter_reco_byHits_allShower_startZ.push_back( std::vector<double>() );
1878  true_beam_daughter_reco_byHits_allShower_len.push_back( std::vector<double>() );
1879 
1880 
1881  if( fTrueToReco ){
1882  for( size_t j = 0; j < trueToPFPs[ part->TrackId() ].size(); ++j ){
1883  true_beam_daughter_reco_byHits_PFP_ID.back().push_back( trueToPFPs[ part->TrackId() ][j] );
1884 
1885  const recob::PFParticle * thePFP = &(pfpVec->at( trueToPFPs[ part->TrackId() ][j] ));
1887  pfpUtil.GetPFParticleHits_Ptrs( *thePFP, evt, fPFParticleTag ).size()
1888  );
1889 
1890  cnnOutput2D theCNNResults = GetCNNOutputFromPFParticle( *thePFP, evt, hitResults, pfpUtil, fPFParticleTag );
1891  true_beam_daughter_reco_byHits_PFP_trackScore.back().push_back( ( ( theCNNResults.nHits > 0 ) ? ( theCNNResults.track / theCNNResults.nHits ) : -999. ) );
1892 
1893  const recob::Track* pandora2Track = 0x0;
1894  try{
1895  pandora2Track = pfpUtil.GetPFParticleTrack( *thePFP, evt, fPFParticleTag, "pandora2Track" );
1896  }
1897  catch( const cet::exception &e ){
1898  MF_LOG_WARNING("PionAnalyzer") << "pandora2Track object not found, moving on" << std::endl;
1899  }
1900 
1901  if( pandora2Track ){
1902  true_beam_daughter_reco_byHits_allTrack_ID.back().push_back( pandora2Track->ID() );
1903  true_beam_daughter_reco_byHits_allTrack_startX.back().push_back( pandora2Track->Trajectory().Start().X() );
1904  true_beam_daughter_reco_byHits_allTrack_startY.back().push_back( pandora2Track->Trajectory().Start().Y() );
1905  true_beam_daughter_reco_byHits_allTrack_startZ.back().push_back( pandora2Track->Trajectory().Start().Z() );
1906  true_beam_daughter_reco_byHits_allTrack_endX.back().push_back( pandora2Track->Trajectory().End().X() );
1907  true_beam_daughter_reco_byHits_allTrack_endY.back().push_back( pandora2Track->Trajectory().End().Y() );
1908  true_beam_daughter_reco_byHits_allTrack_endZ.back().push_back( pandora2Track->Trajectory().End().Z() );
1909  true_beam_daughter_reco_byHits_allTrack_len.back().push_back( pandora2Track->Length() );
1910 
1911  }
1912  else{
1913  true_beam_daughter_reco_byHits_allTrack_ID.back().push_back( -1 );
1914  true_beam_daughter_reco_byHits_allTrack_startX.back().push_back( -999. );
1915  true_beam_daughter_reco_byHits_allTrack_startY.back().push_back( -999. );
1916  true_beam_daughter_reco_byHits_allTrack_startZ.back().push_back( -999. );
1917  true_beam_daughter_reco_byHits_allTrack_endX.back().push_back( -999. );
1918  true_beam_daughter_reco_byHits_allTrack_endY.back().push_back( -999. );
1919  true_beam_daughter_reco_byHits_allTrack_endZ.back().push_back( -999. );
1920  true_beam_daughter_reco_byHits_allTrack_len.back().push_back( -999. );
1921  }
1922 
1923  const recob::Shower* pandora2Shower = 0x0;
1924  try{
1925  pandora2Shower = pfpUtil.GetPFParticleShower( *thePFP, evt, fPFParticleTag, "pandora2Shower" );
1926  }
1927  catch( const cet::exception &e ){
1928  MF_LOG_WARNING("PionAnalyzer") << "pandora2Shower object not found, moving on" << std::endl;
1929  }
1930 
1931  if( pandora2Shower ){
1932  true_beam_daughter_reco_byHits_allShower_ID.back().push_back( pandora2Shower->ID() );
1933  true_beam_daughter_reco_byHits_allShower_startX.back().push_back( pandora2Shower->ShowerStart().X() );
1934  true_beam_daughter_reco_byHits_allShower_startY.back().push_back( pandora2Shower->ShowerStart().Y() );
1935  true_beam_daughter_reco_byHits_allShower_startZ.back().push_back( pandora2Shower->ShowerStart().Z() );
1936  true_beam_daughter_reco_byHits_allShower_len.back().push_back( pandora2Shower->Length() );
1937 
1938  }
1939  else{
1940  true_beam_daughter_reco_byHits_allShower_ID.back().push_back( -1 );
1941  true_beam_daughter_reco_byHits_allShower_startX.back().push_back( -999. );
1942  true_beam_daughter_reco_byHits_allShower_startY.back().push_back( -999. );
1943  true_beam_daughter_reco_byHits_allShower_startZ.back().push_back( -999. );
1944  true_beam_daughter_reco_byHits_allShower_len.back().push_back( -999. );
1945  }
1946 
1947  }
1948  }
1949 
1950  true_beam_daughter_nHits.push_back( truthUtil.GetMCParticleHits( clockData, *part, evt, fHitTag ).size() );
1951 
1952  }
1953  }
1954 
1955  //Get CNN output for the beam
1956  reco_beam_PFP_ID = particle->Self();
1957  const std::vector< art::Ptr< recob::Hit > > beamPFP_hits = pfpUtil.GetPFParticleHits_Ptrs( *particle, evt, fPFParticleTag );
1958  reco_beam_PFP_nHits = beamPFP_hits.size();
1959 
1960  cnnOutput2D cnn = GetCNNOutputFromPFParticle( *particle, evt, hitResults, pfpUtil, fPFParticleTag );
1961  if( cnn.nHits > 0 ){
1962  reco_beam_PFP_trackScore = (cnn.track / cnn.nHits);
1963  reco_beam_PFP_emScore = (cnn.em / cnn.nHits);
1964  reco_beam_PFP_michelScore = (cnn.michel / cnn.nHits);
1965  }
1966  else{
1967  reco_beam_PFP_trackScore = -999.;
1968  reco_beam_PFP_emScore = -999.;
1969  reco_beam_PFP_michelScore = -999.;
1970  }
1971 
1972  cnnOutput2D cnn_collection = GetCNNOutputFromPFParticleFromPlane( *particle, evt, hitResults, pfpUtil, fPFParticleTag, 2 );
1973  if( cnn_collection.nHits > 0 ){
1974  reco_beam_PFP_trackScore_collection = (cnn_collection.track / cnn_collection.nHits);
1975  reco_beam_PFP_emScore_collection = (cnn_collection.em / cnn_collection.nHits);
1976  reco_beam_PFP_michelScore_collection = (cnn_collection.michel / cnn_collection.nHits);
1977  }
1978  else{
1982  }
1983 
1984 
1985 
1986 
1987  // Determine if the beam particle is track-like or shower-like
1988  const recob::Track* thisTrack = pfpUtil.GetPFParticleTrack(*particle,evt,fPFParticleTag,fTrackerTag);
1989  const recob::Shower* thisShower = pfpUtil.GetPFParticleShower(*particle,evt,fPFParticleTag,fShowerTag);
1990  if( thisTrack ){
1991  // Now we can look for the interaction point of the particle if one exists, i.e where the particle
1992  // scatters off an argon nucleus. Shower-like objects won't have an interaction point, so we can
1993  // check this by making sure we get a sensible position
1994  const TVector3 interactionVtx = pfpUtil.GetPFParticleSecondaryVertex(*particle,evt,fPFParticleTag,fTrackerTag);
1995  reco_beam_vtxX = interactionVtx.X();
1996  reco_beam_vtxY = interactionVtx.Y();
1997  reco_beam_vtxZ = interactionVtx.Z();
1998  ////////////////////////////////////////////
1999 
2000  std::pair<double, int> vertex_michel_score =
2001  trackUtil.GetVertexMichelScore(*thisTrack, evt, fTrackerTag, fHitTag/*,
2002  0., -500., 500., 0., 500., 0.*/);
2003  reco_beam_vertex_nHits = vertex_michel_score.second;
2004  reco_beam_vertex_michel_score = vertex_michel_score.first;
2005  //std::cout << vertex_michel_score.first << " " << vertex_michel_score.second << std::endl;
2006 
2007  if (fVerbose) std::cout << "Beam particle is track-like " << thisTrack->ID() << std::endl;
2008  reco_beam_type = 13;
2009 
2010  reco_beam_passes_beam_cuts = beam_cuts.IsBeamlike( *thisTrack, evt, "1" );
2011  if (fVerbose) std::cout << "Beam Cuts " << reco_beam_passes_beam_cuts << std::endl;
2012 
2013 
2014  reco_beam_trackID = thisTrack->ID();
2015 
2016  reco_beam_startX = thisTrack->Trajectory().Start().X();
2017  reco_beam_startY = thisTrack->Trajectory().Start().Y();
2018  reco_beam_startZ = thisTrack->Trajectory().Start().Z();
2019  reco_beam_endX = thisTrack->Trajectory().End().X();
2020  reco_beam_endY = thisTrack->Trajectory().End().Y();
2021  reco_beam_endZ = thisTrack->Trajectory().End().Z();
2022 
2023  auto startDir = thisTrack->StartDirection();
2024  auto endDir = thisTrack->EndDirection();
2025 
2026  //try flipping
2028  reco_beam_flipped = true;
2029  reco_beam_endX = thisTrack->Trajectory().Start().X();
2030  reco_beam_endY = thisTrack->Trajectory().Start().Y();
2031  reco_beam_endZ = thisTrack->Trajectory().Start().Z();
2032  reco_beam_startX = thisTrack->Trajectory().End().X();
2033  reco_beam_startY = thisTrack->Trajectory().End().Y();
2034  reco_beam_startZ = thisTrack->Trajectory().End().Z();
2035 
2036  reco_beam_trackDirX = -1. * endDir.X();
2037  reco_beam_trackDirY = -1. * endDir.Y();
2038  reco_beam_trackDirZ = -1. * endDir.Z();
2039 
2040  reco_beam_trackEndDirX = -1. * startDir.X();
2041  reco_beam_trackEndDirY = -1. * startDir.Y();
2042  reco_beam_trackEndDirZ = -1. * startDir.Z();
2043  }
2044  else{
2045  reco_beam_flipped = false;
2046  reco_beam_trackDirX = startDir.X();
2047  reco_beam_trackDirY = startDir.Y();
2048  reco_beam_trackDirZ = startDir.Z();
2049  reco_beam_trackEndDirX = endDir.X();
2050  reco_beam_trackEndDirY = endDir.Y();
2051  reco_beam_trackEndDirZ = endDir.Z();
2052  }
2053 
2054  reco_beam_len = thisTrack->Length();
2056  thisTrack->Length(), 2212);
2058  thisTrack->Length(), 13);
2059  ////////////////////////////////////////////////////////////////
2060 
2061 
2062  //An old attempt at determining if the reco failed
2063  //and if we should cut out this event
2064  //
2065  //Might throw this out
2068  for( size_t i = 0; i < thisTrack->NumberTrajectoryPoints(); ++i ){
2069  auto pt = thisTrack->Trajectory().LocationAtPoint(i);
2070  if( ( pt.X() - -999. ) < 1.e-6 ) continue;
2071 
2072  TVector3 p( pt.X(), pt.Y(), pt.Z() );
2073  double dist = lateralDist( dir, start, p );
2074 
2076 
2077  if( i < thisTrack->NumberTrajectoryPoints() - 1 ){
2078  auto next_pt = thisTrack->Trajectory().LocationAtPoint(i+1);
2079  if( ( next_pt.X() - -999. ) > 1.e-6 ){
2080 
2081  TVector3 next_p( next_pt.X(), next_pt.Y(), next_pt.Z() );
2082  double segment = ( next_p - p ).Mag();
2083  if( segment > quality_reco_max_segment ) quality_reco_max_segment = segment;
2084  }
2085  }
2086  }
2087 
2088  std::map< const recob::Hit *, int > hitsToSlices;
2089  std::map< int, std::vector< const recob::Hit * > > slicesToHits;
2090 
2091  //Looking at the hits in the beam track
2092  std::map< size_t, const recob::Hit * > trajPtsToHits = trackUtil.GetRecoHitsFromTrajPoints( *thisTrack, evt, fTrackerTag );
2093  double max_X = 0.;
2094  double max_Y = 0.;
2095  double max_Z = 0.;
2096 
2097  std::vector<int> view_0_TPC;
2098  std::vector<int> view_1_TPC;
2099  std::vector<int> view_2_TPC;
2100 
2101  for( auto it = trajPtsToHits.begin(); it != trajPtsToHits.end(); ++it ){
2102 
2103  const recob::Hit * theHit = it->second;
2104  size_t i = it->first;
2105 
2106  double x = thisTrack->Trajectory().LocationAtPoint(i).X();
2107  double y = thisTrack->Trajectory().LocationAtPoint(i).Y();
2108  double z = thisTrack->Trajectory().LocationAtPoint(i).Z();
2109 
2110  if( fSaveHits ){
2111  //saving all hit coordinates for beamtrack
2112  reco_beam_spacePts_X.push_back(x);
2113  reco_beam_spacePts_Y.push_back(y);
2114  reco_beam_spacePts_Z.push_back(z);
2115  }
2116 
2117  //This creates the slices for the thin slice method.
2118  int slice = std::floor(
2119  (thisTrack->Trajectory().LocationAtPoint(i).Z() - z0) / pitch);
2120  hitsToSlices[theHit] = slice;
2121  slicesToHits[slice].push_back(theHit);
2122 
2123  if (z > max_Z){
2124  max_Z = z;
2125  max_X = y;
2126  max_Y = x;
2127  }
2128 
2129  //Some more attempts at checking reconstruction quality
2130  switch( theHit->View() ){
2131  case 0:
2132  if( theHit->WireID().TPC == 5 )
2134  quality_reco_view_0_wire.push_back( theHit->WireID().Wire );
2135  quality_reco_view_0_tick.push_back( theHit->PeakTime() );
2136  view_0_TPC.push_back( theHit->WireID().TPC );
2137  break;
2138  case 1:
2139  if( theHit->WireID().TPC == 5 )
2141  quality_reco_view_1_wire.push_back( theHit->WireID().Wire );
2142  quality_reco_view_1_tick.push_back( theHit->PeakTime() );
2143  view_1_TPC.push_back( theHit->WireID().TPC );
2144  break;
2145  case 2:
2146  if( theHit->WireID().TPC == 5 )
2148  quality_reco_view_2_wire.push_back( theHit->WireID().Wire );
2149  quality_reco_view_2_z.push_back( thisTrack->Trajectory().LocationAtPoint(i).Z() );
2150  quality_reco_view_2_tick.push_back( theHit->PeakTime() );
2151  view_2_TPC.push_back( theHit->WireID().TPC );
2152  break;
2153  default:
2154  break;
2155  }
2156  }
2157 
2158  for( size_t i = 1; i < quality_reco_view_0_wire.size(); ++i ){
2162 
2163  if( quality_reco_view_0_wire[i] < quality_reco_view_0_wire[i-1] && ( view_0_TPC[i] != 5 && view_0_TPC[i-1] != 5) ){
2165  }
2166  }
2167 
2168  for( size_t i = 1; i < quality_reco_view_1_wire.size(); ++i ){
2172 
2173  if( quality_reco_view_1_wire[i] > quality_reco_view_1_wire[i-1] && ( view_1_TPC[i] != 5 && view_1_TPC[i-1] != 5)){
2175  }
2176  }
2177 
2178  for( size_t i = 1; i < quality_reco_view_2_wire.size(); ++i ){
2182 
2183  if( quality_reco_view_2_wire[i] < quality_reco_view_2_wire[i-1] && ( view_2_TPC[i] != 5 && view_2_TPC[i-1] != 5)){
2185  }
2186  }
2187 
2188  //Last point is the vertex slice
2189  reco_beam_vertex_slice = slicesToHits.rbegin()->first;
2190 
2191  //Primary Track Calorimetry
2192  /*std::vector< anab::Calorimetry> */ auto calo = trackUtil.GetRecoTrackCalorimetry(*thisTrack, evt, fTrackerTag, fCalorimetryTag);
2193  bool found_calo = false;
2194  size_t index = 0;
2195  for ( index = 0; index < calo.size(); ++index) {
2196  if (calo[index].PlaneID().Plane == 2) {
2197  found_calo = true;
2198  break;
2199  }
2200  }
2201  std::cout << "Cali index " << index << std::endl;
2202 
2203  if (found_calo) {
2205  calo[index].Range(), 2212);
2207  calo[index].Range(), 13);
2208  reco_beam_alt_len = calo[index].Range();
2209 
2210  auto calo_dQdX = calo[index].dQdx();
2211  auto calo_dEdX = calo[index].dEdx();
2212  auto calo_range = calo[index].ResidualRange();
2213  auto TpIndices = calo[index].TpIndices();
2214 
2215  if (fCalorimetryTag == "pandoracali") {
2216  auto pandoracalo = trackUtil.GetRecoTrackCalorimetry(*thisTrack, evt, fTrackerTag, "pandoracalo");
2217  size_t this_index = 0;
2218  for ( this_index = 0; this_index < pandoracalo.size(); ++this_index) {
2219  if (pandoracalo[this_index].PlaneID().Plane == 2) {
2220  break;
2221  }
2222  }
2223  std::cout << this_index << std::endl;
2224  TpIndices = pandoracalo[this_index].TpIndices();
2225  std::cout << "pandoracalo hits " << pandoracalo[this_index].dQdx().size() << std::endl;
2226  }
2227  std::cout << calo_dQdX.size() << std::endl;
2228  std::cout << calo[index].PlaneID().Plane << std::endl;
2229 
2230  auto theXYZPoints = calo[index].XYZ();
2231  std::vector< size_t > calo_hit_indices;
2232  for( size_t i = 0; i < calo_dQdX.size(); ++i ){
2233  if (fVerbose) std::cout << i << std::endl;
2234  reco_beam_dQdX.push_back( calo_dQdX[i] );
2235  reco_beam_dEdX.push_back( calo_dEdX[i] );
2236  reco_beam_resRange.push_back( calo_range[i] );
2237  reco_beam_TrkPitch.push_back( calo[index].TrkPitchVec()[i] );
2238 
2239  const recob::Hit & theHit = (*allHits)[ TpIndices[i] ];
2240  reco_beam_calo_TPC.push_back(theHit.WireID().TPC);
2241  if (theHit.WireID().TPC == 1) {
2242  reco_beam_calo_wire.push_back( theHit.WireID().Wire );
2243  }
2244  else if (theHit.WireID().TPC == 5) {
2245  reco_beam_calo_wire.push_back( theHit.WireID().Wire + 479);
2246  }
2247  else {
2248  reco_beam_calo_wire.push_back(theHit.WireID().Wire );
2249  }
2250  reco_beam_calo_tick.push_back( theHit.PeakTime() );
2251  calo_hit_indices.push_back( TpIndices[i] );
2252 
2253  reco_beam_calo_wire_z.push_back(
2254  geom->Wire(theHit.WireID()).GetCenter().Z());
2255 
2256  if (fVerbose)
2257  std::cout << theXYZPoints[i].X() << " " << theXYZPoints[i].Y() << " " <<
2258  theXYZPoints[i].Z() << " " << theHit.WireID().Wire << " " <<
2259  geom->Wire(theHit.WireID()).GetCenter().Z() << " " <<
2260  theHit.WireID().TPC << " " << std::endl;
2261  }
2262 
2263  //Getting the SCE corrected start/end positions & directions
2264  std::sort(theXYZPoints.begin(), theXYZPoints.end(), [](auto a, auto b)
2265  {return (a.Z() < b.Z());});
2266 
2267  //std::cout << theXYZPoints.size() << std:;endl;
2268  if (theXYZPoints.size()) {
2269  reco_beam_calo_startX = theXYZPoints[0].X();
2270  reco_beam_calo_startY = theXYZPoints[0].Y();
2271  reco_beam_calo_startZ = theXYZPoints[0].Z();
2272  reco_beam_calo_endX = theXYZPoints.back().X();
2273  reco_beam_calo_endY = theXYZPoints.back().Y();
2274  reco_beam_calo_endZ = theXYZPoints.back().Z();
2275 
2276  TVector3 dir((theXYZPoints.back().X() - theXYZPoints[0].X()),
2277  (theXYZPoints.back().Y() - theXYZPoints[0].Y()),
2278  (theXYZPoints.back().Z() - theXYZPoints[0].Z()));
2279  reco_beam_calo_startDirX.push_back(dir.Unit().X());
2280  reco_beam_calo_endDirX.push_back(dir.Unit().X());
2281  reco_beam_calo_startDirY.push_back(dir.Unit().Y());
2282  reco_beam_calo_endDirY.push_back(dir.Unit().Y());
2283  reco_beam_calo_startDirZ.push_back(dir.Unit().Z());
2284  reco_beam_calo_endDirZ.push_back(dir.Unit().Z());
2285  }
2286  else {
2287  reco_beam_calo_startDirX.push_back(-1.);
2288  reco_beam_calo_endDirX.push_back(-1.);
2289  reco_beam_calo_startDirY.push_back(-1.);
2290  reco_beam_calo_endDirY.push_back(-1.);
2291  reco_beam_calo_startDirZ.push_back(-1.);
2292  reco_beam_calo_endDirZ.push_back(-1.);
2293  }
2294 
2295  if (theXYZPoints.size() > 1) {
2296  TVector3 start_p1(theXYZPoints[0].X(),
2297  theXYZPoints[0].Y(), theXYZPoints[0].Z());
2298  TVector3 start_p2(theXYZPoints[1].X(),
2299  theXYZPoints[1].Y(), theXYZPoints[1].Z());
2300  TVector3 start_diff = start_p2 - start_p1;
2301 
2302  reco_beam_calo_startDirX.push_back(start_diff.Unit().X());
2303  reco_beam_calo_startDirY.push_back(start_diff.Unit().Y());
2304  reco_beam_calo_startDirZ.push_back(start_diff.Unit().Z());
2305 
2306  size_t nPoints = theXYZPoints.size();
2307  TVector3 end_p1(theXYZPoints[nPoints - 2].X(),
2308  theXYZPoints[nPoints - 2].Y(), theXYZPoints[nPoints - 2].Z());
2309  TVector3 end_p2(theXYZPoints[nPoints - 1].X(),
2310  theXYZPoints[nPoints - 1].Y(), theXYZPoints[nPoints - 1].Z());
2311  TVector3 end_diff = end_p2 - end_p1;
2312 
2313  reco_beam_calo_endDirX.push_back(end_diff.Unit().X());
2314  reco_beam_calo_endDirY.push_back(end_diff.Unit().Y());
2315  reco_beam_calo_endDirZ.push_back(end_diff.Unit().Z());
2316  }
2317  else {
2318  reco_beam_calo_startDirX.push_back(-1.);
2319  reco_beam_calo_endDirX.push_back(-1.);
2320  reco_beam_calo_startDirY.push_back(-1.);
2321  reco_beam_calo_endDirY.push_back(-1.);
2322  reco_beam_calo_startDirZ.push_back(-1.);
2323  reco_beam_calo_endDirZ.push_back(-1.);
2324  }
2325 
2326  if (theXYZPoints.size() > 2) {
2327  std::vector<TVector3> input;
2328  for (size_t iP = 0; iP < 3; ++iP) {
2329  input.push_back(TVector3(theXYZPoints[iP].X(),
2330  theXYZPoints[iP].Y(),
2331  theXYZPoints[iP].Z()));
2332  }
2333 
2334  TVector3 startDiff = FitLine(input);
2335  reco_beam_calo_startDirX.push_back(startDiff.Unit().X());
2336  reco_beam_calo_startDirY.push_back(startDiff.Unit().Y());
2337  reco_beam_calo_startDirZ.push_back(startDiff.Unit().Z());
2338 
2339  std::vector<TVector3> end_input;
2340  size_t nPoints = theXYZPoints.size();
2341  for (size_t iP = nPoints - 3; iP < nPoints; ++iP) {
2342  end_input.push_back(TVector3(theXYZPoints[iP].X(),
2343  theXYZPoints[iP].Y(),
2344  theXYZPoints[iP].Z()));
2345  }
2346 
2347  TVector3 endDiff = FitLine(end_input);
2348  reco_beam_calo_endDirX.push_back(endDiff.Unit().X());
2349  reco_beam_calo_endDirY.push_back(endDiff.Unit().Y());
2350  reco_beam_calo_endDirZ.push_back(endDiff.Unit().Z());
2351  }
2352  else {
2353  reco_beam_calo_startDirX.push_back(-1.);
2354  reco_beam_calo_endDirX.push_back(-1.);
2355  reco_beam_calo_startDirY.push_back(-1.);
2356  reco_beam_calo_endDirY.push_back(-1.);
2357  reco_beam_calo_startDirZ.push_back(-1.);
2358  reco_beam_calo_endDirZ.push_back(-1.);
2359  }
2360 
2361  if (theXYZPoints.size() > 3) {
2362  std::vector<TVector3> input;
2363  for (size_t iP = 0; iP < 4; ++iP) {
2364  input.push_back(TVector3(theXYZPoints[iP].X(),
2365  theXYZPoints[iP].Y(),
2366  theXYZPoints[iP].Z()));
2367  }
2368 
2369  TVector3 startDiff = FitLine(input);
2370  reco_beam_calo_startDirX.push_back(startDiff.Unit().X());
2371  reco_beam_calo_startDirY.push_back(startDiff.Unit().Y());
2372  reco_beam_calo_startDirZ.push_back(startDiff.Unit().Z());
2373 
2374  std::vector<TVector3> end_input;
2375  size_t nPoints = theXYZPoints.size();
2376  for (size_t iP = nPoints - 4; iP < nPoints; ++iP) {
2377  end_input.push_back(TVector3(theXYZPoints[iP].X(),
2378  theXYZPoints[iP].Y(),
2379  theXYZPoints[iP].Z()));
2380  }
2381 
2382  TVector3 endDiff = FitLine(end_input);
2383  reco_beam_calo_endDirX.push_back(endDiff.Unit().X());
2384  reco_beam_calo_endDirY.push_back(endDiff.Unit().Y());
2385  reco_beam_calo_endDirZ.push_back(endDiff.Unit().Z());
2386 
2387  }
2388  else {
2389  reco_beam_calo_startDirX.push_back(-1.);
2390  reco_beam_calo_endDirX.push_back(-1.);
2391  reco_beam_calo_startDirY.push_back(-1.);
2392  reco_beam_calo_endDirY.push_back(-1.);
2393  reco_beam_calo_startDirZ.push_back(-1.);
2394  reco_beam_calo_endDirZ.push_back(-1.);
2395  }
2396  ////////////////////////////////////////////
2397 
2398  //New Calibration
2399  std::cout << "Getting reco beam calo" << std::endl;
2400  std::vector< float > new_dEdX = calibration.GetCalibratedCalorimetry( *thisTrack, evt, fTrackerTag, fCalorimetryTag, 2, -1.);
2401  std::cout << new_dEdX.size() << " " << reco_beam_resRange.size() << std::endl;
2402  for( size_t i = 0; i < new_dEdX.size(); ++i ){ reco_beam_calibrated_dEdX.push_back( new_dEdX[i] ); }
2403  std::cout << "got calibrated dedx" << std::endl;
2404  ////////////////////////////////////////////
2405 
2406  std::pair< double, int > pid_chi2_ndof = trackUtil.Chi2PID( reco_beam_calibrated_dEdX, reco_beam_resRange, templates[ 2212 ] );
2407  std::cout << "got chi2" << std::endl;
2408  reco_beam_Chi2_proton = pid_chi2_ndof.first;
2409  reco_beam_Chi2_ndof = pid_chi2_ndof.second;
2410 
2411  if (fVerbose)
2412  std::cout << "Calo check: " << reco_beam_calibrated_dEdX.size() << " " <<
2413  reco_beam_TrkPitch.size() << std::endl;
2414  std::vector< calo_point > reco_beam_calo_points;
2415  //Doing thin slice
2416  if (reco_beam_calibrated_dEdX.size() &&
2417  reco_beam_calibrated_dEdX.size() == reco_beam_TrkPitch.size() &&
2419 
2420  for( size_t i = 0; i < reco_beam_calibrated_dEdX.size(); ++i ){
2421  reco_beam_calo_points.push_back(
2422  calo_point(reco_beam_calo_wire[i], reco_beam_TrkPitch[i],
2423  reco_beam_calibrated_dEdX[i], calo_hit_indices[i],
2425  }
2426 
2427  //std::cout << "N Calo points: " << reco_beam_calo_points.size() << std::endl;
2428  //Sort
2429  //std::sort( reco_beam_calo_points.begin(), reco_beam_calo_points.end(), [](calo_point a, calo_point b) {return ( a.wire < b.wire );} );
2430  std::sort( reco_beam_calo_points.begin(), reco_beam_calo_points.end(), [](calo_point a, calo_point b) {return ( a.z < b.z );} );
2431 
2432  //And also put these in the right order
2433  for( size_t i = 0; i < reco_beam_calo_points.size(); ++i ){
2434  calo_point thePoint = reco_beam_calo_points[i];
2435  reco_beam_calo_wire[i] = thePoint.wire;
2436  reco_beam_calibrated_dEdX[i] = thePoint.dEdX;
2437  reco_beam_TrkPitch[i] = thePoint.pitch;
2438  calo_hit_indices[i] = thePoint.hit_index;
2439  reco_beam_calo_wire_z[i] = thePoint.z;
2440  reco_beam_calo_TPC[i] = thePoint.tpc;
2441  }
2442 
2443 
2444  //Get the initial Energy KE
2445  double mass = 0.;
2446  double init_KE = 0.;
2447  //std::cout << "Has BI? " << fMCHasBI << " " << evt.isRealData() << std::endl;
2448  if (evt.isRealData() || fMCHasBI) {
2449  mass = 139.57;
2450 
2451  init_KE = sqrt( 1.e6*data_BI_P*data_BI_P + mass*mass ) - mass;
2452  // std::cout << "MC has BI: " << init_KE << std::endl;
2453  }
2454  else{
2455  if( true_beam_PDG == 2212 ) mass = 938.27;
2456  else if( abs(true_beam_PDG) == 211 ) mass = 139.57;
2457  else if( abs(true_beam_PDG) == 11 ) mass = .511;
2458  else if( abs(true_beam_PDG) == 321 ) mass = 321;
2459  else if( abs(true_beam_PDG) == 13 ) mass = 105.66;
2460 
2461  init_KE = sqrt( 1.e6 * true_beam_startP*true_beam_startP + mass*mass ) - mass;
2462  //std::cout << "MC does not has BI: " << init_KE << std::endl;
2463  }
2464 
2465  reco_beam_incidentEnergies.push_back( init_KE );
2466  for( size_t i = 0; i < reco_beam_calo_points.size() - 1; ++i ){ //-1 to not count the last slice
2467  //use dedx * pitch or new hit calculation?
2468  double this_energy = reco_beam_incidentEnergies.back() - ( reco_beam_calo_points[i].dEdX * reco_beam_calo_points[i].pitch );
2469  reco_beam_incidentEnergies.push_back( this_energy );
2470  }
2472  }
2473 
2474  if( !evt.isRealData() ){
2475  //New
2476  auto reco_hits = trackUtil.GetRecoTrackHitsFromPlane( *thisTrack, evt, fTrackerTag, 2 );
2477 
2478  //Find the IDEs covered by the reconstructed track
2479  std::vector< const sim::IDE * > true_ides_from_reco;
2480  for( auto it = trajPtsToHits.begin(); it != trajPtsToHits.end(); ++it ){
2481  const recob::Hit * theHit = it->second;
2482  if( theHit->View() != 2 ) continue;
2483 
2484  std::vector< const sim::IDE * > ides = bt_serv->HitToSimIDEs_Ps( clockData, *theHit );
2485  for( size_t i = 0; i < ides.size(); ++i ){
2486  //std::cout << ides[i]->trackID << " " << true_beam_ID << std::endl;
2487  if( abs( ides[i]->trackID ) == true_beam_ID ){
2488  true_ides_from_reco.push_back( ides[i] );
2489  //std::cout << "Adding < " << ides[i] << std::endl;
2490  }
2491  }
2492  }
2493  if( true_ides_from_reco.size() ){
2494  std::sort( true_ides_from_reco.begin(), true_ides_from_reco.end(), sort_IDEs );
2495  if (fVerbose) std::cout << "Max IDE z: " << true_ides_from_reco.back()->z << std::endl;
2496  }
2497 
2498 
2499  //slice up the view2_IDEs up by the wire pitch
2500  auto view2_IDEs = bt_serv->TrackIdToSimIDEs_Ps( true_beam_ID, geo::View_t(2) );
2501 
2502  if (fVerbose) std::cout << "N view2 IDEs: " << view2_IDEs.size() << std::endl;
2503  std::sort( view2_IDEs.begin(), view2_IDEs.end(), sort_IDEs );
2504 
2505  size_t remove_index = 0;
2506  bool do_remove = false;
2507  if( view2_IDEs.size() ){
2508  for( size_t i = 1; i < view2_IDEs.size()-1; ++i ){
2509  const sim::IDE * prev_IDE = view2_IDEs[i-1];
2510  const sim::IDE * this_IDE = view2_IDEs[i];
2511 
2512  //Remove some unwanted EM activity... reconsider?
2513  if( this_IDE->trackID < 0 && ( this_IDE->z - prev_IDE->z ) > 5 ){
2514  remove_index = i;
2515  do_remove = true;
2516  break;
2517  }
2518  }
2519  }
2520 
2521  if( do_remove ){
2522  view2_IDEs.erase( view2_IDEs.begin() + remove_index, view2_IDEs.end() );
2523  }
2524 
2525  auto sliced_ides = slice_IDEs( view2_IDEs, z0, pitch, true_beam_endZ);
2526  std::vector< int > found_slices;
2527 
2528  for( auto it = sliced_ides.begin(); it != sliced_ides.end(); ++it ){
2529 
2530  auto theIDEs = it->second;
2531  //std::cout << "Looking at slice " << it->first << " " << theIDEs.size() << std::endl;
2532 
2533  bool slice_found = false;
2534  for( size_t i = 0; i < theIDEs.size(); ++i ){
2535  if( std::find( true_ides_from_reco.begin(), true_ides_from_reco.end(), theIDEs[i] ) != true_ides_from_reco.end() ){
2536  slice_found = true;
2537  }
2538  }
2539 
2540  //std::cout << "Found slice in reco? " << slice_found << std::endl;
2541  if(slice_found){
2542  found_slices.push_back( it->first );
2543  true_beam_slices_found.push_back(1);
2544  }
2545  else true_beam_slices_found.push_back(0);
2546  }
2547 
2548  if (fVerbose) {
2549  std::cout << "Found " << found_slices.size() << "/" << sliced_ides.size() << " slices" << std::endl;
2550  std::cout << "Maximum true slice: " << (found_slices.size() ? sliced_ides.rbegin()->first : -999 ) << std::endl;
2551  std::cout << "Max found: " << (found_slices.size() ? found_slices.back() : -999 ) << std::endl;
2552  std::cout << "Testing hit to true slice matching" << std::endl;
2553  }
2554 
2555  //An attempt to match true-to-reco slices
2556  std::map< int, std::vector< std::pair<int, double> > > true_slice_to_reco_electrons;
2557  std::map< int, int > reco_beam_hit_to_true_ID;
2558  std::vector< int > reco_beam_hit_index;
2559  for( size_t i = 0; i < reco_beam_calo_points.size(); ++i ){
2560  calo_point thePoint = reco_beam_calo_points[i];
2561 
2562  auto theHit = (*allHits)[thePoint.hit_index];
2563 
2564  reco_beam_hit_index.push_back( thePoint.hit_index );
2565 
2566  std::vector< std::pair< int, double > > theMap = getTrueSliceListFromRecoHit_electrons( clockData, theHit, bt_serv, sliced_ides, true_beam_ID );
2567  reco_beam_hit_to_true_ID[thePoint.hit_index] = getTrueIDFromHit( clockData, theHit, bt_serv );
2568 
2569  //std::cout << "Reco hit: " << thePoint.hit_index << " ID: " << reco_beam_hit_to_true_ID[thePoint.hit_index] << std::endl;
2570 
2571  if( theMap[0].first != -999 ){
2572  for( size_t j = 0; j < theMap.size(); ++j ){
2573  true_slice_to_reco_electrons[theMap[j].first].push_back({thePoint.hit_index, theMap[j].second});
2574  }
2575  }
2576  }
2577 
2578  bool all_good = false;
2579  size_t maxTries = 5;
2580  size_t nTries = 0;
2581 
2582  //std::cout << "Checking true slices for duplicate matches" << std::endl;
2583 
2584  while( !all_good && nTries < maxTries ){
2585  //std::cout << "Try " << nTries << std::endl;
2586 
2587  bool found_duplicate = false;
2588 
2589  //Iterate over the slices
2590  for( auto it = true_slice_to_reco_electrons.begin(); it != true_slice_to_reco_electrons.end(); ++it ){
2591 
2592  //skip default slice
2593  if( it->first == -999 ) continue;
2594 
2595  //std::cout << "Checking True Slice " << it->first << std::endl;
2596 
2597  std::vector< std::pair< int, double > > & reco_electrons = it->second;
2598 
2599  if(reco_electrons.size()){
2600  //Get the max hit & contributing electrons(if size permits)
2601  int maxHit = reco_electrons[0].first;
2602  double maxElectrons = reco_electrons[0].second;
2603 
2604  //std::cout << "Has max hit " << maxHit << " with electrons " << maxElectrons << std::endl;
2605 
2606  //Next iterate over the slices again
2607  for( auto it2 = true_slice_to_reco_electrons.begin(); it2 != true_slice_to_reco_electrons.end(); ++it2 ){
2608 
2609  //Skipping the slice in question and default
2610  if( it2->first == -999 ) continue;
2611  if( it->first == it2->first ) continue;
2612 
2613  //std::cout << "\tComparing to true slice " << it2->first << " with " << it2->second.size() << " reco hits" << std::endl;
2614 
2615  if( it2->second.size() ){
2616  //Get the max hit & contributing electrons for this true slice
2617  int maxHit2 = it2->second[0].first;
2618  double maxElectrons2 = it2->second[0].second;
2619 
2620  //std::cout << "\tWith max hit " << maxHit2 << " with electrons " << maxElectrons2 << std::endl;
2621 
2622  //Check if the max hit for each slice is the same
2623  if( maxHit == maxHit2 ){
2624 
2625  //std::cout << "\tThis is a match!!!" << std::endl;
2626 
2627  found_duplicate = true;
2628  //If the first true slice's electrons are less, remove that hit from the true slice
2629  if( maxElectrons < maxElectrons2 ){
2630  //std::cout << "\tHit2 has more electrons. Removing hit from true slice " << it->first << " " << reco_electrons.size();
2631  reco_electrons.erase( reco_electrons.begin(), reco_electrons.begin()+1 );
2632  //std::cout << " " << reco_electrons.size() << std::endl;
2633  break;
2634  }
2635  }
2636  }
2637  }
2638 
2639  }
2640  //else continue;
2641  }
2642 
2643  all_good = !found_duplicate;
2644  ++nTries;
2645  }
2646 
2647 
2648  std::map< int, int > reco_beam_hit_to_true_slice;
2649  for( size_t i = 0; i < true_beam_slices.size(); ++i ){
2650 
2651  int slice = true_beam_slices[i];
2652 
2653  //std::cout << "True beam slice " << slice << ". Found? " << true_beam_slices_found[i] << std::endl;
2654  //if( true_beam_slices_found[i] && slice > max_slice_found ) max_slice_found = slice;
2655  //std::cout << "\tIn slice map? " << ( true_slice_to_reco_electrons.find( slice ) != true_slice_to_reco_electrons.end() ) << std::endl;
2656  if( true_slice_to_reco_electrons.find( slice ) != true_slice_to_reco_electrons.end() ){
2657  //std::cout << "\tMatched to " << true_slice_to_reco_electrons[slice].size() << " Hits. with max hit: "
2658  // << ( true_slice_to_reco_electrons[slice].size() ? true_slice_to_reco_electrons[slice][0].first : -1 )
2659  // << std::endl;
2660  reco_beam_hit_to_true_slice[true_slice_to_reco_electrons[slice][0].first] = slice;
2661  }
2662  }
2663 
2664  int max_slice_found = -999;
2665  for( size_t i = 0; i < reco_beam_calo_points.size(); ++i ){
2666  calo_point thePoint = reco_beam_calo_points[i];
2667  //std::cout << "Reco hit: " << thePoint.hit_index << " matched to True ID " << reco_beam_hit_to_true_ID[thePoint.hit_index];
2668 
2669  bool found_in_true_slices = ( reco_beam_hit_to_true_slice.find( thePoint.hit_index ) != reco_beam_hit_to_true_slice.end() );
2670  //std::cout << " And slice " << ( found_in_true_slices ? reco_beam_hit_to_true_slice[thePoint.hit_index] : -999) << std::endl;
2671  //std::cout << " and origin " << pi_serv->TrackIdToMCTruth_P( reco_beam_hit_to_true_ID[thePoint.hit_index] )->Origin() << std::endl;
2672  int true_id = reco_beam_hit_to_true_ID[thePoint.hit_index];
2673  reco_beam_hit_true_ID.push_back(true_id);
2674  reco_beam_hit_true_origin.push_back((true_id != -999 ? pi_serv->TrackIdToMCTruth_P(true_id)->Origin() : -999));
2675  reco_beam_hit_true_slice.push_back((found_in_true_slices ? reco_beam_hit_to_true_slice[thePoint.hit_index] : -999));
2676 
2677  if (true_id == true_beam_ID && found_in_true_slices) {
2678  if (reco_beam_hit_to_true_slice[thePoint.hit_index] > max_slice_found)
2679  max_slice_found = reco_beam_hit_to_true_slice[thePoint.hit_index];
2680  }
2681  }
2682  if (fVerbose) std::cout << "Max slice found: " << max_slice_found << std::endl;
2683 
2684 
2685  //Used to find which true slice a process was in.. kinda useless
2686  if (fVerbose) std::cout << "Comparing max slice to processes" << std::endl;
2687  const simb::MCTrajectory & true_beam_trajectory = true_beam_particle->Trajectory();
2688  auto true_beam_proc_map = true_beam_trajectory.TrajectoryProcesses();
2689  for( auto itProc = true_beam_proc_map.begin(); itProc != true_beam_proc_map.end(); ++itProc ){
2690  int index = itProc->first;
2691  std::string process = true_beam_trajectory.KeyToProcess(itProc->second);
2692 
2693  double process_X = true_beam_trajectory.X( index );
2694  double process_Y = true_beam_trajectory.Y( index );
2695  double process_Z = true_beam_trajectory.Z( index );
2696 
2697  int slice_num = std::floor( ( process_Z - z0 ) / pitch );
2698 
2699  if (fVerbose) {
2700  std::cout << "Process " << index << ", " << process << "(" << process_X <<","<< process_Y <<","<< process_Z <<")" << " at slice " << slice_num << std::endl;
2701  std::cout << "d(Slice) to max slice found: " << slice_num - max_slice_found << std::endl;
2702  }
2703  true_beam_process_slice.push_back( slice_num );
2704  true_beam_process_dSlice.push_back( slice_num - max_slice_found );
2705  }
2706 
2707  if( true_beam_endProcess.find( "Inelastic" ) == std::string::npos ){
2708  double process_X = true_beam_endX;
2709  double process_Y = true_beam_endY;
2710  double process_Z = true_beam_endZ;
2711  int slice_num = std::floor( ( process_Z - z0 ) / pitch );
2712 
2713  if (fVerbose) {
2714  std::cout << "Process " << -1 << ", " << true_beam_endProcess << "(" << process_X <<","<< process_Y <<","<< process_Z <<")" << " at slice " << slice_num << std::endl;
2715  std::cout << "d(Slice) to max slice found: " << slice_num - max_slice_found << std::endl;
2716  }
2717  true_beam_process_slice.push_back( slice_num );
2718  true_beam_process_dSlice.push_back( slice_num - max_slice_found );
2719  }
2720  //Check the last process as well
2721 
2722  if (fVerbose) {
2723  std::cout << "N Procs, Slice, dSlice: " << true_beam_processes.size() << ", " << true_beam_process_slice.size() << ", "
2724  << true_beam_process_dSlice.size() << std::endl;
2725  }
2726 
2727  for( size_t i = 0; i < true_beam_processes.size(); ++i ){
2728  if (fVerbose) {
2729  std::cout << "Process " << i << true_beam_processes[i] << " At slice " << true_beam_process_slice[i] << std::endl;
2730  std::cout << "Is " << true_beam_process_dSlice[i] << " slices away from the max found" << std::endl;
2731  }
2732 
2733  //Everything before the last process
2734  if( i < true_beam_processes.size() - 1 ){
2735  //Look before and after this process
2736  if( abs(true_beam_process_dSlice[i]) <= 5 ) true_beam_process_matched.push_back(1);
2737  else true_beam_process_matched.push_back(0);
2738  }
2739  else{//Last process -- just look before it (in this matching, it can't be above)
2740  if( true_beam_process_dSlice[i] <= 5 ) true_beam_process_matched.push_back(1);
2741  else true_beam_process_matched.push_back(0);
2742  }
2743  }
2744 
2745  }
2746  }
2747 
2748  // Alternative Reconstruction.
2749  //
2750  // Loop over all of the PFParticles associated as daughters.
2751  // Then, check the CNN score (later implement the GNN score)
2752  //
2753  // Also, get the forced-tracking (pandora2) and
2754  // get calorimetry + other info
2755 
2756  for( size_t daughterID : particle->Daughters() ){
2757  const recob::PFParticle * daughterPFP = &(pfpVec->at( daughterID ));
2758  reco_daughter_PFP_ID.push_back( daughterID );
2759 
2760  const std::vector< art::Ptr< recob::Hit > > daughterPFP_hits = pfpUtil.GetPFParticleHits_Ptrs( *daughterPFP, evt, fPFParticleTag );
2761  if (fVerbose) std::cout << "Got " << daughterPFP_hits.size() << " hits from daughter " << daughterID << std::endl;
2762 
2763  reco_daughter_PFP_nHits.push_back( daughterPFP_hits.size() );
2764  size_t nHits_coll = 0;
2765  for (size_t i = 0; i < daughterPFP_hits.size(); ++i) {
2766  if (daughterPFP_hits[i]->View() == 2) {
2767  ++nHits_coll;
2768  }
2769  }
2770  reco_daughter_PFP_nHits_collection.push_back(nHits_coll);
2771 
2772  double track_total = 0.;
2773  double em_total = 0.;
2774  double michel_total = 0.;
2775  double none_total = 0.;
2776  for( size_t h = 0; h < daughterPFP_hits.size(); ++h ){
2777  std::array<float,4> cnn_out = hitResults.getOutput( daughterPFP_hits[h] );
2778  track_total += cnn_out[ hitResults.getIndex("track") ];
2779  em_total += cnn_out[ hitResults.getIndex("em") ];
2780  michel_total += cnn_out[ hitResults.getIndex("michel") ];
2781  none_total += cnn_out[ hitResults.getIndex("none") ];
2782 
2783  }
2784 
2785  cnnOutput2D theCNNResults = GetCNNOutputFromPFParticle( *daughterPFP, evt, hitResults, pfpUtil, fPFParticleTag );
2786  if (fVerbose) {
2787  std::cout << "Testing new CNN: " << std::endl;
2788  std::cout << track_total << " " << theCNNResults.track << std::endl;
2789  std::cout << em_total << " " << theCNNResults.em << std::endl;
2790  std::cout << michel_total << " " << theCNNResults.michel << std::endl;
2791  std::cout << none_total << " " << theCNNResults.none << std::endl;
2792  }
2793 
2794 
2795  const std::vector< const recob::SpacePoint* > spVec = pfpUtil.GetPFParticleSpacePoints( *daughterPFP, evt, fPFParticleTag );
2796 
2797  if( daughterPFP_hits.size() > 0 ){
2798  reco_daughter_PFP_trackScore.push_back( track_total / daughterPFP_hits.size() );
2799  reco_daughter_PFP_emScore.push_back( em_total / daughterPFP_hits.size() );
2800  reco_daughter_PFP_michelScore.push_back( michel_total / daughterPFP_hits.size() );
2801  }
2802  else{
2803  reco_daughter_PFP_trackScore.push_back( -999. );
2804  reco_daughter_PFP_emScore.push_back( -999. );
2805  reco_daughter_PFP_michelScore.push_back( -999. );
2806  }
2807 
2808  cnnOutput2D cnn_collection = GetCNNOutputFromPFParticleFromPlane( *daughterPFP, evt, hitResults, pfpUtil, fPFParticleTag, 2 );
2809  if( cnn_collection.nHits > 0 ){
2810  reco_daughter_PFP_trackScore_collection.push_back( cnn_collection.track / cnn_collection.nHits );
2811  reco_daughter_PFP_emScore_collection.push_back( cnn_collection.em / cnn_collection.nHits );
2812  reco_daughter_PFP_michelScore_collection.push_back( cnn_collection.michel / cnn_collection.nHits );
2813  }
2814  else{
2815  reco_daughter_PFP_trackScore_collection.push_back( -999. );
2816  reco_daughter_PFP_emScore_collection.push_back( -999. );
2817  reco_daughter_PFP_michelScore_collection.push_back( -999. );
2818  }
2819 
2820 
2821 
2822  if( !evt.isRealData() ){
2823  //Matching by hits
2824  protoana::MCParticleSharedHits match = truthUtil.GetMCParticleByHits( clockData, *daughterPFP, evt, fPFParticleTag, fHitTag );
2825  if( match.particle ){
2826 
2827  reco_daughter_PFP_true_byHits_PDG.push_back( match.particle->PdgCode() );
2828  reco_daughter_PFP_true_byHits_ID.push_back( match.particle->TrackId() );
2829  reco_daughter_PFP_true_byHits_parID.push_back( match.particle->Mother() );
2830  //std::cout << "mother: " << match.particle->Mother() << std::endl;
2831  //reco_daughter_PFP_true_byHits_parPDG.push_back( pi_serv->TrackIdToMotherParticle_P( match.particle->TrackId() )->PdgCode() );
2833  ( (match.particle->Mother() > 0) ? plist[ match.particle->Mother() ]->PdgCode() : 0 )
2834  );
2835 
2838  pi_serv->TrackIdToMCTruth_P(match.particle->TrackId())->Origin()
2839  );
2842 
2844  reco_daughter_PFP_true_byHits_startX.push_back( match.particle->Position(0).X() );
2845  reco_daughter_PFP_true_byHits_startY.push_back( match.particle->Position(0).Y() );
2846  reco_daughter_PFP_true_byHits_startZ.push_back( match.particle->Position(0).Z() );
2847 
2848  reco_daughter_PFP_true_byHits_endX.push_back( match.particle->EndPosition().X() );
2849  reco_daughter_PFP_true_byHits_endY.push_back( match.particle->EndPosition().Y() );
2850  reco_daughter_PFP_true_byHits_endZ.push_back( match.particle->EndPosition().Z() );
2851 
2852  reco_daughter_PFP_true_byHits_startPx.push_back( match.particle->Px() );
2853  reco_daughter_PFP_true_byHits_startPy.push_back( match.particle->Py() );
2854  reco_daughter_PFP_true_byHits_startPz.push_back( match.particle->Pz() );
2855  reco_daughter_PFP_true_byHits_startE.push_back( match.particle->E() );
2857  sqrt(match.particle->Px()*match.particle->Px() +
2858  match.particle->Py()*match.particle->Py() +
2859  match.particle->Pz()*match.particle->Pz()) );
2861 
2862  auto list = truthUtil.GetMCParticleListByHits( clockData, *daughterPFP, evt, fPFParticleTag, fHitTag );
2863  double total = 0.;
2864  double matched_hits = 0.;
2865  for( size_t j = 0; j < list.size(); ++j ){
2866  // std::cout << "Contrib " << j << " " << list[j].first->TrackId() << " " << list[j].second << std::endl;
2867  //std::cout << "Contrib " << j << " " << list[j].particle->TrackId() << " " << list[j].particle->PdgCode() << " " << list[j].nSharedHits << " " << list[j].nSharedDeltaRayHits << std::endl;
2868 
2869  if( list[j].particle == match.particle ){
2870  matched_hits = list[j].nSharedHits + list[j].nSharedDeltaRayHits;
2871  }
2872 
2873  total += list[j].nSharedHits + list[j].nSharedDeltaRayHits;
2874  }
2875 
2876  reco_daughter_PFP_true_byHits_purity.push_back( matched_hits / total );
2877 
2878  double totalTruth = truthUtil.GetMCParticleHits( clockData, *match.particle, evt, fHitTag).size();
2879  double sharedHits = truthUtil.GetSharedHits( clockData, *match.particle, *daughterPFP, evt, fPFParticleTag).size();
2880  reco_daughter_PFP_true_byHits_completeness.push_back( sharedHits/totalTruth );
2881  }
2882  else{
2883  reco_daughter_PFP_true_byHits_PDG.push_back( -1 );
2884  reco_daughter_PFP_true_byHits_ID.push_back( -1 );
2885  reco_daughter_PFP_true_byHits_origin.push_back( -1 );
2886  reco_daughter_PFP_true_byHits_parID.push_back( -1 );
2887  reco_daughter_PFP_true_byHits_parPDG.push_back( -1 );
2888  reco_daughter_PFP_true_byHits_process.push_back( "empty" );
2890  reco_daughter_PFP_true_byHits_emHits.push_back( 0 );
2891 
2892  reco_daughter_PFP_true_byHits_len.push_back( -999. );
2893  reco_daughter_PFP_true_byHits_startX.push_back( -999. );
2894  reco_daughter_PFP_true_byHits_startY.push_back( -999. );
2895  reco_daughter_PFP_true_byHits_startZ.push_back( -999. );
2896  reco_daughter_PFP_true_byHits_endX.push_back( -999. );
2897  reco_daughter_PFP_true_byHits_endY.push_back( -999. );
2898  reco_daughter_PFP_true_byHits_endZ.push_back( -999. );
2899  reco_daughter_PFP_true_byHits_startPx.push_back( -999. );
2900  reco_daughter_PFP_true_byHits_startPy.push_back( -999. );
2901  reco_daughter_PFP_true_byHits_startPz.push_back( -999. );
2902  reco_daughter_PFP_true_byHits_startP.push_back( -999. );
2903  reco_daughter_PFP_true_byHits_startE.push_back( -999. );
2904  reco_daughter_PFP_true_byHits_endProcess.push_back("empty");
2905  reco_daughter_PFP_true_byHits_purity.push_back( -999. );
2906  reco_daughter_PFP_true_byHits_completeness.push_back( -999. );
2907  }
2908 
2909  //Matching by energy
2910  const simb::MCParticle* true_daughter_byE = truthUtil.GetMCParticleFromPFParticle(clockData, *daughterPFP, evt, fPFParticleTag);
2911  if( true_daughter_byE ){
2912  reco_daughter_PFP_true_byE_PDG.push_back( true_daughter_byE->PdgCode() );
2913  reco_daughter_PFP_true_byE_len.push_back( true_daughter_byE->Trajectory().TotalLength() );
2914  double purity = truthUtil.GetPurity( clockData, *daughterPFP, evt, fPFParticleTag);
2915  double completeness = truthUtil.GetCompleteness( clockData, *daughterPFP, evt, fPFParticleTag, fHitTag );
2916  reco_daughter_PFP_true_byE_purity.push_back( purity );
2917  reco_daughter_PFP_true_byE_completeness.push_back( completeness );
2918  }
2919  else {
2920  reco_daughter_PFP_true_byE_PDG.push_back( -1 );
2921  reco_daughter_PFP_true_byE_len.push_back( -999. );
2922  reco_daughter_PFP_true_byE_purity.push_back( -999. );
2923  reco_daughter_PFP_true_byE_completeness.push_back( -999. );
2924  }
2925  }
2926 
2927  try{
2928  const recob::Track* pandora2Track = pfpUtil.GetPFParticleTrack( *daughterPFP, evt, fPFParticleTag, "pandora2Track" );
2929  if (fVerbose) std::cout << "pandora2 track: " << pandora2Track << std::endl;
2930 
2931  if( pandora2Track ){
2932  reco_daughter_allTrack_ID.push_back( pandora2Track->ID() );
2933 
2934  std::cout << "Getting calo for " << pandora2Track->ID() << std::endl;
2935 
2936  auto dummy_caloSCE =
2937  trackUtil.GetRecoTrackCalorimetry(
2938  *pandora2Track, evt, "pandora2Track", fPandora2CaloSCE);
2939  std::cout << dummy_caloSCE.size() << std::endl;
2940  bool found_calo = false;
2941  size_t index = 0;
2942  for ( index = 0; index < dummy_caloSCE.size(); ++index) {
2943  if (dummy_caloSCE[index].PlaneID().Plane == 2) {
2944  found_calo = true;
2945  break;
2946  }
2947  }
2948  std::cout << index << " " << found_calo << std::endl;
2949 
2950  reco_daughter_allTrack_resRange_SCE.push_back( std::vector<double>() );
2951  reco_daughter_allTrack_dEdX_SCE.push_back( std::vector<double>() );
2952  reco_daughter_allTrack_dQdX_SCE.push_back( std::vector<double>() );
2953  reco_daughter_allTrack_calibrated_dEdX_SCE.push_back( std::vector<double>() );
2954 
2955  if (found_calo) {
2956  auto dummy_dEdx_SCE = dummy_caloSCE[index].dEdx();
2957  auto dummy_dQdx_SCE = dummy_caloSCE[index].dQdx();
2958  auto dummy_Range_SCE = dummy_caloSCE[index].ResidualRange();
2959 
2960  reco_daughter_allTrack_momByRange_alt_proton.push_back( track_p_calc.GetTrackMomentum( dummy_caloSCE[index].Range(), 2212 ) );
2961  reco_daughter_allTrack_momByRange_alt_muon.push_back( track_p_calc.GetTrackMomentum( dummy_caloSCE[index].Range(), 13 ) );
2962  reco_daughter_allTrack_alt_len.push_back( dummy_caloSCE[index].Range() );
2963 
2964  std::vector<float> cali_dEdX_SCE = calibration.GetCalibratedCalorimetry(*pandora2Track, evt, "pandora2Track", fPandora2CaloSCE, 2);
2965 
2966  for( size_t j = 0; j < dummy_dEdx_SCE.size(); ++j ){
2967  reco_daughter_allTrack_resRange_SCE.back().push_back( dummy_Range_SCE[j] );
2968  reco_daughter_allTrack_dEdX_SCE.back().push_back( dummy_dEdx_SCE[j] );
2969  reco_daughter_allTrack_dQdX_SCE.back().push_back( dummy_dQdx_SCE[j] );
2970  }
2971 
2972  for( size_t j = 0; j < cali_dEdX_SCE.size(); ++j ){
2973  reco_daughter_allTrack_calibrated_dEdX_SCE.back().push_back( cali_dEdX_SCE[j] );
2974  }
2975 
2976  std::pair<double, int> this_chi2_ndof = trackUtil.Chi2PID(
2979 
2980  reco_daughter_allTrack_Chi2_proton.push_back(this_chi2_ndof.first);
2981  reco_daughter_allTrack_Chi2_ndof.push_back(this_chi2_ndof.second);
2982  }
2983  else {
2986  reco_daughter_allTrack_alt_len.push_back(-999.);
2987  reco_daughter_allTrack_Chi2_proton.push_back(-999.);
2988  reco_daughter_allTrack_Chi2_ndof.push_back(-999);
2989  }
2990 
2991  //Calorimetry + chi2 for planes 0 and 1
2992  size_t plane0_index = 0;
2993  bool found_plane0 = false;
2994  for ( plane0_index = 0; plane0_index < dummy_caloSCE.size(); ++plane0_index) {
2995  std::cout << dummy_caloSCE[plane0_index].PlaneID().Plane << std::endl;
2996  if (dummy_caloSCE[plane0_index].PlaneID().Plane == 0) {
2997  found_plane0 = true;
2998  break;
2999  }
3000  }
3001  size_t plane1_index = 0;
3002  bool found_plane1 = false;
3003  for ( plane1_index = 0; plane1_index < dummy_caloSCE.size(); ++plane1_index) {
3004  std::cout << dummy_caloSCE[plane1_index].PlaneID().Plane << std::endl;
3005  if (dummy_caloSCE[plane1_index].PlaneID().Plane == 1) {
3006  found_plane1 = true;
3007  break;
3008  }
3009  }
3010  if (fVerbose)
3011  std::cout << "Plane 0, 1 " << plane0_index << " " <<
3012  plane1_index << std::endl;
3013 
3014 
3016  std::vector<double>());
3018  std::vector<double>());
3019 
3020  if (found_plane0) {
3021  auto resRange_plane0 = dummy_caloSCE[plane0_index].ResidualRange();
3022  for (size_t j = 0; j < resRange_plane0.size(); ++j) {
3023  reco_daughter_allTrack_resRange_plane0.back().push_back(
3024  resRange_plane0[j]);
3025  }
3026 
3027  std::vector<float> dEdX_plane0 = calibration.GetCalibratedCalorimetry(
3028  *pandora2Track, evt, "pandora2Track", fPandora2CaloSCE, 0);
3029  for (size_t j = 0; j < dEdX_plane0.size(); ++j) {
3031  dEdX_plane0[j]);
3032  }
3033  std::pair<double, int> plane0_chi2_ndof = trackUtil.Chi2PID(
3037  plane0_chi2_ndof.first);
3039  plane0_chi2_ndof.second);
3040  }
3041  else {
3043  -999.);
3045  -999);
3046  }
3047 
3048 
3050  std::vector<double>());
3051 
3053  std::vector<double>());
3054 
3055  if (found_plane1) {
3056  auto resRange_plane1 = dummy_caloSCE[plane1_index].ResidualRange();
3057  std::vector<float> dEdX_plane1 = calibration.GetCalibratedCalorimetry(
3058  *pandora2Track, evt, "pandora2Track", fPandora2CaloSCE, 1);
3059 
3060  for (size_t j = 0; j < resRange_plane1.size(); ++j) {
3061  reco_daughter_allTrack_resRange_plane1.back().push_back(
3062  resRange_plane1[j]);
3063  }
3064 
3065  for (size_t j = 0; j < dEdX_plane1.size(); ++j) {
3067  dEdX_plane1[j]);
3068  }
3069 
3070  std::pair<double, int> plane1_chi2_ndof = trackUtil.Chi2PID(
3074  plane1_chi2_ndof.first);
3076  plane1_chi2_ndof.second);
3077  }
3078  else {
3080  -999.);
3082  -999);
3083  }
3084  //////////////////////////////////////
3085 
3086  reco_daughter_allTrack_Theta.push_back( pandora2Track->Theta() );
3087  reco_daughter_allTrack_Phi.push_back( pandora2Track->Phi() );
3088 
3089  reco_daughter_allTrack_len.push_back( pandora2Track->Length() );
3090  reco_daughter_allTrack_startX.push_back( pandora2Track->Trajectory().Start().X() );
3091  reco_daughter_allTrack_startY.push_back( pandora2Track->Trajectory().Start().Y() );
3092  reco_daughter_allTrack_startZ.push_back( pandora2Track->Trajectory().Start().Z() );
3093  reco_daughter_allTrack_endX.push_back( pandora2Track->Trajectory().End().X() );
3094  reco_daughter_allTrack_endY.push_back( pandora2Track->Trajectory().End().Y() );
3095  reco_daughter_allTrack_endZ.push_back( pandora2Track->Trajectory().End().Z() );
3096 
3097  std::cout << "Getting michel" << std::endl;
3098  //Using new michel tagging
3099  std::pair<double, int> vertex_results =
3100  trackUtil.GetVertexMichelScore(
3101  *pandora2Track, evt, "pandora2Track", fHitTag,
3102  0., -500., 500., 0., 500., 0., false,
3104 
3106  vertex_results.first);
3108  vertex_results.second);
3109 
3110  if (fVerbose) std::cout << "pandora2Length " << pandora2Track->Length() << std::endl;
3111  reco_daughter_allTrack_momByRange_proton.push_back( track_p_calc.GetTrackMomentum( pandora2Track->Length(), 2212 ) );
3112  reco_daughter_allTrack_momByRange_muon.push_back( track_p_calc.GetTrackMomentum( pandora2Track->Length(), 13 ) );
3113 
3114  //Match the daughters to a slice
3115  //First, check whether the start or end of the daughter track are closer
3116  double d_startX = pandora2Track->Trajectory().Start().X();
3117  double d_startY = pandora2Track->Trajectory().Start().Y();
3118  double d_startZ = pandora2Track->Trajectory().Start().Z();
3119 
3120  double d_endX = pandora2Track->Trajectory().End().X();
3121  double d_endY = pandora2Track->Trajectory().End().Y();
3122  double d_endZ = pandora2Track->Trajectory().End().Z();
3123 
3124  double to_start_of_daughter = sqrt(
3125  ( d_startX - max_X ) * ( d_startX - max_X ) +
3126  ( d_startY - max_Y ) * ( d_startY - max_Y ) +
3127  ( d_startZ - max_Z ) * ( d_startZ - max_Z )
3128  );
3129  double to_end_of_daughter = sqrt(
3130  ( d_endX - max_X ) * ( d_endX - max_X ) +
3131  ( d_endY - max_Y ) * ( d_endY - max_Y ) +
3132  ( d_endZ - max_Z ) * ( d_endZ - max_Z )
3133  );
3134 
3135  if ( to_end_of_daughter < to_start_of_daughter ){
3136  reco_daughter_allTrack_to_vertex.push_back( to_end_of_daughter );
3137  }
3138  else{
3139  reco_daughter_allTrack_to_vertex.push_back( to_start_of_daughter );
3140  }
3141 
3142  double dr_start = std::numeric_limits<double>::max();
3143  double dr_end = std::numeric_limits<double>::max();
3144 
3145  //size_t min_start_index = 0;
3146  //size_t min_end_index = 0;
3147 
3148  for( size_t j = 0; j < thisTrack->NumberTrajectoryPoints(); ++j ){
3149  double X = thisTrack->Trajectory().LocationAtPoint(j).X();
3150  double Y = thisTrack->Trajectory().LocationAtPoint(j).Y();
3151  double Z = thisTrack->Trajectory().LocationAtPoint(j).Z();
3152 
3153  double dr = sqrt(
3154  ( d_startX - X ) * ( d_startX - X ) +
3155  ( d_startY - Y ) * ( d_startY - Y ) +
3156  ( d_startZ - Z ) * ( d_startZ - Z )
3157  );
3158 
3159  if( dr < dr_start ){
3160  dr_start = dr;
3161  //min_start_index = j;
3162  }
3163 
3164  dr = sqrt(
3165  ( d_endX - X ) * ( d_endX - X ) +
3166  ( d_endY - Y ) * ( d_endY - Y ) +
3167  ( d_endZ - Z ) * ( d_endZ - Z )
3168  );
3169 
3170  if( dr < dr_end ){
3171  dr_end = dr;
3172  //min_end_index = j;
3173  }
3174 
3175  }
3176 
3177  //size_t min_index = 0;
3178  if( dr_end < dr_start ){
3179  //min_index = min_end_index;
3180  reco_daughter_allTrack_dR.push_back( dr_end );
3181  }
3182  else{
3183  //min_index = min_start_index;
3184  reco_daughter_allTrack_dR.push_back( dr_start );
3185  }
3186 
3187  }
3188  else{
3189  reco_daughter_allTrack_ID.push_back( -1 );
3190  reco_daughter_allTrack_resRange_SCE.push_back( std::vector<double>() );
3191  reco_daughter_allTrack_dEdX_SCE.push_back( std::vector<double>() );
3192  reco_daughter_allTrack_dQdX_SCE.push_back( std::vector<double>() );
3193  reco_daughter_allTrack_calibrated_dEdX_SCE.push_back(std::vector<double>());
3194  reco_daughter_allTrack_Chi2_proton.push_back( -999. );
3195  reco_daughter_allTrack_Chi2_ndof.push_back( 0 );
3196 
3197  //Calorimetry + chi2 for planes 0 and 1
3199  std::vector<double>());
3201  std::vector<double>());
3203  std::vector<double>());
3205  std::vector<double>());
3206 
3207  reco_daughter_allTrack_Chi2_proton_plane0.push_back( -999. );
3209  reco_daughter_allTrack_Chi2_proton_plane1.push_back( -999. );
3211  //////////////////////////////////
3212 
3213  reco_daughter_allTrack_Theta.push_back(-999. );
3214  reco_daughter_allTrack_Phi.push_back(-999.);
3215  reco_daughter_allTrack_len.push_back( -999. );
3216  reco_daughter_allTrack_alt_len.push_back(-999.);
3217  reco_daughter_allTrack_startX.push_back( -999. );
3218  reco_daughter_allTrack_startY.push_back( -999. );
3219  reco_daughter_allTrack_startZ.push_back( -999. );
3220  reco_daughter_allTrack_endX.push_back( -999. );
3221  reco_daughter_allTrack_endY.push_back( -999. );
3222  reco_daughter_allTrack_endZ.push_back( -999. );
3223  reco_daughter_allTrack_to_vertex.push_back( -999. );
3224  reco_daughter_allTrack_dR.push_back( -1. );
3226  reco_daughter_allTrack_momByRange_muon.push_back(-999.);
3227 
3230 
3232  reco_daughter_allTrack_vertex_nHits.push_back(-999);
3233 
3234  }
3235  }
3236  catch( const cet::exception &e ){
3237  MF_LOG_WARNING("PionAnalyzer") << "pandora2Track object not found, moving on" << std::endl;
3238  }
3239 
3240 
3241  try{
3242  const recob::Shower* pandora2Shower = pfpUtil.GetPFParticleShower( *daughterPFP, evt, fPFParticleTag, "pandora2Shower" );
3243  if (fVerbose) std::cout << "pandora2 shower: " << pandora2Shower << std::endl;
3244 
3245  if( pandora2Shower ){
3246  reco_daughter_allShower_ID.push_back( pandora2Shower->ID() );
3247  reco_daughter_allShower_len.push_back( pandora2Shower->Length() );
3248  reco_daughter_allShower_startX.push_back( pandora2Shower->ShowerStart().X() );
3249  reco_daughter_allShower_startY.push_back( pandora2Shower->ShowerStart().Y() );
3250  reco_daughter_allShower_startZ.push_back( pandora2Shower->ShowerStart().Z() );
3251 
3252  reco_daughter_allShower_dirX.push_back( pandora2Shower->Direction().X() );
3253  reco_daughter_allShower_dirY.push_back( pandora2Shower->Direction().Y() );
3254  reco_daughter_allShower_dirZ.push_back( pandora2Shower->Direction().Z() );
3255 
3256 
3257  const std::vector<art::Ptr<recob::Hit>> hits =
3258  showerUtil.GetRecoShowerArtHits(
3259  *pandora2Shower, evt, "pandora2Shower");
3260 
3261  art::FindManyP<recob::SpacePoint> spFromHits(hits, evt, fHitTag);
3262  //double total_shower_energy = 0.;
3263  //need to get average y
3264  std::vector<double> x_vec, y_vec, z_vec;
3265  double total_y = 0.;
3266  int n_good_y = 0;
3267  std::vector<art::Ptr<recob::Hit>> good_hits;
3268 
3269  for (size_t iHit = 0; iHit < hits.size(); ++iHit) {
3270  auto theHit = hits[iHit];
3271  if (theHit->View() != 2) continue; //skip induction planes
3272 
3273  good_hits.push_back(theHit);
3274 
3275  double shower_hit_x = detProp.ConvertTicksToX(
3276  theHit->PeakTime(),
3277  theHit->WireID().Plane,
3278  theHit->WireID().TPC, 0);
3279 
3280  double shower_hit_z = geom->Wire(theHit->WireID()).GetCenter().Z();
3281 
3282  x_vec.push_back(shower_hit_x);
3283  z_vec.push_back(shower_hit_z);
3284 
3285  std::vector<art::Ptr<recob::SpacePoint>> sps = spFromHits.at(iHit);
3286  //std::cout << shower_hit_x << " " << shower_hit_z << " ";
3287  if (!sps.empty()) {
3288  y_vec.push_back(sps[0]->XYZ()[1]);
3289  total_y += y_vec.back();
3290  ++n_good_y;
3291  //std::cout << shower_hit_y_vec.back();
3292  }
3293  else {
3294  y_vec.push_back(-999.);
3295  }
3296  //std::cout << std::endl;
3297  }
3298 
3299  if (n_good_y < 1) {
3300  reco_daughter_allShower_energy.push_back(-999.);
3301  }
3302  else {
3303  double total_shower_energy = 0.;
3304  for (size_t iHit = 0; iHit < good_hits.size(); ++iHit) {
3305  auto theHit = good_hits[iHit];
3306  if (theHit->View() != 2) continue; //skip induction planes
3307 
3308  if (y_vec[iHit] < -100.)
3309  y_vec[iHit] = total_y / n_good_y;
3310 
3311  total_shower_energy += calibration.HitToEnergy(
3312  good_hits[iHit], x_vec[iHit], y_vec[iHit], z_vec[iHit]);
3313  }
3314  reco_daughter_allShower_energy.push_back(total_shower_energy);
3315  }
3316  }
3317  else{
3318  reco_daughter_allShower_ID.push_back( -1 );
3319  reco_daughter_allShower_len.push_back( -999. );
3320  reco_daughter_allShower_startX.push_back( -999. );
3321  reco_daughter_allShower_startY.push_back( -999. );
3322  reco_daughter_allShower_startZ.push_back( -999. );
3323  reco_daughter_allShower_dirX.push_back( -999. );
3324  reco_daughter_allShower_dirY.push_back( -999. );
3325  reco_daughter_allShower_dirZ.push_back( -999. );
3326  reco_daughter_allShower_energy.push_back( -999. );
3327  }
3328 
3329  }
3330  catch( const cet::exception &e ){
3331  MF_LOG_WARNING("PionAnalyzer") << "pandora2Shower object not found, moving on" << std::endl;
3332  }
3333 
3334 
3335  }
3336 
3337 
3338 
3339  if( fCheckCosmics ){
3340  if( quality_reco_view_2_wire.size() ){
3341 
3342  std::map< int, std::pair< double, double > > UpperCosmicROILimits, LowerCosmicROILimits;
3343  std::map< int, int > wire_to_n_ticks;
3344  std::map< int, double > wire_to_avg_ticks;
3345  bool inTPC1 = false;
3346  for( size_t i = 0; i < quality_reco_view_2_wire.size(); ++i ){
3347  if( view_2_TPC[i] != 1 ) continue;
3348  else inTPC1 = true;
3349  wire_to_n_ticks[ int(quality_reco_view_2_wire[i]) ]++;
3350  wire_to_avg_ticks[ int(quality_reco_view_2_wire[i]) ] += quality_reco_view_2_tick[i];
3351 
3352  }
3353 
3354  if( inTPC1 ){
3355 
3356  double max_tick = 0.;
3357  double min_tick = 99999.;
3358  for( auto it = wire_to_n_ticks.begin(); it != wire_to_n_ticks.end(); ++it ){
3359  wire_to_avg_ticks[ it->first ] /= it->second;
3360 
3361  if( wire_to_avg_ticks[ it->first ] > max_tick ){
3362  max_tick = wire_to_avg_ticks[ it->first ];
3363  }
3364  if( wire_to_avg_ticks[ it->first ] < min_tick ){
3365  min_tick = wire_to_avg_ticks[ it->first ];
3366  }
3367  }
3368 
3369  min_tick -= 100;
3370  max_tick += 100;
3371 
3372  std::vector< double > these_wires, these_ticks;
3373 
3374  for( auto it = wire_to_avg_ticks.begin(); it != wire_to_avg_ticks.end(); ++it ){
3375  these_wires.push_back( it->first );
3376  these_ticks.push_back( it->second );
3377  }
3378  TGraph gr_wire_ticks( these_wires.size(), &these_wires[0], &these_ticks[0] );
3379 
3380 
3381  //1st Get all the reco tracks -- or PFP?
3382  //for( size_t i = 0; i < recoTracks->size(); ++i ){
3383  for( size_t i = 0; i < pfpVec->size(); ++i ){
3384 
3385  //if( (*recoTracks)[i].ID() == thisTrack->ID() ) continue;
3386  if( &(*pfpVec)[i] == particle ) continue; // Check if the same pointer
3387 
3388  int nUpperCosmicROI = 0;
3389  int nLowerCosmicROI = 0;
3390  //std::cout << "Checking Track " << (*recoTracks)[i].ID() << std::endl;
3391 
3392  //auto planeHits = trackUtil.GetRecoTrackHitsFromPlane( (*recoTracks)[i], evt, fTrackerTag, 2 );
3393  auto planeHits = pfpUtil.GetPFParticleHitsFromPlane( (*pfpVec)[i], evt, fPFParticleTag, 2 );
3394  bool found_new = false;
3395 
3397  if( !evt.isRealData() )
3398  match = truthUtil.GetMCParticleByHits( clockData, (*pfpVec)[i], evt, fPFParticleTag, fHitTag );
3399 
3400 
3401  for( size_t j = 0; j < planeHits.size(); ++j ){
3402  auto theHit = planeHits[j];
3403  if( theHit->WireID().TPC == 1 ){
3404 
3405  if( int(theHit->WireID().Wire) > wire_to_avg_ticks.begin()->first && int(theHit->WireID().Wire) < wire_to_avg_ticks.rbegin()->first &&
3406  theHit->PeakTime() > min_tick && theHit->PeakTime() < max_tick ){
3407 
3408  if (fVerbose) {
3409  std::cout << "Checking " << theHit->WireID().Wire << " " << theHit->PeakTime() << std::endl;
3410  std::cout << "\tBeam: " << gr_wire_ticks.Eval( theHit->WireID().Wire ) << std::endl;
3411  }
3412 
3413  if( theHit->PeakTime() > gr_wire_ticks.Eval( theHit->WireID().Wire ) ){
3414  ++nUpperCosmicROI;
3415  }
3416  else{
3417  ++nLowerCosmicROI;
3418  }
3419 
3420  }
3421 
3422  if( !found_new && !evt.isRealData() ){
3423  if( match.particle ){
3424  if( pi_serv->TrackIdToMCTruth_P(match.particle->TrackId())->Origin() == 2 ){
3425  std::vector< const sim::IDE * > ides = bt_serv->HitToSimIDEs_Ps( clockData, *theHit );
3426  for( size_t j = 0; j < ides.size(); ++j ){
3427  if( true_beam_ID == ides[j]->trackID ){
3428  //cosmic_has_beam_IDE.push_back( (*recoTracks)[i].ID() );
3429  cosmic_has_beam_IDE.push_back( i );
3430  found_new = true;
3431  break;
3432  }
3433  }
3434  }
3435  }
3436  }
3437  }
3438  }
3439 
3441 
3442  if (fVerbose) {
3443  std::cout << "NHits in Upper ROI: " << nUpperCosmicROI << std::endl;
3444  std::cout << "NHits in Lower ROI: " << nLowerCosmicROI << std::endl;
3445  }
3446 
3447  if( nLowerCosmicROI || nUpperCosmicROI ){
3448  reco_beam_cosmic_candidate_lower_hits.push_back( nLowerCosmicROI );
3449  reco_beam_cosmic_candidate_upper_hits.push_back( nUpperCosmicROI );
3450  reco_beam_cosmic_candidate_ID.push_back( i );
3451  }
3452 
3453  }
3454  }
3455  }
3456 
3457  if( !evt.isRealData() ){
3458  auto planeHits = trackUtil.GetRecoTrackHitsFromPlane( *thisTrack, evt, fTrackerTag, 2 );
3459  for( size_t i = 0; i < planeHits.size(); ++i ){
3460  auto theHit = planeHits[i];
3461  //std::cout << theHit->WireID().TPC << std::endl;
3462  if( theHit->WireID().TPC == 1 ){
3463  std::vector< const sim::IDE * > ides = bt_serv->HitToSimIDEs_Ps( clockData, *theHit );
3464  for( size_t j = 0; j < ides.size(); ++j ){
3465  if( pi_serv->TrackIdToMCTruth_P( ides[j]->trackID )->Origin() == 2 ){
3466  beam_has_cosmic_IDE = true;
3467  break;
3468  }
3469  }
3470  }
3471  if( beam_has_cosmic_IDE ) break;
3472  }
3473  }
3474  }
3475 
3476  }
3477  else if( thisShower ){
3478  reco_beam_type = 11;
3479  reco_beam_trackID = thisShower->ID();
3480 
3481  if (fVerbose) {
3482  std::cout << "Beam particle is shower-like" << std::endl;
3483  std::cout << thisShower->ShowerStart().X() << " " << thisShower->ShowerStart().Y() << " " << thisShower->ShowerStart().Z() << std::endl;
3484  std::cout << thisShower->Direction().X() << " " << thisShower->Direction().Y() << " " << thisShower->Direction().Z() << std::endl;
3485  std::cout << beam_cuts.IsBeamlike( *thisShower, evt, "1" ) << std::endl;
3486  }
3487  }
3488 
3489  //Forced tracking for beam particle
3490  try{
3491  const recob::Track* pandora2Track = pfpUtil.GetPFParticleTrack( *particle, evt, fPFParticleTag, "pandora2Track" );
3492  if (fVerbose) std::cout << "pandora2 track: " << pandora2Track << std::endl;
3493 
3494 std::cout << "no here" << std::endl;
3495 
3496  if( pandora2Track ){
3497  reco_beam_allTrack_ID = pandora2Track->ID();
3498  reco_beam_allTrack_beam_cuts = beam_cuts.IsBeamlike( *pandora2Track, evt, "1" );
3499  reco_beam_allTrack_startX = pandora2Track->Trajectory().Start().X();
3500  reco_beam_allTrack_startY = pandora2Track->Trajectory().Start().Y();
3501  reco_beam_allTrack_startZ = pandora2Track->Trajectory().Start().Z();
3502  reco_beam_allTrack_endX = pandora2Track->Trajectory().End().X();
3503  reco_beam_allTrack_endY = pandora2Track->Trajectory().End().Y();
3504  reco_beam_allTrack_endZ = pandora2Track->Trajectory().End().Z();
3505 
3506  auto startDir = pandora2Track->StartDirection();
3507  auto endDir = pandora2Track->EndDirection();
3508 
3509  //try flipping
3512  reco_beam_allTrack_endX = pandora2Track->Trajectory().Start().X();
3513  reco_beam_allTrack_endY = pandora2Track->Trajectory().Start().Y();
3514  reco_beam_allTrack_endZ = pandora2Track->Trajectory().Start().Z();
3515  reco_beam_allTrack_startX = pandora2Track->Trajectory().End().X();
3516  reco_beam_allTrack_startY = pandora2Track->Trajectory().End().Y();
3517  reco_beam_allTrack_startZ = pandora2Track->Trajectory().End().Z();
3518 
3519  reco_beam_allTrack_trackDirX = -1. * endDir.X();
3520  reco_beam_allTrack_trackDirY = -1. * endDir.Y();
3521  reco_beam_allTrack_trackDirZ = -1. * endDir.Z();
3522 
3523  reco_beam_allTrack_trackEndDirX = -1. * startDir.X();
3524  reco_beam_allTrack_trackEndDirY = -1. * startDir.Y();
3525  reco_beam_allTrack_trackEndDirZ = -1. * startDir.Z();
3526  }
3527  else{
3529  reco_beam_allTrack_trackDirX = startDir.X();
3530  reco_beam_allTrack_trackDirY = startDir.Y();
3531  reco_beam_allTrack_trackDirZ = startDir.Z();
3532  reco_beam_allTrack_trackEndDirX = endDir.X();
3533  reco_beam_allTrack_trackEndDirY = endDir.Y();
3534  reco_beam_allTrack_trackEndDirZ = endDir.Z();
3535  }
3536 
3537  reco_beam_allTrack_len = pandora2Track->Length();
3538 
3539  /*std::vector< anab::Calorimetry>*/ auto calo = trackUtil.GetRecoTrackCalorimetry(*pandora2Track, evt, fTrackerTag, fCalorimetryTag);
3540  size_t index = 0;
3541  bool found_plane = false;
3542  for (index = 0; index < calo.size(); ++index) {
3543  if (calo[index].PlaneID().Plane == 2) {
3544  found_plane = true;
3545  break;
3546  }
3547  }
3548 
3549  if (found_plane) {
3550  auto calo_range = calo[index].ResidualRange();
3551  for( size_t i = 0; i < calo_range.size(); ++i ){
3552  reco_beam_allTrack_resRange.push_back( calo_range[i] );
3553  }
3554 
3555  //New Calibration
3556  std::vector< float > new_dEdX = calibration.GetCalibratedCalorimetry(*pandora2Track, evt, fTrackerTag, fCalorimetryTag, 2);
3557  for( size_t i = 0; i < new_dEdX.size(); ++i ){ reco_beam_allTrack_calibrated_dEdX.push_back( new_dEdX[i] ); }
3558  ////////////////////////////////////////////
3559 
3560  std::pair< double, int > pid_chi2_ndof = trackUtil.Chi2PID( reco_beam_allTrack_calibrated_dEdX, reco_beam_allTrack_resRange, templates[ 2212 ] );
3561  reco_beam_allTrack_Chi2_proton = pid_chi2_ndof.first;
3562  reco_beam_allTrack_Chi2_ndof = pid_chi2_ndof.second;
3563  }
3564  else{
3567  }
3568  }
3569  else{
3570  reco_beam_allTrack_ID = -999;
3575  reco_beam_allTrack_endX = -999;
3576  reco_beam_allTrack_endY = -999;
3577  reco_beam_allTrack_endZ = -999;
3586 
3587  }
3588  }
3589  catch( const cet::exception &e ){
3590  MF_LOG_WARNING("PionAnalyzer") << "beam pandora2Track object not found, moving on" << std::endl;
3591  }
3592 
3593 
3594  //New geant4reweight stuff
3595 
3596  if (!evt.isRealData() && fDoReweight) {
3597  if (fVerbose) std::cout << "Doing reweight" << std::endl;
3598  if (true_beam_PDG == 211) {
3599  G4ReweightTraj theTraj(true_beam_ID, true_beam_PDG, 0, event, {0,0});
3600  bool created = CreateRWTraj(*true_beam_particle, plist,
3601  fGeometryService, event, &theTraj);
3602  if (created && theTraj.GetNSteps() > 0) {
3603  g4rw_primary_weights.push_back(MultiRW->GetWeightFromNominal(theTraj));
3604 
3605  std::cout << g4rw_primary_weights.size() << std::endl;
3606  std::vector<double> weights_vec = MultiRW->GetWeightFromAll1DThrows(
3607  theTraj);
3608  std::cout << weights_vec.size() << std::endl;
3610  weights_vec.begin(), weights_vec.end());
3611 
3612 
3613  //g4rw_primary_plus_sigma_weight = pm_weights.first;
3614  //g4rw_primary_minus_sigma_weight = pm_weights.second;
3615 
3616  for (size_t i = 0; i < ParSet.size(); ++i) {
3617  std::pair<double, double> pm_weights =
3618  MultiRW->GetPlusMinusSigmaParWeight(theTraj, i);
3619 
3620  g4rw_primary_plus_sigma_weight.push_back(pm_weights.first);
3621  g4rw_primary_minus_sigma_weight.push_back(pm_weights.second);
3622  g4rw_primary_var.push_back(ParSet[i].get<std::string>("Name"));
3623  }
3624 
3625  }
3626 
3627  std::vector<G4ReweightTraj *> trajs = CreateNRWTrajs(
3628  *true_beam_particle, plist,
3629  fGeometryService, event);
3630 
3631  bool added = false;
3632  for (size_t i = 0; i < trajs.size(); ++i) {
3633  if (trajs[i]->GetNSteps() > 0) {
3634  //std::cout << i << " " << trajs[i]->GetNSteps() << std::endl;
3635  for (size_t j = 0; j < ParSet.size(); ++j) {
3636  std::pair<double, double> pm_weights =
3637  MultiRW->GetPlusMinusSigmaParWeight((*trajs[i]), j);
3638  //std::cout << "got weights" << std::endl;
3639  //std::cout << pm_weights.first << " " << pm_weights.second << std::endl;
3640 
3641  if (!added) {
3642  g4rw_alt_primary_plus_sigma_weight.push_back(pm_weights.first);
3643  g4rw_alt_primary_minus_sigma_weight.push_back(pm_weights.second);
3644  }
3645  else {
3646  g4rw_alt_primary_plus_sigma_weight[j] *= pm_weights.first;
3647  g4rw_alt_primary_minus_sigma_weight[j] *= pm_weights.second;
3648  }
3649  }
3650  added = true;
3651  }
3652  }
3653 
3654  }
3655  }
3656  if (!evt.isRealData() && fDoProtReweight && true_beam_PDG == 2212) {
3657  std::vector<G4ReweightTraj *> trajs = CreateNRWTrajs(
3658  *true_beam_particle, plist,
3659  fGeometryService, event);
3660 
3661  bool added = false;
3662  for (size_t i = 0; i < trajs.size(); ++i) {
3663  if (trajs[i]->GetNSteps() > 0) {
3664  //std::cout << i << " " << trajs[i]->GetNSteps() << std::endl;
3665  for (size_t j = 0; j < ParSet.size(); ++j) {
3666  std::pair<double, double> pm_weights =
3667  ProtMultiRW->GetPlusMinusSigmaParWeight((*trajs[i]), j);
3668  //std::cout << "alt got weights" << std::endl;
3669  //std::cout << pm_weights.first << " " << pm_weights.second <<
3670  // std::endl;
3671 
3672  if (!added) {
3673  g4rw_alt_primary_plus_sigma_weight.push_back(pm_weights.first);
3674  g4rw_alt_primary_minus_sigma_weight.push_back(pm_weights.second);
3675  }
3676  else {
3677  g4rw_alt_primary_plus_sigma_weight[j] *= pm_weights.first;
3678  g4rw_alt_primary_minus_sigma_weight[j] *= pm_weights.second;
3679  }
3680  }
3681  added = true;
3682  }
3683  }
3684  }
3685 
3686  fTree->Fill();
3687 }
double E(const int i=0) const
Definition: MCParticle.h:232
std::vector< double > reco_daughter_allShower_dirX
TrackID_t trackID
Geant4 supplied track ID.
Definition: SimChannel.h:112
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_plane0
std::vector< int > reco_daughter_allTrack_Chi2_ndof_plane0
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_len
std::vector< int > reco_daughter_PFP_true_byHits_origin
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_allTrack_ID
unsigned int NumberTrajectoryPoints() const
Definition: MCParticle.h:217
std::vector< int > true_beam_slices
std::vector< double > true_beam_Pi0_decay_startPx
const std::vector< size_t > & Daughters() const
Returns the collection of daughter particles.
Definition: PFParticle.h:114
std::vector< int > reco_daughter_allTrack_ID
const TVector3 & ShowerStart() const
Definition: Shower.h:192
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:218
double Z(const size_type i) const
Definition: MCTrajectory.h:150
double X(const size_type i) const
Definition: MCTrajectory.h:148
std::vector< int > true_beam_Pi0_decay_ID
float z
z position of ionization [cm]
Definition: SimChannel.h:117
std::vector< double > reco_daughter_allTrack_endX
int PdgCode() const
Definition: MCParticle.h:211
std::vector< std::string > true_beam_grand_daughter_Process
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_PFP_trackScore
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endX
protoana::ProtoDUNEBeamCuts beam_cuts
std::vector< int > reco_daughter_PFP_true_byHits_ID
unsigned int event
Definition: DataStructs.h:626
double Py(const int i=0) const
Definition: MCParticle.h:230
std::vector< int > true_beam_Pi0_decay_parID
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endX
std::vector< double > reco_daughter_allTrack_momByRange_alt_proton
std::vector< std::string > true_beam_grand_daughter_endProcess
const std::vector< double > & GetTOFs() const
std::vector< std::vector< double > > reco_daughter_allTrack_dQdX_SCE
std::vector< std::string > reco_daughter_PFP_true_byHits_process
std::vector< double > reco_track_startY
std::vector< std::string > true_beam_daughter_Process
const TLorentzVector & EndPosition() const
Definition: MCParticle.h:224
double EndZ() const
Definition: MCParticle.h:227
std::vector< double > reco_daughter_PFP_true_byHits_endZ
std::vector< int > true_beam_process_dSlice
unsigned int run
Definition: DataStructs.h:627
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:92
std::vector< double > reco_beam_dEdX
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_allTrack_ID
double E(const size_type i) const
Definition: MCTrajectory.h:155
std::vector< double > reco_daughter_PFP_true_byHits_startPy
protoana::ProtoDUNEBeamlineUtils fBeamlineUtils
std::vector< double > reco_daughter_PFP_trackScore_collection
std::vector< std::string > reco_daughter_PFP_true_byHits_endProcess
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startZ
double Length() const
Definition: Shower.h:201
std::vector< int > data_BI_PDG_candidates
AdcChannelData::View View
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< double > reco_daughter_allTrack_endZ
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
std::string string
Definition: nybbler.cc:12
std::string reco_beam_true_byHits_process
const simb::MCTrajectory & Trajectory() const
Definition: MCParticle.h:252
std::vector< std::string > true_beam_daughter_endProcess
geo::WireID WireID() const
Definition: Hit.h:233
int Mother() const
Definition: MCParticle.h:212
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
Definition: Track.h:98
std::vector< double > reco_daughter_allTrack_startZ
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< double > g4rw_primary_weights
double Pz(const size_type i) const
Definition: MCTrajectory.h:154
std::vector< double > reco_daughter_PFP_true_byHits_len
cnnOutput2D GetCNNOutputFromPFParticle(const recob::PFParticle &part, const art::Event &evt, const anab::MVAReader< recob::Hit, 4 > &CNN_results, protoana::ProtoDUNEPFParticleUtils &pfpUtil, std::string fPFParticleTag)
simb::Origin_t Origin() const
Definition: MCTruth.h:74
cnnOutput2D GetCNNOutputFromPFParticleFromPlane(const recob::PFParticle &part, const art::Event &evt, const anab::MVAReader< recob::Hit, 4 > &CNN_results, protoana::ProtoDUNEPFParticleUtils &pfpUtil, std::string fPFParticleTag, size_t planeID)
std::vector< double > true_beam_incidentEnergies
std::vector< double > quality_reco_view_0_tick
std::vector< double > g4rw_alt_primary_minus_sigma_weight
std::string KeyToProcess(unsigned char const &key) const
std::map< int, TProfile * > templates
std::map< int, std::vector< const sim::IDE * > > slice_IDEs(std::vector< const sim::IDE * > ides, double the_z0, double the_pitch, double true_endZ)
double Px(const int i=0) const
Definition: MCParticle.h:229
std::vector< int > true_beam_process_slice
protoana::ProtoDUNECalibration calibration
std::vector< double > reco_daughter_allTrack_len
std::vector< double > data_BI_TOF
std::vector< double > true_beam_traj_Y
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Definition: Track.h:102
std::vector< double > reco_daughter_allTrack_Chi2_proton_plane0
std::vector< double > true_beam_Pi0_decay_startZ
std::vector< std::string > g4rw_primary_var
std::vector< double > true_beam_daughter_endY
std::vector< const sim::IDE * > TrackIdToSimIDEs_Ps(int const &id) const
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_PFP_nHits
std::vector< double > true_beam_elastic_IDE_edep
std::vector< double > reco_track_endY
std::vector< double > true_beam_daughter_startX
std::vector< double > reco_track_startX
std::vector< double > true_beam_daughter_startPx
std::vector< std::vector< int > > true_beam_reco_byHits_allTrack_ID
geo::View_t View() const
View for the plane of the hit.
Definition: Hit.h:232
std::string reco_beam_true_byE_process
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:580
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_PFP_ID
std::vector< std::pair< int, double > > getTrueSliceListFromRecoHit_electrons(detinfo::DetectorClocksData const &clockData, const recob::Hit &hit, art::ServiceHandle< cheat::BackTrackerService > bt, const std::map< int, std::vector< const sim::IDE * > > &true_slices, int beam_id)
std::vector< int > reco_daughter_allTrack_vertex_nHits
std::vector< G4ReweightTraj * > CreateNRWTrajs(const simb::MCParticle &part, const sim::ParticleList &plist, art::ServiceHandle< geo::Geometry > geo_serv, int event)
std::vector< double > reco_daughter_PFP_trackScore
std::vector< int > true_beam_daughter_PDG
string dir
TVector3 FitLine(const std::vector< TVector3 > &input)
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endZ
std::vector< double > quality_reco_view_0_wire
BR-MS.
std::vector< double > true_beam_Pi0_decay_startP
std::string Process() const
Definition: MCParticle.h:214
std::vector< double > reco_beam_calo_startDirZ
double EndY() const
Definition: MCParticle.h:226
std::vector< int > true_beam_daughter_nHits
std::vector< double > true_beam_Pi0_decay_startPy
std::vector< double > reco_daughter_PFP_michelScore
std::vector< int > reco_track_ID
int getTrueIDFromHit(detinfo::DetectorClocksData const &clockData, const recob::Hit &hit, art::ServiceHandle< cheat::BackTrackerService > bt)
std::vector< double > reco_daughter_PFP_true_byHits_completeness
std::vector< int > cosmic_has_beam_IDE
geo::Length_t WirePitch(geo::PlaneID const &planeid) const
Returns the distance between two consecutive wires.
bool IsBeamlike(const recob::Track &, const art::Event &, std::string)
std::vector< double > reco_daughter_PFP_true_byE_completeness
std::vector< double > true_beam_daughter_len
int NumberDaughters() const
Definition: MCParticle.h:216
unsigned int Nwires(unsigned int p, unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wires in the specified plane.
G4MultiReweighter * ProtMultiRW
std::vector< int > true_beam_process_matched
std::vector< double > reco_beam_incidentEnergies
int TrackId() const
Definition: MCParticle.h:209
std::vector< size_t > reco_daughter_PFP_true_byHits_sharedHits
EDIT: quality.
std::vector< double > reco_beam_calo_tick
int Daughter(const int i) const
Definition: MCParticle.cxx:112
std::vector< double > reco_track_endX
std::vector< size_t > reco_daughter_PFP_true_byHits_emHits
std::string reco_beam_true_byHits_endProcess
std::pair< double, int > GetVertexMichelScore(const recob::Track &track, const art::Event &evt, const std::string trackModule, const std::string hitModule, double min_length=5., double min_x=-200., double max_x=0., double min_y=200., double max_y=500., double min_z=25., bool check_wire=true, double check_x=0, double check_y=0., double check_z=0.)
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_PFP_trackScore
std::vector< double > true_beam_daughter_startZ
std::vector< double > reco_beam_dQdX
std::vector< double > true_beam_Pi0_decay_startPz
geo::TPCID FindTPCAtPosition(double const worldLoc[3]) const
Returns the ID of the TPC at specified location.
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE_plane0
std::vector< double > reco_beam_spacePts_Y
std::vector< std::vector< double > > reco_daughter_allTrack_dEdX_SCE
def process(f, kind)
Definition: search.py:254
double y
std::vector< double > reco_daughter_allTrack_momByRange_alt_muon
double HitToEnergy(const art::Ptr< recob::Hit > hit, double X, double Y, double Z, double recomb_factor=.6417)
G4MultiReweighter * MultiRW
T abs(T value)
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_len
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE_plane1
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_len
const std::vector< art::Ptr< recob::Hit > > GetRecoShowerArtHits(const recob::Shower &shower, art::Event const &evt, const std::string showerModule) const
std::vector< double > true_beam_elastic_costheta
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startY
double Phi() const
Definition: Track.h:178
Vector_t StartDirection() const
Access to track direction at different points.
Definition: Track.h:131
std::vector< double > reco_daughter_allTrack_momByRange_proton
Reconstructed Daughter Info.
const double e
double Length(size_t p=0) const
Access to various track properties.
Definition: Track.h:167
std::vector< double > reco_daughter_PFP_true_byHits_startP
double Y(const size_type i) const
Definition: MCTrajectory.h:149
static int input(void)
Definition: code.cpp:15695
std::vector< double > reco_daughter_PFP_true_byHits_startX
std::vector< double > reco_daughter_PFP_emScore
std::vector< double > quality_reco_view_2_tick
std::vector< double > reco_daughter_allShower_dirY
std::vector< double > reco_daughter_PFP_true_byHits_purity
std::string EndProcess() const
Definition: MCParticle.h:215
std::vector< double > reco_daughter_PFP_true_byHits_endX
Point_t const & Start() const
Access to track position at different points.
Definition: Track.h:123
const std::vector< short > & GetActiveFibers(std::string) const
std::vector< double > quality_reco_view_1_wire
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startZ
std::vector< double > g4rw_primary_plus_sigma_weight
Ionization at a point of the TPC sensitive volume.
Definition: SimChannel.h:84
const std::vector< double > & GetRecoBeamMomenta() const
T LocationAtPoint(unsigned int p) const
Position at point p. Use e.g. as:
const art::Ptr< simb::MCTruth > & TrackIdToMCTruth_P(int id) const
double Theta() const
Access to spherical or geographical angles at vertex or at any point.
Definition: Track.h:176
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startZ
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startX
std::vector< std::string > true_beam_processes
std::vector< double > true_beam_elastic_deltaE
std::vector< double > reco_daughter_allShower_dirZ
std::vector< double > true_beam_daughter_startP
double P(const int i=0) const
Definition: MCParticle.h:233
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.
std::vector< int > reco_daughter_PFP_true_byHits_parID
float energy
energy deposited by ionization by this track ID and time [MeV]
Definition: SimChannel.h:114
bool CreateRWTraj(const simb::MCParticle &part, const sim::ParticleList &plist, art::ServiceHandle< geo::Geometry > geo_serv, int event, G4ReweightTraj *theTraj)
std::vector< double > reco_daughter_PFP_true_byHits_startPz
double z
std::vector< double > g4rw_alt_primary_plus_sigma_weight
std::vector< double > reco_beam_spacePts_Z
std::vector< int > true_beam_grand_daughter_PDG
std::vector< std::vector< int > > true_beam_reco_byHits_PFP_ID
std::vector< double > reco_beam_TrkPitch
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startX
std::vector< double > reco_daughter_allTrack_momByRange_muon
std::vector< double > reco_beam_cosmic_candidate_lower_hits
std::vector< double > true_beam_elastic_X
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startY
std::vector< double > true_beam_daughter_startY
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endY
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endY
std::vector< int > reco_daughter_PFP_true_byHits_parPDG
bool sort_IDEs(const sim::IDE *i1, const sim::IDE *i2)
std::vector< double > reco_daughter_PFP_true_byHits_endY
std::vector< int > reco_beam_calo_TPC
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...
std::vector< double > reco_beam_resRange
const TVector3 & Direction() const
Definition: Shower.h:189
bool IsGoodBeamlineTrigger(art::Event const &evt) const
std::vector< double > reco_daughter_PFP_michelScore_collection
std::vector< double > reco_beam_spacePts_X
Reconstructed Daughter Info.
const std::vector< const recob::SpacePoint * > GetPFParticleSpacePoints(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
static int max(int a, int b)
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:493
std::vector< double > true_beam_traj_KE
std::vector< double > reco_beam_calibrated_dEdX
std::vector< int > reco_beam_hit_true_origin
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_allShower_ID
std::vector< int > true_beam_slices_found
std::vector< double > reco_beam_allTrack_calibrated_dEdX
std::vector< int > reco_daughter_PFP_true_byE_PDG
const TLorentzVector & Position(const size_type) const
The accessor methods described above.
ProcessMap const & TrajectoryProcesses() const
Definition: MCTrajectory.h:187
std::vector< double > reco_daughter_allShower_len
std::vector< double > reco_track_endZ
std::vector< double > reco_daughter_allShower_startZ
std::vector< int > reco_track_nHits
std::vector< int > reco_daughter_allShower_ID
std::vector< int > true_beam_grand_daughter_ID
std::vector< double > reco_daughter_allTrack_Chi2_proton
std::vector< double > quality_reco_view_2_z
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE
const sim::ParticleList & ParticleList() const
std::vector< int > reco_daughter_PFP_ID
Add by hits?
std::pair< double, int > Chi2PID(const std::vector< double > &track_dedx, const std::vector< double > &range, TProfile *profile)
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_allShower_ID
std::vector< double > reco_daughter_allTrack_Theta
std::vector< double > reco_track_michel_score
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition: pointer.h:1124
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_SCE
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startZ
const std::vector< const recob::Hit * > GetRecoTrackHitsFromPlane(const recob::Track &track, art::Event const &evt, const std::string trackModule, unsigned int planeID) const
Get the hits from a given reco track from a specific plane.
std::vector< int > reco_daughter_PFP_true_byHits_PDG
p
Definition: test.py:223
Defines an enumeration for cellhit classification.
std::vector< double > true_beam_Pi0_decay_len
WireGeo const & Wire(geo::WireID const &wireid) const
Returns the specified wire.
int ID() const
Definition: Track.h:198
std::vector< double > reco_track_startZ
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:218
std::vector< int > reco_daughter_allTrack_Chi2_ndof_plane1
std::vector< int > GetPID(beam::ProtoDUNEBeamEvent const &beamevt, double nominal_momentum)
std::vector< double > reco_daughter_allTrack_startY
const simb::MCParticle * particle
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startY
Hierarchical representation of particle flow.
Definition: PFParticle.h:44
std::vector< double > reco_daughter_PFP_true_byHits_startY
const std::vector< int > & GetTOFChans() const
size_type size() const
Definition: MCTrajectory.h:165
std::vector< double > reco_beam_calo_wire_z
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
std::vector< int > true_beam_daughter_ID
std::vector< std::vector< int > > true_beam_reco_byHits_PFP_nHits
double TotalLength() const
std::vector< double > reco_daughter_allShower_energy
std::vector< int > reco_daughter_PFP_nHits_collection
std::vector< double > true_beam_daughter_endZ
std::vector< fhicl::ParameterSet > ParSet
std::vector< int > reco_daughter_allTrack_Chi2_ndof
std::vector< int > reco_beam_hit_true_slice
Vector_t EndDirection() const
Definition: Track.h:133
std::vector< double > reco_beam_calo_endDirX
std::vector< double > true_beam_daughter_endX
std::vector< double > quality_reco_view_1_tick
std::vector< double > reco_daughter_PFP_true_byHits_startE
Point_t const & End() const
Returns the position of the last valid point of the trajectory [cm].
std::vector< double > reco_daughter_PFP_true_byE_purity
std::vector< double > reco_daughter_allShower_startX
double Pz(const int i=0) const
Definition: MCParticle.h:231
std::vector< double > reco_beam_cosmic_candidate_upper_hits
const std::vector< art::Ptr< recob::Hit > > GetPFParticleHits_Ptrs(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel) const
std::vector< double > true_beam_traj_Z
std::vector< double > reco_daughter_allTrack_Chi2_proton_plane1
static bool * b
Definition: config.cpp:1043
std::vector< int > reco_beam_hit_true_ID
std::vector< double > true_beam_Pi0_decay_startX
std::vector< double > true_beam_daughter_startPy
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.
Point_t const & End() const
Definition: Track.h:125
unsigned int subRun
Definition: DataStructs.h:628
const std::vector< recob::Track > & GetBeamTracks() const
double Px(const size_type i) const
Definition: MCTrajectory.h:152
detail::Node< FrameID, bool > PlaneID
Definition: CRTID.h:125
std::vector< int > true_beam_Pi0_decay_nHits
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_plane1
list x
Definition: train.py:276
std::vector< double > reco_daughter_allTrack_vertex_michel_score
std::vector< double > true_beam_elastic_Z
std::vector< int > reco_beam_cosmic_candidate_ID
std::vector< int > true_beam_grand_daughter_nHits
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_len
std::vector< double > true_beam_slices_deltaE
const std::vector< const recob::Hit * > GetPFParticleHitsFromPlane(const recob::PFParticle &particle, art::Event const &evt, const std::string particleLabel, unsigned int planeID) const
std::vector< const sim::IDE * > HitToSimIDEs_Ps(detinfo::DetectorClocksData const &clockData, recob::Hit const &hit) const
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
std::vector< int > true_beam_Pi0_decay_PDG
void GetCenter(double *xyz, double localz=0.0) const
Fills the world coordinate of a point on the wire.
Definition: WireGeo.cxx:69
std::vector< double > reco_daughter_PFP_true_byHits_startZ
std::vector< double > reco_beam_calo_endDirZ
std::vector< double > reco_daughter_allTrack_to_vertex
std::vector< double > true_beam_elastic_Y
TCEvent evt
Definition: DataStructs.cxx:7
#define MF_LOG_WARNING(category)
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:291
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:406
std::vector< double > reco_beam_calo_startDirX
std::string reco_beam_true_byE_endProcess
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_PFP_nHits
std::vector< double > reco_beam_calo_endDirY
std::vector< double > reco_daughter_allTrack_dR
double EndX() const
Definition: MCParticle.h:225
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startX
std::vector< float > GetCalibratedCalorimetry(const recob::Track &track, art::Event const &evt, const std::string trackModule, const std::string caloModule, size_t planeID, double negativeZFix=0.)
recob::tracking::Plane Plane
Definition: TrackState.h:17
std::map< size_t, const recob::Hit * > GetRecoHitsFromTrajPoints(const recob::Track &track, art::Event const &evt, std::string trackModule)
std::vector< double > reco_daughter_allTrack_endY
Point_t const & Start() const
Returns the position of the first valid point of the trajectory [cm].
std::vector< double > reco_daughter_allTrack_Phi
double Py(const size_type i) const
Definition: MCTrajectory.h:153
std::vector< double > reco_beam_calo_startDirY
std::vector< double > reco_daughter_allShower_startY
std::vector< double > true_beam_daughter_startPz
std::vector< double > reco_daughter_allTrack_alt_len
int ID() const
Definition: Shower.h:187
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endZ
std::vector< double > quality_reco_view_2_wire
std::vector< double > true_beam_Pi0_decay_startY
std::vector< double > reco_daughter_PFP_true_byHits_startPx
std::vector< double > true_beam_traj_X
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startX
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_PFP_ID
std::vector< double > reco_daughter_PFP_emScore_collection
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
calorimetry
double GetTrackMomentum(double trkrange, int pdg) const
std::vector< double > g4rw_primary_minus_sigma_weight
std::vector< int > true_beam_grand_daughter_parID
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::vector< double > reco_beam_calo_wire
double lateralDist(TVector3 &n, TVector3 &x0, TVector3 &p)
QTextStream & endl(QTextStream &s)
std::vector< double > reco_beam_allTrack_resRange
Event finding and building.
h
training ###############################
Definition: train_cnn.py:186
std::vector< double > reco_daughter_allTrack_startX
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startY
std::vector< int > data_BI_TOF_Chan
std::vector< int > reco_daughter_PFP_nHits
std::vector< int > true_beam_slices_nIDEs
std::vector< double > reco_daughter_PFP_true_byE_len
void pionana::PionAnalyzer::beginJob ( )
overridevirtual

Reconstructed info

Calorimetry/chi2 planes 0 and 1

Reconstructed info – daughter

Reimplemented from art::EDAnalyzer.

Definition at line 3689 of file PionAnalyzer_module.cc.

3690 {
3691 
3692  gROOT->SetBatch(1);
3693 
3695  fTree = tfs->make<TTree>("beamana","beam analysis tree");
3696 
3697  fTree->Branch("run", &run);
3698  fTree->Branch("subrun", &subrun);
3699  fTree->Branch("event", &event);
3700  fTree->Branch("MC", &MC);
3701 
3702 
3703 
3704  ///Reconstructed info
3705  fTree->Branch("reco_beam_type", &reco_beam_type);
3706  fTree->Branch("reco_beam_startX", &reco_beam_startX);
3707  fTree->Branch("reco_beam_startY", &reco_beam_startY);
3708  fTree->Branch("reco_beam_startZ", &reco_beam_startZ);
3709  fTree->Branch("reco_beam_endX", &reco_beam_endX);
3710  fTree->Branch("reco_beam_endY", &reco_beam_endY);
3711  fTree->Branch("reco_beam_endZ", &reco_beam_endZ);
3712  fTree->Branch("reco_beam_len", &reco_beam_len);
3713  fTree->Branch("reco_beam_alt_len", &reco_beam_alt_len);
3714  fTree->Branch("reco_beam_calo_startX", &reco_beam_calo_startX);
3715  fTree->Branch("reco_beam_calo_startY", &reco_beam_calo_startY);
3716  fTree->Branch("reco_beam_calo_startZ", &reco_beam_calo_startZ);
3717  fTree->Branch("reco_beam_calo_endX", &reco_beam_calo_endX);
3718  fTree->Branch("reco_beam_calo_endY", &reco_beam_calo_endY);
3719  fTree->Branch("reco_beam_calo_endZ", &reco_beam_calo_endZ);
3720  fTree->Branch("reco_beam_calo_startDirX", &reco_beam_calo_startDirX);
3721  fTree->Branch("reco_beam_calo_startDirY", &reco_beam_calo_startDirY);
3722  fTree->Branch("reco_beam_calo_startDirZ", &reco_beam_calo_startDirZ);
3723  fTree->Branch("reco_beam_calo_endDirX", &reco_beam_calo_endDirX);
3724  fTree->Branch("reco_beam_calo_endDirY", &reco_beam_calo_endDirY);
3725  fTree->Branch("reco_beam_calo_endDirZ", &reco_beam_calo_endDirZ);
3726 
3727  fTree->Branch("reco_beam_trackDirX", &reco_beam_trackDirX);
3728  fTree->Branch("reco_beam_trackDirY", &reco_beam_trackDirY);
3729  fTree->Branch("reco_beam_trackDirZ", &reco_beam_trackDirZ);
3730  fTree->Branch("reco_beam_trackEndDirX", &reco_beam_trackEndDirX);
3731  fTree->Branch("reco_beam_trackEndDirY", &reco_beam_trackEndDirY);
3732  fTree->Branch("reco_beam_trackEndDirZ", &reco_beam_trackEndDirZ);
3733  fTree->Branch("reco_beam_vtxX", &reco_beam_vtxX);
3734  fTree->Branch("reco_beam_vtxY", &reco_beam_vtxY);
3735  fTree->Branch("reco_beam_vtxZ", &reco_beam_vtxZ);
3736  fTree->Branch("reco_beam_vertex_nHits", &reco_beam_vertex_nHits);
3737  fTree->Branch("reco_beam_vertex_michel_score", &reco_beam_vertex_michel_score);
3738  fTree->Branch("reco_beam_trackID", &reco_beam_trackID);
3739  fTree->Branch("reco_beam_dQdX", &reco_beam_dQdX);
3740  fTree->Branch("reco_beam_dEdX", &reco_beam_dEdX);
3741  fTree->Branch("reco_beam_calibrated_dEdX", &reco_beam_calibrated_dEdX);
3742  fTree->Branch("reco_beam_resRange", &reco_beam_resRange);
3743  fTree->Branch("reco_beam_TrkPitch", &reco_beam_TrkPitch);
3744  fTree->Branch("reco_beam_calo_wire", &reco_beam_calo_wire);
3745  fTree->Branch("reco_beam_calo_wire_z", &reco_beam_calo_wire_z);
3746  fTree->Branch("reco_beam_calo_tick", &reco_beam_calo_tick);
3747  fTree->Branch("reco_beam_calo_TPC", &reco_beam_calo_TPC);
3748 
3749  fTree->Branch("reco_beam_hit_true_ID", &reco_beam_hit_true_ID);
3750  fTree->Branch("reco_beam_hit_true_slice", &reco_beam_hit_true_slice);
3751  fTree->Branch("reco_beam_hit_true_origin", &reco_beam_hit_true_origin);
3752  fTree->Branch("reco_beam_nTrackDaughters", &reco_beam_nTrackDaughters);
3753  fTree->Branch("reco_beam_nShowerDaughters", &reco_beam_nShowerDaughters);
3754  fTree->Branch("reco_beam_flipped", &reco_beam_flipped);
3755  fTree->Branch("reco_beam_passes_beam_cuts", &reco_beam_passes_beam_cuts);
3756 
3757  fTree->Branch("reco_beam_PFP_ID", &reco_beam_PFP_ID);
3758  fTree->Branch("reco_beam_PFP_nHits", &reco_beam_PFP_nHits);
3759  fTree->Branch("reco_beam_PFP_trackScore", &reco_beam_PFP_trackScore);
3760  fTree->Branch("reco_beam_PFP_emScore", &reco_beam_PFP_emScore);
3761  fTree->Branch("reco_beam_PFP_michelScore", &reco_beam_PFP_michelScore);
3762  fTree->Branch("reco_beam_PFP_trackScore_collection", &reco_beam_PFP_trackScore_collection);
3763  fTree->Branch("reco_beam_PFP_emScore_collection", &reco_beam_PFP_emScore_collection);
3764  fTree->Branch("reco_beam_PFP_michelScore_collection", &reco_beam_PFP_michelScore_collection);
3765 
3766  fTree->Branch("reco_beam_allTrack_ID", &reco_beam_allTrack_ID);
3767  fTree->Branch("reco_beam_allTrack_beam_cuts", &reco_beam_allTrack_beam_cuts);
3768  fTree->Branch("reco_beam_allTrack_flipped", &reco_beam_allTrack_flipped);
3769  fTree->Branch("reco_beam_allTrack_len", &reco_beam_allTrack_len);
3770  fTree->Branch("reco_beam_allTrack_startX", &reco_beam_allTrack_startX);
3771  fTree->Branch("reco_beam_allTrack_startY", &reco_beam_allTrack_startY);
3772  fTree->Branch("reco_beam_allTrack_startZ", &reco_beam_allTrack_startZ);
3773  fTree->Branch("reco_beam_allTrack_endX", &reco_beam_allTrack_endX);
3774  fTree->Branch("reco_beam_allTrack_endY", &reco_beam_allTrack_endY);
3775  fTree->Branch("reco_beam_allTrack_endZ", &reco_beam_allTrack_endZ);
3776  fTree->Branch("reco_beam_allTrack_trackDirX", &reco_beam_allTrack_trackDirX);
3777  fTree->Branch("reco_beam_allTrack_trackDirY", &reco_beam_allTrack_trackDirY);
3778  fTree->Branch("reco_beam_allTrack_trackDirZ", &reco_beam_allTrack_trackDirZ);
3779  fTree->Branch("reco_beam_allTrack_trackEndDirX", &reco_beam_allTrack_trackEndDirX);
3780  fTree->Branch("reco_beam_allTrack_trackEndDirY", &reco_beam_allTrack_trackEndDirY);
3781  fTree->Branch("reco_beam_allTrack_trackEndDirZ", &reco_beam_allTrack_trackEndDirZ);
3782  fTree->Branch("reco_beam_allTrack_resRange", &reco_beam_allTrack_resRange);
3783  fTree->Branch("reco_beam_allTrack_calibrated_dEdX", &reco_beam_allTrack_calibrated_dEdX);
3784  fTree->Branch("reco_beam_allTrack_Chi2_proton", &reco_beam_allTrack_Chi2_proton);
3785  fTree->Branch("reco_beam_allTrack_Chi2_ndof", &reco_beam_allTrack_Chi2_ndof);
3786 
3787  fTree->Branch("reco_track_startX", &reco_track_startX);
3788  fTree->Branch("reco_track_startY", &reco_track_startY);
3789  fTree->Branch("reco_track_startZ", &reco_track_startZ);
3790  fTree->Branch("reco_track_endX", &reco_track_endX);
3791  fTree->Branch("reco_track_endY", &reco_track_endY);
3792  fTree->Branch("reco_track_endZ", &reco_track_endZ);
3793  fTree->Branch("reco_track_michel_score", &reco_track_michel_score);
3794  fTree->Branch("reco_track_ID", &reco_track_ID);
3795  fTree->Branch("reco_track_nHits", &reco_track_nHits);
3796 
3797  //Reconstructed info -- daughters
3798  /*
3799  fTree->Branch("reco_daughter_trackID", &reco_daughter_trackID);
3800  fTree->Branch("reco_daughter_true_byE_completeness", &reco_daughter_true_byE_completeness);
3801  fTree->Branch("reco_daughter_true_byE_purity", &reco_daughter_true_byE_purity);
3802  fTree->Branch("reco_daughter_true_byE_PDG", &reco_daughter_true_byE_PDG);
3803  fTree->Branch("reco_daughter_true_byE_ID", &reco_daughter_true_byE_ID);
3804  fTree->Branch("reco_daughter_true_byE_origin", &reco_daughter_true_byE_origin);
3805  fTree->Branch("reco_daughter_true_byE_parID", &reco_daughter_true_byE_parID);
3806  fTree->Branch("reco_daughter_true_byE_parPDG", &reco_daughter_true_byE_parPDG);
3807  fTree->Branch("reco_daughter_true_byE_process", &reco_daughter_true_byE_process);
3808 
3809  fTree->Branch("reco_daughter_true_byHits_PDG", &reco_daughter_true_byHits_PDG);
3810  fTree->Branch("reco_daughter_true_byHits_ID", &reco_daughter_true_byHits_ID);
3811  fTree->Branch("reco_daughter_true_byHits_origin", &reco_daughter_true_byHits_origin);
3812  fTree->Branch("reco_daughter_true_byHits_parID", &reco_daughter_true_byHits_parID);
3813  fTree->Branch("reco_daughter_true_byHits_parPDG", &reco_daughter_true_byHits_parPDG);
3814  fTree->Branch("reco_daughter_true_byHits_process", &reco_daughter_true_byHits_process);
3815  fTree->Branch("reco_daughter_true_byHits_purity", &reco_daughter_true_byHits_purity);
3816  fTree->Branch("reco_daughter_true_byHits_sharedHits", &reco_daughter_true_byHits_sharedHits);
3817  fTree->Branch("reco_daughter_true_byHits_emHits", &reco_daughter_true_byHits_emHits);
3818 
3819  fTree->Branch("reco_daughter_true_byHits_len", &reco_daughter_true_byHits_len);
3820  fTree->Branch("reco_daughter_true_byHits_startX", &reco_daughter_true_byHits_startX);
3821  fTree->Branch("reco_daughter_true_byHits_startY", &reco_daughter_true_byHits_startY);
3822  fTree->Branch("reco_daughter_true_byHits_startZ", &reco_daughter_true_byHits_startZ);
3823  fTree->Branch("reco_daughter_true_byHits_endX", &reco_daughter_true_byHits_endX);
3824  fTree->Branch("reco_daughter_true_byHits_endY", &reco_daughter_true_byHits_endY);
3825  fTree->Branch("reco_daughter_true_byHits_endZ", &reco_daughter_true_byHits_endZ);
3826 
3827  fTree->Branch("reco_daughter_true_byHits_startPx", &reco_daughter_true_byHits_startPx);
3828  fTree->Branch("reco_daughter_true_byHits_startPy", &reco_daughter_true_byHits_startPy);
3829  fTree->Branch("reco_daughter_true_byHits_startPz", &reco_daughter_true_byHits_startPz);
3830  fTree->Branch("reco_daughter_true_byHits_startP", &reco_daughter_true_byHits_startP);
3831  fTree->Branch("reco_daughter_true_byHits_startE", &reco_daughter_true_byHits_startE);
3832  */
3833  //Alternative reco
3834  fTree->Branch("reco_daughter_PFP_true_byHits_PDG", &reco_daughter_PFP_true_byHits_PDG);
3835  fTree->Branch("reco_daughter_PFP_true_byHits_ID", &reco_daughter_PFP_true_byHits_ID);
3836  fTree->Branch("reco_daughter_PFP_true_byHits_origin", &reco_daughter_PFP_true_byHits_origin);
3837  fTree->Branch("reco_daughter_PFP_true_byHits_parID", &reco_daughter_PFP_true_byHits_parID);
3838  fTree->Branch("reco_daughter_PFP_true_byHits_parPDG", &reco_daughter_PFP_true_byHits_parPDG);
3839  fTree->Branch("reco_daughter_PFP_true_byHits_process", &reco_daughter_PFP_true_byHits_process);
3840  fTree->Branch("reco_daughter_PFP_true_byHits_sharedHits", &reco_daughter_PFP_true_byHits_sharedHits);
3841  fTree->Branch("reco_daughter_PFP_true_byHits_emHits", &reco_daughter_PFP_true_byHits_emHits);
3842 
3843  fTree->Branch("reco_daughter_PFP_true_byHits_len", &reco_daughter_PFP_true_byHits_len);
3844  fTree->Branch("reco_daughter_PFP_true_byHits_startX", &reco_daughter_PFP_true_byHits_startX);
3845  fTree->Branch("reco_daughter_PFP_true_byHits_startY", &reco_daughter_PFP_true_byHits_startY);
3846  fTree->Branch("reco_daughter_PFP_true_byHits_startZ", &reco_daughter_PFP_true_byHits_startZ);
3847  fTree->Branch("reco_daughter_PFP_true_byHits_endX", &reco_daughter_PFP_true_byHits_endX);
3848  fTree->Branch("reco_daughter_PFP_true_byHits_endY", &reco_daughter_PFP_true_byHits_endY);
3849  fTree->Branch("reco_daughter_PFP_true_byHits_endZ", &reco_daughter_PFP_true_byHits_endZ);
3850 
3851  fTree->Branch("reco_daughter_PFP_true_byHits_startPx", &reco_daughter_PFP_true_byHits_startPx);
3852  fTree->Branch("reco_daughter_PFP_true_byHits_startPy", &reco_daughter_PFP_true_byHits_startPy);
3853  fTree->Branch("reco_daughter_PFP_true_byHits_startPz", &reco_daughter_PFP_true_byHits_startPz);
3854  fTree->Branch("reco_daughter_PFP_true_byHits_startP", &reco_daughter_PFP_true_byHits_startP);
3855  fTree->Branch("reco_daughter_PFP_true_byHits_startE", &reco_daughter_PFP_true_byHits_startE);
3856  fTree->Branch("reco_daughter_PFP_true_byHits_endProcess", &reco_daughter_PFP_true_byHits_endProcess);
3857  fTree->Branch("reco_daughter_PFP_true_byHits_purity", &reco_daughter_PFP_true_byHits_purity);
3858  fTree->Branch("reco_daughter_PFP_true_byHits_completeness", &reco_daughter_PFP_true_byHits_completeness);
3859  fTree->Branch("reco_daughter_PFP_true_byE_PDG", &reco_daughter_PFP_true_byE_PDG);
3860  fTree->Branch("reco_daughter_PFP_true_byE_len", &reco_daughter_PFP_true_byE_len);
3861  fTree->Branch("reco_daughter_PFP_true_byE_completeness", &reco_daughter_PFP_true_byE_completeness);
3862  fTree->Branch("reco_daughter_PFP_true_byE_purity", &reco_daughter_PFP_true_byE_purity);
3863 
3864  fTree->Branch("reco_daughter_allTrack_ID", &reco_daughter_allTrack_ID);
3865  fTree->Branch("reco_daughter_allTrack_dQdX_SCE", &reco_daughter_allTrack_dQdX_SCE);
3866  fTree->Branch("reco_daughter_allTrack_dEdX_SCE", &reco_daughter_allTrack_dEdX_SCE);
3867  fTree->Branch("reco_daughter_allTrack_resRange_SCE", &reco_daughter_allTrack_resRange_SCE);
3868  fTree->Branch("reco_daughter_allTrack_calibrated_dEdX_SCE", &reco_daughter_allTrack_calibrated_dEdX_SCE);
3869 
3870  fTree->Branch("reco_daughter_allTrack_Chi2_proton", &reco_daughter_allTrack_Chi2_proton);
3871  fTree->Branch("reco_daughter_allTrack_Chi2_ndof", &reco_daughter_allTrack_Chi2_ndof);
3872 
3873 
3874  ///Calorimetry/chi2 planes 0 and 1
3875  fTree->Branch("reco_daughter_allTrack_Chi2_proton_plane0",
3877  fTree->Branch("reco_daughter_allTrack_Chi2_proton_plane1",
3879 
3880  fTree->Branch("reco_daughter_allTrack_Chi2_ndof_plane0",
3882  fTree->Branch("reco_daughter_allTrack_Chi2_ndof_plane1",
3884 
3885  fTree->Branch("reco_daughter_allTrack_calibrated_dEdX_SCE_plane0",
3887  fTree->Branch("reco_daughter_allTrack_calibrated_dEdX_SCE_plane1",
3889  fTree->Branch("reco_daughter_allTrack_resRange_plane0",
3891  fTree->Branch("reco_daughter_allTrack_resRange_plane1",
3893  ///////////////////////////////////
3894 
3895  fTree->Branch("reco_daughter_allTrack_Theta", &reco_daughter_allTrack_Theta);
3896  fTree->Branch("reco_daughter_allTrack_Phi", &reco_daughter_allTrack_Phi);
3897 
3898  fTree->Branch("reco_daughter_allTrack_len", &reco_daughter_allTrack_len);
3899  fTree->Branch("reco_daughter_allTrack_alt_len", &reco_daughter_allTrack_alt_len);
3900  fTree->Branch("reco_daughter_allTrack_startX", &reco_daughter_allTrack_startX);
3901  fTree->Branch("reco_daughter_allTrack_startY", &reco_daughter_allTrack_startY);
3902  fTree->Branch("reco_daughter_allTrack_startZ", &reco_daughter_allTrack_startZ);
3903  fTree->Branch("reco_daughter_allTrack_endX", &reco_daughter_allTrack_endX);
3904  fTree->Branch("reco_daughter_allTrack_endY", &reco_daughter_allTrack_endY);
3905  fTree->Branch("reco_daughter_allTrack_endZ", &reco_daughter_allTrack_endZ);
3906  fTree->Branch("reco_daughter_allTrack_dR", &reco_daughter_allTrack_dR);
3907  fTree->Branch("reco_daughter_allTrack_to_vertex", &reco_daughter_allTrack_to_vertex);
3908 
3909  fTree->Branch("reco_daughter_allTrack_vertex_michel_score",
3911  fTree->Branch("reco_daughter_allTrack_vertex_nHits",
3913  //////
3914 
3915  fTree->Branch("reco_daughter_allShower_ID", &reco_daughter_allShower_ID);
3916  fTree->Branch("reco_daughter_allShower_len", &reco_daughter_allShower_len);
3917  fTree->Branch("reco_daughter_allShower_startX", &reco_daughter_allShower_startX);
3918  fTree->Branch("reco_daughter_allShower_startY", &reco_daughter_allShower_startY);
3919  fTree->Branch("reco_daughter_allShower_startZ", &reco_daughter_allShower_startZ);
3920  fTree->Branch("reco_daughter_allShower_dirX", &reco_daughter_allShower_dirX);
3921  fTree->Branch("reco_daughter_allShower_dirY", &reco_daughter_allShower_dirY);
3922  fTree->Branch("reco_daughter_allShower_dirZ", &reco_daughter_allShower_dirZ);
3923  fTree->Branch("reco_daughter_allShower_energy", &reco_daughter_allShower_energy);
3924 
3925 
3926 /*
3927  fTree->Branch("reco_daughter_shower_true_byE_PDG", &reco_daughter_shower_true_byE_PDG);
3928  fTree->Branch("reco_daughter_shower_true_byE_ID", &reco_daughter_shower_true_byE_ID);
3929  fTree->Branch("reco_daughter_shower_true_byE_origin", &reco_daughter_shower_true_byE_origin);
3930  fTree->Branch("reco_daughter_shower_true_byE_parID", &reco_daughter_shower_true_byE_parID);
3931  fTree->Branch("reco_daughter_shower_true_byE_parPDG", &reco_daughter_shower_true_byE_parPDG);
3932 
3933  fTree->Branch("reco_daughter_shower_true_byE_startPx", &reco_daughter_shower_true_byE_startPx);
3934  fTree->Branch("reco_daughter_shower_true_byE_startPy", &reco_daughter_shower_true_byE_startPy);
3935  fTree->Branch("reco_daughter_shower_true_byE_startPz", &reco_daughter_shower_true_byE_startPz);
3936  fTree->Branch("reco_daughter_shower_true_byE_startP", &reco_daughter_shower_true_byE_startP);
3937  fTree->Branch("reco_daughter_shower_true_byE_endProcess", &reco_daughter_shower_true_byE_endProcess);
3938 
3939 
3940  fTree->Branch("reco_daughter_shower_true_byHits_PDG", &reco_daughter_shower_true_byHits_PDG);
3941  fTree->Branch("reco_daughter_shower_true_byHits_ID", &reco_daughter_shower_true_byHits_ID);
3942  fTree->Branch("reco_daughter_shower_true_byHits_origin", &reco_daughter_shower_true_byHits_origin);
3943  fTree->Branch("reco_daughter_shower_true_byHits_parID", &reco_daughter_shower_true_byHits_parID);
3944  fTree->Branch("reco_daughter_shower_true_byHits_parPDG", &reco_daughter_shower_true_byHits_parPDG);
3945  fTree->Branch("reco_daughter_shower_true_byHits_process", &reco_daughter_shower_true_byHits_process);
3946  fTree->Branch("reco_daughter_shower_true_byHits_purity", &reco_daughter_shower_true_byHits_purity);
3947 
3948  fTree->Branch("reco_daughter_shower_true_byHits_startPx", &reco_daughter_shower_true_byHits_startPx);
3949  fTree->Branch("reco_daughter_shower_true_byHits_startPy", &reco_daughter_shower_true_byHits_startPy);
3950  fTree->Branch("reco_daughter_shower_true_byHits_startPz", &reco_daughter_shower_true_byHits_startPz);
3951  fTree->Branch("reco_daughter_shower_true_byHits_startP", &reco_daughter_shower_true_byHits_startP);
3952  fTree->Branch("reco_daughter_shower_true_byHits_endProcess", &reco_daughter_shower_true_byHits_endProcess);
3953  */
3954 
3955 
3956  ///Reconstructed info -- daughter
3957  /*
3958  fTree->Branch("reco_daughter_showerID", &reco_daughter_showerID);
3959  fTree->Branch("reco_daughter_dQdX", &reco_daughter_dQdX);
3960  fTree->Branch("reco_daughter_dEdX", &reco_daughter_dEdX);
3961  fTree->Branch("reco_daughter_resRange", &reco_daughter_resRange);
3962  fTree->Branch("reco_daughter_shower_dQdX", &reco_daughter_shower_dQdX);
3963  fTree->Branch("reco_daughter_shower_dEdX", &reco_daughter_shower_dEdX);
3964  fTree->Branch("reco_daughter_shower_resRange", &reco_daughter_shower_resRange);
3965  fTree->Branch("reco_daughter_len", &reco_daughter_len);
3966  fTree->Branch("reco_daughter_startX", &reco_daughter_startX);
3967  fTree->Branch("reco_daughter_startY", &reco_daughter_startY);
3968  fTree->Branch("reco_daughter_startZ", &reco_daughter_startZ);
3969  fTree->Branch("reco_daughter_endX", &reco_daughter_endX);
3970  fTree->Branch("reco_daughter_endY", &reco_daughter_endY);
3971  fTree->Branch("reco_daughter_endZ", &reco_daughter_endZ);
3972  fTree->Branch("reco_daughter_deltaR", &reco_daughter_deltaR);
3973 
3974  fTree->Branch("reco_daughter_dR", &reco_daughter_dR);
3975  fTree->Branch("reco_daughter_to_vertex", &reco_daughter_to_vertex);
3976  fTree->Branch("reco_daughter_slice", &reco_daughter_slice);
3977 
3978  fTree->Branch("reco_daughter_shower_to_vertex", &reco_daughter_shower_to_vertex);
3979 
3980  fTree->Branch("reco_daughter_shower_startX", &reco_daughter_shower_startX);
3981  fTree->Branch("reco_daughter_shower_startY", &reco_daughter_shower_startY);
3982  fTree->Branch("reco_daughter_shower_startZ", &reco_daughter_shower_startZ);
3983  fTree->Branch("reco_daughter_shower_len", &reco_daughter_shower_len);
3984  */
3985 
3986 
3987  fTree->Branch("reco_daughter_PFP_ID", &reco_daughter_PFP_ID);
3988  fTree->Branch("reco_daughter_PFP_nHits", &reco_daughter_PFP_nHits);
3989  fTree->Branch("reco_daughter_PFP_nHits_collection",
3991  fTree->Branch("reco_daughter_PFP_trackScore", &reco_daughter_PFP_trackScore);
3992  fTree->Branch("reco_daughter_PFP_emScore", &reco_daughter_PFP_emScore);
3993  fTree->Branch("reco_daughter_PFP_michelScore", &reco_daughter_PFP_michelScore);
3994  fTree->Branch("reco_daughter_PFP_trackScore_collection", &reco_daughter_PFP_trackScore_collection);
3995  fTree->Branch("reco_daughter_PFP_emScore_collection", &reco_daughter_PFP_emScore_collection);
3996  fTree->Branch("reco_daughter_PFP_michelScore_collection", &reco_daughter_PFP_michelScore_collection);
3997 
3998 
3999 
4000 
4001  fTree->Branch("true_beam_PDG", &true_beam_PDG);
4002  fTree->Branch("true_beam_ID", &true_beam_ID);
4003  fTree->Branch("true_beam_endProcess", &true_beam_endProcess);
4004  fTree->Branch("true_beam_endX", &true_beam_endX);
4005  fTree->Branch("true_beam_endY", &true_beam_endY);
4006  fTree->Branch("true_beam_endZ", &true_beam_endZ);
4007  fTree->Branch("true_beam_startX", &true_beam_startX);
4008  fTree->Branch("true_beam_startY", &true_beam_startY);
4009  fTree->Branch("true_beam_startZ", &true_beam_startZ);
4010 
4011  fTree->Branch("true_beam_startPx", &true_beam_startPx);
4012  fTree->Branch("true_beam_startPy", &true_beam_startPy);
4013  fTree->Branch("true_beam_startPz", &true_beam_startPz);
4014  fTree->Branch("true_beam_startP", &true_beam_startP);
4015 
4016  fTree->Branch("true_beam_endPx", &true_beam_endPx);
4017  fTree->Branch("true_beam_endPy", &true_beam_endPy);
4018  fTree->Branch("true_beam_endPz", &true_beam_endPz);
4019  fTree->Branch("true_beam_endP", &true_beam_endP);
4020 
4021  fTree->Branch("true_beam_startDirX", &true_beam_startDirX);
4022  fTree->Branch("true_beam_startDirY", &true_beam_startDirY);
4023  fTree->Branch("true_beam_startDirZ", &true_beam_startDirZ);
4024 
4025  fTree->Branch("true_beam_nElasticScatters", &true_beam_nElasticScatters);
4026  fTree->Branch("true_beam_elastic_costheta", &true_beam_elastic_costheta);
4027  fTree->Branch("true_beam_elastic_X", &true_beam_elastic_X);
4028  fTree->Branch("true_beam_elastic_Y", &true_beam_elastic_Y);
4029  fTree->Branch("true_beam_elastic_Z", &true_beam_elastic_Z);
4030  fTree->Branch("true_beam_elastic_deltaE", &true_beam_elastic_deltaE);
4031  fTree->Branch("true_beam_elastic_IDE_edep", &true_beam_elastic_IDE_edep);
4032  fTree->Branch("true_beam_IDE_totalDep", &true_beam_IDE_totalDep);
4033  fTree->Branch("true_beam_IDE_found_in_recoVtx", &true_beam_IDE_found_in_recoVtx);
4034 
4035  fTree->Branch("true_beam_nHits", &true_beam_nHits);
4036  fTree->Branch("true_beam_reco_byHits_PFP_ID", &true_beam_reco_byHits_PFP_ID);
4037  fTree->Branch("true_beam_reco_byHits_PFP_nHits", &true_beam_reco_byHits_PFP_nHits);
4038  fTree->Branch("true_beam_reco_byHits_allTrack_ID", &true_beam_reco_byHits_allTrack_ID);
4039 
4040  fTree->Branch("true_daughter_nPi0", &true_daughter_nPi0);
4041  fTree->Branch("true_daughter_nPiPlus", &true_daughter_nPiPlus);
4042  fTree->Branch("true_daughter_nProton", &true_daughter_nProton);
4043  fTree->Branch("true_daughter_nNeutron", &true_daughter_nNeutron);
4044  fTree->Branch("true_daughter_nPiMinus", &true_daughter_nPiMinus);
4045  fTree->Branch("true_daughter_nNucleus", &true_daughter_nNucleus);
4046 
4047  fTree->Branch("reco_beam_vertex_slice", &reco_beam_vertex_slice);
4048 
4049  fTree->Branch("true_beam_daughter_PDG", &true_beam_daughter_PDG);
4050  fTree->Branch("true_beam_daughter_ID", &true_beam_daughter_ID);
4051  fTree->Branch("true_beam_daughter_len", &true_beam_daughter_len);
4052  fTree->Branch("true_beam_daughter_startX", &true_beam_daughter_startX);
4053  fTree->Branch("true_beam_daughter_startY", &true_beam_daughter_startY);
4054  fTree->Branch("true_beam_daughter_startZ", &true_beam_daughter_startZ);
4055  fTree->Branch("true_beam_daughter_startPx", &true_beam_daughter_startPx);
4056  fTree->Branch("true_beam_daughter_startPy", &true_beam_daughter_startPy);
4057  fTree->Branch("true_beam_daughter_startPz", &true_beam_daughter_startPz);
4058  fTree->Branch("true_beam_daughter_startP", &true_beam_daughter_startP);
4059  fTree->Branch("true_beam_daughter_endX", &true_beam_daughter_endX);
4060  fTree->Branch("true_beam_daughter_endY", &true_beam_daughter_endY);
4061  fTree->Branch("true_beam_daughter_endZ", &true_beam_daughter_endZ);
4062  fTree->Branch("true_beam_daughter_Process", &true_beam_daughter_Process);
4063  fTree->Branch("true_beam_daughter_endProcess", &true_beam_daughter_endProcess);
4064  fTree->Branch("true_beam_daughter_nHits", &true_beam_daughter_nHits);
4065 
4066  fTree->Branch("true_beam_daughter_reco_byHits_PFP_ID", &true_beam_daughter_reco_byHits_PFP_ID);
4067  fTree->Branch("true_beam_daughter_reco_byHits_PFP_nHits", &true_beam_daughter_reco_byHits_PFP_nHits);
4068  fTree->Branch("true_beam_daughter_reco_byHits_PFP_trackScore", &true_beam_daughter_reco_byHits_PFP_trackScore);
4069  fTree->Branch("true_beam_daughter_reco_byHits_allTrack_ID", &true_beam_daughter_reco_byHits_allTrack_ID);
4070  fTree->Branch("true_beam_daughter_reco_byHits_allTrack_startX", &true_beam_daughter_reco_byHits_allTrack_startX);
4071  fTree->Branch("true_beam_daughter_reco_byHits_allTrack_startY", &true_beam_daughter_reco_byHits_allTrack_startY);
4072  fTree->Branch("true_beam_daughter_reco_byHits_allTrack_startZ", &true_beam_daughter_reco_byHits_allTrack_startZ);
4073  fTree->Branch("true_beam_daughter_reco_byHits_allTrack_endX", &true_beam_daughter_reco_byHits_allTrack_endX);
4074  fTree->Branch("true_beam_daughter_reco_byHits_allTrack_endY", &true_beam_daughter_reco_byHits_allTrack_endY);
4075  fTree->Branch("true_beam_daughter_reco_byHits_allTrack_endZ", &true_beam_daughter_reco_byHits_allTrack_endZ);
4076  fTree->Branch("true_beam_daughter_reco_byHits_allTrack_len", &true_beam_daughter_reco_byHits_allTrack_len);
4077 
4078  fTree->Branch("true_beam_daughter_reco_byHits_allShower_ID", &true_beam_daughter_reco_byHits_allShower_ID);
4079  fTree->Branch("true_beam_daughter_reco_byHits_allShower_startX", &true_beam_daughter_reco_byHits_allShower_startX);
4080  fTree->Branch("true_beam_daughter_reco_byHits_allShower_startY", &true_beam_daughter_reco_byHits_allShower_startY);
4081  fTree->Branch("true_beam_daughter_reco_byHits_allShower_startZ", &true_beam_daughter_reco_byHits_allShower_startZ);
4082  fTree->Branch("true_beam_daughter_reco_byHits_allShower_len", &true_beam_daughter_reco_byHits_allShower_len);
4083 
4084  fTree->Branch("true_beam_Pi0_decay_ID", &true_beam_Pi0_decay_ID);
4085  fTree->Branch("true_beam_Pi0_decay_parID", &true_beam_Pi0_decay_parID);
4086  fTree->Branch("true_beam_Pi0_decay_PDG", &true_beam_Pi0_decay_PDG);
4087  fTree->Branch("true_beam_Pi0_decay_startP", &true_beam_Pi0_decay_startP);
4088  fTree->Branch("true_beam_Pi0_decay_startPx", &true_beam_Pi0_decay_startPx);
4089  fTree->Branch("true_beam_Pi0_decay_startPy", &true_beam_Pi0_decay_startPy);
4090  fTree->Branch("true_beam_Pi0_decay_startPz", &true_beam_Pi0_decay_startPz);
4091  fTree->Branch("true_beam_Pi0_decay_startX", &true_beam_Pi0_decay_startX);
4092  fTree->Branch("true_beam_Pi0_decay_startY", &true_beam_Pi0_decay_startY);
4093  fTree->Branch("true_beam_Pi0_decay_startZ", &true_beam_Pi0_decay_startZ);
4094 
4095  fTree->Branch("true_beam_Pi0_decay_len", &true_beam_Pi0_decay_len);
4096  fTree->Branch("true_beam_Pi0_decay_nHits", &true_beam_Pi0_decay_nHits);
4097  fTree->Branch("true_beam_Pi0_decay_reco_byHits_PFP_ID", &true_beam_Pi0_decay_reco_byHits_PFP_ID);
4098  fTree->Branch("true_beam_Pi0_decay_reco_byHits_PFP_nHits", &true_beam_Pi0_decay_reco_byHits_PFP_nHits);
4099  fTree->Branch("true_beam_Pi0_decay_reco_byHits_PFP_trackScore", &true_beam_Pi0_decay_reco_byHits_PFP_trackScore);
4100 
4101  fTree->Branch("true_beam_Pi0_decay_reco_byHits_allTrack_ID", &true_beam_Pi0_decay_reco_byHits_allTrack_ID);
4102  fTree->Branch("true_beam_Pi0_decay_reco_byHits_allTrack_startX", &true_beam_Pi0_decay_reco_byHits_allTrack_startX);
4103  fTree->Branch("true_beam_Pi0_decay_reco_byHits_allTrack_startY", &true_beam_Pi0_decay_reco_byHits_allTrack_startY);
4104  fTree->Branch("true_beam_Pi0_decay_reco_byHits_allTrack_startZ", &true_beam_Pi0_decay_reco_byHits_allTrack_startZ);
4105  fTree->Branch("true_beam_Pi0_decay_reco_byHits_allTrack_endX", &true_beam_Pi0_decay_reco_byHits_allTrack_endX);
4106  fTree->Branch("true_beam_Pi0_decay_reco_byHits_allTrack_endY", &true_beam_Pi0_decay_reco_byHits_allTrack_endY);
4107  fTree->Branch("true_beam_Pi0_decay_reco_byHits_allTrack_endZ", &true_beam_Pi0_decay_reco_byHits_allTrack_endZ);
4108  fTree->Branch("true_beam_Pi0_decay_reco_byHits_allTrack_len", &true_beam_Pi0_decay_reco_byHits_allTrack_len);
4109 
4110  fTree->Branch("true_beam_Pi0_decay_reco_byHits_allShower_ID", &true_beam_Pi0_decay_reco_byHits_allShower_ID);
4111  fTree->Branch("true_beam_Pi0_decay_reco_byHits_allShower_startX", &true_beam_Pi0_decay_reco_byHits_allShower_startX);
4112  fTree->Branch("true_beam_Pi0_decay_reco_byHits_allShower_startY", &true_beam_Pi0_decay_reco_byHits_allShower_startY);
4113  fTree->Branch("true_beam_Pi0_decay_reco_byHits_allShower_startZ", &true_beam_Pi0_decay_reco_byHits_allShower_startZ);
4114  fTree->Branch("true_beam_Pi0_decay_reco_byHits_allShower_len", &true_beam_Pi0_decay_reco_byHits_allShower_len);
4115 
4116  fTree->Branch("true_beam_grand_daughter_ID", &true_beam_grand_daughter_ID);
4117  fTree->Branch("true_beam_grand_daughter_parID", &true_beam_grand_daughter_parID);
4118  fTree->Branch("true_beam_grand_daughter_PDG", &true_beam_grand_daughter_PDG);
4119  fTree->Branch("true_beam_grand_daughter_nHits", &true_beam_grand_daughter_nHits);
4120  fTree->Branch("true_beam_grand_daughter_Process", &true_beam_grand_daughter_Process);
4121  fTree->Branch("true_beam_grand_daughter_endProcess", &true_beam_grand_daughter_endProcess);
4122 
4123  ////Matching reco to truth
4124  fTree->Branch("reco_beam_true_byE_endProcess", &reco_beam_true_byE_endProcess);
4125  fTree->Branch("reco_beam_true_byE_process", &reco_beam_true_byE_process);
4126  fTree->Branch("reco_beam_true_byE_origin", &reco_beam_true_byE_origin);
4127  fTree->Branch("reco_beam_true_byE_PDG", &reco_beam_true_byE_PDG);
4128  fTree->Branch("reco_beam_true_byE_ID", &reco_beam_true_byE_ID);
4129 
4130  fTree->Branch("reco_beam_true_byHits_endProcess", &reco_beam_true_byHits_endProcess);
4131  fTree->Branch("reco_beam_true_byHits_process", &reco_beam_true_byHits_process);
4132  fTree->Branch("reco_beam_true_byHits_origin", &reco_beam_true_byHits_origin);
4133  fTree->Branch("reco_beam_true_byHits_PDG", &reco_beam_true_byHits_PDG);
4134  fTree->Branch("reco_beam_true_byHits_ID", &reco_beam_true_byHits_ID);
4135 
4136  fTree->Branch("reco_beam_true_byE_matched", &reco_beam_true_byE_matched);
4137  fTree->Branch("reco_beam_true_byHits_matched", &reco_beam_true_byHits_matched);
4138  fTree->Branch("reco_beam_true_byHits_purity", &reco_beam_true_byHits_purity);
4139 
4140  fTree->Branch("true_beam_processes", &true_beam_processes);
4141  fTree->Branch("true_beam_process_slice", &true_beam_process_slice);
4142  fTree->Branch("true_beam_process_dSlice", &true_beam_process_dSlice);
4143  fTree->Branch("true_beam_process_matched", &true_beam_process_matched);
4144  //fTree->Branch("reco_daughter_true_byE_isPrimary", &reco_daughter_true_byE_isPrimary);
4145 
4146  fTree->Branch("data_BI_P", &data_BI_P);
4147  fTree->Branch("data_BI_TOF", &data_BI_TOF);
4148  fTree->Branch("data_BI_TOF_Chan", &data_BI_TOF_Chan);
4149  fTree->Branch("data_BI_X", &data_BI_X);
4150  fTree->Branch("data_BI_Y", &data_BI_Y);
4151  fTree->Branch("data_BI_Z", &data_BI_Z);
4152  fTree->Branch("data_BI_dirX", &data_BI_dirX);
4153  fTree->Branch("data_BI_dirY", &data_BI_dirY);
4154  fTree->Branch("data_BI_dirZ", &data_BI_dirZ);
4155 
4156  fTree->Branch("data_BI_nFibersP1", &data_BI_nFibersP1);
4157  fTree->Branch("data_BI_nFibersP2", &data_BI_nFibersP2);
4158  fTree->Branch("data_BI_nFibersP3", &data_BI_nFibersP3);
4159  fTree->Branch("data_BI_PDG_candidates", &data_BI_PDG_candidates);
4160  fTree->Branch("data_BI_nTracks", &data_BI_nTracks);
4161  fTree->Branch("data_BI_nMomenta", &data_BI_nMomenta);
4162 
4163 
4164  fTree->Branch("quality_reco_view_0_hits_in_TPC5", &quality_reco_view_0_hits_in_TPC5);
4165  fTree->Branch("quality_reco_view_1_hits_in_TPC5", &quality_reco_view_1_hits_in_TPC5);
4166  fTree->Branch("quality_reco_view_2_hits_in_TPC5", &quality_reco_view_2_hits_in_TPC5);
4167  fTree->Branch("quality_reco_max_lateral", &quality_reco_max_lateral);
4168  fTree->Branch("quality_reco_max_segment", &quality_reco_max_segment);
4169  fTree->Branch("quality_reco_view_0_max_segment", &quality_reco_view_0_max_segment);
4170  fTree->Branch("quality_reco_view_1_max_segment", &quality_reco_view_1_max_segment);
4171  fTree->Branch("quality_reco_view_2_max_segment", &quality_reco_view_2_max_segment);
4172 
4173  fTree->Branch("quality_reco_view_0_wire_backtrack", &quality_reco_view_0_wire_backtrack);
4174  fTree->Branch("quality_reco_view_1_wire_backtrack", &quality_reco_view_1_wire_backtrack);
4175  fTree->Branch("quality_reco_view_2_wire_backtrack", &quality_reco_view_2_wire_backtrack);
4176 
4177  fTree->Branch("quality_reco_view_0_wire", &quality_reco_view_0_wire);
4178  fTree->Branch("quality_reco_view_1_wire", &quality_reco_view_1_wire);
4179  fTree->Branch("quality_reco_view_2_wire", &quality_reco_view_2_wire);
4180 
4181  fTree->Branch("quality_reco_view_2_z", &quality_reco_view_2_z);
4182 
4183  fTree->Branch("quality_reco_view_0_tick", &quality_reco_view_0_tick);
4184  fTree->Branch("quality_reco_view_1_tick", &quality_reco_view_1_tick);
4185  fTree->Branch("quality_reco_view_2_tick", &quality_reco_view_2_tick);
4186 
4187  fTree->Branch("reco_beam_Chi2_proton", &reco_beam_Chi2_proton);
4188  fTree->Branch("reco_beam_Chi2_ndof", &reco_beam_Chi2_ndof);
4189 
4190  fTree->Branch("reco_beam_cosmic_candidate_lower_hits", &reco_beam_cosmic_candidate_lower_hits);
4191  fTree->Branch("reco_beam_cosmic_candidate_upper_hits", &reco_beam_cosmic_candidate_upper_hits);
4192  fTree->Branch("reco_beam_cosmic_candidate_ID", &reco_beam_cosmic_candidate_ID);
4193  fTree->Branch("beam_has_cosmic_IDE", &beam_has_cosmic_IDE);
4194  fTree->Branch("cosmic_has_beam_IDE", &cosmic_has_beam_IDE);
4195  fTree->Branch("n_cosmics_with_beam_IDE", &n_cosmics_with_beam_IDE);
4196 
4197  fTree->Branch("reco_daughter_allTrack_momByRange_proton", &reco_daughter_allTrack_momByRange_proton);
4198  fTree->Branch("reco_daughter_allTrack_momByRange_muon", &reco_daughter_allTrack_momByRange_muon);
4199  fTree->Branch("reco_beam_momByRange_proton", &reco_beam_momByRange_proton);
4200  fTree->Branch("reco_beam_momByRange_muon", &reco_beam_momByRange_muon);
4201 
4202  fTree->Branch("reco_daughter_allTrack_momByRange_alt_proton", &reco_daughter_allTrack_momByRange_alt_proton);
4203  fTree->Branch("reco_daughter_allTrack_momByRange_alt_muon", &reco_daughter_allTrack_momByRange_alt_muon);
4204  fTree->Branch("reco_beam_momByRange_alt_proton", &reco_beam_momByRange_alt_proton);
4205  fTree->Branch("reco_beam_momByRange_alt_muon", &reco_beam_momByRange_alt_muon);
4206  /*
4207  fTree->Branch("reco_daughter_Chi2_proton", &reco_daughter_Chi2_proton);
4208  fTree->Branch("reco_daughter_Chi2_ndof", &reco_daughter_Chi2_ndof);
4209  fTree->Branch("reco_daughter_momByRange_proton", &reco_daughter_momByRange_proton);
4210  fTree->Branch("reco_daughter_momByRange_muon", &reco_daughter_momByRange_muon);
4211 
4212  fTree->Branch("reco_daughter_shower_Chi2_proton", &reco_daughter_shower_Chi2_proton);
4213  fTree->Branch("reco_daughter_shower_Chi2_ndof", &reco_daughter_shower_Chi2_ndof);
4214 
4215  fTree->Branch("reco_daughter_trackScore", &reco_daughter_trackScore);
4216  fTree->Branch("reco_daughter_emScore", &reco_daughter_emScore);
4217  fTree->Branch("reco_daughter_michelScore", &reco_daughter_michelScore);
4218 
4219  fTree->Branch("reco_daughter_shower_trackScore", &reco_daughter_shower_trackScore);
4220  fTree->Branch("reco_daughter_shower_emScore", &reco_daughter_shower_emScore);
4221  fTree->Branch("reco_daughter_shower_michelScore", &reco_daughter_shower_michelScore);
4222  */
4223 
4224  fTree->Branch("reco_beam_true_byE_endPx", &reco_beam_true_byE_endPx);
4225  fTree->Branch("reco_beam_true_byE_endPy", &reco_beam_true_byE_endPy);
4226  fTree->Branch("reco_beam_true_byE_endPz", &reco_beam_true_byE_endPz);
4227  fTree->Branch("reco_beam_true_byE_endE", &reco_beam_true_byE_endE);
4228  fTree->Branch("reco_beam_true_byE_endP", &reco_beam_true_byE_endP);
4229 
4230  fTree->Branch("reco_beam_true_byE_startPx", &reco_beam_true_byE_startPx);
4231  fTree->Branch("reco_beam_true_byE_startPy", &reco_beam_true_byE_startPy);
4232  fTree->Branch("reco_beam_true_byE_startPz", &reco_beam_true_byE_startPz);
4233  fTree->Branch("reco_beam_true_byE_startE", &reco_beam_true_byE_startE);
4234  fTree->Branch("reco_beam_true_byE_startP", &reco_beam_true_byE_startP);
4235 
4236 
4237  fTree->Branch("reco_beam_true_byHits_endPx", &reco_beam_true_byHits_endPx);
4238  fTree->Branch("reco_beam_true_byHits_endPy", &reco_beam_true_byHits_endPy);
4239  fTree->Branch("reco_beam_true_byHits_endPz", &reco_beam_true_byHits_endPz);
4240  fTree->Branch("reco_beam_true_byHits_endE", &reco_beam_true_byHits_endE);
4241  fTree->Branch("reco_beam_true_byHits_endP", &reco_beam_true_byHits_endP);
4242 
4243  fTree->Branch("reco_beam_true_byHits_startPx", &reco_beam_true_byHits_startPx);
4244  fTree->Branch("reco_beam_true_byHits_startPy", &reco_beam_true_byHits_startPy);
4245  fTree->Branch("reco_beam_true_byHits_startPz", &reco_beam_true_byHits_startPz);
4246  fTree->Branch("reco_beam_true_byHits_startE", &reco_beam_true_byHits_startE);
4247  fTree->Branch("reco_beam_true_byHits_startP", &reco_beam_true_byHits_startP);
4248 
4249  fTree->Branch("reco_beam_incidentEnergies", &reco_beam_incidentEnergies);
4250  fTree->Branch("reco_beam_interactingEnergy", &reco_beam_interactingEnergy);
4251  fTree->Branch("true_beam_incidentEnergies", &true_beam_incidentEnergies);
4252  fTree->Branch("true_beam_interactingEnergy", &true_beam_interactingEnergy);
4253  fTree->Branch("true_beam_slices", &true_beam_slices);
4254  fTree->Branch("true_beam_slices_found", &true_beam_slices_found);
4255  fTree->Branch("true_beam_slices_nIDEs", &true_beam_slices_nIDEs);
4256  fTree->Branch("true_beam_slices_deltaE", &true_beam_slices_deltaE);
4257  //fTree->Branch("new_true_beam_incidentEnergies", &new_true_beam_incidentEnergies);
4258  //fTree->Branch("new_true_beam_interactingEnergy", &new_true_beam_interactingEnergy);
4259  fTree->Branch("em_energy", &em_energy);
4260  fTree->Branch("true_beam_traj_X", &true_beam_traj_X);
4261  fTree->Branch("true_beam_traj_Y", &true_beam_traj_Y);
4262  fTree->Branch("true_beam_traj_Z", &true_beam_traj_Z);
4263  fTree->Branch("true_beam_traj_KE", &true_beam_traj_KE);
4264 
4265  fTree->Branch("g4rw_primary_weights", &g4rw_primary_weights);
4266  fTree->Branch("g4rw_primary_plus_sigma_weight", &g4rw_primary_plus_sigma_weight);
4267  fTree->Branch("g4rw_primary_minus_sigma_weight", &g4rw_primary_minus_sigma_weight);
4268  fTree->Branch("g4rw_primary_var", &g4rw_primary_var);
4269 
4270  //fTree->Branch("g4rw_alt_primary_weights", &g4rw_alt_primary_weights);
4271  fTree->Branch("g4rw_alt_primary_plus_sigma_weight",
4273  fTree->Branch("g4rw_alt_primary_minus_sigma_weight",
4275 
4276  if( fSaveHits ){
4277  fTree->Branch( "reco_beam_spacePts_X", &reco_beam_spacePts_X );
4278  fTree->Branch( "reco_beam_spacePts_Y", &reco_beam_spacePts_Y );
4279  fTree->Branch( "reco_beam_spacePts_Z", &reco_beam_spacePts_Z );
4280 
4281  fTree->Branch( "reco_daughter_spacePts_X", &reco_daughter_spacePts_X );
4282  fTree->Branch( "reco_daughter_spacePts_Y", &reco_daughter_spacePts_Y );
4283  fTree->Branch( "reco_daughter_spacePts_Z", &reco_daughter_spacePts_Z );
4284 
4285  fTree->Branch( "reco_daughter_shower_spacePts_X", &reco_daughter_shower_spacePts_X );
4286  fTree->Branch( "reco_daughter_shower_spacePts_Y", &reco_daughter_shower_spacePts_Y );
4287  fTree->Branch( "reco_daughter_shower_spacePts_Z", &reco_daughter_shower_spacePts_Z );
4288  }
4289 
4290 }
std::vector< double > reco_daughter_allShower_dirX
std::vector< std::vector< double > > reco_daughter_spacePts_Z
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_plane0
std::vector< int > reco_daughter_allTrack_Chi2_ndof_plane0
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_len
std::vector< int > reco_daughter_PFP_true_byHits_origin
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_allTrack_ID
std::vector< int > true_beam_slices
std::vector< double > true_beam_Pi0_decay_startPx
std::vector< int > reco_daughter_allTrack_ID
std::vector< int > true_beam_Pi0_decay_ID
std::vector< double > reco_daughter_allTrack_endX
std::vector< std::string > true_beam_grand_daughter_Process
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_PFP_trackScore
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endX
std::vector< int > reco_daughter_PFP_true_byHits_ID
std::vector< int > true_beam_Pi0_decay_parID
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endX
std::vector< double > reco_daughter_allTrack_momByRange_alt_proton
std::vector< std::string > true_beam_grand_daughter_endProcess
std::vector< std::vector< double > > reco_daughter_allTrack_dQdX_SCE
std::vector< std::string > reco_daughter_PFP_true_byHits_process
std::vector< double > reco_track_startY
std::vector< std::string > true_beam_daughter_Process
std::vector< double > reco_daughter_PFP_true_byHits_endZ
std::vector< int > true_beam_process_dSlice
std::vector< double > reco_beam_dEdX
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_allTrack_ID
std::vector< double > reco_daughter_PFP_true_byHits_startPy
std::vector< double > reco_daughter_PFP_trackScore_collection
std::vector< std::string > reco_daughter_PFP_true_byHits_endProcess
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startZ
std::vector< int > data_BI_PDG_candidates
std::vector< std::vector< double > > reco_daughter_spacePts_X
std::vector< double > reco_daughter_allTrack_endZ
std::string reco_beam_true_byHits_process
std::vector< std::string > true_beam_daughter_endProcess
std::vector< double > reco_daughter_allTrack_startZ
std::vector< double > g4rw_primary_weights
std::vector< double > reco_daughter_PFP_true_byHits_len
std::vector< double > true_beam_incidentEnergies
std::vector< double > quality_reco_view_0_tick
std::vector< double > g4rw_alt_primary_minus_sigma_weight
std::vector< int > true_beam_process_slice
std::vector< double > reco_daughter_allTrack_len
std::vector< double > data_BI_TOF
std::vector< double > true_beam_traj_Y
std::vector< double > reco_daughter_allTrack_Chi2_proton_plane0
std::vector< double > true_beam_Pi0_decay_startZ
std::vector< std::string > g4rw_primary_var
std::vector< double > true_beam_daughter_endY
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_PFP_nHits
std::vector< double > true_beam_elastic_IDE_edep
std::vector< double > reco_track_endY
std::vector< double > true_beam_daughter_startX
std::vector< double > reco_track_startX
std::vector< double > true_beam_daughter_startPx
std::vector< std::vector< int > > true_beam_reco_byHits_allTrack_ID
std::string reco_beam_true_byE_process
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_PFP_ID
std::vector< int > reco_daughter_allTrack_vertex_nHits
std::vector< double > reco_daughter_PFP_trackScore
std::vector< int > true_beam_daughter_PDG
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endZ
std::vector< double > quality_reco_view_0_wire
BR-MS.
std::vector< double > true_beam_Pi0_decay_startP
std::vector< double > reco_beam_calo_startDirZ
std::vector< int > true_beam_daughter_nHits
std::vector< double > true_beam_Pi0_decay_startPy
std::vector< double > reco_daughter_PFP_michelScore
std::vector< int > reco_track_ID
std::vector< double > reco_daughter_PFP_true_byHits_completeness
std::vector< int > cosmic_has_beam_IDE
std::vector< double > reco_daughter_PFP_true_byE_completeness
std::vector< double > true_beam_daughter_len
std::vector< int > true_beam_process_matched
std::vector< double > reco_beam_incidentEnergies
std::vector< size_t > reco_daughter_PFP_true_byHits_sharedHits
EDIT: quality.
std::vector< std::vector< double > > reco_daughter_shower_spacePts_Z
std::vector< double > reco_beam_calo_tick
std::vector< double > reco_track_endX
std::vector< size_t > reco_daughter_PFP_true_byHits_emHits
std::string reco_beam_true_byHits_endProcess
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_PFP_trackScore
std::vector< double > true_beam_daughter_startZ
std::vector< double > reco_beam_dQdX
std::vector< double > true_beam_Pi0_decay_startPz
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE_plane0
std::vector< double > reco_beam_spacePts_Y
std::vector< std::vector< double > > reco_daughter_allTrack_dEdX_SCE
std::vector< double > reco_daughter_allTrack_momByRange_alt_muon
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_len
std::vector< std::vector< double > > reco_daughter_shower_spacePts_Y
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE_plane1
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_len
std::vector< double > true_beam_elastic_costheta
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startY
std::vector< double > reco_daughter_allTrack_momByRange_proton
Reconstructed Daughter Info.
std::vector< double > reco_daughter_PFP_true_byHits_startP
std::vector< double > reco_daughter_PFP_true_byHits_startX
std::vector< double > quality_reco_view_2_tick
std::vector< double > reco_daughter_PFP_emScore
std::vector< double > reco_daughter_allShower_dirY
std::vector< double > reco_daughter_PFP_true_byHits_purity
std::vector< std::vector< double > > reco_daughter_shower_spacePts_X
std::vector< double > reco_daughter_PFP_true_byHits_endX
std::vector< double > quality_reco_view_1_wire
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startZ
std::vector< double > g4rw_primary_plus_sigma_weight
std::vector< std::vector< double > > reco_daughter_spacePts_Y
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startZ
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startX
std::vector< std::string > true_beam_processes
std::vector< double > true_beam_elastic_deltaE
std::vector< double > true_beam_daughter_startP
std::vector< double > reco_daughter_allShower_dirZ
std::vector< int > reco_daughter_PFP_true_byHits_parID
std::vector< double > reco_daughter_PFP_true_byHits_startPz
std::vector< double > g4rw_alt_primary_plus_sigma_weight
std::vector< double > reco_beam_spacePts_Z
std::vector< int > true_beam_grand_daughter_PDG
std::vector< std::vector< int > > true_beam_reco_byHits_PFP_ID
std::vector< double > reco_beam_TrkPitch
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startX
std::vector< double > reco_daughter_allTrack_momByRange_muon
std::vector< double > reco_beam_cosmic_candidate_lower_hits
std::vector< double > true_beam_elastic_X
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startY
std::vector< double > true_beam_daughter_startY
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endY
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endY
std::vector< int > reco_daughter_PFP_true_byHits_parPDG
std::vector< double > reco_daughter_PFP_true_byHits_endY
std::vector< int > reco_beam_calo_TPC
std::vector< double > reco_beam_resRange
std::vector< double > reco_daughter_PFP_michelScore_collection
std::vector< double > reco_beam_spacePts_X
Reconstructed Daughter Info.
std::vector< double > true_beam_traj_KE
std::vector< double > reco_beam_calibrated_dEdX
std::vector< int > reco_beam_hit_true_origin
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_allShower_ID
std::vector< int > true_beam_slices_found
std::vector< double > reco_beam_allTrack_calibrated_dEdX
std::vector< int > reco_daughter_PFP_true_byE_PDG
std::vector< double > reco_daughter_allShower_len
std::vector< double > reco_track_endZ
std::vector< double > reco_daughter_allShower_startZ
std::vector< int > reco_track_nHits
std::vector< int > reco_daughter_allShower_ID
std::vector< int > true_beam_grand_daughter_ID
std::vector< double > reco_daughter_allTrack_Chi2_proton
std::vector< double > quality_reco_view_2_z
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE
std::vector< int > reco_daughter_PFP_ID
Add by hits?
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_allShower_ID
std::vector< double > reco_daughter_allTrack_Theta
std::vector< double > reco_track_michel_score
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_SCE
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startZ
std::vector< int > reco_daughter_PFP_true_byHits_PDG
std::vector< double > true_beam_Pi0_decay_len
std::vector< double > reco_track_startZ
std::vector< int > reco_daughter_allTrack_Chi2_ndof_plane1
std::vector< double > reco_daughter_allTrack_startY
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startY
std::vector< double > reco_daughter_PFP_true_byHits_startY
std::vector< double > reco_beam_calo_wire_z
std::vector< int > true_beam_daughter_ID
std::vector< std::vector< int > > true_beam_reco_byHits_PFP_nHits
std::vector< double > reco_daughter_allShower_energy
std::vector< int > reco_daughter_PFP_nHits_collection
std::vector< double > true_beam_daughter_endZ
std::vector< int > reco_daughter_allTrack_Chi2_ndof
std::vector< int > reco_beam_hit_true_slice
std::vector< double > reco_beam_calo_endDirX
std::vector< double > true_beam_daughter_endX
std::vector< double > quality_reco_view_1_tick
std::vector< double > reco_daughter_PFP_true_byHits_startE
std::vector< double > reco_daughter_PFP_true_byE_purity
std::vector< double > reco_daughter_allShower_startX
std::vector< double > reco_beam_cosmic_candidate_upper_hits
std::vector< double > true_beam_traj_Z
std::vector< double > reco_daughter_allTrack_Chi2_proton_plane1
std::vector< int > reco_beam_hit_true_ID
std::vector< double > true_beam_Pi0_decay_startX
std::vector< double > true_beam_daughter_startPy
std::vector< int > true_beam_Pi0_decay_nHits
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_plane1
std::vector< double > reco_daughter_allTrack_vertex_michel_score
std::vector< double > true_beam_elastic_Z
std::vector< int > reco_beam_cosmic_candidate_ID
std::vector< int > true_beam_grand_daughter_nHits
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_len
std::vector< double > true_beam_slices_deltaE
std::vector< int > true_beam_Pi0_decay_PDG
std::vector< double > reco_daughter_PFP_true_byHits_startZ
std::vector< double > reco_beam_calo_endDirZ
std::vector< double > reco_daughter_allTrack_to_vertex
std::vector< double > true_beam_elastic_Y
std::vector< double > reco_beam_calo_startDirX
std::string reco_beam_true_byE_endProcess
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_PFP_nHits
std::vector< double > reco_beam_calo_endDirY
std::vector< double > reco_daughter_allTrack_dR
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startX
std::vector< double > reco_daughter_allTrack_endY
std::vector< double > reco_daughter_allTrack_Phi
std::vector< double > reco_beam_calo_startDirY
std::vector< double > reco_daughter_allShower_startY
std::vector< double > true_beam_daughter_startPz
std::vector< double > reco_daughter_allTrack_alt_len
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endZ
std::vector< double > quality_reco_view_2_wire
std::vector< double > true_beam_Pi0_decay_startY
std::vector< double > reco_daughter_PFP_true_byHits_startPx
std::vector< double > true_beam_traj_X
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startX
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_PFP_ID
std::vector< double > reco_daughter_PFP_emScore_collection
std::vector< double > g4rw_primary_minus_sigma_weight
std::vector< int > true_beam_grand_daughter_parID
std::vector< double > reco_beam_calo_wire
std::vector< double > reco_beam_allTrack_resRange
Event finding and building.
std::vector< double > reco_daughter_allTrack_startX
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startY
std::vector< int > data_BI_TOF_Chan
std::vector< int > reco_daughter_PFP_nHits
std::vector< int > true_beam_slices_nIDEs
std::vector< double > reco_daughter_PFP_true_byE_len
std::vector< G4ReweightTraj * > pionana::PionAnalyzer::CreateNRWTrajs ( const simb::MCParticle part,
const sim::ParticleList &  plist,
art::ServiceHandle< geo::Geometry geo_serv,
int  event 
)
private

Definition at line 4927 of file PionAnalyzer_module.cc.

4929  {
4930  std::vector<G4ReweightTraj *> results;
4931 
4932 
4933  //Create process map
4934  auto procs = part.Trajectory().TrajectoryProcesses();
4935  std::map<size_t, std::string> proc_map;
4936  for (auto it = procs.begin(); it != procs.end(); ++it) {
4937  proc_map[it->first] = part.Trajectory().KeyToProcess(it->second);
4938  }
4939 
4940  std::vector<double> traj_X, traj_Y, traj_Z;
4941  //std::vector<double> traj_PX, traj_PY, traj_PZ;
4942  //std::vector<size_t> elastic_indices;
4943 
4944  std::vector<std::pair<size_t, size_t>> ranges;
4945 
4946  //bool found_last = false;
4947  bool found_LAr = false;
4948  size_t start = 0, end = 0;
4949  //G4ReweightTraj theTraj(part.TrackId(), part.PdgCode(), 0, event, {0,0});
4950  for (size_t i = 0; i < part.NumberTrajectoryPoints(); ++i) {
4951  double x = part.Position(i).X();
4952  double y = part.Position(i).Y();
4953  double z = part.Position(i).Z();
4954 
4955  geo::Point_t test_point{x, y, z};
4956  const TGeoMaterial * test_material = geo_serv->Material(test_point);
4957 
4958  if (!strcmp(test_material->GetName(), "LAr")) {
4959  if (fVerbose) {
4960  std::cout << i << " " << "LAr: " << test_material->GetDensity() << " " <<
4961  test_material->GetA() << " " << test_material->GetZ() <<
4962  " " << x << " " << y << " " << z <<
4963  std::endl;
4964  }
4965 
4966  if (!found_LAr) {
4967  found_LAr = true;
4968  start = i;
4969  }
4970 
4971  //traj_PX.push_back(part.Px(i));
4972  //traj_PY.push_back(part.Py(i));
4973  //traj_PZ.push_back(part.Pz(i));
4974 
4975  //auto itProc = proc_map.find(i);
4976  //if (itProc != proc_map.end() && itProc->second == "hadElastic") {
4977  // elastic_indices.push_back(i);
4978  //}
4979  }
4980  else {
4981  if (fVerbose) {
4982  std::cout << i << " " << test_material->GetName() << " " <<
4983  test_material->GetDensity() << " " <<
4984  test_material->GetA() << " " << test_material->GetZ() <<
4985  " " << x << " " << y << " " << z <<
4986  std::endl;
4987  }
4988  if (found_LAr) {
4989  found_LAr = false;
4990  end = i;
4991  ranges.push_back({start, end});
4992  }
4993  }
4994 
4995  //if (i == part.NumberTrajectoryPoints() - 1)
4996  // found_last = true;
4997  }
4998  if (found_LAr) {
4999  //size_t np = part.NumberTrajectoryPoints();
5000  ranges.push_back({start, part.NumberTrajectoryPoints() - 1});
5001  //double x = part.Position(np - 1).X();
5002  //double y = part.Position(np - 1).Y();
5003  //double z = part.Position(np - 1).Z();
5004  }
5005 
5006  double mass = 0.;
5007 
5008  switch (abs(part.PdgCode())) {
5009  case 211: {
5010  mass = 139.57;
5011  break;
5012  }
5013  case 2212: {
5014  mass = 938.28;
5015  break;
5016  }
5017  default: {
5018  return results;
5019  break;
5020  }
5021  }
5022 
5023  for (size_t i = 0; i < ranges.size(); ++i) {
5024  //std::cout << ranges[i].first << " " << ranges[i].second << std::endl;
5025  G4ReweightTraj * theTraj = new G4ReweightTraj(i, part.PdgCode(), 0, event, {0,0});
5026 
5027  for (size_t j = ranges[i].first; j < ranges[i].second; ++j) {
5028  double dx = part.Position(j+1).X() - part.Position(j).X();
5029  double dy = part.Position(j+1).Y() - part.Position(j).Y();
5030  double dz = part.Position(j+1).Z() - part.Position(j).Z();
5031 
5032  double len = sqrt(dx*dx + dy*dy + dz*dz);
5033 
5034  double preStepP[3] = {part.Px(j)*1.e3,
5035  part.Py(j)*1.e3,
5036  part.Pz(j)*1.e3};
5037 
5038  double postStepP[3] = {part.Px(j + 1)*1.e3,
5039  part.Py(j + 1)*1.e3,
5040  part.Pz(j + 1)*1.e3};
5041  if (j == ranges[i].first) {
5042  double p_squared = preStepP[0]*preStepP[0] + preStepP[1]*preStepP[1] +
5043  preStepP[2]*preStepP[2];
5044  theTraj->SetEnergy(sqrt(p_squared + mass*mass));
5045  }
5046 
5047  //prochere
5048  auto itProc = proc_map.find(j);
5049  std::string proc = "default";
5050  if (itProc != proc_map.end() &&
5051  j != (part.NumberTrajectoryPoints() - 2)) {
5052  proc = itProc->second;
5053  }
5054  //- 2 because the last element is the end of the last step
5055  else if (j == (part.NumberTrajectoryPoints() - 2)) {
5056  proc = part.EndProcess();
5057  }
5058  //std::cout << j << " Proc: " << proc << std::endl;
5059  G4ReweightStep * step = new G4ReweightStep(i, part.PdgCode(),
5060  0, event, preStepP, postStepP,
5061  len, proc);
5062  theTraj->AddStep(step);
5063  }
5064 
5065  results.push_back(theTraj);
5066  }
5067 
5068  if (results.size()) {
5069  //Loop over daughters
5070  for (int i = 0; i < part.NumberDaughters(); ++i) {
5071  int d_index = part.Daughter(i);
5072  auto d_part = plist[d_index];
5073 
5074  int d_PDG = d_part->PdgCode();
5075  int d_ID = d_part->TrackId();
5076 
5077  results.back()->AddChild(new G4ReweightTraj(d_ID, d_PDG,
5078  results.size() - 1, event, {0,0}));
5079  }
5080  }
5081  return results;
5082 }
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
unsigned int NumberTrajectoryPoints() const
Definition: MCParticle.h:217
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:218
int PdgCode() const
Definition: MCParticle.h:211
double Py(const int i=0) const
Definition: MCParticle.h:230
std::string string
Definition: nybbler.cc:12
const simb::MCTrajectory & Trajectory() const
Definition: MCParticle.h:252
std::string KeyToProcess(unsigned char const &key) const
double Px(const int i=0) const
Definition: MCParticle.h:229
int NumberDaughters() const
Definition: MCParticle.h:216
int Daughter(const int i) const
Definition: MCParticle.cxx:112
double y
T abs(T value)
std::string EndProcess() const
Definition: MCParticle.h:215
double z
ProcessMap const & TrajectoryProcesses() const
Definition: MCTrajectory.h:187
int strcmp(const String &s1, const String &s2)
Definition: relates.cpp:14
double Pz(const int i=0) const
Definition: MCParticle.h:231
TGeoMaterial const * Material(geo::Point_t const &point) const
Returns the material at the specified position.
list x
Definition: train.py:276
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
QTextStream & endl(QTextStream &s)
bool pionana::PionAnalyzer::CreateRWTraj ( const simb::MCParticle part,
const sim::ParticleList &  plist,
art::ServiceHandle< geo::Geometry geo_serv,
int  event,
G4ReweightTraj *  theTraj 
)
private

Definition at line 4796 of file PionAnalyzer_module.cc.

4799  {
4800 
4801  //Loop over daughters
4802  for (int i = 0; i < part.NumberDaughters(); ++i) {
4803  int d_index = part.Daughter(i);
4804  auto d_part = plist[d_index];
4805 
4806  int d_PDG = d_part->PdgCode();
4807  int d_ID = d_part->TrackId();
4808 
4809  theTraj->AddChild(new G4ReweightTraj(d_ID, d_PDG, part.TrackId(),
4810  event, {0,0}));
4811  }
4812 
4813  //Create process map
4814  auto procs = part.Trajectory().TrajectoryProcesses();
4815  std::map<size_t, std::string> proc_map;
4816  for (auto it = procs.begin(); it != procs.end(); ++it) {
4817  proc_map[it->first] = part.Trajectory().KeyToProcess(it->second);
4818  }
4819 
4820  std::vector<double> traj_X, traj_Y, traj_Z;
4821  std::vector<double> traj_PX, traj_PY, traj_PZ;
4822  std::vector<size_t> elastic_indices;
4823 
4824  bool found_last = false;
4825  //G4ReweightTraj theTraj(part.TrackId(), part.PdgCode(), 0, event, {0,0});
4826  for (size_t i = 0; i < part.NumberTrajectoryPoints(); ++i) {
4827  double x = part.Position(i).X();
4828  double y = part.Position(i).Y();
4829  double z = part.Position(i).Z();
4830 
4831  geo::Point_t test_point{x, y, z};
4832  const TGeoMaterial * test_material = geo_serv->Material(test_point);
4833 
4834  if (!strcmp(test_material->GetName(), "LAr")) {
4835  traj_X.push_back(x);
4836  traj_Y.push_back(y);
4837  traj_Z.push_back(z);
4838 
4839  traj_PX.push_back(part.Px(i));
4840  traj_PY.push_back(part.Py(i));
4841  traj_PZ.push_back(part.Pz(i));
4842 
4843  auto itProc = proc_map.find(i);
4844  if (itProc != proc_map.end() && itProc->second == "hadElastic") {
4845  elastic_indices.push_back(i);
4846  }
4847  if (fVerbose) {
4848  std::cout << "LAr: " << test_material->GetDensity() << " " <<
4849  test_material->GetA() << " " << test_material->GetZ() <<
4850  " " << x << " " << y << " " << z << " " << part.P(i);
4851  if (itProc != proc_map.end())
4852  std::cout << " " << itProc->second;
4853  std::cout << std::endl;
4854  }
4855  }
4856  else if (fVerbose) {
4857  auto itProc = proc_map.find(i);
4858  std::cout << test_material->GetName() << " " <<
4859  test_material->GetDensity() << " " <<
4860  test_material->GetA() << " " << test_material->GetZ() <<
4861  " " << x << " " << y << " " << z;
4862  if (itProc != proc_map.end())
4863  std::cout << " " << itProc->second;
4864  std::cout << std::endl;
4865  }
4866 
4867  if (i == part.NumberTrajectoryPoints() - 1)
4868  found_last = true;
4869  }
4870 
4871  double mass = 0.;
4872 
4873  switch (abs(part.PdgCode())) {
4874  case 211: {
4875  mass = 139.57;
4876  break;
4877  }
4878  case 2212: {
4879  mass = 938.28;
4880  break;
4881  }
4882  default: {
4883  return false;
4884  break;
4885  }
4886  }
4887 
4888  for (size_t i = 1; i < traj_X.size(); ++i) {
4889  std::string proc = "default";
4890  if (found_last && i == traj_X.size() - 1) {
4891  proc = part.EndProcess();
4892  }
4893  else if (std::find(elastic_indices.begin(), elastic_indices.end(), i) !=
4894  elastic_indices.end()){
4895  proc = "hadElastic";
4896  }
4897 
4898  double dX = traj_X[i] - traj_X[i-1];
4899  double dY = traj_Y[i] - traj_Y[i-1];
4900  double dZ = traj_Z[i] - traj_Z[i-1];
4901 
4902  double len = sqrt(dX*dX + dY*dY + dZ*dZ);
4903 
4904  double preStepP[3] = {traj_PX[i-1]*1.e3,
4905  traj_PY[i-1]*1.e3,
4906  traj_PZ[i-1]*1.e3};
4907 
4908  double postStepP[3] = {traj_PX[i]*1.e3,
4909  traj_PY[i]*1.e3,
4910  traj_PZ[i]*1.e3};
4911  if (i == 1) {
4912  double p_squared = preStepP[0]*preStepP[0] + preStepP[1]*preStepP[1] +
4913  preStepP[2]*preStepP[2];
4914  theTraj->SetEnergy(sqrt(p_squared + mass*mass));
4915  }
4916 
4917  G4ReweightStep * step = new G4ReweightStep(part.TrackId(), part.PdgCode(),
4918  0, event, preStepP, postStepP,
4919  len, proc);
4920  theTraj->AddStep(step);
4921  }
4922 
4923  return true;
4924 }
unsigned int NumberTrajectoryPoints() const
Definition: MCParticle.h:217
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:218
int PdgCode() const
Definition: MCParticle.h:211
double Py(const int i=0) const
Definition: MCParticle.h:230
std::string string
Definition: nybbler.cc:12
const simb::MCTrajectory & Trajectory() const
Definition: MCParticle.h:252
std::string KeyToProcess(unsigned char const &key) const
double Px(const int i=0) const
Definition: MCParticle.h:229
int NumberDaughters() const
Definition: MCParticle.h:216
int TrackId() const
Definition: MCParticle.h:209
int Daughter(const int i) const
Definition: MCParticle.cxx:112
double y
T abs(T value)
std::string EndProcess() const
Definition: MCParticle.h:215
double P(const int i=0) const
Definition: MCParticle.h:233
double z
ProcessMap const & TrajectoryProcesses() const
Definition: MCTrajectory.h:187
int strcmp(const String &s1, const String &s2)
Definition: relates.cpp:14
double Pz(const int i=0) const
Definition: MCParticle.h:231
TGeoMaterial const * Material(geo::Point_t const &point) const
Returns the material at the specified position.
list x
Definition: train.py:276
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
QTextStream & endl(QTextStream &s)
void pionana::PionAnalyzer::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 4292 of file PionAnalyzer_module.cc.

4293 {
4294  dEdX_template_file.Close();
4295 }
double pionana::PionAnalyzer::lateralDist ( TVector3 &  n,
TVector3 &  x0,
TVector3 &  p 
)

Definition at line 4297 of file PionAnalyzer_module.cc.

4297  {
4298  TVector3 x = ( (p - x0)*n )*n;
4299  return (x - (p - x0)).Mag();
4300 }
std::void_t< T > n
p
Definition: test.py:223
list x
Definition: train.py:276
PionAnalyzer& pionana::PionAnalyzer::operator= ( PionAnalyzer const &  )
delete
PionAnalyzer& pionana::PionAnalyzer::operator= ( PionAnalyzer &&  )
delete
void pionana::PionAnalyzer::reset ( )

Definition at line 4302 of file PionAnalyzer_module.cc.

4303 {
4304  reco_beam_startX = -1;
4305  reco_beam_startY = -1;
4306  reco_beam_startZ = -1;
4307  reco_beam_endX = -1;
4308  reco_beam_endY = -1;
4309  reco_beam_endZ = -1;
4310  reco_beam_flipped = false;
4311  reco_beam_trackEndDirX = -999;
4312  reco_beam_trackEndDirY = -999;
4313  reco_beam_trackEndDirZ = -999;
4314  reco_beam_trackDirX = -999;
4315  reco_beam_trackDirY = -999;
4316  reco_beam_trackDirZ = -999;
4317 
4318  reco_beam_len = -1;
4319  reco_beam_alt_len = -1;
4320  reco_beam_calo_startX = -1;
4321  reco_beam_calo_startY = -1;
4322  reco_beam_calo_startZ = -1;
4323  reco_beam_calo_endX = -1;
4324  reco_beam_calo_endY = -1;
4325  reco_beam_calo_endZ = -1;
4326  reco_beam_calo_startDirX.clear();
4327  reco_beam_calo_startDirY.clear();
4328  reco_beam_calo_startDirZ.clear();
4329  reco_beam_calo_endDirX.clear();
4330  reco_beam_calo_endDirY.clear();
4331  reco_beam_calo_endDirZ.clear();
4332 
4333  reco_track_startX.clear();
4334  reco_track_startY.clear();
4335  reco_track_startZ.clear();
4336  reco_track_endX.clear();
4337  reco_track_endY.clear();
4338  reco_track_endZ.clear();
4339  reco_track_michel_score.clear();
4340  reco_track_ID.clear();
4341  reco_track_nHits.clear();
4342 
4343  reco_beam_type = -1;
4345 
4347 
4348  true_daughter_nPi0 = 0;
4354 
4359 
4360  true_beam_PDG = 0;
4361  true_beam_ID = 0;
4363  true_beam_endX = 0.;
4364  true_beam_endY = 0.;
4365  true_beam_endZ = 0.;
4366  true_beam_startX = 0.;
4367  true_beam_startY = 0.;
4368  true_beam_startZ = 0.;
4369 
4370  true_beam_startPx = 0.;
4371  true_beam_startPy = 0.;
4372  true_beam_startPz = 0.;
4373  true_beam_startP = 0.;
4374 
4375  true_beam_endPx = 0.;
4376  true_beam_endPy = 0.;
4377  true_beam_endPz = 0.;
4378  true_beam_endP = 0.;
4379 
4380  true_beam_startDirX = 0.;
4381  true_beam_startDirY = 0.;
4382  true_beam_startDirZ = 0.;
4383  true_beam_nHits = -1;
4384 
4385 
4386  true_beam_processes.clear();
4387  true_beam_process_slice.clear();
4388  true_beam_process_dSlice.clear();
4389  true_beam_process_matched.clear();
4392  true_beam_elastic_X.clear();
4393  true_beam_elastic_Y.clear();
4394  true_beam_elastic_Z.clear();
4395  true_beam_elastic_deltaE.clear();
4399 
4403 
4407 
4413 
4419 
4423 
4429 
4435 
4439 
4440 
4441  //reco_daughter_true_byE_isPrimary = false;
4442  reco_beam_Chi2_proton = 999.;
4443 
4447  beam_has_cosmic_IDE = false;
4448  cosmic_has_beam_IDE.clear();
4450 
4451 
4452  data_BI_P = 0.;
4453  data_BI_X = 0.;
4454  data_BI_Y = 0.;
4455  data_BI_Z = 0.;
4456  data_BI_dirX = 0.;
4457  data_BI_dirY = 0.;
4458  data_BI_dirZ = 0.;
4459  data_BI_nFibersP1 = 0;
4460  data_BI_nFibersP2 = 0;
4461  data_BI_nFibersP3 = 0;
4462  data_BI_PDG_candidates.clear();
4463  data_BI_TOF.clear();
4464  data_BI_TOF_Chan.clear();
4465  data_BI_nTracks = -1;
4466  data_BI_nMomenta = -1;
4467 
4468 
4472  quality_reco_max_lateral = -999.;
4473  quality_reco_max_segment = -999.;
4474 
4478 
4479  quality_reco_view_0_wire.clear();
4480  quality_reco_view_1_wire.clear();
4481  quality_reco_view_2_wire.clear();
4482 
4483  quality_reco_view_2_z.clear();
4484 
4485  quality_reco_view_0_tick.clear();
4486  quality_reco_view_1_tick.clear();
4487  quality_reco_view_2_tick.clear();
4488 
4492 
4493  reco_beam_Chi2_ndof = -1;
4494 
4498  reco_beam_momByRange_muon = -999.;
4499 
4504 
4505  true_beam_daughter_PDG.clear();
4506  true_beam_daughter_len.clear();
4507  true_beam_daughter_startX.clear();
4508  true_beam_daughter_startY.clear();
4509  true_beam_daughter_startZ.clear();
4513  true_beam_daughter_startP.clear();
4514  true_beam_daughter_endX.clear();
4515  true_beam_daughter_endY.clear();
4516  true_beam_daughter_endZ.clear();
4519  true_beam_daughter_nHits.clear();
4520 
4524 
4533 
4539 
4540  true_beam_Pi0_decay_ID.clear();
4541  true_beam_Pi0_decay_parID.clear();
4549  true_beam_Pi0_decay_PDG.clear();
4550  true_beam_Pi0_decay_len.clear();
4551  true_beam_Pi0_decay_nHits.clear();
4555 
4564 
4570 
4577  true_beam_daughter_ID.clear();
4578 
4581 
4582  reco_daughter_PFP_ID.clear();
4583  reco_daughter_PFP_nHits.clear();
4586  reco_daughter_PFP_emScore.clear();
4591 
4592  reco_beam_PFP_ID = -999;
4593  reco_beam_PFP_nHits = -999;
4594  reco_beam_PFP_trackScore = -999;
4595  reco_beam_PFP_emScore = -999;
4600 
4601  reco_beam_allTrack_ID = -999;
4604  reco_beam_allTrack_len = -999;
4608  reco_beam_allTrack_endX = -999;
4609  reco_beam_allTrack_endY = -999;
4610  reco_beam_allTrack_endZ = -999;
4621 
4622 
4623 
4624 
4625  reco_beam_dQdX.clear();
4626  reco_beam_dEdX.clear();
4627  reco_beam_calibrated_dEdX.clear();
4628  reco_beam_vtxX = -1.;
4629  reco_beam_vtxY = -1.;
4630  reco_beam_vtxZ = -1.;
4633  /*
4634  reco_daughter_startX.clear();
4635  reco_daughter_startY.clear();
4636  reco_daughter_startZ.clear();
4637  reco_daughter_endX.clear();
4638  reco_daughter_endY.clear();
4639  reco_daughter_endZ.clear();
4640  reco_daughter_deltaR.clear();
4641  reco_daughter_dR.clear();
4642  reco_daughter_to_vertex.clear();
4643  reco_daughter_slice.clear();
4644 
4645  reco_daughter_shower_to_vertex.clear();
4646 
4647  reco_daughter_shower_startX.clear();
4648  reco_daughter_shower_startY.clear();
4649  reco_daughter_shower_startZ.clear();
4650 
4651  reco_daughter_shower_len.clear();
4652  */
4653 
4654  reco_beam_resRange.clear();
4655  reco_beam_TrkPitch.clear();
4656  reco_beam_calo_wire.clear();
4657  reco_beam_calo_wire_z.clear();
4658  reco_beam_calo_tick.clear();
4659  reco_beam_calo_TPC.clear();
4660  reco_beam_hit_true_ID.clear();
4661  reco_beam_hit_true_origin.clear();
4662  reco_beam_hit_true_slice.clear();
4663 
4664  reco_beam_trackID = -1;
4665 
4669  //new_true_beam_incidentEnergies.clear();
4670  true_beam_slices.clear();
4671  true_beam_slices_found.clear();
4672  true_beam_slices_nIDEs.clear();
4673  true_beam_slices_deltaE.clear();
4675  //new_true_beam_interactingEnergy = -999.;
4676  em_energy = 0.;
4677  true_beam_traj_X.clear();
4678  true_beam_traj_Y.clear();
4679  true_beam_traj_Z.clear();
4680  true_beam_traj_KE.clear();
4681 
4682  //Alternative Reco
4691 
4699 
4708 
4713 
4714 
4715 
4716  reco_daughter_allTrack_ID.clear();
4717  //reco_daughter_allTrack_dEdX.clear();
4718  //reco_daughter_allTrack_dQdX.clear();
4719  //reco_daughter_allTrack_resRange.clear();
4723 
4724 
4725  //Calorimetry + chi2 for planes 0 and 1
4728 
4731 
4734 
4737  ///////////////////////////////////////////
4738 
4739 
4740  //reco_daughter_allTrack_calibrated_dEdX.clear();
4742 
4745 
4756  reco_daughter_allTrack_dR.clear();
4760 
4766 
4771  ///////
4772 
4773 
4774  //New Hits info
4775  reco_beam_spacePts_X.clear();
4776  reco_beam_spacePts_Y.clear();
4777  reco_beam_spacePts_Z.clear();
4778 
4779  reco_daughter_spacePts_X.clear();
4780  reco_daughter_spacePts_Y.clear();
4781  reco_daughter_spacePts_Z.clear();
4782 
4786  //
4787 
4788  g4rw_primary_weights.clear();
4791  g4rw_primary_var.clear();
4794 }
std::vector< double > reco_daughter_allShower_dirX
std::vector< std::vector< double > > reco_daughter_spacePts_Z
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_plane0
std::vector< int > reco_daughter_allTrack_Chi2_ndof_plane0
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_len
std::vector< int > reco_daughter_PFP_true_byHits_origin
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_allTrack_ID
std::vector< int > true_beam_slices
std::vector< double > true_beam_Pi0_decay_startPx
std::vector< int > reco_daughter_allTrack_ID
std::vector< int > true_beam_Pi0_decay_ID
std::vector< double > reco_daughter_allTrack_endX
std::vector< std::string > true_beam_grand_daughter_Process
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_PFP_trackScore
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endX
std::vector< int > reco_daughter_PFP_true_byHits_ID
std::vector< int > true_beam_Pi0_decay_parID
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endX
std::vector< double > reco_daughter_allTrack_momByRange_alt_proton
std::vector< std::string > true_beam_grand_daughter_endProcess
std::vector< std::vector< double > > reco_daughter_allTrack_dQdX_SCE
std::vector< std::string > reco_daughter_PFP_true_byHits_process
std::vector< double > reco_track_startY
std::vector< std::string > true_beam_daughter_Process
std::vector< double > reco_daughter_PFP_true_byHits_endZ
std::vector< int > true_beam_process_dSlice
std::vector< double > reco_beam_dEdX
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_allTrack_ID
std::vector< double > reco_daughter_PFP_true_byHits_startPy
std::vector< double > reco_daughter_PFP_trackScore_collection
std::vector< std::string > reco_daughter_PFP_true_byHits_endProcess
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startZ
std::vector< int > data_BI_PDG_candidates
std::vector< std::vector< double > > reco_daughter_spacePts_X
std::vector< double > reco_daughter_allTrack_endZ
std::string reco_beam_true_byHits_process
std::vector< std::string > true_beam_daughter_endProcess
std::vector< double > reco_daughter_allTrack_startZ
std::vector< double > g4rw_primary_weights
std::vector< double > reco_daughter_PFP_true_byHits_len
std::vector< double > true_beam_incidentEnergies
std::vector< double > quality_reco_view_0_tick
std::vector< double > g4rw_alt_primary_minus_sigma_weight
std::vector< int > true_beam_process_slice
std::vector< double > reco_daughter_allTrack_len
std::vector< double > data_BI_TOF
std::vector< double > true_beam_traj_Y
std::vector< double > reco_daughter_allTrack_Chi2_proton_plane0
std::vector< double > true_beam_Pi0_decay_startZ
std::vector< std::string > g4rw_primary_var
std::vector< double > true_beam_daughter_endY
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_PFP_nHits
std::vector< double > true_beam_elastic_IDE_edep
std::vector< double > reco_track_endY
std::vector< double > true_beam_daughter_startX
std::vector< double > reco_track_startX
std::vector< double > true_beam_daughter_startPx
std::vector< std::vector< int > > true_beam_reco_byHits_allTrack_ID
std::string reco_beam_true_byE_process
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_PFP_ID
std::vector< int > reco_daughter_allTrack_vertex_nHits
std::vector< double > reco_daughter_PFP_trackScore
std::vector< int > true_beam_daughter_PDG
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endZ
std::vector< double > true_beam_Pi0_decay_startP
std::vector< double > quality_reco_view_0_wire
BR-MS.
std::vector< double > reco_beam_calo_startDirZ
std::vector< int > true_beam_daughter_nHits
std::vector< double > true_beam_Pi0_decay_startPy
std::vector< double > reco_daughter_PFP_michelScore
std::vector< int > reco_track_ID
std::vector< double > reco_daughter_PFP_true_byHits_completeness
std::vector< int > cosmic_has_beam_IDE
std::vector< double > reco_daughter_PFP_true_byE_completeness
std::vector< double > true_beam_daughter_len
std::vector< int > true_beam_process_matched
std::vector< double > reco_beam_incidentEnergies
std::vector< size_t > reco_daughter_PFP_true_byHits_sharedHits
EDIT: quality.
std::vector< std::vector< double > > reco_daughter_shower_spacePts_Z
std::vector< double > reco_beam_calo_tick
std::vector< double > reco_track_endX
std::vector< size_t > reco_daughter_PFP_true_byHits_emHits
std::string reco_beam_true_byHits_endProcess
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_PFP_trackScore
std::vector< double > true_beam_daughter_startZ
std::vector< double > reco_beam_dQdX
std::vector< double > true_beam_Pi0_decay_startPz
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE_plane0
std::vector< double > reco_beam_spacePts_Y
std::vector< std::vector< double > > reco_daughter_allTrack_dEdX_SCE
std::vector< double > reco_daughter_allTrack_momByRange_alt_muon
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_len
std::vector< std::vector< double > > reco_daughter_shower_spacePts_Y
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE_plane1
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_len
std::vector< double > true_beam_elastic_costheta
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startY
std::vector< double > reco_daughter_allTrack_momByRange_proton
Reconstructed Daughter Info.
std::vector< double > reco_daughter_PFP_true_byHits_startP
std::vector< double > reco_daughter_PFP_true_byHits_startX
std::vector< double > reco_daughter_PFP_emScore
std::vector< double > quality_reco_view_2_tick
std::vector< double > reco_daughter_allShower_dirY
std::vector< double > reco_daughter_PFP_true_byHits_purity
std::vector< std::vector< double > > reco_daughter_shower_spacePts_X
std::vector< double > reco_daughter_PFP_true_byHits_endX
std::vector< double > quality_reco_view_1_wire
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startZ
std::vector< double > g4rw_primary_plus_sigma_weight
std::vector< std::vector< double > > reco_daughter_spacePts_Y
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startZ
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startX
std::vector< std::string > true_beam_processes
std::vector< double > true_beam_elastic_deltaE
std::vector< double > reco_daughter_allShower_dirZ
std::vector< double > true_beam_daughter_startP
std::vector< int > reco_daughter_PFP_true_byHits_parID
std::vector< double > reco_daughter_PFP_true_byHits_startPz
std::vector< double > g4rw_alt_primary_plus_sigma_weight
std::vector< double > reco_beam_spacePts_Z
std::vector< int > true_beam_grand_daughter_PDG
std::vector< std::vector< int > > true_beam_reco_byHits_PFP_ID
std::vector< double > reco_beam_TrkPitch
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allShower_startX
std::vector< double > reco_daughter_allTrack_momByRange_muon
std::vector< double > reco_beam_cosmic_candidate_lower_hits
std::vector< double > true_beam_elastic_X
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startY
std::vector< double > true_beam_daughter_startY
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endY
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_endY
std::vector< int > reco_daughter_PFP_true_byHits_parPDG
std::vector< double > reco_daughter_PFP_true_byHits_endY
std::vector< int > reco_beam_calo_TPC
std::vector< double > reco_beam_resRange
std::vector< double > reco_daughter_PFP_michelScore_collection
std::vector< double > reco_beam_spacePts_X
Reconstructed Daughter Info.
static int max(int a, int b)
std::vector< double > true_beam_traj_KE
std::vector< double > reco_beam_calibrated_dEdX
std::vector< int > reco_beam_hit_true_origin
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_allShower_ID
std::vector< int > true_beam_slices_found
std::vector< double > reco_beam_allTrack_calibrated_dEdX
std::vector< int > reco_daughter_PFP_true_byE_PDG
std::vector< double > reco_daughter_allShower_len
std::vector< double > reco_track_endZ
std::vector< double > reco_daughter_allShower_startZ
std::vector< int > reco_track_nHits
std::vector< int > reco_daughter_allShower_ID
std::vector< int > true_beam_grand_daughter_ID
std::vector< double > reco_daughter_allTrack_Chi2_proton
std::vector< double > quality_reco_view_2_z
std::vector< std::vector< double > > reco_daughter_allTrack_calibrated_dEdX_SCE
std::vector< int > reco_daughter_PFP_ID
Add by hits?
std::vector< std::vector< int > > true_beam_Pi0_decay_reco_byHits_allShower_ID
std::vector< double > reco_daughter_allTrack_Theta
std::vector< double > reco_track_michel_score
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_SCE
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startZ
std::vector< int > reco_daughter_PFP_true_byHits_PDG
std::vector< double > true_beam_Pi0_decay_len
std::vector< double > reco_track_startZ
std::vector< int > reco_daughter_allTrack_Chi2_ndof_plane1
std::vector< double > reco_daughter_allTrack_startY
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allShower_startY
std::vector< double > reco_daughter_PFP_true_byHits_startY
std::vector< double > reco_beam_calo_wire_z
std::vector< int > true_beam_daughter_ID
std::vector< std::vector< int > > true_beam_reco_byHits_PFP_nHits
std::vector< double > reco_daughter_allShower_energy
std::vector< int > reco_daughter_PFP_nHits_collection
std::vector< double > true_beam_daughter_endZ
std::vector< int > reco_daughter_allTrack_Chi2_ndof
std::vector< int > reco_beam_hit_true_slice
std::vector< double > reco_beam_calo_endDirX
std::vector< double > true_beam_daughter_endX
std::vector< double > quality_reco_view_1_tick
std::vector< double > reco_daughter_PFP_true_byHits_startE
std::vector< double > reco_daughter_PFP_true_byE_purity
std::vector< double > reco_daughter_allShower_startX
std::vector< double > reco_beam_cosmic_candidate_upper_hits
std::vector< double > true_beam_traj_Z
std::vector< double > reco_daughter_allTrack_Chi2_proton_plane1
std::vector< int > reco_beam_hit_true_ID
std::vector< double > true_beam_Pi0_decay_startX
std::vector< double > true_beam_daughter_startPy
std::vector< int > true_beam_Pi0_decay_nHits
std::vector< std::vector< double > > reco_daughter_allTrack_resRange_plane1
std::vector< double > reco_daughter_allTrack_vertex_michel_score
std::vector< double > true_beam_elastic_Z
std::vector< int > reco_beam_cosmic_candidate_ID
std::vector< int > true_beam_grand_daughter_nHits
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_len
std::vector< double > true_beam_slices_deltaE
std::vector< int > true_beam_Pi0_decay_PDG
std::vector< double > reco_daughter_PFP_true_byHits_startZ
std::vector< double > reco_beam_calo_endDirZ
std::vector< double > reco_daughter_allTrack_to_vertex
std::vector< double > true_beam_elastic_Y
std::vector< double > reco_beam_calo_startDirX
std::string reco_beam_true_byE_endProcess
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_PFP_nHits
std::vector< double > reco_beam_calo_endDirY
std::vector< double > reco_daughter_allTrack_dR
std::vector< std::vector< double > > true_beam_Pi0_decay_reco_byHits_allTrack_startX
std::vector< double > reco_daughter_allTrack_endY
std::vector< double > reco_daughter_allTrack_Phi
std::vector< double > reco_beam_calo_startDirY
std::vector< double > reco_daughter_allShower_startY
std::vector< double > true_beam_daughter_startPz
std::vector< double > reco_daughter_allTrack_alt_len
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_endZ
std::vector< double > quality_reco_view_2_wire
std::vector< double > true_beam_Pi0_decay_startY
std::vector< double > reco_daughter_PFP_true_byHits_startPx
std::vector< double > true_beam_traj_X
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startX
std::vector< std::vector< int > > true_beam_daughter_reco_byHits_PFP_ID
std::vector< double > reco_daughter_PFP_emScore_collection
std::vector< double > g4rw_primary_minus_sigma_weight
std::vector< int > true_beam_grand_daughter_parID
std::vector< double > reco_beam_calo_wire
std::vector< double > reco_beam_allTrack_resRange
std::vector< double > reco_daughter_allTrack_startX
std::vector< std::vector< double > > true_beam_daughter_reco_byHits_allTrack_startY
std::vector< int > data_BI_TOF_Chan
std::vector< int > reco_daughter_PFP_nHits
std::vector< int > true_beam_slices_nIDEs
std::vector< double > reco_daughter_PFP_true_byE_len

Member Data Documentation

protoana::ProtoDUNEBeamCuts pionana::PionAnalyzer::beam_cuts
private

Definition at line 947 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::beam_has_cosmic_IDE
private

Definition at line 583 of file PionAnalyzer_module.cc.

fhicl::ParameterSet pionana::PionAnalyzer::BeamCuts
private

Definition at line 946 of file PionAnalyzer_module.cc.

fhicl::ParameterSet pionana::PionAnalyzer::BeamPars
private

Definition at line 945 of file PionAnalyzer_module.cc.

protoana::ProtoDUNECalibration pionana::PionAnalyzer::calibration
private

Definition at line 949 of file PionAnalyzer_module.cc.

fhicl::ParameterSet pionana::PionAnalyzer::CalibrationPars
private

Definition at line 948 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::cosmic_has_beam_IDE
private

Definition at line 584 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::data_BI_dirX
private

Definition at line 672 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::data_BI_dirY
private

Definition at line 672 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::data_BI_dirZ
private

Definition at line 672 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::data_BI_nFibersP1
private

Definition at line 673 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::data_BI_nFibersP2
private

Definition at line 673 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::data_BI_nFibersP3
private

Definition at line 673 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::data_BI_nMomenta
private

Definition at line 674 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::data_BI_nTracks
private

Definition at line 674 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::data_BI_P
private

Definition at line 668 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::data_BI_PDG_candidates
private

Definition at line 670 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::data_BI_TOF
private

Definition at line 669 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::data_BI_TOF_Chan
private

Definition at line 670 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::data_BI_X
private

Definition at line 671 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::data_BI_Y
private

Definition at line 671 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::data_BI_Z
private

Definition at line 671 of file PionAnalyzer_module.cc.

TFile pionana::PionAnalyzer::dEdX_template_file
private

Definition at line 943 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::dEdX_template_name
private

Definition at line 942 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::em_energy
private

Definition at line 638 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::event
private

Definition at line 426 of file PionAnalyzer_module.cc.

protoana::ProtoDUNEBeamlineUtils pionana::PionAnalyzer::fBeamlineUtils
private

Definition at line 941 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::fBeamModuleLabel
private

Definition at line 940 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::fCalorimetryTag
private

Definition at line 933 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::fCheckCosmics
private

Definition at line 951 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::fDoProtReweight
private

Definition at line 954 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::fDoReweight
private

Definition at line 953 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::fGeneratorTag
private

Definition at line 939 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::fHitTag
private

Definition at line 936 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::fMCHasBI
private

Definition at line 955 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::fPandora2CaloSCE
private

Definition at line 934 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::fPFParticleTag
private

Definition at line 938 of file PionAnalyzer_module.cc.

TFile* pionana::PionAnalyzer::FracsFile
private

Definition at line 958 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::fSaveHits
private

Definition at line 950 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::fShowerTag
private

Definition at line 937 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::fTrackerTag
private

Definition at line 935 of file PionAnalyzer_module.cc.

const art::InputTag pionana::PionAnalyzer::fTrackModuleLabel
private

Definition at line 420 of file PionAnalyzer_module.cc.

TTree* pionana::PionAnalyzer::fTree
private

Definition at line 422 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::fTrueToReco
private

Definition at line 952 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::fVerbose
private

Definition at line 944 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::g4rw_alt_primary_minus_sigma_weight
private

Definition at line 603 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::g4rw_alt_primary_plus_sigma_weight
private

Definition at line 602 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::g4rw_primary_minus_sigma_weight
private

Definition at line 599 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::g4rw_primary_plus_sigma_weight
private

Definition at line 598 of file PionAnalyzer_module.cc.

std::vector<std::string> pionana::PionAnalyzer::g4rw_primary_var
private

Definition at line 600 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::g4rw_primary_weights
private

Definition at line 597 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::MC
private

Definition at line 427 of file PionAnalyzer_module.cc.

G4MultiReweighter* pionana::PionAnalyzer::MultiRW
private

Definition at line 962 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::n_cosmics_with_beam_IDE
private

Definition at line 585 of file PionAnalyzer_module.cc.

G4ReweightParameterMaker pionana::PionAnalyzer::ParMaker
private

Definition at line 961 of file PionAnalyzer_module.cc.

std::vector<fhicl::ParameterSet> pionana::PionAnalyzer::ParSet
private

Definition at line 960 of file PionAnalyzer_module.cc.

TFile* pionana::PionAnalyzer::ProtFracsFile
private

Definition at line 959 of file PionAnalyzer_module.cc.

G4MultiReweighter * pionana::PionAnalyzer::ProtMultiRW
private

Definition at line 962 of file PionAnalyzer_module.cc.

TFile * pionana::PionAnalyzer::ProtXSecFile
private

Definition at line 959 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::quality_reco_max_lateral
private

Definition at line 689 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::quality_reco_max_segment
private

Definition at line 689 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::quality_reco_view_0_hits_in_TPC5
private

Definition at line 680 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::quality_reco_view_0_max_segment
private

Definition at line 686 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::quality_reco_view_0_tick
private

Definition at line 682 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::quality_reco_view_0_wire
private

BR-MS.

Definition at line 682 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::quality_reco_view_0_wire_backtrack
private

Definition at line 687 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::quality_reco_view_1_hits_in_TPC5
private

Definition at line 680 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::quality_reco_view_1_max_segment
private

Definition at line 686 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::quality_reco_view_1_tick
private

Definition at line 683 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::quality_reco_view_1_wire
private

Definition at line 683 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::quality_reco_view_1_wire_backtrack
private

Definition at line 687 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::quality_reco_view_2_hits_in_TPC5
private

Definition at line 680 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::quality_reco_view_2_max_segment
private

Definition at line 686 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::quality_reco_view_2_tick
private

Definition at line 684 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::quality_reco_view_2_wire
private

Definition at line 684 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::quality_reco_view_2_wire_backtrack
private

Definition at line 687 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::quality_reco_view_2_z
private

Definition at line 685 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::reco_beam_allTrack_beam_cuts
private

Definition at line 654 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_allTrack_calibrated_dEdX
private

Definition at line 661 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_allTrack_Chi2_ndof
private

Definition at line 663 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_Chi2_proton
private

Definition at line 662 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_endX
private

Definition at line 657 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_endY
private

Definition at line 657 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_endZ
private

Definition at line 657 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::reco_beam_allTrack_flipped
private

Definition at line 654 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_allTrack_ID
private

Definition at line 653 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_len
private

Definition at line 655 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_allTrack_resRange
private

Definition at line 660 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_startX
private

Definition at line 656 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_startY
private

Definition at line 656 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_startZ
private

Definition at line 656 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_trackDirX
private

Definition at line 658 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_trackDirY
private

Definition at line 658 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_trackDirZ
private

Definition at line 658 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_trackEndDirX
private

Definition at line 659 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_trackEndDirY
private

Definition at line 659 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_allTrack_trackEndDirZ
private

Definition at line 659 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_alt_len
private

Definition at line 550 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_calibrated_dEdX
private

Definition at line 566 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_beam_calo_endDirX
private

Definition at line 557 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_beam_calo_endDirY
private

Definition at line 558 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_beam_calo_endDirZ
private

Definition at line 559 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_calo_endX
private

Definition at line 556 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_calo_endY
private

Definition at line 556 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_calo_endZ
private

Definition at line 556 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_beam_calo_startDirX
private

Definition at line 557 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_beam_calo_startDirY
private

Definition at line 558 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_beam_calo_startDirZ
private

Definition at line 559 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_calo_startX
private

Definition at line 555 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_calo_startY
private

Definition at line 555 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_calo_startZ
private

Definition at line 555 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_calo_tick
private

Definition at line 564 of file PionAnalyzer_module.cc.

std::vector<int> pionana::PionAnalyzer::reco_beam_calo_TPC
private

Definition at line 565 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_calo_wire
private

Definition at line 564 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_calo_wire_z
private

Definition at line 564 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_Chi2_ndof
private

Definition at line 578 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_Chi2_proton
private

Definition at line 577 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::reco_beam_cosmic_candidate_ID
private

Definition at line 582 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_cosmic_candidate_lower_hits
private

Definition at line 581 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_cosmic_candidate_upper_hits
private

Definition at line 580 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_dEdX
private

Definition at line 563 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_dQdX
private

Definition at line 563 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_endX
private

Definition at line 548 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_endY
private

Definition at line 548 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_endZ
private

Definition at line 548 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::reco_beam_flipped
private

Definition at line 570 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::reco_beam_hit_true_ID
private

Definition at line 568 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::reco_beam_hit_true_origin
private

Definition at line 568 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::reco_beam_hit_true_slice
private

Definition at line 568 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_incidentEnergies
private

Definition at line 632 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_interactingEnergy
private

Definition at line 633 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_len
private

Definition at line 550 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_momByRange_alt_muon
private

Definition at line 902 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_momByRange_alt_proton
private

Definition at line 901 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_momByRange_muon
private

Definition at line 897 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_momByRange_proton
private

Definition at line 896 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_nShowerDaughters
private

Definition at line 575 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_nTrackDaughters
private

Definition at line 575 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::reco_beam_passes_beam_cuts
private

Definition at line 573 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_PFP_emScore
private

Definition at line 647 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_PFP_emScore_collection
private

Definition at line 650 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_PFP_ID
private

Definition at line 644 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_PFP_michelScore
private

Definition at line 648 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_PFP_michelScore_collection
private

Definition at line 651 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_PFP_nHits
private

Definition at line 645 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_PFP_trackScore
private

Definition at line 646 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_PFP_trackScore_collection
private

Definition at line 649 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_resRange
private

Definition at line 563 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_spacePts_X
private

Reconstructed Daughter Info.

Definition at line 921 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_spacePts_Y
private

Definition at line 921 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_spacePts_Z
private

Definition at line 921 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_startX
private

Definition at line 547 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_startY
private

Definition at line 547 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_startZ
private

Definition at line 547 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_trackDirX
private

Definition at line 561 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_trackDirY
private

Definition at line 561 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_trackDirZ
private

Definition at line 561 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_trackEndDirX
private

Definition at line 562 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_trackEndDirY
private

Definition at line 562 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_trackEndDirZ
private

Definition at line 562 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_trackID
private

Definition at line 569 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_beam_TrkPitch
private

Definition at line 563 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byE_endE
private

Definition at line 620 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byE_endP
private

Definition at line 621 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::reco_beam_true_byE_endProcess
private

Definition at line 607 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byE_endPx
private

Definition at line 617 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byE_endPy
private

Definition at line 618 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byE_endPz
private

Definition at line 619 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_true_byE_ID
private

Definition at line 610 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::reco_beam_true_byE_matched
private

Definition at line 611 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_true_byE_origin
private

Definition at line 614 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_true_byE_PDG
private

Definition at line 609 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::reco_beam_true_byE_process
private

Definition at line 608 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byE_startE
private

Definition at line 626 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byE_startP
private

Definition at line 627 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byE_startPx
private

Definition at line 623 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byE_startPy
private

Definition at line 624 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byE_startPz
private

Definition at line 625 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byHits_endE
private

Definition at line 620 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byHits_endP
private

Definition at line 621 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::reco_beam_true_byHits_endProcess
private

Definition at line 607 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byHits_endPx
private

Definition at line 617 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byHits_endPy
private

Definition at line 618 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byHits_endPz
private

Definition at line 619 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_true_byHits_ID
private

Definition at line 610 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::reco_beam_true_byHits_matched
private

Definition at line 611 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_true_byHits_origin
private

Definition at line 614 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_true_byHits_PDG
private

Definition at line 609 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::reco_beam_true_byHits_process
private

Definition at line 608 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byHits_purity
private

Definition at line 629 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byHits_startE
private

Definition at line 626 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byHits_startP
private

Definition at line 627 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byHits_startPx
private

Definition at line 623 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byHits_startPy
private

Definition at line 624 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_true_byHits_startPz
private

Definition at line 625 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_type
private

Definition at line 576 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_vertex_michel_score
private

Definition at line 551 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_vertex_nHits
private

Definition at line 552 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::reco_beam_vertex_slice
private

Definition at line 541 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_vtxX
private

Definition at line 549 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_vtxY
private

Definition at line 549 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::reco_beam_vtxZ
private

Definition at line 549 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allShower_dirX
private

Definition at line 831 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allShower_dirY
private

Definition at line 831 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allShower_dirZ
private

Definition at line 831 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allShower_energy
private

Definition at line 831 of file PionAnalyzer_module.cc.

std::vector<int> pionana::PionAnalyzer::reco_daughter_allShower_ID
private

Definition at line 830 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allShower_len
private

Definition at line 831 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allShower_startX
private

Definition at line 831 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allShower_startY
private

Definition at line 831 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allShower_startZ
private

Definition at line 831 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_allTrack_alt_len
private

Definition at line 823 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::reco_daughter_allTrack_calibrated_dEdX_SCE
private

Definition at line 799 of file PionAnalyzer_module.cc.

std::vector<std::vector<double> > pionana::PionAnalyzer::reco_daughter_allTrack_calibrated_dEdX_SCE_plane0
private

Definition at line 805 of file PionAnalyzer_module.cc.

std::vector<std::vector<double> > pionana::PionAnalyzer::reco_daughter_allTrack_calibrated_dEdX_SCE_plane1
private

Definition at line 805 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::reco_daughter_allTrack_Chi2_ndof
private

Definition at line 801 of file PionAnalyzer_module.cc.

std::vector<int> pionana::PionAnalyzer::reco_daughter_allTrack_Chi2_ndof_plane0
private

Definition at line 815 of file PionAnalyzer_module.cc.

std::vector<int> pionana::PionAnalyzer::reco_daughter_allTrack_Chi2_ndof_plane1
private

Definition at line 815 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_allTrack_Chi2_proton
private

Definition at line 800 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allTrack_Chi2_proton_plane0
private

Definition at line 812 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allTrack_Chi2_proton_plane1
private

Definition at line 812 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::reco_daughter_allTrack_dEdX_SCE
private

Definition at line 798 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::reco_daughter_allTrack_dQdX_SCE
private

Definition at line 798 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_allTrack_dR
private

Definition at line 822 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_allTrack_endX
private

Definition at line 819 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_allTrack_endY
private

Definition at line 820 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_allTrack_endZ
private

Definition at line 821 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::reco_daughter_allTrack_ID
private

Definition at line 795 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_allTrack_len
private

Definition at line 823 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allTrack_momByRange_alt_muon
private

Definition at line 900 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allTrack_momByRange_alt_proton
private

Definition at line 899 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allTrack_momByRange_muon
private

Definition at line 895 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allTrack_momByRange_proton
private

Reconstructed Daughter Info.

Definition at line 894 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_allTrack_Phi
private

Definition at line 797 of file PionAnalyzer_module.cc.

std::vector<std::vector<double> > pionana::PionAnalyzer::reco_daughter_allTrack_resRange_plane0
private

Definition at line 809 of file PionAnalyzer_module.cc.

std::vector<std::vector<double> > pionana::PionAnalyzer::reco_daughter_allTrack_resRange_plane1
private

Definition at line 809 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::reco_daughter_allTrack_resRange_SCE
private

Definition at line 798 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_allTrack_startX
private

Definition at line 819 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_allTrack_startY
private

Definition at line 820 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_allTrack_startZ
private

Definition at line 821 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_allTrack_Theta
private

Definition at line 796 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_allTrack_to_vertex
private

Definition at line 824 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_daughter_allTrack_vertex_michel_score
private

Definition at line 826 of file PionAnalyzer_module.cc.

std::vector<int> pionana::PionAnalyzer::reco_daughter_allTrack_vertex_nHits
private

Definition at line 827 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_emScore
private

Definition at line 750 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_emScore_collection
private

Definition at line 753 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::reco_daughter_PFP_ID
private

Add by hits?

Definition at line 746 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_michelScore
private

Definition at line 751 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_michelScore_collection
private

Definition at line 754 of file PionAnalyzer_module.cc.

std::vector<int> pionana::PionAnalyzer::reco_daughter_PFP_nHits
private

Definition at line 747 of file PionAnalyzer_module.cc.

std::vector<int> pionana::PionAnalyzer::reco_daughter_PFP_nHits_collection
private

Definition at line 747 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_trackScore
private

Definition at line 749 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_trackScore_collection
private

Definition at line 752 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byE_completeness
private

Definition at line 787 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byE_len
private

Definition at line 786 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::reco_daughter_PFP_true_byE_PDG
private

Definition at line 785 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byE_purity
private

Definition at line 788 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_completeness
private

Definition at line 767 of file PionAnalyzer_module.cc.

std::vector< size_t > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_emHits
private

Definition at line 766 of file PionAnalyzer_module.cc.

std::vector< std::string > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_endProcess
private

Definition at line 783 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_endX
private

Definition at line 773 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_endY
private

Definition at line 774 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_endZ
private

Definition at line 775 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_ID
private

Definition at line 760 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_len
private

Definition at line 769 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_origin
private

Definition at line 761 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_parID
private

Definition at line 762 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_parPDG
private

Definition at line 763 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_PDG
private

Definition at line 759 of file PionAnalyzer_module.cc.

std::vector< std::string > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_process
private

Definition at line 764 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_purity
private

Definition at line 765 of file PionAnalyzer_module.cc.

std::vector< size_t > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_sharedHits
private

EDIT: quality.

Definition at line 766 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_startE
private

Definition at line 780 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_startP
private

Definition at line 781 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_startPx
private

Definition at line 777 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_startPy
private

Definition at line 778 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_startPz
private

Definition at line 779 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_startX
private

Definition at line 770 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_startY
private

Definition at line 771 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::reco_daughter_PFP_true_byHits_startZ
private

Definition at line 772 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::reco_daughter_shower_spacePts_X
private

Definition at line 924 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::reco_daughter_shower_spacePts_Y
private

Definition at line 924 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::reco_daughter_shower_spacePts_Z
private

Definition at line 924 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::reco_daughter_spacePts_X
private

Definition at line 923 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::reco_daughter_spacePts_Y
private

Definition at line 923 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::reco_daughter_spacePts_Z
private

Definition at line 923 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_track_endX
private

Definition at line 589 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_track_endY
private

Definition at line 589 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_track_endZ
private

Definition at line 589 of file PionAnalyzer_module.cc.

std::vector<int> pionana::PionAnalyzer::reco_track_ID
private

Definition at line 592 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_track_michel_score
private

Definition at line 589 of file PionAnalyzer_module.cc.

std::vector<int> pionana::PionAnalyzer::reco_track_nHits
private

Definition at line 592 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_track_startX
private

Definition at line 589 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_track_startY
private

Definition at line 589 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::reco_track_startZ
private

Definition at line 589 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::run
private

Definition at line 424 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::subrun
private

Definition at line 425 of file PionAnalyzer_module.cc.

std::map< int, TProfile* > pionana::PionAnalyzer::templates
private

Definition at line 930 of file PionAnalyzer_module.cc.

std::vector< std::string > pionana::PionAnalyzer::true_beam_daughter_endProcess
private

Definition at line 495 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_daughter_endX
private

Definition at line 499 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_daughter_endY
private

Definition at line 499 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_daughter_endZ
private

Definition at line 499 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_daughter_ID
private

Definition at line 493 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_daughter_len
private

Definition at line 494 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_daughter_nHits
private

Definition at line 500 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_daughter_PDG
private

Definition at line 492 of file PionAnalyzer_module.cc.

std::vector< std::string > pionana::PionAnalyzer::true_beam_daughter_Process
private

Definition at line 495 of file PionAnalyzer_module.cc.

std::vector< std::vector< int > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_allShower_ID
private

Definition at line 504 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_allShower_len
private

Definition at line 511 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_allShower_startX
private

Definition at line 510 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_allShower_startY
private

Definition at line 510 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_allShower_startZ
private

Definition at line 510 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_allTrack_endX
private

Definition at line 508 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_allTrack_endY
private

Definition at line 508 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_allTrack_endZ
private

Definition at line 508 of file PionAnalyzer_module.cc.

std::vector< std::vector< int > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_allTrack_ID
private

Definition at line 504 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_allTrack_len
private

Definition at line 509 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_allTrack_startX
private

Definition at line 507 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_allTrack_startY
private

Definition at line 507 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_allTrack_startZ
private

Definition at line 507 of file PionAnalyzer_module.cc.

std::vector< std::vector< int > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_PFP_ID
private

Definition at line 504 of file PionAnalyzer_module.cc.

std::vector< std::vector< int > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_PFP_nHits
private

Definition at line 504 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_daughter_reco_byHits_PFP_trackScore
private

Definition at line 506 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_daughter_startP
private

Definition at line 498 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_daughter_startPx
private

Definition at line 498 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_daughter_startPy
private

Definition at line 498 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_daughter_startPz
private

Definition at line 498 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_daughter_startX
private

Definition at line 497 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_daughter_startY
private

Definition at line 497 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_daughter_startZ
private

Definition at line 497 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_elastic_costheta
private

Definition at line 473 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_elastic_deltaE
private

Definition at line 473 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_elastic_IDE_edep
private

Definition at line 473 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_elastic_X
private

Definition at line 473 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_elastic_Y
private

Definition at line 473 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_elastic_Z
private

Definition at line 473 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_endP
private

Definition at line 469 of file PionAnalyzer_module.cc.

std::string pionana::PionAnalyzer::true_beam_endProcess
private

Definition at line 449 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_endPx
private

Definition at line 466 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_endPy
private

Definition at line 467 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_endPz
private

Definition at line 468 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_endX
private

Definition at line 450 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_endY
private

Definition at line 451 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_endZ
private

Definition at line 452 of file PionAnalyzer_module.cc.

std::vector< std::string > pionana::PionAnalyzer::true_beam_grand_daughter_endProcess
private

Definition at line 533 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_grand_daughter_ID
private

Definition at line 531 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_grand_daughter_nHits
private

Definition at line 532 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_grand_daughter_parID
private

Definition at line 531 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_grand_daughter_PDG
private

Definition at line 531 of file PionAnalyzer_module.cc.

std::vector< std::string > pionana::PionAnalyzer::true_beam_grand_daughter_Process
private

Definition at line 533 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::true_beam_ID
private

Definition at line 448 of file PionAnalyzer_module.cc.

bool pionana::PionAnalyzer::true_beam_IDE_found_in_recoVtx
private

Definition at line 478 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_IDE_totalDep
private

Definition at line 477 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_incidentEnergies
private

Definition at line 634 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_interactingEnergy
private

Definition at line 637 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::true_beam_nElasticScatters
private

Definition at line 471 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::true_beam_nHits
private

Definition at line 472 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::true_beam_PDG
private

Definition at line 447 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_Pi0_decay_ID
private

Definition at line 516 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_Pi0_decay_len
private

Definition at line 529 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_Pi0_decay_nHits
private

Definition at line 519 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_Pi0_decay_parID
private

Definition at line 516 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_Pi0_decay_PDG
private

Definition at line 516 of file PionAnalyzer_module.cc.

std::vector< std::vector< int > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_allShower_ID
private

Definition at line 520 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_allShower_len
private

Definition at line 527 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_allShower_startX
private

Definition at line 526 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_allShower_startY
private

Definition at line 526 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_allShower_startZ
private

Definition at line 526 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_allTrack_endX
private

Definition at line 524 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_allTrack_endY
private

Definition at line 524 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_allTrack_endZ
private

Definition at line 524 of file PionAnalyzer_module.cc.

std::vector< std::vector< int > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_allTrack_ID
private

Definition at line 520 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_allTrack_len
private

Definition at line 525 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_allTrack_startX
private

Definition at line 523 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_allTrack_startY
private

Definition at line 523 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_allTrack_startZ
private

Definition at line 523 of file PionAnalyzer_module.cc.

std::vector< std::vector< int > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_PFP_ID
private

Definition at line 520 of file PionAnalyzer_module.cc.

std::vector< std::vector< int > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_PFP_nHits
private

Definition at line 520 of file PionAnalyzer_module.cc.

std::vector< std::vector< double > > pionana::PionAnalyzer::true_beam_Pi0_decay_reco_byHits_PFP_trackScore
private

Definition at line 522 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_Pi0_decay_startP
private

Definition at line 517 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_Pi0_decay_startPx
private

Definition at line 517 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_Pi0_decay_startPy
private

Definition at line 517 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_Pi0_decay_startPz
private

Definition at line 517 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_Pi0_decay_startX
private

Definition at line 518 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_Pi0_decay_startY
private

Definition at line 518 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_Pi0_decay_startZ
private

Definition at line 518 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_process_dSlice
private

Definition at line 480 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_process_matched
private

Definition at line 482 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_process_slice
private

Definition at line 481 of file PionAnalyzer_module.cc.

std::vector< std::string > pionana::PionAnalyzer::true_beam_processes
private

Definition at line 479 of file PionAnalyzer_module.cc.

std::vector< std::vector< int > > pionana::PionAnalyzer::true_beam_reco_byHits_allTrack_ID
private

Definition at line 485 of file PionAnalyzer_module.cc.

std::vector< std::vector< int > > pionana::PionAnalyzer::true_beam_reco_byHits_PFP_ID
private

Definition at line 485 of file PionAnalyzer_module.cc.

std::vector< std::vector< int > > pionana::PionAnalyzer::true_beam_reco_byHits_PFP_nHits
private

Definition at line 485 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_slices
private

Definition at line 635 of file PionAnalyzer_module.cc.

std::vector< double > pionana::PionAnalyzer::true_beam_slices_deltaE
private

Definition at line 636 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_slices_found
private

Definition at line 635 of file PionAnalyzer_module.cc.

std::vector< int > pionana::PionAnalyzer::true_beam_slices_nIDEs
private

Definition at line 635 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_startDirX
private

Definition at line 457 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_startDirY
private

Definition at line 458 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_startDirZ
private

Definition at line 459 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_startP
private

Definition at line 464 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_startPx
private

Definition at line 461 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_startPy
private

Definition at line 462 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_startPz
private

Definition at line 463 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_startX
private

Definition at line 453 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_startY
private

Definition at line 454 of file PionAnalyzer_module.cc.

double pionana::PionAnalyzer::true_beam_startZ
private

Definition at line 455 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::true_beam_traj_KE
private

Definition at line 642 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::true_beam_traj_X
private

Definition at line 639 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::true_beam_traj_Y
private

Definition at line 640 of file PionAnalyzer_module.cc.

std::vector<double> pionana::PionAnalyzer::true_beam_traj_Z
private

Definition at line 641 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::true_daughter_nNeutron
private

Definition at line 537 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::true_daughter_nNucleus
private

Definition at line 537 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::true_daughter_nPi0
private

Definition at line 536 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::true_daughter_nPiMinus
private

Definition at line 536 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::true_daughter_nPiPlus
private

Definition at line 536 of file PionAnalyzer_module.cc.

int pionana::PionAnalyzer::true_daughter_nProton
private

Definition at line 537 of file PionAnalyzer_module.cc.

TFile * pionana::PionAnalyzer::XSecFile
private

Definition at line 958 of file PionAnalyzer_module.cc.


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