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

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 NCNNKeras (fhicl::ParameterSet const &p)
 
 ~NCNNKeras ()
 
void beginJob () override
 
void beginRun (art::Run &evt) override
 
void reconfigure (const fhicl::ParameterSet &pset)
 
void produce (art::Event &e) override
 
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)
 
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

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 Member Functions

double TransMomFraction (const std::vector< art::Ptr< rb::Prong > > &prongs) const
 Return transverse momentum fraction of the event. Calculation based on reconstructed prongs. More...
 

Private Attributes

std::string fSliceLabel
 
std::string fVertexLabel
 
std::string fProngLabel
 
std::string fProngInstance
 
std::string fCVNLabel
 
std::string fShowerLIDLabel
 
std::string fShowerLabel
 
std::string fCosmicTrackLabel
 
std::string fMCTruthModuleLabel
 
std::string fPIDLibPath
 
std::string fNCKerasFile
 
keras::KerasModelkeras_5nn
 
TTree * fTree
 
float cosmicid
 
float shwGap
 
float shwnhit
 
float shwnhitx
 
float shwnhity
 
float shwwwidth
 
float shwcalE
 
float partptp
 
float shwdirY
 
float shwlen
 
float shwxminusy
 
float shwxplusy
 
float shwxovery
 
float nmiphit
 
float nshwlid
 
float kerasValue
 
fhicl::ParameterSet fParticleIDAlgPSet
 Particle ID alorithm (loglikelihoods and dE/dx) More...
 

Detailed Description

Definition at line 61 of file NCNNKeras_module.cc.

Member Typedef Documentation

Definition at line 17 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::detail::Producer::Table = Modifier::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 25 of file Producer.h.

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

Definition at line 18 of file EDProducer.h.

Constructor & Destructor Documentation

ncid::NCNNKeras::NCNNKeras ( fhicl::ParameterSet const &  p)
explicit

Definition at line 121 of file NCNNKeras_module.cc.

References reconfigure().

121  :
122  EDProducer(p),
123  fMCTruthModuleLabel(p.get<std::string>("MCTruthModuleLabel")),
124  //fParticleIDAlg(0),
125  fParticleIDAlgPSet(p.get<fhicl::ParameterSet>("ParticleIDAlgPSet"))
126  {
127  produces< std::vector<ncid::NCKeras> > ();
128  produces< art::Assns<ncid::NCKeras, rb::Cluster> > ();
129  this->reconfigure(p);
130  }
fhicl::ParameterSet fParticleIDAlgPSet
Particle ID alorithm (loglikelihoods and dE/dx)
std::string fMCTruthModuleLabel
const char * p
Definition: xmltok.h:285
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.h:20
void reconfigure(const fhicl::ParameterSet &pset)
enum BeamMode string
ncid::NCNNKeras::~NCNNKeras ( )

Definition at line 133 of file NCNNKeras_module.cc.

134  {
135  }

Member Function Documentation

void ncid::NCNNKeras::beginJob ( )
overridevirtual

Reimplemented from art::EDProducer.

Definition at line 138 of file NCNNKeras_module.cc.

References cosmicid, fTree, kerasValue, nmiphit, nshwlid, partptp, shwcalE, shwdirY, shwGap, shwlen, shwnhit, shwnhitx, shwnhity, shwwwidth, shwxminusy, shwxovery, and shwxplusy.

139  {
141  fTree = tfs->make<TTree>("Testtree", "Testtree");
142 
143  fTree->Branch("cosmicid", &cosmicid, "cosmicid/F");
144  fTree->Branch("shwGap", &shwGap, "shwGap/F");
145  fTree->Branch("shwnhit", &shwnhit, "shwnhit/F");
146  fTree->Branch("shwnhitx", &shwnhitx, "shwnhitx/F");
147  fTree->Branch("shwnhity", &shwnhity, "shwnhity/F");
148  fTree->Branch("shwwwidth", &shwwwidth, "shwwwidth/F");
149  fTree->Branch("shwcalE", &shwcalE, "shwcalE/F");
150  fTree->Branch("partptp", &partptp, "partptp/F");
151  fTree->Branch("shwdirY", &shwdirY, "shwdirY/F");
152  fTree->Branch("shwlen", &shwlen, "shwlen/F");
153  fTree->Branch("shwxminusy", &shwxminusy, "shwxminusy/F");
154  fTree->Branch("shwxplusy", &shwxplusy, "shwxplusy/F");
155  fTree->Branch("shwxovery", &shwxovery, "shwxovery/F");
156  fTree->Branch("nmiphit", &nmiphit, "nmiphit/F");
157  fTree->Branch("nshwlid", &nshwlid, "nshwlid/F");
158  fTree->Branch("kerasValue", &kerasValue, "kerasValue/F");
159  }
void ncid::NCNNKeras::beginRun ( art::Run evt)
overridevirtual

Reimplemented from art::EDProducer.

Definition at line 162 of file NCNNKeras_module.cc.

References allTimeWatchdog::endl, util::EnvExpansion(), cet::file_exists(), fNCKerasFile, fPIDLibPath, keras_5nn, and string.

163  {
165  // Make sure we can find the Neural Networks weight file
166  if(!cet::file_exists(pidlibpath + fNCKerasFile)){
167  throw cet::exception("NCKeras")
168  << "Couldn't find file " << pidlibpath + fNCKerasFile <<std::endl;
169  }
170  keras_5nn = new keras::KerasModel(pidlibpath + fNCKerasFile, false);
171  }
std::string fNCKerasFile
std::string fPIDLibPath
std::string EnvExpansion(const std::string &inString)
Function to expand environment variables.
Definition: EnvExpand.cxx:8
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
keras::KerasModel * keras_5nn
bool file_exists(std::string const &qualified_filename)
enum BeamMode string
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::Producer::doBeginJob ( )
inherited
bool art::detail::Producer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited
bool art::detail::Producer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited
void art::detail::Producer::doEndJob ( )
inherited
bool art::detail::Producer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited
bool art::detail::Producer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited
bool art::detail::Producer::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::Producer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited
void art::detail::Producer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited
void art::detail::Producer::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited
void art::detail::Producer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited
std::array<std::vector<ProductInfo>, NumBranchTypes> const& art::ModuleBase::getConsumables ( ) 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
void ncid::NCNNKeras::produce ( art::Event e)
overridevirtual

Implements art::EDProducer.

Definition at line 189 of file NCNNKeras_module.cc.

References simb::MCNeutrino::CCNC(), slid::CompareByEnergy(), keras::KerasModel::compute_output(), cosmicid, util::CreateAssn(), allTimeWatchdog::endl, fCVNLabel, art::fill_ptr_vector(), check_time_usage::float, fMCTruthModuleLabel, fProngInstance, fProngLabel, fShowerLIDLabel, fSliceLabel, fTree, geom(), art::DataViewImpl::getByLabel(), simb::MCTruth::GetNeutrino(), rb::Cluster::IsNoise(), keras_5nn, kerasValue, simb::kNC, rb::Cluster::NCell(), simb::MCTruth::NeutrinoSet(), nmiphit, nshwlid, partptp, ncid::NCKeras::ProngTransMom(), art::DataViewImpl::put(), keras::DataChunk::set_data(), ncid::NCKeras::SetCosPIDKeras(), ncid::NCKeras::SetProngTransMom(), shwcalE, shwdirY, shwGap, shwlen, shwnhit, shwnhitx, shwnhity, shwwwidth, shwxminusy, shwxovery, shwxplusy, cheat::BackTracker::SliceToMCTruth(), TransMomFraction(), and registry_explorer::v.

190  {
191 
192  bool isMCTruthListEmpty = false;
194  try {
195  evt.getByLabel(fMCTruthModuleLabel, mclist);
196  if(mclist->empty()) { isMCTruthListEmpty = true; }
197  }
198  catch(...) { isMCTruthListEmpty = true; }
199  if(isMCTruthListEmpty){
200  mf::LogError("MCTruth Error") << "Error retrieving MCTruth list." << std::endl;
201  return;
202  }
203 
206 
207  std::unique_ptr< std::vector<ncid::NCKeras> >
208  ncCosKeras(new std::vector<ncid::NCKeras>);
209  std::unique_ptr< art::Assns<ncid::NCKeras, rb::Cluster> >
211 
212  // Get the slices in the event
214  evt.getByLabel(fSliceLabel, sliceHandle);
215  std::vector<art::Ptr<rb::Cluster> > slices;
216  art::fill_ptr_vector(slices, sliceHandle);
217 
218  // Get things associated with slices
220  art::FindMany<slid::ShowerLID> showerLidAssn(sliceHandle, evt, fShowerLIDLabel);
221 
222  const int nslices = slices.size();
223  for(int isli = 0; isli < nslices; ++isli){
224 
225  std::vector<cheat::NeutrinoEffPur> SlicePurr = bt->SliceToMCTruth(slices[isli]->AllCells(), slices[isli]->AllCells());
226 
227  if(SlicePurr.size() == 0) continue;
228 
229  const art::Ptr<simb::MCTruth> &SliceTruth = SlicePurr[0].neutrinoInt;
230  if(!SliceTruth->NeutrinoSet()) continue;
231  const simb::MCNeutrino& nu = SliceTruth->GetNeutrino();
232  art::Ptr<rb::Cluster> thisSlice = slices.at(isli);
233 
234  if(thisSlice->IsNoise()) continue;
235  if(!prongAssn.isValid()) continue;
236 
237  int intCurrent = nu.CCNC();
238 
239  if(intCurrent != simb::kNC) continue; // select only CC
240 
241  ncid::NCKeras nckeras;
242  std::vector< art::Ptr<rb::Prong> > prongs = prongAssn.at(isli);
243  if(prongs.empty()) continue;
244 
245  nckeras.SetProngTransMom(TransMomFraction(prongs));
246 
247  art::FindManyP<cvn::Result> fmCVN(slices, evt, fCVNLabel);
248  if(!fmCVN.isValid()) continue; // CVN Validation
249  std::vector< art::Ptr<cvn::Result> > cvns = fmCVN.at(isli);
250  cosmicid = -5.; // CVN values
251  if(!cvns.empty()) cosmicid = cvns[0]->fOutput[14];
252  shwGap = -5.; // LIDShower values
253  shwnhit = -5.;
254  shwnhitx = -5.;
255  shwnhity = -5.;
256  shwwwidth = -5.;
257  shwcalE = -5.;
258  partptp = nckeras.ProngTransMom();
259  shwdirY = -5.;
260  shwlen = -5.;
261  kerasValue = -5.;
262 
263  if(!showerLidAssn.isValid()) continue; // showerLidAssn Validation
264 
265  std::vector<const slid::ShowerLID*> shwlids = showerLidAssn.at(isli);
266  if(shwlids.empty()) continue;
267 
268  sort(shwlids.begin(), shwlids.end(), slid::CompareByEnergy);
270  nshwlid = shwlids.size();
271 
272  cet::maybe_ref< art::Ptr<rb::Shower> const > roSh(foSh.at(0));
273  art::Ptr<rb::Shower> shower = roSh.ref();
274  std::vector< art::Ptr<rb::Shower> > showers;
275  showers.push_back(shower);
277  if(!foShLID.isValid()) continue; // foShLID validation
278 
279  cet::maybe_ref< art::Ptr<slid::ShowerLID> const > roShLID(foShLID.at(0));
280  art::Ptr<slid::ShowerLID> showerLID = roShLID.ref();
281  shwGap = showerLID->Gap();
282  shwnhit = shower->NCell();
283  shwwwidth = showerLID->Radius();
284  shwcalE = showerLID->ShowerEnergy();
285  shwnhitx = shower->NXCell();
286  shwdirY = (float)shower->Dir().Y();
287  shwnhity = shower->NYCell();
288  shwlen = shower->TotalLength();
292  nmiphit = thisSlice->NCell();
293 
294  // Keras model
295  keras::DataChunk *sample = new keras::DataChunkFlat();
296  float myfloats[] = {partptp,
297  cosmicid,
298  nmiphit,
299  shwcalE,
300  shwnhit,
301  nshwlid,
302  shwnhitx,
303  shwnhity,
304  shwxminusy,
305  shwxplusy,
306  shwxovery,
307  shwdirY,
308  shwlen,
309  shwwwidth,
310  shwGap};
311 
312  std::vector<float> v (myfloats, myfloats + sizeof(myfloats) / sizeof(float));
313  sample->set_data(v);
314  kerasValue = keras_5nn->compute_output(sample)[0];
315 
316  nckeras.SetCosPIDKeras(kerasValue);
317 
318  delete sample;
319  ncCosKeras->push_back(nckeras);
320 
321  util::CreateAssn(evt, *ncCosKeras, thisSlice ,*sliceAssn);
322  fTree->Fill();
323  } // end loop over slices
324  evt.put(std::move(sliceAssn));
325  evt.put(std::move(ncCosKeras));
326  } // end of producer
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
int CCNC() const
Definition: MCNeutrino.h:148
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
const simb::MCNeutrino & GetNeutrino() const
Definition: MCTruth.h:77
std::string fMCTruthModuleLabel
std::string fProngLabel
void SetCosPIDKeras(double input)
Definition: NCKeras.h:28
std::string fCVNLabel
virtual void set_data(std::vector< std::vector< std::vector< float > > > const &)
Definition: KerasModel.h:38
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
double ProngTransMom() const
Transverse component of the energy-weighted average of prong directions.
Definition: NCKeras.h:20
std::vector< float > compute_output(keras::DataChunk *dc)
Definition: KerasModel.cxx:354
bool CompareByEnergy(const slid::ShowerLID *a, const slid::ShowerLID *b)
Definition: ShowerLID.cxx:51
std::string fProngInstance
std::string fShowerLIDLabel
double TransMomFraction(const std::vector< art::Ptr< rb::Prong > > &prongs) const
Return transverse momentum fraction of the event. Calculation based on reconstructed prongs...
int evt
keras::KerasModel * keras_5nn
void geom(int which=0)
Definition: geom.C:163
void SetProngTransMom(double input)
Definition: NCKeras.h:25
std::string fSliceLabel
bool NeutrinoSet() const
Definition: MCTruth.h:78
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:291
Event generator information.
Definition: MCNeutrino.h:18
std::vector< NeutrinoEffPur > SliceToMCTruth(const std::vector< const rb::CellHit * > &sliceHits, const std::vector< const rb::CellHit * > &allHits, bool sortPur=false) const
Given a collection of hits (often a slice), returns vector of structures of MCTruth, efficiency, and purity of that neutrino interaction relative to the slice. Efficiency is defined as FLS energy from neutrino interaction in slice / total FLS energy from neutrino interaction in event. This vector is sorted from the highest efficiency interaction to lowest. This function returns all MCTruth, including those without neutrino interactions, i.e. cosmics.
void ncid::NCNNKeras::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 174 of file NCNNKeras_module.cc.

References fCVNLabel, fMCTruthModuleLabel, fNCKerasFile, fParticleIDAlgPSet, fPIDLibPath, fProngInstance, fProngLabel, fShowerLabel, fShowerLIDLabel, fSliceLabel, fhicl::ParameterSet::get(), and string.

Referenced by NCNNKeras().

175  {
176  fMCTruthModuleLabel = p.get< std::string >("MCTruthModuleLabel");
177  fSliceLabel = p.get< std::string >("SliceLabel");
178  fProngLabel = p.get< std::string >("ProngLabel");
179  fProngInstance = p.get< std::string >("ProngInstance");
180  fCVNLabel = p.get< std::string >("CVNLabel");
181  fShowerLabel = p.get< std::string >("ShowerLabel");
182  fShowerLIDLabel = p.get< std::string >("ShowerLIDLabel");
183  fPIDLibPath = p.get< std::string >("PIDLibPath");
184  fNCKerasFile = p.get< std::string >("NCKerasFile");
185  fParticleIDAlgPSet = p.get< fhicl::ParameterSet >("ParticleIDAlgPSet");
186  }
fhicl::ParameterSet fParticleIDAlgPSet
Particle ID alorithm (loglikelihoods and dE/dx)
std::string fNCKerasFile
std::string fPIDLibPath
std::string fMCTruthModuleLabel
std::string fProngLabel
const char * p
Definition: xmltok.h:285
std::string fCVNLabel
std::string fShowerLabel
std::string fProngInstance
std::string fShowerLIDLabel
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::string fSliceLabel
enum BeamMode string
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  )
inherited
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited
double ncid::NCNNKeras::TransMomFraction ( const std::vector< art::Ptr< rb::Prong > > &  prongs) const
private

Return transverse momentum fraction of the event. Calculation based on reconstructed prongs.

Definition at line 329 of file NCNNKeras_module.cc.

References a, b, rb::Cluster::CalorimetricEnergy(), ncid::CompareByCalEnergy(), DEFINE_ART_MODULE(), geom(), geo::GeometryBase::NuMIBeamDirection(), runNovaSAM::ret, and w.

Referenced by produce().

330  {
331  if(prongs.empty()) return 0.;
332 
333  TVector3 ret;
334  for(const art::Ptr<rb::Prong>& prong: prongs){
335  if(!prong->Is3D()) continue;
336  const double w = prong->CalorimetricEnergy();
337  ret += w*prong->Dir();
338  }
339 
340  ret = ret.Unit();
341 
343  const TVector3 beamDir = geom->NuMIBeamDirection();
344  const double beamProj = ret.Dot(beamDir);
345 
346  return (ret-beamProj*beamDir).Mag();
347  }
TVector3 NuMIBeamDirection() const
Direction of neutrinos from the NuMI beam (unit vector)
void geom(int which=0)
Definition: geom.C:163
Float_t w
Definition: plot.C:20
Definition: fwd.h:29
std::string art::EDProducer::workerType ( ) const
inherited

Member Data Documentation

float ncid::NCNNKeras::cosmicid
private

Definition at line 90 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

std::string ncid::NCNNKeras::fCosmicTrackLabel
private

Definition at line 82 of file NCNNKeras_module.cc.

std::string ncid::NCNNKeras::fCVNLabel
private

Definition at line 79 of file NCNNKeras_module.cc.

Referenced by produce(), and reconfigure().

std::string ncid::NCNNKeras::fMCTruthModuleLabel
private

Definition at line 83 of file NCNNKeras_module.cc.

Referenced by produce(), and reconfigure().

std::string ncid::NCNNKeras::fNCKerasFile
private

Definition at line 85 of file NCNNKeras_module.cc.

Referenced by beginRun(), and reconfigure().

fhicl::ParameterSet ncid::NCNNKeras::fParticleIDAlgPSet
private

Particle ID alorithm (loglikelihoods and dE/dx)

FCL parameters for particle ID alorithm (loglikelihoods and dE/dx)

Definition at line 110 of file NCNNKeras_module.cc.

Referenced by reconfigure().

std::string ncid::NCNNKeras::fPIDLibPath
private

Definition at line 84 of file NCNNKeras_module.cc.

Referenced by beginRun(), and reconfigure().

std::string ncid::NCNNKeras::fProngInstance
private

Definition at line 78 of file NCNNKeras_module.cc.

Referenced by produce(), and reconfigure().

std::string ncid::NCNNKeras::fProngLabel
private

Definition at line 77 of file NCNNKeras_module.cc.

Referenced by produce(), and reconfigure().

std::string ncid::NCNNKeras::fShowerLabel
private

Definition at line 81 of file NCNNKeras_module.cc.

Referenced by reconfigure().

std::string ncid::NCNNKeras::fShowerLIDLabel
private

Definition at line 80 of file NCNNKeras_module.cc.

Referenced by produce(), and reconfigure().

std::string ncid::NCNNKeras::fSliceLabel
private

Definition at line 75 of file NCNNKeras_module.cc.

Referenced by produce(), and reconfigure().

TTree* ncid::NCNNKeras::fTree
private

Definition at line 88 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

std::string ncid::NCNNKeras::fVertexLabel
private

Definition at line 76 of file NCNNKeras_module.cc.

keras::KerasModel* ncid::NCNNKeras::keras_5nn
private

Definition at line 87 of file NCNNKeras_module.cc.

Referenced by beginRun(), and produce().

float ncid::NCNNKeras::kerasValue
private

Definition at line 105 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::nmiphit
private

Definition at line 103 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::nshwlid
private

Definition at line 104 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::partptp
private

Definition at line 97 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::shwcalE
private

Definition at line 96 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::shwdirY
private

Definition at line 98 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::shwGap
private

Definition at line 91 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::shwlen
private

Definition at line 99 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::shwnhit
private

Definition at line 92 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::shwnhitx
private

Definition at line 93 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::shwnhity
private

Definition at line 94 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::shwwwidth
private

Definition at line 95 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::shwxminusy
private

Definition at line 100 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::shwxovery
private

Definition at line 102 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().

float ncid::NCNNKeras::shwxplusy
private

Definition at line 101 of file NCNNKeras_module.cc.

Referenced by beginJob(), and produce().


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