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

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

Inheritance diagram for skim::NumuSkimmer:
skim::BaseSkimmer

Public Member Functions

 NumuSkimmer (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)
 
template<class T >
void CopyTrackAssn (art::Event &e, art::EDProducer const &prod, std::vector< art::Ptr< rb::Track > > const &trackIn, std::vector< T > &tOut, std::vector< rb::Track > &trackOut, art::Assns< rb::Track, T > &trkTAssn, std::string const &modLabel)
 

Private Attributes

std::string fVertexLabel
 label of module creating vertex More...
 
std::string fShowerLabel
 label of module creating showers More...
 
std::string fEnergyLabel
 label of module creating energy objects More...
 
std::string fTrackLabel
 label of module creating tracks More...
 
std::string fCosmicLabel
 label of module creating cosmic tracks More...
 
std::string fCosRejLabel
 label of module creating CosRej More...
 
std::string fNumuSandLabel
 label of module creating NumuSand More...
 
std::string fVetoLabel
 label of module creating vetos More...
 
std::string fQePIdLabel
 label of module creating QePIds More...
 
std::string fReMIdLabel
 label of module creating ReMIds More...
 
std::string fNumuELabel
 label of module creating NumuEs More...
 
std::string fMichelELabel
 label of module creating MichelEClusters More...
 
std::string fCAFLabel
 label of module creating StandardRecords More...
 
std::string fGeneratorLabel
 label of module creating MC events More...
 
std::string fFluxWeightLabel
 label of module creating flux weights More...
 
std::string fCosmicInstance
 label for cosmic ray related products being made More...
 
std::string fNueCosRejLabel
 label of module creating NueCosRej (2017) More...
 
std::string fCVNLabel
 label of module creating cvns (2017) More...
 
std::string fLIDLabel
 label of module creating lids (2017) More...
 
art::InputTag fProngTag
 input tag of module creating showers (2017) More...
 

Detailed Description

Definition at line 29 of file NumuSkimmer.h.

Constructor & Destructor Documentation

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

Definition at line 48 of file NumuSkimmer.cxx.

References reconfigure().

50 {
51  this->reconfigure(p);
52 
53  return;
54 }
const char * p
Definition: xmltok.h:285
BaseSkimmer(fhicl::ParameterSet const &p)
Definition: BaseSkimmer.cxx:10
void reconfigure(fhicl::ParameterSet const &p)

Member Function Documentation

void skim::NumuSkimmer::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 369 of file NumuSkimmer.cxx.

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

Referenced by Skim().

377 {
378 
379  // do a FindOne for the shower to ShowerLID connection. Copy the found ShowerLID into the
380  // output vector, then make the associations
381  art::FindOne<slid::ShowerLID> foslid(showerIn, e, fLIDLabel);
382 
383  // we may be calling this multiple times in an event because there are several slices
384  // that passed the selection. figure out where the showers for this slice start in
385  // the output vector as that is important for the creation of the slid to shower associations
386  size_t offset = showerOut.size() - showerIn.size();
387 
388  for(size_t s = 0; s < showerIn.size(); ++s){
390  if( slid.isValid() ){
391  slidOut.push_back( slid.ref() );
393  e,
394  showerOut,
395  slidOut,
396  shwSLDAssn,
397  slidOut.size()-1,
398  slidOut.size(),
399  s + offset,
403  e,
404  sliceOut,
405  slidOut,
406  slcSLDAssn,
407  slidOut.size()-1,
408  slidOut.size(),
409  UINT_MAX,
412  }
413  }
414 
415  return;
416 }
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
std::string fLIDLabel
label of module creating lids (2017)
Definition: NumuSkimmer.h:88
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
template<class T >
void skim::NumuSkimmer::CopyTrackAssn ( art::Event e,
art::EDProducer const &  prod,
std::vector< art::Ptr< rb::Track > > const &  trackIn,
std::vector< T > &  tOut,
std::vector< rb::Track > &  trackOut,
art::Assns< rb::Track, T > &  trkTAssn,
std::string const &  modLabel 
)
private

Definition at line 328 of file NumuSkimmer.cxx.

References util::CreateAssn(), skim::BaseSkimmer::fInstanceLabel, art::Assns< L, R, D >::size(), and confusionMatrixTree::t.

Referenced by Skim().

335 {
336  // this method requires the trackOut collection to have already been filled. All
337  // tracks from the slice are assumed to be copied into the skimmed slice and in the
338  // same order as the tracks from the original slice (ie trackIn)
339  // trackOut could be larger than track in, if we are in the ND so only look at the
340  // last trackIn.size() entries in trackOut
341 
342  // do a FindOne for the track to T connection. Copy the found T
343  // into the output vector, then make the associations
344  art::FindOne<T> fot(trackIn, e, modLabel);
345  for(size_t ti = 0; ti < trackIn.size(); ++ti){
346  cet::maybe_ref<T const> t(fot.at(ti));
347  if( t.isValid() ){
348  tOut.push_back( t.ref() );
350  e,
351  trackOut,
352  tOut,
353  trkTAssn,
354  tOut.size()-1,
355  tOut.size(),
356  trackOut.size() - trackIn.size() + ti,
359  }
360  }
361 
362  return;
363 }
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.
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
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::NumuSkimmer::reconfigure ( fhicl::ParameterSet const &  p)
virtual

2017

2017

2017

2018

Implements skim::BaseSkimmer.

Definition at line 419 of file NumuSkimmer.cxx.

References fCAFLabel, fCosmicInstance, fCosmicLabel, fCosRejLabel, fCVNLabel, fEnergyLabel, fFluxWeightLabel, fGeneratorLabel, skim::BaseSkimmer::fInstanceLabel, fLIDLabel, fMichelELabel, fNueCosRejLabel, fNumuELabel, fNumuSandLabel, fProngTag, fQePIdLabel, fReMIdLabel, fShowerLabel, fTrackLabel, fVertexLabel, fVetoLabel, fhicl::ParameterSet::get(), and elec2geo::pos.

Referenced by NumuSkimmer().

420 {
421  fVertexLabel = p.get<std::string>("VertexLabel", "elasticarmshs" );
422  fShowerLabel = p.get<std::string>("ShowerLabel", "recluster" );
423  fTrackLabel = p.get<std::string>("TrackLabel", "kalmantrackmerge" );
424  fCosmicLabel = p.get<std::string>("CosmicLabel", "cosmictrack" );
425  fCosRejLabel = p.get<std::string>("CosRejLabel", "cosrej" );
426  fNueCosRejLabel = p.get<std::string>("NueCosRejLabel", "nuecosrej" ); /// 2017
427  fLIDLabel = p.get<std::string>("LIDLabel", "slid" ); /// 2017
428  if( fInstanceLabel.find("2018") == std::string::npos ) // chek it is not 2018 Analysis
429  fCVNLabel = p.get<std::string>("CVNLabel", "cvneval" ); /// 2017
430  else
431  fCVNLabel = p.get<std::string>("CVNLabel", "cvnevalprod3train" ); /// 2018
432  fNumuSandLabel = p.get<std::string>("NumuSandLabel", "numusand" );
433  fVetoLabel = p.get<std::string>("VetoLabel", "veto" );
434  fQePIdLabel = p.get<std::string>("QePIdLabel", "qepid" );
435  fReMIdLabel = p.get<std::string>("ReMIdLabel", "remid" );
436  fMichelELabel = p.get<std::string>("MichelELabel", "michelekalmantrack");
437  fNumuELabel = p.get<std::string>("NumuELabel", "numue" );
438  fEnergyLabel = p.get<std::string>("EnergyLabel", "numue" );
439  fCAFLabel = p.get<std::string>("CAFLabel", "cafmaker" );
440  fGeneratorLabel = p.get<std::string>("GeneratorLabel", "generator" );
441  fFluxWeightLabel = p.get<std::string>("FluxWeightLabel", "ppfxcorrection" );
442 
443  fCosmicInstance = fInstanceLabel + "Cosmics";
444 
445 
446  auto prongTag = p.get<std::string>("ProngTag", "fuzzykvertex:Prong3D");
447  auto pos = prongTag.find(":");
448  fProngTag = art::InputTag(prongTag.substr(0, pos),
449  prongTag.substr(pos+1, prongTag.size()));
450 
451  return;
452 }
std::string fNumuSandLabel
label of module creating NumuSand
Definition: NumuSkimmer.h:75
std::string fTrackLabel
label of module creating tracks
Definition: NumuSkimmer.h:72
std::string fGeneratorLabel
label of module creating MC events
Definition: NumuSkimmer.h:82
art::InputTag fProngTag
input tag of module creating showers (2017)
Definition: NumuSkimmer.h:89
const char * p
Definition: xmltok.h:285
std::string fMichelELabel
label of module creating MichelEClusters
Definition: NumuSkimmer.h:80
std::string fCosmicInstance
label for cosmic ray related products being made
Definition: NumuSkimmer.h:84
std::string fVertexLabel
label of module creating vertex
Definition: NumuSkimmer.h:69
std::string fCosmicLabel
label of module creating cosmic tracks
Definition: NumuSkimmer.h:73
std::string fCosRejLabel
label of module creating CosRej
Definition: NumuSkimmer.h:74
std::string fVetoLabel
label of module creating vetos
Definition: NumuSkimmer.h:76
std::string fShowerLabel
label of module creating showers
Definition: NumuSkimmer.h:70
std::string fNueCosRejLabel
label of module creating NueCosRej (2017)
Definition: NumuSkimmer.h:86
std::string fReMIdLabel
label of module creating ReMIds
Definition: NumuSkimmer.h:78
std::string fQePIdLabel
label of module creating QePIds
Definition: NumuSkimmer.h:77
std::string fLIDLabel
label of module creating lids (2017)
Definition: NumuSkimmer.h:88
std::string fEnergyLabel
label of module creating energy objects
Definition: NumuSkimmer.h:71
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
std::string fCVNLabel
label of module creating cvns (2017)
Definition: NumuSkimmer.h:87
std::string fCAFLabel
label of module creating StandardRecords
Definition: NumuSkimmer.h:81
std::string fFluxWeightLabel
label of module creating flux weights
Definition: NumuSkimmer.h:83
std::string fNumuELabel
label of module creating NumuEs
Definition: NumuSkimmer.h:79
std::string fInstanceLabel
instance label for products created by this skimmer
Definition: BaseSkimmer.h:44
void skim::NumuSkimmer::Skim ( art::Event e,
art::EDProducer const &  prod 
)
virtual

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

2017

Implements skim::BaseSkimmer.

Definition at line 57 of file NumuSkimmer.cxx.

References skim::SkimmingUtils::CopyProductAndSliceAssn(), skim::SkimmingUtils::CopyProngs(), CopyShowerLID(), skim::SkimmingUtils::CopyShowers(), skim::SkimmingUtils::CopySlice(), CopyTrackAssn(), skim::SkimmingUtils::CopyTracks(), skim::SkimmingUtils::CopyVertex(), make_associated_cosmic_defs::cosmics, art::Handle< T >::failedToGet(), fCosmicInstance, fCosmicLabel, fCosRejLabel, fCVNLabel, fEnergyLabel, fFluxWeightLabel, fGeneratorLabel, skim::BaseSkimmer::fInputTag, skim::BaseSkimmer::fInstanceLabel, PandAna.Demos.pi0_spectra::fmt, fNueCosRejLabel, fNumuELabel, fNumuSandLabel, fProngTag, fQePIdLabel, fReMIdLabel, fShowerLabel, fTrackLabel, fVertexLabel, fVetoLabel, art::FindManyP< ProdB, Data >::get(), art::DataViewImpl::getByLabel(), art::Event::isRealData(), LOG_DEBUG, LOG_VERBATIM, prongByLengthNumu(), art::Event::put(), showerByEnergyNumu(), art::PtrVector< T >::size(), and skim::SkimmingUtils::SliceMCTruthAssociation().

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

59 {
60  // get the CellHits made in the previous module
62  e.getByLabel(fInputTag, cellHits);
63 
64  if(cellHits.failedToGet() ){
65  LOG_VERBATIM("NumuSkimmer")
66  << "There are no numu CellHits for this event, don't try to skim anything.";
67  return;
68  }
69 
70  // if we are in this module, then this event has interesting slices.
71  // to facilitate making copies of the rb::XXX objects we want, make
72  // a map of the cell unique id values to the art::Ptr of the copy
73  // from the previous module
74  skim::SkimmingUtils su(cellHits, fInstanceLabel);
75 
76  // get the slices out of the event
78  e.getByLabel(fInputTag, sliceHandle);
79  art::PtrVector<rb::Cluster> slices = *sliceHandle;
80 
81  art::Handle<std::vector<int> > sliceNumHandle;
82  e.getByLabel(fInputTag, sliceNumHandle);
83 
84  LOG_DEBUG("NumuSkimmer")
85  << "there are "
86  << slices.size()
87  << " slices in this event";
88 
89  // now we are sure we have all the data products we need, declare the items to store in the event
90  // As long as we do a drop on output we will keep all the necessary provanence information on how
91  // each item was created. The information is left in the configuration DB intact, and we know what
92  // modules created which input data product by the module label configurations for this module.
93  std::unique_ptr< std::vector<rb::Energy> > energyOut (new std::vector<rb::Energy> );
94  std::unique_ptr< std::vector<rb::Cluster> > sliceOut (new std::vector<rb::Cluster> );
95  std::unique_ptr< std::vector<rb::Track> > trackOut (new std::vector<rb::Track> );
96  std::unique_ptr< std::vector<rb::Track> > cosTrkOut (new std::vector<rb::Track> );
97  std::unique_ptr< std::vector<cosrej::CosRejObj> > cosRejOut (new std::vector<cosrej::CosRejObj> );
98  std::unique_ptr< std::vector<cosrej::NueCosRej> > nueCosRejOut (new std::vector<cosrej::NueCosRej> ); // 2017
99  std::unique_ptr< std::vector<rb::Shower> > showerOut (new std::vector<rb::Shower> ); // 2017
100  std::unique_ptr< std::vector<rb::Prong> > prongOut (new std::vector<rb::Prong> ); // 2017
101  std::unique_ptr< std::vector<rb::Vertex> > vertexOut (new std::vector<rb::Vertex> ); // 2017
102  std::unique_ptr< std::vector<slid::EventLID> > elidOut (new std::vector<slid::EventLID> ); // 2017
103  std::unique_ptr< std::vector<slid::ShowerLID> > slidOut (new std::vector<slid::ShowerLID> ); // 2017
104  std::unique_ptr< std::vector<cvn::Result> > cvnOut (new std::vector<cvn::Result> ); // 2017
105 
106  std::unique_ptr< std::vector<numusand::NumuSandObj> > sandOut (new std::vector<numusand::NumuSandObj> );
107  std::unique_ptr< std::vector<presel::Veto> > vetoOut (new std::vector<presel::Veto> );
108  std::unique_ptr< std::vector<qeef::QePId> > qepidOut (new std::vector<qeef::QePId> );
109  std::unique_ptr< std::vector<remid::ReMId> > remidOut (new std::vector<remid::ReMId> );
110  std::unique_ptr< std::vector<numue::NumuE> > numuEOut (new std::vector<numue::NumuE> );
111  std::unique_ptr< art::Assns<rb::Cluster, rb::Track> > slcTrkAssn (new art::Assns<rb::Cluster, rb::Track> );
112  std::unique_ptr< art::Assns<rb::Cluster, rb::Track> > slcCosTrkAssn(new art::Assns<rb::Cluster, rb::Track> );
113  std::unique_ptr< art::Assns<rb::Cluster, cosrej::CosRejObj> > slcCROAssn (new art::Assns<rb::Cluster, cosrej::CosRejObj> );
114  std::unique_ptr< art::Assns<rb::Cluster, cosrej::NueCosRej> > slcNueCRAssn (new art::Assns<rb::Cluster, cosrej::NueCosRej> ); // 2017
115  std::unique_ptr< art::Assns<rb::Cluster, cvn::Result> > slcCVNAssn (new art::Assns<rb::Cluster, cvn::Result> ); // 2017
116  std::unique_ptr< art::Assns<rb::Cluster, rb::Shower> > slcShwAssn (new art::Assns<rb::Cluster, rb::Shower> ); // 2017
117  std::unique_ptr< art::Assns<rb::Cluster, rb::Prong> > slcPrgAssn (new art::Assns<rb::Cluster, rb::Prong> ); // 2017
118  std::unique_ptr< art::Assns<rb::Cluster, rb::Vertex> > slcVtxAssn (new art::Assns<rb::Cluster, rb::Vertex> ); // 2017
119  std::unique_ptr< art::Assns<rb::Cluster, slid::ShowerLID> > slcSLDAssn (new art::Assns<rb::Cluster, slid::ShowerLID>); // 2017
120  std::unique_ptr< art::Assns<rb::Shower, slid::ShowerLID> > shwSLDAssn (new art::Assns<rb::Shower, slid::ShowerLID>); // 2017
121  std::unique_ptr< art::Assns<rb::Cluster, numusand::NumuSandObj> > slcNSOAssn (new art::Assns<rb::Cluster, numusand::NumuSandObj>);
122  std::unique_ptr< art::Assns<rb::Cluster, presel::Veto> > slcVetAssn (new art::Assns<rb::Cluster, presel::Veto> );
123  std::unique_ptr< art::Assns<rb::Cluster, qeef::QePId> > slcQEPAssn (new art::Assns<rb::Cluster, qeef::QePId> );
124  std::unique_ptr< art::Assns<rb::Cluster, numue::NumuE> > slcNMEAssn (new art::Assns<rb::Cluster, numue::NumuE> );
125  std::unique_ptr< art::Assns<rb::Track, remid::ReMId> > trkREMAssn (new art::Assns<rb::Track, remid::ReMId> );
126  std::unique_ptr< art::Assns<rb::Track, rb::Energy> > trkEngAssn (new art::Assns<rb::Track, rb::Energy> );
127  std::unique_ptr< art::Assns<rb::Cluster, simb::MCTruth> > slcTruAssn (new art::Assns<rb::Cluster, simb::MCTruth> );
128  std::unique_ptr< art::Assns<rb::Cluster, simb::MCFlux> > slcFlxAssn (new art::Assns<rb::Cluster, simb::MCFlux> );
129  std::unique_ptr< art::Assns<rb::Cluster, fxwgt::FluxWeights> > slcFlxWgtAssn(new art::Assns<rb::Cluster, fxwgt::FluxWeights> );
130  std::unique_ptr< art::Assns<rb::Cluster, simb::GTruth> > slcGTruAssn (new art::Assns<rb::Cluster, simb::GTruth> );
131 
132 
133  // get the FindMany for the slices to shower association.
134  art::FindManyP<rb::Shower> fms (slices, e, fShowerLabel );
135  art::FindManyP<rb::Vertex> fmvx (slices, e, fVertexLabel );
137  art::FindManyP<rb::Track> fmct (slices, e, fCosmicLabel );
139  art::FindManyP<cosrej::NueCosRej> fmnuecr(slices, e, fNueCosRejLabel); /// 2017
140  art::FindManyP<rb::Prong> fmp (slices, e, fProngTag ); /// 2017
141 
143  art::FindManyP<presel::Veto> fmv (slices, e, fVetoLabel );
144  art::FindManyP<qeef::QePId> fmqe (slices, e, fQePIdLabel );
145  art::FindManyP<numue::NumuE> fme (slices, e, fNumuELabel );
146  art::FindManyP<cvn::Result> fmcvn (slices, e, fCVNLabel ); // 2017
147 
148  size_t sliceNum = 0;
149  for(size_t s = 0; s < slices.size(); ++s){
150 
151  sliceNum = sliceNumHandle->at(s);
152 
153  // vector of art::Ptrs for the FindManyP calls
154  std::vector< art::Ptr<rb::Track> > tracks;
155  std::vector< art::Ptr<rb::Track> > cosmics;
156  std::vector< art::Ptr<cosrej::CosRejObj> > cosrejs;
157  std::vector< art::Ptr<cosrej::NueCosRej> > nuecosrejs; /// 2017
158  std::vector< art::Ptr<rb::Shower> > showers; /// 2017
159  std::vector< art::Ptr<rb::Prong> > prongs; /// 2017
160  std::vector< art::Ptr<rb::Vertex> > vertices; /// 2017
161  std::vector< art::Ptr<cvn::Result> > cvns; /// 2017
162  std::vector< art::Ptr<numusand::NumuSandObj> > sands;
163  std::vector< art::Ptr<presel::Veto> > vetos;
164  std::vector< art::Ptr<qeef::QePId> > qepids;
165  std::vector< art::Ptr<numue::NumuE> > numues;
166 
167  fmt .get( s, tracks );
168  fmct .get( s, cosmics );
169  fmcr .get( s, cosrejs );
170  fmnuecr.get(s, nuecosrejs); /// 2017
171  fms .get( s, showers ); /// 2017
172  fmp .get( s, prongs ); /// 2017
173  fmvx .get( s, vertices); /// 2017
174  fmcvn.get( s, cvns ); /// 2017
175  fmns .get( s, sands );
176  fmv .get( s, vetos );
177  fmqe .get( s, qepids );
178  fme .get( s, numues );
179 
180  // sort the showers in order of decreasing energy
181  // std::sort(showers.begin(), showers.end(), skim::showerByEnergy);
182  std::sort(showers.begin(), showers.end(), showerByEnergyNumu);
183 
184  // sort the prongs in order of decreasing length
185  // std::sort(prongs.begin(), prongs.end(), skim::prongPtrByLength);
186  // std::sort(prongs.begin(), prongs.end(), skim::prongByLength);
187  std::sort(prongs.begin(), prongs.end(), prongByLengthNumu);
188 
189  // create the new copies of the desired data products
190  su.CopySlice(slices[s], *sliceOut, sliceNum);
191 
192  su.CopyVertex (prod, e, vertices[0], *vertexOut, *sliceOut, *slcVtxAssn); /// 2017
193  su.CopyProngs (prod, e, prongs, *prongOut, *sliceOut, *slcPrgAssn); /// 2017
194  su.CopyShowers(prod, e, showers, *showerOut, *sliceOut, *slcShwAssn); /// 2017
195 
196  su.CopyTracks(prod, e, tracks, *trackOut, *sliceOut, *slcTrkAssn );
197  su.CopyTracks(prod, e, cosmics, *cosTrkOut, *sliceOut, *slcCosTrkAssn, fInstanceLabel, fCosmicInstance);
198  su.CopyProductAndSliceAssn(prod, e, cosrejs, *cosRejOut, *sliceOut, *slcCROAssn);
199  su.CopyProductAndSliceAssn(prod, e, nuecosrejs, *nueCosRejOut, *sliceOut, *slcNueCRAssn); // 2017
200 
201  su.CopyProductAndSliceAssn(prod, e, cvns, *cvnOut, *sliceOut, *slcCVNAssn);
202  su.CopyProductAndSliceAssn(prod, e, sands, *sandOut, *sliceOut, *slcNSOAssn);
203  su.CopyProductAndSliceAssn(prod, e, vetos, *vetoOut, *sliceOut, *slcVetAssn);
204  su.CopyProductAndSliceAssn(prod, e, qepids, *qepidOut, *sliceOut, *slcQEPAssn);
205  su.CopyProductAndSliceAssn(prod, e, numues, *numuEOut, *sliceOut, *slcNMEAssn);
206  this->CopyTrackAssn(e, prod, tracks, *remidOut, *trackOut, *trkREMAssn, fReMIdLabel);
207  this->CopyTrackAssn(e, prod, tracks, *energyOut, *trackOut, *trkEngAssn, fEnergyLabel);
208  this->CopyShowerLID(e, prod, showers, *slidOut, *sliceOut, *showerOut, *slcSLDAssn, *shwSLDAssn); /// 2017
209 
210  //this->CopyMichelEClusters(e, prod, tracks, *michelEOut, *sliceOut, *trackOut, *slcMECAssn, *trkMECAssn);
211 
212  // apparently we can't count on a vertex object being present in the
213  // reconstruction. As no cuts depend on them, just remove them for now
214  //std::vector< art::Ptr<rb::Vertex> > vertices;
215  //fmvx.get(s, vertices);
216  //su.CopyVertex(prod, e, vertices[0], *vertexOut, *sliceOut, *slcVtxAssn);
217 
218  // finally check to see if this is MC, and if so make the association to MCTruth
219  if( !e.isRealData() )
220  su.SliceMCTruthAssociation(prod,
221  e,
222  s,
223  *sliceOut,
224  *slcTruAssn,
225  *slcFlxAssn,
226  *slcFlxWgtAssn,
227  *slcGTruAssn,
230 
231  } // end loop over the slices
232 
233 
234  e.put(std::move(sliceOut), fInstanceLabel);
235  e.put(std::move(energyOut), fInstanceLabel);
236  e.put(std::move(trackOut), fInstanceLabel);
237  e.put(std::move(cosRejOut), fInstanceLabel);
238  e.put(std::move(nueCosRejOut), fInstanceLabel); /// 2017
239  e.put(std::move(showerOut), fInstanceLabel); /// 2017
240  e.put(std::move(prongOut), fInstanceLabel); /// 2017
241  e.put(std::move(vertexOut), fInstanceLabel); /// 2017
242  e.put(std::move(slidOut), fInstanceLabel); /// 2017
243  e.put(std::move(cvnOut), fInstanceLabel); /// 2017
244  e.put(std::move(sandOut), fInstanceLabel);
245  e.put(std::move(vetoOut), fInstanceLabel);
246  e.put(std::move(qepidOut), fInstanceLabel);
247  e.put(std::move(remidOut), fInstanceLabel);
248  e.put(std::move(numuEOut), fInstanceLabel);
249  e.put(std::move(slcTrkAssn), fInstanceLabel);
250  e.put(std::move(slcCROAssn), fInstanceLabel);
251 
252  e.put(std::move(slcNueCRAssn), fInstanceLabel); /// 2017
253  e.put(std::move(slcVtxAssn), fInstanceLabel); /// 2017
254  e.put(std::move(slcShwAssn), fInstanceLabel); /// 2017
255  e.put(std::move(slcPrgAssn), fInstanceLabel); /// 2017
256  e.put(std::move(slcSLDAssn), fInstanceLabel); /// 2017
257  e.put(std::move(shwSLDAssn), fInstanceLabel); /// 2017
258  e.put(std::move(slcCVNAssn), fInstanceLabel); /// 2017
259  e.put(std::move(slcNSOAssn), fInstanceLabel);
260  e.put(std::move(slcVetAssn), fInstanceLabel);
261  e.put(std::move(slcQEPAssn), fInstanceLabel);
262  e.put(std::move(slcNMEAssn), fInstanceLabel);
263  e.put(std::move(trkREMAssn), fInstanceLabel);
264  e.put(std::move(trkEngAssn), fInstanceLabel);
265  e.put(std::move(slcTruAssn), fInstanceLabel);
266  e.put(std::move(slcFlxAssn), fInstanceLabel);
267  e.put(std::move(slcFlxWgtAssn), fInstanceLabel);
268  e.put(std::move(slcGTruAssn), fInstanceLabel);
269 
270  // cosmic ray tracks
271  e.put(std::move(cosTrkOut), fCosmicInstance);
272  e.put(std::move(slcCosTrkAssn), fCosmicInstance);
273 
274  //e.put(std::move(showerOut), fInstanceLabel);
275  //e.put(std::move(vertexOut), fInstanceLabel);
276  //e.put(std::move(michelEOut));
277  //e.put(std::move(slcShwAssn), fInstanceLabel);
278  //e.put(std::move(slcVtxAssn), fInstanceLabel);
279  //e.put(std::move(slcMECAssn));
280  //e.put(std::move(trkMECAssn));
281 
282  return;
283 }
std::string fNumuSandLabel
label of module creating NumuSand
Definition: NumuSkimmer.h:75
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
std::string fTrackLabel
label of module creating tracks
Definition: NumuSkimmer.h:72
std::string fGeneratorLabel
label of module creating MC events
Definition: NumuSkimmer.h:82
art::InputTag fProngTag
input tag of module creating showers (2017)
Definition: NumuSkimmer.h:89
bool showerByEnergyNumu(art::Ptr< rb::Shower > s1, art::Ptr< rb::Shower > s2)
Definition: NumuSkimmer.cxx:35
std::string fCosmicInstance
label for cosmic ray related products being made
Definition: NumuSkimmer.h:84
bool isRealData() const
Definition: Event.h:83
std::string fVertexLabel
label of module creating vertex
Definition: NumuSkimmer.h:69
art::InputTag fInputTag
combination of the above two strings
Definition: BaseSkimmer.h:45
bool prongByLengthNumu(art::Ptr< rb::Prong > p1, art::Ptr< rb::Prong > p2)
Definition: NumuSkimmer.cxx:41
std::string fCosmicLabel
label of module creating cosmic tracks
Definition: NumuSkimmer.h:73
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
const XML_Char * s
Definition: expat.h:262
std::string fCosRejLabel
label of module creating CosRej
Definition: NumuSkimmer.h:74
std::string fVetoLabel
label of module creating vetos
Definition: NumuSkimmer.h:76
std::string fShowerLabel
label of module creating showers
Definition: NumuSkimmer.h:70
std::string fNueCosRejLabel
label of module creating NueCosRej (2017)
Definition: NumuSkimmer.h:86
std::string fReMIdLabel
label of module creating ReMIds
Definition: NumuSkimmer.h:78
std::string fQePIdLabel
label of module creating QePIds
Definition: NumuSkimmer.h:77
T prod(const std::vector< T > &v)
Definition: prod.hpp:17
size_type size() const
Definition: PtrVector.h:308
std::string fEnergyLabel
label of module creating energy objects
Definition: NumuSkimmer.h:71
std::string fCVNLabel
label of module creating cvns (2017)
Definition: NumuSkimmer.h:87
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
std::string fFluxWeightLabel
label of module creating flux weights
Definition: NumuSkimmer.h:83
std::string fNumuELabel
label of module creating NumuEs
Definition: NumuSkimmer.h:79
void CopyTrackAssn(art::Event &e, art::EDProducer const &prod, std::vector< art::Ptr< rb::Track > > const &trackIn, std::vector< T > &tOut, std::vector< rb::Track > &trackOut, art::Assns< rb::Track, T > &trkTAssn, std::string const &modLabel)
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)
std::string fInstanceLabel
instance label for products created by this skimmer
Definition: BaseSkimmer.h:44
#define LOG_VERBATIM(category)
bool failedToGet() const
Definition: Handle.h:196

Member Data Documentation

std::string skim::NumuSkimmer::fCAFLabel
private

label of module creating StandardRecords

Definition at line 81 of file NumuSkimmer.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::NumuSkimmer::fCosmicInstance
private

label for cosmic ray related products being made

Definition at line 84 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fCosmicLabel
private

label of module creating cosmic tracks

Definition at line 73 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fCosRejLabel
private

label of module creating CosRej

Definition at line 74 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fCVNLabel
private

label of module creating cvns (2017)

Definition at line 87 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fEnergyLabel
private

label of module creating energy objects

Definition at line 71 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fFluxWeightLabel
private

label of module creating flux weights

Definition at line 83 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fGeneratorLabel
private

label of module creating MC events

Definition at line 82 of file NumuSkimmer.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(), and skim::NueSkimmer::Skim().

std::string skim::BaseSkimmer::fInstanceLabel
protectedinherited
std::string skim::NumuSkimmer::fLIDLabel
private

label of module creating lids (2017)

Definition at line 88 of file NumuSkimmer.h.

Referenced by CopyShowerLID(), and reconfigure().

std::string skim::NumuSkimmer::fMichelELabel
private

label of module creating MichelEClusters

Definition at line 80 of file NumuSkimmer.h.

Referenced by reconfigure().

std::string skim::NumuSkimmer::fNueCosRejLabel
private

label of module creating NueCosRej (2017)

Definition at line 86 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fNumuELabel
private

label of module creating NumuEs

Definition at line 79 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fNumuSandLabel
private

label of module creating NumuSand

Definition at line 75 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

art::InputTag skim::NumuSkimmer::fProngTag
private

input tag of module creating showers (2017)

Definition at line 89 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fQePIdLabel
private

label of module creating QePIds

Definition at line 77 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fReMIdLabel
private

label of module creating ReMIds

Definition at line 78 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fShowerLabel
private

label of module creating showers

Definition at line 70 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fTrackLabel
private

label of module creating tracks

Definition at line 72 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fVertexLabel
private

label of module creating vertex

Definition at line 69 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().

std::string skim::NumuSkimmer::fVetoLabel
private

label of module creating vetos

Definition at line 76 of file NumuSkimmer.h.

Referenced by reconfigure(), and Skim().


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