All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
ana::SBNOsc::NueSelection Class Reference

Electron neutrino event selection. More...

#include <NueSelection.h>

Inheritance diagram for ana::SBNOsc::NueSelection:
core::SelectionBase core::ProcessorBase

Public Member Functions

 NueSelection ()
 
void Initialize (fhicl::ParameterSet *config=NULL)
 
void Finalize ()
 
bool ProcessEvent (const gallery::Event &ev, const std::vector< event::Interaction > &truth, std::vector< event::RecoInteraction > &reco)
 
- Public Member Functions inherited from core::SelectionBase
 SelectionBase ()
 
virtual ~SelectionBase ()
 
- Public Member Functions inherited from core::ProcessorBase
 ProcessorBase ()
 
virtual ~ProcessorBase ()
 
virtual void FillTree ()
 
virtual void FillRecoTree ()
 
virtual void EventCleanup ()
 
template<class T >
TBranch * AddBranch (std::string name, T *obj)
 
template<class T >
TBranch * AddRecoBranch (std::string name, T *obj)
 

Protected Attributes

unsigned fEventCounter
 Count processed events. More...
 
unsigned fNuCount
 Count selected events. More...
 
art::InputTag fTruthTag
 art tag for MCTruth information More...
 
- Protected Attributes inherited from core::ProcessorBase
unsigned long fEventIndex
 An incrementing index. More...
 
Experiment fExperimentID
 Experiment identifier. More...
 
ProviderManagerfProviderManager
 Interface for provider access. More...
 
std::string fOutputFilename
 The output filename. More...
 
std::string fProviderConfig
 A custom provider config fcl file. More...
 
std::vector< geo::BoxBoundedGeofActiveVolumes
 List of active volumes in configured detector. More...
 
bool fWriteTree
 Enable writing of the main tree. More...
 
TFile * fOutputFile
 The output ROOT file. More...
 
TTree * fTree
 The output ROOT tree. More...
 
event::EventfEvent
 The standard output event data structure. More...
 
bool fWriteRecoTree
 Enable writing of the reco tree. More...
 
TTree * fRecoTree
 The output reco ROOT tree. More...
 
event::RecoEventfRecoEvent
 The standard output reco event data structure. More...
 
TTree * fSubRunTree
 Subrun output tree. More...
 
SubRunfSubRun
 Standard output subrun structure. More...
 
TTree * fFileMetaTree
 File metadata output tree. More...
 
FileMetafFileMeta
 standard output file metadata structure More...
 
TParameter< int > * fExperimentParameter
 Saves value of experiment enum. More...
 
std::set< std::pair< int, int > > fSubRunCache
 Cache stored subruns. More...
 
art::InputTag fTruthTag
 art tag for MCTruth information More...
 
art::InputTag fFluxTag
 art tag for MCFlux information More...
 
std::vector< art::InputTag > fWeightTags
 art tag(s) for MCEventWeight information More...
 
art::InputTag fMCTrackTag
 art tag for MCTrack More...
 
art::InputTag fMCShowerTag
 art tag for MCShower More...
 
art::InputTag fMCParticleTag
 art tag for MCParticle More...
 
std::string fGeneratorProcess
 process_name of process used to run genie. Used to extract subrun/POT information More...
 

Additional Inherited Members

- Public Attributes inherited from core::ProcessorBase
std::vector
< event::RecoInteraction > * 
fReco
 Reco interaction list. More...
 
- Protected Member Functions inherited from core::ProcessorBase
virtual void Initialize (char *config=NULL)
 
virtual void Setup (char *config=NULL)
 
virtual void Setup (fhicl::ParameterSet *config=NULL)
 
virtual void Teardown ()
 
void BuildEventTree (gallery::Event &ev)
 
void SetupServices (gallery::Event &ev)
 
void UpdateSubRuns (gallery::Event &ev)
 
void UpdateFileMeta (gallery::Event &ev)
 

Detailed Description

Electron neutrino event selection.

Definition at line 26 of file NueSelection.h.

Constructor & Destructor Documentation

ana::SBNOsc::NueSelection::NueSelection ( )

Constructor.

Definition at line 16 of file NueSelection.cxx.

unsigned fNuCount
Count selected events.
Definition: NueSelection.h:52
unsigned fEventCounter
Count processed events.
Definition: NueSelection.h:51

Member Function Documentation

void ana::SBNOsc::NueSelection::Finalize ( )
virtual

Finalize and write objects to the output file.

Implements core::ProcessorBase.

Definition at line 33 of file NueSelection.cxx.

33 {}
void ana::SBNOsc::NueSelection::Initialize ( fhicl::ParameterSet *  config = NULL)
virtual

Initialization.

Parameters
configA configuration, as a FHiCL ParameterSet object

Implements core::ProcessorBase.

Definition at line 19 of file NueSelection.cxx.

19  {
20  // Load configuration parameters
21  fTruthTag = { "generator" };
22 
23  fhicl::ParameterSet pconfig = config->get<fhicl::ParameterSet>("SBNOsc");
24 
25  if (config) {
26  fTruthTag = { pconfig.get<std::string>("MCTruthTag", "generator") };
27  }
28 
29  hello();
30 }
art::InputTag fTruthTag
art tag for MCTruth information
Definition: NueSelection.h:55
bool ana::SBNOsc::NueSelection::ProcessEvent ( const gallery::Event &  ev,
const std::vector< event::Interaction > &  truth,
std::vector< event::RecoInteraction > &  reco 
)
virtual

Process one event.

Parameters
evA single event, as a gallery::Event
Reconstructedinteractions
Returns
True to keep event

Implements core::ProcessorBase.

Definition at line 36 of file NueSelection.cxx.

36  {
37  if (fEventCounter % 10 == 0) {
38  std::cout << "NueSelection: Processing event " << fEventCounter << " "
39  << "(" << fNuCount << " neutrinos selected)"
40  << std::endl;
41  }
42  fEventCounter++;
43 
44  // Grab a data product from the event
45  auto const& mctruths = \
46  *ev.getValidHandle<std::vector<simb::MCTruth> >(fTruthTag);
47 
48  // Iterate through the neutrinos
49  for (size_t i=0; i<mctruths.size(); i++) {
50  auto const& mctruth = mctruths.at(i);
51  const simb::MCNeutrino& nu = mctruth.GetNeutrino();
52 
53  if (nu.CCNC() == simb::kCC && nu.Mode() == 0 && nu.Nu().PdgCode() == 12) {
54  event::RecoInteraction interaction(i);
55  reco.push_back(interaction);
56  }
57  }
58 
59  bool selected = !reco.empty();
60 
61  if (selected) {
62  fNuCount++;
63  }
64 
65  return selected;
66 }
unsigned fNuCount
Count selected events.
Definition: NueSelection.h:52
Charged-current interactions.
Definition: IPrediction.h:38
Contains truth level information and additional fields for selection-defined reconstruction informati...
Definition: Event.hh:178
unsigned fEventCounter
Count processed events.
Definition: NueSelection.h:51
art::InputTag fTruthTag
art tag for MCTruth information
Definition: NueSelection.h:55
BEGIN_PROLOG SN nu
BEGIN_PROLOG could also be cout

Member Data Documentation

unsigned ana::SBNOsc::NueSelection::fEventCounter
protected

Count processed events.

Definition at line 51 of file NueSelection.h.

unsigned ana::SBNOsc::NueSelection::fNuCount
protected

Count selected events.

Definition at line 52 of file NueSelection.h.

art::InputTag ana::SBNOsc::NueSelection::fTruthTag
protected

art tag for MCTruth information

Configuration parameters

Definition at line 55 of file NueSelection.h.


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