Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
bpfit::BPFEnergyAna Class Reference
Inheritance diagram for bpfit::BPFEnergyAna:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 BPFEnergyAna (fhicl::ParameterSet const &pset)
 
 ~BPFEnergyAna ()
 
void analyze (const art::Event &evt)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
void beginJob ()
 
void resetVars ()
 
void setTruthVars (const std::vector< cheat::NeutrinoEffPur > &nuEP)
 
std::string workerType () const
 
void doBeginJob ()
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
Handle< TriggerResults > getTriggerResults (Event const &e) const
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< TconsumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< TmayConsumeView (InputTag const &tag)
 

Protected Member Functions

detail::ProcessAndEventSelectors & processAndEventSelectors ()
 
ConsumesCollector & consumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Private Attributes

const art::ProductToken< std::vector< rb::Cluster > > fSlicerToken
 
std::string fEnergyLabel
 label for module that made the energy objects More...
 
bool fIsMC
 are you running over MC? More...
 
TTree * fBPFEnergyTree
 TTree with slice level info (for energy estimator training) More...
 
float fEreco1
 first reconstructed event energy More...
 
float fEres1
 first estimated event energy resolution More...
 
float fEreco2
 second reconstructed event energy More...
 
float fEres2
 second estimated event energy resolution More...
 
float fEreco3
 third reconstructed event energy More...
 
float fEres3
 third estimated event energy resolution More...
 
float fPmu
 reconstructed muon momentum from the track selected to be the muon More...
 
float fDirZmu
 track.dirZ() from the track selected to be the muon More...
 
float fN3Dprongs
 number of fuzzyk 3D prongs More...
 
float fE3Dprongs
 sum of hit energies in 3D prongs (excluding the "muon" prong) - this does NOT account for dead material More...
 
float fEremain
 sum of remaining slice energy not in 3D prongs - this does NOT account for dead material More...
 
float fSumPE
 sum of PE from all hits not on the muon track More...
 
float fEventID
 best BPF muon PID value for the event More...
 
float fE
 true energy More...
 
float fMinX
 minimum hit X value in the slice More...
 
float fMinY
 minimum hit Y value in the slice More...
 
float fMinZ
 minimum hit Z value in the slice More...
 
float fMaxX
 maximum hit X value in the slice More...
 
float fMaxY
 maximum hit Y value in the slice More...
 
float fMaxZ
 maximum hit Z value in the slice More...
 
int fNHitX
 number of X-view hits in the slice More...
 
int fNHitY
 number of Y-view hits in the slice More...
 
int fCCNC
 is this CC or NC (from truth) More...
 
int fIntType
 neutrino interaction type (from truth) More...
 
int fnuPDG
 PDG code for the best matched nu (from truth) More...
 

Detailed Description

Definition at line 46 of file BPFEnergyAna_module.cc.

Member Typedef Documentation

Definition at line 25 of file EDAnalyzer.h.

using art::EDAnalyzer::WorkerType = WorkerT<EDAnalyzer>
inherited

Definition at line 24 of file EDAnalyzer.h.

Constructor & Destructor Documentation

bpfit::BPFEnergyAna::BPFEnergyAna ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 107 of file BPFEnergyAna_module.cc.

References reconfigure().

108  : EDAnalyzer(pset),
109  fSlicerToken(consumes<std::vector<rb::Cluster>>(pset.get<std::string>("SlicerLabel")))
110  {
111  this->reconfigure(pset);
112  }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:27
void reconfigure(const fhicl::ParameterSet &pset)
ProductToken< T > consumes(InputTag const &)
Definition: ModuleBase.h:55
const art::ProductToken< std::vector< rb::Cluster > > fSlicerToken
enum BeamMode string
bpfit::BPFEnergyAna::~BPFEnergyAna ( )

Definition at line 115 of file BPFEnergyAna_module.cc.

116  {
117  //======================================================================
118  // Clean up any memory allocated by your module... ...if you dare...
119  //======================================================================
120  }

Member Function Documentation

void bpfit::BPFEnergyAna::analyze ( const art::Event evt)

Definition at line 230 of file BPFEnergyAna_module.cc.

References DEFINE_ART_MODULE(), fBPFEnergyTree, fDirZmu, fE3Dprongs, fEnergyLabel, fEreco1, fEreco2, fEreco3, fEremain, fEres1, fEres2, fEres3, fEventID, fIsMC, fMaxX, fMaxY, fMaxZ, fMinX, fMinY, fMinZ, fN3Dprongs, fNHitX, fNHitY, fPmu, fSlicerToken, fSumPE, art::DataViewImpl::getByToken(), MECModelEnuComparisons::i, art::PtrVector< T >::push_back(), resetVars(), setTruthVars(), and cheat::BackTracker::SlicesToMCTruthsTable().

231  {
232 
233  // get the slices
235  evt.getByToken(fSlicerToken, slices);
236 
237  // create the FindMany object for getting the energy objects
238  art::FindManyP<bpfit::BPFEnergy> energyFMP(slices, evt, fEnergyLabel);
239 
240  // Make the required service handles...
242 
243  // Put the slices into a PtrVector and get the list neutrinos matched
244  // to each slice from backtracker.
245  art::PtrVector<rb::Cluster> ARTslices;
246  for(unsigned int i = 0; i < slices->size(); ++i) {
247  ARTslices.push_back(art::Ptr<rb::Cluster>(slices,i));
248  }
249  std::vector< std::vector< cheat::NeutrinoEffPur > > ALLnuEffPur;
250  if(fIsMC) {
251  ALLnuEffPur = BT->SlicesToMCTruthsTable(ARTslices);
252  }
253 
254 
255  // loop over all slices and get the fuzzyk 3D prongs
256  for(unsigned int islice = 0; islice < slices->size(); ++islice) {
257 
258  // As usual, skip the noise slice...
259  if((*slices)[islice].IsNoise()) continue;
260 
261  // NOTE: Currently, the fundamental object of analysis is the slice.
262  // If in the future we change things so that the fundamental object
263  // of analysis becomes the vertex, then we will have to get prongs
264  // associated with the vertex instead.
265 
266  // Reset all TTree variables.
267  this->resetVars();
268 
269  // Set slice level and truth variables for the TTrees.
270  fMinX = (*slices)[islice].MinX();
271  fMinY = (*slices)[islice].MinY();
272  fMinZ = (*slices)[islice].MinZ();
273  fMaxX = (*slices)[islice].MaxX();
274  fMaxY = (*slices)[islice].MaxY();
275  fMaxZ = (*slices)[islice].MaxZ();
276  fNHitX = (*slices)[islice].NXCell();
277  fNHitY = (*slices)[islice].NYCell();
278  if(fIsMC) {
279  this->setTruthVars(ALLnuEffPur[islice]);
280  }
281 
282  // get the energy object associated with this slice
283  std::vector< art::Ptr< bpfit::BPFEnergy > > energies;
284  if(energyFMP.isValid()) energies = energyFMP.at(islice);
285 
286  // There can be only one!!!
287  // Something went wrong if there is more than one energy object
288  // per slice.
289  if(energies.size() != 1) continue;
290 
291  // Set remaining branch values and fill the TTree.
292  fEreco1 = energies[0]->E1();
293  fEres1 = energies[0]->Eres1();
294  fEreco2 = energies[0]->E2();
295  fEres2 = energies[0]->Eres2();
296  fEreco3 = energies[0]->E3();
297  fEres3 = energies[0]->Eres3();
298  fPmu = energies[0]->PMuon();
299  fDirZmu = energies[0]->DirZMuon();
300  fN3Dprongs = energies[0]->N3DProngs();
301  fE3Dprongs = energies[0]->EFuzzyK3D();
302  fEremain = energies[0]->ERemain();
303  fSumPE = energies[0]->SumPE();
304  fEventID = energies[0]->EventID();
305 
306  fBPFEnergyTree->Fill();
307 
308  } // end loop over slices (islice)
309 
310  return;
311 
312  }
float fEreco2
second reconstructed event energy
bool getByToken(ProductToken< PROD > const &, Handle< PROD > &result) const
Definition: DataViewImpl.h:462
float fMaxY
maximum hit Y value in the slice
float fE3Dprongs
sum of hit energies in 3D prongs (excluding the "muon" prong) - this does NOT account for dead materi...
float fN3Dprongs
number of fuzzyk 3D prongs
int fNHitX
number of X-view hits in the slice
float fEres3
third estimated event energy resolution
float fEreco3
third reconstructed event energy
float fEremain
sum of remaining slice energy not in 3D prongs - this does NOT account for dead material ...
float fEventID
best BPF muon PID value for the event
std::vector< std::vector< cheat::NeutrinoEffPur > > SlicesToMCTruthsTable(const std::vector< const rb::Cluster * > &sliceList) const
Given ALL the slices in an event, including the noise slice, returns a vector of vector of structures...
std::string fEnergyLabel
label for module that made the energy objects
float fEres2
second estimated event energy resolution
bool fIsMC
are you running over MC?
float fSumPE
sum of PE from all hits not on the muon track
void setTruthVars(const std::vector< cheat::NeutrinoEffPur > &nuEP)
float fPmu
reconstructed muon momentum from the track selected to be the muon
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:435
float fMaxX
maximum hit X value in the slice
float fEres1
first estimated event energy resolution
float fMinX
minimum hit X value in the slice
float fMaxZ
maximum hit Z value in the slice
float fDirZmu
track.dirZ() from the track selected to be the muon
float fMinY
minimum hit Y value in the slice
float fEreco1
first reconstructed event energy
float fMinZ
minimum hit Z value in the slice
const art::ProductToken< std::vector< rb::Cluster > > fSlicerToken
TTree * fBPFEnergyTree
TTree with slice level info (for energy estimator training)
int fNHitY
number of Y-view hits in the slice
void bpfit::BPFEnergyAna::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 130 of file BPFEnergyAna_module.cc.

References fBPFEnergyTree, fCCNC, fDirZmu, fE, fE3Dprongs, fEreco1, fEreco2, fEreco3, fEremain, fEres1, fEres2, fEres3, fEventID, fIntType, fMaxX, fMaxY, fMaxZ, fMinX, fMinY, fMinZ, fN3Dprongs, fNHitX, fNHitY, fnuPDG, fPmu, and fSumPE.

131  {
133 
134  //
135  // Book the Energy TTree
136  //
137  fBPFEnergyTree = tfs->make<TTree>("BPFEnergyTree","Tree containing BPFEnergy object info");
138 
139  // attach the variables:
140  fBPFEnergyTree->Branch("Ereco1",&fEreco1,"Ereco1/F");
141  fBPFEnergyTree->Branch("Eres1",&fEres1,"Eres1/F");
142  fBPFEnergyTree->Branch("Ereco2",&fEreco2,"Ereco2/F");
143  fBPFEnergyTree->Branch("Eres2",&fEres2,"Eres2/F");
144  fBPFEnergyTree->Branch("Ereco3",&fEreco3,"Ereco3/F");
145  fBPFEnergyTree->Branch("Eres3",&fEres3,"Eres3/F");
146  fBPFEnergyTree->Branch("Pmu",&fPmu,"Pmu/F");
147  fBPFEnergyTree->Branch("DirZmu",&fDirZmu,"DirZmu/F");
148  fBPFEnergyTree->Branch("N3Dprongs",&fN3Dprongs,"N3Dprongs/F");
149  fBPFEnergyTree->Branch("E3Dprongs",&fE3Dprongs,"E3Dprongs/F");
150  fBPFEnergyTree->Branch("Eremain",&fEremain,"Eremain/F");
151  fBPFEnergyTree->Branch("SumPE",&fSumPE,"SumPE/F");
152  fBPFEnergyTree->Branch("EventID",&fEventID,"EventID/F");
153 
154  fBPFEnergyTree->Branch("E",&fE,"E/F");
155  fBPFEnergyTree->Branch("MinX",&fMinX,"MinX/F");
156  fBPFEnergyTree->Branch("MinY",&fMinY,"MinY/F");
157  fBPFEnergyTree->Branch("MinZ",&fMinZ,"MinZ/F");
158  fBPFEnergyTree->Branch("MaxX",&fMaxX,"MaxX/F");
159  fBPFEnergyTree->Branch("MaxY",&fMaxY,"MaxY/F");
160  fBPFEnergyTree->Branch("MaxZ",&fMaxZ,"MaxZ/F");
161  fBPFEnergyTree->Branch("NHitX",&fNHitX,"NHitX/I");
162  fBPFEnergyTree->Branch("NHitY",&fNHitY,"NHitY/I");
163  fBPFEnergyTree->Branch("CCNC",&fCCNC,"CCNC/I");
164  fBPFEnergyTree->Branch("IntType",&fIntType,"IntType/I");
165  fBPFEnergyTree->Branch("nuPDG",&fnuPDG,"nuPDG/I");
166 
167  }
float fEreco2
second reconstructed event energy
float fMaxY
maximum hit Y value in the slice
float fE3Dprongs
sum of hit energies in 3D prongs (excluding the "muon" prong) - this does NOT account for dead materi...
int fCCNC
is this CC or NC (from truth)
float fN3Dprongs
number of fuzzyk 3D prongs
int fNHitX
number of X-view hits in the slice
float fEres3
third estimated event energy resolution
float fEreco3
third reconstructed event energy
float fEremain
sum of remaining slice energy not in 3D prongs - this does NOT account for dead material ...
float fEventID
best BPF muon PID value for the event
float fEres2
second estimated event energy resolution
float fE
true energy
float fSumPE
sum of PE from all hits not on the muon track
float fPmu
reconstructed muon momentum from the track selected to be the muon
float fMaxX
maximum hit X value in the slice
float fEres1
first estimated event energy resolution
float fMinX
minimum hit X value in the slice
int fIntType
neutrino interaction type (from truth)
float fMaxZ
maximum hit Z value in the slice
float fDirZmu
track.dirZ() from the track selected to be the muon
float fMinY
minimum hit Y value in the slice
float fEreco1
first reconstructed event energy
float fMinZ
minimum hit Z value in the slice
int fnuPDG
PDG code for the best matched nu (from truth)
TTree * fBPFEnergyTree
TTree with slice level info (for energy estimator training)
int fNHitY
number of Y-view hits in the slice
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 55 of file ModuleBase.h.

References art::ModuleBase::collector_, art::ConsumesCollector::consumes(), T, and getGoodRuns4SAM::tag.

56  {
57  return collector_.consumes<T, BT>(tag);
58  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
ProductToken< T > consumes(InputTag const &)
double T
Definition: Xdiff_gwt.C:5
ConsumesCollector& art::ModuleBase::consumesCollector ( )
protectedinherited
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 69 of file ModuleBase.h.

References art::ModuleBase::collector_, art::ConsumesCollector::consumesMany(), and T.

70  {
71  collector_.consumesMany<T, BT>();
72  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
double T
Definition: Xdiff_gwt.C:5
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 62 of file ModuleBase.h.

References art::ModuleBase::collector_, art::ConsumesCollector::consumesView(), T, and getGoodRuns4SAM::tag.

63  {
64  return collector_.consumesView<T, BT>(tag);
65  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
ViewToken< Element > consumesView(InputTag const &)
double T
Definition: Xdiff_gwt.C:5
void art::detail::Analyzer::doBeginJob ( )
inherited
bool art::detail::Analyzer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited
bool art::detail::Analyzer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited
void art::detail::Analyzer::doEndJob ( )
inherited
bool art::detail::Analyzer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited
bool art::detail::Analyzer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited
bool art::detail::Analyzer::doEvent ( EventPrincipal ep,
ModuleContext const &  mc,
std::atomic< std::size_t > &  counts_run,
std::atomic< std::size_t > &  counts_passed,
std::atomic< std::size_t > &  counts_failed 
)
inherited
void art::detail::Analyzer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited
void art::detail::Analyzer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited
void art::detail::Analyzer::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited
void art::detail::Analyzer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited
void art::Observer::fillDescriptions ( ModuleDescription const &  )
inherited
std::array<std::vector<ProductInfo>, NumBranchTypes> const& art::ModuleBase::getConsumables ( ) const
inherited
Handle<TriggerResults> art::Observer::getTriggerResults ( Event const &  e) const
inherited
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 76 of file ModuleBase.h.

References art::ModuleBase::collector_, art::ConsumesCollector::mayConsume(), T, and getGoodRuns4SAM::tag.

77  {
78  return collector_.mayConsume<T, BT>(tag);
79  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:50
double T
Definition: Xdiff_gwt.C:5
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 90 of file ModuleBase.h.

References art::ModuleBase::collector_, art::ConsumesCollector::mayConsumeMany(), and T.

91  {
93  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
double T
Definition: Xdiff_gwt.C:5
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 83 of file ModuleBase.h.

References art::ModuleBase::collector_, art::ConsumesCollector::mayConsumeView(), T, and getGoodRuns4SAM::tag.

84  {
85  return collector_.mayConsumeView<T, BT>(tag);
86  }
ConsumesCollector collector_
Definition: ModuleBase.h:50
ViewToken< Element > mayConsumeView(InputTag const &)
double T
Definition: Xdiff_gwt.C:5
ModuleDescription const& art::ModuleBase::moduleDescription ( ) const
inherited
detail::ProcessAndEventSelectors& art::Observer::processAndEventSelectors ( )
protectedinherited
std::string const& art::Observer::processName ( ) const
inherited
void bpfit::BPFEnergyAna::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 123 of file BPFEnergyAna_module.cc.

References fEnergyLabel, fIsMC, fhicl::ParameterSet::get(), and string.

Referenced by BPFEnergyAna().

124  {
125  fEnergyLabel = pset.get<std::string>("EnergyLabel");
126  fIsMC = pset.get<bool> ("IsMC");
127  }
std::string fEnergyLabel
label for module that made the energy objects
bool fIsMC
are you running over MC?
T get(std::string const &key) const
Definition: ParameterSet.h:231
enum BeamMode string
void art::Observer::registerProducts ( ProductDescriptions ,
ModuleDescription const &   
)
inherited
void bpfit::BPFEnergyAna::resetVars ( )

Definition at line 170 of file BPFEnergyAna_module.cc.

References fCCNC, fDirZmu, fE, fE3Dprongs, fEreco1, fEreco2, fEreco3, fEremain, fEres1, fEres2, fEres3, fEventID, fIntType, fMaxX, fMaxY, fMaxZ, fMinX, fMinY, fMinZ, fN3Dprongs, fNHitX, fNHitY, fnuPDG, fPmu, and fSumPE.

Referenced by analyze().

171  {
172  fEreco1 = -5.0;
173  fEres1 = -5.0;
174  fEreco2 = -5.0;
175  fEres2 = -5.0;
176  fEreco3 = -5.0;
177  fEres3 = -5.0;
178  fPmu = -5.0;
179  fDirZmu = -5.0;
180  fN3Dprongs = -5.0;
181  fE3Dprongs = -5.0;
182  fEremain = -5.0;
183  fSumPE = -5.0;
184  fEventID = -5.0;
185 
186  fE = -5.0;
187  fMinX = 1.0e9;
188  fMinY = 1.0e9;
189  fMinZ = 1.0e9;
190  fMaxX = -1.0e9;
191  fMaxY = -1.0e9;
192  fMaxZ = -1.0e9;
193  fNHitX = -5;
194  fNHitY = -5;
195  fCCNC = -5;
196  fIntType = -5;
197  fnuPDG = 0;
198  }
float fEreco2
second reconstructed event energy
float fMaxY
maximum hit Y value in the slice
float fE3Dprongs
sum of hit energies in 3D prongs (excluding the "muon" prong) - this does NOT account for dead materi...
int fCCNC
is this CC or NC (from truth)
float fN3Dprongs
number of fuzzyk 3D prongs
int fNHitX
number of X-view hits in the slice
float fEres3
third estimated event energy resolution
float fEreco3
third reconstructed event energy
float fEremain
sum of remaining slice energy not in 3D prongs - this does NOT account for dead material ...
float fEventID
best BPF muon PID value for the event
float fEres2
second estimated event energy resolution
float fE
true energy
float fSumPE
sum of PE from all hits not on the muon track
float fPmu
reconstructed muon momentum from the track selected to be the muon
float fMaxX
maximum hit X value in the slice
float fEres1
first estimated event energy resolution
float fMinX
minimum hit X value in the slice
int fIntType
neutrino interaction type (from truth)
float fMaxZ
maximum hit Z value in the slice
float fDirZmu
track.dirZ() from the track selected to be the muon
float fMinY
minimum hit Y value in the slice
float fEreco1
first reconstructed event energy
float fMinZ
minimum hit Z value in the slice
int fnuPDG
PDG code for the best matched nu (from truth)
int fNHitY
number of Y-view hits in the slice
fhicl::ParameterSetID art::Observer::selectorConfig ( ) const
inherited
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  )
inherited
void bpfit::BPFEnergyAna::setTruthVars ( const std::vector< cheat::NeutrinoEffPur > &  nuEP)

Definition at line 201 of file BPFEnergyAna_module.cc.

References simb::MCNeutrino::CCNC(), simb::MCParticle::E(), fCCNC, fE, fIntType, fnuPDG, MECModelEnuComparisons::i, simb::MCNeutrino::InteractionType(), cafExposure::match, simb::MCNeutrino::Nu(), simb::MCParticle::PdgCode(), and purity().

Referenced by analyze().

202  {
203  //
204  // This function sets any variables for the TTree that come from truth.
205  // Currently, the most pure neutrino is assumed to be the best
206  // match.
207  //
208 
209  float mostPure = 0.0;
210  unsigned int match = 0;
211  for(unsigned int i = 0; i < nuEP.size(); ++i) {
212  if(nuEP[i].purity > mostPure && nuEP[i].neutrinoInt->NeutrinoSet()) {
213  mostPure = nuEP[i].purity;
214  match = i;
215  }
216  }
217 
218  if(mostPure > 0 && nuEP[match].neutrinoInt->NeutrinoSet()) {
219  simb::MCNeutrino nu = nuEP[match].neutrinoInt->GetNeutrino();
220  simb::MCParticle Nu = nu.Nu();
221  fE = Nu.E();
222  fCCNC = nu.CCNC();
223  fIntType = nu.InteractionType();
224  fnuPDG = Nu.PdgCode();
225  }
226 
227  }
double E(const int i=0) const
Definition: MCParticle.h:232
int PdgCode() const
Definition: MCParticle.h:211
int CCNC() const
Definition: MCNeutrino.h:148
int fCCNC
is this CC or NC (from truth)
const simb::MCParticle & Nu() const
Definition: MCNeutrino.h:146
float fE
true energy
int InteractionType() const
Definition: MCNeutrino.h:150
int fIntType
neutrino interaction type (from truth)
void purity()
Definition: purity.C:35
int fnuPDG
PDG code for the best matched nu (from truth)
Event generator information.
Definition: MCNeutrino.h:18
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited
bool art::Observer::wantAllEvents ( ) const
inherited
bool art::Observer::wantEvent ( Event const &  e)
inherited
std::string art::EDAnalyzer::workerType ( ) const
inherited

Member Data Documentation

TTree* bpfit::BPFEnergyAna::fBPFEnergyTree
private

TTree with slice level info (for energy estimator training)

Definition at line 62 of file BPFEnergyAna_module.cc.

Referenced by analyze(), and beginJob().

int bpfit::BPFEnergyAna::fCCNC
private

is this CC or NC (from truth)

Definition at line 95 of file BPFEnergyAna_module.cc.

Referenced by beginJob(), resetVars(), and setTruthVars().

float bpfit::BPFEnergyAna::fDirZmu
private

track.dirZ() from the track selected to be the muon

Definition at line 78 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fE
private

true energy

Definition at line 86 of file BPFEnergyAna_module.cc.

Referenced by beginJob(), resetVars(), and setTruthVars().

float bpfit::BPFEnergyAna::fE3Dprongs
private

sum of hit energies in 3D prongs (excluding the "muon" prong) - this does NOT account for dead material

Definition at line 80 of file BPFEnergyAna_module.cc.

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

std::string bpfit::BPFEnergyAna::fEnergyLabel
private

label for module that made the energy objects

Definition at line 59 of file BPFEnergyAna_module.cc.

Referenced by analyze(), and reconfigure().

float bpfit::BPFEnergyAna::fEreco1
private

first reconstructed event energy

Definition at line 71 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fEreco2
private

second reconstructed event energy

Definition at line 73 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fEreco3
private

third reconstructed event energy

Definition at line 75 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fEremain
private

sum of remaining slice energy not in 3D prongs - this does NOT account for dead material

Definition at line 81 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fEres1
private

first estimated event energy resolution

Definition at line 72 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fEres2
private

second estimated event energy resolution

Definition at line 74 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fEres3
private

third estimated event energy resolution

Definition at line 76 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fEventID
private

best BPF muon PID value for the event

Definition at line 83 of file BPFEnergyAna_module.cc.

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

int bpfit::BPFEnergyAna::fIntType
private

neutrino interaction type (from truth)

Definition at line 96 of file BPFEnergyAna_module.cc.

Referenced by beginJob(), resetVars(), and setTruthVars().

bool bpfit::BPFEnergyAna::fIsMC
private

are you running over MC?

Definition at line 60 of file BPFEnergyAna_module.cc.

Referenced by analyze(), and reconfigure().

float bpfit::BPFEnergyAna::fMaxX
private

maximum hit X value in the slice

Definition at line 90 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fMaxY
private

maximum hit Y value in the slice

Definition at line 91 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fMaxZ
private

maximum hit Z value in the slice

Definition at line 92 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fMinX
private

minimum hit X value in the slice

Definition at line 87 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fMinY
private

minimum hit Y value in the slice

Definition at line 88 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fMinZ
private

minimum hit Z value in the slice

Definition at line 89 of file BPFEnergyAna_module.cc.

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

float bpfit::BPFEnergyAna::fN3Dprongs
private

number of fuzzyk 3D prongs

Definition at line 79 of file BPFEnergyAna_module.cc.

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

int bpfit::BPFEnergyAna::fNHitX
private

number of X-view hits in the slice

Definition at line 93 of file BPFEnergyAna_module.cc.

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

int bpfit::BPFEnergyAna::fNHitY
private

number of Y-view hits in the slice

Definition at line 94 of file BPFEnergyAna_module.cc.

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

int bpfit::BPFEnergyAna::fnuPDG
private

PDG code for the best matched nu (from truth)

Definition at line 97 of file BPFEnergyAna_module.cc.

Referenced by beginJob(), resetVars(), and setTruthVars().

float bpfit::BPFEnergyAna::fPmu
private

reconstructed muon momentum from the track selected to be the muon

Definition at line 77 of file BPFEnergyAna_module.cc.

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

const art::ProductToken<std::vector<rb::Cluster> > bpfit::BPFEnergyAna::fSlicerToken
private

Definition at line 58 of file BPFEnergyAna_module.cc.

Referenced by analyze().

float bpfit::BPFEnergyAna::fSumPE
private

sum of PE from all hits not on the muon track

Definition at line 82 of file BPFEnergyAna_module.cc.

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


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