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

Electron neutrino event selection. More...

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

Public Member Functions

 OpSimHitPrinter ()
 
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

std::string fOpDetHitTag
 
opdet::opHitFinderSBND_op_hit_maker
 
bool MakeOpHits
 
unsigned event_ind
 
- 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 33 of file OpSimHitPrinter.cc.

Constructor & Destructor Documentation

ana::SBNOsc::OpSimHitPrinter::OpSimHitPrinter ( )
inline

Constructor.

Definition at line 36 of file OpSimHitPrinter.cc.

36 {}

Member Function Documentation

void ana::SBNOsc::OpSimHitPrinter::Finalize ( )
inlinevirtual

Finalize and write objects to the output file.

Implements core::ProcessorBase.

Definition at line 52 of file OpSimHitPrinter.cc.

52  {
53  }
void ana::SBNOsc::OpSimHitPrinter::Initialize ( fhicl::ParameterSet *  config = NULL)
inlinevirtual

Initialization.

Parameters
configA configuration, as a FHiCL ParameterSet object

Implements core::ProcessorBase.

Definition at line 43 of file OpSimHitPrinter.cc.

43  {
44  fOpDetHitTag = config ? config->get<std::string>("OpDetHitTag", "ophit") : "ophit";
45  MakeOpHits = config ? config->get<bool>("MakeOpHits", false) : false;
46  _op_hit_maker = (MakeOpHits) ? new opdet::opHitFinderSBND(config->get<fhicl::ParameterSet>("OpHitMaker"), fProviderManager->GetDetectorClocksProvider()) :
47  NULL;
48  event_ind = 0;
49  }
opdet::opHitFinderSBND * _op_hit_maker
const detinfo::DetectorClocksStandard * GetDetectorClocksProvider() const
ProviderManager * fProviderManager
Interface for provider access.
bool ana::SBNOsc::OpSimHitPrinter::ProcessEvent ( const gallery::Event &  ev,
const std::vector< event::Interaction > &  truth,
std::vector< event::RecoInteraction > &  reco 
)
inlinevirtual

Process one event.

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

Implements core::ProcessorBase.

Definition at line 62 of file OpSimHitPrinter.cc.

62  {
63  std::vector<recob::OpHit> op_hits;
64  if (MakeOpHits) {
65  const std::vector<raw::OpDetWaveform> &op_waveforms = *ev.getValidHandle<std::vector<raw::OpDetWaveform>>("opdaq");
66  op_hits = _op_hit_maker->MakeHits(op_waveforms);
67  }
68  else {
69  op_hits = *ev.getValidHandle<std::vector<recob::OpHit>>(fOpDetHitTag);
70  }
71 
72  std::cout << "New event!" << std::endl;
73  for (const recob::OpHit &hit: op_hits) {
74  std::cout << "Op hit:" << " channel: " << hit.OpChannel() << " time:" << hit.PeakTime() << std::endl;
75  }
76  return false;
77  }
opdet::opHitFinderSBND * _op_hit_maker
process_name hit
Definition: cheaterreco.fcl:51
std::vector< recob::OpHit > MakeHits(const std::vector< raw::OpDetWaveform > &waveforms)
BEGIN_PROLOG could also be cout

Member Data Documentation

opdet::opHitFinderSBND* ana::SBNOsc::OpSimHitPrinter::_op_hit_maker
protected

Definition at line 81 of file OpSimHitPrinter.cc.

unsigned ana::SBNOsc::OpSimHitPrinter::event_ind
protected

Definition at line 83 of file OpSimHitPrinter.cc.

std::string ana::SBNOsc::OpSimHitPrinter::fOpDetHitTag
protected

Definition at line 80 of file OpSimHitPrinter.cc.

bool ana::SBNOsc::OpSimHitPrinter::MakeOpHits
protected

Definition at line 82 of file OpSimHitPrinter.cc.


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