Public Member Functions | Private Attributes | List of all members
dunemva::MVASelect Class Reference
Inheritance diagram for dunemva::MVASelect:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Member Functions

 MVASelect (fhicl::ParameterSet const &pset)
 
virtual ~MVASelect ()
 
void beginJob () override
 
void beginSubRun (art::SubRun &sr) override
 
void endSubRun (art::SubRun &sr) override
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void produce (art::Event &evt) override
 
- Public Member Functions inherited from art::EDProducer
 EDProducer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDProducer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Producer
virtual ~Producer () noexcept
 
 Producer (fhicl::ParameterSet const &)
 
 Producer (Producer const &)=delete
 
 Producer (Producer &&)=delete
 
Produceroperator= (Producer const &)=delete
 
Produceroperator= (Producer &&)=delete
 
void doBeginJob (SharedResources const &resources)
 
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)
 
- Public Member Functions inherited from art::Modifier
 ~Modifier () noexcept
 
 Modifier ()
 
 Modifier (Modifier const &)=delete
 
 Modifier (Modifier &&)=delete
 
Modifieroperator= (Modifier const &)=delete
 
Modifieroperator= (Modifier &&)=delete
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
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< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Attributes

MVAAlg fMVAAlg
 
std::string fMVAMethod
 
bool fSelNuE
 
bool fSelNuMu
 

Additional Inherited Members

- Public Types inherited from art::EDProducer
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
- Public Types inherited from art::detail::Producer
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 
- Public Types inherited from art::Modifier
template<typename UserConfig , typename UserKeysToIgnore = void>
using Table = ProducerTable< UserConfig, detail::ModuleConfig, UserKeysToIgnore >
 
- Static Public Member Functions inherited from art::EDProducer
static void commitEvent (EventPrincipal &ep, Event &e)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (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< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 47 of file MVASelect_module.cc.

Constructor & Destructor Documentation

dunemva::MVASelect::MVASelect ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 72 of file MVASelect_module.cc.

73  : EDProducer(pset), fMVAAlg(pset)
74  {
75  produces<dunemva::MVASelectPID>();
76 
77  this->reconfigure(pset);
78  }
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
void reconfigure(fhicl::ParameterSet const &pset)
dunemva::MVASelect::~MVASelect ( )
virtual

Definition at line 80 of file MVASelect_module.cc.

80 {}

Member Function Documentation

void dunemva::MVASelect::beginJob ( )
overridevirtual

Reimplemented from art::EDProducer.

Definition at line 100 of file MVASelect_module.cc.

101  {
102  }
void dunemva::MVASelect::beginSubRun ( art::SubRun sr)
overridevirtual

Reimplemented from art::EDProducer.

Definition at line 114 of file MVASelect_module.cc.

114  {
115  }
void dunemva::MVASelect::endSubRun ( art::SubRun sr)
overridevirtual

Reimplemented from art::EDProducer.

Definition at line 170 of file MVASelect_module.cc.

170  {
171  fMVAAlg.endSubRun(sr);
172  }
void endSubRun(const art::SubRun &sr)
Definition: MVAAlg.cxx:373
void dunemva::MVASelect::produce ( art::Event evt)
overridevirtual

Implements art::EDProducer.

Definition at line 119 of file MVASelect_module.cc.

120  {
121  std::unique_ptr<dunemva::MVASelectPID> pidout = std::make_unique<MVASelectPID>();
122 
123  if(fSelNuE) pidout->selectMode = 12;
124  if(fSelNuMu) pidout->selectMode = 14;
125 
126  // Weight seems to have osc probability etc in it. Not suitable for a reco
127  // module, drop that output on the floor
128  double weight;
129  fMVAAlg.Run(evt, pidout->pid, weight);
130 
131  pidout->evtcharge = fMVAAlg.evtcharge;
132  pidout->rawcharge = fMVAAlg.rawcharge;
133  pidout->wirecharge = fMVAAlg.wirecharge;
134 
135  pidout->ntrack = fMVAAlg.ntrack;
138  pidout->trkdedx = fMVAAlg.trkdedx;
139  pidout->trkrch = fMVAAlg.trkrch;
140  pidout->trkrt = fMVAAlg.trkrt;
141  pidout->trkfr = fMVAAlg.trkfr;
143  pidout->nshower = fMVAAlg.nshower;
144  pidout->showerdedx = fMVAAlg.showerdedx;
145  pidout->eshower = fMVAAlg.eshower;
146  pidout->frshower = fMVAAlg.frshower;
147  pidout->nhitspershw = fMVAAlg.nhitspershw;
148  pidout->shwlength = fMVAAlg.shwlength;
149  pidout->shwmax = fMVAAlg.shwmax;
154  pidout->shwdis = fMVAAlg.shwdis;
155  pidout->shwdisx = fMVAAlg.shwdisx;
156  pidout->shwdisy = fMVAAlg.shwdisy;
157  pidout->shwdisz = fMVAAlg.shwdisz;
158  pidout->shwcosx = fMVAAlg.shwcosx;
159  pidout->shwcosy = fMVAAlg.shwcosy;
160  pidout->shwcosz = fMVAAlg.shwcosz;
161  pidout->trkcosx = fMVAAlg.trkcosx;
162  pidout->trkcosy = fMVAAlg.trkcosy;
163  pidout->trkcosz = fMVAAlg.trkcosz;
164  pidout->et = fMVAAlg.ET;
165 
166  evt.put(std::move(pidout));
167  }
float maxtrklength
Definition: MVAAlg.h:99
double wirecharge
Definition: MVAAlg.h:130
float fract_5_wires
Definition: MVAAlg.h:112
int selectMode
What neutrino species are we IDing? Use PDG code to identify numu or nue selection.
Definition: MVASelectPID.h:10
float showerdedx
Definition: MVAAlg.h:106
float shwmax
Definition: MVAAlg.h:111
double rawcharge
Definition: MVAAlg.h:129
float trkpida_save
Definition: MVAAlg.h:104
float trkdedx
Definition: MVAAlg.h:100
weight
Definition: test.py:257
float fract_10_wires
Definition: MVAAlg.h:113
void Run(const art::Event &evt, std::vector< double > &result, double &wgt)
float trkcosy
Definition: MVAAlg.h:124
float shwdisz
Definition: MVAAlg.h:119
float shwcosx
Definition: MVAAlg.h:120
float fract_100_wires
Definition: MVAAlg.h:115
float trkcosz
Definition: MVAAlg.h:125
def move(depos, offset)
Definition: depos.py:107
float frshower
Definition: MVAAlg.h:108
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: DataViewImpl.h:686
float shwdisy
Definition: MVAAlg.h:118
float shwcosy
Definition: MVAAlg.h:121
float avgtrklength
Definition: MVAAlg.h:98
float shwdisx
Definition: MVAAlg.h:117
float evtcharge
Definition: MVAAlg.h:96
float fract_50_wires
Definition: MVAAlg.h:114
float eshower
Definition: MVAAlg.h:107
float trkrch
Definition: MVAAlg.h:101
float trkfr
Definition: MVAAlg.h:103
float trkcosx
Definition: MVAAlg.h:123
double pid
How confident are we?
Definition: MVASelectPID.h:11
float nhitspershw
Definition: MVAAlg.h:109
float shwdis
Definition: MVAAlg.h:116
float ntrack
Definition: MVAAlg.h:97
float shwlength
Definition: MVAAlg.h:110
float nshower
Definition: MVAAlg.h:105
float shwcosz
Definition: MVAAlg.h:122
float trkrt
Definition: MVAAlg.h:102
void dunemva::MVASelect::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 83 of file MVASelect_module.cc.

84  {
85  fMVAMethod=pset.get< std::string >("MVAMethod");
86  fMVAAlg.reconfigure(pset);
87 
88  if(pset.get<std::string>("Select") == "nue"){
89  fSelNuE = true;
90  fSelNuMu = false;
91  } else if(pset.get<std::string>("Select") == "numu"){
92  fSelNuE = false;
93  fSelNuMu = true;
94  }
95 
96  }
std::string string
Definition: nybbler.cc:12
void reconfigure(fhicl::ParameterSet const &p)
Definition: MVAAlg.cxx:273

Member Data Documentation

MVAAlg dunemva::MVASelect::fMVAAlg
private

Definition at line 62 of file MVASelect_module.cc.

std::string dunemva::MVASelect::fMVAMethod
private

Definition at line 63 of file MVASelect_module.cc.

bool dunemva::MVASelect::fSelNuE
private

Definition at line 65 of file MVASelect_module.cc.

bool dunemva::MVASelect::fSelNuMu
private

Definition at line 66 of file MVASelect_module.cc.


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