Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
presel::LEMPresel Class Reference

Speed up LEM processing, mostly of FD data. More...

Inheritance diagram for presel::LEMPresel:
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

 LEMPresel (const fhicl::ParameterSet &pset)
 
virtual ~LEMPresel ()
 
virtual void produce (art::Event &evt) override
 
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

bool PassesContainment (const cosrej::NueCosRej &cr) const
 
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 fNueCosRejLabel
 
double fMinCaloE
 
double fMaxCaloE
 
double fEastDist
 
double fWestDist
 
double fTopDist
 
double fBottomDist
 
double fFrontDist
 
double fBackDist
 

Detailed Description

Speed up LEM processing, mostly of FD data.

Definition at line 24 of file LEMPresel_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::LEMPresel::LEMPresel ( const fhicl::ParameterSet pset)
explicit

Definition at line 49 of file LEMPresel_module.cc.

49  :
50  fSlicerLabel (pset.get<std::string>("SlicerLabel")),
51  fNueCosRejLabel(pset.get<std::string>("NueCosRejLabel")),
52  fMinCaloE (pset.get<double>("MinCaloE")),
53  fMaxCaloE (pset.get<double>("MaxCaloE")),
54  fEastDist (pset.get<double>("EastDist")),
55  fWestDist (pset.get<double>("WestDist")),
56  fTopDist (pset.get<double>("TopDist")),
57  fBottomDist(pset.get<double>("BottomDist")),
58  fFrontDist (pset.get<double>("FrontDist")),
59  fBackDist (pset.get<double>("BackDist"))
60  {
61  produces<rb::FilterList<rb::Cluster>>();
62  }
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::string fSlicerLabel
std::string fNueCosRejLabel
enum BeamMode string
presel::LEMPresel::~LEMPresel ( )
virtual

Definition at line 65 of file LEMPresel_module.cc.

66  {
67  }

Member Function Documentation

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
bool presel::LEMPresel::PassesContainment ( const cosrej::NueCosRej cr) const
protected

Definition at line 111 of file LEMPresel_module.cc.

References DEFINE_ART_MODULE(), fBackDist, fBottomDist, fEastDist, fFrontDist, fTopDist, fWestDist, cosrej::NueCosRej::StartDistToBack(), cosrej::NueCosRej::StartDistToBottom(), cosrej::NueCosRej::StartDistToEast(), cosrej::NueCosRej::StartDistToFront(), cosrej::NueCosRej::StartDistToTop(), cosrej::NueCosRej::StartDistToWest(), cosrej::NueCosRej::StopDistToBack(), cosrej::NueCosRej::StopDistToBottom(), cosrej::NueCosRej::StopDistToEast(), cosrej::NueCosRej::StopDistToFront(), cosrej::NueCosRej::StopDistToTop(), and cosrej::NueCosRej::StopDistToWest().

Referenced by produce().

112  {
113  if(cr.StartDistToEast() < fEastDist ||
114  cr.StopDistToEast() < fEastDist ) return false;
115 
116  if(cr.StartDistToWest() < fWestDist ||
117  cr.StopDistToWest() < fWestDist ) return false;
118 
119  if(cr.StartDistToTop() < fTopDist ||
120  cr.StopDistToTop() < fTopDist ) return false;
121 
122  if(cr.StartDistToBottom() < fBottomDist ||
123  cr.StopDistToBottom() < fBottomDist) return false;
124 
125  if(cr.StartDistToFront() < fFrontDist ||
126  cr.StopDistToFront() < fFrontDist ) return false;
127 
128  if(cr.StartDistToBack() < fBackDist ||
129  cr.StopDistToBack() < fBackDist ) return false;
130 
131  return true;
132  }
double StopDistToTop() const
Perpendicular distance of stop point of the leading prong to the top edge of the detector.
Definition: NueCosRej.h:72
double StopDistToWest() const
Perpendicular distance of stop point of the leading prong to the west edge of the detector (west is p...
Definition: NueCosRej.h:88
double StopDistToFront() const
Perpendicular distance of stop point of the leading prong to the front edge of the detector...
Definition: NueCosRej.h:80
double StartDistToBottom() const
Perpendicular distance of start point of the leading prong to the bottom edge of the detector...
Definition: NueCosRej.h:52
double StopDistToBack() const
Perpendicular distance of stop point of the leading prong to the back edge of the detector...
Definition: NueCosRej.h:84
double StartDistToTop() const
Perpendicular distance of start point of the leading prong to the top edge of the detector...
Definition: NueCosRej.h:48
double StartDistToEast() const
Perpendicular distance of start point of the leading prong to the east edge of the detector (east is ...
Definition: NueCosRej.h:68
double StopDistToBottom() const
Perpendicular distance of stop point of the leading prong to the bottom edge of the detector...
Definition: NueCosRej.h:76
double StartDistToBack() const
Perpendicular distance of start point of the leading prong to the back edge of the detector...
Definition: NueCosRej.h:60
double StartDistToFront() const
Perpendicular distance of start point of the leading prong to the front edge of the detector...
Definition: NueCosRej.h:56
double StopDistToEast() const
Perpendicular distance of stop point of the leading prong to the east edge of the detector (east is n...
Definition: NueCosRej.h:92
double StartDistToWest() const
Perpendicular distance of start point of the leading prong to the west edge of the detector (west is ...
Definition: NueCosRej.h:64
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void presel::LEMPresel::produce ( art::Event evt)
overridevirtual

Implements art::EDProducer.

Definition at line 70 of file LEMPresel_module.cc.

References ana::assert(), rb::Cluster::CalorimetricEnergy(), fillBadChanDBTables::det, ds::DetectorService::DetId(), fMaxCaloE, fMinCaloE, fNueCosRejLabel, fSlicerLabel, art::DataViewImpl::getByLabel(), rb::Cluster::IsNoise(), novadaq::cnv::kFARDET, PassesContainment(), and art::Event::put().

71  {
72  std::unique_ptr< rb::FilterList<rb::Cluster> > filtcol(new rb::FilterList<rb::Cluster>);
73 
75  if(det->DetId() != novadaq::cnv::kFARDET){
76  evt.put(std::move(filtcol));
77  return;
78  }
79 
81  evt.getByLabel(fSlicerLabel, slices);
82 
84 
85  const int sliceMax = slices->size();
86  for(int sliceIdx = 0; sliceIdx < sliceMax; ++sliceIdx){
87  const rb::Cluster& slice = (*slices)[sliceIdx];
88  if(slice.IsNoise()) continue;
89 
90  const double caloE = slice.CalorimetricEnergy();
91  // Make sure to test calE even if NueCosRej is unavailable
92  if(caloE < fMinCaloE || (fMaxCaloE > 0 && caloE > fMaxCaloE)){
93  filtcol->Add(slices, sliceIdx);
94  // Once we've filtered the slice there's no need to check anything else
95  continue;
96  }
97 
98  std::vector< art::Ptr<cosrej::NueCosRej> > cosrejs = fmcr.at(sliceIdx);
99  if(cosrejs.empty()) continue;
100  assert(cosrejs.size() == 1);
101 
102  if(!PassesContainment(*cosrejs[0])){
103  filtcol->Add(slices, sliceIdx);
104  }
105  } // end for sliceIdx
106 
107  evt.put(std::move(filtcol));
108  }
novadaq::cnv::DetId DetId() const
What detector are we in?
A simple list of products that have been marked "filtered out".
Definition: FilterList.h:74
A collection of associated CellHits.
Definition: Cluster.h:47
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
Far Detector at Ash River, MN.
double CalorimetricEnergy(EEnergyCalcScheme escheme=kRecomputeEnergy) const
Simple estimate of neutrino energy.
Definition: Cluster.cxx:439
std::string fSlicerLabel
bool PassesContainment(const cosrej::NueCosRej &cr) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
assert(nhit_max >=nhit_nbins)
bool IsNoise() const
Is the noise flag set?
Definition: Cluster.h:163
std::string fNueCosRejLabel
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

double presel::LEMPresel::fBackDist
protected

Definition at line 45 of file LEMPresel_module.cc.

Referenced by PassesContainment().

double presel::LEMPresel::fBottomDist
protected

Definition at line 43 of file LEMPresel_module.cc.

Referenced by PassesContainment().

double presel::LEMPresel::fEastDist
protected

Definition at line 40 of file LEMPresel_module.cc.

Referenced by PassesContainment().

double presel::LEMPresel::fFrontDist
protected

Definition at line 44 of file LEMPresel_module.cc.

Referenced by PassesContainment().

double presel::LEMPresel::fMaxCaloE
protected

Definition at line 38 of file LEMPresel_module.cc.

Referenced by produce().

double presel::LEMPresel::fMinCaloE
protected

Definition at line 37 of file LEMPresel_module.cc.

Referenced by produce().

std::string presel::LEMPresel::fNueCosRejLabel
protected

Definition at line 35 of file LEMPresel_module.cc.

Referenced by produce().

std::string presel::LEMPresel::fSlicerLabel
protected

Definition at line 34 of file LEMPresel_module.cc.

Referenced by produce().

double presel::LEMPresel::fTopDist
protected

Definition at line 42 of file LEMPresel_module.cc.

Referenced by PassesContainment().

double presel::LEMPresel::fWestDist
protected

Definition at line 41 of file LEMPresel_module.cc.

Referenced by PassesContainment().


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