Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
skim::NueSkimmer Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-09-17/AnalysisSkimmer/skimmers/NueSkimmer.h"

Inheritance diagram for skim::NueSkimmer:
skim::BaseSkimmer

Public Member Functions

 NueSkimmer (fhicl::ParameterSet const &p)
 
void reconfigure (fhicl::ParameterSet const &p)
 
void Skim (art::Event &e, art::EDProducer const &prod)
 
std::string const & InstanceLabel ()
 

Protected Attributes

std::string fCellHitSkimLabel
 label of module creating slices More...
 
std::string fInstanceLabel
 instance label for products created by this skimmer More...
 
art::InputTag fInputTag
 combination of the above two strings More...
 

Private Member Functions

void CopyShowerLID (art::Event &e, art::EDProducer const &prod, std::vector< art::Ptr< rb::Shower > > const &showerIn, std::vector< slid::ShowerLID > &slidOut, std::vector< rb::Cluster > &sliceOut, std::vector< rb::Shower > &showerOut, art::Assns< rb::Cluster, slid::ShowerLID > &slcSLDAssn, art::Assns< rb::Shower, slid::ShowerLID > &shwSLDAssn)
 
void CopyProngCVN (art::Event &e, art::EDProducer const &prod, std::vector< art::Ptr< rb::Prong > > const &prongIn, std::vector< rb::PID > &pidOut, std::vector< rb::Cluster > &sliceOut, std::vector< rb::Prong > &prongOut, art::Assns< rb::Cluster, rb::PID > &slcPIDAssn, art::Assns< rb::Prong, rb::PID > &pngPIDAssn)
 
void CopyShowerPngAssn (art::Event &e, art::EDProducer const &prod, std::vector< art::Ptr< rb::Shower > > const &showerIn, std::vector< art::Ptr< rb::Prong > > const &prongIn, std::vector< rb::Shower > &showerOut, std::vector< rb::Prong > &prongOut, art::Assns< rb::Shower, rb::Prong > &shwPngAssn)
 
void CopyMichelSlice (art::Event &e, art::EDProducer const &prod, std::vector< art::Ptr< me::SlcME > > const &objIn, std::vector< me::SlcME > &objOut, std::vector< rb::Cluster > &sliceOut, art::Assns< rb::Cluster, me::SlcME > &slcMEAssn)
 
void CopyMichelTrack (art::Event &e, art::EDProducer const &prod, std::vector< art::Ptr< me::TrkME > > const &objIn, std::vector< me::TrkME > &objOut, std::vector< rb::Cluster > &sliceOut, art::Assns< rb::Cluster, me::TrkME > &slcMEAssn)
 

Private Attributes

std::string fVertexLabel
 label of module creating vertex More...
 
std::string fShowerLabel
 label of module creating showers More...
 
art::InputTag fProngTag
 input tag of module creating showers More...
 
std::string fLIDLabel
 label of module creating lids More...
 
std::string fLEMLabel
 label of module creating lems More...
 
std::string fCosRejLabel
 label of module creating cosrejs More...
 
std::string fCAFLabel
 label of module creating StandardRecords More...
 
std::string fGeneratorLabel
 label of module generating events More...
 
std::string fFluxWeightLabel
 label of module creating flux weights More...
 
std::string fCVNLabel
 label of module creating cvns More...
 
std::string fNueVetoLabel
 label of module creating nuevetos More...
 
std::string fMichelLabel
 label of module creating slice Michel e's More...
 
std::string fCVNProngLabel
 label of module creating prongs cvn More...
 

Detailed Description

Definition at line 32 of file NueSkimmer.h.

Constructor & Destructor Documentation

skim::NueSkimmer::NueSkimmer ( fhicl::ParameterSet const &  p)
explicit

Definition at line 54 of file NueSkimmer.cxx.

References reconfigure().

56 
57 {
58  this->reconfigure(p);
59 
60  return;
61 }
void reconfigure(fhicl::ParameterSet const &p)
Definition: NueSkimmer.cxx:519
const char * p
Definition: xmltok.h:285
BaseSkimmer(fhicl::ParameterSet const &p)
Definition: BaseSkimmer.cxx:10

Member Function Documentation

void skim::NueSkimmer::CopyMichelSlice ( art::Event e,
art::EDProducer const &  prod,
std::vector< art::Ptr< me::SlcME > > const &  objIn,
std::vector< me::SlcME > &  objOut,
std::vector< rb::Cluster > &  sliceOut,
art::Assns< rb::Cluster, me::SlcME > &  slcMEAssn 
)
private

Definition at line 435 of file NueSkimmer.cxx.

References util::CreateAssn(), skim::BaseSkimmer::fInstanceLabel, art::EDProducer::getProductID(), in, art::Event::productGetter(), me::SlcME::SetMID(), and art::Assns< L, R, D >::size().

Referenced by Skim().

441 {
442 
443  // need to create a ptr to the slice into the new object.
444  art::ProductID slcID = prod.getProductID< std::vector<rb::Cluster> >(fInstanceLabel);
445  art::Ptr<rb::Cluster> slcPtr(slcID, sliceOut.size() - 1, e.productGetter(slcID));
446 
447  me::SlcME slcME;
448 
449  for(auto in : objIn){
450 
451  slcME.SetMID (in->MID() );
452  slcME.SetParentSlc(slcPtr );
453  slcME.SetDeltaT (in->DeltaT() );
454  slcME.SetDistToSlc(in->DistToSlc());
455 
456  objOut.push_back( slcME );
457 
459  e,
460  sliceOut,
461  objOut,
462  slcMEAssn,
463  objOut.size()-1,
464  objOut.size(),
465  UINT_MAX,
468  }
469 
470  return;
471 }
EDProductGetter const * productGetter(ProductID const) const
size_type size() const
Definition: Assns.h:440
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 SetMID(double)
Definition: MEClusters.cxx:18
T prod(const std::vector< T > &v)
Definition: prod.hpp:17
ifstream in
Definition: comparison.C:7
std::string fInstanceLabel
instance label for products created by this skimmer
Definition: BaseSkimmer.h:44
void skim::NueSkimmer::CopyMichelTrack ( art::Event e,
art::EDProducer const &  prod,
std::vector< art::Ptr< me::TrkME > > const &  objIn,
std::vector< me::TrkME > &  objOut,
std::vector< rb::Cluster > &  sliceOut,
art::Assns< rb::Cluster, me::TrkME > &  slcMEAssn 
)
private

Definition at line 474 of file NueSkimmer.cxx.

References util::CreateAssn(), skim::BaseSkimmer::fInstanceLabel, art::EDProducer::getProductID(), in, art::Event::productGetter(), me::SlcME::SetMID(), and art::Assns< L, R, D >::size().

Referenced by Skim().

480 {
481 
482  // need to create a ptr to the slice into the new object.
483  art::ProductID slcID = prod.getProductID< std::vector<rb::Cluster> >(fInstanceLabel);
484  art::Ptr<rb::Cluster> slcPtr(slcID, sliceOut.size() - 1, e.productGetter(slcID));
485 
486  me::TrkME trkME;
487 
488  for(auto in : objIn){
489 
490  trkME.SetMID (in->MID() );
491  trkME.SetParentSlc(slcPtr );
492  trkME.SetDeltaT (in->DeltaT() );
493  trkME.SetDistToSlc(in->DistToSlc());
494 
495  // Intentionally not copying the art::Ptr to the parent kalman track
496  // here because it does not appear to be used for the BEND decomposition
497  // We can revisit that decision if necessary, but it will make the
498  // bookkeeping much harder.
499 
500  objOut.push_back( trkME );
501 
503  e,
504  sliceOut,
505  objOut,
506  slcMEAssn,
507  objOut.size()-1,
508  objOut.size(),
509  UINT_MAX,
512  }
513 
514  return;
515 }
EDProductGetter const * productGetter(ProductID const) const
size_type size() const
Definition: Assns.h:440
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 SetMID(double)
Definition: MEClusters.cxx:18
T prod(const std::vector< T > &v)
Definition: prod.hpp:17
ifstream in
Definition: comparison.C:7
std::string fInstanceLabel
instance label for products created by this skimmer
Definition: BaseSkimmer.h:44
void skim::NueSkimmer::CopyProngCVN ( art::Event e,
art::EDProducer const &  prod,
std::vector< art::Ptr< rb::Prong > > const &  prongIn,
std::vector< rb::PID > &  pidOut,
std::vector< rb::Cluster > &  sliceOut,
std::vector< rb::Prong > &  prongOut,
art::Assns< rb::Cluster, rb::PID > &  slcPIDAssn,
art::Assns< rb::Prong, rb::PID > &  pngPIDAssn 
)
private

Definition at line 325 of file NueSkimmer.cxx.

References util::CreateAssn(), fCVNProngLabel, skim::BaseSkimmer::fInstanceLabel, art::FindManyP< ProdB, Data >::get(), PandAna.reco_validation.add_data::offset, BlessedPlots::pid, and art::Assns< L, R, D >::size().

Referenced by Skim().

333 {
334 
335  art::FindManyP<rb::PID> fmpid(prongIn, e, fCVNProngLabel);
336 
337  // we may be calling this multiple times in an event because there are several slices
338  // that passed the selection. figure out where the showers for this slice start in
339  // the output vector as that is important for the creation of the slid to shower associations
340  size_t offset = prongOut.size() - prongIn.size();
341 
342  std::vector< art::Ptr<rb::PID>> pidvec;
343  for(size_t s = 0; s < prongIn.size(); ++s){
344 
345  pidvec.clear();
346  fmpid.get(s, pidvec);
347 
348  for(auto pid : pidvec ){
349  // make a copy of the PID, you can't just copy the location of the
350  // previous one.
351  pidOut.emplace_back(pid->Pdg(), pid->Value());
353  e,
354  prongOut,
355  pidOut,
356  pngPIDAssn,
357  pidOut.size()-1,
358  pidOut.size(),
359  s + offset,
363  e,
364  sliceOut,
365  pidOut,
366  slcPIDAssn,
367  pidOut.size()-1,
368  pidOut.size(),
369  UINT_MAX,
372  }
373  }
374 
375  return;
376 }
size_type size() const
Definition: Assns.h:440
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.
std::string fCVNProngLabel
label of module creating prongs cvn
Definition: NueSkimmer.h:97
const XML_Char * s
Definition: expat.h:262
T prod(const std::vector< T > &v)
Definition: prod.hpp:17
std::string fInstanceLabel
instance label for products created by this skimmer
Definition: BaseSkimmer.h:44
void skim::NueSkimmer::CopyShowerLID ( art::Event e,
art::EDProducer const &  prod,
std::vector< art::Ptr< rb::Shower > > const &  showerIn,
std::vector< slid::ShowerLID > &  slidOut,
std::vector< rb::Cluster > &  sliceOut,
std::vector< rb::Shower > &  showerOut,
art::Assns< rb::Cluster, slid::ShowerLID > &  slcSLDAssn,
art::Assns< rb::Shower, slid::ShowerLID > &  shwSLDAssn 
)
private

Definition at line 271 of file NueSkimmer.cxx.

References util::CreateAssn(), skim::BaseSkimmer::fInstanceLabel, fLIDLabel, PandAna.reco_validation.add_data::offset, and art::Assns< L, R, D >::size().

Referenced by Skim().

279 {
280 
281  // do a FindOne for the shower to ShowerLID connection. Copy the found ShowerLID into the
282  // output vector, then make the associations
283  art::FindOne<slid::ShowerLID> foslid(showerIn, e, fLIDLabel);
284 
285  // we may be calling this multiple times in an event because there are several slices
286  // that passed the selection. figure out where the showers for this slice start in
287  // the output vector as that is important for the creation of the slid to shower associations
288  size_t offset = showerOut.size() - showerIn.size();
289 
290  for(size_t s = 0; s < showerIn.size(); ++s){
292  if( slid.isValid() ){
293  slidOut.push_back( slid.ref() );
295  e,
296  showerOut,
297  slidOut,
298  shwSLDAssn,
299  slidOut.size()-1,
300  slidOut.size(),
301  s + offset,
305  e,
306  sliceOut,
307  slidOut,
308  slcSLDAssn,
309  slidOut.size()-1,
310  slidOut.size(),
311  UINT_MAX,
314  }
315  }
316 
317  return;
318 }
size_type size() const
Definition: Assns.h:440
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.
const XML_Char * s
Definition: expat.h:262
T prod(const std::vector< T > &v)
Definition: prod.hpp:17
std::string fInstanceLabel
instance label for products created by this skimmer
Definition: BaseSkimmer.h:44
Build slid::LID objects to store electron ID, if asked for, otherwise, calculate LID info and make av...
Definition: FillPIDs.h:12
std::string fLIDLabel
label of module creating lids
Definition: NueSkimmer.h:88
void skim::NueSkimmer::CopyShowerPngAssn ( art::Event e,
art::EDProducer const &  prod,
std::vector< art::Ptr< rb::Shower > > const &  showerIn,
std::vector< art::Ptr< rb::Prong > > const &  prongIn,
std::vector< rb::Shower > &  showerOut,
std::vector< rb::Prong > &  prongOut,
art::Assns< rb::Shower, rb::Prong > &  shwPngAssn 
)
private

Definition at line 381 of file NueSkimmer.cxx.

References util::CreateAssn(), skim::BaseSkimmer::fInstanceLabel, LOG_DEBUG, PandAna.reco_validation.add_data::offset, and rb::Shower::TotalLength().

Referenced by Skim().

389 {
390 
391 
392 
393 
394 
395  art::FindOneP<rb::Shower> fmshower(prongIn, e, "recluster" );
396 
397 
398  // we may be calling this multiple times in an event because there are several slices
399  // that passed the selection. figure out where the showers for this slice start in
400  // the output vector as that is important for the creation of the slid to shower associations
401  size_t offset = showerOut.size() - showerIn.size();
402 
403  for(unsigned int iPng=0; iPng<prongIn.size(); ++iPng ){
404 
405  art::Ptr<rb::Shower> slid = fmshower.at(iPng);
406 
407  for(unsigned int iShw=0; iShw<showerOut.size(); ++iShw ){
408 
409  if(slid->TotalLength() == showerOut[iShw].TotalLength()) {
410 
412  e,
413  showerOut,
414  prongOut,
415  shwPngAssn,
416  iPng,
417  iPng+1,
418  iShw + offset, ///
421 
422  } // if
423  } // for iShw
424 
425  } // for iPng
426 
427  LOG_DEBUG("NueSkimmer") << "NueSkimmer - CopyShowerPngAssn Summary : "
428  << "\n Input Showers vector size " << showerIn.size()
429  << "\n Output Showers vector size " << showerOut.size();
430  return;
431 }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
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.
virtual double TotalLength() const
Length (cm) of a shower.
Definition: Shower.cxx:43
T prod(const std::vector< T > &v)
Definition: prod.hpp:17
std::string fInstanceLabel
instance label for products created by this skimmer
Definition: BaseSkimmer.h:44
Build slid::LID objects to store electron ID, if asked for, otherwise, calculate LID info and make av...
Definition: FillPIDs.h:12
Definition: fwd.h:28
std::string const & skim::BaseSkimmer::InstanceLabel ( )
inlineinherited

Definition at line 48 of file BaseSkimmer.h.

References skim::BaseSkimmer::fInstanceLabel.

48 { return fInstanceLabel; }
std::string fInstanceLabel
instance label for products created by this skimmer
Definition: BaseSkimmer.h:44
void skim::NueSkimmer::reconfigure ( fhicl::ParameterSet const &  p)
virtual

Implements skim::BaseSkimmer.

Definition at line 519 of file NueSkimmer.cxx.

References fCAFLabel, fCosRejLabel, fCVNLabel, fCVNProngLabel, fFluxWeightLabel, fGeneratorLabel, skim::BaseSkimmer::fInstanceLabel, fLEMLabel, fLIDLabel, fMichelLabel, fNueVetoLabel, fProngTag, fShowerLabel, fVertexLabel, fhicl::ParameterSet::get(), and elec2geo::pos.

Referenced by NueSkimmer().

520 {
521  fVertexLabel = p.get<std::string>("VertexLabel", "elasticarmshs" );
522  fShowerLabel = p.get<std::string>("ShowerLabel", "recluster" );
523  fLIDLabel = p.get<std::string>("LIDLabel", "slid" );
524  fLEMLabel = p.get<std::string>("LEMLabel", "lem" );
525  if( fInstanceLabel.find("2018") == std::string::npos ) // chek it is not 2018 Analysis
526  fCVNLabel = p.get<std::string>("CVNLabel", "cvneval" );
527  else
528  fCVNLabel = p.get<std::string>("CVNLabel", "cvnevalprod3train");
529  fCVNProngLabel = p.get<std::string>("CVNProngLabel", "cvnprongeval" );
530  fCosRejLabel = p.get<std::string>("CosRejLabel", "nuecosrej" );
531  fCAFLabel = p.get<std::string>("CAFLabel", "cafmaker" );
532  fGeneratorLabel = p.get<std::string>("GeneratorLabel", "generator" );
533  fFluxWeightLabel = p.get<std::string>("FluxWeightLabel", "ppfxcorrection" );
534  fNueVetoLabel = p.get<std::string>("NueVetoLabel", "veto" );
535  fMichelLabel = p.get<std::string>("MichelLabel", "mefinder" );
536 
537  auto prongTag = p.get<std::string>("ProngTag", "fuzzykvertex:Prong3D");
538  auto pos = prongTag.find(":");
539  fProngTag = art::InputTag(prongTag.substr(0, pos),
540  prongTag.substr(pos+1, prongTag.size()));
541 
542  return;
543 }
std::string fCosRejLabel
label of module creating cosrejs
Definition: NueSkimmer.h:90
const char * p
Definition: xmltok.h:285
std::string fLEMLabel
label of module creating lems
Definition: NueSkimmer.h:89
art::InputTag fProngTag
input tag of module creating showers
Definition: NueSkimmer.h:87
std::string fCVNLabel
label of module creating cvns
Definition: NueSkimmer.h:94
std::string fShowerLabel
label of module creating showers
Definition: NueSkimmer.h:86
std::string fCVNProngLabel
label of module creating prongs cvn
Definition: NueSkimmer.h:97
std::string fMichelLabel
label of module creating slice Michel e&#39;s
Definition: NueSkimmer.h:96
std::string fFluxWeightLabel
label of module creating flux weights
Definition: NueSkimmer.h:93
std::string fGeneratorLabel
label of module generating events
Definition: NueSkimmer.h:92
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
std::string fCAFLabel
label of module creating StandardRecords
Definition: NueSkimmer.h:91
std::string fInstanceLabel
instance label for products created by this skimmer
Definition: BaseSkimmer.h:44
std::string fVertexLabel
label of module creating vertex
Definition: NueSkimmer.h:85
std::string fNueVetoLabel
label of module creating nuevetos
Definition: NueSkimmer.h:95
std::string fLIDLabel
label of module creating lids
Definition: NueSkimmer.h:88
void skim::NueSkimmer::Skim ( art::Event e,
art::EDProducer const &  prod 
)
virtual

Only check if not 2017 and 2018 analysis. To be updated for future analyses.

Only check if not 2017 and 2018 analysis. To be updated for future analyses.

2017

2017 - copy Shower Prong association needed for Nue Energy

Only check if not 2017 and 2018 analysis. To be updated for future analyses.

Only check if not 2017 and 2018 analysis. To be updated for future analyses.

Implements skim::BaseSkimmer.

Definition at line 64 of file NueSkimmer.cxx.

References CopyMichelSlice(), CopyMichelTrack(), skim::SkimmingUtils::CopyProductAndSliceAssn(), CopyProngCVN(), skim::SkimmingUtils::CopyProngs(), CopyShowerLID(), CopyShowerPngAssn(), skim::SkimmingUtils::CopyShowers(), skim::SkimmingUtils::CopySlice(), skim::SkimmingUtils::CopyVertex(), art::Handle< T >::failedToGet(), fCosRejLabel, fCVNLabel, fFluxWeightLabel, fGeneratorLabel, skim::BaseSkimmer::fInputTag, skim::BaseSkimmer::fInstanceLabel, fLEMLabel, fLIDLabel, fMichelLabel, fNueVetoLabel, fProngTag, fShowerLabel, fVertexLabel, art::FindManyP< ProdB, Data >::get(), art::DataViewImpl::getByLabel(), art::Event::isRealData(), LOG_DEBUG, LOG_VERBATIM, prongByLengthNue(), art::Event::put(), showerByEnergyNue(), and skim::SkimmingUtils::SliceMCTruthAssociation().

Referenced by skim::NueSkim::produce().

66 {
67  // get the CellHits made in the previous module
69  e.getByLabel(fInputTag, cellHits);
70 
71  if(cellHits.failedToGet() ){
72  LOG_VERBATIM("NueSkimmer")
73  << "There are no numu CellHits for this event, don't try to skim anything.";
74  return;
75  }
76 
77  // if we are in this module, then this event has interesting slices.
78  // to facilitate making copies of the rb::XXX objects we want, make
79  // a map of the cell unique id values to the art::Ptr of the copy
80  // from the previous module
81  skim::SkimmingUtils su(cellHits, fInstanceLabel);
82 
83  // get the slices out of the event
85  e.getByLabel(fInputTag, sliceHandle);
86 
87  art::Handle<std::vector<int> > sliceNumHandle;
88  e.getByLabel(fInputTag, sliceNumHandle);
89 
90  auto slices = *sliceHandle;
91 
92  LOG_DEBUG("NueSkimmer")
93  << "there are "
94  << slices.size()
95  << " slices in this event"
96  << sliceNumHandle->size();
97 
98  // get the FindMany for the slices to XXX association.
100  art::FindManyP<rb::Shower> fms (slices, e, fShowerLabel);
101  art::FindManyP<rb::Prong> fmp (slices, e, fProngTag);
102  art::FindManyP<rb::Vertex> fmv (slices, e, fVertexLabel);
103  art::FindManyP<slid::EventLID> fmelid (slices, e, fLIDLabel);
104  art::FindManyP<lem::PIDDetails> fmlem (slices, e, fLEMLabel);
105  art::FindManyP<cvn::Result> fmcvn (slices, e, fCVNLabel);
106  art::FindManyP<presel::Veto> fmnueveto(slices, e, fNueVetoLabel);
107  art::FindManyP<me::SlcME> fmslcme (slices, e, fMichelLabel);
108  art::FindManyP<me::TrkME> fmtrkme (slices, e, fMichelLabel);
109 
110  // need to copy the following objects into the new file still
111  // presel::PreselObj --> simple data types, associated to slice
112  // presel::Veto --> simple data types, associated to slice
113  // nuesand::NueSandObj --> simple data types, associated to slice
114 
115  // now we are sure we have all the data products we need, declare the items to store in the event
116  // As long as we do a drop on output we will keep all the necessary provanence information on how
117  // each item was created. The information is left in the configuration DB intact, and we know what
118  // modules created which input data product by the module label configurations for this module.
119  std::unique_ptr< std::vector<rb::Cluster> > sliceOut (new std::vector<rb::Cluster> );
120  std::unique_ptr< std::vector<rb::Shower> > showerOut (new std::vector<rb::Shower> );
121  std::unique_ptr< std::vector<rb::Prong> > prongOut (new std::vector<rb::Prong> );
122  std::unique_ptr< std::vector<rb::Vertex> > vertexOut (new std::vector<rb::Vertex> );
123  std::unique_ptr< std::vector<slid::EventLID> > elidOut (new std::vector<slid::EventLID> );
124  std::unique_ptr< std::vector<slid::ShowerLID> > slidOut (new std::vector<slid::ShowerLID> );
125  std::unique_ptr< std::vector<lem::PIDDetails> > lemOut (new std::vector<lem::PIDDetails> );
126  std::unique_ptr< std::vector<cosrej::NueCosRej> > cosrejOut (new std::vector<cosrej::NueCosRej> );
127  std::unique_ptr< std::vector<cvn::Result> > cvnOut (new std::vector<cvn::Result> );
128  std::unique_ptr< std::vector<presel::Veto> > nuevetoOut (new std::vector<presel::Veto> );
129  std::unique_ptr< std::vector<me::SlcME> > slcmeOut (new std::vector<me::SlcME> );
130  std::unique_ptr< std::vector<me::TrkME> > trkmeOut (new std::vector<me::TrkME> );
131  std::unique_ptr< std::vector<rb::PID> > pidOut (new std::vector<rb::PID> ); // 2017
132  std::unique_ptr< art::Assns<rb::Cluster, rb::Shower> > slcShwAssn (new art::Assns<rb::Cluster, rb::Shower> );
133  std::unique_ptr< art::Assns<rb::Cluster, rb::Prong> > slcPrgAssn (new art::Assns<rb::Cluster, rb::Prong> );
134  std::unique_ptr< art::Assns<rb::Cluster, rb::Vertex> > slcVtxAssn (new art::Assns<rb::Cluster, rb::Vertex> );
135  std::unique_ptr< art::Assns<rb::Cluster, slid::EventLID> > slcELDAssn (new art::Assns<rb::Cluster, slid::EventLID> );
136  std::unique_ptr< art::Assns<rb::Cluster, slid::ShowerLID> > slcSLDAssn (new art::Assns<rb::Cluster, slid::ShowerLID> );
137  std::unique_ptr< art::Assns<rb::Shower, slid::ShowerLID> > shwSLDAssn (new art::Assns<rb::Shower, slid::ShowerLID> );
138  std::unique_ptr< art::Assns<rb::Cluster, lem::PIDDetails> > slcLEMAssn (new art::Assns<rb::Cluster, lem::PIDDetails> );
139  std::unique_ptr< art::Assns<rb::Cluster, cosrej::NueCosRej> > slcCRJAssn (new art::Assns<rb::Cluster, cosrej::NueCosRej> );
140  std::unique_ptr< art::Assns<rb::Cluster, simb::MCTruth> > slcTruAssn (new art::Assns<rb::Cluster, simb::MCTruth> );
141  std::unique_ptr< art::Assns<rb::Cluster, simb::MCFlux> > slcFlxAssn (new art::Assns<rb::Cluster, simb::MCFlux> );
142  std::unique_ptr< art::Assns<rb::Cluster, fxwgt::FluxWeights> > slcFlxWgtAssn (new art::Assns<rb::Cluster, fxwgt::FluxWeights> );
143  std::unique_ptr< art::Assns<rb::Cluster, simb::GTruth> > slcGTruAssn (new art::Assns<rb::Cluster, simb::GTruth> );
144  std::unique_ptr< art::Assns<rb::Cluster, cvn::Result> > slcCVNAssn (new art::Assns<rb::Cluster, cvn::Result> );
145  std::unique_ptr< art::Assns<rb::Cluster, presel::Veto> > slcNueVetoAssn(new art::Assns<rb::Cluster, presel::Veto> );
146  std::unique_ptr< art::Assns<rb::Cluster, me::SlcME> > slcSlcMEAssn (new art::Assns<rb::Cluster, me::SlcME> );
147  std::unique_ptr< art::Assns<rb::Cluster, me::TrkME> > slcTrkMEAssn (new art::Assns<rb::Cluster, me::TrkME> );
148  std::unique_ptr< art::Assns<rb::Cluster, rb::PID> > slcPIDAssn(new art::Assns<rb::Cluster, rb::PID> ); // 2017
149  std::unique_ptr< art::Assns<rb::Prong, rb::PID> > pngPIDAssn(new art::Assns<rb::Prong, rb::PID> ); // 2017
150  std::unique_ptr< art::Assns< rb::Shower, rb::Prong > > shwPngAssn( new art::Assns< rb::Shower, rb::Prong> ); // 2017
151 
152  size_t sliceNum = 0;
153 
154  for(size_t s = 0; s < slices.size(); ++s){
155 
156  sliceNum = sliceNumHandle->at(s);
157 
158  // vector of art::Ptrs for the FindManyP calls
159  std::vector< art::Ptr<rb::Shower> > showers;
160  std::vector< art::Ptr<rb::Prong> > prongs;
161  std::vector< art::Ptr<rb::Vertex> > vertices;
162  std::vector< art::Ptr<slid::EventLID> > eLIDs;
163  std::vector< art::Ptr<lem::PIDDetails> > lems;
164  std::vector< art::Ptr<cosrej::NueCosRej> > cosrejs;
165  std::vector< art::Ptr<cvn::Result> > cvns;
166  std::vector< art::Ptr<presel::Veto> > nuevetos;
167  std::vector< art::Ptr<me::SlcME> > slcmes;
168  std::vector< art::Ptr<me::TrkME> > trkmes;
169 
170  fms .get(s, showers );
171  fmp .get(s, prongs );
172  fmv .get(s, vertices);
173  fmelid .get(s, eLIDs );
174  fmcr .get(s, cosrejs );
175  fmcvn .get(s, cvns );
176  fmnueveto.get(s, nuevetos);
177  fmslcme .get(s, slcmes );
178  fmtrkme .get(s, trkmes );
179  if( fInstanceLabel.find("2017") == std::string::npos &&
180  fInstanceLabel.find("2018") == std::string::npos ) /// Only check if not 2017 and 2018 analysis. To be updated for future analyses.
181  fmlem .get(s, lems );
182 
183  // sort the showers in order of decreasing energy
184  // std::sort(showers.begin(), showers.end(), skim::showerByEnergy);
185  std::sort(showers.begin(), showers.end(), showerByEnergyNue);
186 
187  // sort the prongs in order of decreasing length
188  // std::sort(prongs.begin(), prongs.end(), skim::prongPtrByLength);
189  // std::sort(prongs.begin(), prongs.end(), skim::prongByLength);
190  std::sort(prongs.begin(), prongs.end(), prongByLengthNue);
191 
192  // create the new copy of the slice.
193  su.CopySlice(slices[s], *sliceOut, sliceNum);
194  su.CopyShowers(prod, e, showers, *showerOut, *sliceOut, *slcShwAssn);
195  su.CopyProngs (prod, e, prongs, *prongOut, *sliceOut, *slcPrgAssn);
196  su.CopyVertex (prod, e, vertices[0], *vertexOut, *sliceOut, *slcVtxAssn);
197  su.CopyProductAndSliceAssn(prod, e, eLIDs, *elidOut, *sliceOut, *slcELDAssn);
198  su.CopyProductAndSliceAssn(prod, e, cosrejs, *cosrejOut, *sliceOut, *slcCRJAssn);
199  su.CopyProductAndSliceAssn(prod, e, cvns, *cvnOut, *sliceOut, *slcCVNAssn);
200  su.CopyProductAndSliceAssn(prod, e, nuevetos, *nuevetoOut, *sliceOut, *slcNueVetoAssn);
201  if( fInstanceLabel.find("2017") == std::string::npos &&
202  fInstanceLabel.find("2018") == std::string::npos ) /// Only check if not 2017 and 2018 analysis. To be updated for future analyses.
203  su.CopyProductAndSliceAssn(prod, e, lems, *lemOut, *sliceOut, *slcLEMAssn);
204 
205  this->CopyShowerLID(e, prod, showers, *slidOut, *sliceOut, *showerOut, *slcSLDAssn, *shwSLDAssn);
206  this->CopyProngCVN( e, prod, prongs, *pidOut, *sliceOut, *prongOut, *slcPIDAssn, *pngPIDAssn); /// 2017
207 
208  this->CopyShowerPngAssn(e, prod, showers, prongs, *showerOut, *prongOut, *shwPngAssn); /// 2017 - copy Shower Prong association needed for Nue Energy
209 
210  this->CopyMichelSlice(e, prod, slcmes, *slcmeOut, *sliceOut, *slcSlcMEAssn);
211  this->CopyMichelTrack(e, prod, trkmes, *trkmeOut, *sliceOut, *slcTrkMEAssn);
212 
213  // finally check to see if this is MC, and if so make the association to MCTruth
214  if( !e.isRealData() )
215  su.SliceMCTruthAssociation(prod,
216  e,
217  s,
218  *sliceOut,
219  *slcTruAssn,
220  *slcFlxAssn,
221  *slcFlxWgtAssn,
222  *slcGTruAssn,
225 
226  } // end loop over the slices
227 
228  e.put(std::move(sliceOut), fInstanceLabel);
229  e.put(std::move(showerOut), fInstanceLabel);
230  e.put(std::move(prongOut), fInstanceLabel);
231  e.put(std::move(vertexOut), fInstanceLabel);
232  e.put(std::move(elidOut), fInstanceLabel);
233  e.put(std::move(slidOut), fInstanceLabel);
234  e.put(std::move(cvnOut), fInstanceLabel);
235  e.put(std::move(nuevetoOut), fInstanceLabel);
236  e.put(std::move(slcmeOut), fInstanceLabel);
237  e.put(std::move(trkmeOut), fInstanceLabel);
238  e.put(std::move(cosrejOut), fInstanceLabel);
239  if( fInstanceLabel.find("2017") == std::string::npos &&
240  fInstanceLabel.find("2018") == std::string::npos ) /// Only check if not 2017 and 2018 analysis. To be updated for future analyses.
241  e.put(std::move(lemOut), fInstanceLabel);
242 
243  e.put(std::move(slcVtxAssn), fInstanceLabel);
244  e.put(std::move(slcShwAssn), fInstanceLabel);
245  e.put(std::move(slcPrgAssn), fInstanceLabel);
246  e.put(std::move(slcELDAssn), fInstanceLabel);
247  e.put(std::move(slcSLDAssn), fInstanceLabel);
248  e.put(std::move(shwSLDAssn), fInstanceLabel);
249  e.put(std::move(slcCRJAssn), fInstanceLabel);
250  e.put(std::move(slcTruAssn), fInstanceLabel);
251  e.put(std::move(slcFlxAssn), fInstanceLabel);
252  e.put(std::move(slcFlxWgtAssn), fInstanceLabel);
253  e.put(std::move(slcGTruAssn), fInstanceLabel);
254  e.put(std::move(slcCVNAssn), fInstanceLabel);
255  e.put(std::move(slcNueVetoAssn), fInstanceLabel);
256  e.put(std::move(slcSlcMEAssn), fInstanceLabel);
257  e.put(std::move(slcTrkMEAssn), fInstanceLabel);
258  if( fInstanceLabel.find("2017") == std::string::npos &&
259  fInstanceLabel.find("2018") == std::string::npos ) /// Only check if not 2017 and 2018 analysis. To be updated for future analyses.
260  e.put(std::move(slcLEMAssn), fInstanceLabel);
261 
262  e.put(std::move(pidOut), fInstanceLabel);
263  e.put(std::move(slcPIDAssn), fInstanceLabel);
264  e.put(std::move(pngPIDAssn), fInstanceLabel);
265  e.put(std::move(shwPngAssn), fInstanceLabel);
266 
267  return;
268 }
void CopyMichelTrack(art::Event &e, art::EDProducer const &prod, std::vector< art::Ptr< me::TrkME > > const &objIn, std::vector< me::TrkME > &objOut, std::vector< rb::Cluster > &sliceOut, art::Assns< rb::Cluster, me::TrkME > &slcMEAssn)
Definition: NueSkimmer.cxx:474
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
std::string fCosRejLabel
label of module creating cosrejs
Definition: NueSkimmer.h:90
std::string fLEMLabel
label of module creating lems
Definition: NueSkimmer.h:89
art::InputTag fProngTag
input tag of module creating showers
Definition: NueSkimmer.h:87
std::string fCVNLabel
label of module creating cvns
Definition: NueSkimmer.h:94
bool isRealData() const
Definition: Event.h:83
art::InputTag fInputTag
combination of the above two strings
Definition: BaseSkimmer.h:45
std::string fShowerLabel
label of module creating showers
Definition: NueSkimmer.h:86
void CopyShowerLID(art::Event &e, art::EDProducer const &prod, std::vector< art::Ptr< rb::Shower > > const &showerIn, std::vector< slid::ShowerLID > &slidOut, std::vector< rb::Cluster > &sliceOut, std::vector< rb::Shower > &showerOut, art::Assns< rb::Cluster, slid::ShowerLID > &slcSLDAssn, art::Assns< rb::Shower, slid::ShowerLID > &shwSLDAssn)
Definition: NueSkimmer.cxx:271
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
const XML_Char * s
Definition: expat.h:262
std::string fMichelLabel
label of module creating slice Michel e&#39;s
Definition: NueSkimmer.h:96
void CopyShowerPngAssn(art::Event &e, art::EDProducer const &prod, std::vector< art::Ptr< rb::Shower > > const &showerIn, std::vector< art::Ptr< rb::Prong > > const &prongIn, std::vector< rb::Shower > &showerOut, std::vector< rb::Prong > &prongOut, art::Assns< rb::Shower, rb::Prong > &shwPngAssn)
Definition: NueSkimmer.cxx:381
T prod(const std::vector< T > &v)
Definition: prod.hpp:17
std::string fFluxWeightLabel
label of module creating flux weights
Definition: NueSkimmer.h:93
std::string fGeneratorLabel
label of module generating events
Definition: NueSkimmer.h:92
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void CopyProngCVN(art::Event &e, art::EDProducer const &prod, std::vector< art::Ptr< rb::Prong > > const &prongIn, std::vector< rb::PID > &pidOut, std::vector< rb::Cluster > &sliceOut, std::vector< rb::Prong > &prongOut, art::Assns< rb::Cluster, rb::PID > &slcPIDAssn, art::Assns< rb::Prong, rb::PID > &pngPIDAssn)
Definition: NueSkimmer.cxx:325
bool prongByLengthNue(art::Ptr< rb::Prong > p1, art::Ptr< rb::Prong > p2)
Definition: NueSkimmer.cxx:47
std::string fInstanceLabel
instance label for products created by this skimmer
Definition: BaseSkimmer.h:44
std::string fVertexLabel
label of module creating vertex
Definition: NueSkimmer.h:85
#define LOG_VERBATIM(category)
bool showerByEnergyNue(art::Ptr< rb::Shower > s1, art::Ptr< rb::Shower > s2)
Definition: NueSkimmer.cxx:41
std::string fNueVetoLabel
label of module creating nuevetos
Definition: NueSkimmer.h:95
bool failedToGet() const
Definition: Handle.h:196
std::string fLIDLabel
label of module creating lids
Definition: NueSkimmer.h:88
void CopyMichelSlice(art::Event &e, art::EDProducer const &prod, std::vector< art::Ptr< me::SlcME > > const &objIn, std::vector< me::SlcME > &objOut, std::vector< rb::Cluster > &sliceOut, art::Assns< rb::Cluster, me::SlcME > &slcMEAssn)
Definition: NueSkimmer.cxx:435

Member Data Documentation

std::string skim::NueSkimmer::fCAFLabel
private

label of module creating StandardRecords

Definition at line 91 of file NueSkimmer.h.

Referenced by reconfigure().

std::string skim::BaseSkimmer::fCellHitSkimLabel
protectedinherited

label of module creating slices

Definition at line 43 of file BaseSkimmer.h.

std::string skim::NueSkimmer::fCosRejLabel
private

label of module creating cosrejs

Definition at line 90 of file NueSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NueSkimmer::fCVNLabel
private

label of module creating cvns

Definition at line 94 of file NueSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NueSkimmer::fCVNProngLabel
private

label of module creating prongs cvn

Definition at line 97 of file NueSkimmer.h.

Referenced by CopyProngCVN(), and reconfigure().

std::string skim::NueSkimmer::fFluxWeightLabel
private

label of module creating flux weights

Definition at line 93 of file NueSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NueSkimmer::fGeneratorLabel
private

label of module generating events

Definition at line 92 of file NueSkimmer.h.

Referenced by reconfigure(), and Skim().

art::InputTag skim::BaseSkimmer::fInputTag
protectedinherited

combination of the above two strings

Definition at line 45 of file BaseSkimmer.h.

Referenced by skim::NumuCCpiSkimmer::Skim(), skim::NumuSkimmer::Skim(), and Skim().

std::string skim::BaseSkimmer::fInstanceLabel
protectedinherited
std::string skim::NueSkimmer::fLEMLabel
private

label of module creating lems

Definition at line 89 of file NueSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NueSkimmer::fLIDLabel
private

label of module creating lids

Definition at line 88 of file NueSkimmer.h.

Referenced by CopyShowerLID(), reconfigure(), and Skim().

std::string skim::NueSkimmer::fMichelLabel
private

label of module creating slice Michel e's

Definition at line 96 of file NueSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NueSkimmer::fNueVetoLabel
private

label of module creating nuevetos

Definition at line 95 of file NueSkimmer.h.

Referenced by reconfigure(), and Skim().

art::InputTag skim::NueSkimmer::fProngTag
private

input tag of module creating showers

Definition at line 87 of file NueSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NueSkimmer::fShowerLabel
private

label of module creating showers

Definition at line 86 of file NueSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NueSkimmer::fVertexLabel
private

label of module creating vertex

Definition at line 85 of file NueSkimmer.h.

Referenced by reconfigure(), and Skim().


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