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

 RawDigit2DAQHit (fhicl::ParameterSet const &p)
 
virtual ~RawDigit2DAQHit ()
 
void produce (art::Event &event) 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

void FillDAQHits (art::Handle< std::vector< rawdata::RawDigit > > &RawDigits, std::unique_ptr< std::vector< novaddt::DAQHit > > &DAQHits, unsigned long long event_time)
 
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 fRawDigitLabel
 label of where to find Raw Digits More...
 
std::string fRawTriggerLabel
 label of where to find Raw Triggers More...
 
art::ServiceHandle< novaddt::WaveformProcessorwpr
 

Detailed Description

Definition at line 35 of file RawDigit2DAQHit_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

raw2daq::RawDigit2DAQHit::RawDigit2DAQHit ( fhicl::ParameterSet const &  p)
explicit

Definition at line 53 of file RawDigit2DAQHit_module.cc.

References fRawDigitLabel, fRawTriggerLabel, and art::InEvent.

54  : fRawDigitLabel (p.get< std::string >("RawDigitLabel")),
55  fRawTriggerLabel (p.get< std::string >("RawTriggerLabel"))
56 {
57  // Call appropriate Produces<>() functions here.
58  mf::LogInfo("RawDigit2DAQHit") << "=== raw2daq:::RawDigit2DAQHit instantiate";
59  mf::LogInfo("RawDigit2DAQHit") << "\t RawDigitLabel: " << fRawDigitLabel;
60  mf::LogInfo("RawDigit2DAQHit") << "\t RawTriggerLabel: " << fRawTriggerLabel;
61  produces< std::vector<novaddt::DAQHit>, art::InEvent>();
62 
63 }
std::string fRawTriggerLabel
label of where to find Raw Triggers
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
const char * p
Definition: xmltok.h:285
std::string fRawDigitLabel
label of where to find Raw Digits
enum BeamMode string
raw2daq::RawDigit2DAQHit::~RawDigit2DAQHit ( )
virtual

Definition at line 65 of file RawDigit2DAQHit_module.cc.

66 {
67  // Clean up dynamic memory and other resources here.
68 }

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
void raw2daq::RawDigit2DAQHit::FillDAQHits ( art::Handle< std::vector< rawdata::RawDigit > > &  RawDigits,
std::unique_ptr< std::vector< novaddt::DAQHit > > &  DAQHits,
unsigned long long  event_time 
)
protected

Definition at line 93 of file RawDigit2DAQHit_module.cc.

References rawdata::RawDigit::ADC(), ana::assert(), om::cerr, rawdata::RawDigit::Channel(), visualisationForPaperMasterPlot::cmap, DEFINE_ART_MODULE(), fillBadChanDBTables::det, ds::DetectorService::DetId(), daqchannelmap::DAQChannelMap::encodeDChan(), allTimeWatchdog::endl, novaddt::WaveformProcessor::getADC(), novaddt::WaveformProcessor::getTDC(), cmap::dataprov::CMap::Map(), cet::sqlite::max(), rawdata::RawDigit::NADC(), rh, novaddt::WaveformProcessor::setup(), rawdata::RawDigit::TDC(), and wpr.

Referenced by produce().

97 {
98  const unsigned int nDigits = RawDigits->size();
100 
102  const novadaq::cnv::DetId det = rh->DetId();
103 
104  // loop over digits
105  for(unsigned int iDigit=0; iDigit < nDigits; ++iDigit){
106  const rawdata::RawDigit* digit = &(*RawDigits)[iDigit];
107  const daqchannelmap::lchan channel = digit->Channel();
108  const daqchannelmap::dchan daqchannel = cmap->Map()->encodeDChan(channel);
109 
110  if (digit->NADC() < 4) // use DCS
111  DAQHits->emplace_back(det,
112  daqchannel,
113  novaddt::ADC(digit->ADC()),
114  novaddt::TDC(digit->TDC() + event_time));
115 
116  else { // using WaveformProcessor
117  novaddt::TDC theTDC;
118  novaddt::ADC theADC;
119  int16_t adc1 = digit->ADC(1) - digit->ADC(0);
120  int16_t adc2 = digit->ADC(2) - digit->ADC(0);
121  int16_t adc3 = digit->ADC(3) - digit->ADC(0);
122 
123 
124  //
125  // Time Conversion: Offline TDC -> Raw TDC
126  //
127  if (event_time > std::numeric_limits<int64_t>::max())
128  {
129  std::cerr << "\n\tThe event time is too large to fit into int64_t.\n"
130  << std::endl;
131  assert(false);
132  }
133 
134  int32_t offline_tdc = digit->TDC();
135  // This casting of uint64 to int64 is okay because our event time only
136  // goes up to 56 bits and we checked above.
137  int64_t integer_raw_tdc =
138  static_cast<int64_t>(event_time) + static_cast<int64_t>(offline_tdc);
139  unsigned long long raw_tdc = static_cast<unsigned long long>(integer_raw_tdc);
140  uint32_t raw_tdc_low = raw_tdc & 0x00000000FFFFFFFF;
141  unsigned long long raw_tdc_high = raw_tdc >> 32;
142 
143 
144  wpr->setup(raw_tdc_low, raw_tdc_high, adc1, adc2, adc3, digit->ADC());
145 
146  DAQHits->emplace_back(det,
147  daqchannel,
148  wpr->getADC(),
149  wpr->getTDC());
150  }
151  } // end of loop on raw digits
152 }
novadaq::cnv::DetId DetId() const
What detector are we in?
TH2 * rh
Definition: drawXsec.C:5
int32_t TDC() const
The time of the last baseline sample.
Definition: RawDigit.h:94
OStream cerr
Definition: OStream.cxx:7
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
void setup(daqdataformats::RawMicroSlice *theMicro, daqdataformats::RawNanoSlice *theNano)
int16_t ADC(uint32_t i) const
Definition: RawDigit.cxx:58
uint32_t NADC() const
Definition: RawDigit.h:81
uint32_t Channel() const
Definition: RawDigit.h:84
assert(nhit_max >=nhit_nbins)
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
uint32_t dchan
< DAQ Channel Map Package
T max(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:68
art::ServiceHandle< novaddt::WaveformProcessor > wpr
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 raw2daq::RawDigit2DAQHit::produce ( art::Event event)
overridevirtual

Implements art::EDProducer.

Definition at line 70 of file RawDigit2DAQHit_module.cc.

References ana::assert(), FillDAQHits(), fRawDigitLabel, and fRawTriggerLabel.

71 {
72  // Implementation of required member function here.
73  // get the RawDigit list
75  event.getByLabel(fRawDigitLabel, RawDigits);
76  // make a vector to store the DAQHits into
77  std::unique_ptr<std::vector<novaddt::DAQHit> > DAQHits(new std::vector<novaddt::DAQHit>);
78 
79  // Get the raw trigger to get the event time
81  event.getByLabel(fRawTriggerLabel, RawTriggers);
82  // Currently no triggers should be configured to have more than one raw trigger per event
83  // The vector nature is reserved for exotic supernovae triggers
84  assert(RawTriggers->size()==1);
85  unsigned long long event_time = RawTriggers->at(0).fTriggerTimingMarker_TimeStart;
86 
87  // Make a DAQHit for every RawDigit and write it out
88  FillDAQHits(RawDigits, DAQHits, event_time);
89  // add DAQHits into the event
90  event.put(std::move(DAQHits));
91 }
std::string fRawTriggerLabel
label of where to find Raw Triggers
void FillDAQHits(art::Handle< std::vector< rawdata::RawDigit > > &RawDigits, std::unique_ptr< std::vector< novaddt::DAQHit > > &DAQHits, unsigned long long event_time)
std::string fRawDigitLabel
label of where to find Raw Digits
assert(nhit_max >=nhit_nbins)
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 raw2daq::RawDigit2DAQHit::fRawDigitLabel
private

label of where to find Raw Digits

Definition at line 42 of file RawDigit2DAQHit_module.cc.

Referenced by produce(), and RawDigit2DAQHit().

std::string raw2daq::RawDigit2DAQHit::fRawTriggerLabel
private

label of where to find Raw Triggers

Definition at line 43 of file RawDigit2DAQHit_module.cc.

Referenced by produce(), and RawDigit2DAQHit().

art::ServiceHandle<novaddt::WaveformProcessor> raw2daq::RawDigit2DAQHit::wpr
private

Definition at line 44 of file RawDigit2DAQHit_module.cc.

Referenced by FillDAQHits().


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