LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
DUNE::NeutrinoShowerEff Class Reference
Inheritance diagram for DUNE::NeutrinoShowerEff:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 NeutrinoShowerEff (fhicl::ParameterSet const &pset)
 
virtual ~NeutrinoShowerEff ()
 
void beginJob ()
 
void endJob ()
 
void beginRun (const art::Run &run)
 
void analyze (const art::Event &evt)
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void processEff (const art::Event &evt, bool &isFiducial)
 
void truthMatcher (std::vector< art::Ptr< recob::Hit >>all_hits, std::vector< art::Ptr< recob::Hit >> shower_hits, const simb::MCParticle *&MCparticle, double &Efrac, double &Ecomplet)
 
template<size_t N>
void checkCNNtrkshw (const art::Event &evt, std::vector< art::Ptr< recob::Hit >>all_hits)
 
bool insideFV (double vertex[4])
 
void doEfficiencies ()
 
void reset ()
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > consumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > consumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > mayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > mayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

art::InputTag fMCTruthModuleLabel
 
art::InputTag fHitModuleLabel
 
art::InputTag fShowerModuleLabel
 
art::InputTag fCNNEMModuleLabel
 
int fNeutrinoPDGcode
 
int fLeptonPDGcode
 
double fMaxNeutrinoE
 
bool fSaveMCTree
 
double fMaxEfrac
 
double fMinCompleteness
 
TTree * fEventTree
 
TH1D * h_Ev_den
 
TH1D * h_Ev_num
 
TH1D * h_Ev_num_dEdx
 
TH1D * h_Ee_den
 
TH1D * h_Ee_num
 
TH1D * h_Ee_num_dEdx
 
TH1D * h_Pe_den
 
TH1D * h_Pe_num
 
TH1D * h_theta_den
 
TH1D * h_theta_num
 
TH1D * h_Efrac_shContamination
 
TH1D * h_Efrac_shPurity
 
TH1D * h_Ecomplet_lepton
 
TH1D * h_Efrac_NueCCPurity
 
TH1D * h_Ecomplet_NueCC
 
TH1D * h_HighestHitsProducedParticlePDG_NueCC
 
TH1D * h_HighestHitsProducedParticlePDG_bkg
 
TH1D * h_Efrac_bkgPurity
 
TH1D * h_Ecomplet_bkg
 
TEfficiency * h_Eff_Ev = 0
 
TEfficiency * h_Eff_Ev_dEdx = 0
 
TEfficiency * h_Eff_Ee = 0
 
TEfficiency * h_Eff_Ee_dEdx = 0
 
TEfficiency * h_Eff_Pe = 0
 
TEfficiency * h_Eff_theta = 0
 
TH1D * h_esh_bestplane_NueCC
 
TH1D * h_esh_bestplane_NC
 
TH1D * h_dEdX_electronorpositron_NueCC
 
TH1D * h_dEdX_electronorpositron_NC
 
TH1D * h_dEdX_photon_NueCC
 
TH1D * h_dEdX_photon_NC
 
TH1D * h_dEdX_proton_NueCC
 
TH1D * h_dEdX_proton_NC
 
TH1D * h_dEdX_neutron_NueCC
 
TH1D * h_dEdX_neutron_NC
 
TH1D * h_dEdX_chargedpion_NueCC
 
TH1D * h_dEdX_chargedpion_NC
 
TH1D * h_dEdX_neutralpion_NueCC
 
TH1D * h_dEdX_neutralpion_NC
 
TH1D * h_dEdX_everythingelse_NueCC
 
TH1D * h_dEdX_everythingelse_NC
 
TH1D * h_dEdXasymm_electronorpositron_NueCC
 
TH1D * h_dEdXasymm_photon_NC
 
TH1D * h_mpi0_electronorpositron_NueCC
 
TH1D * h_mpi0_photon_NC
 
TH1D * h_trklike_em
 
TH1D * h_trklike_nonem
 
TH1D * h_CosThetaShDirwrtTrueparticle_electronorpositron_NueCC
 
TH1D * h_CosThetaShDirwrtTrueparticle_electronorpositron_NC
 
TH1D * h_CosThetaShDirwrtTrueparticle_photon_NueCC
 
TH1D * h_CosThetaShDirwrtTrueparticle_photon_NC
 
TH1D * h_CosThetaShDirwrtTrueparticle_proton_NueCC
 
TH1D * h_CosThetaShDirwrtTrueparticle_proton_NC
 
TH1D * h_CosThetaShDirwrtTrueparticle_chargedpion_NueCC
 
TH1D * h_CosThetaShDirwrtTrueparticle_chargedpion_NC
 
TH1D * h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NueCC
 
TH1D * h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NueCC
 
TH1D * h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NueCC
 
TH1D * h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NC
 
TH1D * h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NC
 
TH1D * h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NC
 
TH1D * h_ShStartXwrtTrueparticleStartXDiff_photon_NueCC
 
TH1D * h_ShStartYwrtTrueparticleStartYDiff_photon_NueCC
 
TH1D * h_ShStartZwrtTrueparticleStartZDiff_photon_NueCC
 
TH1D * h_ShStartXwrtTrueparticleStartXDiff_photon_NC
 
TH1D * h_ShStartYwrtTrueparticleStartYDiff_photon_NC
 
TH1D * h_ShStartZwrtTrueparticleStartZDiff_photon_NC
 
TH1D * h_ShStartXwrtTrueparticleEndXDiff_photon_NueCC
 
TH1D * h_ShStartYwrtTrueparticleEndYDiff_photon_NueCC
 
TH1D * h_ShStartZwrtTrueparticleEndZDiff_photon_NueCC
 
TH1D * h_ShStartXwrtTrueparticleEndXDiff_photon_NC
 
TH1D * h_ShStartYwrtTrueparticleEndYDiff_photon_NC
 
TH1D * h_ShStartZwrtTrueparticleEndZDiff_photon_NC
 
TH1D * h_ShStartXwrtTrueparticleStartXDiff_proton_NueCC
 
TH1D * h_ShStartYwrtTrueparticleStartYDiff_proton_NueCC
 
TH1D * h_ShStartZwrtTrueparticleStartZDiff_proton_NueCC
 
TH1D * h_ShStartXwrtTrueparticleStartXDiff_proton_NC
 
TH1D * h_ShStartYwrtTrueparticleStartYDiff_proton_NC
 
TH1D * h_ShStartZwrtTrueparticleStartZDiff_proton_NC
 
TH1D * h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NueCC
 
TH1D * h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NueCC
 
TH1D * h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NueCC
 
TH1D * h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NC
 
TH1D * h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NC
 
TH1D * h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NC
 
int Event
 
int Run
 
int SubRun
 
int MC_incoming_PDG
 
int MC_lepton_PDG
 
int MC_isCC
 
int MC_channel
 
int MC_target
 
double MC_Q2
 
double MC_W
 
double MC_vertex [4]
 
double MC_incoming_P [4]
 
double MC_lepton_startMomentum [4]
 
double MC_lepton_endMomentum [4]
 
double MC_lepton_startXYZT [4]
 
double MC_lepton_endXYZT [4]
 
double MC_lepton_theta
 
int MC_leptonID
 
int MC_LeptonTrack
 
double sh_direction_X [MAX_SHOWERS]
 
double sh_direction_Y [MAX_SHOWERS]
 
double sh_direction_Z [MAX_SHOWERS]
 
double sh_start_X [MAX_SHOWERS]
 
double sh_start_Y [MAX_SHOWERS]
 
double sh_start_Z [MAX_SHOWERS]
 
double sh_energy [MAX_SHOWERS][3]
 
double sh_MIPenergy [MAX_SHOWERS][3]
 
double sh_dEdx [MAX_SHOWERS][3]
 
int sh_bestplane [MAX_SHOWERS]
 
double sh_length [MAX_SHOWERS]
 
int sh_hasPrimary_e [MAX_SHOWERS]
 
double sh_Efrac_contamination [MAX_SHOWERS]
 
double sh_purity [MAX_SHOWERS]
 
double sh_completeness [MAX_SHOWERS]
 
int sh_nHits [MAX_SHOWERS]
 
int sh_largest
 
int sh_pdg [MAX_SHOWERS]
 
double sh_dEdxasymm [MAX_SHOWERS]
 
double sh_mpi0
 
int n_recoShowers
 
double sh_Efrac_best
 
float fFidVolCutX
 
float fFidVolCutY
 
float fFidVolCutZ
 
float fFidVolXmin
 
float fFidVolXmax
 
float fFidVolYmin
 
float fFidVolYmax
 
float fFidVolZmin
 
float fFidVolZmax
 
art::ServiceHandle< geo::Geometrygeom
 

Detailed Description

Definition at line 47 of file NeutrinoShowerEff_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

DUNE::NeutrinoShowerEff::NeutrinoShowerEff ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 274 of file NeutrinoShowerEff_module.cc.

References reconfigure().

275  : EDAnalyzer(parameterSet)
276  {
277  reconfigure(parameterSet);
278 
279  }
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
void reconfigure(fhicl::ParameterSet const &pset)
DUNE::NeutrinoShowerEff::~NeutrinoShowerEff ( )
virtual

Definition at line 281 of file NeutrinoShowerEff_module.cc.

281  {
282  //destructor
283  }

Member Function Documentation

void DUNE::NeutrinoShowerEff::analyze ( const art::Event evt)

Definition at line 628 of file NeutrinoShowerEff_module.cc.

References Event, fEventTree, fSaveMCTree, processEff(), reset(), Run, and SubRun.

628  {
629 
630  reset();
631 
632  Event = event.id().event();
633  Run = event.run();
634  SubRun = event.subRun();
635  bool isFiducial = false;
636  processEff(event, isFiducial);
637  if( fSaveMCTree ){
638  if(isFiducial) fEventTree->Fill();
639  }
640  }
void processEff(const art::Event &evt, bool &isFiducial)
Event finding and building.
void DUNE::NeutrinoShowerEff::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 303 of file NeutrinoShowerEff_module.cc.

References Event, fEventTree, fFidVolCutX, fFidVolCutY, fFidVolCutZ, fFidVolXmax, fFidVolXmin, fFidVolYmax, fFidVolYmin, fFidVolZmax, fFidVolZmin, fSaveMCTree, h_CosThetaShDirwrtTrueparticle_chargedpion_NC, h_CosThetaShDirwrtTrueparticle_chargedpion_NueCC, h_CosThetaShDirwrtTrueparticle_electronorpositron_NC, h_CosThetaShDirwrtTrueparticle_electronorpositron_NueCC, h_CosThetaShDirwrtTrueparticle_photon_NC, h_CosThetaShDirwrtTrueparticle_photon_NueCC, h_CosThetaShDirwrtTrueparticle_proton_NC, h_CosThetaShDirwrtTrueparticle_proton_NueCC, h_dEdX_chargedpion_NC, h_dEdX_chargedpion_NueCC, h_dEdX_electronorpositron_NC, h_dEdX_electronorpositron_NueCC, h_dEdX_everythingelse_NC, h_dEdX_everythingelse_NueCC, h_dEdX_neutralpion_NC, h_dEdX_neutralpion_NueCC, h_dEdX_neutron_NC, h_dEdX_neutron_NueCC, h_dEdX_photon_NC, h_dEdX_photon_NueCC, h_dEdX_proton_NC, h_dEdX_proton_NueCC, h_dEdXasymm_electronorpositron_NueCC, h_dEdXasymm_photon_NC, h_Ecomplet_bkg, h_Ecomplet_lepton, h_Ecomplet_NueCC, h_Ee_den, h_Ee_num, h_Ee_num_dEdx, h_Efrac_bkgPurity, h_Efrac_NueCCPurity, h_Efrac_shContamination, h_Efrac_shPurity, h_esh_bestplane_NC, h_esh_bestplane_NueCC, h_Ev_den, h_Ev_num, h_Ev_num_dEdx, h_HighestHitsProducedParticlePDG_bkg, h_HighestHitsProducedParticlePDG_NueCC, h_mpi0_electronorpositron_NueCC, h_mpi0_photon_NC, h_Pe_den, h_Pe_num, h_ShStartXwrtTrueparticleEndXDiff_photon_NC, h_ShStartXwrtTrueparticleEndXDiff_photon_NueCC, h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NC, h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NueCC, h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NC, h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NueCC, h_ShStartXwrtTrueparticleStartXDiff_photon_NC, h_ShStartXwrtTrueparticleStartXDiff_photon_NueCC, h_ShStartXwrtTrueparticleStartXDiff_proton_NC, h_ShStartXwrtTrueparticleStartXDiff_proton_NueCC, h_ShStartYwrtTrueparticleEndYDiff_photon_NC, h_ShStartYwrtTrueparticleEndYDiff_photon_NueCC, h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NC, h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NueCC, h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NC, h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NueCC, h_ShStartYwrtTrueparticleStartYDiff_photon_NC, h_ShStartYwrtTrueparticleStartYDiff_photon_NueCC, h_ShStartYwrtTrueparticleStartYDiff_proton_NC, h_ShStartYwrtTrueparticleStartYDiff_proton_NueCC, h_ShStartZwrtTrueparticleEndZDiff_photon_NC, h_ShStartZwrtTrueparticleEndZDiff_photon_NueCC, h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NC, h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NueCC, h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NC, h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NueCC, h_ShStartZwrtTrueparticleStartZDiff_photon_NC, h_ShStartZwrtTrueparticleStartZDiff_photon_NueCC, h_ShStartZwrtTrueparticleStartZDiff_proton_NC, h_ShStartZwrtTrueparticleStartZDiff_proton_NueCC, h_theta_den, h_theta_num, h_trklike_em, h_trklike_nonem, geo::TPCGeo::LocalToWorld(), art::TFileDirectory::make(), MC_channel, MC_incoming_P, MC_incoming_PDG, MC_isCC, MC_lepton_endMomentum, MC_lepton_endXYZT, MC_lepton_PDG, MC_lepton_startMomentum, MC_lepton_startXYZT, MC_lepton_theta, MC_leptonID, MC_Q2, MC_target, MC_vertex, MC_W, n_recoShowers, Run, sh_bestplane, sh_completeness, sh_dEdx, sh_dEdxasymm, sh_direction_X, sh_direction_Y, sh_direction_Z, sh_Efrac_best, sh_Efrac_contamination, sh_energy, sh_hasPrimary_e, sh_largest, sh_length, sh_MIPenergy, sh_mpi0, sh_nHits, sh_pdg, sh_purity, sh_start_X, sh_start_Y, sh_start_Z, and SubRun.

303  {
304  cout<<"job begin..."<<endl;
305 
306  // Get geometry.
307  auto const* geo = lar::providerFrom<geo::Geometry>();
308  // Define histogram boundaries (cm).
309  // For now only draw cryostat=0.
310  double minx = 1e9;
311  double maxx = -1e9;
312  double miny = 1e9;
313  double maxy = -1e9;
314  double minz = 1e9;
315  double maxz = -1e9;
316  for (size_t i = 0; i<geo->NTPC(); ++i){
317  double local[3] = {0.,0.,0.};
318  double world[3] = {0.,0.,0.};
319  const geo::TPCGeo &tpc = geo->TPC(i);
320  tpc.LocalToWorld(local,world);
321  if (minx>world[0]-geo->DetHalfWidth(i))
322  minx = world[0]-geo->DetHalfWidth(i);
323  if (maxx<world[0]+geo->DetHalfWidth(i))
324  maxx = world[0]+geo->DetHalfWidth(i);
325  if (miny>world[1]-geo->DetHalfHeight(i))
326  miny = world[1]-geo->DetHalfHeight(i);
327  if (maxy<world[1]+geo->DetHalfHeight(i))
328  maxy = world[1]+geo->DetHalfHeight(i);
329  if (minz>world[2]-geo->DetLength(i)/2.)
330  minz = world[2]-geo->DetLength(i)/2.;
331  if (maxz<world[2]+geo->DetLength(i)/2.)
332  maxz = world[2]+geo->DetLength(i)/2.;
333  }
334 
335  fFidVolXmin = minx + fFidVolCutX;
336  fFidVolXmax = maxx - fFidVolCutX;
337  fFidVolYmin = miny + fFidVolCutY;
338  fFidVolYmax = maxy - fFidVolCutY;
339  fFidVolZmin = minz + fFidVolCutZ;
340  fFidVolZmax = maxz - fFidVolCutZ;
341 
342  std::cout<<"Fiducial volume:"<<"\n"
343  <<fFidVolXmin<<"\t< x <\t"<<fFidVolXmax<<"\n"
344  <<fFidVolYmin<<"\t< y <\t"<<fFidVolYmax<<"\n"
345  <<fFidVolZmin<<"\t< z <\t"<<fFidVolZmax<<"\n";
346 
348 
349 
350  double E_bins[21] ={0,0.5,1.0,1.5,2.0,2.5,3.0,3.5,4,4.5,5.0,5.5,6.0,7.0,8.0,10.0,12.0,14.0,17.0,20.0,25.0};
351  double theta_bin[44]= { 0.,1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.,13.,14.,15.,16.,17.,18.,19.,20.,22.,24.,26.,28.,30.,32.,34.,36.,38.,40.,42.,44.,46.,48.,50.,55.,60.,65.,70.,75.,80.,85.,90.};
352  // double Pbins[18] ={0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.2,1.4,1.6,1.8,2.0,2.5,3.0};
353 
354 
355  h_Ev_den = tfs->make<TH1D>("h_Ev_den","Neutrino Energy; Neutrino Energy (GeV); Shower Reconstruction Efficiency",20,E_bins);
356  h_Ev_den->Sumw2();
357  h_Ev_num = tfs->make<TH1D>("h_Ev_num","Neutrino Energy; Neutrino Energy (GeV); Shower Reconstruction Efficiency",20,E_bins);
358  h_Ev_num->Sumw2();
359  h_Ev_num_dEdx = tfs->make<TH1D>("h_Ev_num_dEdx","Neutrino Energy; Neutrino Energy (GeV); Shower Reconstruction Efficiency",20,E_bins);
360  h_Ev_num_dEdx->Sumw2();
361 
362  h_Ee_den = tfs->make<TH1D>("h_Ee_den","Electron Energy; Electron Energy (GeV); Shower Reconstruction Efficiency",20,E_bins);
363  h_Ee_den->Sumw2();
364  h_Ee_num = tfs->make<TH1D>("h_Ee_num","Electron Energy; Electron Energy (GeV); Shower Reconstruction Efficiency",20,E_bins);
365  h_Ee_num->Sumw2();
366  h_Ee_num_dEdx = tfs->make<TH1D>("h_Ee_num_dEdx","Electron Energy; Electron Energy (GeV); Shower Reconstruction Efficiency",20,E_bins);
367  h_Ee_num_dEdx->Sumw2();
368 
369  h_Pe_den = tfs->make<TH1D>("h_Pe_den","Electron Momentum; Electron Momentum (GeV); Shower reconstruction Efficiency",20,E_bins);
370  h_Pe_den->Sumw2();
371  h_Pe_num = tfs->make<TH1D>("h_Pe_num","Electron Momentum; Electron Momentum (GeV); Shower reconstruction Efficiency",20,E_bins);
372  h_Pe_num->Sumw2();
373 
374  h_theta_den = tfs->make<TH1D>("h_theta_den","CosTheta; CosTheta w.r.t beam direction (Degrees); Shower reconstruction Efficiency",43,theta_bin);
375  h_theta_den->Sumw2();
376  h_theta_num = tfs->make<TH1D>("h_theta_num","CosTheta; CosTheta w.r.t beam direction (Degrees); Shower reconstruction Efficiency",43,theta_bin);
377  h_theta_num->Sumw2();
378 
379  h_Efrac_shContamination = tfs->make<TH1D>("h_Efrac_shContamination","Efrac Lepton; Energy fraction (contamination);",60,0,1.2);
380  h_Efrac_shContamination->Sumw2();
381  h_Efrac_shPurity = tfs->make<TH1D>("h_Efrac_shPurity","Efrac Lepton; Energy fraction (Purity);",60,0,1.2);
382  h_Efrac_shPurity->Sumw2();
383  h_Ecomplet_lepton = tfs->make<TH1D>("h_Ecomplet_lepton","Ecomplet Lepton; Shower Completeness;",60,0,1.2);
384  h_Ecomplet_lepton->Sumw2();
385 
386  h_HighestHitsProducedParticlePDG_NueCC= tfs->make<TH1D>("h_HighestHitsProducedParticlePDG_NueCC","PDG Code; PDG Code;",4,-0.5,3.5);//0 for undefined, 1=electron, 2=photon, 3=anything else //Signal
388  h_HighestHitsProducedParticlePDG_bkg= tfs->make<TH1D>("h_HighestHitsProducedParticlePDG_bkg","PDG Code; PDG Code;",4,-0.5,3.5);//0 for undefined, 1=electron, 2=photon, 3=anything else //bkg
390 
391 
392  h_Efrac_NueCCPurity= tfs->make<TH1D>("h_Efrac_NueCCPurity","Efrac NueCC; Energy fraction (Purity);",60,0,1.2); //Signal
393  h_Efrac_NueCCPurity->Sumw2();
394  h_Ecomplet_NueCC= tfs->make<TH1D>("h_Ecomplet_NueCC","Ecomplet NueCC; Shower Completeness;",60,0,1.2);
395  h_Ecomplet_NueCC->Sumw2();
396 
397 
398  h_Efrac_bkgPurity= tfs->make<TH1D>("h_Efrac_bkgPurity","Efrac bkg; Energy fraction (Purity);",60,0,1.2); //Background
399  h_Efrac_bkgPurity->Sumw2();
400  h_Ecomplet_bkg= tfs->make<TH1D>("h_Ecomplet_bkg","Ecomplet bkg; Shower Completeness;",60,0,1.2);
401  h_Ecomplet_bkg->Sumw2();
402 
403 
404 
405  h_esh_bestplane_NueCC=tfs->make<TH1D>("h_esh_bestplane_NueCC","Best plane; Best plane;",4,-0.5,3.5);
406  h_esh_bestplane_NC=tfs->make<TH1D>("h_esh_bestplane_NC","Best plane; Best plane;",4,-0.5,3.5);
407  h_dEdX_electronorpositron_NueCC=tfs->make<TH1D>("h_dEdX_electronorpositron_NueCC","dE/dX; Electron or Positron dE/dX (MeV/cm);",100,0.0,15.0);
408  h_dEdX_electronorpositron_NC=tfs->make<TH1D>("h_dEdX_electronorpositron_NC","dE/dX; Electron or Positron dE/dX (MeV/cm);",100,0.0,15.0);
409  h_dEdX_photon_NueCC=tfs->make<TH1D>("h_dEdX_photon_NueCC","dE/dX; photon dE/dX (MeV/cm);",100,0.0,15.0);
410  h_dEdX_photon_NC=tfs->make<TH1D>("h_dEdX_photon_NC","dE/dX; photon dE/dX (MeV/cm);",100,0.0,15.0);
411  h_dEdX_proton_NueCC=tfs->make<TH1D>("h_dEdX_proton_NueCC","dE/dX; proton dE/dX (MeV/cm);",100,0.0,15.0);
412  h_dEdX_proton_NC=tfs->make<TH1D>("h_dEdX_proton_NC","dE/dX; proton dE/dX (MeV/cm);",100,0.0,15.0);
413  h_dEdX_neutron_NueCC=tfs->make<TH1D>("h_dEdX_neutron_NueCC","dE/dX; neutron dE/dX (MeV/cm);",100,0.0,15.0);
414  h_dEdX_neutron_NC=tfs->make<TH1D>("h_dEdX_neutron_NC","dE/dX; neutron dE/dX (MeV/cm);",100,0.0,15.0);
415  h_dEdX_chargedpion_NueCC=tfs->make<TH1D>("h_dEdX_chargedpion_NueCC","dE/dX; charged pion dE/dX (MeV/cm);",100,0.0,15.0);
416  h_dEdX_chargedpion_NC=tfs->make<TH1D>("h_dEdX_chargedpion_NC","dE/dX; charged pion dE/dX (MeV/cm);",100,0.0,15.0);
417  h_dEdX_neutralpion_NueCC=tfs->make<TH1D>("h_dEdX_neutralpion_NueCC","dE/dX; neutral pion dE/dX (MeV/cm);",100,0.0,15.0);
418  h_dEdX_neutralpion_NC=tfs->make<TH1D>("h_dEdX_neutralpion_NC","dE/dX; neutral pion dE/dX (MeV/cm);",100,0.0,15.0);
419  h_dEdX_everythingelse_NueCC=tfs->make<TH1D>("h_dEdX_everythingelse_NueCC","dE/dX; everythingelse dE/dX (MeV/cm);",100,0.0,15.0);
420  h_dEdX_everythingelse_NC=tfs->make<TH1D>("h_dEdX_everythingelse_NC","dE/dX; everythingelse dE/dX (MeV/cm);",100,0.0,15.0);
421 
422  h_dEdXasymm_electronorpositron_NueCC=tfs->make<TH1D>("h_dEdXasymm_electronorpositron_NueCC","dE/dX asymmetry; Electron or Positron dE/dX asymmetry;",60,0.0,1.2);
423  h_dEdXasymm_photon_NC=tfs->make<TH1D>("h_dEdXasymm_photon_NC","dE/dX asymmetry; photon dE/dx asymmetry;",60,0.0,1.2);
424 
425  h_mpi0_electronorpositron_NueCC=tfs->make<TH1D>("h_mpi0_electronorpositron_NueCC","m(#gamma#gamma); Electron or Positron dE/dX (MeV/cm);",100,0,1);
426  h_mpi0_photon_NC=tfs->make<TH1D>("h_mpi0_photon_NC","m(#gamma#gamma); Electron or Positron dE/dX (MeV/cm);",100,0,1);
427 
428  h_esh_bestplane_NueCC->Sumw2();
429  h_esh_bestplane_NC->Sumw2();
432  h_dEdX_photon_NueCC->Sumw2();
433  h_dEdX_photon_NC->Sumw2();
434  h_dEdX_proton_NueCC->Sumw2();
435  h_dEdX_proton_NC->Sumw2();
436  h_dEdX_neutron_NueCC->Sumw2();
437  h_dEdX_neutron_NC->Sumw2();
438  h_dEdX_chargedpion_NueCC->Sumw2();
439  h_dEdX_chargedpion_NC->Sumw2();
440  h_dEdX_neutralpion_NueCC->Sumw2();
441  h_dEdX_neutralpion_NC->Sumw2();
443  h_dEdX_everythingelse_NC->Sumw2();
444 
446  h_dEdXasymm_photon_NC->Sumw2();
447 
449  h_mpi0_photon_NC->Sumw2();
450 
451  h_trklike_em = tfs->make<TH1D>("h_trklike_em","EM hits; Track-like Score;",100,0,1);
452  h_trklike_nonem = tfs->make<TH1D>("h_trklike_nonem","Non-EM hits; Track-like Score;",100,0,1);
453 
454 
455  //Study the constheta angle between the reconstructed shower direction w.r.t MC true particle direction
456  h_CosThetaShDirwrtTrueparticle_electronorpositron_NueCC=tfs->make<TH1D>("h_CosThetaShDirwrtTrueparticle_electronorpositron_NueCC","CosTheta; cos#theta;",110,-1.1,1.1);
457  h_CosThetaShDirwrtTrueparticle_electronorpositron_NC=tfs->make<TH1D>("h_CosThetaShDirwrtTrueparticle_electronorpositron_NC","CosTheta;cos#theta;",110,-1.1,1.1);
458  h_CosThetaShDirwrtTrueparticle_photon_NueCC=tfs->make<TH1D>("h_CosThetaShDirwrtTrueparticle_photon_NueCC","CosTheta;cos#theta;",110,-1.1,1.1);
459  h_CosThetaShDirwrtTrueparticle_photon_NC=tfs->make<TH1D>("h_CosThetaShDirwrtTrueparticle_photon_NC","CosTheta;cos#theta;",110,-1.1,1.1);
460  h_CosThetaShDirwrtTrueparticle_proton_NueCC=tfs->make<TH1D>("h_CosThetaShDirwrtTrueparticle_proton_NueCC","CosTheta;cos#theta;",110,-1.1,1.1);
461  h_CosThetaShDirwrtTrueparticle_proton_NC=tfs->make<TH1D>("h_CosThetaShDirwrtTrueparticle_proton_NC","CosTheta;cos#theta;",110,-1.1,1.1);
462  h_CosThetaShDirwrtTrueparticle_chargedpion_NueCC=tfs->make<TH1D>("h_CosThetaShDirwrtTrueparticle_chargedpion_NueCC","CosTheta;cos#theta;",110,-1.1,1.1);
463  h_CosThetaShDirwrtTrueparticle_chargedpion_NC=tfs->make<TH1D>("h_CosThetaShDirwrtTrueparticle_chargedpion_NC","CosTheta;cos#theta;",110,-1.1,1.1);
464 
465  //Study the reconstructed shower start position (x,y,z) w.r.t MC true particle start position
466  h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NueCC=tfs->make<TH1D>("h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NueCC","ShVx-TrueParticleVx; ShVx-TrueParticleVx (cm);",100,-5.0,5.0);
467  h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NueCC=tfs->make<TH1D>("h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NueCC","ShVy-TrueParticleVy; ShVy-TrueParticleVy (cm);",100,-5.0,5.0);
468  h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NueCC=tfs->make<TH1D>("h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NueCC","ShVz-TrueParticleVz; ShVz-TrueParticleVz (cm);",100,-5.0,5.0);
469 
470  h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NC=tfs->make<TH1D>("h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NC","ShVx-TrueParticleVx; ShVx-TrueParticleVx (cm);",100,-5.0,5.0);
471  h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NC=tfs->make<TH1D>("h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NC","ShVy-TrueParticleVy; ShVy-TrueParticleVy (cm);",100,-5.0,5.0);
472  h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NC=tfs->make<TH1D>("h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NC","ShVz-TrueParticleVz; ShVz-TrueParticleVz (cm);",100,-5.0,5.0);
473 
474 
475  h_ShStartXwrtTrueparticleStartXDiff_photon_NueCC=tfs->make<TH1D>("h_ShStartXwrtTrueparticleStartXDiff_photon_NueCC","ShVx-TrueParticleVx; ShVx-TrueParticleVx (cm);",100,-5.0,5.0);
476  h_ShStartYwrtTrueparticleStartYDiff_photon_NueCC=tfs->make<TH1D>("h_ShStartYwrtTrueparticleStartYDiff_photon_NueCC","ShVy-TrueParticleVy; ShVy-TrueParticleVy (cm);",100,-5.0,5.0);
477  h_ShStartZwrtTrueparticleStartZDiff_photon_NueCC=tfs->make<TH1D>("h_ShStartZwrtTrueparticleStartZDiff_photon_NueCC","ShVz-TrueParticleVz; ShVz-TrueParticleVz (cm);",100,-5.0,5.0);
478 
479  h_ShStartXwrtTrueparticleStartXDiff_photon_NC=tfs->make<TH1D>("h_ShStartXwrtTrueparticleStartXDiff_photon_NC","ShVx-TrueParticleVx; ShVx-TrueParticleVx (cm);",100,-5.0,5.0);
480  h_ShStartYwrtTrueparticleStartYDiff_photon_NC=tfs->make<TH1D>("h_ShStartYwrtTrueparticleStartYDiff_photon_NC","ShVy-TrueParticleVy; ShVy-TrueParticleVy (cm);",100,-5.0,5.0);
481  h_ShStartZwrtTrueparticleStartZDiff_photon_NC=tfs->make<TH1D>("h_ShStartZwrtTrueparticleStartZDiff_photon_NC","ShVz-TrueParticleVz; ShVz-TrueParticleVz (cm);",100,-5.0,5.0);
482 
483 
484 
485 
486  h_ShStartXwrtTrueparticleEndXDiff_photon_NueCC=tfs->make<TH1D>("h_ShStartXwrtTrueparticleEndXDiff_photon_NueCC","ShVx-TrueParticleVx; ShVx-TrueParticleVx (cm);",100,-5.0,5.0);
487  h_ShStartYwrtTrueparticleEndYDiff_photon_NueCC=tfs->make<TH1D>("h_ShStartYwrtTrueparticleEndYDiff_photon_NueCC","ShVy-TrueParticleVy; ShVy-TrueParticleVy (cm);",100,-5.0,5.0);
488  h_ShStartZwrtTrueparticleEndZDiff_photon_NueCC=tfs->make<TH1D>("h_ShStartZwrtTrueparticleEndZDiff_photon_NueCC","ShVz-TrueParticleVz; ShVz-TrueParticleVz (cm);",100,-5.0,5.0);
489 
490  h_ShStartXwrtTrueparticleEndXDiff_photon_NC=tfs->make<TH1D>("h_ShStartXwrtTrueparticleEndXDiff_photon_NC","ShVx-TrueParticleVx; ShVx-TrueParticleVx (cm);",100,-5.0,5.0);
491  h_ShStartYwrtTrueparticleEndYDiff_photon_NC=tfs->make<TH1D>("h_ShStartYwrtTrueparticleEndYDiff_photon_NC","ShVy-TrueParticleVy; ShVy-TrueParticleVy (cm);",100,-5.0,5.0);
492  h_ShStartZwrtTrueparticleEndZDiff_photon_NC=tfs->make<TH1D>("h_ShStartZwrtTrueparticleEndZDiff_photon_NC","ShVz-TrueParticleVz; ShVz-TrueParticleVz (cm);",100,-5.0,5.0);
493 
494 
495  h_ShStartXwrtTrueparticleStartXDiff_proton_NueCC=tfs->make<TH1D>("h_ShStartXwrtTrueparticleStartXDiff_proton_NueCC","ShVx-TrueParticleVx; ShVx-TrueParticleVx (cm);",100,-5.0,5.0);
496  h_ShStartYwrtTrueparticleStartYDiff_proton_NueCC=tfs->make<TH1D>("h_ShStartYwrtTrueparticleStartYDiff_proton_NueCC","ShVy-TrueParticleVy; ShVy-TrueParticleVy (cm);",100,-5.0,5.0);
497  h_ShStartZwrtTrueparticleStartZDiff_proton_NueCC=tfs->make<TH1D>("h_ShStartZwrtTrueparticleStartZDiff_proton_NueCC","ShVz-TrueParticleVz; ShVz-TrueParticleVz (cm);",100,-5.0,5.0);
498 
499  h_ShStartXwrtTrueparticleStartXDiff_proton_NC=tfs->make<TH1D>("h_ShStartXwrtTrueparticleStartXDiff_proton_NC","ShVx-TrueParticleVx; ShVx-TrueParticleVx (cm);",100,-5.0,5.0);
500  h_ShStartYwrtTrueparticleStartYDiff_proton_NC=tfs->make<TH1D>("h_ShStartYwrtTrueparticleStartYDiff_proton_NC","ShVy-TrueParticleVy; ShVy-TrueParticleVy (cm);",100,-5.0,5.0);
501  h_ShStartZwrtTrueparticleStartZDiff_proton_NC=tfs->make<TH1D>("h_ShStartZwrtTrueparticleStartZDiff_proton_NC","ShVz-TrueParticleVz; ShVz-TrueParticleVz (cm);",100,-5.0,5.0);
502 
503 
504 
505  h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NueCC=tfs->make<TH1D>("h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NueCC","ShVx-TrueParticleVx; ShVx-TrueParticleVx (cm);",100,-5.0,5.0);
506  h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NueCC=tfs->make<TH1D>("h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NueCC","ShVy-TrueParticleVy; ShVy-TrueParticleVy (cm);",100,-5.0,5.0);
507  h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NueCC=tfs->make<TH1D>("h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NueCC","ShVz-TrueParticleVz; ShVz-TrueParticleVz (cm);",100,-5.0,5.0);
508 
509  h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NC=tfs->make<TH1D>("h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NC","ShVx-TrueParticleVx; ShVx-TrueParticleVx (cm);",100,-5.0,5.0);
510  h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NC=tfs->make<TH1D>("h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NC","ShVy-TrueParticleVy; ShVy-TrueParticleVy (cm);",100,-5.0,5.0);
511  h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NC=tfs->make<TH1D>("h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NC","ShVz-TrueParticleVz; ShVz-TrueParticleVz (cm);",100,-5.0,5.0);
512 
513 
514  //Study the constheta angle between the reconstructed shower direction w.r.t MC true particle direction
523 
524  //Study the reconstructed shower start position (x,y,z) w.r.t MC true particle start position
528 
532 
536 
540 
541 
545 
549 
550 
554 
558 
562 
566 
567 
568 
569 
570 
571 
572 
573  if( fSaveMCTree ){
574  fEventTree = new TTree("Event", "Event Tree from Sim & Reco");
575  fEventTree->Branch("eventNo", &Event);
576  fEventTree->Branch("runNo", &Run);
577  fEventTree->Branch("subRunNo", &SubRun);
578  fEventTree->Branch("mc_incoming_PDG", &MC_incoming_PDG);
579  fEventTree->Branch("mc_lepton_PDG", &MC_lepton_PDG);
580  fEventTree->Branch("mc_isCC", &MC_isCC);
581  fEventTree->Branch("mc_target", &MC_target);
582  fEventTree->Branch("mc_channel", &MC_channel);
583  fEventTree->Branch("mc_Q2", &MC_Q2);
584  fEventTree->Branch("mc_W", &MC_W);
585  fEventTree->Branch("mc_vertex", &MC_vertex, "mc_vertex[4]/D");
586  fEventTree->Branch("mc_incoming_P", &MC_incoming_P, "mc_incoming_P[4]/D");
587  fEventTree->Branch("mc_lepton_startMomentum", &MC_lepton_startMomentum, "mc_lepton_startMomentum[4]/D");
588  fEventTree->Branch("mc_lepton_endMomentum", &MC_lepton_endMomentum, "mc_lepton_endMomentum[4]/D");
589  fEventTree->Branch("mc_lepton_startXYZT", &MC_lepton_startXYZT, "mc_lepton_startXYZT[4]/D");
590  fEventTree->Branch("mc_lepton_endXYZT", &MC_lepton_endXYZT, "mc_lepton_endXYZT[4]/D");
591  fEventTree->Branch("mc_lepton_theta", &MC_lepton_theta, "mc_lepton_theta/D");
592  fEventTree->Branch("mc_leptonID", &MC_leptonID, "mc_leptonID/I");
593 
594  fEventTree->Branch("n_showers", &n_recoShowers);
595  fEventTree->Branch("sh_direction_X", &sh_direction_X, "sh_direction_X[n_showers]/D");
596  fEventTree->Branch("sh_direction_Y", &sh_direction_Y, "sh_direction_Y[n_showers]/D");
597  fEventTree->Branch("sh_direction_Z", &sh_direction_Z, "sh_direction_Z[n_showers]/D");
598  fEventTree->Branch("sh_start_X", &sh_start_X, "sh_start_X[n_showers]/D");
599  fEventTree->Branch("sh_start_Y", &sh_start_Y, "sh_start_Y[n_showers]/D");
600  fEventTree->Branch("sh_start_Z", &sh_start_Z, "sh_start_Z[n_showers]/D");
601  fEventTree->Branch("sh_energy", &sh_energy, "sh_energy[n_showers][3]/D");
602  fEventTree->Branch("sh_MIPenergy", &sh_MIPenergy, "sh_MIPenergy[n_showers][3]/D");
603  fEventTree->Branch("sh_dEdx", &sh_dEdx, "sh_dEdx[n_showers][3]/D");
604  fEventTree->Branch("sh_bestplane", &sh_bestplane, "sh_bestplane[n_showers]/I");
605  fEventTree->Branch("sh_length", &sh_length, "sh_length[n_showers]/D");
606  fEventTree->Branch("sh_hasPrimary_e", &sh_hasPrimary_e, "sh_hasPrimary_e[n_showers]/I");
607  fEventTree->Branch("sh_Efrac_contamination", &sh_Efrac_contamination, "sh_Efrac_contamination[n_showers]/D");
608  fEventTree->Branch("sh_purity",&sh_purity,"sh_purity[n_showers]/D");
609  fEventTree->Branch("sh_completeness",&sh_completeness,"sh_completeness[n_showers]/D");
610  fEventTree->Branch("sh_Efrac_best", &sh_Efrac_best, "sh_Efrac_best/D");
611  fEventTree->Branch("sh_nHits",&sh_nHits, "sh_nHits[n_showers]/I");
612  fEventTree->Branch("sh_largest",&sh_largest,"sh_largest/I");
613  fEventTree->Branch("sh_pdg",&sh_pdg,"sh_pdg[n_showers]/I");
614  fEventTree->Branch("sh_dEdxasymm", &sh_dEdxasymm, "sh_dEdxasymm[n_showers]/D");
615  fEventTree->Branch("sh_mpi0",&sh_mpi0,"sh_mpi0/D");
616  }
617 
618  }
TH1D * h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NC
double sh_energy[MAX_SHOWERS][3]
TH1D * h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NC
Geometry information for a single TPC.
Definition: TPCGeo.h:37
double sh_dEdx[MAX_SHOWERS][3]
TH1D * h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NueCC
TH1D * h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NueCC
TH1D * h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NueCC
T * make(ARGS...args) const
double sh_Efrac_contamination[MAX_SHOWERS]
TH1D * h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NC
Namespace collecting geometry-related classes utilities.
double sh_MIPenergy[MAX_SHOWERS][3]
void LocalToWorld(const double *tpc, double *world) const
Transform point from local TPC frame to world frame.
Definition: TPCGeo.h:490
TH1D * h_CosThetaShDirwrtTrueparticle_electronorpositron_NueCC
void DUNE::NeutrinoShowerEff::beginRun ( const art::Run run)

Definition at line 624 of file NeutrinoShowerEff_module.cc.

624  {
625  mf::LogInfo("NeutrinoShowerEff")<<"begin run..."<<endl;
626  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

Referenced by art::EDAnalyzer::doEvent(), and art::OutputModule::doWriteEvent().

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<size_t N>
void DUNE::NeutrinoShowerEff::checkCNNtrkshw ( const art::Event evt,
std::vector< art::Ptr< recob::Hit >>  all_hits 
)

Definition at line 1285 of file NeutrinoShowerEff_module.cc.

References anab::MVAReader< T, N >::create(), energy, fCNNEMModuleLabel, h_trklike_em, h_trklike_nonem, cheat::BackTrackerService::HitToEveTrackIDEs(), maxE, simb::MCParticle::PdgCode(), and cheat::ParticleInventoryService::TrackIdToParticle_P().

1285  {
1286  if (fCNNEMModuleLabel=="") return;
1287 
1290  //auto const* geo = lar::providerFrom<geo::Geometry>();
1291 
1293  if (hitResults){
1294  int trkLikeIdx = hitResults->getIndex("track");
1295  int emLikeIdx = hitResults->getIndex("em");
1296  if ((trkLikeIdx < 0) || (emLikeIdx < 0)){
1297  throw cet::exception("NeutrinoShowerEff") << "No em/track labeled columns in MVA data products." << std::endl;
1298  }
1299  //std::cout<<all_hits.size()<<std::endl;
1300  for (size_t i = 0; i<all_hits.size(); ++i){
1301  //find out if the hit was generated by an EM particle
1302  bool isEMparticle = false;
1303  int pdg = INT_MAX;
1304  std::vector<sim::TrackIDE> TrackIDs = bt_serv->HitToEveTrackIDEs(all_hits[i]);
1305  if (!TrackIDs.size()) continue;
1306 // raw::ChannelID_t channel = all_hits[i]->Channel();
1307 // bool firstwire = false;
1308 // std::vector<geo::WireID> wires = geo->ChannelToWire(channel);
1309 // for (auto &w : wires){
1310 // if (w.TPC == all_hits[i]->WireID().TPC){
1311 // if (w==all_hits[i]->WireID()) firstwire = true;
1312 // break;
1313 // }
1314 // }
1315  int trkid = INT_MAX;
1316  double maxE = -1;
1317  for(size_t k = 0; k < TrackIDs.size(); k++){
1318  if (TrackIDs[k].energy>maxE){
1319  maxE = TrackIDs[k].energy;
1320  trkid = TrackIDs[k].trackID;
1321  }
1322  }
1323  if (trkid!=INT_MAX){
1324  auto *particle = pi_serv->TrackIdToParticle_P(trkid);
1325  if (particle){
1326  pdg = particle->PdgCode();
1327  if (std::abs(pdg)==11||//electron/positron
1328  pdg == 22 ||//photon
1329  pdg == 111){//pi0
1330  isEMparticle = true;
1331  }
1332  }
1333  }
1334  auto vout = hitResults->getOutput(all_hits[i]);
1335  //std::cout<<i<<" "<<all_hits[i]->View()<<" "<<vout[0]<<" "<<vout[1]<<" "<<vout[2]<<" "<<vout[3]<<" "<<firstwire<<std::endl;
1336  double trk_like = -1, trk_or_em = vout[trkLikeIdx] + vout[emLikeIdx];
1337  if (trk_or_em > 0){
1338  trk_like = vout[trkLikeIdx] / trk_or_em;
1339  //std::cout<<"trk_like "<<trk_like<<std::endl;
1340  if (isEMparticle){
1341  h_trklike_em->Fill(trk_like);
1342 // if (trk_like>0.4&&trk_like<0.41){
1343 // std::cout<<std::string(all_hits[i]->WireID())<<" "<<all_hits[i]->PeakTime()<<std::endl;
1344 // std::cout<<vout[trkLikeIdx]<<" "<<vout[emLikeIdx]<<" "<<trk_like<<std::endl;
1345 // }
1346  }
1347  else{
1348  h_trklike_nonem->Fill(trk_like);
1349  }
1350  }
1351  }
1352  }
1353  else{
1354  std::cout<<"Couldn't get hitResults."<<std::endl;
1355  }
1356  }
const simb::MCParticle * TrackIdToParticle_P(int const &id)
int PdgCode() const
Definition: MCParticle.h:216
std::vector< TrackID > TrackIDs
double energy
Definition: plottest35.C:25
const std::vector< sim::TrackIDE > HitToEveTrackIDEs(recob::Hit const &hit)
double maxE
Definition: plot_hist.C:8
static std::unique_ptr< MVAReader > create(const art::Event &evt, const art::InputTag &tag)
Definition: MVAReader.h:110
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 147 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

148 {
149  if (!moduleContext_)
150  return ProductToken<T>::invalid();
151 
152  consumables_[BT].emplace_back(ConsumableType::Product,
153  TypeID{typeid(T)},
154  it.label(),
155  it.instance(),
156  it.process());
157  return ProductToken<T>{it};
158 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 162 of file Consumer.h.

163 {
164  if (!moduleContext_)
165  return;
166 
167  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
168 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 172 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

173 {
174  if (!moduleContext_)
175  return ViewToken<T>::invalid();
176 
177  consumables_[BT].emplace_back(ConsumableType::ViewElement,
178  TypeID{typeid(T)},
179  it.label(),
180  it.instance(),
181  it.process());
182  return ViewToken<T>{it};
183 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited

Definition at line 32 of file EngineCreator.cc.

References art::EngineCreator::rng().

34 {
35  return rng()->createEngine(
36  placeholder_schedule_id(), seed, kind_of_engine_to_make);
37 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited

Definition at line 40 of file EngineCreator.cc.

References art::EngineCreator::rng().

43 {
44  return rng()->createEngine(
45  placeholder_schedule_id(), seed, kind_of_engine_to_make, engine_label);
46 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
CurrentProcessingContext const * art::EDAnalyzer::currentContext ( ) const
protectedinherited

Definition at line 114 of file EDAnalyzer.cc.

References art::EDAnalyzer::current_context_.

Referenced by art::EDAnalyzer::workerType().

115  {
116  return current_context_.get();
117  }
CPC_exempt_ptr current_context_
Definition: EDAnalyzer.h:179
void DUNE::NeutrinoShowerEff::doEfficiencies ( )

Definition at line 1235 of file NeutrinoShowerEff_module.cc.

References h_Ee_den, h_Ee_num, h_Ee_num_dEdx, h_Eff_Ee, h_Eff_Ee_dEdx, h_Eff_Ev, h_Eff_Ev_dEdx, h_Eff_Pe, h_Eff_theta, h_Ev_den, h_Ev_num, h_Ev_num_dEdx, h_Pe_den, h_Pe_num, h_theta_den, h_theta_num, and art::TFileDirectory::make().

Referenced by endJob().

1235  {
1236 
1238 
1239  if(TEfficiency::CheckConsistency(*h_Ev_num,*h_Ev_den)){
1240  h_Eff_Ev = tfs->make<TEfficiency>(*h_Ev_num,*h_Ev_den);
1241  TGraphAsymmErrors *grEff_Ev = h_Eff_Ev->CreateGraph();
1242  grEff_Ev->Write("grEff_Ev");
1243  h_Eff_Ev->Write("h_Eff_Ev");
1244  }
1245 
1246  if(TEfficiency::CheckConsistency(*h_Ev_num_dEdx,*h_Ev_den)){
1247  h_Eff_Ev_dEdx = tfs->make<TEfficiency>(*h_Ev_num_dEdx,*h_Ev_den);
1248  TGraphAsymmErrors *grEff_Ev_dEdx = h_Eff_Ev_dEdx->CreateGraph();
1249  grEff_Ev_dEdx->Write("grEff_Ev_dEdx");
1250  h_Eff_Ev_dEdx->Write("h_Eff_Ev_dEdx");
1251  }
1252 
1253  if(TEfficiency::CheckConsistency(*h_Ee_num,*h_Ee_den)){
1254  h_Eff_Ee = tfs->make<TEfficiency>(*h_Ee_num,*h_Ee_den);
1255  TGraphAsymmErrors *grEff_Ee = h_Eff_Ee->CreateGraph();
1256  grEff_Ee->Write("grEff_Ee");
1257  h_Eff_Ee->Write("h_Eff_Ee");
1258  }
1259 
1260  if(TEfficiency::CheckConsistency(*h_Ee_num_dEdx,*h_Ee_den)){
1261  h_Eff_Ee_dEdx = tfs->make<TEfficiency>(*h_Ee_num_dEdx,*h_Ee_den);
1262  TGraphAsymmErrors *grEff_Ee_dEdx = h_Eff_Ee_dEdx->CreateGraph();
1263  grEff_Ee_dEdx->Write("grEff_Ee_dEdx");
1264  h_Eff_Ee_dEdx->Write("h_Eff_Ee_dEdx");
1265  }
1266 
1267  if(TEfficiency::CheckConsistency(*h_Pe_num,*h_Pe_den)){
1268  h_Eff_Pe = tfs->make<TEfficiency>(*h_Pe_num,*h_Pe_den);
1269  TGraphAsymmErrors *grEff_Pe = h_Eff_Pe->CreateGraph();
1270  grEff_Pe->Write("grEff_Pe");
1271  h_Eff_Pe->Write("h_Eff_Pe");
1272  }
1273  if(TEfficiency::CheckConsistency(*h_theta_num,*h_theta_den)){
1274  h_Eff_theta = tfs->make<TEfficiency>(*h_theta_num,*h_theta_den);
1275  TGraphAsymmErrors *grEff_theta = h_Eff_theta->CreateGraph();
1276  grEff_theta->Write("grEff_theta");
1277  h_Eff_theta->Write("h_Eff_theta");
1278  }
1279 
1280  }
T * make(ARGS...args) const
void DUNE::NeutrinoShowerEff::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 620 of file NeutrinoShowerEff_module.cc.

References doEfficiencies().

620  {
621  doEfficiencies();
622  }
EngineCreator::seed_t EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited

Definition at line 49 of file EngineCreator.cc.

References fhicl::ParameterSet::get().

Referenced by art::MixFilter< T >::initEngine_().

52 {
53  auto const& explicit_seeds = pset.get<std::vector<int>>(key, {});
54  return explicit_seeds.empty() ? implicit_seed : explicit_seeds.front();
55 }
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

Referenced by art::OutputModule::doWriteEvent().

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:34
bool DUNE::NeutrinoShowerEff::insideFV ( double  vertex[4])

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Definition at line 1210 of file NeutrinoShowerEff_module.cc.

References fFidVolXmax, fFidVolXmin, fFidVolYmax, fFidVolYmin, fFidVolZmax, fFidVolZmin, x, y, and z.

Referenced by processEff().

1210  {
1211 
1213  //This is temporarily we should define a common FV
1214  double x = vertex[0];
1215  double y = vertex[1];
1216  double z = vertex[2];
1217 
1218  /* if( fabs(x) > 350.0 ) return false;
1219  else if( fabs(y) > 550.0 ) return false;
1220  else if( z< 0 || z> 400.0 ) return false;
1221  else return true;
1222  */
1223 
1224  if (x>fFidVolXmin && x<fFidVolXmax&&
1225  y>fFidVolYmin && y<fFidVolYmax&&
1226  z>fFidVolZmin && z<fFidVolZmax)
1227  return true;
1228  else
1229  return false;
1230 
1231 
1232 
1233  }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
vertex reconstruction
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 190 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

191 {
192  if (!moduleContext_)
193  return ProductToken<T>::invalid();
194 
195  consumables_[BT].emplace_back(ConsumableType::Product,
196  TypeID{typeid(T)},
197  it.label(),
198  it.instance(),
199  it.process());
200  return ProductToken<T>{it};
201 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 205 of file Consumer.h.

206 {
207  if (!moduleContext_)
208  return;
209 
210  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
211 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 215 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

216 {
217  if (!moduleContext_)
218  return ViewToken<T>::invalid();
219 
220  consumables_[BT].emplace_back(ConsumableType::ViewElement,
221  TypeID{typeid(T)},
222  it.label(),
223  it.instance(),
224  it.process());
225  return ViewToken<T>{it};
226 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited

Definition at line 89 of file Consumer.cc.

References fhicl::ParameterSet::get_if_present().

Referenced by art::EDProducer::doBeginJob(), art::EDFilter::doBeginJob(), and art::EDAnalyzer::doBeginJob().

90 {
91  if (!moduleContext_)
92  return;
93 
94  pset.get_if_present("errorOnMissingConsumes", requireConsumes_);
95  for (auto& consumablesPerBranch : consumables_) {
96  cet::sort_all(consumablesPerBranch);
97  }
98 }
bool requireConsumes_
Definition: Consumer.h:137
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
void DUNE::NeutrinoShowerEff::processEff ( const art::Event evt,
bool &  isFiducial 
)

save neutrino's interaction info

save lepton

Definition at line 642 of file NeutrinoShowerEff_module.cc.

References sim::ParticleList::begin(), recob::Shower::best_plane(), simb::MCNeutrino::CCNC(), recob::Shower::dEdx(), recob::Shower::Direction(), art::InputTag::encode(), sim::ParticleList::end(), simb::MCParticle::EndMomentum(), simb::MCParticle::EndPosition(), simb::MCParticle::EndX(), simb::MCParticle::EndY(), simb::MCParticle::EndZ(), recob::Shower::Energy(), fHitModuleLabel, art::fill_ptr_vector(), fLeptonPDGcode, fMCTruthModuleLabel, fMinCompleteness, fNeutrinoPDGcode, fShowerModuleLabel, art::DataViewImpl::getByLabel(), simb::MCTruth::GetNeutrino(), h_CosThetaShDirwrtTrueparticle_chargedpion_NC, h_CosThetaShDirwrtTrueparticle_chargedpion_NueCC, h_CosThetaShDirwrtTrueparticle_electronorpositron_NC, h_CosThetaShDirwrtTrueparticle_electronorpositron_NueCC, h_CosThetaShDirwrtTrueparticle_photon_NC, h_CosThetaShDirwrtTrueparticle_photon_NueCC, h_CosThetaShDirwrtTrueparticle_proton_NC, h_CosThetaShDirwrtTrueparticle_proton_NueCC, h_dEdX_chargedpion_NC, h_dEdX_chargedpion_NueCC, h_dEdX_electronorpositron_NC, h_dEdX_electronorpositron_NueCC, h_dEdX_everythingelse_NC, h_dEdX_everythingelse_NueCC, h_dEdX_neutralpion_NC, h_dEdX_neutralpion_NueCC, h_dEdX_neutron_NC, h_dEdX_neutron_NueCC, h_dEdX_photon_NC, h_dEdX_photon_NueCC, h_dEdX_proton_NC, h_dEdX_proton_NueCC, h_dEdXasymm_electronorpositron_NueCC, h_dEdXasymm_photon_NC, h_Ecomplet_bkg, h_Ecomplet_lepton, h_Ecomplet_NueCC, h_Ee_den, h_Ee_num, h_Ee_num_dEdx, h_Efrac_bkgPurity, h_Efrac_NueCCPurity, h_Efrac_shContamination, h_Efrac_shPurity, h_esh_bestplane_NC, h_esh_bestplane_NueCC, h_Ev_den, h_Ev_num, h_Ev_num_dEdx, h_HighestHitsProducedParticlePDG_bkg, h_HighestHitsProducedParticlePDG_NueCC, h_mpi0_electronorpositron_NueCC, h_mpi0_photon_NC, h_Pe_den, h_Pe_num, h_ShStartXwrtTrueparticleEndXDiff_photon_NC, h_ShStartXwrtTrueparticleEndXDiff_photon_NueCC, h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NC, h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NueCC, h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NC, h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NueCC, h_ShStartXwrtTrueparticleStartXDiff_photon_NC, h_ShStartXwrtTrueparticleStartXDiff_photon_NueCC, h_ShStartXwrtTrueparticleStartXDiff_proton_NC, h_ShStartXwrtTrueparticleStartXDiff_proton_NueCC, h_ShStartYwrtTrueparticleEndYDiff_photon_NC, h_ShStartYwrtTrueparticleEndYDiff_photon_NueCC, h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NC, h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NueCC, h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NC, h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NueCC, h_ShStartYwrtTrueparticleStartYDiff_photon_NC, h_ShStartYwrtTrueparticleStartYDiff_photon_NueCC, h_ShStartYwrtTrueparticleStartYDiff_proton_NC, h_ShStartYwrtTrueparticleStartYDiff_proton_NueCC, h_ShStartZwrtTrueparticleEndZDiff_photon_NC, h_ShStartZwrtTrueparticleEndZDiff_photon_NueCC, h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NC, h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NueCC, h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NC, h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NueCC, h_ShStartZwrtTrueparticleStartZDiff_photon_NC, h_ShStartZwrtTrueparticleStartZDiff_photon_NueCC, h_ShStartZwrtTrueparticleStartZDiff_proton_NC, h_ShStartZwrtTrueparticleStartZDiff_proton_NueCC, h_theta_den, h_theta_num, hits(), insideFV(), simb::MCNeutrino::InteractionType(), recob::Shower::Length(), simb::MCNeutrino::Lepton(), maxE, MC_channel, MC_incoming_P, MC_incoming_PDG, MC_isCC, MC_lepton_endMomentum, MC_lepton_endXYZT, MC_lepton_PDG, MC_lepton_startMomentum, MC_lepton_startXYZT, MC_leptonID, MC_Q2, MC_target, MC_vertex, MC_W, recob::Shower::MIPEnergy(), simb::MCParticle::Momentum(), simb::MCParticle::Mother(), n_recoShowers, simb::MCTruth::NeutrinoSet(), simb::MCNeutrino::Nu(), simb::MCParticle::P(), cheat::ParticleInventoryService::ParticleList(), simb::MCParticle::PdgCode(), simb::MCParticle::Position(), simb::MCParticle::Px(), simb::MCParticle::Py(), simb::MCParticle::Pz(), simb::MCNeutrino::QSqr(), sh_bestplane, sh_completeness, sh_dEdx, sh_dEdxasymm, sh_direction_X, sh_direction_Y, sh_direction_Z, sh_Efrac_best, sh_Efrac_contamination, sh_energy, sh_hasPrimary_e, sh_largest, sh_length, sh_MIPenergy, sh_mpi0, sh_nHits, sh_pdg, sh_purity, sh_start_X, sh_start_Y, sh_start_Z, recob::Shower::ShowerStart(), simb::MCNeutrino::Target(), simb::MCParticle::TrackId(), truthMatcher(), simb::MCParticle::Vx(), simb::MCParticle::Vy(), simb::MCParticle::Vz(), and simb::MCNeutrino::W().

Referenced by analyze().

642  {
643 
646  event.getByLabel(fMCTruthModuleLabel, MCtruthHandle);
647  std::vector<art::Ptr<simb::MCTruth>> MCtruthlist;
648  art::fill_ptr_vector(MCtruthlist, MCtruthHandle);
649  art::Ptr<simb::MCTruth> MCtruth;
650 
651  //For now assume that there is only one neutrino interaction...
652  int MCinteractions = MCtruthlist.size();
653  for( int i =0; i<MCinteractions; i++){
654  MCtruth = MCtruthlist[i];
655  if( MCtruth->NeutrinoSet() ){
656  simb::MCNeutrino nu = MCtruth->GetNeutrino();
657  if( nu.CCNC() == 0 ) MC_isCC = 1;
658  else if ( nu.CCNC() == 1 ) MC_isCC = 0;
659  simb::MCParticle neutrino = nu.Nu();
660  MC_target = nu.Target();
661  MC_incoming_PDG = std::abs(nu.Nu().PdgCode());
662  MC_Q2 = nu.QSqr();
664  MC_W = nu.W();
665  const TLorentzVector& nu_momentum = nu.Nu().Momentum(0);
666  nu_momentum.GetXYZT(MC_incoming_P);
667  const TLorentzVector& vertex =neutrino.Position(0);
668  vertex.GetXYZT(MC_vertex);
669  simb::MCParticle lepton = nu.Lepton();
670  MC_lepton_PDG = lepton.PdgCode();
671  //cout<<"Incoming E "<<MC_incoming_P[3]<<" is CC? "<<MC_isCC<<" nuPDG "<<MC_incoming_PDG<<" target "<<MC_target<<" vtx "<<MC_vertex[0]<<" "<<MC_vertex[1]<<" "<<MC_vertex[2]<<" "<<MC_vertex[3]<<endl;
672  }
673  }
674 
676  simb::MCParticle *MClepton = NULL;
678  const sim::ParticleList& plist = pi_serv->ParticleList();
679  simb::MCParticle *particle=0;
680 
681  for( sim::ParticleList::const_iterator ipar = plist.begin(); ipar!=plist.end(); ++ipar){
682  particle = ipar->second;
683  if( std::abs(particle->PdgCode()) == fLeptonPDGcode && particle->Mother() == 0 ){ //primary lepton
684  const TLorentzVector& lepton_momentum =particle->Momentum(0);
685  const TLorentzVector& lepton_position =particle->Position(0);
686  const TLorentzVector& lepton_positionEnd = particle->EndPosition();
687  const TLorentzVector& lepton_momentumEnd = particle->EndMomentum();
688  lepton_momentum.GetXYZT(MC_lepton_startMomentum);
689  lepton_position.GetXYZT(MC_lepton_startXYZT);
690  lepton_positionEnd.GetXYZT(MC_lepton_endXYZT);
691  lepton_momentumEnd.GetXYZT(MC_lepton_endMomentum);
692  MC_leptonID = particle->TrackId();
693  MClepton = particle;
694  }
695  }
696  //Saving denominator histograms for lepton pions and protons
697  isFiducial =insideFV( MC_vertex );
698  if( !isFiducial ) return;
699  double Pe = sqrt(pow(MC_lepton_startMomentum[0],2)+pow(MC_lepton_startMomentum[1],2)+pow(MC_lepton_startMomentum[2],2));
700  double Pv = sqrt(pow(MC_incoming_P[0],2)+pow(MC_incoming_P[1],2)+pow(MC_incoming_P[2],2));
702  theta_e *= (180.0/3.14159);
703 
704  //save CC events within the fiducial volume with the favorite neutrino flavor
706  if( MClepton ){
707  h_Ev_den->Fill(MC_incoming_P[3]);
708  h_Ee_den->Fill(MC_lepton_startMomentum[3]);
709  h_Pe_den->Fill(Pe);
710  h_theta_den->Fill(theta_e);
711  }
712  }
713 
714  //========================================================================
715  //========================================================================
716  // Reco stuff
717  //========================================================================
718  //========================================================================
720  if(!event.getByLabel(fShowerModuleLabel,showerHandle)){
721  mf::LogError("NeutrinoShowerEff")<<"Could not find shower with label "<<fShowerModuleLabel.encode();
722  return;
723  }
724  std::vector<art::Ptr<recob::Shower>> showerlist;
725  art::fill_ptr_vector(showerlist, showerHandle);
726 
728  std::vector<art::Ptr<recob::Hit>> all_hits;
729  if(event.getByLabel(fHitModuleLabel,hitHandle)){
730  art::fill_ptr_vector(all_hits, hitHandle);
731  }
732 
733  n_recoShowers= showerlist.size();
734  //if ( n_recoShowers == 0 || n_recoShowers> MAX_SHOWERS ) return;
735  art::FindManyP<recob::Hit> sh_hitsAll(showerHandle, event, fShowerModuleLabel);
736  cout<<"Found this many showers "<<n_recoShowers<<endl;
737  double Efrac_contamination= 999.0;
738  double Efrac_contaminationNueCC= 999.0;
739 
740  double Ecomplet_lepton =0.0;
741  double Ecomplet_NueCC =0.0;
742  int ParticlePDG_HighestShHits=0;//undefined
743  int shower_bestplane=0;
744  double Showerparticlededx_inbestplane=0.0;
745  double dEdxasymm_largestshw = -1.;
746 
747  int showerPDGwithHighestHitsforFillingdEdX=0;//0=undefined,1=electronorpositronshower,2=photonshower,3=protonshower,4=neutronshower,5=chargedpionshower,6=neutralpionshower,7=everythingelseshower
748 
749 
750  double ShAngle=-9999.0,ShVxTrueParticleVxDiff=-9999.0,ShVyTrueParticleVyDiff=-9999.0,ShVzTrueParticleVzDiff=-9999.0, ShStartVxTrueParticleEndVxDiff=-9999.0,ShStartVyTrueParticleEndVyDiff=-9999.0,ShStartVzTrueParticleEndVzDiff=-9999.0;
751 
752  const simb::MCParticle *MClepton_reco = NULL;
753  int nHits =0;
754 
755  TVector3 p1, p2;
756  double E1st = 0;
757  double E2nd = 0;
758 
759  for(int i=0; i<n_recoShowers; i++){
760 
761  art::Ptr<recob::Shower> shower = showerlist[i];
762  sh_direction_X[i] = shower->Direction().X();
763  sh_direction_Y[i] = shower->Direction().Y();
764  sh_direction_Z[i] = shower->Direction().Z();
765  sh_start_X[i] = shower->ShowerStart().X();
766  sh_start_Y[i] = shower->ShowerStart().Y();
767  sh_start_Z[i] = shower->ShowerStart().Z();
768  sh_bestplane[i] = shower->best_plane();
769  sh_length[i] = shower->Length();
770  for( size_t j =0; j<shower->Energy().size(); j ++) sh_energy[i][j] = shower->Energy()[j];
771  for( size_t j =0; j<shower->MIPEnergy().size(); j++) sh_MIPenergy[i][j] = shower->MIPEnergy()[j];
772  for( size_t j =0; j<shower->dEdx().size(); j++) sh_dEdx[i][j] = shower->dEdx()[j];
773 
774  double dEdxasymm = -1;
775  double dEdx0 = 0;
776  if (shower->best_plane()>=0&&shower->best_plane()<int(shower->dEdx().size())){
777  dEdx0 = shower->dEdx()[shower->best_plane()];
778  }
779  double dEdx1 = 0;
780  double maxE = 0;
781  for (int j = 0; j<3; ++j){
782  if (j==shower->best_plane()) continue;
783  if (j>=int(shower->Energy().size())) continue;
784  if (shower->Energy()[j]>maxE){
785  maxE = shower->Energy()[j];
786  dEdx1 = shower->dEdx()[j];
787  }
788  }
789  if (dEdx0||dEdx1){
790  dEdxasymm = std::abs(dEdx0-dEdx1)/(dEdx0+dEdx1);
791  }
792  sh_dEdxasymm[i] = dEdxasymm;
793 
794  if (shower->best_plane()>=0 && shower->best_plane()<int(shower->Energy().size())){
795  if (shower->Energy()[shower->best_plane()]>E1st){
796  if (p1.Mag()){
797  E2nd = E1st;
798  p2 = p1;
799  }
800  E1st = shower->Energy()[shower->best_plane()];
801  p1[0] = E1st * shower->Direction().X();
802  p1[1] = E1st * shower->Direction().Y();
803  p1[2] = E1st * shower->Direction().Z();
804  }
805  else{
806  if (shower->Energy()[shower->best_plane()]>E2nd){
807  E2nd = shower->Energy()[shower->best_plane()];
808  p2[0] = E2nd * shower->Direction().X();
809  p2[1] = E2nd * shower->Direction().Y();
810  p2[2] = E2nd * shower->Direction().Z();
811  }
812  }
813  }
814 
815  std::vector<art::Ptr<recob::Hit>> sh_hits = sh_hitsAll.at(i);
816 
817  if (!sh_hits.size()){
818  //no shower hits found, try pfparticle
819  // PFParticles
821  std::vector<art::Ptr<recob::PFParticle> > pfps;
822  if (event.getByLabel(fShowerModuleLabel, pfpHandle))
823  art::fill_ptr_vector(pfps, pfpHandle);
824  // Clusters
826  std::vector<art::Ptr<recob::Cluster> > clusters;
827  if (event.getByLabel(fShowerModuleLabel, clusterHandle))
828  art::fill_ptr_vector(clusters, clusterHandle);
832  if (fmps.isValid()){
833  std::vector<art::Ptr<recob::PFParticle>> pfs = fmps.at(i);
834  for (size_t ipf = 0; ipf<pfs.size(); ++ipf){
835  if (fmcp.isValid()){
836  std::vector<art::Ptr<recob::Cluster>> clus = fmcp.at(pfs[ipf].key());
837  for (size_t iclu = 0; iclu<clus.size(); ++iclu){
838  if (fmhc.isValid()){
839  std::vector<art::Ptr<recob::Hit>> hits = fmhc.at(clus[iclu].key());
840  for (size_t ihit = 0; ihit<hits.size(); ++ihit){
841  sh_hits.push_back(hits[ihit]);
842  }
843  }
844  }
845  }
846  }
847  }
848  }
849  // std::cout<<" shower best plane:"<<shower->best_plane()<<" shower dEdx size:"<<shower->dEdx().size()<<std::endl;
850  //for( size_t j =0; j<shower->dEdx().size(); j++) std::cout<<shower->dEdx()[j]<<" ";
851 
852  const simb::MCParticle *particle;
853  double tmpEfrac_contamination = 0.0; //fraction of non EM energy contatiminatio (see truthMatcher for definition)
854  double tmpEcomplet =0;
855 
856  int tmp_nHits = sh_hits.size();
857 
858 
859  truthMatcher( all_hits, sh_hits, particle, tmpEfrac_contamination,tmpEcomplet);
860  //truthMatcher( all_hits, sh_hits, particle, tmpEfrac_contaminationNueCC,tmpEcompletNueCC );
861  if (!particle) continue;
862 
863  sh_Efrac_contamination[i] = tmpEfrac_contamination;
864  sh_purity[i] = 1 - tmpEfrac_contamination;
865  sh_completeness[i] = tmpEcomplet;
866  sh_nHits[i] = tmp_nHits;
867  sh_hasPrimary_e[i] = 0;
868  sh_pdg[i] = particle->PdgCode();
869 
870  //Shower with highest hits
871  if( tmp_nHits > nHits ){
872  sh_largest = i;
873  dEdxasymm_largestshw = dEdxasymm;
874  nHits = tmp_nHits;
875  Ecomplet_NueCC =tmpEcomplet;
876  Efrac_contaminationNueCC = tmpEfrac_contamination;
877  //Calculate Shower anagle w.r.t True particle
878  double ShDirMag = sqrt(pow(sh_direction_X[i],2)+pow(sh_direction_Y[i],2)+pow(sh_direction_Z[i],2));
879  ShAngle = (sh_direction_X[i]*particle->Px() + sh_direction_Y[i]*particle->Py() +sh_direction_Z[i]*particle->Pz())/(ShDirMag*particle->P()) ;
880 
881 
882  ShVxTrueParticleVxDiff=sh_start_X[i]-particle->Vx();
883  ShVyTrueParticleVyDiff=sh_start_Y[i]-particle->Vy();
884  ShVzTrueParticleVzDiff=sh_start_Z[i]-particle->Vz();
885 
886  //put overflow and underflow at top and bottom bins:
887  if (ShVxTrueParticleVxDiff > 5) ShVxTrueParticleVxDiff = 4.99;
888  else if (ShVxTrueParticleVxDiff < -5) ShVxTrueParticleVxDiff = -5;
889  if (ShVyTrueParticleVyDiff > 5) ShVyTrueParticleVyDiff = 4.99;
890  else if (ShVyTrueParticleVyDiff < -5) ShVyTrueParticleVyDiff = -5;
891  if (ShVzTrueParticleVzDiff > 5) ShVzTrueParticleVzDiff = 4.99;
892  else if (ShVzTrueParticleVzDiff < -5) ShVzTrueParticleVzDiff = -5;
893 
894 
895  ShStartVxTrueParticleEndVxDiff=sh_start_X[i]-particle->EndX();
896  ShStartVyTrueParticleEndVyDiff=sh_start_Y[i]-particle->EndY();
897  ShStartVzTrueParticleEndVzDiff=sh_start_Z[i]-particle->EndZ();
898 
899 
900  if(std::abs(particle->PdgCode())==11){
901  ParticlePDG_HighestShHits=1;
902  }else if(particle->PdgCode()==22){
903  ParticlePDG_HighestShHits=2;
904  }else{
905  ParticlePDG_HighestShHits=3;
906  }
907 
908 
909 
910  //dedx for different showers
911  //Highest hits shower pdg for the dEdx study 0=undefined,1=electronorpositronshower,2=photonshower,3=protonshower,4=neutronshower,5=chargedpionshower,6=neutralpionshower,7=everythingelseshower
912  shower_bestplane=shower->best_plane();
913  if (shower_bestplane<0 || shower_bestplane>=int(shower->dEdx().size())){
914  //bestplane is not set properly, just pick the first plane that has dEdx
915  for (size_t i = 0; i<shower->dEdx().size(); ++i){
916  if (shower->dEdx()[i]){
917  shower_bestplane = i;
918  break;
919  }
920  }
921  }
922  if (shower_bestplane<0 || shower_bestplane>=int(shower->dEdx().size())){
923  //still a problem? just set it to 0
924  shower_bestplane = 0;
925  }
926 
927  if (shower_bestplane>=0 and shower_bestplane<int(shower->dEdx().size()))
928  Showerparticlededx_inbestplane=shower->dEdx()[shower_bestplane];
929 
930  if(std::abs(particle->PdgCode())==11){//lepton shower
931  showerPDGwithHighestHitsforFillingdEdX=1;
932  }else if(particle->PdgCode()==22){//photon shower
933  showerPDGwithHighestHitsforFillingdEdX=2;
934  }else if(particle->PdgCode()==2212){//proton shower
935  showerPDGwithHighestHitsforFillingdEdX=3;
936  }else if(particle->PdgCode()==2112){//neutron shower
937  showerPDGwithHighestHitsforFillingdEdX=4;
938  }else if(std::abs(particle->PdgCode())==211){//charged pion shower
939  showerPDGwithHighestHitsforFillingdEdX=5;
940  }else if(particle->PdgCode()==111){//neutral pion shower
941  showerPDGwithHighestHitsforFillingdEdX=6;
942  }else{//everythingelse shower
943  showerPDGwithHighestHitsforFillingdEdX=7;
944  }
945 
946 
947  //Efrac_contamination = tmpEfrac_contamination;
948  //MClepton_reco = particle;
949  //sh_Efrac_best =Efrac_contamination;
950  //cout<<"this is the best shower "<<particle->PdgCode()<<" "<<particle->TrackId()<<" Efrac "<<tmpEfrac_contamination<<" "<<sh_hits.size()<<endl;
951  }
952 
953 
954 
955  if( particle->PdgCode() == fLeptonPDGcode && particle->TrackId() == MC_leptonID ) sh_hasPrimary_e[i] = 1;
956  //cout<<particle->PdgCode()<<" "<<particle->TrackId()<<" Efrac "<<tmpEfrac_contamination<<" "<<sh_hits.size()<<" "<<particle->TrackId()<<" "<<MC_leptonID<<endl;
957  //save the best shower based on non EM and number of hits
958 
959  if( std::abs(particle->PdgCode()) == fLeptonPDGcode && particle->TrackId() == MC_leptonID ){
960 
961  if(tmpEcomplet>Ecomplet_lepton){
962 
963  Ecomplet_lepton = tmpEcomplet;
964 
965  Efrac_contamination = tmpEfrac_contamination;
966  MClepton_reco = particle;
967  sh_Efrac_best =Efrac_contamination;
968 
969  }
970  }
971  }//end of looping all the showers
972 
973  if (p1.Mag()&&p2.Mag()){
974  sh_mpi0 = sqrt(pow(p1.Mag()+p2.Mag(),2)-(p1+p2).Mag2());
975  }
976  else sh_mpi0 = 0;
977 
978  if( MClepton_reco && MClepton ){
979  if( MC_isCC && (fNeutrinoPDGcode == std::abs(MC_incoming_PDG)) ){
980  h_Efrac_shContamination->Fill(Efrac_contamination);
981  h_Efrac_shPurity->Fill(1-Efrac_contamination);
982  h_Ecomplet_lepton->Fill(Ecomplet_lepton);
983 
984  // Selecting good showers requires completeness of gretaer than 70 % and Purity > 70 %
985  if( Efrac_contamination < fMaxEfrac && Ecomplet_lepton> fMinCompleteness ){
986 
987  h_Pe_num->Fill(Pe);
988  h_Ev_num->Fill(MC_incoming_P[3]);
989  h_Ee_num->Fill(MC_lepton_startMomentum[3]);
990  h_theta_num->Fill(theta_e);
991 
992  if (Showerparticlededx_inbestplane > 1 && Showerparticlededx_inbestplane < 3) {
993  h_Ev_num_dEdx->Fill(MC_incoming_P[3]);
994  h_Ee_num_dEdx->Fill(MC_lepton_startMomentum[3]);
995  }
996  }
997  }
998  }
999 
1000  //NueCC SIgnal and background Completeness
1001  if(MC_isCC==1
1002  &&(fNeutrinoPDGcode == std::abs(MC_incoming_PDG))
1003  &&isFiducial){
1004  h_HighestHitsProducedParticlePDG_NueCC->Fill(ParticlePDG_HighestShHits);
1005 
1006  if(ParticlePDG_HighestShHits>0){// atleat one shower is reconstructed
1007  h_Ecomplet_NueCC->Fill(Ecomplet_NueCC);
1008  h_Efrac_NueCCPurity->Fill(1-Efrac_contaminationNueCC);
1009 
1010  h_esh_bestplane_NueCC->Fill(shower_bestplane);
1011  if(showerPDGwithHighestHitsforFillingdEdX==1)//electron or positron shower
1012  {
1013  h_dEdX_electronorpositron_NueCC->Fill(Showerparticlededx_inbestplane);
1014  //Study the angle between the reconstructed shower direction w.r.t MC true particle direction
1016 
1017  //Study the reconstructed shower start position (x,y,z) w.r.t MC true particle start position
1021 
1022  h_dEdXasymm_electronorpositron_NueCC->Fill(dEdxasymm_largestshw);
1023 
1024  h_mpi0_electronorpositron_NueCC->Fill(sh_mpi0);
1025 
1026  }else if(showerPDGwithHighestHitsforFillingdEdX==2)//photon shower
1027  {
1028  h_dEdX_photon_NueCC->Fill(Showerparticlededx_inbestplane);
1030  h_ShStartXwrtTrueparticleStartXDiff_photon_NueCC->Fill(ShVxTrueParticleVxDiff);
1031  h_ShStartYwrtTrueparticleStartYDiff_photon_NueCC->Fill(ShVyTrueParticleVyDiff);
1032  h_ShStartZwrtTrueparticleStartZDiff_photon_NueCC->Fill(ShVzTrueParticleVzDiff);
1033 
1034 
1035  h_ShStartXwrtTrueparticleEndXDiff_photon_NueCC->Fill(ShStartVxTrueParticleEndVxDiff);
1036  h_ShStartYwrtTrueparticleEndYDiff_photon_NueCC->Fill(ShStartVyTrueParticleEndVyDiff);
1037  h_ShStartZwrtTrueparticleEndZDiff_photon_NueCC->Fill(ShStartVzTrueParticleEndVzDiff);
1038 
1039 
1040 
1041  }else if(showerPDGwithHighestHitsforFillingdEdX==3)//proton shower
1042  {
1043  h_dEdX_proton_NueCC->Fill(Showerparticlededx_inbestplane);
1045 
1046  h_ShStartXwrtTrueparticleStartXDiff_proton_NueCC->Fill(ShVxTrueParticleVxDiff);
1047  h_ShStartYwrtTrueparticleStartYDiff_proton_NueCC->Fill(ShVyTrueParticleVyDiff);
1048  h_ShStartZwrtTrueparticleStartZDiff_proton_NueCC->Fill(ShVzTrueParticleVzDiff);
1049 
1050 
1051  }else if(showerPDGwithHighestHitsforFillingdEdX==4)//neutron shower
1052  {
1053  h_dEdX_neutron_NueCC->Fill(Showerparticlededx_inbestplane);
1054 
1055  }else if(showerPDGwithHighestHitsforFillingdEdX==5)//charged pion shower
1056  {
1057  h_dEdX_chargedpion_NueCC->Fill(Showerparticlededx_inbestplane);
1059  h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NueCC->Fill(ShVxTrueParticleVxDiff);
1060  h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NueCC->Fill(ShVyTrueParticleVyDiff);
1061  h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NueCC->Fill(ShVzTrueParticleVzDiff);
1062 
1063  }else if(showerPDGwithHighestHitsforFillingdEdX==6)//neutral pion shower
1064  {
1065  h_dEdX_neutralpion_NueCC->Fill(Showerparticlededx_inbestplane);
1066  }else if(showerPDGwithHighestHitsforFillingdEdX==7)//everythingelse shower
1067  {
1068  h_dEdX_everythingelse_NueCC->Fill(Showerparticlededx_inbestplane);
1069  }
1070  }
1071  }
1072  else if(!MC_isCC&&
1073  isFiducial){
1074  h_HighestHitsProducedParticlePDG_bkg->Fill(ParticlePDG_HighestShHits);
1075 
1076 
1077  if(ParticlePDG_HighestShHits>0){
1078  h_Ecomplet_bkg->Fill(Ecomplet_NueCC);
1079  h_Efrac_bkgPurity->Fill(1-Efrac_contaminationNueCC);
1080 
1081 
1082  h_esh_bestplane_NC->Fill(shower_bestplane);
1083  if(showerPDGwithHighestHitsforFillingdEdX==1)//electron or positron shower
1084  {
1085  h_dEdX_electronorpositron_NC->Fill(Showerparticlededx_inbestplane);
1087 
1088 
1089  h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NC->Fill(ShVxTrueParticleVxDiff);
1090  h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NC->Fill(ShVyTrueParticleVyDiff);
1091  h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NC->Fill(ShVzTrueParticleVzDiff);
1092 
1093 
1094  }else if(showerPDGwithHighestHitsforFillingdEdX==2)//photon shower
1095  {
1096  h_dEdX_photon_NC->Fill(Showerparticlededx_inbestplane);
1098 
1099 
1100  h_ShStartXwrtTrueparticleStartXDiff_photon_NC->Fill(ShVxTrueParticleVxDiff);
1101  h_ShStartYwrtTrueparticleStartYDiff_photon_NC->Fill(ShVyTrueParticleVyDiff);
1102  h_ShStartZwrtTrueparticleStartZDiff_photon_NC->Fill(ShVzTrueParticleVzDiff);
1103 
1104  h_ShStartXwrtTrueparticleEndXDiff_photon_NC->Fill(ShStartVxTrueParticleEndVxDiff);
1105  h_ShStartYwrtTrueparticleEndYDiff_photon_NC->Fill(ShStartVyTrueParticleEndVyDiff);
1106  h_ShStartZwrtTrueparticleEndZDiff_photon_NC->Fill(ShStartVzTrueParticleEndVzDiff);
1107 
1108  h_dEdXasymm_photon_NC->Fill(dEdxasymm_largestshw);
1109 
1110  h_mpi0_photon_NC->Fill(sh_mpi0);
1111 
1112  }else if(showerPDGwithHighestHitsforFillingdEdX==3)//proton shower
1113  {
1114  h_dEdX_proton_NC->Fill(Showerparticlededx_inbestplane);
1116 
1117  h_ShStartXwrtTrueparticleStartXDiff_proton_NC->Fill(ShVxTrueParticleVxDiff);
1118  h_ShStartYwrtTrueparticleStartYDiff_proton_NC->Fill(ShVyTrueParticleVyDiff);
1119  h_ShStartZwrtTrueparticleStartZDiff_proton_NC->Fill(ShVzTrueParticleVzDiff);
1120 
1121 
1122 
1123 
1124  }else if(showerPDGwithHighestHitsforFillingdEdX==4)//neutron shower
1125  {
1126  h_dEdX_neutron_NC->Fill(Showerparticlededx_inbestplane);
1127  }else if(showerPDGwithHighestHitsforFillingdEdX==5)//charged pion shower
1128  {
1129  h_dEdX_chargedpion_NC->Fill(Showerparticlededx_inbestplane);
1131  h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NC->Fill(ShVxTrueParticleVxDiff);
1132  h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NC->Fill(ShVyTrueParticleVyDiff);
1133  h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NC->Fill(ShVzTrueParticleVzDiff);
1134 
1135 
1136  }else if(showerPDGwithHighestHitsforFillingdEdX==6)//neutral pion shower
1137  {
1138  h_dEdX_neutralpion_NC->Fill(Showerparticlededx_inbestplane);
1139  }else if(showerPDGwithHighestHitsforFillingdEdX==7)//everythingelse shower
1140  {
1141  h_dEdX_everythingelse_NC->Fill(Showerparticlededx_inbestplane);
1142  }
1143  }//if(ParticlePDG_HighestShHits>0)
1144  }//else if(!MC_isCC&&isFiducial)
1145 
1146  checkCNNtrkshw<4>(event, all_hits);
1147  }
int best_plane() const
Definition: Shower.h:200
TH1D * h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NC
const TVector3 & ShowerStart() const
Definition: Shower.h:192
const TLorentzVector & Position(const int i=0) const
Definition: MCParticle.h:223
int PdgCode() const
Definition: MCParticle.h:216
int CCNC() const
Definition: MCNeutrino.h:152
double QSqr() const
Definition: MCNeutrino.h:161
const simb::MCNeutrino & GetNeutrino() const
Definition: MCTruth.h:74
double Py(const int i=0) const
Definition: MCParticle.h:235
double sh_energy[MAX_SHOWERS][3]
const TLorentzVector & EndPosition() const
Definition: MCParticle.h:229
double EndZ() const
Definition: MCParticle.h:232
void truthMatcher(std::vector< art::Ptr< recob::Hit >>all_hits, std::vector< art::Ptr< recob::Hit >> shower_hits, const simb::MCParticle *&MCparticle, double &Efrac, double &Ecomplet)
double Length() const
Definition: Shower.h:201
int Mother() const
Definition: MCParticle.h:217
const simb::MCParticle & Nu() const
Definition: MCNeutrino.h:150
TH1D * h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NC
list_type::const_iterator const_iterator
Definition: ParticleList.h:132
const std::vector< double > & Energy() const
Definition: Shower.h:195
double Px(const int i=0) const
Definition: MCParticle.h:234
double sh_dEdx[MAX_SHOWERS][3]
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
double EndY() const
Definition: MCParticle.h:231
TH1D * h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NueCC
int TrackId() const
Definition: MCParticle.h:214
TH1D * h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NueCC
int InteractionType() const
Definition: MCNeutrino.h:154
void hits()
Definition: readHits.C:15
const simb::MCParticle & Lepton() const
Definition: MCNeutrino.h:151
double W() const
Definition: MCNeutrino.h:158
const std::vector< double > & dEdx() const
Definition: Shower.h:203
const std::vector< double > & MIPEnergy() const
Definition: Shower.h:198
std::string encode() const
Definition: InputTag.cc:36
double P(const int i=0) const
Definition: MCParticle.h:238
iterator begin()
Definition: ParticleList.h:305
const TVector3 & Direction() const
Definition: Shower.h:189
TH1D * h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NueCC
double Vx(const int i=0) const
Definition: MCParticle.h:225
int Target() const
Definition: MCNeutrino.h:155
const TLorentzVector & Momentum(const int i=0) const
Definition: MCParticle.h:224
double Pz(const int i=0) const
Definition: MCParticle.h:236
double Vz(const int i=0) const
Definition: MCParticle.h:227
bool NeutrinoSet() const
Definition: MCTruth.h:75
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
double maxE
Definition: plot_hist.C:8
double EndX() const
Definition: MCParticle.h:230
double sh_Efrac_contamination[MAX_SHOWERS]
TH1D * h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NC
Event generator information.
Definition: MCNeutrino.h:18
double sh_MIPenergy[MAX_SHOWERS][3]
const TLorentzVector & EndMomentum() const
Definition: MCParticle.h:244
double Vy(const int i=0) const
Definition: MCParticle.h:226
Event finding and building.
TH1D * h_CosThetaShDirwrtTrueparticle_electronorpositron_NueCC
vertex reconstruction
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void DUNE::NeutrinoShowerEff::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 285 of file NeutrinoShowerEff_module.cc.

References fCNNEMModuleLabel, fFidVolCutX, fFidVolCutY, fFidVolCutZ, fHitModuleLabel, fLeptonPDGcode, fMaxEfrac, fMaxNeutrinoE, fMCTruthModuleLabel, fMinCompleteness, fNeutrinoPDGcode, fSaveMCTree, fShowerModuleLabel, and fhicl::ParameterSet::get().

Referenced by NeutrinoShowerEff().

285  {
286 
287 
288  fMCTruthModuleLabel = p.get<art::InputTag>("MCTruthModuleLabel");
289  fHitModuleLabel = p.get<art::InputTag>("HitModuleLabel");
290  fShowerModuleLabel = p.get<art::InputTag>("ShowerModuleLabel");
291  fCNNEMModuleLabel = p.get<art::InputTag>("CNNEMModuleLabel","");
292  fLeptonPDGcode = p.get<int>("LeptonPDGcode");
293  fNeutrinoPDGcode = p.get<int>("NeutrinoPDGcode");
294  fMaxNeutrinoE = p.get<double>("MaxNeutrinoE");
295  fMaxEfrac = p.get<double>("MaxEfrac");
296  fMinCompleteness = p.get<double>("MinCompleteness");
297  fSaveMCTree = p.get<bool>("SaveMCTree");
298  fFidVolCutX = p.get<float>("FidVolCutX");
299  fFidVolCutY = p.get<float>("FidVolCutY");
300  fFidVolCutZ = p.get<float>("FidVolCutZ");}
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

36  {}
void DUNE::NeutrinoShowerEff::reset ( void  )

Definition at line 1360 of file NeutrinoShowerEff_module.cc.

References DEFINE_ART_MODULE, MAX_SHOWERS, MC_channel, MC_incoming_PDG, MC_isCC, MC_lepton_PDG, MC_lepton_theta, MC_leptonID, MC_LeptonTrack, MC_Q2, MC_target, MC_W, sh_bestplane, sh_completeness, sh_dEdx, sh_dEdxasymm, sh_direction_X, sh_direction_Y, sh_direction_Z, sh_Efrac_contamination, sh_energy, sh_hasPrimary_e, sh_largest, sh_length, sh_MIPenergy, sh_mpi0, sh_nHits, sh_pdg, sh_purity, sh_start_X, sh_start_Y, and sh_start_Z.

Referenced by analyze().

1360  {
1361 
1362  MC_incoming_PDG = -999;
1363  MC_lepton_PDG =-999;
1364  MC_isCC =-999;
1365  MC_channel =-999;
1366  MC_target =-999;
1367  MC_Q2 =-999.0;
1368  MC_W =-999.0;
1369  MC_lepton_theta = -999.0;
1370  MC_leptonID = -999;
1371  MC_LeptonTrack = -999;
1372 
1373  for(int i=0; i<MAX_SHOWERS; i++){
1374  sh_direction_X[i] = -999.0;
1375  sh_direction_Y[i] = -999.0;
1376  sh_direction_Z[i] = -999.0;
1377  sh_start_X[i] = -999.0;
1378  sh_start_Y[i] = -999.0;
1379  sh_start_Z[i] = -999.0;
1380  sh_bestplane[i] = -999.0;
1381  sh_length[i] = -999.0;
1382  sh_hasPrimary_e[i] = -999.0;
1383  sh_Efrac_contamination[i] = -999.0;
1384  sh_purity[i] = -999.0;
1385  sh_completeness[i] = -999.0;
1386  sh_nHits[i] = -999.0;
1387  for( int j=0; j<3; j++){
1388  sh_energy[i][j] = -999.0;
1389  sh_MIPenergy[i][j] = -999.0;
1390  sh_dEdx[i][j] = -999.0;
1391  }
1392  sh_pdg[i] = -999;
1393  sh_dEdxasymm[i] = -999;
1394  }
1395  sh_largest = -999;
1396  sh_mpi0 = -999;
1397  }
#define MAX_SHOWERS
double sh_energy[MAX_SHOWERS][3]
double sh_dEdx[MAX_SHOWERS][3]
double sh_Efrac_contamination[MAX_SHOWERS]
double sh_MIPenergy[MAX_SHOWERS][3]
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

Referenced by art::RootOutputFile::writeOne().

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Definition at line 125 of file Consumer.cc.

Referenced by art::EDProducer::doEndJob(), art::EDFilter::doEndJob(), art::EDAnalyzer::doEndJob(), and art::RootOutput::endJob().

126 {
127  if (!moduleContext_)
128  return;
129 
130  // If none of the branches have missing consumes statements, exit early.
131  if (std::all_of(cbegin(missingConsumes_),
132  cend(missingConsumes_),
133  [](auto const& perBranch) { return perBranch.empty(); }))
134  return;
135 
136  constexpr cet::HorizontalRule rule{60};
137  mf::LogPrint log{"MTdiagnostics"};
138  log << '\n'
139  << rule('=') << '\n'
140  << "The following consumes (or mayConsume) statements are missing from\n"
141  << module_context(moduleDescription_) << '\n'
142  << rule('-') << '\n';
143 
144  cet::for_all_with_index(
145  missingConsumes_, [&log](std::size_t const i, auto const& perBranch) {
146  for (auto const& pi : perBranch) {
147  log << " "
148  << assemble_consumes_statement(static_cast<BranchType>(i), pi)
149  << '\n';
150  }
151  });
152  log << rule('=');
153 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
void DUNE::NeutrinoShowerEff::truthMatcher ( std::vector< art::Ptr< recob::Hit >>  all_hits,
std::vector< art::Ptr< recob::Hit >>  shower_hits,
const simb::MCParticle *&  MCparticle,
double &  Efrac,
double &  Ecomplet 
)

Definition at line 1150 of file NeutrinoShowerEff_module.cc.

References cheat::BackTrackerService::HitToEveTrackIDEs(), and cheat::ParticleInventoryService::TrackIdToParticle_P().

Referenced by processEff().

1150  {
1151 
1152  MCparticle=0;
1153  Efrac=1.0;
1154  Ecomplet=0;
1155 
1158  std::map<int,double> trkID_E;
1159  for(size_t j = 0; j < shower_hits.size(); ++j){
1160  art::Ptr<recob::Hit> hit = shower_hits[j];
1161  //For know let's use collection plane to look at the shower reconstruction
1162  //if( hit->View() != 2) continue;
1163  std::vector<sim::TrackIDE> TrackIDs = bt_serv->HitToEveTrackIDEs(hit);
1164  for(size_t k = 0; k < TrackIDs.size(); k++){
1165  if (trkID_E.find(std::abs(TrackIDs[k].trackID))==trkID_E.end()) trkID_E[std::abs(TrackIDs[k].trackID)] = 0;
1166  trkID_E[std::abs(TrackIDs[k].trackID)] += TrackIDs[k].energy;
1167  }
1168  }
1169  double max_E = -999.0;
1170  double total_E = 0.0;
1171  int TrackID = -999;
1172  double partial_E=0.0;
1173  //double noEM_E = 0.0; //non electromagnetic energy is defined as energy from charged pion and protons
1174  if( !trkID_E.size() ) return; //Ghost shower???
1175  for(std::map<int,double>::iterator ii = trkID_E.begin(); ii!=trkID_E.end(); ++ii){
1176  total_E += ii->second;
1177  if((ii->second)>max_E){
1178  partial_E = ii->second;
1179  max_E = ii->second;
1180  TrackID = ii->first;
1181  }
1182  //int ID = ii->first;
1183  // const simb::MCParticle *particle = pi_serv->TrackIDToParticle(ID);
1184  //if( abs(particle->PdgCode()) == 211 || particle->PdgCode() == 2212 ){
1185  //if( particle->PdgCode() != 22 && abs(particle->PdgCode()) != 11){
1186  //noEM_E += ii->second;
1187  //}
1188 
1189  }
1190  MCparticle = pi_serv->TrackIdToParticle_P(TrackID);
1191 
1192 
1193  Efrac = 1-(partial_E/total_E);
1194 
1195  //completeness
1196  double totenergy =0;
1197  for(size_t k = 0; k < all_hits.size(); ++k){
1198  art::Ptr<recob::Hit> hit = all_hits[k];
1199  std::vector<sim::TrackIDE> TrackIDs = bt_serv->HitToEveTrackIDEs(hit);
1200  for(size_t l = 0; l < TrackIDs.size(); ++l){
1201  if(std::abs(TrackIDs[l].trackID)==TrackID) {
1202  totenergy += TrackIDs[l].energy;
1203  }
1204  }
1205  }
1206  Ecomplet = partial_E/totenergy;
1207 
1208  }
const simb::MCParticle * TrackIdToParticle_P(int const &id)
intermediate_table::iterator iterator
std::vector< TrackID > TrackIDs
Detector simulation of raw signals on wires.
const std::vector< sim::TrackIDE > HitToEveTrackIDEs(recob::Hit const &hit)
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Definition at line 101 of file Consumer.cc.

References art::errors::ProductRegistrationFailure.

103 {
104  // Early exits if consumes tracking has been disabled or if the
105  // consumed product is an allowed consumable.
106  if (!moduleContext_)
107  return;
108 
109  if (cet::binary_search_all(consumables_[bt], pi))
110  return;
111 
112  if (requireConsumes_) {
114  "Consumer: an error occurred during validation of a "
115  "retrieved product\n\n")
116  << "The following consumes (or mayConsume) statement is missing from\n"
117  << module_context(moduleDescription_) << ":\n\n"
118  << " " << assemble_consumes_statement(bt, pi) << "\n\n";
119  }
120 
121  missingConsumes_[bt].insert(pi);
122 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
bool requireConsumes_
Definition: Consumer.h:137
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

int DUNE::NeutrinoShowerEff::Event
private

Definition at line 205 of file NeutrinoShowerEff_module.cc.

Referenced by analyze(), and beginJob().

art::InputTag DUNE::NeutrinoShowerEff::fCNNEMModuleLabel
private

Definition at line 74 of file NeutrinoShowerEff_module.cc.

Referenced by checkCNNtrkshw(), and reconfigure().

TTree* DUNE::NeutrinoShowerEff::fEventTree
private

Definition at line 84 of file NeutrinoShowerEff_module.cc.

Referenced by analyze(), and beginJob().

float DUNE::NeutrinoShowerEff::fFidVolCutX
private

Definition at line 253 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and reconfigure().

float DUNE::NeutrinoShowerEff::fFidVolCutY
private

Definition at line 254 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and reconfigure().

float DUNE::NeutrinoShowerEff::fFidVolCutZ
private

Definition at line 255 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and reconfigure().

float DUNE::NeutrinoShowerEff::fFidVolXmax
private

Definition at line 258 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and insideFV().

float DUNE::NeutrinoShowerEff::fFidVolXmin
private

Definition at line 257 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and insideFV().

float DUNE::NeutrinoShowerEff::fFidVolYmax
private

Definition at line 260 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and insideFV().

float DUNE::NeutrinoShowerEff::fFidVolYmin
private

Definition at line 259 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and insideFV().

float DUNE::NeutrinoShowerEff::fFidVolZmax
private

Definition at line 262 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and insideFV().

float DUNE::NeutrinoShowerEff::fFidVolZmin
private

Definition at line 261 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and insideFV().

art::InputTag DUNE::NeutrinoShowerEff::fHitModuleLabel
private

Definition at line 72 of file NeutrinoShowerEff_module.cc.

Referenced by processEff(), and reconfigure().

int DUNE::NeutrinoShowerEff::fLeptonPDGcode
private

Definition at line 77 of file NeutrinoShowerEff_module.cc.

Referenced by processEff(), and reconfigure().

double DUNE::NeutrinoShowerEff::fMaxEfrac
private

Definition at line 80 of file NeutrinoShowerEff_module.cc.

Referenced by reconfigure().

double DUNE::NeutrinoShowerEff::fMaxNeutrinoE
private

Definition at line 78 of file NeutrinoShowerEff_module.cc.

Referenced by reconfigure().

art::InputTag DUNE::NeutrinoShowerEff::fMCTruthModuleLabel
private

Definition at line 71 of file NeutrinoShowerEff_module.cc.

Referenced by processEff(), and reconfigure().

double DUNE::NeutrinoShowerEff::fMinCompleteness
private

Definition at line 81 of file NeutrinoShowerEff_module.cc.

Referenced by processEff(), and reconfigure().

int DUNE::NeutrinoShowerEff::fNeutrinoPDGcode
private

Definition at line 76 of file NeutrinoShowerEff_module.cc.

Referenced by processEff(), and reconfigure().

bool DUNE::NeutrinoShowerEff::fSaveMCTree
private

Definition at line 79 of file NeutrinoShowerEff_module.cc.

Referenced by analyze(), beginJob(), and reconfigure().

art::InputTag DUNE::NeutrinoShowerEff::fShowerModuleLabel
private

Definition at line 73 of file NeutrinoShowerEff_module.cc.

Referenced by processEff(), and reconfigure().

art::ServiceHandle<geo::Geometry> DUNE::NeutrinoShowerEff::geom
private

Definition at line 264 of file NeutrinoShowerEff_module.cc.

TH1D* DUNE::NeutrinoShowerEff::h_CosThetaShDirwrtTrueparticle_chargedpion_NC
private

Definition at line 158 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_CosThetaShDirwrtTrueparticle_chargedpion_NueCC
private

Definition at line 157 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_CosThetaShDirwrtTrueparticle_electronorpositron_NC
private

Definition at line 152 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_CosThetaShDirwrtTrueparticle_electronorpositron_NueCC
private

Definition at line 151 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_CosThetaShDirwrtTrueparticle_photon_NC
private

Definition at line 154 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_CosThetaShDirwrtTrueparticle_photon_NueCC
private

Definition at line 153 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_CosThetaShDirwrtTrueparticle_proton_NC
private

Definition at line 156 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_CosThetaShDirwrtTrueparticle_proton_NueCC
private

Definition at line 155 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_chargedpion_NC
private

Definition at line 133 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_chargedpion_NueCC
private

Definition at line 132 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_electronorpositron_NC
private

Definition at line 125 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_electronorpositron_NueCC
private

Definition at line 124 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_everythingelse_NC
private

Definition at line 137 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_everythingelse_NueCC
private

Definition at line 136 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_neutralpion_NC
private

Definition at line 135 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_neutralpion_NueCC
private

Definition at line 134 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_neutron_NC
private

Definition at line 131 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_neutron_NueCC
private

Definition at line 130 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_photon_NC
private

Definition at line 127 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_photon_NueCC
private

Definition at line 126 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_proton_NC
private

Definition at line 129 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdX_proton_NueCC
private

Definition at line 128 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdXasymm_electronorpositron_NueCC
private

Definition at line 139 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_dEdXasymm_photon_NC
private

Definition at line 140 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Ecomplet_bkg
private

Definition at line 110 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Ecomplet_lepton
private

Definition at line 103 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Ecomplet_NueCC
private

Definition at line 106 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Ee_den
private

Definition at line 91 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), doEfficiencies(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Ee_num
private

Definition at line 92 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), doEfficiencies(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Ee_num_dEdx
private

Definition at line 93 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), doEfficiencies(), and processEff().

TEfficiency* DUNE::NeutrinoShowerEff::h_Eff_Ee = 0
private

Definition at line 115 of file NeutrinoShowerEff_module.cc.

Referenced by doEfficiencies().

TEfficiency* DUNE::NeutrinoShowerEff::h_Eff_Ee_dEdx = 0
private

Definition at line 116 of file NeutrinoShowerEff_module.cc.

Referenced by doEfficiencies().

TEfficiency* DUNE::NeutrinoShowerEff::h_Eff_Ev = 0
private

Definition at line 113 of file NeutrinoShowerEff_module.cc.

Referenced by doEfficiencies().

TEfficiency* DUNE::NeutrinoShowerEff::h_Eff_Ev_dEdx = 0
private

Definition at line 114 of file NeutrinoShowerEff_module.cc.

Referenced by doEfficiencies().

TEfficiency* DUNE::NeutrinoShowerEff::h_Eff_Pe = 0
private

Definition at line 117 of file NeutrinoShowerEff_module.cc.

Referenced by doEfficiencies().

TEfficiency* DUNE::NeutrinoShowerEff::h_Eff_theta = 0
private

Definition at line 118 of file NeutrinoShowerEff_module.cc.

Referenced by doEfficiencies().

TH1D* DUNE::NeutrinoShowerEff::h_Efrac_bkgPurity
private

Definition at line 109 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Efrac_NueCCPurity
private

Definition at line 105 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Efrac_shContamination
private

Definition at line 101 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Efrac_shPurity
private

Definition at line 102 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_esh_bestplane_NC
private

Definition at line 123 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_esh_bestplane_NueCC
private

Definition at line 122 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Ev_den
private

Definition at line 87 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), doEfficiencies(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Ev_num
private

Definition at line 88 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), doEfficiencies(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Ev_num_dEdx
private

Definition at line 89 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), doEfficiencies(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_HighestHitsProducedParticlePDG_bkg
private

Definition at line 108 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_HighestHitsProducedParticlePDG_NueCC
private

Definition at line 107 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_mpi0_electronorpositron_NueCC
private

Definition at line 142 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_mpi0_photon_NC
private

Definition at line 143 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Pe_den
private

Definition at line 95 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), doEfficiencies(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_Pe_num
private

Definition at line 96 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), doEfficiencies(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartXwrtTrueparticleEndXDiff_photon_NC
private

Definition at line 182 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartXwrtTrueparticleEndXDiff_photon_NueCC
private

Definition at line 178 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NC
private

Definition at line 198 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartXwrtTrueparticleStartXDiff_chargedpion_NueCC
private

Definition at line 194 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NC
private

Definition at line 165 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartXwrtTrueparticleStartXDiff_electronorpositron_NueCC
private

Definition at line 161 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartXwrtTrueparticleStartXDiff_photon_NC
private

Definition at line 173 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartXwrtTrueparticleStartXDiff_photon_NueCC
private

Definition at line 169 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartXwrtTrueparticleStartXDiff_proton_NC
private

Definition at line 190 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartXwrtTrueparticleStartXDiff_proton_NueCC
private

Definition at line 186 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartYwrtTrueparticleEndYDiff_photon_NC
private

Definition at line 183 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartYwrtTrueparticleEndYDiff_photon_NueCC
private

Definition at line 179 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NC
private

Definition at line 199 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartYwrtTrueparticleStartYDiff_chargedpion_NueCC
private

Definition at line 195 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NC
private

Definition at line 166 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartYwrtTrueparticleStartYDiff_electronorpositron_NueCC
private

Definition at line 162 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartYwrtTrueparticleStartYDiff_photon_NC
private

Definition at line 174 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartYwrtTrueparticleStartYDiff_photon_NueCC
private

Definition at line 170 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartYwrtTrueparticleStartYDiff_proton_NC
private

Definition at line 191 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartYwrtTrueparticleStartYDiff_proton_NueCC
private

Definition at line 187 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartZwrtTrueparticleEndZDiff_photon_NC
private

Definition at line 184 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartZwrtTrueparticleEndZDiff_photon_NueCC
private

Definition at line 180 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NC
private

Definition at line 200 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartZwrtTrueparticleStartZDiff_chargedpion_NueCC
private

Definition at line 196 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NC
private

Definition at line 167 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartZwrtTrueparticleStartZDiff_electronorpositron_NueCC
private

Definition at line 163 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartZwrtTrueparticleStartZDiff_photon_NC
private

Definition at line 175 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartZwrtTrueparticleStartZDiff_photon_NueCC
private

Definition at line 171 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartZwrtTrueparticleStartZDiff_proton_NC
private

Definition at line 192 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_ShStartZwrtTrueparticleStartZDiff_proton_NueCC
private

Definition at line 188 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_theta_den
private

Definition at line 98 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), doEfficiencies(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_theta_num
private

Definition at line 99 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), doEfficiencies(), and processEff().

TH1D* DUNE::NeutrinoShowerEff::h_trklike_em
private

Definition at line 146 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and checkCNNtrkshw().

TH1D* DUNE::NeutrinoShowerEff::h_trklike_nonem
private

Definition at line 147 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and checkCNNtrkshw().

int DUNE::NeutrinoShowerEff::MC_channel
private

Definition at line 213 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::MC_incoming_P[4]
private

Definition at line 218 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

int DUNE::NeutrinoShowerEff::MC_incoming_PDG
private

Definition at line 210 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

int DUNE::NeutrinoShowerEff::MC_isCC
private

Definition at line 212 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::MC_lepton_endMomentum[4]
private

Definition at line 220 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

double DUNE::NeutrinoShowerEff::MC_lepton_endXYZT[4]
private

Definition at line 222 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

int DUNE::NeutrinoShowerEff::MC_lepton_PDG
private

Definition at line 211 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::MC_lepton_startMomentum[4]
private

Definition at line 219 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

double DUNE::NeutrinoShowerEff::MC_lepton_startXYZT[4]
private

Definition at line 221 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

double DUNE::NeutrinoShowerEff::MC_lepton_theta
private

Definition at line 223 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and reset().

int DUNE::NeutrinoShowerEff::MC_leptonID
private

Definition at line 224 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

int DUNE::NeutrinoShowerEff::MC_LeptonTrack
private

Definition at line 225 of file NeutrinoShowerEff_module.cc.

Referenced by reset().

double DUNE::NeutrinoShowerEff::MC_Q2
private

Definition at line 215 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

int DUNE::NeutrinoShowerEff::MC_target
private

Definition at line 214 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::MC_vertex[4]
private

Definition at line 217 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

double DUNE::NeutrinoShowerEff::MC_W
private

Definition at line 216 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

int DUNE::NeutrinoShowerEff::n_recoShowers
private

Definition at line 248 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

int DUNE::NeutrinoShowerEff::Run
private

Definition at line 206 of file NeutrinoShowerEff_module.cc.

Referenced by analyze(), and beginJob().

int DUNE::NeutrinoShowerEff::sh_bestplane[MAX_SHOWERS]
private

Definition at line 236 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_completeness[MAX_SHOWERS]
private

Definition at line 241 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_dEdx[MAX_SHOWERS][3]
private

Definition at line 235 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_dEdxasymm[MAX_SHOWERS]
private

Definition at line 245 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_direction_X[MAX_SHOWERS]
private

Definition at line 227 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_direction_Y[MAX_SHOWERS]
private

Definition at line 228 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_direction_Z[MAX_SHOWERS]
private

Definition at line 229 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_Efrac_best
private

Definition at line 249 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), and processEff().

double DUNE::NeutrinoShowerEff::sh_Efrac_contamination[MAX_SHOWERS]
private

Definition at line 239 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_energy[MAX_SHOWERS][3]
private

Definition at line 233 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

int DUNE::NeutrinoShowerEff::sh_hasPrimary_e[MAX_SHOWERS]
private

Definition at line 238 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

int DUNE::NeutrinoShowerEff::sh_largest
private

Definition at line 243 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_length[MAX_SHOWERS]
private

Definition at line 237 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_MIPenergy[MAX_SHOWERS][3]
private

Definition at line 234 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_mpi0
private

Definition at line 246 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

int DUNE::NeutrinoShowerEff::sh_nHits[MAX_SHOWERS]
private

Definition at line 242 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

int DUNE::NeutrinoShowerEff::sh_pdg[MAX_SHOWERS]
private

Definition at line 244 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_purity[MAX_SHOWERS]
private

Definition at line 240 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_start_X[MAX_SHOWERS]
private

Definition at line 230 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_start_Y[MAX_SHOWERS]
private

Definition at line 231 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

double DUNE::NeutrinoShowerEff::sh_start_Z[MAX_SHOWERS]
private

Definition at line 232 of file NeutrinoShowerEff_module.cc.

Referenced by beginJob(), processEff(), and reset().

int DUNE::NeutrinoShowerEff::SubRun
private

Definition at line 207 of file NeutrinoShowerEff_module.cc.

Referenced by analyze(), and beginJob().


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