Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
murem::MRCCAna Class Reference
Inheritance diagram for murem::MRCCAna:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 MRCCAna (const fhicl::ParameterSet &pset)
 
virtual ~MRCCAna ()
 
void analyze (const art::Event &evt)
 
void beginJob ()
 
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< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (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< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (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< TmayConsumeView (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 Member Functions

bool SliceSelection (const art::Event &evt, const art::Ptr< rb::Cluster > &slice)
 

Private Attributes

std::string fTruthModuleLabel
 
std::string fHitsModuleLabel
 
std::string fClusterModuleLabel
 
std::string fElasticModuleLabel
 
std::string fFuzzy3DModuleLabel
 
std::string fBPFTrackModuleLabel
 
std::string fMRCCHitsModuleLabel
 
std::string fMRCCClusterModuleLabel
 
art::ServiceHandle< cheat::BackTrackerbt
 
art::ServiceHandle< art::TFileServicetfs
 
TH1I * hNumNuClusters
 
TH1I * hNumNuClustersMRCC
 
TProfile * hSliceHadronicFrac
 
TProfile * hSliceHadronicFracMRCC
 
TProfile * hAnyMRCCNeutrinoEnergy
 
TProfile * hAnyMRCCMuonEnergy
 
TProfile * hSliceEFracRemoved
 
TProfile * hSliceHadEFracRemoved
 
TProfile * hSliceLepEFracRemoved
 
TH1F * hSliceDeltaE
 
TH1F * hSliceDeltaLepE
 
TH1F * hSliceDeltaHadE
 
TProfile * hLeptonEFracRemoved
 
TProfile * hHadronEFracRemoved
 
TProfile * hMRCCSliceEFracRemoved
 
TProfile * hMRCCSliceHadEFracRemoved
 
TProfile * hMRCCSliceLepEFracRemoved
 
TProfile * hMRCCLeptonEFracRemoved
 
TProfile * hMRCCHadronEFracRemoved
 
TH1D * hHadYMRCC
 
TH1D * hHadYNoMRCC
 
TProfile * hSliceEFracRemovedQE
 
TProfile * hSliceEFracRemovedDIS
 
TProfile * hSliceEFracRemovedRES
 

Detailed Description

Definition at line 288 of file MRCCAna_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

murem::MRCCAna::MRCCAna ( const fhicl::ParameterSet pset)
explicit

Definition at line 347 of file MRCCAna_module.cc.

347  :
348  EDAnalyzer(pset),
349  fTruthModuleLabel(pset.get<std::string>("TruthModuleLabel")),
350  fHitsModuleLabel(pset.get<std::string>("HitsModuleLabel")),
351  fClusterModuleLabel(pset.get<std::string>("ClusterModuleLabel")),
352  fElasticModuleLabel(pset.get<std::string>("ElasticModuleLabel")),
353  fFuzzy3DModuleLabel(pset.get<std::string>("Fuzzy3DModuleLabel")),
354  fBPFTrackModuleLabel(pset.get<std::string>("BPFTrackModuleLabel")),
355  fMRCCHitsModuleLabel(pset.get<std::string>("MRCCHitsModuleLabel")),
356  fMRCCClusterModuleLabel(pset.get<std::string>("MRCCClusterModuleLabel")) {
357 }
std::string fTruthModuleLabel
std::string fFuzzy3DModuleLabel
std::string fBPFTrackModuleLabel
std::string fHitsModuleLabel
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::string fElasticModuleLabel
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
std::string fMRCCClusterModuleLabel
std::string fClusterModuleLabel
std::string fMRCCHitsModuleLabel
enum BeamMode string
murem::MRCCAna::~MRCCAna ( )
virtual

Definition at line 360 of file MRCCAna_module.cc.

360  {
361 }

Member Function Documentation

void murem::MRCCAna::analyze ( const art::Event evt)

Definition at line 448 of file MRCCAna_module.cc.

References rb::Cluster::AllCells(), art::PtrVector< T >::begin(), murem::MRCCNeutrino::CC(), ddthelpers::cluster_hits(), murem::MRCCNeutrino::ClusterCharge(), murem::MRCCNeutrino::ClusterHadronicCharge(), murem::MRCCNeutrino::ClusterLeptonicCharge(), murem::MRCCNeutrino::ClusterMRCCCharge(), murem::MRCCNeutrino::ClusterMRCCHadronicCharge(), murem::MRCCNeutrino::ClusterMRCCLeptonicCharge(), art::PtrVector< T >::end(), murem::MRCCNeutrino::Energy(), art::fill_ptr_vector(), art::DataViewImpl::getByLabel(), simb::MCTruth::GetNeutrino(), hits(), simb::MCNeutrino::InteractionType(), plot_timing_data::mrcc, murem::MRCCNeutrino::Muon(), murem::MRCCNeutrino::NumAssociatedClusters(), murem::MRCCNeutrino::NumAssociatedMRCCClusters(), murem::MRCCNeutrino::Particles(), simb::MCParticle::TrackId(), murem::MRCCNeutrino::Truth(), and simb::MCNeutrino::Y().

448  {
449 
450  // Get the truth information
452  std::vector<art::Ptr<simb::MCTruth> > truths;
453  if (evt.getByLabel(fTruthModuleLabel, truthHandle))
454  art::fill_ptr_vector(truths, truthHandle);
455 
456  // Get all the hits before muon removal
458  std::vector<art::Ptr<rb::CellHit> > hits;
459  if (evt.getByLabel(fHitsModuleLabel, hitsHandle))
460  art::fill_ptr_vector(hits, hitsHandle);
461 
462  // Get the clusters before muon removal
463  art::Handle<std::vector<rb::Cluster> > clusterHandle;
464  std::vector<art::Ptr<rb::Cluster> > clusters;
465  if (evt.getByLabel(fClusterModuleLabel, clusterHandle))
466  art::fill_ptr_vector(clusters, clusterHandle);
467 
468  // Get the hits following muon removal
469  art::Handle<std::vector<rb::CellHit> > mrccHitsHandle;
470  std::vector<art::Ptr<rb::CellHit> > mrccHits;
471  if (evt.getByLabel(fMRCCHitsModuleLabel, mrccHitsHandle))
472  art::fill_ptr_vector(mrccHits, mrccHitsHandle);
473 
474  // Get the clusters following muon removal
475  art::Handle<std::vector<rb::Cluster> > mrccClusterHandle;
476  std::vector<art::Ptr<rb::Cluster> > mrccClusters;
477  if (evt.getByLabel(fMRCCClusterModuleLabel, mrccClusterHandle))
478  art::fill_ptr_vector(mrccClusters, mrccClusterHandle);
479 
480  // Container to hold true neutrino information
481  std::map<unsigned int, MRCCNeutrino*> true_neutrinos;
482 
483  // Grab and save the neutrino interaction truth information
484  for (std::vector<art::Ptr<simb::MCTruth> >::const_iterator truthIt = truths.begin(); truthIt != truths.end(); ++truthIt) {
485  std::vector<const sim::Particle*> sim_particles = bt->MCTruthToParticles(*truthIt);
486  true_neutrinos[truthIt->key()] = new MRCCNeutrino(*truthIt, sim_particles);
487  }
488 
489  // Add all hits to the relevant true particle for each neutrino interaction, before muon removal
490  for (std::vector<art::Ptr<rb::Cluster> >::const_iterator clusterIt = clusters.begin();
491  clusterIt != clusters.end(); ++clusterIt) {
492  if ((*clusterIt)->IsNoise() or !SliceSelection(evt, *clusterIt))
493  continue;
494  std::vector<cheat::NeutrinoEffPur> nus = bt->SliceToNeutrinoInteractions(*clusterIt, hits);
495  if (nus.size() != 1)
496  continue;
497  true_neutrinos[nus[0].neutrinoInt.key()]->AddAssociatedCluster(clusterIt->key());
499  for (art::PtrVector<rb::CellHit>::const_iterator hitIt = cluster_hits.begin();
500  hitIt != cluster_hits.end(); ++hitIt) {
501  const sim::Particle* true_particle = bt->HitToParticle(*(*hitIt));
502  if (true_particle == nullptr)
503  continue;
504  true_neutrinos[nus[0].neutrinoInt.key()]->AddParticleHit(true_particle->TrackId(), *hitIt);
505  }
506  }
507 
508  // Add all hits to the relevant true particle for each neutrino interaction, after muon removal
509  for (std::vector<art::Ptr<rb::Cluster> >::const_iterator clusterIt = mrccClusters.begin();
510  clusterIt != mrccClusters.end(); ++clusterIt) {
511  if ((*clusterIt)->IsNoise())// or !SliceSelection(evt, *clusterIt))
512  continue;
513  std::vector<cheat::NeutrinoEffPur> nus = bt->SliceToNeutrinoInteractions(*clusterIt, mrccHits);
514  if (nus.size() != 1)
515  continue;
516  true_neutrinos[nus[0].neutrinoInt.key()]->AddAssociatedMRCCCluster(clusterIt->key());
517  art::PtrVector<rb::CellHit> cluster_hits = (*clusterIt)->AllCells();
518  for (art::PtrVector<rb::CellHit>::const_iterator hitIt = cluster_hits.begin();
519  hitIt != cluster_hits.end(); ++hitIt) {
520  const sim::Particle* true_particle = bt->HitToParticle(*(*hitIt));
521  if (true_particle == nullptr)
522  continue;
523  true_neutrinos[nus[0].neutrinoInt.key()]->AddParticleMRCCHit(true_particle->TrackId(), *hitIt);
524  }
525  }
526 
527  // Plot things!
528  for (std::map<unsigned int, MRCCNeutrino*>::const_iterator neutrinoIt = true_neutrinos.begin();
529  neutrinoIt != true_neutrinos.end(); ++neutrinoIt) {
530 
531  const MRCCNeutrino* true_nu = neutrinoIt->second;
532 
533  // Neutrino-level plots
534  hNumNuClusters->Fill(true_nu->NumAssociatedClusters());
535  hNumNuClustersMRCC->Fill(true_nu->NumAssociatedMRCCClusters());
536 
537  // For the slice plots, only consider unique neutrino slices which weren't affected by the muon removal
538  if (true_nu->NumAssociatedClusters() != 1 or true_nu->NumAssociatedClusters() != true_nu->NumAssociatedMRCCClusters())
539  continue;
540 
541  // Slice-level plots
542  hSliceHadronicFrac->Fill(true_nu->Energy(), true_nu->ClusterHadronicCharge()/true_nu->ClusterCharge());
543  hSliceHadronicFracMRCC->Fill(true_nu->Energy(), true_nu->ClusterMRCCHadronicCharge()/true_nu->ClusterMRCCCharge());
544 
545  float charge_before = true_nu->ClusterCharge(), charge_after = true_nu->ClusterMRCCCharge();
546  bool mrcc = charge_before != charge_after;
547 
548  if (true_nu->CC())
549  hAnyMRCCNeutrinoEnergy->Fill(true_nu->Energy(), mrcc);
550 
551  if (charge_before) {
552  hSliceEFracRemoved->Fill(true_nu->Energy(), (charge_before-charge_after)/charge_before);
553  hSliceDeltaE->Fill((charge_before-charge_after)/charge_before);
554  if (true_nu->Truth()->GetNeutrino().InteractionType() == 1001)
555  hSliceEFracRemovedQE->Fill(true_nu->Energy(), (charge_before-charge_after)/charge_before);
556  if (true_nu->Truth()->GetNeutrino().InteractionType() >= 1003 and true_nu->Truth()->GetNeutrino().InteractionType() <= 1090)
557  hSliceEFracRemovedRES->Fill(true_nu->Energy(), (charge_before-charge_after)/charge_before);
558  if (true_nu->Truth()->GetNeutrino().InteractionType() == 1091)
559  hSliceEFracRemovedDIS->Fill(true_nu->Energy(), (charge_before-charge_after)/charge_before);
560  if (mrcc)
561  hMRCCSliceEFracRemoved->Fill(true_nu->Energy(), (charge_before-charge_after)/charge_before);
562  }
563 
564  float had_charge_before = true_nu->ClusterHadronicCharge(), had_charge_after = true_nu->ClusterMRCCHadronicCharge();
565  if (had_charge_before) {
566  hSliceHadEFracRemoved->Fill(true_nu->Energy(), (had_charge_before-had_charge_after)/had_charge_before);
567  hSliceDeltaHadE->Fill((had_charge_before-had_charge_after)/had_charge_before);
568  if (mrcc)
569  hMRCCSliceHadEFracRemoved->Fill(true_nu->Energy(), (had_charge_before-had_charge_after)/had_charge_before);
570  }
571 
572  float lep_charge_before = true_nu->ClusterLeptonicCharge(), lep_charge_after = true_nu->ClusterMRCCLeptonicCharge();
573  if (lep_charge_before) {
574  hSliceLepEFracRemoved->Fill(true_nu->Energy(), (lep_charge_before-lep_charge_after)/lep_charge_before);
575  hSliceDeltaLepE->Fill((lep_charge_before-lep_charge_after)/lep_charge_before);
576  if (mrcc)
577  hMRCCSliceLepEFracRemoved->Fill(true_nu->Energy(), (lep_charge_before-lep_charge_after)/lep_charge_before);
578  }
579 
580  if (mrcc)
581  hHadYMRCC->Fill(true_nu->Truth()->GetNeutrino().Y());
582  else
583  hHadYNoMRCC->Fill(true_nu->Truth()->GetNeutrino().Y());
584 
585  // Particle-level plots
586  std::map<unsigned int, MRCCParticle*> particles = true_nu->Particles();
587  int muon = true_nu->Muon();
588  for (std::map<unsigned int, MRCCParticle*>::const_iterator particleIt = particles.begin();
589  particleIt != particles.end(); ++particleIt) {
590  float p_charge_before = particleIt->second->DepositedCharge();
591  float p_charge_after = particleIt->second->DepositedMRCCCharge();
592  if (!p_charge_before)
593  continue;
594  if ((int)particleIt->first == muon) {
595  hLeptonEFracRemoved->Fill(particleIt->second->Energy(), (p_charge_before-p_charge_after)/p_charge_before);
596  hAnyMRCCMuonEnergy->Fill(particleIt->second->Energy(), mrcc);
597  if (mrcc)
598  hMRCCLeptonEFracRemoved->Fill(particleIt->second->Energy(), (p_charge_before-p_charge_after)/p_charge_before);
599  } else {
600  hHadronEFracRemoved->Fill(particleIt->second->Energy(), (p_charge_before-p_charge_after)/p_charge_before);
601  if (mrcc)
602  hMRCCHadronEFracRemoved->Fill(particleIt->second->Energy(), (p_charge_before-p_charge_after)/p_charge_before);
603  }
604  }
605 
606  }
607 
608  return;
609 
610 }
TProfile * hSliceEFracRemovedRES
TProfile * hSliceHadEFracRemoved
rb::Cluster cluster_hits(std::vector< art::Ptr< rb::CellHit > > const &hits, int32_t t_start, int32_t t_end, int16_t adc_cut=0)
Definition: DDTHelpers.cxx:13
std::vector< NeutrinoEffPur > SliceToNeutrinoInteractions(const std::vector< const rb::CellHit * > &sliceHits, const std::vector< const rb::CellHit * > &allHits, bool sortPur=false) const
Given a collection of hits (often a slice), returns vector of structures of neutrino interactions...
iterator begin()
Definition: PtrVector.h:223
std::string fTruthModuleLabel
TProfile * hSliceEFracRemoved
TProfile * hLeptonEFracRemoved
const sim::Particle * HitToParticle(art::Ptr< rb::CellHit > const &hit, bool quiet=false) const
Returns the sim::Particle object contributing the most light to the specified rb::CellHit.
art::PtrVector< rb::CellHit > AllCells() const
Get all cells from both views.
Definition: Cluster.cxx:180
int TrackId() const
Definition: MCParticle.h:209
TProfile * hMRCCSliceHadEFracRemoved
TProfile * hSliceLepEFracRemoved
TProfile * hAnyMRCCNeutrinoEnergy
TH1I * hNumNuClustersMRCC
void hits()
Definition: readHits.C:15
TProfile * hMRCCSliceEFracRemoved
bool SliceSelection(const art::Event &evt, const art::Ptr< rb::Cluster > &slice)
std::string fHitsModuleLabel
iterator end()
Definition: PtrVector.h:237
TProfile * hMRCCSliceLepEFracRemoved
TProfile * hSliceHadronicFracMRCC
TProfile * hHadronEFracRemoved
std::string fMRCCClusterModuleLabel
TProfile * hMRCCLeptonEFracRemoved
TProfile * hAnyMRCCMuonEnergy
TProfile * hMRCCHadronEFracRemoved
art::ServiceHandle< cheat::BackTracker > bt
data_t::const_iterator const_iterator
Definition: PtrVector.h:61
std::string fClusterModuleLabel
TProfile * hSliceHadronicFrac
std::string fMRCCHitsModuleLabel
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
TProfile * hSliceEFracRemovedQE
TProfile * hSliceEFracRemovedDIS
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
std::vector< const sim::Particle * > MCTruthToParticles(art::Ptr< simb::MCTruth > const &mct) const
void murem::MRCCAna::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 364 of file MRCCAna_module.cc.

364  {
365 
367  = tfs->make<TH1I>("NumNuClusters", ";Number of Clusters Associated with True Neutrino;", 5,0,5);
368  hNumNuClusters->GetXaxis()->CenterLabels();
370  = tfs->make<TH1I>("NumNuClustersMRCC", ";Number of Clusters Associated with True Neutrino;", 5,0,5);
371  hNumNuClustersMRCC->GetXaxis()->CenterLabels();
373  = tfs->make<TProfile>("SliceHadronicFrac", ";Neutrino Energy (GeV);Hadronic Fraction of Total Slice Charge;", 100,0,40);
374  hSliceHadronicFrac->SetMinimum(0);
375  hSliceHadronicFrac->SetMaximum(1);
377  = tfs->make<TProfile>("SliceHadronicFracMRCC", ";Neutrino Energy (GeV);Hadronic Fraction of Total Slice Charge;", 100,0,40);
378  hSliceHadronicFracMRCC->SetMinimum(0);
379  hSliceHadronicFracMRCC->SetMaximum(1);
381  = tfs->make<TProfile>("AnyMRCCNeutrinoEnergy", ";Neutrino Energy (GeV);Fraction of Neutrino Interactions with Charge Removed;", 100,0,40);
382  hAnyMRCCNeutrinoEnergy->SetMinimum(0);
383  hAnyMRCCNeutrinoEnergy->SetMaximum(1);
385  = tfs->make<TProfile>("AnyMRCCMuonEnergy", ";Muon Energy (GeV);Fraction of CC Muons with Charge Removed;", 100,0,40);
386  hAnyMRCCMuonEnergy->SetMinimum(0);
387  hAnyMRCCMuonEnergy->SetMaximum(1);
389  = tfs->make<TProfile>("SliceEFracRemoved", ";Neutrino Energy (GeV);Fraction of Slice Charge Removed;", 100,0,40);
390  hSliceEFracRemoved->SetMinimum(0);
391  hSliceEFracRemoved->SetMaximum(1);
393  = tfs->make<TProfile>("SliceHadEFracRemoved", ";Neutrino Energy (GeV);Fraction of Slice Hadronic Charge Removed;", 100,0,40);
394  hSliceHadEFracRemoved->SetMinimum(0);
395  hSliceHadEFracRemoved->SetMaximum(1);
397  = tfs->make<TProfile>("SliceLepEFracRemoved", ";Neutrino Energy (GeV);Fraction of Slice Leptonic Charge Removed;", 100,0,40);
398  hSliceLepEFracRemoved->SetMinimum(0);
399  hSliceLepEFracRemoved->SetMaximum(1);
401  = tfs->make<TH1F>("SliceDeltaE", ";Fraction of Slice Charge Removed (GeV);", 100,0,1);
403  = tfs->make<TH1F>("SliceDeltaLepE", ";Fraction of Slice Leptonic Charge Removed (GeV);", 100,0,1);
405  = tfs->make<TH1F>("SliceDeltaHadE", ";Fraction of Slice Hadronic Charge Removed (GeV);", 100,0,1);
407  = tfs->make<TProfile>("LeptonEFracRemoved", ";Lepton Energy (GeV);Fraction of Charge Removed;", 100,0,40);
408  hLeptonEFracRemoved->SetMinimum(0);
409  hLeptonEFracRemoved->SetMaximum(1);
411  = tfs->make<TProfile>("HadronEFracRemoved", ";Hadron Energy (GeV);Fraction of Charge Removed;", 100,0,40);
412  hHadronEFracRemoved->SetMinimum(0);
413  hHadronEFracRemoved->SetMaximum(1);
415  = tfs->make<TProfile>("MRCCSliceEFracRemoved", ";Neutrino Energy (GeV);Fraction of Slice Charge Removed;", 100,0,40);
416  hMRCCSliceEFracRemoved->SetMinimum(0);
417  hMRCCSliceEFracRemoved->SetMaximum(1);
419  = tfs->make<TProfile>("MRCCSliceHadEFracRemoved", ";Neutrino Energy (GeV);Fraction of Slice Hadronic Charge Removed;", 100,0,40);
420  hMRCCSliceHadEFracRemoved->SetMinimum(0);
421  hMRCCSliceHadEFracRemoved->SetMaximum(1);
423  = tfs->make<TProfile>("MRCCSliceLepEFracRemoved", ";Neutrino Energy (GeV);Fraction of Slice Leptonic Charge Removed;", 100,0,40);
424  hMRCCSliceLepEFracRemoved->SetMinimum(0);
425  hMRCCSliceLepEFracRemoved->SetMaximum(1);
427  = tfs->make<TProfile>("MRCCLeptonEFracRemoved", ";Lepton Energy (GeV);Fraction of Charge Removed;", 100,0,40);
428  hMRCCLeptonEFracRemoved->SetMinimum(0);
429  hMRCCLeptonEFracRemoved->SetMaximum(1);
431  = tfs->make<TProfile>("MRCCHadronEFracRemoved", ";Hadron Energy (GeV);Fraction of Charge Removed;", 100,0,40);
432  hMRCCHadronEFracRemoved->SetMinimum(0);
433  hMRCCHadronEFracRemoved->SetMaximum(1);
434  hHadYMRCC = tfs->make<TH1D>("HadYMRCC", ";Hadronic Y;", 100, 0, 1);
435  hHadYNoMRCC = tfs->make<TH1D>("HadYNoMRCC", ";Hadronic Y;", 100, 0, 1);
437  = tfs->make<TProfile>("SliceEFracRemovedQE", ";Fraction of Slice Charge Removed (QE);", 100,0,40);
439  = tfs->make<TProfile>("SliceEFracRemovedDIS", ";Fraction of Slice Charge Removed (DIS);", 100,0,40);
441  = tfs->make<TProfile>("SliceEFracRemovedRES", ";Fraction of Slice Charge Removed (RES);", 100,0,40);
442 
443  return;
444 
445 }
TProfile * hSliceEFracRemovedRES
TProfile * hSliceHadEFracRemoved
TProfile * hSliceEFracRemoved
TProfile * hLeptonEFracRemoved
TProfile * hMRCCSliceHadEFracRemoved
TProfile * hSliceLepEFracRemoved
TProfile * hAnyMRCCNeutrinoEnergy
TH1I * hNumNuClustersMRCC
TProfile * hMRCCSliceEFracRemoved
TProfile * hMRCCSliceLepEFracRemoved
TProfile * hSliceHadronicFracMRCC
TProfile * hHadronEFracRemoved
TProfile * hMRCCLeptonEFracRemoved
TProfile * hAnyMRCCMuonEnergy
TProfile * hMRCCHadronEFracRemoved
TProfile * hSliceHadronicFrac
T * make(ARGS...args) const
TProfile * hSliceEFracRemovedQE
art::ServiceHandle< art::TFileService > tfs
TProfile * hSliceEFracRemovedDIS
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
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 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

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

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
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 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDAnalyzer::currentContext ( ) const
protectedinherited
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
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_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
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 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

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

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
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 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

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

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

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

Referenced by art::RootOutput::endJob().

bool murem::MRCCAna::SliceSelection ( const art::Event evt,
const art::Ptr< rb::Cluster > &  slice 
)
private

Definition at line 613 of file MRCCAna_module.cc.

References abs(), evt, PandAna.Demos.pi0_spectra::fmt, and rb::IsFiltered().

613  {
614 
615  // Copied from MuonRemove_module
616 
617  // rock filtered?
618  if (rb::IsFiltered(evt, slice, "rockpresel"))
619  return false;
620 
621  // find vertex
623  if (!fmElastic.isValid())
624  return false;
625 
626  std::vector<art::Ptr<rb::Vertex> > elastics = fmElastic.at(0);
627  if (elastics.empty())
628  return false;
629 
630  // find prongs
631  art::FindManyP<rb::Prong> fmFuzzyProng3D(elastics, evt, fFuzzy3DModuleLabel);
632  std::vector<art::Ptr<rb::Prong> > prongs = fmFuzzyProng3D.at(0);
633  if (prongs.empty())
634  return false;
635 
636  // find energy of parent muon
637  double muonEmax = -1;
639  std::vector<art::Ptr<rb::Track> > tracks = fmt.at(0);
640  for (unsigned int trackIt = 0; trackIt < tracks.size(); ++trackIt) {
641  art::FindManyP<rb::FitSum> fmBPFFitSums({tracks[trackIt]}, evt, fBPFTrackModuleLabel);
642  if (fmBPFFitSums.isValid()) {
643  std::vector<art::Ptr<rb::FitSum> > bpfFitSums = fmBPFFitSums.at(0);
644  if (abs(bpfFitSums[0]->PDG()) == 13) {
645  double muonE = bpfFitSums[0]->FourMom().E();
646  if (muonE > muonEmax)
647  muonEmax = muonE;
648  }
649  }
650  }
651  if (muonEmax <= 0)
652  return false;
653 
654  return true;
655 
656 }
void abs(TH1 *hist)
std::string fFuzzy3DModuleLabel
std::string fBPFTrackModuleLabel
int evt
std::string fElasticModuleLabel
bool IsFiltered(const art::Event &evt, art::Ptr< T > x, const std::vector< std::string > &labels)
Is this Ptr marked "filtered out"?
Definition: FilterList.h:96
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

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

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
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

art::ServiceHandle<cheat::BackTracker> murem::MRCCAna::bt
private

Definition at line 313 of file MRCCAna_module.cc.

std::string murem::MRCCAna::fBPFTrackModuleLabel
private

Definition at line 308 of file MRCCAna_module.cc.

std::string murem::MRCCAna::fClusterModuleLabel
private

Definition at line 305 of file MRCCAna_module.cc.

std::string murem::MRCCAna::fElasticModuleLabel
private

Definition at line 306 of file MRCCAna_module.cc.

std::string murem::MRCCAna::fFuzzy3DModuleLabel
private

Definition at line 307 of file MRCCAna_module.cc.

std::string murem::MRCCAna::fHitsModuleLabel
private

Definition at line 304 of file MRCCAna_module.cc.

std::string murem::MRCCAna::fMRCCClusterModuleLabel
private

Definition at line 310 of file MRCCAna_module.cc.

std::string murem::MRCCAna::fMRCCHitsModuleLabel
private

Definition at line 309 of file MRCCAna_module.cc.

std::string murem::MRCCAna::fTruthModuleLabel
private

Definition at line 303 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hAnyMRCCMuonEnergy
private

Definition at line 322 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hAnyMRCCNeutrinoEnergy
private

Definition at line 321 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hHadronEFracRemoved
private

Definition at line 330 of file MRCCAna_module.cc.

TH1D* murem::MRCCAna::hHadYMRCC
private

Definition at line 336 of file MRCCAna_module.cc.

TH1D* murem::MRCCAna::hHadYNoMRCC
private

Definition at line 337 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hLeptonEFracRemoved
private

Definition at line 329 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hMRCCHadronEFracRemoved
private

Definition at line 335 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hMRCCLeptonEFracRemoved
private

Definition at line 334 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hMRCCSliceEFracRemoved
private

Definition at line 331 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hMRCCSliceHadEFracRemoved
private

Definition at line 332 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hMRCCSliceLepEFracRemoved
private

Definition at line 333 of file MRCCAna_module.cc.

TH1I* murem::MRCCAna::hNumNuClusters
private

Definition at line 317 of file MRCCAna_module.cc.

TH1I* murem::MRCCAna::hNumNuClustersMRCC
private

Definition at line 318 of file MRCCAna_module.cc.

TH1F* murem::MRCCAna::hSliceDeltaE
private

Definition at line 326 of file MRCCAna_module.cc.

TH1F* murem::MRCCAna::hSliceDeltaHadE
private

Definition at line 328 of file MRCCAna_module.cc.

TH1F* murem::MRCCAna::hSliceDeltaLepE
private

Definition at line 327 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hSliceEFracRemoved
private

Definition at line 323 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hSliceEFracRemovedDIS
private

Definition at line 339 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hSliceEFracRemovedQE
private

Definition at line 338 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hSliceEFracRemovedRES
private

Definition at line 340 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hSliceHadEFracRemoved
private

Definition at line 324 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hSliceHadronicFrac
private

Definition at line 319 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hSliceHadronicFracMRCC
private

Definition at line 320 of file MRCCAna_module.cc.

TProfile* murem::MRCCAna::hSliceLepEFracRemoved
private

Definition at line 325 of file MRCCAna_module.cc.

art::ServiceHandle<art::TFileService> murem::MRCCAna::tfs
private

Definition at line 314 of file MRCCAna_module.cc.


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