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

 LEHitReco (const fhicl::ParameterSet &p)
 
void reconfigure (const fhicl::ParameterSet &p)
 
void produce (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 ()
 

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

LEHitFinder< double > * fLEHitFinderAlg
 
art::InputTag fRawDataLabel
 
std::map< LEParams, double > fLEParamSet
 
art::ServiceHandle< beamlineutil::BeamlineChannelMapfChannelMap
 

Detailed Description

Definition at line 45 of file LEHitReco_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

beamlinereco::LEHitReco::LEHitReco ( const fhicl::ParameterSet p)
explicit

Definition at line 62 of file LEHitReco_module.cc.

References reconfigure().

62  {
63  produces<std::vector<brb::BeamlineDigit> >();
64  produces<art::Assns<brb::BeamlineDigit, rawdata::RawBeamlineDigit> >();
65 
66  reconfigure(p);
67 }
void reconfigure(const fhicl::ParameterSet &p)

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
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void beamlinereco::LEHitReco::produce ( art::Event e)
overridevirtual

Implements art::EDProducer.

Definition at line 93 of file LEHitReco_module.cc.

References util::CreateAssn(), DEFINE_ART_MODULE(), fChannelMap, art::fill_ptr_vector(), fLEHitFinderAlg, fRawDataLabel, art::DataViewImpl::getByLabel(), beamlinereco::LEHitFinder< T >::GetHitCollection(), beamlinereco::LEHitFinder< T >::Go(), beamlineutil::BeamlineChannelMap::OnlineDigitChannel(), art::Event::put(), brb::BeamlineDigit::SetChannelID(), brb::BeamlineDigit::SetEndTimeInNanoSec(), brb::BeamlineDigit::SetPeakADC(), brb::BeamlineDigit::SetPeakTimeInNanoSec(), brb::BeamlineDigit::SetStartTimeInNanoSec(), beamlinereco::LEHitFinder< T >::SetWaveform(), art::DataViewImpl::size(), and submit_nova_art::timestamp.

93  {
94  std::unique_ptr<std::vector<brb::BeamlineDigit> > digit_reco(new std::vector<brb::BeamlineDigit>);
95  std::unique_ptr<art::Assns<brb::BeamlineDigit, rawdata::RawBeamlineDigit> > digit_assn(new art::Assns<brb::BeamlineDigit, rawdata::RawBeamlineDigit>);
96 
97  // get the raw digits
99  std::vector<art::Ptr<rawdata::RawBeamlineDigit> > digits;
100  if (e.getByLabel(fRawDataLabel, digitHandle)) art::fill_ptr_vector(digits, digitHandle);
101 
102  // run the reco algorithm here
103  for (std::vector<art::Ptr<rawdata::RawBeamlineDigit> >::const_iterator digitIt = digits.begin(); digitIt != digits.end(); ++digitIt) {
104  unsigned int channelNumber = fChannelMap->OnlineDigitChannel((*digitIt)->ChannelID());
105  std::vector<uint16_t> waveform = (*digitIt)->ADCs();
106  uint32_t timestamp = (*digitIt)->Timestamp();
107 
108  fLEHitFinderAlg->SetWaveform(waveform, channelNumber, timestamp);
109  fLEHitFinderAlg->Go();
110  std::map<double, hit_t<double> > HitCollection = fLEHitFinderAlg->GetHitCollection();
111 
112  for (std::map<double, hit_t<double> >::iterator digitHCIt = HitCollection.begin(); digitHCIt != HitCollection.end(); digitHCIt++) {
113  brb::BeamlineDigit in_this_channel;
114  //in_this_channel.SetChannelID((digitHCIt->second).DigitizerChannel);
115  in_this_channel.SetChannelID((*digitIt)->ChannelID());
116  in_this_channel.SetStartTimeInNanoSec((digitHCIt->second).TStartInNanoSec);
117  in_this_channel.SetPeakTimeInNanoSec((digitHCIt->second).TPeakInNanoSec);
118  in_this_channel.SetEndTimeInNanoSec((digitHCIt->second).TStartInNanoSec + (digitHCIt->second).RiseTimeInNanoSec + (digitHCIt->second).FallTimeInNanoSec);
119  in_this_channel.SetPeakADC((digitHCIt->second).AmplitudeInADC);
120 
121  digit_reco->push_back(in_this_channel);
122 
123  // make assn between the reconstructed and raw digits
124  util::CreateAssn(*this, e, *(digit_reco.get()), *digitIt, *(digit_assn.get()), digit_reco->size()-1);
125  }
126  }
127 
128  e.put(std::move(digit_reco));
129  e.put(std::move(digit_assn));
130 }
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.
void SetEndTimeInNanoSec(double time_ns)
void SetPeakTimeInNanoSec(double time_ns)
void SetStartTimeInNanoSec(double time_ns)
unsigned int OnlineDigitChannel(ChannelID channel) const
Online digiziter channel number for this offline ChannelID.
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
LEHitFinder< double > * fLEHitFinderAlg
void SetWaveform(std::vector< uint16_t > &waveform, unsigned int channelNo, uint32_t timestamp)
void SetChannelID(beamlinegeo::ChannelID channel)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
const std::map< T, hit_t< T > > & GetHitCollection() const
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
void SetPeakADC(int adc)
Definition: fwd.h:28
art::ServiceHandle< beamlineutil::BeamlineChannelMap > fChannelMap
size_t size() const
void beamlinereco::LEHitReco::reconfigure ( const fhicl::ParameterSet p)

Definition at line 69 of file LEHitReco_module.cc.

References fLEHitFinderAlg, fLEParamSet, fRawDataLabel, fhicl::ParameterSet::get(), beamlinereco::kADCDynamicRange, beamlinereco::kADCNBits, beamlinereco::kADCOffset, beamlinereco::kConsecutiveHitSeperationDurationInTicks, beamlinereco::kGSFilter, beamlinereco::kGSFilterDegree, beamlinereco::kGSFilterWindow, beamlinereco::kIntergratedWindowFixed, beamlinereco::kIntergratedWindowLowerLimitIndex, beamlinereco::kIntergratedWindowUpperLimitIndex, beamlinereco::kIsWaveformNegativePolarity, beamlinereco::kLEThresholdInNoiseBands, beamlinereco::kNSamplingPoints, beamlinereco::kRawHitFinderThresholdInNoiseSigma, beamlinereco::kShortRawHitIgnoringDurationInTicks, beamlinereco::kTimeSamplingInterval, and beamlinereco::LEHitFinder< T >::SetParams().

Referenced by LEHitReco().

69  {
70  fRawDataLabel = p.get<art::InputTag>("RawDataLabel");
71 
72  fLEParamSet[kADCNBits] = p.get<double>("valADCNBits");
73  fLEParamSet[kADCDynamicRange] = p.get<double>("valADCDynamicRange");
74  fLEParamSet[kADCOffset] = p.get<double>("valADCOffset");
75  fLEParamSet[kTimeSamplingInterval] = p.get<double>("valTimeSamplingInterval");
76  fLEParamSet[kNSamplingPoints] = p.get<double>("valNSamplingPoints");
77  fLEParamSet[kIsWaveformNegativePolarity] = p.get<bool> ("valIsWaveformNegativePolarity");
78  fLEParamSet[kLEThresholdInNoiseBands] = p.get<double>("valLEThresholdInNoiseBands");
79  fLEParamSet[kRawHitFinderThresholdInNoiseSigma] = p.get<double>("valRawHitFinderThresholdInNoiseSigma");
80  fLEParamSet[kShortRawHitIgnoringDurationInTicks] = p.get<double>("valShortRawHitIgnoringDurationInTicks");
81  fLEParamSet[kConsecutiveHitSeperationDurationInTicks] = p.get<double>("valConsecutiveHitSeperationDurationInTicks");
82  fLEParamSet[kGSFilter] = p.get<bool> ("valGSFilter");
83  fLEParamSet[kGSFilterWindow] = p.get<double>("valGSFilterWindow");
84  fLEParamSet[kGSFilterDegree] = p.get<double>("valGSFilterDegree");
85  fLEParamSet[kIntergratedWindowFixed] = p.get<bool> ("valIntergratedWindowFixed");
86  fLEParamSet[kIntergratedWindowLowerLimitIndex] = p.get<double>("valIntergratedWindowLowerLimitIndex");
87  fLEParamSet[kIntergratedWindowUpperLimitIndex] = p.get<double>("valIntergratedWindowUpperLimitIndex");
88 
89  fLEHitFinderAlg = new LEHitFinder<double>();
90  fLEHitFinderAlg->SetParams(fLEParamSet);
91 }
void SetParams(const std::map< LEParams, double > &paramSet)
LEHitFinder< double > * fLEHitFinderAlg
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::map< LEParams, double > fLEParamSet
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

art::ServiceHandle<beamlineutil::BeamlineChannelMap> beamlinereco::LEHitReco::fChannelMap
private

Definition at line 58 of file LEHitReco_module.cc.

Referenced by produce().

LEHitFinder<double>* beamlinereco::LEHitReco::fLEHitFinderAlg
private

Definition at line 53 of file LEHitReco_module.cc.

Referenced by produce(), and reconfigure().

std::map<LEParams, double> beamlinereco::LEHitReco::fLEParamSet
private

Definition at line 55 of file LEHitReco_module.cc.

Referenced by reconfigure().

art::InputTag beamlinereco::LEHitReco::fRawDataLabel
private

Definition at line 54 of file LEHitReco_module.cc.

Referenced by produce(), and reconfigure().


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