Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
febstat::EventFEBStatus Class Reference
Inheritance diagram for febstat::EventFEBStatus:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 EventFEBStatus (fhicl::ParameterSet const &pset)
 
 ~EventFEBStatus ()
 
void ReadEventFile ()
 
void beginJob () override
 
void analyze (const art::Event &evt) override
 
void ClearMapAndVectors ()
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) 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
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

std::string fRawDataLabel
 Module that produced raw digits (to get trigger/event time) More...
 
std::string fCellHitLabel
 Module that produced cell hits. More...
 
std::string fEventFile
 List of run/subrun/event/evt_times. More...
 
double fWindow
 Time window to check before/after event. More...
 
unsigned int fNhitCut
 If # hits on an FEB in fWindow before or after the event time is below this, the feb is marked bad. More...
 
int run
 
int subrun
 
int spillEvent
 Event number of current art event (last event with window in it is the number that goes in the TTree) More...
 
int beamlineEvent
 Event number of corresponding event in Beamline stream (provided in event-list file) More...
 
Double_t spillEvtTime
 Trigger time of current art event. More...
 
Double_t beamlineEvtTime
 Trigger time of corresponding Beamline event. More...
 
std::vector< uint32_t > dcm
 
std::vector< uint32_t > feb
 
std::vector< intnhit_pre
 Number of hits in fWindow before beamline event time. More...
 
std::vector< intnhit_post
 Number of hits in fWindow after beamline event time. More...
 
std::vector< bool > febStatus
 0 if nhit_pre or nhit_post is less than fNhitCut More...
 
std::vector< bool > febShutoffBit
 1 if shutoff bit set prior to event time and FEB recorded no hits after More...
 
bool eventStatus
 0 if any FEB has a status of 0 More...
 
TTree * febshutoff
 
std::set< unsigned intfRuns
 
std::set< std::pair< unsigned int, unsigned int > > fSubRuns
 
std::set< std::tuple< unsigned int, unsigned int, double > > fTimes
 
std::map< double, unsigned intfEventMap
 Map of beamline event time to event number. More...
 
std::map< std::pair< unsigned int, unsigned int >, std::pair< unsigned int, unsigned int > > fFEBhitsNULL
 Null map to set hit count to zero for every FEB. More...
 
std::map< std::pair< unsigned int, unsigned int >, std::pair< unsigned int, unsigned int > > fFEBhits
 Map of hits counts before and after event for each dcm,feb combination. More...
 
std::map< std::pair< unsigned int, unsigned int >, std::pair< bool, double > > fShutoffMapNULL
 Null map to reset shutoff state for every FEB. More...
 
std::map< std::pair< unsigned int, unsigned int >, std::pair< bool, double > > fShutoffMap
 Map of shutoff status and last hit time for each dcm,feb combination. More...
 
bool completePre
 Have we looked at the full fWindow before the event? More...
 
bool completePost
 Have we looked at the full fWindow after the event? More...
 

Detailed Description

Definition at line 41 of file EventFEBStatus_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

febstat::EventFEBStatus::EventFEBStatus ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 98 of file EventFEBStatus_module.cc.

References ReadEventFile().

99  : EDAnalyzer(pset),
100  fRawDataLabel(pset.get<std::string>("RawDataLabel")),
101  fCellHitLabel(pset.get<std::string>("CellHitLabel")),
102  fEventFile(pset.get<std::string>("EventFile")),
103  fWindow(pset.get<double>("Window")),
104  fNhitCut(pset.get<unsigned int>("NhitCut"))
105  {
106  ReadEventFile();
107  }
double fWindow
Time window to check before/after event.
std::string fEventFile
List of run/subrun/event/evt_times.
std::string fCellHitLabel
Module that produced cell hits.
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
unsigned int fNhitCut
If # hits on an FEB in fWindow before or after the event time is below this, the feb is marked bad...
std::string fRawDataLabel
Module that produced raw digits (to get trigger/event time)
enum BeamMode string
febstat::EventFEBStatus::~EventFEBStatus ( )

Definition at line 111 of file EventFEBStatus_module.cc.

112  {
113  }

Member Function Documentation

void febstat::EventFEBStatus::analyze ( const art::Event evt)
override

Definition at line 225 of file EventFEBStatus_module.cc.

References abs(), beamlineEvent, beamlineEvtTime, ClearMapAndVectors(), visualisationForPaperMasterPlot::cmap, completePost, completePre, novadaq::timeutils::convertNovaTimeToUnixTime(), confusionMatrixTree::count, rawdata::RawDigit::DaqChannel(), dcm, DEFINE_ART_MODULE(), release_diff::diff, e, art::Event::event(), eventStatus, fCellHitLabel, feb, febshutoff, febShutoffBit, febStatus, fEventMap, fFEBhits, rawdata::RawDigit::fFEBStatus, fNhitCut, fRawDataLabel, fShutoffMap, fSubRuns, fTimes, rawdata::RawTrigger::fTriggerTimingMarker_TimeStart, fWindow, art::DataViewImpl::getByLabel(), daqchannelmap::DAQChannelMap::getDCM(), daqchannelmap::DAQChannelMap::getFEB(), make_pair(), cmap::dataprov::CMap::Map(), nhit_post, nhit_pre, art::Event::run(), spillEvent, spillEvtTime, subrun, art::Event::subRun(), msf_helper::timespec, and rb::CellHit::TNS().

227 {
228  bool inlist = false;
229  // Is this run/subrun pair in the list?
230  inlist = fSubRuns.count(std::make_pair(evt.run(), evt.subRun()));
231 
232  // Skip the event if the run, subrun pair is not in the list
233  if(!inlist){
234  return;
235  }
236 
237  run = evt.run();
238  subrun = evt.subRun();
239  spillEvent = evt.event();
240 
241  // Load services
243 
244  // Get trigger time
246  evt.getByLabel(fRawDataLabel, trigs);
247  const rawdata::RawTrigger trig = trigs->at(0);
248 
249  struct timespec unixTime;
251  unsigned long int unixTimeSec = unixTime.tv_sec;
252  unsigned long int unixTimeNanoSec = unixTime.tv_nsec;
253  spillEvtTime = unixTimeSec + (1e-9)*unixTimeNanoSec;
254 
255  // Check event list for first time after current trigger time (first time potentially contained within event)
256  std::set< std::tuple<unsigned int, unsigned int, double> >::iterator setIt
257  = fTimes.lower_bound(std::make_tuple(run,subrun,spillEvtTime));
258  beamlineEvtTime = std::get<2>(*setIt);
259  //bound functiion will only find *next* time in list. Check previous time to see if diff is closer.
260  setIt--;
261  double beamlineEvtTime_prev = std::get<2>(*setIt);
262  double diff = beamlineEvtTime - spillEvtTime;
263  double diff2 = beamlineEvtTime_prev - spillEvtTime;
264  if (abs(diff2)<abs(diff)){
265  beamlineEvtTime = beamlineEvtTime_prev;
266  diff = diff2;
267  }
268  // Skip event if it does not contain any of window of interest
269  //if ( (diff-fWindow<0 || diff-fWindow>0.2) && (diff+fWindow<0 || diff+fWindow>0.2) )
270  // Need to keep longer before for shutfoff bit stuff
271  if ( (diff-0.11<0 || diff-0.11>0.2) && (diff+fWindow<0 || diff+fWindow>0.2) )
272  return;
273 
274  // Lookup beamline event number in event map using beamline event time
275  beamlineEvent = fEventMap.find(beamlineEvtTime)->second;
276 
277  // Check if you have the full time window of interest yet
278  if (!completePre && spillEvtTime < (beamlineEvtTime-fWindow) ){
279  completePre = true;
280  }
281  if (!completePost && (spillEvtTime + 0.2) > (beamlineEvtTime+fWindow) ) {
282  completePost = true;
283  }
284 
285  // Get CellHits
287  evt.getByLabel(fCellHitLabel,cellhits);
288  double hitTimePrev = 0;
289  for (unsigned int hitIdx=0; hitIdx<cellhits->size(); ++hitIdx){
290  art::Ptr<rb::CellHit> ihit(cellhits,hitIdx);
291  uint32_t dchan = ihit->DaqChannel();
292  unsigned int dcmId = cmap->Map()->getDCM(dchan);
293  unsigned int febId = cmap->Map()->getFEB(dchan);
294  double hitTime = spillEvtTime + ihit->TNS()*1e-9;
295 
296 
297  // Check for FEB shutoff in 110 ms before event
298  if ( (beamlineEvtTime - hitTime) < 0.110 && (beamlineEvtTime - hitTime) > 0 ) {
299  uint8_t febStatusNano = ihit->fFEBStatus;
300  hitTimePrev = fShutoffMap.at(std::make_pair(dcmId,febId)).second;
301  if ( febStatusNano == 32) {
302  //std::cout<<std::fixed<<"Shutoff detected. dcm: "<<dcmId<<" feb: "<<febId<<" hitTime: "<<hitTime<<std::endl;
303  fShutoffMap.at(std::make_pair(dcmId,febId)).first = true;
304  fShutoffMap.at(std::make_pair(dcmId,febId)).second = hitTime;
305  }
306  else if (febStatusNano == 48 && hitTime > hitTimePrev ) {
307  //if (fShutoffMap.at(std::make_pair(dcmId,febId)).first)
308  //std::cout<<std::fixed<<"Hits after shutoff. dcm: "<<dcmId<<" feb: "<<febId<<" hitTime: "<<hitTime<<std::endl;
309  fShutoffMap.at(std::make_pair(dcmId,febId)).first = false;
310  fShutoffMap.at(std::make_pair(dcmId,febId)).second = hitTime;
311  }
312  }
313 
314  // count hits for fWindow before
315  if ( (beamlineEvtTime - hitTime) < fWindow && (beamlineEvtTime - hitTime) > 0 ) {
316  fFEBhits.at(std::make_pair(dcmId,febId)).first++;
317  }
318  // count hits for fWindow after
319  else if ( (hitTime - beamlineEvtTime) < fWindow && (hitTime - beamlineEvtTime) > 0 ) {
320  fFEBhits.at(std::make_pair(dcmId,febId)).second++;
321  }
322 
323  } // end loop over cellhits
324 
325 
326  // Fill tree if we have information from the full window and reset map to zeroes
327  if (completePre && completePost) {
328 
329  // Iterate over map and fill nhit stuff, including boolean of good/bad feb
330  for (auto &mapIt: fFEBhits) {
331  dcm.push_back((mapIt.first).first);
332  feb.push_back((mapIt.first).second);
333  nhit_pre.push_back((mapIt.second).first);
334  nhit_post.push_back((mapIt.second).second);
335  if ( (mapIt.second).first > fNhitCut && (mapIt.second).second > fNhitCut )
336  febStatus.push_back(1);
337  else
338  febStatus.push_back(0);
339  } // end loop over map
340 
341  // Iterate over shutoff bit map and fill
342  for (auto &mapIt: fShutoffMap) {
343  febShutoffBit.push_back((mapIt.second).first);
344  }
345 
346  if (std::count(febStatus.begin(), febStatus.end(), true) == 126)
347  eventStatus = 1;
348  else
349  eventStatus = 0;
350 
351  febshutoff->Fill();
353 
354  } // end filling tree
355 
356  } // end analyze
SubRunNumber_t subRun() const
Definition: Event.h:72
double fWindow
Time window to check before/after event.
std::vector< bool > febShutoffBit
1 if shutoff bit set prior to event time and FEB recorded no hits after
std::vector< uint32_t > feb
Double_t spillEvtTime
Trigger time of current art event.
const daqchannelmap::DAQChannelMap * Map() const
Definition: CMap.h:57
void abs(TH1 *hist)
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
std::string fCellHitLabel
Module that produced cell hits.
bool convertNovaTimeToUnixTime(uint64_t const &inputNovaTime, struct timespec &outputUnixTime)
std::vector< uint32_t > dcm
std::vector< int > nhit_pre
Number of hits in fWindow before beamline event time.
std::map< std::pair< unsigned int, unsigned int >, std::pair< unsigned int, unsigned int > > fFEBhits
Map of hits counts before and after event for each dcm,feb combination.
std::set< std::pair< unsigned int, unsigned int > > fSubRuns
EventNumber_t event() const
Definition: Event.h:67
Double_t beamlineEvtTime
Trigger time of corresponding Beamline event.
std::set< std::tuple< unsigned int, unsigned int, double > > fTimes
bool completePost
Have we looked at the full fWindow after the event?
std::map< std::pair< unsigned int, unsigned int >, std::pair< bool, double > > fShutoffMap
Map of shutoff status and last hit time for each dcm,feb combination.
Definition: run.py:1
unsigned int fNhitCut
If # hits on an FEB in fWindow before or after the event time is below this, the feb is marked bad...
bool completePre
Have we looked at the full fWindow before the event?
std::map< double, unsigned int > fEventMap
Map of beamline event time to event number.
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
unsigned long long fTriggerTimingMarker_TimeStart
Definition: RawTrigger.h:38
int beamlineEvent
Event number of corresponding event in Beamline stream (provided in event-list file) ...
int spillEvent
Event number of current art event (last event with window in it is the number that goes in the TTree)...
dcm_id_t getDCM(dchan daqchan) const
Decode the dcm ID from a dchan.
Float_t e
Definition: plot.C:35
uint32_t dchan
< DAQ Channel Map Package
RunNumber_t run() const
Definition: Event.h:77
bool eventStatus
0 if any FEB has a status of 0
std::vector< bool > febStatus
0 if nhit_pre or nhit_post is less than fNhitCut
std::vector< int > nhit_post
Number of hits in fWindow after beamline event time.
std::string fRawDataLabel
Module that produced raw digits (to get trigger/event time)
feb_t getFEB(dchan daqchan) const
Decode the feb id from a dchan.
void febstat::EventFEBStatus::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 186 of file EventFEBStatus_module.cc.

References beamlineEvent, beamlineEvtTime, ClearMapAndVectors(), dcm, eventStatus, feb, febshutoff, febShutoffBit, febStatus, fFEBhitsNULL, fShutoffMapNULL, art::TFileDirectory::make(), make_pair(), nhit_post, nhit_pre, spillEvent, spillEvtTime, and subrun.

187  {
188 
189  // Initialize null map
190  for (unsigned int dcmId=1; dcmId<4; ++dcmId){
191  for (unsigned int febId=0; febId<64; ++febId){
192  if ( (dcmId<3&&(febId==8||febId==24||febId==40||febId==56)) || (dcmId==2&&(febId==47||febId==63)) || (dcmId==3&&febId>7) )
193  continue;
194  fFEBhitsNULL.insert(std::pair <std::pair <unsigned int, unsigned int>, std::pair <unsigned int, unsigned int> >
195  (std::make_pair(dcmId,febId),std::make_pair(0,0)));
196  // Start with assuming all FEBs are shutoff - only set to false if a hit is detected in 110 ms before
197  // This takes care of FEBs that didn't have a single hit during this time and therefore did not report the shutoff bit.
198  fShutoffMapNULL.insert(std::pair <std::pair <unsigned int, unsigned int>, std::pair <bool, double> >
199  (std::make_pair(dcmId,febId),std::make_pair(true,0)));
200  }
201  }
203 
205  febshutoff = tfs->make<TTree>("evts","");
206  febshutoff->Branch("run",&run,"run/I");
207  febshutoff->Branch("subrun",&subrun,"subrun/I");
208  febshutoff->Branch("spillEvent",&spillEvent,"spillEvent/I");
209  febshutoff->Branch("beamlineEvent",&beamlineEvent,"beamlineEvent/I");
210  febshutoff->Branch("dcm",&dcm);
211  febshutoff->Branch("feb",&feb);
212  febshutoff->Branch("spillEvtTime",&spillEvtTime,"spillEvtTime/D");
213  febshutoff->Branch("beamlineEvtTime",&beamlineEvtTime,"beamlineEvtTime/D");
214  febshutoff->Branch("nhit_pre",&nhit_pre);
215  febshutoff->Branch("nhit_post",&nhit_post);
216  febshutoff->Branch("febStatus",&febStatus);
217  febshutoff->Branch("eventStatus",&eventStatus,"eventStatus/O");
218 
219  febshutoff->Branch("febShutoffBit",&febShutoffBit);
220 
221  }
std::vector< bool > febShutoffBit
1 if shutoff bit set prior to event time and FEB recorded no hits after
std::vector< uint32_t > feb
Double_t spillEvtTime
Trigger time of current art event.
std::map< std::pair< unsigned int, unsigned int >, std::pair< bool, double > > fShutoffMapNULL
Null map to reset shutoff state for every FEB.
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
std::vector< uint32_t > dcm
std::vector< int > nhit_pre
Number of hits in fWindow before beamline event time.
Double_t beamlineEvtTime
Trigger time of corresponding Beamline event.
Definition: run.py:1
T * make(ARGS...args) const
int beamlineEvent
Event number of corresponding event in Beamline stream (provided in event-list file) ...
int spillEvent
Event number of current art event (last event with window in it is the number that goes in the TTree)...
std::map< std::pair< unsigned int, unsigned int >, std::pair< unsigned int, unsigned int > > fFEBhitsNULL
Null map to set hit count to zero for every FEB.
bool eventStatus
0 if any FEB has a status of 0
std::vector< bool > febStatus
0 if nhit_pre or nhit_post is less than fNhitCut
std::vector< int > nhit_post
Number of hits in fWindow after beamline event time.
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
void febstat::EventFEBStatus::ClearMapAndVectors ( )

Clear vectors and map that are filled for each beamline event. Since these are filled by beamline event, but this module runs over the spill stream, they should not be cleared after each art event, but rather once we know we have the full window before/after the time of interest.

Definition at line 165 of file EventFEBStatus_module.cc.

References completePost, completePre, dcm, feb, febShutoffBit, febStatus, fFEBhits, fFEBhitsNULL, fShutoffMap, fShutoffMapNULL, nhit_post, and nhit_pre.

Referenced by analyze(), and beginJob().

166  {
167  fFEBhits.clear();
168  // Cleanup vectors
169  dcm.clear();
170  feb.clear();
171  nhit_pre.clear();
172  nhit_post.clear();
173  febStatus.clear();
174  febShutoffBit.clear();
175 
176  // Reset map to zeros and completion flags to false
179  completePre = false;
180  completePost = false;
181 
182  }
std::vector< bool > febShutoffBit
1 if shutoff bit set prior to event time and FEB recorded no hits after
std::vector< uint32_t > feb
std::map< std::pair< unsigned int, unsigned int >, std::pair< bool, double > > fShutoffMapNULL
Null map to reset shutoff state for every FEB.
std::vector< uint32_t > dcm
std::vector< int > nhit_pre
Number of hits in fWindow before beamline event time.
std::map< std::pair< unsigned int, unsigned int >, std::pair< unsigned int, unsigned int > > fFEBhits
Map of hits counts before and after event for each dcm,feb combination.
bool completePost
Have we looked at the full fWindow after the event?
std::map< std::pair< unsigned int, unsigned int >, std::pair< bool, double > > fShutoffMap
Map of shutoff status and last hit time for each dcm,feb combination.
bool completePre
Have we looked at the full fWindow before the event?
std::map< std::pair< unsigned int, unsigned int >, std::pair< unsigned int, unsigned int > > fFEBhitsNULL
Null map to set hit count to zero for every FEB.
std::vector< bool > febStatus
0 if nhit_pre or nhit_post is less than fNhitCut
std::vector< int > nhit_post
Number of hits in fWindow after beamline event time.
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::EDAnalyzer::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
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:35
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::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void febstat::EventFEBStatus::ReadEventFile ( )

Read in beamline event information from text file. File format should be (lines starting with # are ignored):

run subrun event event time

100792 1 3860 1583451706.619207 100792 2 13403 1583452785.790757 100792 5 9158 1583454586.687062 100792 7 11686 1583455849.647850

Definition at line 125 of file EventFEBStatus_module.cc.

References om::cerr, clear, allTimeWatchdog::endl, fEventFile, fEventMap, fRuns, fSubRuns, fTimes, make_pair(), run, string, and subrun.

Referenced by EventFEBStatus().

126  {
127  fRuns. clear();
128  fSubRuns. clear();
129  fTimes. clear();
130  std::ifstream ifs;
131  ifs.open(fEventFile.c_str());
132  if (ifs.is_open()) {
133  while (ifs.good()) {
134  std::string buff;
135  std::getline(ifs, buff);
136  if (buff[0]=='#') continue;
137 
138  int run, subrun, event;
139  double time;
140 
141  sscanf(buff.c_str(), "%d %d %d %lf", &run, &subrun, &event, &time);
142 
143  fRuns.insert(run);
144  fSubRuns.insert(std::make_pair(run, subrun));
145  fEventMap.insert( std::pair<double, unsigned int>(time, event) );
146  fTimes.insert(std::make_tuple(run, subrun, time));
147  } // close while loop
148  ifs.close();
149  } // close input file
150  else {
151  std::cerr << __FILE__ << ":" << __LINE__
152  << " Failed to open file " << fEventFile << " for read"
153  << std::endl;
154  }
155 
156  }
std::string fEventFile
List of run/subrun/event/evt_times.
vector< vector< double > > clear
OStream cerr
Definition: OStream.cxx:7
std::pair< Spectrum *, CheatDecomp * > make_pair(SpectrumLoaderBase &loader_data, SpectrumLoaderBase &loader_mc, HistAxis *axis, Cut *cut, const SystShifts &shift, const Var &wei)
Definition: DataMCLoad.C:336
::xsd::cxx::tree::time< char, simple_type > time
Definition: Database.h:194
std::set< std::pair< unsigned int, unsigned int > > fSubRuns
std::set< std::tuple< unsigned int, unsigned int, double > > fTimes
std::map< double, unsigned int > fEventMap
Map of beamline event time to event number.
std::set< unsigned int > fRuns
enum BeamMode string
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

References string.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited

Definition at line 46 of file EventObserverBase.h.

References art::EventObserverBase::wantAllEvents_.

Referenced by art::RootOutput::RootOutput().

47  {
48  return wantAllEvents_;
49  }
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited

Definition at line 51 of file EventObserverBase.h.

References art::EventObserverBase::selectors_, and art::detail::CachedProducts::wantEvent().

52  {
53  return selectors_.wantEvent(e);
54  }
detail::CachedProducts selectors_
Float_t e
Definition: plot.C:35
bool wantEvent(Event const &)
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }

Member Data Documentation

int febstat::EventFEBStatus::beamlineEvent
private

Event number of corresponding event in Beamline stream (provided in event-list file)

Definition at line 61 of file EventFEBStatus_module.cc.

Referenced by analyze(), and beginJob().

Double_t febstat::EventFEBStatus::beamlineEvtTime
private

Trigger time of corresponding Beamline event.

Definition at line 63 of file EventFEBStatus_module.cc.

Referenced by analyze(), and beginJob().

bool febstat::EventFEBStatus::completePost
private

Have we looked at the full fWindow after the event?

Definition at line 92 of file EventFEBStatus_module.cc.

Referenced by analyze(), and ClearMapAndVectors().

bool febstat::EventFEBStatus::completePre
private

Have we looked at the full fWindow before the event?

Definition at line 91 of file EventFEBStatus_module.cc.

Referenced by analyze(), and ClearMapAndVectors().

std::vector<uint32_t> febstat::EventFEBStatus::dcm
private

Definition at line 64 of file EventFEBStatus_module.cc.

Referenced by analyze(), beginJob(), and ClearMapAndVectors().

bool febstat::EventFEBStatus::eventStatus
private

0 if any FEB has a status of 0

Definition at line 70 of file EventFEBStatus_module.cc.

Referenced by analyze(), and beginJob().

std::string febstat::EventFEBStatus::fCellHitLabel
private

Module that produced cell hits.

Definition at line 53 of file EventFEBStatus_module.cc.

Referenced by analyze().

std::vector<uint32_t> febstat::EventFEBStatus::feb
private

Definition at line 65 of file EventFEBStatus_module.cc.

Referenced by analyze(), beginJob(), and ClearMapAndVectors().

TTree* febstat::EventFEBStatus::febshutoff
private

Definition at line 72 of file EventFEBStatus_module.cc.

Referenced by analyze(), and beginJob().

std::vector<bool> febstat::EventFEBStatus::febShutoffBit
private

1 if shutoff bit set prior to event time and FEB recorded no hits after

Definition at line 69 of file EventFEBStatus_module.cc.

Referenced by analyze(), beginJob(), and ClearMapAndVectors().

std::vector<bool> febstat::EventFEBStatus::febStatus
private

0 if nhit_pre or nhit_post is less than fNhitCut

Definition at line 68 of file EventFEBStatus_module.cc.

Referenced by analyze(), beginJob(), and ClearMapAndVectors().

std::string febstat::EventFEBStatus::fEventFile
private

List of run/subrun/event/evt_times.

Definition at line 54 of file EventFEBStatus_module.cc.

Referenced by ReadEventFile().

std::map< double, unsigned int > febstat::EventFEBStatus::fEventMap
private

Map of beamline event time to event number.

Definition at line 78 of file EventFEBStatus_module.cc.

Referenced by analyze(), and ReadEventFile().

std::map< std::pair<unsigned int, unsigned int> , std::pair<unsigned int, unsigned int> > febstat::EventFEBStatus::fFEBhits
private

Map of hits counts before and after event for each dcm,feb combination.

Definition at line 83 of file EventFEBStatus_module.cc.

Referenced by analyze(), and ClearMapAndVectors().

std::map< std::pair<unsigned int, unsigned int> , std::pair<unsigned int, unsigned int> > febstat::EventFEBStatus::fFEBhitsNULL
private

Null map to set hit count to zero for every FEB.

Definition at line 81 of file EventFEBStatus_module.cc.

Referenced by beginJob(), and ClearMapAndVectors().

unsigned int febstat::EventFEBStatus::fNhitCut
private

If # hits on an FEB in fWindow before or after the event time is below this, the feb is marked bad.

Definition at line 56 of file EventFEBStatus_module.cc.

Referenced by analyze().

std::string febstat::EventFEBStatus::fRawDataLabel
private

Module that produced raw digits (to get trigger/event time)

Definition at line 52 of file EventFEBStatus_module.cc.

Referenced by analyze().

std::set<unsigned int> febstat::EventFEBStatus::fRuns
private

Definition at line 74 of file EventFEBStatus_module.cc.

Referenced by ReadEventFile().

std::map< std::pair<unsigned int, unsigned int>, std::pair<bool, double> > febstat::EventFEBStatus::fShutoffMap
private

Map of shutoff status and last hit time for each dcm,feb combination.

Definition at line 88 of file EventFEBStatus_module.cc.

Referenced by analyze(), and ClearMapAndVectors().

std::map< std::pair<unsigned int, unsigned int>, std::pair<bool, double> > febstat::EventFEBStatus::fShutoffMapNULL
private

Null map to reset shutoff state for every FEB.

Definition at line 86 of file EventFEBStatus_module.cc.

Referenced by beginJob(), and ClearMapAndVectors().

std::set< std::pair<unsigned int, unsigned int> > febstat::EventFEBStatus::fSubRuns
private

Definition at line 75 of file EventFEBStatus_module.cc.

Referenced by analyze(), and ReadEventFile().

std::set< std::tuple<unsigned int, unsigned int, double> > febstat::EventFEBStatus::fTimes
private

Definition at line 76 of file EventFEBStatus_module.cc.

Referenced by analyze(), and ReadEventFile().

double febstat::EventFEBStatus::fWindow
private

Time window to check before/after event.

Definition at line 55 of file EventFEBStatus_module.cc.

Referenced by analyze().

std::vector<int> febstat::EventFEBStatus::nhit_post
private

Number of hits in fWindow after beamline event time.

Definition at line 67 of file EventFEBStatus_module.cc.

Referenced by analyze(), beginJob(), and ClearMapAndVectors().

std::vector<int> febstat::EventFEBStatus::nhit_pre
private

Number of hits in fWindow before beamline event time.

Definition at line 66 of file EventFEBStatus_module.cc.

Referenced by analyze(), beginJob(), and ClearMapAndVectors().

int febstat::EventFEBStatus::run
private
int febstat::EventFEBStatus::spillEvent
private

Event number of current art event (last event with window in it is the number that goes in the TTree)

Definition at line 60 of file EventFEBStatus_module.cc.

Referenced by analyze(), and beginJob().

Double_t febstat::EventFEBStatus::spillEvtTime
private

Trigger time of current art event.

Definition at line 62 of file EventFEBStatus_module.cc.

Referenced by analyze(), and beginJob().

int febstat::EventFEBStatus::subrun
private

Definition at line 59 of file EventFEBStatus_module.cc.

Referenced by analyze(), beginJob(), and ReadEventFile().


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