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