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

Electron neutrino event selection. More...

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

Public Member Functions

 CosmicArrivalTimes ()
 
void Initialize (fhicl::ParameterSet *config=NULL)
 
void Finalize ()
 
bool ProcessEvent (const gallery::Event &event, 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 fMCParticleTag
 
unsigned event_ind
 
TH1D * fCosmicEnterTimes
 
TH2D * fCosmicEnterTimesPE
 
- 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 39 of file CosmicArrivalTimes.cc.

Constructor & Destructor Documentation

ana::SBNOsc::CosmicArrivalTimes::CosmicArrivalTimes ( )
inline

Constructor.

Definition at line 42 of file CosmicArrivalTimes.cc.

42 {}

Member Function Documentation

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

Finalize and write objects to the output file.

Implements core::ProcessorBase.

Definition at line 57 of file CosmicArrivalTimes.cc.

57  {
58  fOutputFile->cd();
59  fCosmicEnterTimes->Write();
60  fCosmicEnterTimesPE->Write();
61  }
TFile * fOutputFile
The output ROOT file.
void ana::SBNOsc::CosmicArrivalTimes::Initialize ( fhicl::ParameterSet *  config = NULL)
inlinevirtual

Initialization.

Parameters
configA configuration, as a FHiCL ParameterSet object

Implements core::ProcessorBase.

Definition at line 49 of file CosmicArrivalTimes.cc.

49  {
50  fMCParticleTag = config ? config->get<std::string>("MCParticleTag", "largeant") : "largeant";
51  fCosmicEnterTimes = new TH1D("cosmic_enter", "cosmic_enter", 700, -60., 10.);
52  fCosmicEnterTimesPE = new TH2D("cosmic_enter_v_pe", "cosmic_enter_v_pe", 700, -60., 10., 100, 0, 10000);
53  event_ind = 0;
54  }
bool ana::SBNOsc::CosmicArrivalTimes::ProcessEvent ( const gallery::Event &  event,
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 70 of file CosmicArrivalTimes.cc.

70  {
71  std::cout << "New Event!\n";
72  auto const &intime = event.getValidHandle<std::vector<simb::MCTruth>>({"GenInTimeSorter", "intime"});
73  //auto const &outtime = event.getValidHandle<std::vector<simb::MCTruth>>({"GenInTimeSorter", "outtime"});
74 
75  art::FindManyP<simb::MCParticle, sim::GeneratedParticleInfo> intime_to_particles(intime, event, fMCParticleTag);
76  //art::FindManyP<simb::MCParticle, sim::GeneratedParticleInfo> outtime_to_particles(outtime, event, fMCParticleTag);
77 
78  double in_time_photon_energy = 0.;
79  unsigned in_time_photons = 0;
80  const std::vector<sim::SimPhotons> &photon_list = *event.getValidHandle<std::vector<sim::SimPhotons>>("larg4intime");
81  for (const sim::SimPhotons &photons: photon_list) {
82  for (const sim::OnePhoton &photon: photons) {
83  if (photon.Time > -200. && photon.Time < 1800.) {
84  in_time_photon_energy += photon.Energy;
85  in_time_photons ++;
86  }
87  }
88  }
89  gallery::Handle<std::vector<sim::SimPhotons>> reflected;
90  event.getByLabel({"larg4intime", "Reflected"}, reflected);
91  if (reflected.isValid()) {
92  std::cout << "Reflected!\n";
93  const std::vector<sim::SimPhotons> &photon_list = *event.getValidHandle<std::vector<sim::SimPhotons>>({"larg4intime", "Reflected"});
94  for (const sim::SimPhotons &photons: photon_list) {
95  for (const sim::OnePhoton &photon: photons) {
96  if (photon.Time > -200. && photon.Time < 1800.) {
97  in_time_photon_energy += photon.Energy;
98  in_time_photons ++;
99  }
100  }
101  }
102  }
103 
104  for (const art::Ptr<simb::MCParticle> part: intime_to_particles.at(0)) {
105  if (abs(part->PdgCode()) != 13) continue;
106  unsigned n_traj = part->NumberTrajectoryPoints();
107  bool next = false;
108  for (unsigned i = 0; i < n_traj; i++) {
109  for (const geo::BoxBoundedGeo &vol: fActiveVolumes) {
110  if (vol.ContainsPosition(part->Position(i).Vect())) {
111  fCosmicEnterTimes->Fill(part->Position(i).T() / 1000.) /* ns -> us*/;
112  fCosmicEnterTimesPE->Fill(part->Position(i).T() / 1000., in_time_photons);
113  next = true;
114  break;
115  }
116  }
117  if (next) break;
118  }
119  }
120 
121  /*
122  for (const art::Ptr<simb::MCParticle> part: outtime_to_particles.at(0)) {
123  unsigned n_traj = part->NumberTrajectoryPoints();
124  bool next = false;
125  for (unsigned i = 0; i < n_traj; i++) {
126  for (const geo::BoxBoundedGeo &vol: fActiveVolumes) {
127  if (vol.ContainsPosition(part->Position(i).Vect())) {
128  fCosmicEnterTimes->Fill(part->Position(i).T() / 1000.);
129  next = true;
130  break;
131  }
132  }
133  if (next) break;
134  }
135  }*/
136 
137  return false;
138  }
process_name can override from command line with o or output photon
Definition: runPID.fcl:28
All information of a photon entering the sensitive optical detector volume.
Definition: SimPhotons.h:64
std::vector< geo::BoxBoundedGeo > fActiveVolumes
List of active volumes in configured detector.
T abs(T value)
Collection of photons which recorded on one channel.
Definition: SimPhotons.h:136
A base class aware of world box coordinatesAn object describing a simple shape can inherit from this ...
Definition: BoxBoundedGeo.h:33
BEGIN_PROLOG could also be cout

Member Data Documentation

unsigned ana::SBNOsc::CosmicArrivalTimes::event_ind
protected

Definition at line 142 of file CosmicArrivalTimes.cc.

TH1D* ana::SBNOsc::CosmicArrivalTimes::fCosmicEnterTimes
protected

Definition at line 143 of file CosmicArrivalTimes.cc.

TH2D* ana::SBNOsc::CosmicArrivalTimes::fCosmicEnterTimesPE
protected

Definition at line 144 of file CosmicArrivalTimes.cc.

std::string ana::SBNOsc::CosmicArrivalTimes::fMCParticleTag
protected

Definition at line 141 of file CosmicArrivalTimes.cc.


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