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

 DQSpillFlags (fhicl::ParameterSet const &pset)
 
virtual ~DQSpillFlags ()
 
void produce (art::Event &evt)
 
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 FillCountVars (sumdata::EventQuality *spillqual, const std::vector< rb::CellHit > &chits) const
 
void FillSyncVars (sumdata::EventQuality *spillqual, const std::vector< rb::Cluster > &slices, const std::vector< rb::Track > &tracks) const
 
void FillRawVars (sumdata::EventQuality *spillqual, const rawdata::DAQHeader &daqheader)
 
void FillPopulatedDCMs (const rb::Cluster &clust, std::set< DCMId > &pop) const
 
void AccumulateSyncMetric (const rb::Cluster &clust, const std::set< DCMId > &pop, int &nedge, int &nmatch) const
 
CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Protected Attributes

std::string fCellHitLabel
 Label for cell hits. More...
 
std::string fSliceLabel
 Label for slices. More...
 
std::string fTrackLabel
 Label for tracks. More...
 
std::string fRawDataLabel
 Label for raw data. More...
 
bool fTrackSyncMetric
 Use track hits rather than all hits. More...
 
double fTimeLow
 Hit time of beam trigger window low end. More...
 
double fTimeHigh
 Hit time of beam trigger window high end. More...
 
unsigned int fNoisyHitMin
 Miniumum number of hits to be considered a noisy APD. More...
 

Detailed Description

Definition at line 53 of file DQSpillFlags_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

dqsf::DQSpillFlags::DQSpillFlags ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 91 of file DQSpillFlags_module.cc.

References fhicl::ParameterSet::get(), and string.

92  {
93  fCellHitLabel = pset.get< std::string >("CellHitLabel");
94  fSliceLabel = pset.get< std::string >("SliceLabel");
95  fTrackLabel = pset.get< std::string >("TrackLabel");
96  fRawDataLabel = pset.get< std::string >("RawDataLabel");
97  fTrackSyncMetric = pset.get< bool >("TrackSyncMetric");
98  fTimeLow = pset.get< double >("TimeLow");
99  fTimeHigh = pset.get< double >("TimeHigh");
100  fNoisyHitMin = pset.get< int >("NoisyHitMin");
101 
102  produces< sumdata::EventQuality >();
103  }
std::string fTrackLabel
Label for tracks.
std::string fSliceLabel
Label for slices.
std::string fRawDataLabel
Label for raw data.
double fTimeHigh
Hit time of beam trigger window high end.
bool fTrackSyncMetric
Use track hits rather than all hits.
unsigned int fNoisyHitMin
Miniumum number of hits to be considered a noisy APD.
double fTimeLow
Hit time of beam trigger window low end.
std::string fCellHitLabel
Label for cell hits.
enum BeamMode string
dqsf::DQSpillFlags::~DQSpillFlags ( )
virtual

Definition at line 106 of file DQSpillFlags_module.cc.

107  {
108  }

Member Function Documentation

void dqsf::DQSpillFlags::AccumulateSyncMetric ( const rb::Cluster clust,
const std::set< DCMId > &  pop,
int nedge,
int nmatch 
) const
protected

Definition at line 335 of file DQSpillFlags_module.cc.

References rb::CellHit::Cell(), rb::Cluster::Cell(), dir, dqsf::Edges::flag, it, dqsf::kDown, findDuplicateFiles::key, dqsf::kLeft, dqsf::kRight, dqsf::kUp, dqsf::Move(), rb::Cluster::NCell(), dqsf::Opposite(), rb::CellHit::Plane(), febshutoff_auto::val, and rb::CellHit::View().

338  {
339  std::map<DCMId, Edges> edges;
340 
341  for(unsigned int chitIdx = 0; chitIdx < clust.NCell(); ++chitIdx){
342  art::Ptr<rb::CellHit> chit = clust.Cell(chitIdx);
343 
344  const int modplane = chit->Plane() % 64;
345  const int modcell = chit->Cell() % 64;
346 
347  const int dcmx = chit->Plane() / 64;
348  const int dcmy = chit->Cell() / 64;
349 
350  const DCMId key(chit->View(), dcmx, dcmy);
351 
352  if(modplane == 0 || modplane == 1) edges[key].flag[kLeft] = true;
353  if(modplane == 62 || modplane == 63) edges[key].flag[kRight] = true;
354  if(modcell == 0) edges[key].flag[kDown] = true;
355  if(modcell == 63) edges[key].flag[kUp] = true;
356  } // end for chitIdx
357 
358  // Make a copy because [] access to edges in the loop below might mutate
359  // what we're looping over?
360  std::map<DCMId, Edges> edges_it = edges;
361 
362  for(auto it: edges_it){
363  const DCMId key = it.first;
364  const Edges val = it.second;
365 
366  for(Dir dir: {kLeft, kRight, kUp, kDown}){
367  if(!val.flag[dir]) continue;
368 
369  const DCMId nei = Move(key, dir);
370  // Only count if the neighbouring DCM has hits at all
371  if(!pop.count(nei)) continue;
372 
373  if(edges[nei].flag[Opposite(dir)]){
374  ++nedge;
375  ++nmatch;
376  }
377  else{
378  // If there's no match, count two chances, because a good match
379  // will have been counted from both sides.
380  nedge += 2;
381  }
382  } // end for dir
383  } // end for it
384  }
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
set< int >::iterator it
unsigned short Plane() const
Definition: CellHit.h:39
geo::View_t View() const
Definition: CellHit.h:41
unsigned short Cell() const
Definition: CellHit.h:40
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
Definition: Cluster.cxx:145
TDirectory * dir
Definition: macro.C:5
DCMId Move(DCMId dcm, Dir d)
Dir Opposite(Dir d)
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 dqsf::DQSpillFlags::FillCountVars ( sumdata::EventQuality spillqual,
const std::vector< rb::CellHit > &  chits 
) const
protected

Definition at line 153 of file DQSpillFlags_module.cc.

References febshutoff_auto::apd, getBrightness::cell, febshutoff_auto::db, febshutoff_auto::dcm, geo::GeometryBase::DetId(), daqchannelmap::DAQChannelMap::encodeDChan(), geo::GeometryBase::FirstPlaneInMuonCatcher(), check_time_usage::float, sumdata::EventQuality::fracdcm3hits, geom(), daqchannelmap::DAQChannelMap::getDCM(), daqchannelmap::DAQChannelMap::getDiBlock(), daqchannelmap::DAQChannelMap::getDiBlockType(), daqchannelmap::DAQChannelMap::getFEB(), daqchannelmap::DAQChannelMap::getNumberOfDCM(), daqchannelmap::DAQChannelMap::getTotalNumberOfDiblocks(), makeTrainCVSamples::int, novadaq::cnv::kNEARDET, geo::kY, geo::LiveGeometry::NDropouts(), sumdata::EventQuality::nmissingdcms, sumdata::EventQuality::nmissingdcmslg, sumdata::EventQuality::nnoisyapds, and sumdata::EventQuality::nouttimehits.

155  {
159 
160  unsigned int horizhits = 0; // All hits for horizontal modules
161  unsigned int ndcm3hits = 0; // DCM3 hits for horizontal modules
162 
163  unsigned int ncells_outtime = 0; // # of cells in out-beam-windomw
164 
165  // Chosen an arbitrary diblock/dcm/feb/pixel to encode a dchan in
166  // order to get diblock type (instead of hardcoding). This allows
167  // one to set the max total dcm value for either ND or FD
168  const daqchannelmap::dchan dchan = cmap->encodeDChan(geom->DetId(), 1, 1, 0, 0);
169  const daqchannelmap::DiBlock_TYPE db_t = cmap->getDiBlockType(dchan);
170 
171  // Irrespective of ND Muon Catcher, this sets max number of DCM within
172  // detector diblock to set limits on loop over DCMs later on
173  const unsigned int totdcm = cmap->getNumberOfDCM(db_t);
174  const unsigned int totdb = cmap->getTotalNumberOfDiblocks();
175 
176  std::vector<std::vector<unsigned int> > ndcmhits(totdb);
177  for(auto & itr : ndcmhits) itr.resize(totdcm, 0);
178 
179  std::map< unsigned int,
180  std::map<unsigned int, unsigned int> > dbapdmap; // Map of diblock/APD/nhits
181 
182  for(const rb::CellHit& chit: chits){
183 
184  const unsigned int dcm = cmap->getDCM(chit.DaqChannel());
185  const unsigned int db = cmap->getDiBlock(chit.DaqChannel());
186  const unsigned int apd = cmap->getFEB(chit.DaqChannel());
187  // Offset by 1 as db and dcm accounting starts at 1
188  ++ndcmhits[db-1][dcm-1];
189 
190  // Only look at hits outside of beam window
191  if(chit.TNS() < fTimeLow || chit.TNS() > fTimeHigh ){
192  ++ncells_outtime; // total number of cells out of time
193 
194  // Cells 95, 87, 79 and 71 in Y-view in ND are impacted by
195  // lights on the catwalk. See K. Sachdev doc-db 12426
196  if(geom->DetId() == novadaq::cnv::kNEARDET &&
197  chit.Plane() < geom->FirstPlaneInMuonCatcher() &&
198  chit.View() == geo::kY){
199  ++horizhits;
200  int cell = chit.Cell();
201  if(cell == 95 || cell == 87 || cell == 79 || cell == 71)
202  ++ndcm3hits;
203  } // DB horizontal plane only, excluding Muon Catcher
204 
205  // count number of hits for each apd into ndbapd map
206  ++dbapdmap[db][apd];
207  } // outside beam window
208  } // end loop over all hits
209 
210  unsigned int ndeaddcms = 0;
211 
212  // Loop over di-blocks
213  for(unsigned int dbIdx = 0; dbIdx < totdb; ++dbIdx){
214  if(geom->DetId() == novadaq::cnv::kNEARDET && (dbIdx < (totdb-1))){
215  for(unsigned int dcmIdx = 0; dcmIdx < totdcm; ++dcmIdx){
216  if(ndcmhits[dbIdx][dcmIdx] == 0) ndeaddcms++;
217  }
218  } // end loop for ND minus Muon Catcher
219  else if(geom->DetId() != novadaq::cnv::kNEARDET){
220  for(unsigned int dcmIdx = 0; dcmIdx < totdcm; ++dcmIdx){
221  if(ndcmhits[dbIdx][dcmIdx] == 0) ++ndeaddcms;
222  }
223  } // end loop for NOT ND
224  } // end loop over diblocks
225  // Special case for the 2 Near Det Muon Catcher DCMS
226  if(geom->DetId() == novadaq::cnv::kNEARDET){
227  for(unsigned int dcmIdx = 0; dcmIdx < 2; ++dcmIdx){
228  if(ndcmhits[totdb-1][dcmIdx] == 0) ++ndeaddcms;
229  } // end loop for ND Muon Catcher DCMs
230  } // end loop for ND
231 
232  // Calculate fraction of partial DCM3 hits in horizontal modules to
233  // detect lights-on effect in ND
234  float filter_lightson = 0.; // fraction of partial DCM3 hits in horizontal modules
235  if(horizhits > 0) filter_lightson = float(ndcm3hits)/horizhits;
236 
237  // Noisy APD if it has at least fNoisyHitMin hits.
238  // Original value of fNoisyHitMin = 28 for ND
239  // See X. Bu doc-db 12316
240  // Total number of noisy apd in ND
241  int napd_hitmin_tot = 0;
242 
243  if(geom->DetId() == novadaq::cnv::kNEARDET){
244  for(const auto dbItr : dbapdmap){
245  for(const auto apdItr : dbItr.second){
246  if(apdItr.second > fNoisyHitMin) napd_hitmin_tot++;
247  } // end loop APD/Value pair
248  } // end loop dbapdmap
249  } //end detector check
250 
251  //save the values for dq flags
252  spillqual->nmissingdcmslg = livegeom->NDropouts();
253  spillqual->nmissingdcms = ndeaddcms;
254  spillqual->fracdcm3hits = filter_lightson;
255  spillqual->nouttimehits = ncells_outtime;
256  spillqual->nnoisyapds = napd_hitmin_tot;
257  }
int nouttimehits
of out-beam-window hits
Definition: EventQuality.h:25
virtual unsigned int getNumberOfDCM(DiBlock_TYPE dbt) const =0
How many DCMs does this diblock have?
double fTimeHigh
Hit time of beam trigger window high end.
int nmissingdcms
of missing DCMs
Definition: EventQuality.h:23
Horizontal planes which measure Y.
Definition: PlaneGeo.h:29
double fracdcm3hits
fraction of DCM3 hits in horizontal modules
Definition: EventQuality.h:24
virtual unsigned int getTotalNumberOfDiblocks() const =0
How many diblocks does the detector have?
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
Near Detector in the NuMI cavern.
A rawdata::RawDigit with channel information decoded.
Definition: CellHit.h:27
void geom(int which=0)
Definition: geom.C:163
cmap::CMap class source code
Definition: CMap.cxx:17
dcm_id_t getDCM(dchan daqchan) const
Decode the dcm ID from a dchan.
dchan encodeDChan(int detID, diblock_t diblock, dcm_id_t dcm, feb_t feb, pixel_t pixel) const
DiBlock_TYPE
Types of Diblock.
uint32_t dchan
< DAQ Channel Map Package
unsigned int fNoisyHitMin
Miniumum number of hits to be considered a noisy APD.
double fTimeLow
Hit time of beam trigger window low end.
int nnoisyapds
of noisy APDs
Definition: EventQuality.h:26
diblock_t getDiBlock(dchan daqchan) const
Decode the diblock ID from a dchan.
virtual DiBlock_TYPE getDiBlockType(dchan chan) const =0
What format is the diblock? Only relevant in NDOS.
feb_t getFEB(dchan daqchan) const
Decode the feb id from a dchan.
const unsigned int FirstPlaneInMuonCatcher() const
Returns the index of the first plane contained in the muon catcher.
void dqsf::DQSpillFlags::FillPopulatedDCMs ( const rb::Cluster clust,
std::set< DCMId > &  pop 
) const
protected

Definition at line 321 of file DQSpillFlags_module.cc.

References rb::CellHit::Cell(), rb::Cluster::Cell(), dqsf::DCMId::DCMId(), rb::Cluster::NCell(), rb::CellHit::Plane(), and rb::CellHit::View().

323  {
324  for(unsigned int chitIdx = 0; chitIdx < clust.NCell(); ++chitIdx){
325  art::Ptr<rb::CellHit> chit = clust.Cell(chitIdx);
326 
327  const int dcmx = chit->Plane() / 64;
328  const int dcmy = chit->Cell() / 64;
329 
330  pop.insert(DCMId(chit->View(), dcmx, dcmy));
331  }
332  }
unsigned int NCell(geo::View_t view) const
Number of cells in view view.
Definition: Cluster.cxx:134
unsigned short Plane() const
Definition: CellHit.h:39
geo::View_t View() const
Definition: CellHit.h:41
unsigned short Cell() const
Definition: CellHit.h:40
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
Definition: Cluster.cxx:145
void dqsf::DQSpillFlags::FillRawVars ( sumdata::EventQuality spillqual,
const rawdata::DAQHeader daqheader 
)
protected

Definition at line 387 of file DQSpillFlags_module.cc.

References DEFINE_ART_MODULE(), sumdata::EventQuality::nmicroslices, and rawdata::DAQHeader::TotalMicroSlices().

389  {
390  spillqual->nmicroslices = daqheader.TotalMicroSlices();
391  }//end for FillRawVars
int TotalMicroSlices() const
Definition: DAQHeader.h:27
int nmicroslices
of micro slices
Definition: EventQuality.h:27
void dqsf::DQSpillFlags::FillSyncVars ( sumdata::EventQuality spillqual,
const std::vector< rb::Cluster > &  slices,
const std::vector< rb::Track > &  tracks 
) const
protected

Definition at line 260 of file DQSpillFlags_module.cc.

References sumdata::EventQuality::dcmedgematchfrac.

263  {
264  // Which DCMs are populated at all, so we don't penalize at edges and for
265  // missing DCMs (that's a different cut)
266  std::set<DCMId> pop;
267 
268  for(const rb::Cluster& slice: slices) FillPopulatedDCMs(slice, pop);
269 
270  // How many edge crossings we considered
271  int nedge = 0;
272  // How many had a match
273  int nmatch = 0;
274 
275  if(fTrackSyncMetric){
276  for(const rb::Track& track: tracks)
277  AccumulateSyncMetric(track, pop, nedge, nmatch);
278  }
279  else{
280  for(const rb::Cluster& slice: slices){
281  if(!slice.IsNoise()) AccumulateSyncMetric(slice, pop, nedge, nmatch);
282  }
283  }
284 
285  spillqual->dcmedgematchfrac = (nedge ? nmatch/double(nedge) : -1);
286  }
Definition: event.h:19
A collection of associated CellHits.
Definition: Cluster.h:47
A rb::Prong with full reconstructed trajectory.
Definition: Track.h:20
void FillPopulatedDCMs(const rb::Cluster &clust, std::set< DCMId > &pop) const
float dcmedgematchfrac
Low values mean out-of-sync detector.
Definition: EventQuality.h:29
void AccumulateSyncMetric(const rb::Cluster &clust, const std::set< DCMId > &pop, int &nedge, int &nmatch) const
bool fTrackSyncMetric
Use track hits rather than all hits.
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 dqsf::DQSpillFlags::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 111 of file DQSpillFlags_module.cc.

References geo::GeometryBase::DetId(), art::Handle< T >::failedToGet(), geom(), art::DataViewImpl::getByLabel(), novadaq::cnv::kNEARDET, and art::Event::put().

112  {
113  std::unique_ptr<sumdata::EventQuality> spillqual(new sumdata::EventQuality);
114 
116 
117  //get all hits info
119  evt.getByLabel(fCellHitLabel, chits);
120 
123 
125  evt.getByLabel(fRawDataLabel,daqheader);
126  if( !daqheader.failedToGet() )
127  FillRawVars(spillqual.get(),*daqheader);
128 
129  FillCountVars(spillqual.get(), *chits);
130 
131  //skip caclulating FD track sync variables
132  if(geom->DetId() == novadaq::cnv::kNEARDET){
133  evt.put(std::move(spillqual));
134  return; //skip caclulating FD track sync variables
135  }
136 
137  evt.getByLabel(fSliceLabel, slices);
138 
139  if(fTrackSyncMetric) evt.getByLabel(fTrackLabel, tracks);
140 
141  if(fTrackSyncMetric)
142  FillSyncVars(spillqual.get(), *slices, *tracks);
143  else
144  FillSyncVars(spillqual.get(), *slices, {});
145 
146 
147  //save info to event tree
148  evt.put(std::move(spillqual));
149 
150  }//end event loop
std::string fTrackLabel
Label for tracks.
std::string fSliceLabel
Label for slices.
std::string fRawDataLabel
Label for raw data.
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
void FillRawVars(sumdata::EventQuality *spillqual, const rawdata::DAQHeader &daqheader)
novadaq::cnv::DetId DetId() const
Prefer ds::DetectorService::DetId() instead.
Definition: GeometryBase.h:243
Near Detector in the NuMI cavern.
void FillCountVars(sumdata::EventQuality *spillqual, const std::vector< rb::CellHit > &chits) const
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
void geom(int which=0)
Definition: geom.C:163
bool fTrackSyncMetric
Use track hits rather than all hits.
std::string fCellHitLabel
Label for cell hits.
bool failedToGet() const
Definition: Handle.h:196
void FillSyncVars(sumdata::EventQuality *spillqual, const std::vector< rb::Cluster > &slices, const std::vector< rb::Track > &tracks) const
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 dqsf::DQSpillFlags::fCellHitLabel
protected

Label for cell hits.

Definition at line 77 of file DQSpillFlags_module.cc.

unsigned int dqsf::DQSpillFlags::fNoisyHitMin
protected

Miniumum number of hits to be considered a noisy APD.

Definition at line 86 of file DQSpillFlags_module.cc.

std::string dqsf::DQSpillFlags::fRawDataLabel
protected

Label for raw data.

Definition at line 80 of file DQSpillFlags_module.cc.

std::string dqsf::DQSpillFlags::fSliceLabel
protected

Label for slices.

Definition at line 78 of file DQSpillFlags_module.cc.

double dqsf::DQSpillFlags::fTimeHigh
protected

Hit time of beam trigger window high end.

Definition at line 85 of file DQSpillFlags_module.cc.

double dqsf::DQSpillFlags::fTimeLow
protected

Hit time of beam trigger window low end.

Definition at line 84 of file DQSpillFlags_module.cc.

std::string dqsf::DQSpillFlags::fTrackLabel
protected

Label for tracks.

Definition at line 79 of file DQSpillFlags_module.cc.

bool dqsf::DQSpillFlags::fTrackSyncMetric
protected

Use track hits rather than all hits.

Definition at line 82 of file DQSpillFlags_module.cc.


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