Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
presel::NuePresel Class Reference
Inheritance diagram for presel::NuePresel:
art::EDProducer art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

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

Public Member Functions

 NuePresel (const fhicl::ParameterSet &pset)
 
virtual ~NuePresel ()
 
void beginRun (art::Run &run)
 
virtual void produce (art::Event &evt)
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Protected Attributes

std::string fSlicerLabel
 
std::string fRecoType
 
std::string fAssn3D
 
std::string fAssn2D
 
bool fDoLengthCut
 
bool fDoEnergyCut
 
bool fDoPercMipCut
 
bool fDoNCellCut
 
bool fDoCPlanesCut
 
bool fDoPlanesCut
 
double fNCellLow
 
double fNCellHigh
 
double fLengthLow
 
double fLengthHigh
 
double fPercMipLow
 
double fPercMipHigh
 
double fPlanesMax
 
double fCPlanesLow
 
double fCPlanesHigh
 
double fRecoELow
 
double fRecoEHigh
 
bool fInFidCut
 
fhicl::ParameterSet fPSetNDOS
 
fhicl::ParameterSet fPSetND
 
fhicl::ParameterSet fPSetFD
 

Detailed Description

Definition at line 35 of file NuePresel_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 43 of file EDProducer.h.

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

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

presel::NuePresel::NuePresel ( const fhicl::ParameterSet pset)
explicit

Definition at line 77 of file NuePresel_module.cc.

77  :
78  fSlicerLabel (pset.get<std::string>("SlicerLabel")),
79  fRecoType (pset.get<std::string>("RecoType" )),
80  fAssn3D (pset.get<std::string>("Assn3D" )),
81  fAssn2D (pset.get<std::string>("Assn2D" )),
82  fDoLengthCut (0),
83  fDoEnergyCut (0),
84  fDoPercMipCut (0),
85  fDoNCellCut (0),
86  fDoCPlanesCut (0),
87  fDoPlanesCut (0),
88  fNCellLow (0),
89  fNCellHigh (0),
90  fLengthLow (0),
91  fLengthHigh (0),
92  fPercMipLow (0),
93  fPercMipHigh (0),
94  fPlanesMax (0),
95  fCPlanesLow (0),
96  fCPlanesHigh (0),
97  fRecoELow (0),
98  fRecoEHigh (0),
99  fInFidCut (0),
100  fPSetNDOS (pset.get<fhicl::ParameterSet>("ndos")),
101  fPSetND (pset.get<fhicl::ParameterSet>("nd")),
102  fPSetFD (pset.get<fhicl::ParameterSet>("fd"))
103  {
104  produces< rb::FilterList<rb::Cluster> >();
105  produces< std::vector<presel::PreselObj> >();
106  produces< std::vector<rb::PID> >();
107  produces< art::Assns<rb::PID, rb::Cluster> >();
108  produces< art::Assns<presel::PreselObj, rb::Cluster> >();
109  }
std::string fSlicerLabel
T get(std::string const &key) const
Definition: ParameterSet.h:231
fhicl::ParameterSet fPSetND
fhicl::ParameterSet fPSetNDOS
fhicl::ParameterSet fPSetFD
enum BeamMode string
presel::NuePresel::~NuePresel ( )
virtual

Definition at line 112 of file NuePresel_module.cc.

113  {
114  }

Member Function Documentation

void presel::NuePresel::beginRun ( art::Run run)
virtual

Reimplemented from art::EDProducer.

Definition at line 116 of file NuePresel_module.cc.

References ana::assert(), geo::GeometryBase::DetId(), fCPlanesHigh, fCPlanesLow, fDoCPlanesCut, fDoEnergyCut, fDoLengthCut, fDoNCellCut, fDoPercMipCut, fDoPlanesCut, fInFidCut, fLengthHigh, fLengthLow, fNCellHigh, fNCellLow, fPercMipHigh, fPercMipLow, fPlanesMax, fPSetFD, fPSetND, fRecoEHigh, fRecoELow, geom(), fhicl::ParameterSet::get(), novadaq::cnv::kFARDET, novadaq::cnv::kNDOS, and novadaq::cnv::kNEARDET.

117  {
119 
120  fhicl::ParameterSet pset;
121 
122  switch(geom->DetId()){
123  case novadaq::cnv::kNDOS:
124  break;
126  pset = fPSetND;
127  break;
129  pset = fPSetFD;
130  break;
131  default:
132  assert(0 && "Unknown detector");
133  }
134 
135  fDoLengthCut = pset.get< bool >("DoLengthCut" );
136  fDoEnergyCut = pset.get< bool >("DoEnergyCut" );
137  fDoPercMipCut = pset.get< bool >("DoPercMipCut" );
138  fDoNCellCut = pset.get< bool >("DoNCellCut" );
139  fDoCPlanesCut = pset.get< bool >("DoCPlanesCut" );
140  fDoPlanesCut = pset.get< bool >("DoPlanesCut" );
141  fNCellLow = pset.get< signed int >("NCellLow" );
142  fNCellHigh = pset.get< signed int >("NCellHigh" );
143  fLengthLow = pset.get< signed int >("LengthLow" );
144  fLengthHigh = pset.get< signed int >("LengthHigh" );
145  fPercMipLow = pset.get< double >("PercMipLow" );
146  fPercMipHigh = pset.get< double >("PercMipHigh" );
147  fPlanesMax = pset.get< signed int >("PlanesMax" );
148  fCPlanesLow = pset.get< signed int >("CPlanesLow" );
149  fCPlanesHigh = pset.get< signed int >("CPlanesHigh" );
150  fRecoELow = pset.get< signed int >("RecoELow" );
151  fRecoEHigh = pset.get< signed int >("RecoEHigh" );
152  fInFidCut = pset.get< bool >("InFidCut" );
153  }
Far Detector at Ash River, MN.
Prototype Near Detector on the surface at FNAL.
T get(std::string const &key) const
Definition: ParameterSet.h:231
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
Near Detector in the NuMI cavern.
fhicl::ParameterSet fPSetND
fhicl::ParameterSet fPSetFD
void geom(int which=0)
Definition: geom.C:163
assert(nhit_max >=nhit_nbins)
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDProducer::currentContext ( ) const
protectedinherited
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
template<typename PROD , BranchType B>
ProductID art::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

Referenced by skim::NueSkimmer::CopyMichelSlice(), and skim::NueSkimmer::CopyMichelTrack().

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void presel::NuePresel::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 156 of file NuePresel_module.cc.

References rb::Cluster::CalorimetricEnergy(), rb::Cluster::Cell(), util::CreateAssn(), DEFINE_ART_MODULE(), rb::Cluster::ExtentPlane(), fAssn2D, fAssn3D, fCPlanesHigh, fDoCPlanesCut, fDoEnergyCut, fDoLengthCut, fDoNCellCut, fDoPercMipCut, fDoPlanesCut, fInFidCut, fLengthHigh, fNCellHigh, fPercMipHigh, fPlanesMax, fRecoEHigh, fRecoType, fSlicerLabel, geom(), art::Ptr< T >::get(), art::DataViewImpl::getByLabel(), ip, rb::RecoHit::IsCalibrated(), geo::GeometryBase::isInsideFiducialVolume(), rb::Cluster::IsNoise(), geo::kX, CLHEP::L, calib::Calibrator::MakeRecoHit(), extractScale::mean, rb::Cluster::MeanXYZ(), rb::RecoHit::MIP(), getGoodRuns4SAM::n, rb::Cluster::NCell(), rb::Cluster::NXCell(), rb::Cluster::NYCell(), rb::CellHit::Plane(), art::Event::put(), presel::PreselObj::SetPassPresel(), rb::CellHit::View(), rb::Cluster::W(), rb::Cluster::XCell(), and rb::Cluster::YCell().

157  {
158  std::unique_ptr< rb::FilterList<rb::Cluster> > filtcol(new rb::FilterList<rb::Cluster>);
159  std::unique_ptr< std::vector<presel::PreselObj> > nueprecol(new std::vector<presel::PreselObj>);
160  std::unique_ptr< std::vector<rb::PID> > pidcol(new std::vector<rb::PID>);
161  std::unique_ptr< art::Assns<rb::PID, rb::Cluster> > assns(new art::Assns<rb::PID, rb::Cluster>);
162  std::unique_ptr< art::Assns<presel::PreselObj, rb::Cluster> > nuepreassns(new art::Assns<presel::PreselObj, rb::Cluster>);
163 
164  //Set up Calibrator and Geometry services
167 
168  //Grab event's slices
170  evt.getByLabel(fSlicerLabel, slices);
171 
172  // Object holding showers associated with slice
173  art::FindManyP<rb::Shower> fmpShower3D(slices, evt, art::InputTag(fRecoType,fAssn3D));
174  art::FindManyP<rb::Shower> fmpShower2D(slices, evt, art::InputTag(fRecoType,fAssn2D));
175 
176  // Object holding prongs associated with slice
177  art::FindManyP<rb::Prong> fmpProng3D(slices, evt, art::InputTag(fRecoType,fAssn3D));
178  art::FindManyP<rb::Prong> fmpProng2D(slices, evt, art::InputTag(fRecoType,fAssn2D));
179 
180  // Object holding tracks associated with slice
181  art::FindManyP<rb::Track> fmpTrack3D(slices, evt, art::InputTag(fRecoType,fAssn3D));
182  art::FindManyP<rb::Track> fmpTrack2D(slices, evt, art::InputTag(fRecoType,fAssn2D));
183 
184  const int sliceMax = slices->size();
185 
186  for(int sliceIdx = 0; sliceIdx < sliceMax; ++sliceIdx){
187  const rb::Cluster& slice = (*slices)[sliceIdx];
188 
189  if(slice.IsNoise()) continue;
190 
191  presel::PreselObj nuepreobj; // nue preselection object initialisation
192 
193  double longestObject = 0;
194  if(fDoLengthCut){
195  //see if input is tracks
196  if(fmpTrack3D.isValid()){
197  std::vector< art::Ptr<rb::Track> > tracks = fmpTrack3D.at(sliceIdx);
198  //if there is a defined 2D label, use that as well
199  if(fmpTrack2D.isValid() && fAssn2D != ""){
200  std::vector< art::Ptr<rb::Track> > tracks2D = fmpTrack2D.at(sliceIdx);
201  for (unsigned int ip=0; ip<tracks2D.size(); ++ip) tracks.push_back(tracks2D[ip]);
202  }
203 
204  //Find the longest track in the slice:
205  for(unsigned int n = 0; n < tracks.size(); ++n){
206  const double L = tracks[n]->TotalLength();
207  if(L > longestObject) longestObject = L;
208  }
209  }
210  //else fall back to prongs
211  else if(fmpProng3D.isValid()){
212  std::vector< art::Ptr<rb::Prong> > prongs = fmpProng3D.at(sliceIdx);
213  //if there is a defined 2D label, use that as well
214  if(fmpProng2D.isValid() && fAssn2D != ""){
215  std::vector< art::Ptr<rb::Prong> > prongs2D = fmpProng2D.at(sliceIdx);
216  for (unsigned int ip=0; ip<prongs2D.size(); ++ip) prongs.push_back(prongs2D[ip]);
217  }
218 
219  //Find the longest prong in the slice:
220  for(unsigned int n = 0; n < prongs.size(); ++n){
221  const double L = prongs[n]->TotalLength();
222  if(L > longestObject) longestObject = L;
223  }
224  }
225  //else fall back to showers
226  else if(fmpShower3D.isValid()){
227  std::vector< art::Ptr<rb::Shower> > showers = fmpShower3D.at(sliceIdx);
228  //if there is a defined 2D label, use that as well
229  if(fmpShower2D.isValid() && fAssn2D != ""){
230  std::vector< art::Ptr<rb::Shower> > showers2D = fmpShower2D.at(sliceIdx);
231  for (unsigned int ip=0; ip<showers2D.size(); ++ip) showers.push_back(showers2D[ip]);
232  }
233 
234  //Find the longest shower in the slice:
235  for(unsigned int n = 0; n < showers.size(); ++n){
236  const double L = showers[n]->TotalLength();
237  if(L > longestObject) longestObject = L;
238  }
239  }
240  }
241 
242  const double nCells = slice.NCell(); //Number of cells in slice
243  const int lengthPlanes = slice.ExtentPlane(); //Number of planes in the slice
244 
245  //Find whether the slice is in the fiducial volume (based on center of mass):
246  const TVector3 mean = slice.MeanXYZ();
247  const bool inFid = geom->isInsideFiducialVolume(mean.X(), mean.Y(), mean.Z());
248 
249  const double wx = (slice.NXCell() > 0) ? slice.W(slice.XCell(0).get()) : 0;
250  const double wy = (slice.NYCell() > 0) ? slice.W(slice.YCell(0).get()) : 0;
251 
252  //Holds contiguous planes info:
253  int planeNum=-1;
254  std::vector<int> planelist;
255 
256  //Hit counters:
257  double nTotHit = 0.0;
258  double nMipHit = 0.0;
259  double fMipFrac = -1;
260 
261  for(unsigned int hitIdx = 0; hitIdx < slice.NCell(); ++hitIdx){
262  // This is slow because we have to keep recalculating the mean
263  // positions. The manual version below is much better.
264  // const rb::RecoHit rhit = slice.RecoHit(hitIdx);
265 
266  const art::Ptr<rb::CellHit>& chit = slice.Cell(hitIdx);
267 
268  //Get calbrated reco hit:
269  const rb::RecoHit rhit(cal->MakeRecoHit(*chit, chit->View() == geo::kX ? wx : wy));
270 
271  //Make sure things have been calibrated:
272  if(!rhit.IsCalibrated())
273  continue;
274 
275 
276  //Don't do this if we're not using contiguous planes cut
277  if (fDoCPlanesCut){
278 
279  //Make a list of the planes which have hits in the event:
280  planeNum = chit->Plane();
281  if (std::find (planelist.begin(),planelist.end(),planeNum) == planelist.end()) {
282  planelist.push_back(planeNum);
283  }
284 
285  }
286 
287  //Count up total hits:
288  nTotHit++;
289 
290  //Count up MIP hits:
291  if ( (rhit.MIP() > 0.5) && (rhit.MIP() < 1.5) ) nMipHit++;
292  }
293 
294  //Calculate fraction of MIP hits:
295  if (nTotHit>0) fMipFrac = nMipHit/nTotHit;
296 
297  // Selected unless we fail any cuts below
298  bool sel = true;
299 
300  //Do the Fiducial Cut:
301  if(!inFid && fInFidCut) {
302  sel = false;
303  }
304 
305  //Do the NCell cut:
306  if ( fDoNCellCut ){
307  if (nCells <= fNCellLow || nCells > fNCellHigh) sel = false;
308  }
309 
310  //Do the Longest reco object cut:
311  if ( fDoLengthCut ){
312  if (longestObject <= fLengthLow || longestObject > fLengthHigh) sel = false;
313  }
314 
315  //Do the MIP Fraction cut:
316  if ( fDoPercMipCut){
317  if ( fMipFrac <= fPercMipLow || fMipFrac > fPercMipHigh ) sel = false;
318  }
319 
320  //Do the Plane Length cut:
321  if ( fDoPlanesCut ){
322  if ( lengthPlanes > fPlanesMax ) sel = false;
323  }
324 
325  //Do the Energy Cut:
326  if (fDoEnergyCut){
327  const double calE = slice.CalorimetricEnergy();
328  if (calE <= fRecoELow || calE > fRecoEHigh) sel = false;
329  }
330 
331  //----Find the maximum number of contiguous planes, if we're doing this
332  //----cut and if it's still necessary:
333  if (fDoCPlanesCut && sel){
334 
335  int nContig=1;
336  int maxContig=-1;
337 
338  //Contiguous plane counter:
339  if (planelist.size()>0) std::sort(planelist.begin(),planelist.end());
340  for (unsigned int iplane=0; iplane<planelist.size(); iplane++){
341 
342  if (iplane!=0){
343  if (planelist[iplane] == (planelist[iplane-1]+1)){
344  nContig++;
345  if (nContig>maxContig) maxContig=nContig;
346  } else {
347  nContig=0;
348  }
349  }
350  }
351 
352  //Do the Contiguous Planes Cut
353  if (maxContig <= fCPlanesLow || maxContig > fCPlanesHigh) sel = false;
354  }
355 
356  if(!sel) filtcol->Add(slices, sliceIdx);
357 
358  // We're a nue preselection
359  pidcol->push_back(rb::PID(12, sel));
360  nuepreobj.SetPassPresel(sel);
361 
362  nueprecol->push_back(nuepreobj);
363 
364  util::CreateAssn(*this, evt, *pidcol, art::Ptr<rb::Cluster>(slices, sliceIdx), *assns);
365  util::CreateAssn(*this, evt, *nueprecol, art::Ptr<rb::Cluster>(slices, sliceIdx), *nuepreassns);
366 
367  } // end for sliceIdx
368 
369  evt.put(std::move(pidcol));
370  evt.put(std::move(nueprecol));
371  evt.put(std::move(assns));
372  evt.put(std::move(nuepreassns));
373  evt.put(std::move(filtcol));
374  }
std::string fSlicerLabel
A simple list of products that have been marked "filtered out".
Definition: FilterList.h:74
A pid value and corresponding pdg code.
Definition: PID.h:13
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 W(const rb::CellHit *chit) const
Estimate the unmeasured coordinate of chit.
Definition: Cluster.cxx:121
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
art::Ptr< rb::CellHit > XCell(unsigned int xIdx) const
Get the ith cell in the x-view.
Definition: Cluster.cxx:157
unsigned short Plane() const
Definition: CellHit.h:39
geo::View_t View() const
Definition: CellHit.h:41
Vertical planes which measure X.
Definition: PlaneGeo.h:28
rb::RecoHit MakeRecoHit(rb::CellHit const &cellhit, double w)
A collection of associated CellHits.
Definition: Cluster.h:47
TString ip
Definition: loadincs.C:5
TVector3 MeanXYZ(rb::AveragingScheme=kDefaultScheme) const
Definition: Cluster.cxx:538
Calibrated quantities relying on position in the orthogonal view. To generate a rb::CellHit from a rb...
Definition: RecoHit.h:19
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
void SetPassPresel(bool pass)
holds pass/fail output of presel
Definition: PreselObj.cxx:24
double CalorimetricEnergy(EEnergyCalcScheme escheme=kRecomputeEnergy) const
Simple estimate of neutrino energy.
Definition: Cluster.cxx:439
static constexpr double L
art::Ptr< rb::CellHit > YCell(unsigned int yIdx) const
Get the ith cell in the y-view.
Definition: Cluster.cxx:165
unsigned int NYCell() const
Number of cells in the y-view.
Definition: Cluster.h:108
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
Definition: Cluster.cxx:145
T const * get() const
Definition: Ptr.h:321
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
unsigned int NXCell() const
Number of cells in the x-view.
Definition: Cluster.h:106
void geom(int which=0)
Definition: geom.C:163
unsigned int ExtentPlane(geo::View_t view=geo::kXorY) const
Definition: Cluster.h:250
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163
bool isInsideFiducialVolume(const double x_cm, const double y_cm, const double z_cm) const
Is the particle inside the detector Fiducial Volume?
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

std::string presel::NuePresel::fAssn2D
protected

Definition at line 49 of file NuePresel_module.cc.

Referenced by produce().

std::string presel::NuePresel::fAssn3D
protected

Definition at line 48 of file NuePresel_module.cc.

Referenced by produce().

double presel::NuePresel::fCPlanesHigh
protected

Definition at line 64 of file NuePresel_module.cc.

Referenced by beginRun(), and produce().

double presel::NuePresel::fCPlanesLow
protected

Definition at line 63 of file NuePresel_module.cc.

Referenced by beginRun().

bool presel::NuePresel::fDoCPlanesCut
protected

Definition at line 54 of file NuePresel_module.cc.

Referenced by beginRun(), and produce().

bool presel::NuePresel::fDoEnergyCut
protected

Definition at line 51 of file NuePresel_module.cc.

Referenced by beginRun(), and produce().

bool presel::NuePresel::fDoLengthCut
protected

Definition at line 50 of file NuePresel_module.cc.

Referenced by beginRun(), and produce().

bool presel::NuePresel::fDoNCellCut
protected

Definition at line 53 of file NuePresel_module.cc.

Referenced by beginRun(), and produce().

bool presel::NuePresel::fDoPercMipCut
protected

Definition at line 52 of file NuePresel_module.cc.

Referenced by beginRun(), and produce().

bool presel::NuePresel::fDoPlanesCut
protected

Definition at line 55 of file NuePresel_module.cc.

Referenced by beginRun(), and produce().

bool presel::NuePresel::fInFidCut
protected

Definition at line 67 of file NuePresel_module.cc.

Referenced by beginRun(), and produce().

double presel::NuePresel::fLengthHigh
protected

Definition at line 59 of file NuePresel_module.cc.

Referenced by beginRun(), and produce().

double presel::NuePresel::fLengthLow
protected

Definition at line 58 of file NuePresel_module.cc.

Referenced by beginRun().

double presel::NuePresel::fNCellHigh
protected

Definition at line 57 of file NuePresel_module.cc.

Referenced by beginRun(), and produce().

double presel::NuePresel::fNCellLow
protected

Definition at line 56 of file NuePresel_module.cc.

Referenced by beginRun().

double presel::NuePresel::fPercMipHigh
protected

Definition at line 61 of file NuePresel_module.cc.

Referenced by beginRun(), and produce().

double presel::NuePresel::fPercMipLow
protected

Definition at line 60 of file NuePresel_module.cc.

Referenced by beginRun().

double presel::NuePresel::fPlanesMax
protected

Definition at line 62 of file NuePresel_module.cc.

Referenced by beginRun(), and produce().

fhicl::ParameterSet presel::NuePresel::fPSetFD
protected

Definition at line 69 of file NuePresel_module.cc.

Referenced by beginRun().

fhicl::ParameterSet presel::NuePresel::fPSetND
protected

Definition at line 69 of file NuePresel_module.cc.

Referenced by beginRun().

fhicl::ParameterSet presel::NuePresel::fPSetNDOS
protected

Definition at line 69 of file NuePresel_module.cc.

double presel::NuePresel::fRecoEHigh
protected

Definition at line 66 of file NuePresel_module.cc.

Referenced by beginRun(), and produce().

double presel::NuePresel::fRecoELow
protected

Definition at line 65 of file NuePresel_module.cc.

Referenced by beginRun().

std::string presel::NuePresel::fRecoType
protected

Definition at line 47 of file NuePresel_module.cc.

Referenced by produce().

std::string presel::NuePresel::fSlicerLabel
protected

Definition at line 46 of file NuePresel_module.cc.

Referenced by produce().


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