Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
novaddt::RemoveOneDSlices Class Reference
Inheritance diagram for novaddt::RemoveOneDSlices:
art::EDFilter art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDFilter
 
using WorkerType = WorkerT< EDFilter >
 
template<typename UserConfig >
using Table = ProducerBase::Table< UserConfig >
 

Public Member Functions

 RemoveOneDSlices (fhicl::ParameterSet const &p)
 
virtual ~RemoveOneDSlices ()
 
virtual bool filter (art::Event &event)
 
void endJob () 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 ()
 

Static Public Attributes

static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 

Protected Member Functions

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

Private Member Functions

void countHitsPerViewOutlyingCells (HitList &hits, uint &x_hits, uint &y_hits)
 
void printDDTSlice (HitList &hits)
 

Private Attributes

std::string fInputLabel
 
std::string fInputInstance
 
uint fMinHitsPerView
 
int _nEvents = 0
 
int _nInputSlices = 0
 
int _nOutputSlices = 0
 

Detailed Description

Definition at line 26 of file RemoveOneDSlices_module.cc.

Member Typedef Documentation

using art::EDFilter::ModuleType = EDFilter
inherited

Definition at line 37 of file EDFilter.h.

template<typename UserConfig >
using art::EDFilter::Table = ProducerBase::Table<UserConfig>
inherited

Definition at line 46 of file EDFilter.h.

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

Definition at line 38 of file EDFilter.h.

Constructor & Destructor Documentation

novaddt::RemoveOneDSlices::RemoveOneDSlices ( fhicl::ParameterSet const &  p)
explicit

Definition at line 48 of file RemoveOneDSlices_module.cc.

References om::cout, allTimeWatchdog::endl, fInputInstance, fInputLabel, and fMinHitsPerView.

49 :
50  fInputLabel (p.get< std::string >("InputLabel" )),
51  fInputInstance (p.get< std::string >("InputInstance")),
52  fMinHitsPerView (p.get< uint >("MinHitsPerView"))
53 
54  // Initialize member data here.
55 {
56  std::cout << "=== novaddt::RemoveOneDSlices instantiate" << std::endl;
57  std::cout << "\t input hits label: " << fInputLabel << std::endl;
58  std::cout << "\t input hits instance: " << fInputInstance << std::endl;
59  std::cout << "\t min hits per view: " << fMinHitsPerView << std::endl;
60  // Call appropriate Produces<>() functions here.
61  produces<std::vector<HitList>>("TwoDSlices");
62 }
const char * p
Definition: xmltok.h:285
OStream cout
Definition: OStream.cxx:6
enum BeamMode string
unsigned int uint
novaddt::RemoveOneDSlices::~RemoveOneDSlices ( )
virtual

Definition at line 64 of file RemoveOneDSlices_module.cc.

65 {
66  // Clean up dynamic memory and other resources here.
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
void novaddt::RemoveOneDSlices::countHitsPerViewOutlyingCells ( HitList hits,
uint x_hits,
uint y_hits 
)
private

Definition at line 105 of file RemoveOneDSlices_module.cc.

References allTimeWatchdog::endl, LOG_DEBUG, novaddt::View::val, novaddt::DAQHit::View(), and daqchannelmap::X_VIEW.

Referenced by filter().

108 {
109  for (unsigned int i_hit = 0; i_hit < hits.size(); ++i_hit){
110  DAQHit hit = hits[i_hit];
111  // check that the current cells view
112  if (hit.View().val == daqchannelmap::X_VIEW){
113  x_hits++;
114  } else {
115  y_hits++;
116  }
117  } // end of loop on hits
118 
119  LOG_DEBUG("RemoveOneDSlices") << "\t\t - end of loop, current slice x hits: "
120  << x_hits << ", y hits: "
121  << y_hits << std::endl;
122 }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
void hits()
Definition: readHits.C:15
Identifier for the X measuring view of the detector (top)
Definition: structs.h:12
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::EDFilter::currentContext ( ) const
protectedinherited
void novaddt::RemoveOneDSlices::endJob ( )
overridevirtual

Reimplemented from art::EDFilter.

Definition at line 148 of file RemoveOneDSlices_module.cc.

References _nEvents, _nInputSlices, _nOutputSlices, om::cout, DEFINE_ART_MODULE(), and allTimeWatchdog::endl.

149 {
150  std::cout << "=== novaddt::RemoveOneDSlices endJob" << std::endl;
151  std::cout << "\tNumber of events: " << _nEvents << std::endl;
152  std::cout << "\tNumber of slices: " << _nInputSlices << std::endl;
153  std::cout << "\tNumber of slices filtered: " << _nOutputSlices << std::endl;
154 }
OStream cout
Definition: OStream.cxx:6
bool novaddt::RemoveOneDSlices::filter ( art::Event event)
virtual

Implements art::EDFilter.

Definition at line 69 of file RemoveOneDSlices_module.cc.

References _nEvents, _nInputSlices, _nOutputSlices, countHitsPerViewOutlyingCells(), allTimeWatchdog::endl, fInputInstance, fInputLabel, fMinHitsPerView, MECModelEnuComparisons::i, LOG_DEBUG, and stan::io::product().

70 {
71  LOG_DEBUG("RemoveOneDSlices") << "=== novaddt::RemoveOneDSlices filter. Event: "
72  << event.id().event()
73  << std::endl;
74  _nEvents++;
76  event.getByLabel(fInputLabel, fInputInstance, hit_lists);
77  LOG_DEBUG("RemoveOneDSlices") << "\t got " << hit_lists->size() << " hit lists" << std::endl;
78 
79  //make a hit lists out of hits/hit lists that pass the spatial noise removal
80  std::unique_ptr< std::vector<HitList> >final_product(new std::vector<HitList>);
81 
82  for(unsigned int i=0; i<hit_lists->size(); ++i){
83  _nInputSlices++;
84  HitList product = hit_lists->at(i);
85  LOG_DEBUG("RemoveOneDSlices") << "\t hit list[" << i << "]: " << product.size() << " hits" << std::endl;
86  //printDDTSlice(product);
87  // count hits per view
88  uint x_hits = 0;
89  uint y_hits = 0;
90  countHitsPerViewOutlyingCells(product, x_hits, y_hits);
91 
92  //printDDTSlice(product);
93  if ((x_hits >= fMinHitsPerView) &&
94  (y_hits >= fMinHitsPerView)) final_product->push_back(product);
95 
96  } // end of loop on hits lists
97  //put the hits into the event for later use
98  LOG_DEBUG("RemoveOneDSlices") << "\t produced " << final_product->size() << " hit lists" << std::endl;
99  _nOutputSlices+=final_product->size();
100  event.put(std::move(final_product),"TwoDSlices");
101 
102  return true;
103 }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
std::vector< DAQHit > HitList
Definition: HitList.h:15
T product(std::vector< T > dims)
void countHitsPerViewOutlyingCells(HitList &hits, uint &x_hits, uint &y_hits)
unsigned int uint
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::EDFilter::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 131 of file EDFilter.h.

References art::EDFilter::moduleDescription_.

Referenced by novaddt::HoughTrackMaker::create_associations().

132  {
133  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
134  instanceName);
135  }
ModuleDescription moduleDescription_
Definition: EDFilter.h:124
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 novaddt::RemoveOneDSlices::printDDTSlice ( HitList hits)
private

Definition at line 124 of file RemoveOneDSlices_module.cc.

References novaddt::DAQHit::ADC(), novaddt::DAQHit::Cell(), allTimeWatchdog::endl, calib::j, LOG_DEBUG, novaddt::DAQHit::Plane(), string, novaddt::DAQHit::TDC(), novaddt::TDC::val, novaddt::ADC::val, novaddt::Plane::val, novaddt::Cell::val, novaddt::View::val, POTSpillRate::view, novaddt::DAQHit::View(), and daqchannelmap::X_VIEW.

125 {
126  // print them
127  LOG_DEBUG("RemoveOneDSlices") << "\t\t - Hit list: " << hits.size()
128  << std::endl;
129  // sort them
130  sort(hits.begin(), hits.end(), novaddt::CompareDAQHit<novaddt::Cell>());
131  // loop over hits in each slice
132  for(unsigned int j = 0; j < hits.size(); ++j){
134  std::string view = "y";
135  if( hit.View().val == daqchannelmap::X_VIEW ){
136  view = "x";
137  }
138  LOG_DEBUG("RemoveOneDSlices") << "\t\t\thit[" << j
139  << "]: TDC: " << hit.TDC().val
140  << ", ADC: " << hit.ADC().val
141  << ", plane: " << hit.Plane().val
142  << ", " << view
143  << "-cell: " << hit.Cell().val
144  << std::endl;
145  } // end of loop on hits
146 }
#define LOG_DEBUG(stream)
Definition: Messenger.h:149
void hits()
Definition: readHits.C:15
Identifier for the X measuring view of the detector (top)
const double j
Definition: BetheBloch.cxx:29
Definition: structs.h:12
enum BeamMode string
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

int novaddt::RemoveOneDSlices::_nEvents = 0
private

Definition at line 43 of file RemoveOneDSlices_module.cc.

Referenced by endJob(), and filter().

int novaddt::RemoveOneDSlices::_nInputSlices = 0
private

Definition at line 44 of file RemoveOneDSlices_module.cc.

Referenced by endJob(), and filter().

int novaddt::RemoveOneDSlices::_nOutputSlices = 0
private

Definition at line 45 of file RemoveOneDSlices_module.cc.

Referenced by endJob(), and filter().

constexpr bool art::EDFilter::Fail {false}
staticinherited

Definition at line 33 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().

std::string novaddt::RemoveOneDSlices::fInputInstance
private

Definition at line 35 of file RemoveOneDSlices_module.cc.

Referenced by filter(), and RemoveOneDSlices().

std::string novaddt::RemoveOneDSlices::fInputLabel
private

Definition at line 34 of file RemoveOneDSlices_module.cc.

Referenced by filter(), and RemoveOneDSlices().

uint novaddt::RemoveOneDSlices::fMinHitsPerView
private

Definition at line 36 of file RemoveOneDSlices_module.cc.

Referenced by filter(), and RemoveOneDSlices().

constexpr bool art::EDFilter::Pass {true}
staticinherited

Definition at line 32 of file EDFilter.h.

Referenced by evgen::GENIEFilter::filter().


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