XnuePID_module.cc
Go to the documentation of this file.
1 // NOvA includes
2 #include "XnuePID/Xnue.h"
4 #include "RecoBase/Track.h"
5 #include "RecoBase/Prong.h"
6 #include "RecoBase/Cluster.h"
7 #include "RecoBase/CellHit.h"
8 #include "RecoBase/FilterList.h"
9 #include "RecoBase/RecoHit.h"
10 #include "RecoBase/Vertex.h"
12 #include "Utilities/AssociationUtil.h"
14 
15 // Framework includes
19 #include "fhiclcpp/ParameterSet.h"
26 
27 #include <vector>
28 #include <string>
29 
30 // ROOT includes
31 #include "TObject.h"
32 #include "TNtuple.h"
33 #include "TMVA/Factory.h"
34 #include "TMVA/Tools.h"
35 #include "TMVA/Reader.h"
36 #include "TString.h"
37 #include "TMath.h"
38 
39 
40 #include <boost/algorithm/string.hpp>
41 #include <boost/foreach.hpp>
42 #include <boost/tokenizer.hpp>
43 
44 /// for std::out
45 #define MAX_BUFFER 100000
46 
47 /// In case this will be changed to whatever in future
48 //#define FUZZYKVERTEXOUTPUT rb::Track
49 //#define FUZZYKVERTEXOUTPUT rb::Shower
50 #define FUZZYKVERTEXOUTPUT rb::Prong
51 
52 
53 namespace xnue {
54  class XnuePID : public art::EDProducer {
55  public:
56 
57  explicit XnuePID(fhicl::ParameterSet const& pset);
58  virtual ~XnuePID();
59  void beginJob();
60  void produce(art::Event& evt);
61 
62  private:
63 
65  float const& w);
66 
67  /// Book xnue reader
68  bool bookVariables(const std::string& weight_file, TMVA::Reader& xnue, std::string& method_name);
69 
70 
71  /// Method to get Variable names from XML
72  std::vector<std::string> getVarNamesFromXML(const std::string weights_file_name) const;
73 
74 
75  /// Get TMVA method name from XML
76  std::string getMethodNameFromXML(const std::string weights_file_name, const bool get_full_name=true) const;
77 
78  protected:
79  std::string fXnueWeightFile; ///< Xnue weight file name
80  std::string fSliceLabel; ///< Label for slices
81  std::string fProngLabel; ///< Label for prong
82  std::string fInstLabel3D; ///< Instance label for 3d prongs
83  std::string fInstLabel2D; ///< Instance label for 2d prongs
84  std::string fVertexLabel; ///< Label for vertex
85 
86  std::vector<Float_t> fInputVarsXnue; ///< Vector of the variables that are input for TMVA
87 
88  TMVA::Reader* fbdtXnue; ///< Reader for Xnue15
90 
91  };
92 
93  //----------------------------------------------------------------------------
95  fbdtXnue (new TMVA::Reader())
96  {
97  /// Reserve the number of variables to be something big
98  fInputVarsXnue.reserve(10000);
99 
100  fXnueWeightFile = util::EnvExpansion(pset.get< std::string >("XnueWeightFile") );
101  fSliceLabel = pset.get< std::string >("SliceLabel");
102  fProngLabel = pset.get< std::string >("ProngLabel");
103  fInstLabel3D = pset.get< std::string >("InstLabel3D");
104  fInstLabel2D = pset.get< std::string >("InstLabel2D");
105  fVertexLabel = pset.get< std::string >("VertexLabel");
106 
107  /// Expand fcl input path to BDTs
108  //std::string bdtpath = util::EnvExpansion(bdt);
109  /// Add BDT path to the files
110  //fXnueWeightFile = bdtpath + fXnueWeightFile;
111 
112 
113  produces< std::vector<xnue::Xnue> >();
114  produces< art::Assns<xnue::Xnue,rb::Cluster> >();
115 
116  }
117 
118  //...........................................................................
120  {
121  if(fbdtXnue) delete fbdtXnue;
122  }
123 
124  //...........................................................................
126  {
127 
129 
130  /// Need to set Weight file
131  fbdtXnueMethodName = "XnuePID ";
133 
134  /// Need to set Weight file
135  //fbdtXnue12MethodName = "Xnue12 ";
136  //bookVariables(fXnue12WeightFile, *fbdtXnue12, fbdtXnue12MethodName);
137  }
138 
139  //......................................................................
141  float const& w)
142  {
144  rb::RecoHit rhit(cal->MakeRecoHit(*chit, w));
145 
146  return rhit;
147  }
148 
149  //...........................................................................
151  {
152 
154 
155  typedef std::unique_ptr<std::vector<xnue::Xnue> > Xnues_t;
156  typedef std::unique_ptr<art::Assns<xnue::Xnue,rb::Cluster> > XnueAssn_t;
157  Xnues_t pidcol (new std::vector<xnue::Xnue>);
158  XnueAssn_t assncol(new art::Assns<xnue::Xnue,rb::Cluster>);
159 
160  float BDT = -1.0;//set the BDT output to -1
161 
163  evt.getByLabel(fSliceLabel, slices);
164 
165  const art::FindManyP<rb::Vertex> fmVertex (slices, evt, fVertexLabel);
166 
167  //loop over all slices
168  for(unsigned int sliceIdx = 0; sliceIdx < slices->size(); ++sliceIdx){
169 
170  if(rb::IsFiltered(evt, slices, sliceIdx)) continue;
171  const rb::Cluster& slice = (*slices)[sliceIdx];
172 
173  if(slice.IsNoise()) continue;
174 
175  //reco vertex
176  //only continue if this get by label succeeded
177  if (fmVertex.isValid()){
178  std::vector<art::Ptr<rb::Vertex>> vert = fmVertex.at(sliceIdx);
179  if (vert.size() != 1) continue;
180 
182  std::vector<art::Ptr<FUZZYKVERTEXOUTPUT>> prongs = fmProng3D.at(0);
183 
184  std::vector<art::Ptr<FUZZYKVERTEXOUTPUT>> SelectedProng;
185  //check if instance label is defined to handle sorting of prongs
186  if ((fInstLabel3D != "")&&(fInstLabel2D != "")){
187  SelectedProng = fmProng3D.at(0);
188  }
189  else{
190  for( unsigned int ip=0; ip<prongs.size(); ++ip ){
191  art::Ptr<FUZZYKVERTEXOUTPUT> current_prong = prongs[ip];
192  if(current_prong->IsNoise() ) continue;
193  if(current_prong->View() == geo::kXorY)//3D prongs
194  SelectedProng.push_back(current_prong);
195  }
196  }
197 
198  ///////////////////////////////
199  // variables
200  ///////////////////////////////
201  float prong1_energy=0.;
202  float prong1_fmip=0.;
203  float prong2_fmip=0.;
204  float prong1_Efrac_6maxplanes=0.;
205  float prong1_Efrac_plane2=0.;
206  float prong1_Efrac_plane3=0.;
207  float prong1_Efrac_plane4=0.;
208  float prong1_Efrac_10planes=0.;
209  float prong1_Efrac_2sigma=0.;
210 
211  ////////////////////////////////
212  //select most-energetic shower
213  //select sub-most-energetic shower
214  ////////////////////////////////
215  int nprongs=SelectedProng.size();
216 
217  if( nprongs>0 ){
218  //prong-level info
219  std::vector<float> pEnergy;
220  std::vector<float> pFmip;
221  std::vector<int> pNplanes;
222  pEnergy.clear();
223  pFmip.clear();
224  pNplanes.clear();
225 
226  //cell-level info
227  std::vector<unsigned int> pCellIndex;
228  std::vector<float> pCellX;
229  std::vector<float> pCellY;
230  std::vector<float> pCellE;
231  std::vector<int> pCellPlane;
232  pCellIndex.clear();
233  pCellX.clear();
234  pCellY.clear();
235  pCellE.clear();
236  pCellPlane.clear();
237 
238  for( int ip=0; ip<nprongs; ++ip ){
239 
240  float Eprong=0.;
241  int ntotal=0;
242  int nmip=0;
243  const art::Ptr<FUZZYKVERTEXOUTPUT> current_prong = SelectedProng[ip];
244  for( unsigned int icell=0; icell<current_prong->NCell(); ++icell){
245  const art::Ptr<rb::CellHit>& chit = current_prong->Cell(icell);
246  const rb::RecoHit rhit = current_prong->RecoHit(icell);
247 
248  if( !rhit.IsCalibrated() ) continue;
249 
250  pCellX.push_back(rhit.X());
251  pCellY.push_back(rhit.Y());
252  pCellE.push_back(rhit.GeV());
253  pCellIndex.push_back(ip);
254  pCellPlane.push_back(chit->Plane());
255 
256  Eprong += rhit.GeV();
257  ++ntotal;
258  //if( rhit.PECorr()>100. && rhit.PECorr()<240. ) ++nmip;
259  if( rhit.GeV()>0.0067 && rhit.GeV()<0.0161 ) ++nmip;
260  }//loop prong associated cells
261  //save each prong energy
262  pEnergy.push_back(Eprong);
263  //save total planes
264  pNplanes.push_back(current_prong->ExtentPlane());
265  //calculate and save fraction of mip for each prong
266  float fmip=0.;
267  if( ntotal>0 ) fmip = (float)nmip/ntotal;
268  pFmip.push_back(fmip);
269 
270  }//loop prongs
271  //find index for most-energetic prong
272  unsigned int Index1=-1;
273  float p1Emax=-1.;
274  for( int i=0; i<nprongs; ++i ){
275  if( pEnergy[i]>p1Emax ){
276  p1Emax = pEnergy[i];
277  Index1=i;
278  }
279  }//loop all prongs' energy
280  prong1_energy = pEnergy[Index1];
281  prong1_fmip = pFmip[Index1];
282 
283  //save leading-prong associated cell info
284  std::vector<float> p1cellX;
285  std::vector<float> p1cellY;
286  std::vector<float> p1cellE;
287  std::vector<int> p1cellPlane;
288  for(unsigned int ic=0; ic<pCellE.size(); ++ic ){
289  if( pCellIndex[ic] != Index1 ) continue;
290  p1cellX.push_back(pCellX[ic]);
291  p1cellY.push_back(pCellY[ic]);
292  p1cellE.push_back(pCellE[ic]);
293  p1cellPlane.push_back(pCellPlane[ic]);
294  }//loop all cells
295 
296  int minplane=9999;
297  for(unsigned int ic=0; ic<p1cellE.size(); ++ic ){
298  if( minplane>p1cellPlane[ic] ){
299  minplane=p1cellPlane[ic];
300  }
301  }//lopp leading-prong cells
302 
303  int Nplanes_p1=pNplanes[Index1];
304  if( prong1_energy>0. ){
305  //energy in each plane
306  std::vector<float> p1PlaneEnergy;
307  p1PlaneEnergy.clear();
308  //energy in transverse road
309  double totalE_road=0.;
310 
311  for( int ip=0; ip<Nplanes_p1; ++ip ){
312  double eplane=0.;
313 
314  double cellX=0.;//energetic cell X in each plane
315  double cellY=0.;//energetic cell Y in each plane
316  double Ecell=0.;
317  double EXcell=0.;
318  double EYcell=0.;
319  std::vector<double> Xxview;
320  std::vector<double> Exview;
321  std::vector<double> Yyview;
322  std::vector<double> Eyview;
323  Xxview.clear();
324  Exview.clear();
325  Yyview.clear();
326  Eyview.clear();
327 
328  for(unsigned int ic=0; ic<p1cellE.size(); ++ic ){
329  int Dplane=p1cellPlane[ic]-minplane;
330  if( Dplane==ip ){
331  eplane += p1cellE[ic];
332 
333  Ecell += p1cellE[ic];
334  EXcell += p1cellE[ic]*p1cellX[ic];
335  EYcell += p1cellE[ic]*p1cellY[ic];
336 
337  if( p1cellPlane[ic]%2 != 0 ){
338  Xxview.push_back(p1cellX[ic]);
339  Exview.push_back(p1cellE[ic]);
340  }//in X view
341  else {
342  Yyview.push_back(p1cellY[ic]);
343  Eyview.push_back(p1cellE[ic]);
344  }//in Y view
345  }//in the plane
346  }//loop leading-prong associated cells
347  p1PlaneEnergy.push_back(eplane);
348 
349  if( Ecell>0.0 ){
350  cellX = EXcell/Ecell;
351  cellY = EYcell/Ecell;
352  }
353  int Nxviews=Xxview.size();
354  int Nyviews=Yyview.size();
355  if( Nxviews>0 ){
356  for( int ixv=0; ixv<Nxviews; ++ixv ){
357  if( fabs(Xxview[ixv]-cellX) < 2.*2. ) totalE_road+=Exview[ixv];
358  }
359  }//in X view
360  if( Nyviews>0 ){
361  for( int iyv=0; iyv<Nyviews; ++iyv ){
362  if( fabs(Yyview[iyv]-cellY) < 2.*2. ) totalE_road+=Eyview[iyv];
363  }
364  }//in Y view
365 
366  }//loop planes
367 
368  double efrac_6plane=-1.;
369  double p1_Eplane[20]={0.};//energy deposit upto 20 planes
370  int nplanes=p1PlaneEnergy.size();
371  for( int ip=0; ip<nplanes; ++ip ){
372  for( int j=0; j<20; ++j ){
373  if( ip<=j ) p1_Eplane[j]+=p1PlaneEnergy[ip];
374  }
375  if( ip<nplanes-6 ){
376  double e_frac6=(p1PlaneEnergy[ip]+p1PlaneEnergy[ip+1]+p1PlaneEnergy[ip+2]+p1PlaneEnergy[ip+3]+p1PlaneEnergy[ip+4]+p1PlaneEnergy[ip+5])/pEnergy[Index1];
377  if( efrac_6plane<e_frac6 ) efrac_6plane=e_frac6;
378  }
379  else if( nplanes<=6 ) efrac_6plane=1.;
380 
381  }//end loop for p1PlaneEnergy
382 
383  double efrac_Eplane[20]={0.};
384  for( int ip=0; ip<20; ++ip ){
385  efrac_Eplane[ip] = p1_Eplane[ip]/pEnergy[Index1];
386  }
387 
388  double efrac_plane2=0.;
389  double efrac_plane3=0.;
390  double efrac_plane4=0.;
391 
392  if( p1PlaneEnergy.size()>1 && pEnergy[Index1]>0. )
393  efrac_plane2=p1PlaneEnergy[1]/pEnergy[Index1];
394  if( p1PlaneEnergy.size()>2 && pEnergy[Index1]>0. )
395  efrac_plane3=p1PlaneEnergy[2]/pEnergy[Index1];
396  if( p1PlaneEnergy.size()>3 && pEnergy[Index1]>0. )
397  efrac_plane4=p1PlaneEnergy[3]/pEnergy[Index1];
398 
399  prong1_Efrac_6maxplanes=efrac_6plane;
400  prong1_Efrac_10planes=efrac_Eplane[9];
401  prong1_Efrac_plane2 = efrac_plane2;
402  prong1_Efrac_plane3 = efrac_plane3;
403  prong1_Efrac_plane4 = efrac_plane4;
404 
405  prong1_Efrac_2sigma = totalE_road/pEnergy[Index1];
406 
407  }//prong energy is above 0
408 
409  //find index for sub-leading prong
410  if( nprongs>1 ){
411  unsigned int Index2=-1;
412  float p2Emax=-1;
413  for(unsigned int i=0; i<pEnergy.size(); ++i ){
414  if( i == Index1 ) continue;//exclude leading prong
415  if( pEnergy[i]>p2Emax ){
416  p2Emax = pEnergy[i];
417  Index2=i;
418  }
419  }//loop all prongs' energy
420  prong2_fmip=pFmip[Index2];
421 
422  }//haveing more than 1 prongs
423 
424  }//having 3D prongs
425 
426  fInputVarsXnue[0] = (Float_t)prong2_fmip;
427  fInputVarsXnue[1] = (Float_t)prong1_Efrac_6maxplanes;
428  fInputVarsXnue[2] = (Float_t)prong1_Efrac_plane2;
429  fInputVarsXnue[3] = (Float_t)prong1_Efrac_plane3;
430  fInputVarsXnue[4] = (Float_t)prong1_Efrac_plane4;
431  fInputVarsXnue[5] = (Float_t)prong1_Efrac_10planes;
432  fInputVarsXnue[6] = (Float_t)prong1_Efrac_2sigma;
433 
434 
435  BDT = fbdtXnue->EvaluateMVA(fbdtXnueMethodName);
436 
437 
438  /// Slice for the PID
439  const art::Ptr<rb::Cluster> bestSlice(slices,sliceIdx);
440 
441  Xnue pid;
442  pid.SetVal (BDT);
443  pid.SetPdg (12);
444  pid.SetP2Fmip (fInputVarsXnue[0]);
445  pid.SetEmaxfrac6p (fInputVarsXnue[1]);
446  pid.SetEfracp2 (fInputVarsXnue[2]);
447  pid.SetEfracp3 (fInputVarsXnue[3]);
448  pid.SetEfracp4 (fInputVarsXnue[4]);
449  pid.SetEfrac10p (fInputVarsXnue[5]);
450  pid.SetEfrac2sig (fInputVarsXnue[6]);
451 
452  pid.SetP1Fmip (prong1_fmip);
453  pid.SetP1Energy (prong1_energy);
454 
455  pidcol->push_back(pid);
456 
457 
458  util::CreateAssn(*this,evt,*(pidcol.get()),bestSlice,*(assncol.get()));
459 
460 
461  }//check Assn between Vertex and Slice exists
462  }//has reco slicer
463 
464  evt.put(std::move(pidcol));
465  evt.put(std::move(assncol));
466 
467  }// end of produce
468 
469 
470  //...........................................................................
471  bool XnuePID::bookVariables(const std::string& weight_file, TMVA::Reader& xnue, std::string& method_name)
472  {
473  /// Get all variable names from the weight XML
474  const std::vector<std::string> varnames_from_xml = getVarNamesFromXML(weight_file);
475 
476  /// Number of variables
477  const unsigned int nvars = varnames_from_xml.size();
478 
479  /// Add variables to TMVA
480  for(unsigned int i=0; i<nvars; ++i){
481  xnue.AddVariable(varnames_from_xml[i], &fInputVarsXnue[i]);
482 
483  }// end of adding variables to TMVA
484 
485  /// Extract method name and add it to the current name
486  method_name += getMethodNameFromXML(weight_file);
487 
488  /// Book TMVA
489  xnue.BookMVA(method_name, weight_file);
490 
491  return true;
492  }// end of XnuePID::bookVariables(TMVA::Reader& xnue)
493 
494 
495  //---------------------------------------------------------------------------
496  // Parse XML file to extract TMVA method name
498  const bool get_full_name
499  ) const
500  {
501 
502  /// System command to read out variables
503  std::string cmd = "cat " + weights_file_name;
504  cmd += "| grep \"<MethodSetup\"";
505 
506  /// d
507  std::string data; ///< stream from system
508 
509  /// Perform a system call of cmd with the output stream going to data
510  {
511  FILE *stream;
512  char buffer[MAX_BUFFER];
513 
514  stream = popen(cmd.c_str(), "r");
515 
516  while ( fgets(buffer, MAX_BUFFER, stream) != NULL ){
517  data.append(buffer);
518  }
519  pclose(stream);
520  }// end of the system call
521 
522  /// Replace stuff
523  boost::replace_all(data, "<MethodSetup Method=", "");
524  boost::replace_all(data, ">" , "");
525  boost::replace_all(data, "\"" , "");
526  boost::replace_all(data, " " , "");
527  boost::replace_all(data, "\n" , "");
528 
529  /// If getting a full name, return now
530  /// Full name is, for instance, "BDT::BDTG"
531  /// Short name would be "BDTG"
532  if(get_full_name) return data;
533 
534 
535  /// Getting the short name from the full name
536 
537  std::vector<std::string> names;
538 
539  /// Tokenize the string, with a separator ";"
540  const boost::char_separator<char> sep(":");
541  boost::tokenizer< boost::char_separator<char> > tokens(data, sep);
542  BOOST_FOREACH (const std::string& t, tokens) {
543 
544  /// If the size is non-zero, add the string to the vector of arguments
545  if(t.size() > 0)
546  names.push_back(t);
547  }// end of loop over tokens
548 
549  std::string out_string;
550 
551  if(names.size() > 0)
552  out_string = names[names.size() - 1];
553 
554  return out_string;
555  }
556 
557  //---------------------------------------------------------------------------
558  // Parse XML file to extract variable names
559  std::vector<std::string> XnuePID::getVarNamesFromXML(const std::string file_name) const
560  {
561  /// System command to read out variables
562  std::string cmd = "cat " + file_name;
563  cmd += "| grep \"Variable VarIndex=\" | awk \'{print $3}\'";
564 
565  /// d
566  std::string data; ///< stream from system
567 
568  /// Perform a system call of cmd with the output stream going to data
569  {
570  FILE *stream;
571  char buffer[MAX_BUFFER];
572 
573  stream = popen(cmd.c_str(), "r");
574 
575  while ( fgets(buffer, MAX_BUFFER, stream) != NULL ){
576  data.append(buffer);
577  }
578  pclose(stream);
579  }// end of the system call
580 
581  /// Replace stuff
582  boost::replace_all(data, "Expression=", ";");
583  boost::replace_all(data, "\"" , "");
584  boost::replace_all(data, "\n" , "");
585  boost::replace_all(data, "," , "");
586  boost::replace_all(data, " " , "");
587  /// After the replacement the string of variables have variables separated by ";"
588 
589  /// Output vector of variables in the XML file
590  std::vector<std::string> vars;
591 
592  /// Tokenize the string, with a separator ";"
593  const boost::char_separator<char> sep(";");
594  boost::tokenizer< boost::char_separator<char> > tokens(data, sep);
595  BOOST_FOREACH (const std::string& t, tokens) {
596 
597  /// If the size is non-zero, add the string to the vector of arguments
598  if(t.size() > 0)
599  vars.push_back(t);
600  }// end of loop over tokens
601 
602  return vars;
603  }
604 
606 
607 }//end namespace
608 
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.
void SetEfracp4(float efrac_p4)
Definition: Xnue.h:43
fvar< T > fabs(const fvar< T > &x)
Definition: fabs.hpp:15
int nprongs
X or Y views.
Definition: PlaneGeo.h:30
virtual ~XnuePID()
unsigned short Plane() const
Definition: CellHit.h:39
std::string EnvExpansion(const std::string &inString)
Function to expand environment variables.
Definition: EnvExpand.cxx:8
rb::RecoHit MakeRecoHit(rb::CellHit const &cellhit, double w)
A collection of associated CellHits.
Definition: Cluster.h:47
std::vector< Float_t > fInputVarsXnue
Vector of the variables that are input for TMVA.
TString ip
Definition: loadincs.C:5
DEFINE_ART_MODULE(TestTMapFile)
void SetEfracp2(float efrac_p2)
Definition: Xnue.h:41
void SetEmaxfrac6p(float emaxfrac_6p)
Definition: Xnue.h:39
::xsd::cxx::tree::buffer< char > buffer
Definition: Database.h:179
Calibrated quantities relying on position in the orthogonal view. To generate a rb::CellHit from a rb...
Definition: RecoHit.h:19
bool bookVariables(const std::string &weight_file, TMVA::Reader &xnue, std::string &method_name)
Book xnue reader.
const XML_Char const XML_Char * data
Definition: expat.h:268
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
bool replace_all(std::string &in, std::string const &from, std::string const &to)
Replace all occurrences of from in string with to.
std::string fProngLabel
Label for prong.
TMVA::Reader * fbdtXnue
Reader for Xnue15.
string cmd
Definition: run_hadd.py:52
void SetP1Fmip(float p1Fmip)
Definition: Xnue.h:37
T get(std::string const &key) const
Definition: ParameterSet.h:231
int evt
bool IsCalibrated() const
You MUST check here before accessing PECorr, MIP or GeV.
Definition: RecoHit.cxx:35
bool IsFiltered(const art::Event &evt, art::Ptr< T > x, const std::vector< std::string > &labels)
Is this Ptr marked "filtered out"?
Definition: FilterList.h:96
const std::map< std::pair< std::string, std::string >, Variable > vars
const double j
Definition: BetheBloch.cxx:29
Vertex location in position and time.
void SetEfrac10p(float efrac_10p)
Definition: Xnue.h:40
std::string fInstLabel3D
Instance label for 3d prongs.
std::string fXnueWeightFile
Xnue weight file name.
const char sep
void SetP2Fmip(float p2Fmip)
Definition: Xnue.h:38
int nplanes
Definition: geom.C:145
void SetPdg(int pdg)
Definition: PID.h:23
std::string fInstLabel2D
Instance label for 2d prongs.
std::string fVertexLabel
Label for vertex.
float GeV() const
Definition: RecoHit.cxx:69
const int nvars
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
std::string getMethodNameFromXML(const std::string weights_file_name, const bool get_full_name=true) const
Get TMVA method name from XML.
float X() const
Definition: RecoHit.h:36
Definition: FillPIDs.h:16
Definition: tmvaglob.h:28
std::vector< std::string > getVarNamesFromXML(const std::string weights_file_name) const
Method to get Variable names from XML.
void SetEfracp3(float efrac_p3)
Definition: Xnue.h:42
void produce(art::Event &evt)
float Y() const
Definition: RecoHit.h:37
rb::RecoHit MakeRecoHit(art::Ptr< rb::CellHit > const &chit, float const &w)
std::string fSliceLabel
Label for slices.
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163
void SetEfrac2sig(float efrac_2sig)
Definition: Xnue.h:44
void SetVal(double val)
Definition: PID.h:24
XnuePID(fhicl::ParameterSet const &pset)
Float_t w
Definition: plot.C:20
void SetP1Energy(float p1Energy)
Definition: Xnue.h:36
#define MAX_BUFFER
for std::out
std::string fbdtXnueMethodName
enum BeamMode string