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

 CFDHitReco (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

CFDHitFinder< double > * fCFDHitFinderAlg
 
art::InputTag fRawDataLabel
 
std::string fInterpolationType
 
std::string fDiscriminationType
 
std::string fFilterType
 
std::map< CFDParams, double > fCFDParamSet
 
art::ServiceHandle< beamlineutil::BeamlineChannelMapfChannelMap
 
art::ServiceHandle< beamlineutil::BeamlineCalibrationfCalibration
 

Detailed Description

Definition at line 46 of file CFDHitReco_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::CFDHitReco::CFDHitReco ( const fhicl::ParameterSet p)
explicit

Definition at line 70 of file CFDHitReco_module.cc.

References reconfigure().

70  {
71  produces<std::vector<brb::BeamlineDigit> >();
72  produces<art::Assns<brb::BeamlineDigit, rawdata::RawBeamlineDigit> >();
73 
74  reconfigure(p);
75 }
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::CFDHitReco::produce ( art::Event e)
overridevirtual

Implements art::EDProducer.

Definition at line 112 of file CFDHitReco_module.cc.

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

112  {
113 
114  std::unique_ptr<std::vector<brb::BeamlineDigit> >
115  digit_reco(new std::vector<brb::BeamlineDigit>);
116  std::unique_ptr<art::Assns<brb::BeamlineDigit, rawdata::RawBeamlineDigit> >
118 
119  // get the raw digits
121  std::vector<art::Ptr<rawdata::RawBeamlineDigit> > rawDigits;
122  if (evt.getByLabel(fRawDataLabel, rawDigitHandle))
123  art::fill_ptr_vector(rawDigits, rawDigitHandle);
124 
125  // run the reco algorithm here
126  for (auto rawDigit : rawDigits) {
127  unsigned int channelNumber = fChannelMap->OnlineDigitChannel(rawDigit->ChannelID());
128  std::vector<uint16_t> waveform = rawDigit->ADCs();
129  uint32_t timestamp = rawDigit->Timestamp();
130 
131  fCFDHitFinderAlg->SetWaveform(waveform, channelNumber, timestamp);
132  fCFDHitFinderAlg->Go();
133  std::map<double, hit_t<double> > HitCollection = fCFDHitFinderAlg->GetHitCollection();
134 
135  double pedestal = fCFDHitFinderAlg->GetPedestal();
136 
137  for (std::map<double, hit_t<double> >::iterator digitHCIt = HitCollection.begin();
138  digitHCIt != HitCollection.end(); digitHCIt++) {
139  brb::BeamlineDigit in_this_channel;
140  in_this_channel.SetChannelID(rawDigit->ChannelID());
141  in_this_channel.SetStartTimeInNanoSec((digitHCIt->second).TStartInNanoSec);
142  in_this_channel.SetPeakTimeInNanoSec((digitHCIt->second).TPeakInNanoSec);
143  in_this_channel.SetEndTimeInNanoSec((digitHCIt->second).TStartInNanoSec +
144  (digitHCIt->second).RiseTimeInNanoSec +
145  (digitHCIt->second).FallTimeInNanoSec);
146  in_this_channel.SetPeakADC((digitHCIt->second).AmplitudeInADC);
147  in_this_channel.SetAmplitudeInADC(abs((digitHCIt->second).AmplitudeInADC - pedestal));
148  in_this_channel.SetAreaInADCNanoSec((digitHCIt->second).IntegratedChargeInADCNanoSec);
149  in_this_channel.SetWidthInNanoSec((digitHCIt->second).WidthInNanoSec);
150 
151  digit_reco->push_back(in_this_channel);
152 
153  // make assn between the reconstructed and raw digits
154  util::CreateAssn(*this, evt, *(digit_reco.get()), rawDigit, *(digit_assn.get()), digit_reco->size()-1);
155  }
156  }
157 
158  evt.put(std::move(digit_reco));
159  evt.put(std::move(digit_assn));
160 }
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.
const std::map< T, hit_t< T > > & GetHitCollection() const
void SetEndTimeInNanoSec(double time_ns)
void SetPeakTimeInNanoSec(double time_ns)
void SetWidthInNanoSec(double width_ns)
void SetStartTimeInNanoSec(double time_ns)
void abs(TH1 *hist)
unsigned int OnlineDigitChannel(ChannelID channel) const
Online digiziter channel number for this offline ChannelID.
void SetAmplitudeInADC(int adc)
CFDHitFinder< double > * fCFDHitFinderAlg
int evt
void SetWaveform(std::vector< uint16_t > &waveform, unsigned int channelNo, uint32_t timestamp)
void SetChannelID(beamlinegeo::ChannelID channel)
const T & GetPedestal() const
art::ServiceHandle< beamlineutil::BeamlineChannelMap > fChannelMap
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
void SetPeakADC(int adc)
void SetAreaInADCNanoSec(double area_adcns)
void beamlinereco::CFDHitReco::reconfigure ( const fhicl::ParameterSet p)

Definition at line 78 of file CFDHitReco_module.cc.

References fCFDHitFinderAlg, fCFDParamSet, fDiscriminationType, fFilterType, fInterpolationType, fRawDataLabel, fhicl::ParameterSet::get(), beamlinereco::kADCDynamicRange, beamlinereco::kADCNBits, beamlinereco::kADCOffset, beamlinereco::kConsecutiveHitSeperationDurationInTicks, beamlinereco::kDiscriminationThreshold, beamlinereco::kGSFilterDegree, beamlinereco::kGSFilterWindow, beamlinereco::kIntergratedWindowFixed, beamlinereco::kIntergratedWindowLowerLimitIndex, beamlinereco::kIntergratedWindowUpperLimitIndex, beamlinereco::kIsWaveformNegativePolarity, beamlinereco::kKalmanFilterGain, beamlinereco::kKalmanFilterMeasurementNoiseCovariance, beamlinereco::kKalmanFilterProcessNoiseCovariance, beamlinereco::kNSamplingPoints, beamlinereco::kRawHitFinderThresholdInNoiseSigma, beamlinereco::kRawHitFinderTicksFromEnd, beamlinereco::kShortRawHitIgnoringDurationInTicks, beamlinereco::kTimeSamplingInterval, beamlinereco::CFDHitFinder< T >::SetParams(), and string.

Referenced by CFDHitReco().

78  {
79  fRawDataLabel = p.get<art::InputTag>("RawDataLabel");
80  fInterpolationType = p.get<std::string>("valInterpolationType");
81  fDiscriminationType = p.get<std::string>("valDiscriminationType");
82  fFilterType = p.get<std::string>("valFilter");
83 
84  fCFDParamSet[kADCNBits] = p.get<double>("valADCNBits");
85  fCFDParamSet[kADCDynamicRange] = p.get<double>("valADCDynamicRange");
86  fCFDParamSet[kADCOffset] = p.get<double>("valADCOffset");
87  fCFDParamSet[kTimeSamplingInterval] = p.get<double>("valTimeSamplingInterval");
88  fCFDParamSet[kNSamplingPoints] = p.get<double>("valNSamplingPoints");
89  fCFDParamSet[kIsWaveformNegativePolarity] = p.get<bool> ("valIsWaveformNegativePolarity");
90  fCFDParamSet[kDiscriminationThreshold] = p.get<double>("valDiscriminationThreshold");
91  fCFDParamSet[kRawHitFinderThresholdInNoiseSigma] = p.get<double>("valRawHitFinderThresholdInNoiseSigma");
92  fCFDParamSet[kRawHitFinderTicksFromEnd] = p.get<double>("valRawHitFinderStopTicksFromEnd");
93  fCFDParamSet[kShortRawHitIgnoringDurationInTicks] = p.get<double>("valShortRawHitIgnoringDurationInTicks");
94  fCFDParamSet[kConsecutiveHitSeperationDurationInTicks] = p.get<double>("valConsecutiveHitSeperationDurationInTicks");
95  fCFDParamSet[kGSFilterWindow] = p.get<double>("valGSFilterWindow");
96  fCFDParamSet[kGSFilterDegree] = p.get<double>("valGSFilterDegree");
97  fCFDParamSet[kKalmanFilterProcessNoiseCovariance] = p.get<double>("valKalmanFilterProcessNoiseCovariance");
98  fCFDParamSet[kKalmanFilterMeasurementNoiseCovariance] = p.get<double>("valKalmanFilterMeasurementNoiseCovariance");
99  fCFDParamSet[kKalmanFilterGain] = p.get<double>("valKalmanFilterGain");
100  fCFDParamSet[kIntergratedWindowFixed] = p.get<bool> ("valIntergratedWindowFixed");
101  fCFDParamSet[kIntergratedWindowLowerLimitIndex] = p.get<double>("valIntergratedWindowLowerLimitIndex");
102  fCFDParamSet[kIntergratedWindowUpperLimitIndex] = p.get<double>("valIntergratedWindowUpperLimitIndex");
103 
104  fCFDHitFinderAlg = new CFDHitFinder<double>();
105  fCFDHitFinderAlg->SetParams(fCFDParamSet);
106  fCFDHitFinderAlg->SetInterpolationType(fInterpolationType);
107  fCFDHitFinderAlg->SetDiscriminationType(fDiscriminationType);
108  fCFDHitFinderAlg->SetFilterType(fFilterType);
109 }
CFDHitFinder< double > * fCFDHitFinderAlg
void SetParams(const std::map< CFDParams, double > &paramSet)
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::map< CFDParams, double > fCFDParamSet
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

art::ServiceHandle<beamlineutil::BeamlineCalibration> beamlinereco::CFDHitReco::fCalibration
private

Definition at line 65 of file CFDHitReco_module.cc.

CFDHitFinder<double>* beamlinereco::CFDHitReco::fCFDHitFinderAlg
private

Definition at line 55 of file CFDHitReco_module.cc.

Referenced by produce(), and reconfigure().

std::map<CFDParams, double> beamlinereco::CFDHitReco::fCFDParamSet
private

Definition at line 61 of file CFDHitReco_module.cc.

Referenced by reconfigure().

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

Definition at line 64 of file CFDHitReco_module.cc.

Referenced by produce().

std::string beamlinereco::CFDHitReco::fDiscriminationType
private

Definition at line 58 of file CFDHitReco_module.cc.

Referenced by reconfigure().

std::string beamlinereco::CFDHitReco::fFilterType
private

Definition at line 59 of file CFDHitReco_module.cc.

Referenced by reconfigure().

std::string beamlinereco::CFDHitReco::fInterpolationType
private

Definition at line 57 of file CFDHitReco_module.cc.

Referenced by reconfigure().

art::InputTag beamlinereco::CFDHitReco::fRawDataLabel
private

Definition at line 56 of file CFDHitReco_module.cc.

Referenced by produce(), and reconfigure().


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