Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
novaddt::Clusterer Class Reference
Inheritance diagram for novaddt::Clusterer:
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

 Clusterer (fhicl::ParameterSet const &p)
 
virtual ~Clusterer ()
 
bool filter (art::Event &e) 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 Attributes

std::string _hlabel
 
std::string _instan
 
bool _trigflag
 

Detailed Description

Definition at line 23 of file Clusterer_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::Clusterer::Clusterer ( fhicl::ParameterSet const &  p)
explicit

Definition at line 39 of file Clusterer_module.cc.

40 :
41 // Initialize member data here.
42  _hlabel(p.get< std::string>("hlist_label")),
43  _instan(p.get< std::string>("hlist_instance")),
44  _trigflag(false)
45 {
46  // Call appropriate Produces<>() functions here.
47  produces< std::vector<novaddt::Cluster> >();
48  produces< art::Assns<novaddt::Cluster, novaddt::HitList> >();
49 }
const char * p
Definition: xmltok.h:285
enum BeamMode string
novaddt::Clusterer::~Clusterer ( )
virtual

Definition at line 51 of file Clusterer_module.cc.

52 {
53  // Clean up dynamic memory and other resources here.
54 }

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::EDFilter::currentContext ( ) const
protectedinherited
bool novaddt::Clusterer::filter ( art::Event e)
overridevirtual

Implements art::EDFilter.

Definition at line 56 of file Clusterer_module.cc.

References _hlabel, _instan, _trigflag, novaddt::Cell::Cell(), util::CreateAssn(), DEFINE_ART_MODULE(), art::DataViewImpl::getByLabel(), MECModelEnuComparisons::i, novaddt::Plane::Plane(), stan::io::product(), art::Event::put(), novaddt::TDC::TDC(), novaddt::Cell::val, daqchannelmap::X_VIEW, and daqchannelmap::Y_VIEW.

57 {
58  // Grab the vector of hitlists from the EDS
60  e.getByLabel(_hlabel, _instan, lists);
61 
62  // This is what is being put into the EDS
63  std::unique_ptr<std::vector<novaddt::Cluster>> product(new std::vector<Cluster>);
64  std::unique_ptr<art::Assns<novaddt::Cluster, novaddt::HitList> >
66 
67  // How many groups of hits are we dealing with?
68  unsigned int ngroups = lists->size();
69  if (!ngroups) {
70  _trigflag = false;
71  e.put(std::move(product));
72  e.put(std::move(assn));
73  return _trigflag;
74  }
75 
76  // Loop over each group, make a cluster
77  for(size_t i = 0; i != ngroups; ++i){
78  // novaddt::HitList hits = (*i);
79  art::Ptr<novaddt::HitList> hl(lists,i);
80  novaddt::TDC lowt = (*hl)[0].TDC();
81  novaddt::TDC hight= (*hl)[0].TDC();
82  novaddt::Plane lowp = (*hl)[0].Plane();
83  novaddt::Plane highp= (*hl)[0].Plane();
84  uint32_t asum = 0;
85  novaddt::Cell lowxc = (*hl)[0].Cell();
86  novaddt::Cell lowyc = (*hl)[0].Cell();
87  novaddt::Cell highxc= (*hl)[0].Cell();
88  novaddt::Cell highyc= (*hl)[0].Cell();
89 
90  for(auto const& hit: *hl){
91  // Figure out earliest and latest time
92  if (hit.TDC().val < lowt) lowt = hit.TDC().val;
93  else if(hight < hit.TDC().val) hight = hit.TDC().val;
94 
95  // Figure out smallest and largest cell in each view
96  if (daqchannelmap::X_VIEW==hit.View().val){
97  if (hit.Cell().val < lowxc) lowxc = hit.Cell().val;
98  else if(highxc < hit.Cell().val) highxc = hit.Cell().val;
99  }
100  if (daqchannelmap::Y_VIEW==hit.View().val){
101  if (hit.Cell().val < lowyc) lowyc = hit.Cell().val;
102  else if(highyc < hit.Cell().val) highyc = hit.Cell().val;
103  }
104 
105  // Figure out starting and ending plane of Cluster
106  if (hit.Plane().val < lowp) lowp = hit.Plane().val;
107  else if(highp < hit.Plane().val) highp = hit.Plane().val;
108 
109  // Increment the ADC sum by the ADC value of the hit
110  asum = asum + hit.ADC().val;
111 
112  } // End of loop over hits in a hitlist
113 
114  // Make the Cluster
115  novaddt::Cluster clust(lowxc, lowyc, highxc, highyc, lowp, highp, lowt, hight, asum);
116 
117  // Add the Cluster to the vector if it's 3D (might change this later)
118  if (!(lowxc.val == highxc.val || lowyc.val == highyc.val)){
119  product->push_back(clust);
120  //Making Association with the hit list with the cluster
121  util::CreateAssn(*this, e, *(product.get()), hl,*(assn.get()));
122  }
123 
124  } // End of loops over hitlists
125 
126  // Check the size of the vector of Clusters
127  _trigflag = (product->size() > 0);
128 
129  // Put the vector of Clusters into the event
130  //e.put(std::move(product),"Clusters");
131  e.put(std::move(product));
132  e.put(std::move(assn));
133 
134  // Return appropriate flag
135  return _trigflag;
136 }
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.
value_type val
Definition: BaseProducts.h:109
Cell()=default
Identifier for the Y measuring view of the detector (side)
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
TDC()=default
Identifier for the X measuring view of the detector (top)
Plane()=default
T product(std::vector< T > dims)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
Definition: structs.h:12
Definition: fwd.h:28
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 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 novaddt::Clusterer::_hlabel
private

Definition at line 32 of file Clusterer_module.cc.

Referenced by filter().

std::string novaddt::Clusterer::_instan
private

Definition at line 33 of file Clusterer_module.cc.

Referenced by filter().

bool novaddt::Clusterer::_trigflag
private

Definition at line 34 of file Clusterer_module.cc.

Referenced by filter().

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

Definition at line 33 of file EDFilter.h.

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

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: