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

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 LongReadoutAnalyzer (fhicl::ParameterSet const &p)
 
 LongReadoutAnalyzer (LongReadoutAnalyzer const &)=delete
 
 LongReadoutAnalyzer (LongReadoutAnalyzer &&)=delete
 
LongReadoutAnalyzeroperator= (LongReadoutAnalyzer const &)=delete
 
LongReadoutAnalyzeroperator= (LongReadoutAnalyzer &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
void endJob () override
 
void beginRun (art::Run const &r) override
 
void respondToOpenInputFile (const art::FileBlock &fb) override
 
void createDBTables ()
 
void fillDB ()
 
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
 label of where to find RawData More...
 
std::vector< unsigned intfTriggerTypes
 vector of trigger type numbers to check More...
 
TTree * fEvents
 
std::string fFileName
 Input filename. More...
 
novadaq::cnv::DetId fDetId
 Detector ID. More...
 
unsigned int fEvt
 Event number. More...
 
unsigned int fEvtRecord
 Event number for this file. More...
 
unsigned int fRun
 Run number. More...
 
unsigned int fSubRun
 Subrun number. More...
 
unsigned long long fTime
 Event timestamp. More...
 
unsigned int fNMicroslices
 Number of microslices present. More...
 
unsigned long long fTrigNum
 Trigger number. More...
 
unsigned long long fTrigMasterNum
 Trigger master number. More...
 
unsigned long long fTrigMasterID
 Unique identifier for a given master trigger. More...
 
unsigned int fTrigType
 Numerical trigger type. More...
 
unsigned long long fTrigTimeStart
 NOvA time of trigger. More...
 
unsigned long long fTrigUnixTimeStart
 Unix time of trigger (in ns) More...
 
uint32_t fTrigLength
 Length of trigger (units of 500 nsec) More...
 
int fErrorRegister
 Error register. More...
 
unsigned int fNMicroslicesMin
 Minimum number of microslices to be OK. More...
 
unsigned int fNMicroclicesMax
 Maximum number of microslices to be OK. More...
 
uint32_t fNDroppedMicroBlocks
 Number of dropped microblocks. More...
 
bool fWriteToSQLite3File
 Write to sqlite3 file? More...
 
bool fWriteToROOTFile
 Write to ROOT histogram file? More...
 
std::string fSQLite3FileName
 Name of sqlite3 file. More...
 
std::string fSchemaFileName
 Name of sqlite3 schema file. More...
 
sqlite3 * db
 SQLite3 database object. More...
 
sqlite3_stmt * stmt = 0
 SQLite3 prepared statement container. More...
 

Detailed Description

Definition at line 48 of file LongReadoutAnalyzer_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

trigmon::LongReadoutAnalyzer::LongReadoutAnalyzer ( fhicl::ParameterSet const &  p)
explicit

Definition at line 105 of file LongReadoutAnalyzer_module.cc.

References fWriteToROOTFile.

106  :
107  EDAnalyzer(p),
108  fRawDataLabel(p.get<std::string>("RawDataLabel")),
109  fTriggerTypes(p.get<std::vector<unsigned int>>("TriggerTypes")),
110  fFileName(""),
112  fEvt(0),
113  fRun(0),
114  fSubRun(0),
115  fTime(0),
116  fNMicroslices(0),
117  fTrigNum(0),
118  fTrigMasterNum(0),
119  fTrigMasterID(0),
120  fTrigType(0),
121  fTrigTimeStart(0),
123  fTrigLength(0),
124  fErrorRegister(0),
125  fNMicroslicesMin(p.get<int>("NMicroslicesMin")),
126  fNMicroclicesMax(p.get<int>("NMicroslicesMax")),
128  fWriteToSQLite3File(p.get<bool>("WriteToSQLite3File")),
129  fWriteToROOTFile(p.get<bool>("WriteToROOTFile")),
130  fSQLite3FileName(p.get<std::string>("SQLite3FileName")),
131  fSchemaFileName(p.get<std::string>("SchemaFileName"))
132 {
133  if (fWriteToROOTFile) {
135  }
136 }
unsigned int fNMicroslices
Number of microslices present.
unsigned int fSubRun
Subrun number.
uint32_t fNDroppedMicroBlocks
Number of dropped microblocks.
std::string fRawDataLabel
label of where to find RawData
std::string fFileName
Input filename.
const char * p
Definition: xmltok.h:285
unsigned long long fTrigMasterID
Unique identifier for a given master trigger.
unsigned long long fTime
Event timestamp.
bool fWriteToSQLite3File
Write to sqlite3 file?
unsigned int fTrigType
Numerical trigger type.
uint32_t fTrigLength
Length of trigger (units of 500 nsec)
std::string fSQLite3FileName
Name of sqlite3 file.
bool fWriteToROOTFile
Write to ROOT histogram file?
std::string fSchemaFileName
Name of sqlite3 schema file.
unsigned long long fTrigUnixTimeStart
Unix time of trigger (in ns)
EDAnalyzer(Table< Config > const &config)
Definition: EDAnalyzer.h:100
unsigned int fNMicroclicesMax
Maximum number of microslices to be OK.
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
unsigned long long fTrigMasterNum
Trigger master number.
std::vector< unsigned int > fTriggerTypes
vector of trigger type numbers to check
novadaq::cnv::DetId fDetId
Detector ID.
unsigned long long fTrigTimeStart
NOvA time of trigger.
unsigned long long fTrigNum
Trigger number.
unsigned int fNMicroslicesMin
Minimum number of microslices to be OK.
trigmon::LongReadoutAnalyzer::LongReadoutAnalyzer ( LongReadoutAnalyzer const &  )
delete
trigmon::LongReadoutAnalyzer::LongReadoutAnalyzer ( LongReadoutAnalyzer &&  )
delete

Member Function Documentation

void trigmon::LongReadoutAnalyzer::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 140 of file LongReadoutAnalyzer_module.cc.

References novadaq::timeutils::convertNovaTimeToUnixTime(), om::cout, allTimeWatchdog::endl, art::EventID::event(), fErrorRegister, fEvents, fEvt, fEvtRecord, fillDB(), fNDroppedMicroBlocks, fNMicroclicesMax, fNMicroslices, fRawDataLabel, fRun, fSubRun, fTime, rawdata::RawTrigger::fTriggerHeader_MasterTriggerNumber, rawdata::RawTrigger::fTriggerHeader_TriggerNumber, rawdata::RawTrigger::fTriggerMask_TriggerType, rawdata::RawTrigger::fTriggerRange_TriggerLength, rawdata::RawTrigger::fTriggerTimingMarker_TimeStart, fTriggerTypes, fTrigLength, fTrigMasterID, fTrigMasterNum, fTrigNum, fTrigTimeStart, fTrigType, fTrigUnixTimeStart, fWriteToROOTFile, fWriteToSQLite3File, art::DataViewImpl::getByLabel(), rawdata::DAQUnpack::GetRawEvent(), art::Event::id(), makeTrainCVSamples::int, art::Event::isRealData(), trigmon::kIncompleteEvent, trigmon::kNHitsOutOfRange, art::Event::run(), art::Event::subRun(), art::Event::time(), msf_helper::timespec, and rawdata::DAQHeader::TotalMicroSlices().

141 {
142  // Reset the error register for this event
143  fErrorRegister = 0;
144 
145  /* If this is MC, don't do anything */
146  if (!e.isRealData()) {
147  mf::LogWarning("EventIsMC") << "This event is not real data. Skipping...";
148  return;
149  }
150 
151 
152  /* Get some basic info from the event */
153  fEvt = e.id().event();
154  fRun = e.run();
155  fSubRun = e.subRun();
156  fTime = (unsigned long long)((e.time()).value());
157  fEvtRecord++;
158 
159  /* Get the FlatDAQData data from the event and unpack it */
161  e.getByLabel(fRawDataLabel, flatdaqdata);
162 
163  rawdata::DAQUnpack* daqUnpack(new rawdata::DAQUnpack);
165  daqUnpack->GetRawEvent(*flatdaqdata, rawevt);
166 
167  /* Get DAQHeader from event */
169  e.getByLabel(fRawDataLabel, daqheader);
170  fNMicroslices = daqheader->TotalMicroSlices();
171 
173  e.getByLabel(fRawDataLabel, droppedMBs);
174  fNDroppedMicroBlocks = (*droppedMBs)[0].fSumTrig_NumDroppedMicroblocks;
175 
176 
177  /* Get the trigger information from event */
179  e.getByLabel(fRawDataLabel, trigs);
180  const rawdata::RawTrigger trig = trigs->at(0);
181 
184  fTrigType = (unsigned int)(trig.fTriggerMask_TriggerType);
186 
187  /* If the trigger doesn't match list in fcl, don't do anything */
188  if (std::find(fTriggerTypes.begin(), fTriggerTypes.end(), fTrigType) == fTriggerTypes.end()) {
189  mf::LogWarning("RequestedTriggerNotFound") << "This trigger type (" << fTrigType << ") does not match a requested type. Skipping this trigger.";
190  return;
191  }
192 
193  // FFFF FFFF FF00 0000 - Master trigger number: first 40 bits
194  // 0000 0000 00FF FFFF - Run number: remaining 24 bits
195  fTrigMasterID = ((uint64_t)fTrigMasterNum & 0xffffffffff) << 24 | ((uint64_t)fRun & 0xffffff);
196 
197  std::cout << "Processing record " << fEvtRecord << " (master trigger 0x" << std::hex << fTrigMasterID << std::dec << ", trigger " << fTrigNum << ", type " << fTrigType << ")" << std::endl;
198 
199  /* Convert trigger start time form NOvA time to Unix time */
200  struct timespec unixtime;
202 
204  fTrigUnixTimeStart = unixtime.tv_sec * 1e9 + unixtime.tv_nsec;
205 
206  /* Check for known error modes */
207  if (rawevt.getHeader()->isEventIncomplete()) fErrorRegister |= 1 << trigmon::LongReadoutError::kIncompleteEvent;
208  if (fNMicroslices < fNMicroslicesMin || fNMicroslices > fNMicroclicesMax) fErrorRegister |= 1 << trigmon::LongReadoutError::kNHitsOutOfRange;
209 
210  /* Fill TTree and DB */
211  if (fWriteToROOTFile) fEvents->Fill();
212  if (fWriteToSQLite3File) this->fillDB();
213 
214  return;
215 }
unsigned int fNMicroslices
Number of microslices present.
bit-1: isEventIncomplete flag set
unsigned int fSubRun
Subrun number.
uint32_t fNDroppedMicroBlocks
Number of dropped microblocks.
std::string fRawDataLabel
label of where to find RawData
unsigned long long fTrigMasterID
Unique identifier for a given master trigger.
unsigned long long fTime
Event timestamp.
bool fWriteToSQLite3File
Write to sqlite3 file?
int TotalMicroSlices() const
Definition: DAQHeader.h:27
unsigned int fTrigType
Numerical trigger type.
bool convertNovaTimeToUnixTime(uint64_t const &inputNovaTime, struct timespec &outputUnixTime)
uint32_t fTrigLength
Length of trigger (units of 500 nsec)
bit-0: Number of hits out of range
uint8_t fTriggerMask_TriggerType
Definition: RawTrigger.h:43
unsigned int fEvtRecord
Event number for this file.
unsigned long long fTriggerHeader_MasterTriggerNumber
Definition: RawTrigger.h:35
bool fWriteToROOTFile
Write to ROOT histogram file?
const XML_Char int const XML_Char * value
Definition: expat.h:331
unsigned long long fTrigUnixTimeStart
Unix time of trigger (in ns)
OStream cout
Definition: OStream.cxx:6
unsigned int fNMicroclicesMax
Maximum number of microslices to be OK.
unsigned long long fTrigMasterNum
Trigger master number.
unsigned long long fTriggerHeader_TriggerNumber
Definition: RawTrigger.h:34
std::vector< unsigned int > fTriggerTypes
vector of trigger type numbers to check
unsigned long long fTriggerTimingMarker_TimeStart
Definition: RawTrigger.h:38
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
unsigned long long fTrigTimeStart
NOvA time of trigger.
uint32_t fTriggerRange_TriggerLength
Definition: RawTrigger.h:40
unsigned long long fTrigNum
Trigger number.
Float_t e
Definition: plot.C:35
void trigmon::LongReadoutAnalyzer::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 219 of file LongReadoutAnalyzer_module.cc.

References createDBTables(), db, fErrorRegister, fEvents, fEvt, fEvtRecord, fNDroppedMicroBlocks, fNMicroslices, fRun, fSQLite3FileName, fSubRun, fTime, fTrigLength, fTrigMasterID, fTrigMasterNum, fTrigNum, fTrigTimeStart, fTrigType, fTrigUnixTimeStart, fWriteToROOTFile, fWriteToSQLite3File, and art::TFileDirectory::make().

220 {
221  /* Open database and create tables */
222  if (fWriteToSQLite3File) {
223  sqlite3_open(fSQLite3FileName.c_str(), &db);
224  this->createDBTables();
225  }
226 
227  /* Build TTree */
228  if (fWriteToROOTFile) {
230  fEvents = tfs->make<TTree>("Events", "Events");
231  fEvents->Branch("evt", &fEvt);
232  fEvents->Branch("evtRecord", &fEvtRecord);
233  fEvents->Branch("run", &fRun);
234  fEvents->Branch("srun", &fSubRun);
235  fEvents->Branch("time", &fTime);
236  fEvents->Branch("NMicroSlices", &fNMicroslices);
237  fEvents->Branch("NDroppedMicroBlocks", &fNDroppedMicroBlocks);
238  fEvents->Branch("ErrorRegister", &fErrorRegister);
239  fEvents->Branch("TriggerNo", &fTrigNum);
240  fEvents->Branch("MasterTriggerNo", &fTrigMasterNum);
241  fEvents->Branch("MasterTriggerID", &fTrigMasterID);
242  fEvents->Branch("TriggerType", &fTrigType);
243  fEvents->Branch("TriggerTimeStart", &fTrigTimeStart);
244  fEvents->Branch("TriggerUnixTimeStart", &fTrigUnixTimeStart);
245  fEvents->Branch("TriggerLength", &fTrigLength);
246  }
247 
248  fEvtRecord = 0;
249 
250  return;
251 }
unsigned int fNMicroslices
Number of microslices present.
unsigned int fSubRun
Subrun number.
uint32_t fNDroppedMicroBlocks
Number of dropped microblocks.
unsigned long long fTrigMasterID
Unique identifier for a given master trigger.
unsigned long long fTime
Event timestamp.
bool fWriteToSQLite3File
Write to sqlite3 file?
unsigned int fTrigType
Numerical trigger type.
uint32_t fTrigLength
Length of trigger (units of 500 nsec)
unsigned int fEvtRecord
Event number for this file.
std::string fSQLite3FileName
Name of sqlite3 file.
bool fWriteToROOTFile
Write to ROOT histogram file?
unsigned long long fTrigUnixTimeStart
Unix time of trigger (in ns)
T * make(ARGS...args) const
unsigned long long fTrigMasterNum
Trigger master number.
sqlite3 * db
SQLite3 database object.
unsigned long long fTrigTimeStart
NOvA time of trigger.
unsigned long long fTrigNum
Trigger number.
void trigmon::LongReadoutAnalyzer::beginRun ( art::Run const &  r)
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 286 of file LongReadoutAnalyzer_module.cc.

References ds::DetectorService::DetId(), and fDetId.

287 {
289  fDetId = ds->DetId();
290 }
novadaq::cnv::DetId DetId() const
What detector are we in?
A very simple service to remember what detector we&#39;re working in.
novadaq::cnv::DetId fDetId
Detector ID.
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_
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
void trigmon::LongReadoutAnalyzer::createDBTables ( )

Definition at line 301 of file LongReadoutAnalyzer_module.cc.

References om::cout, allTimeWatchdog::endl, novadaq::messages::error::rc::errMsg, cet::search_path::find_file(), and fSchemaFileName.

Referenced by beginJob().

302 {
303  char* errMsg = 0;
304  std::string schemaFilePath;
305 
306  cet::search_path searchpath("FW_SEARCH_PATH");
307  if (!searchpath.find_file(fSchemaFileName, schemaFilePath)) {
308  std::cout << "Cannot find SQL schema file" << std::endl;
309  throw cet::exception("LongReadoutAnalyzer") << "Cannot find SQL schema file " << fSchemaFileName;
310  }
311 
312  std::ifstream schemaFile(schemaFilePath);
313  std::string sqlschema((std::istreambuf_iterator<char>(schemaFile)), std::istreambuf_iterator<char>());
314 
315  sqlite3_exec(db, sqlschema.c_str(), 0, 0, &errMsg);
316 
317  if (errMsg) {
318  std::cout << "Error message: " << errMsg << std::endl;
319  throw cet::exception("LongReadoutAnalyzer") << "Error writing database schema: " << errMsg << std::endl;
320  }
321  return;
322 }
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
static const char *const errMsg[]
Definition: Error.h:69
std::string fSchemaFileName
Name of sqlite3 schema file.
OStream cout
Definition: OStream.cxx:6
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
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
void trigmon::LongReadoutAnalyzer::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 255 of file LongReadoutAnalyzer_module.cc.

References fDetId, fFileName, fRun, fSubRun, fWriteToSQLite3File, submit_cafana::rc, and stmt.

256 {
257  if (fWriteToSQLite3File) {
258  /* Fill table: "filenames" */
259  sqlite3_prepare_v2(db,
260  "INSERT OR REPLACE INTO files(filename, det, run, subrun) VALUES(?, ?, ?, ?);",
261  -1,
262  &stmt,
263  NULL);
264 
265  sqlite3_bind_text (stmt, 1, fFileName.c_str(), -1, 0);
266  sqlite3_bind_int (stmt, 2, fDetId);
267  sqlite3_bind_int (stmt, 3, fRun);
268  sqlite3_bind_int (stmt, 4, fSubRun);
269 
270  int rc = sqlite3_step(stmt);
271  if( rc != SQLITE_DONE)
272  throw cet::exception("LongReadoutAnalyzer") << "problem writing to \"files\" table (SQLite error " << rc << ").";
273 
274  rc = sqlite3_finalize(stmt);
275 
276 
277  /* close DB connection */
278  sqlite3_close(db);
279  }
280 
281  return;
282 }
unsigned int fSubRun
Subrun number.
std::string fFileName
Input filename.
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
bool fWriteToSQLite3File
Write to sqlite3 file?
sqlite3_stmt * stmt
SQLite3 prepared statement container.
novadaq::cnv::DetId fDetId
Detector ID.
void trigmon::LongReadoutAnalyzer::fillDB ( )

Definition at line 326 of file LongReadoutAnalyzer_module.cc.

References DEFINE_ART_MODULE(), fErrorRegister, fEvt, fNDroppedMicroBlocks, fNMicroslices, fRun, fSubRun, fTrigLength, fTrigMasterID, fTrigMasterNum, fTrigNum, fTrigTimeStart, fTrigType, fTrigUnixTimeStart, and stmt.

Referenced by analyze().

327 {
328  /* Fill table: "triggers" */
329  sqlite3_prepare_v2(db,
330  "INSERT OR REPLACE INTO triggers(master_trigger_id, master_trigger_number, trigger_number, type, run, subrun, event, tstart_nova, tstart_unix, tlength, n_uslices, n_dropped_ublocks, error_modes) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);",
331  -1,
332  &stmt,
333  NULL);
334 
335  sqlite3_bind_int64 (stmt, 1, fTrigMasterID);
336  sqlite3_bind_int (stmt, 2, fTrigMasterNum);
337  sqlite3_bind_int (stmt, 3, fTrigNum);
338  sqlite3_bind_int (stmt, 4, fTrigType);
339  sqlite3_bind_int (stmt, 5, fRun);
340  sqlite3_bind_int (stmt, 6, fSubRun);
341  sqlite3_bind_int (stmt, 7, fEvt);
342  sqlite3_bind_int64 (stmt, 8, fTrigTimeStart);
343  sqlite3_bind_int64 (stmt, 9, fTrigUnixTimeStart);
344  sqlite3_bind_int (stmt, 10, fTrigLength);
345  sqlite3_bind_int (stmt, 11, fNMicroslices);
346  sqlite3_bind_int (stmt, 12, fNDroppedMicroBlocks);
347  sqlite3_bind_int (stmt, 13, fErrorRegister);
348 
349  if( sqlite3_step(stmt) != SQLITE_DONE)
350  throw cet::exception("LongReadoutAnalyzer") << "problem writing to triggers table ";
351 
352  sqlite3_finalize(stmt);
353 
354  return;
355 }
unsigned int fNMicroslices
Number of microslices present.
unsigned int fSubRun
Subrun number.
uint32_t fNDroppedMicroBlocks
Number of dropped microblocks.
unsigned long long fTrigMasterID
Unique identifier for a given master trigger.
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
unsigned int fTrigType
Numerical trigger type.
uint32_t fTrigLength
Length of trigger (units of 500 nsec)
sqlite3_stmt * stmt
SQLite3 prepared statement container.
unsigned long long fTrigUnixTimeStart
Unix time of trigger (in ns)
unsigned long long fTrigMasterNum
Trigger master number.
unsigned long long fTrigTimeStart
NOvA time of trigger.
unsigned long long fTrigNum
Trigger number.
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
LongReadoutAnalyzer& trigmon::LongReadoutAnalyzer::operator= ( LongReadoutAnalyzer const &  )
delete
LongReadoutAnalyzer& trigmon::LongReadoutAnalyzer::operator= ( LongReadoutAnalyzer &&  )
delete
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

36  {}
void trigmon::LongReadoutAnalyzer::respondToOpenInputFile ( const art::FileBlock fb)
override

Definition at line 294 of file LongReadoutAnalyzer_module.cc.

References fFileName, and art::FileBlock::fileName().

295 {
296  fFileName = basename((char*)fb.fileName().c_str());
297 }
std::string fFileName
Input filename.
std::string const & fileName() const
Definition: FileBlock.h:38
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

sqlite3* trigmon::LongReadoutAnalyzer::db
private

SQLite3 database object.

Definition at line 98 of file LongReadoutAnalyzer_module.cc.

Referenced by beginJob().

novadaq::cnv::DetId trigmon::LongReadoutAnalyzer::fDetId
private

Detector ID.

Definition at line 75 of file LongReadoutAnalyzer_module.cc.

Referenced by beginRun(), and endJob().

int trigmon::LongReadoutAnalyzer::fErrorRegister
private

Error register.

Definition at line 89 of file LongReadoutAnalyzer_module.cc.

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

TTree* trigmon::LongReadoutAnalyzer::fEvents
private

Definition at line 73 of file LongReadoutAnalyzer_module.cc.

Referenced by analyze(), and beginJob().

unsigned int trigmon::LongReadoutAnalyzer::fEvt
private

Event number.

Definition at line 76 of file LongReadoutAnalyzer_module.cc.

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

unsigned int trigmon::LongReadoutAnalyzer::fEvtRecord
private

Event number for this file.

Definition at line 77 of file LongReadoutAnalyzer_module.cc.

Referenced by analyze(), and beginJob().

std::string trigmon::LongReadoutAnalyzer::fFileName
private

Input filename.

Definition at line 74 of file LongReadoutAnalyzer_module.cc.

Referenced by endJob(), and respondToOpenInputFile().

uint32_t trigmon::LongReadoutAnalyzer::fNDroppedMicroBlocks
private

Number of dropped microblocks.

Definition at line 92 of file LongReadoutAnalyzer_module.cc.

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

unsigned int trigmon::LongReadoutAnalyzer::fNMicroclicesMax
private

Maximum number of microslices to be OK.

Definition at line 91 of file LongReadoutAnalyzer_module.cc.

Referenced by analyze().

unsigned int trigmon::LongReadoutAnalyzer::fNMicroslices
private

Number of microslices present.

Definition at line 81 of file LongReadoutAnalyzer_module.cc.

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

unsigned int trigmon::LongReadoutAnalyzer::fNMicroslicesMin
private

Minimum number of microslices to be OK.

Definition at line 90 of file LongReadoutAnalyzer_module.cc.

std::string trigmon::LongReadoutAnalyzer::fRawDataLabel
private

label of where to find RawData

Definition at line 70 of file LongReadoutAnalyzer_module.cc.

Referenced by analyze().

unsigned int trigmon::LongReadoutAnalyzer::fRun
private

Run number.

Definition at line 78 of file LongReadoutAnalyzer_module.cc.

Referenced by analyze(), beginJob(), endJob(), and fillDB().

std::string trigmon::LongReadoutAnalyzer::fSchemaFileName
private

Name of sqlite3 schema file.

Definition at line 96 of file LongReadoutAnalyzer_module.cc.

Referenced by createDBTables().

std::string trigmon::LongReadoutAnalyzer::fSQLite3FileName
private

Name of sqlite3 file.

Definition at line 95 of file LongReadoutAnalyzer_module.cc.

Referenced by beginJob().

unsigned int trigmon::LongReadoutAnalyzer::fSubRun
private

Subrun number.

Definition at line 79 of file LongReadoutAnalyzer_module.cc.

Referenced by analyze(), beginJob(), endJob(), and fillDB().

unsigned long long trigmon::LongReadoutAnalyzer::fTime
private

Event timestamp.

Definition at line 80 of file LongReadoutAnalyzer_module.cc.

Referenced by analyze(), and beginJob().

std::vector<unsigned int> trigmon::LongReadoutAnalyzer::fTriggerTypes
private

vector of trigger type numbers to check

Definition at line 71 of file LongReadoutAnalyzer_module.cc.

Referenced by analyze().

uint32_t trigmon::LongReadoutAnalyzer::fTrigLength
private

Length of trigger (units of 500 nsec)

Definition at line 88 of file LongReadoutAnalyzer_module.cc.

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

unsigned long long trigmon::LongReadoutAnalyzer::fTrigMasterID
private

Unique identifier for a given master trigger.

Definition at line 84 of file LongReadoutAnalyzer_module.cc.

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

unsigned long long trigmon::LongReadoutAnalyzer::fTrigMasterNum
private

Trigger master number.

Definition at line 83 of file LongReadoutAnalyzer_module.cc.

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

unsigned long long trigmon::LongReadoutAnalyzer::fTrigNum
private

Trigger number.

Definition at line 82 of file LongReadoutAnalyzer_module.cc.

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

unsigned long long trigmon::LongReadoutAnalyzer::fTrigTimeStart
private

NOvA time of trigger.

Definition at line 86 of file LongReadoutAnalyzer_module.cc.

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

unsigned int trigmon::LongReadoutAnalyzer::fTrigType
private

Numerical trigger type.

Definition at line 85 of file LongReadoutAnalyzer_module.cc.

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

unsigned long long trigmon::LongReadoutAnalyzer::fTrigUnixTimeStart
private

Unix time of trigger (in ns)

Definition at line 87 of file LongReadoutAnalyzer_module.cc.

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

bool trigmon::LongReadoutAnalyzer::fWriteToROOTFile
private

Write to ROOT histogram file?

Definition at line 94 of file LongReadoutAnalyzer_module.cc.

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

bool trigmon::LongReadoutAnalyzer::fWriteToSQLite3File
private

Write to sqlite3 file?

Definition at line 93 of file LongReadoutAnalyzer_module.cc.

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

sqlite3_stmt* trigmon::LongReadoutAnalyzer::stmt = 0
private

SQLite3 prepared statement container.

Definition at line 99 of file LongReadoutAnalyzer_module.cc.

Referenced by endJob(), and fillDB().


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