CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DaqSource.cc
Go to the documentation of this file.
1 
8 #include "DaqSource.h"
9 
13 
16 
27 
28 #include <string>
29 #include <iostream>
30 #include <time.h>
31 #include <sys/time.h>
32 #include <sys/types.h>
33 
34 #include "xgi/Method.h"
35 #include "xgi/Utils.h"
36 
37 #include "cgicc/Cgicc.h"
38 #include "cgicc/FormEntry.h"
39 #include "cgicc/HTMLClasses.h"
40 
41 #include "boost/tokenizer.hpp"
42 
43 
45 // construction/destruction
47 
48 
49 
50 namespace edm {
51  namespace daqsource{
54  }
55 
56  //______________________________________________________________________________
58  const InputSourceDescription& desc)
59  : InputSource(pset,desc)
60  , evf::ModuleWeb("DaqSource")
61  , reader_(0)
62  , lumiSegmentSizeInEvents_(pset.getUntrackedParameter<unsigned int>("evtsPerLS",0))
63  , useEventCounter_(pset.getUntrackedParameter<bool>("useEventCounter",false))
64  , eventCounter_(0)
65  , keepUsingPsidFromTrigger_(pset.getUntrackedParameter<bool>("keepUsingPsidFromTrigger",false))
66  , fakeLSid_(lumiSegmentSizeInEvents_ != 0)
67  , runNumber_(RunID::firstValidRun().run())
68  , luminosityBlockNumber_(LuminosityBlockID::firstValidLuminosityBlock().luminosityBlock())
69  , noMoreEvents_(false)
70  , newRun_(true)
71  , newLumi_(true)
72  , eventCached_(false)
73  , alignLsToLast_(false)
74  , is_(0)
75  , mis_(0)
76  , thisEventLSid(0)
77  , goToStopping(false)
78  {
79  count = 0;
80  pthread_mutex_init(&mutex_,0);
81  pthread_mutex_init(&signal_lock_,0);
82  pthread_cond_init(&cond_,0);
83  produces<FEDRawDataCollection>();
85 
86  // Instantiate the requested data source
87  std::string reader = pset.getUntrackedParameter<std::string>("readerPluginName");
88 
89  try{
90  reader_=
91  DaqReaderPluginFactory::get()->create(reader,
92  pset.getUntrackedParameter<ParameterSet>("readerPset"));
94  }
95  catch(edm::Exception &e) {
96  if(e.category() == "Configuration" && reader_ == 0) {
97  reader_ = DaqReaderPluginFactoryU::get()->create(reader);
98  if(reader_ == 0) throw;
100  }
101  else {
102  throw;
103  }
104  }
105  }
106 
107  //______________________________________________________________________________
109  delete reader_;
110  }
111 
112 
114  // implementation of member functions
116 
117  //______________________________________________________________________________
120  // std::cout << getpid() << " enter getNextItemType " << std::endl;
121  if(goToStopping){noMoreEvents_ = true; goToStopping=false;}
122  if (noMoreEvents_) {
123  pthread_mutex_lock(&mutex_);
124  pthread_cond_signal(&cond_);
125  pthread_mutex_unlock(&mutex_);
126  return IsStop;
127  }
128  if (newRun_) {
129  return IsRun;
130  }
132  // std::cout << "newLumi & lumiblock valid " << std::endl;
133  return IsLumi;
134  }
135  if (alignLsToLast_) { //here we are recovering from a gap in Ls number so an event may already be cached but
136  // we hold onto it until we have issued all the necessary endLumi/beginLumi
137 // std::cout << getpid() << "alignLsToLast was set and ls number is "
138 // << luminosityBlockNumber_ << " before signaling" << std::endl;
141 // std::cout << getpid() << "alignLsToLast signaled and incremented "
142 // << luminosityBlockNumber_ << " eventcached "
143 // << eventCached_ << std::endl;
144  newLumi_ = true;
148  {
149  alignLsToLast_ = false;
150  }
154 
157  // std::cout << "nextItemType: dealt with new lumi block principal, retval is " << retval << std::endl;
158  }
159  return IsLumi;
160  }
161  if (eventCached_) {
162  // std::cout << "read event already cached " << std::endl;
163  return IsEvent;
164  }
165  if(reader_ == 0) {
167  << "DaqSource is used without a reader. Check your configuration !";
168  }
169  EventID eventId;
170  TimeValue_t time = 0LL;
171  timeval stv;
172  gettimeofday(&stv,0);
173  time = stv.tv_sec;
174  time = (time << 32) + stv.tv_usec;
175  Timestamp tstamp(time);
176 
177  int bunchCrossing = EventAuxiliary::invalidBunchXing;
178  int orbitNumber = EventAuxiliary::invalidBunchXing;
179 
180  // pass a 0 pointer to fillRawData()!
181  FEDRawDataCollection* fedCollection(0);
182 
184 
185  // let reader_ fill the fedCollection
186  int retval = reader_->fillRawData(eventId, tstamp, fedCollection);
187  if(retval==0) {
188  // fillRawData() failed, clean up the fedCollection in case it was allocated!
189  if (0 != fedCollection) delete fedCollection;
190  noMoreEvents_ = true;
191  pthread_mutex_lock(&mutex_);
192  pthread_cond_signal(&cond_);
193  pthread_mutex_unlock(&mutex_);
194  return IsStop;
195  }
196  else if(retval<0)
197  {
198 
199  unsigned int nextLsFromSignal = (-1)*retval+1;
200 // std::cout << getpid() << "::got end-of-lumi for " << (-1)*retval
201 // << " was " << luminosityBlockNumber_ << std::endl;
202  if(luminosityBlockNumber_ == (nextLsFromSignal-1) )
203  {
204  lastLumiUsingEol_->value_ = nextLsFromSignal;
205  if(lsToBeRecovered_->value_){
206 // std::cout << getpid() << "eol::recover ls::for " << (-1)*retval << std::endl;
209  newLumi_ = true;
212  thisEventLSid = nextLsFromSignal - 1;
214  alignLsToLast_ = true;
215  // std::cout << getpid() << "eol::::alignLsToLast_ " << alignLsToLast_ << std::endl;
216  }
217  else{
218  // std::cout << getpid() << "eol::realign ls::for " << (-1)*retval << std::endl;
219  luminosityBlockNumber_ = nextLsFromSignal;
220  newLumi_ = true;
223  }
224  }
225  else if(nextLsFromSignal >(luminosityBlockNumber_+100) ) {
226  edm::LogError("DaqSource") << "Got EOL event with value " << retval
227  << " nextLS would be " << nextLsFromSignal
228  << " while we expected " << luminosityBlockNumber_+1 << " - disregarding... ";
229  }
230  // else
231  // std::cout << getpid() << "::skipping end-of-lumi for " << (-1)*retval << std::endl;
232  }
233  else
234  {
235  if (eventId.event() == 0) {
237  << "The reader used with DaqSource has returned an invalid (zero) event number!\n"
238  << "Event numbers must begin at 1, not 0.";
239  }
240  EventSourceSentry(*this);
241  setTimestamp(tstamp);
242 
243  unsigned char *gtpFedAddr = fedCollection->FEDData(daqsource::gtpEvmId_).size()!=0 ? fedCollection->FEDData(daqsource::gtpEvmId_).data() : 0;
244  uint32_t gtpsize = 0;
245  if(gtpFedAddr !=0) gtpsize = fedCollection->FEDData(daqsource::gtpEvmId_).size();
246  unsigned char *gtpeFedAddr = fedCollection->FEDData(daqsource::gtpeId_).size()!=0 ? fedCollection->FEDData(daqsource::gtpeId_).data() : 0;
247 
248  unsigned int nextFakeLs = 0;
249  eventCounter_++;
251  (nextFakeLs = useEventCounter_ ? ((eventCounter_-1)/lumiSegmentSizeInEvents_ + 1) :
252  ((eventId.event() - 1)/lumiSegmentSizeInEvents_ + 1))) {
253  lastLumiPrescaleIndex_->value_ = prescaleSetIndex_->value_;
254  prescaleSetIndex_->value_ = 0; // since we do not know better but we want to be able to run
255 
256  if(luminosityBlockNumber_ == nextFakeLs-1)
258  luminosityBlockNumber_ = nextFakeLs;
259  thisEventLSid = nextFakeLs-1;
260  newLumi_ = true;
264  gtpFedAddr!=0 && evf::evtn::evm_board_sense(gtpFedAddr,gtpsize)){
265  prescaleSetIndex_->value_ = (evf::evtn::getfdlpsc(gtpFedAddr) & 0xffff);
266  }
267  }
268  else if(!fakeLSid_){
269 
270  if(gtpFedAddr!=0 && evf::evtn::evm_board_sense(gtpFedAddr,gtpsize)){
271  lastLumiPrescaleIndex_->value_ = prescaleSetIndex_->value_;
272  thisEventLSid = evf::evtn::getlbn(gtpFedAddr);
273  prescaleSetIndex_->value_ = (evf::evtn::getfdlpsc(gtpFedAddr) & 0xffff);
276  // we got here in a running process and some Ls might have been skipped so set the flag,
277  // increase by one, check and if appropriate set the flag then continue
278  if(lsToBeRecovered_->value_){
279  // std::cout << getpid() << "eve::recover ls::for " << thisEventLSid << std::endl;
282  newLumi_ = true;
286  // std::cout << getpid() << "eve::::alignLsToLast_ " << alignLsToLast_ << std::endl;
287  }
288  else{ // we got here because the process was restarted. just realign the ls id and proceed with this event
289  // std::cout << getpid() << "eve::realign ls::for " << thisEventLSid << std::endl;
291  newLumi_ = true;
294  lsToBeRecovered_->value_ = true;
295  }
296  }
297  }
298  else if(gtpeFedAddr!=0 && evf::evtn::gtpe_board_sense(gtpeFedAddr)){
299  lastLumiPrescaleIndex_->value_ = prescaleSetIndex_->value_;
300  thisEventLSid = evf::evtn::gtpe_getlbn(gtpeFedAddr);
301  prescaleSetIndex_->value_ = 0; //waiting to get a PS index from gtpe
307  newLumi_ = true;
310  }
311  }
312  }
313  if(gtpFedAddr!=0 && evf::evtn::evm_board_sense(gtpFedAddr,gtpsize)){
314  bunchCrossing = int(evf::evtn::getfdlbx(gtpFedAddr));
315  orbitNumber = int(evf::evtn::getorbit(gtpFedAddr));
316  TimeValue_t time = evf::evtn::getgpshigh(gtpFedAddr);
317  time = (time << 32) + evf::evtn::getgpslow(gtpFedAddr);
318  Timestamp tstamp(time);
319  setTimestamp(tstamp);
320  }
321  else if(gtpeFedAddr!=0 && evf::evtn::gtpe_board_sense(gtpeFedAddr)){
322  bunchCrossing = int(evf::evtn::gtpe_getbx(gtpeFedAddr));
323  orbitNumber = int(evf::evtn::gtpe_getorbit(gtpeFedAddr));
324  }
325  }
326 
327  // std::cout << "lumiblockaux = " << luminosityBlockAuxiliary() << std::endl;
328  // If there is no luminosity block principal, make one.
330  newLumi_ = true;
333 
336  // std::cout << "nextItemType: dealt with new lumi block principal, retval is " << retval << std::endl;
337  }
338  // std::cout << "here retval = " << retval << std::endl;
339  if(retval<0){
340  // std::cout << getpid() << " returning from getnextitem because retval < 0 - IsLumi "
341  // << IsLumi << std::endl;
342  if(newLumi_) return IsLumi; else return getNextItemType();
343  }
344 
345  // make a brand new event
346  eventId = EventID(runNumber_,thisEventLSid+1, eventId.event());
347  std::auto_ptr<EventAuxiliary> eventAux(
348  new EventAuxiliary(eventId, processGUID(),
349  timestamp(),
350  true,
351  evttype,
352  bunchCrossing,
354  orbitNumber));
356  eventCached_ = true;
357 
358  // have fedCollection managed by a std::auto_ptr<>
359  std::auto_ptr<FEDRawDataCollection> bare_product(fedCollection);
360 
361  std::auto_ptr<Event> e(new Event(*eventPrincipalCache(), moduleDescription()));
362  // put the fed collection into the transient event store
363  e->put(bare_product);
364  // The commit is needed to complete the "put" transaction.
365  e->commit_();
366  if (newLumi_) {
367  return IsLumi;
368  }
369  return IsEvent;
370  }
371 
372  void
374  assert(!eventCached_);
375  reset();
376  newRun_ = newLumi_ = true;
377  runNumber_ = r;
379  noMoreEvents_ = false;
381  }
382 
383  boost::shared_ptr<RunAuxiliary>
385  assert(newRun_);
386  assert(!noMoreEvents_);
387  newRun_ = false;
388  return boost::shared_ptr<RunAuxiliary>(new RunAuxiliary(runNumber_, timestamp(), Timestamp::invalidTimestamp()));
389  }
390 
391  boost::shared_ptr<LuminosityBlockAuxiliary>
393  assert(!newRun_);
394  assert(newLumi_);
395  assert(!noMoreEvents_);
396  assert(luminosityBlockAuxiliary());
397  //assert(eventCached_); //the event may or may not be cached - rely on
398  // the call to getNextItemType to detect that.
399  newLumi_ = false;
400  return luminosityBlockAuxiliary();
401  }
402 
405  // std::cout << "assert not newRun " << std::endl;
406  assert(!newRun_);
407  // std::cout << "assert not newLumi " << std::endl;
408  assert(!newLumi_);
409  // std::cout << "assert not noMoreEvents " << std::endl;
410  assert(!noMoreEvents_);
411  // std::cout << "assert eventCached " << std::endl;
412  assert(eventCached_);
413  // std::cout << "asserts done " << std::endl;
414  eventCached_ = false;
415  return eventPrincipalCache();
416  }
417 
418  void
420  throw edm::Exception(errors::LogicError,"DaqSource::setLumi(LuminosityBlockNumber_t lumiNumber)")
421  << "The luminosity block number cannot be set externally for DaqSource.\n"
422  << "Contact a Framework developer.\n";
423  }
424 
427  throw edm::Exception(errors::LogicError,"DaqSource::readIt(EventID const& eventID)")
428  << "Random access read cannot be used for DaqSource.\n"
429  << "Contact a Framework developer.\n";
430  }
431 
432  void
434  throw edm::Exception(errors::LogicError,"DaqSource::skip(int offset)")
435  << "Random access skip cannot be used for DaqSource\n"
436  << "Contact a Framework developer.\n";
437  }
438 
439  void DaqSource::publish(xdata::InfoSpace *is)
440  {
441  is_ = is;
442  lumiSectionIndex_ = (xdata::UnsignedInteger32*)is_->find("lumiSectionIndex");
443  prescaleSetIndex_ = (xdata::UnsignedInteger32*)is_->find("prescaleSetIndex");
444  lastLumiPrescaleIndex_ = (xdata::UnsignedInteger32*)is_->find("lastLumiPrescaleIndex");
445  lastLumiUsingEol_ = (xdata::UnsignedInteger32*)is_->find("lastLumiUsingEol");
446  lsTimedOut_ = (xdata::Boolean*)is_->find("lsTimedOut");
447  lsToBeRecovered_ = (xdata::Boolean*)is_->find("lsToBeRecovered");
448  }
449  void DaqSource::publishToXmas(xdata::InfoSpace *is)
450  {
451  mis_ = is;
452  }
453 
454  void DaqSource::openBackDoor(unsigned int timeout_sec)
455  {
456  count++;
457  if(count==2) throw;
458  pthread_mutex_lock(&mutex_);
459  pthread_mutex_unlock(&signal_lock_);
460  timespec ts;
461 #if _POSIX_TIMERS > 0
462  clock_gettime(CLOCK_REALTIME, &ts);
463 #else
464  struct timeval tv;
465  gettimeofday(&tv, NULL);
466  ts.tv_sec = tv.tv_sec + 0;
467  ts.tv_nsec = 0;
468 #endif
469  ts.tv_sec += timeout_sec;
470 
471  int rc = pthread_cond_timedwait(&cond_, &mutex_, &ts);
472  if(rc == ETIMEDOUT) lsTimedOut_->value_ = true;
473  }
474 
476  {
477  count--;
478  pthread_cond_signal(&cond_);
479  pthread_mutex_unlock(&mutex_);
480  pthread_mutex_lock(&signal_lock_);
481  lsTimedOut_->value_ = false;
482  }
483 
485  {
486  pthread_mutex_lock(&signal_lock_);
487  pthread_mutex_lock(&mutex_);
488  pthread_mutex_unlock(&signal_lock_);
489  // std::cout << getpid() << " DS::signal from evloop " << std::endl;
490  pthread_cond_signal(&cond_);
491  // std::cout << getpid() << " DS::go to wait for scalers wl " << std::endl;
492  pthread_cond_wait(&cond_, &mutex_);
493  pthread_mutex_unlock(&mutex_);
494  ::usleep(1000);//allow other thread to lock
495  }
496 
498  {
499  std::string path;
500  std::string urn;
501  std::string mname;
502  std::string query;
503  std::string original_referrer_;
504  try
505  {
506  cgicc::Cgicc cgi(in);
507  if ( xgi::Utils::hasFormElement(cgi,"gotostopping") )
508  {
509  goToStopping=true;
510  }
511  if ( xgi::Utils::hasFormElement(cgi,"module") )
512  mname = xgi::Utils::getFormElement(cgi, "module")->getValue();
513  cgicc::CgiEnvironment cgie(in);
514  if(original_referrer_ == "")
515  original_referrer_ = cgie.getReferrer();
516  path = cgie.getPathInfo();
517  query = cgie.getQueryString();
518  }
519  catch (const std::exception & e)
520  {
521  // don't care if it did not work
522  }
523 
524  using std::endl;
525  *out << "<html>" << endl;
526  *out << "<head>" << endl;
527 
528 
529  *out << "<STYLE type=\"text/css\"> #T1 {border-width: 2px; border: solid blue; text-align: center} </STYLE> " << endl;
530  *out << "<link type=\"text/css\" rel=\"stylesheet\"";
531  *out << " href=\"/" << urn
532  << "/styles.css\"/>" << endl;
533 
534  *out << "<title>" << moduleName_
535  << " MAIN</title>" << endl;
536 
537  *out << "</head>" << endl;
538  *out << "<body onload=\"loadXMLDoc()\">" << endl;
539  *out << "<table border=\"0\" width=\"100%\">" << endl;
540  *out << "<tr>" << endl;
541  *out << " <td align=\"left\">" << endl;
542  *out << " <img" << endl;
543  *out << " align=\"middle\"" << endl;
544  *out << " src=\"/evf/images/bugicon.jpg\"" << endl;
545  *out << " alt=\"main\"" << endl;
546  *out << " width=\"90\"" << endl;
547  *out << " height=\"64\"" << endl;
548  *out << " border=\"\"/>" << endl;
549  *out << " <b>" << endl;
550  *out << moduleName_ << endl;
551  *out << " </b>" << endl;
552  *out << " </td>" << endl;
553  *out << " <td width=\"32\">" << endl;
554  *out << " <a href=\"/urn:xdaq-application:lid=3\">" << endl;
555  *out << " <img" << endl;
556  *out << " align=\"middle\"" << endl;
557  *out << " src=\"/hyperdaq/images/HyperDAQ.jpg\"" << endl;
558  *out << " alt=\"HyperDAQ\"" << endl;
559  *out << " width=\"32\"" << endl;
560  *out << " height=\"32\"" << endl;
561  *out << " border=\"\"/>" << endl;
562  *out << " </a>" << endl;
563  *out << " </td>" << endl;
564  *out << " <td width=\"32\">" << endl;
565  *out << " </td>" << endl;
566  *out << " <td width=\"32\">" << endl;
567  *out << " <a href=\"" << original_referrer_ << "\">" << endl;
568  *out << " <img" << endl;
569  *out << " align=\"middle\"" << endl;
570  *out << " src=\"/evf/images/spoticon.jpg\"" << endl;
571  *out << " alt=\"main\"" << endl;
572  *out << " width=\"32\"" << endl;
573  *out << " height=\"32\"" << endl;
574  *out << " border=\"\"/>" << endl;
575  *out << " </a>" << endl;
576  *out << " </td>" << endl;
577  *out << "</tr>" << endl;
578  *out << "</table>" << endl;
579 
580  *out << "<hr/>" << endl;
581 
582  *out << cgicc::form().set("method","GET").set("action", path )
583  << std::endl;
584  boost::char_separator<char> sep("&");
585  boost::tokenizer<boost::char_separator<char> > tokens(query, sep);
586  for (boost::tokenizer<boost::char_separator<char> >::iterator tok_iter = tokens.begin();
587  tok_iter != tokens.end(); ++tok_iter){
588  size_t pos = (*tok_iter).find_first_of("=");
589  if(pos != std::string::npos){
590  std::string first = (*tok_iter).substr(0 , pos);
591  std::string second = (*tok_iter).substr(pos+1, (*tok_iter).length()-pos-1);
592  *out << cgicc::input().set("type","hidden").set("name",first).set("value", second)
593  << std::endl;
594  }
595  }
596 
597  *out << cgicc::input().set("type","hidden").set("name","gotostopping").set("value","true")
598  << std::endl;
599  *out << cgicc::input().set("type","submit").set("value","Go To Stopping") << std::endl;
600  *out << cgicc::form() << std::endl;
601 
602  *out << "</body>" << endl;
603  *out << "</html>" << endl;
604  }
605 }
DaqBaseReader * reader_
Definition: DaqSource.h:61
static const char runNumber_[]
xdata::InfoSpace * mis_
Definition: DaqSource.h:86
EventNumber_t event() const
Definition: EventID.h:44
T getUntrackedParameter(std::string const &, T const &) const
virtual void openBackDoor(unsigned int)
Definition: DaqSource.cc:454
xdata::Boolean * lsTimedOut_
Definition: DaqSource.h:83
unsigned int getgpshigh(const unsigned char *)
EventPrincipal *const eventPrincipalCache()
Definition: InputSource.cc:156
#define Input(cl)
Definition: vmac.h:189
LuminosityBlockNumber_t luminosityBlockNumber_
Definition: DaqSource.h:69
unsigned int getfdlbx(const unsigned char *)
bool gtpe_board_sense(const unsigned char *p)
virtual void closeBackDoor()
Definition: DaqSource.cc:475
void readAndCacheLumi()
Read next luminosity block.
Definition: InputSource.cc:309
virtual ItemType getNextItemType()
Definition: DaqSource.cc:119
xdata::UnsignedInteger32 * lumiSectionIndex_
Definition: DaqSource.h:79
virtual boost::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
Definition: DaqSource.cc:392
unsigned int eventCounter_
Definition: DaqSource.h:64
xdata::Boolean * lsToBeRecovered_
Definition: DaqSource.h:84
virtual void publish(xdata::InfoSpace *)
Definition: DaqSource.cc:439
boost::tokenizer< boost::char_separator< char > > tokenizer
boost::shared_ptr< LuminosityBlockAuxiliary > luminosityBlockAuxiliary() const
Called by the framework to merge or insert lumi in principal cache.
Definition: InputSource.h:242
virtual void publishToXmas(xdata::InfoSpace *)
Definition: DaqSource.cc:449
#define NULL
Definition: scimark2.h:8
void setTimestamp(Timestamp const &theTime)
To set the current time, as seen by the input source.
Definition: InputSource.h:297
xdata::UnsignedInteger32 * lastLumiUsingEol_
Definition: DaqSource.h:82
RunNumber_t runNumber_
Definition: DaqSource.h:68
unsigned int getfdlpsc(const unsigned char *)
pthread_cond_t cond_
Definition: DaqSource.h:78
unsigned int LuminosityBlockNumber_t
Definition: EventID.h:31
boost::shared_ptr< LuminosityBlockPrincipal > const luminosityBlockPrincipal() const
Definition: InputSource.cc:280
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
static unsigned int gtpeId_
Definition: DaqSource.cc:53
std::string const & processGUID() const
Accessor for global process identifier.
Definition: InputSource.h:196
int path() const
Definition: HLTadd.h:3
U second(std::pair< T, U > const &p)
void resetLuminosityBlockAuxiliary() const
Definition: InputSource.h:306
pthread_mutex_t signal_lock_
Definition: DaqSource.h:77
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
static int const invalidBunchXing
unsigned int getlbn(const unsigned char *)
bool fakeLSid_
Definition: DaqSource.h:66
xdata::UnsignedInteger32 * prescaleSetIndex_
Definition: DaqSource.h:80
void setLuminosityBlockAuxiliary(LuminosityBlockAuxiliary *lbp)
Definition: InputSource.h:302
virtual void signalWaitingThreadAndBlock()
Definition: DaqSource.cc:484
bool keepUsingPsidFromTrigger_
Definition: DaqSource.h:65
unsigned long long TimeValue_t
Definition: Timestamp.h:27
bool evm_board_sense(const unsigned char *p, size_t size)
bool goToStopping
Definition: DaqSource.h:89
std::string moduleName_
Definition: ModuleWeb.h:23
tuple input
Definition: collect_tpl.py:10
DaqSource(const ParameterSet &pset, const InputSourceDescription &desc)
Definition: DaqSource.cc:57
tuple out
Definition: dbtoconf.py:99
LuminosityBlockNumber_t luminosityBlock() const
Accessor for current luminosity block number.
Definition: InputSource.cc:588
virtual void skip(int offset)
Definition: DaqSource.cc:433
virtual void setRun(RunNumber_t r)
Definition: DaqSource.cc:373
unsigned int getorbit(const unsigned char *)
static unsigned int gtpEvmId_
Definition: DaqSource.cc:52
void fillEventPrincipal(std::auto_ptr< EventAuxiliary > aux, boost::shared_ptr< LuminosityBlockPrincipal > lbp, boost::shared_ptr< EventSelectionIDVector > eventSelectionIDs=boost::shared_ptr< EventSelectionIDVector >(new EventSelectionIDVector), boost::shared_ptr< BranchListIndexes > branchListIndexes=boost::shared_ptr< BranchListIndexes >(new BranchListIndexes), boost::shared_ptr< BranchMapper > mapper=boost::shared_ptr< BranchMapper >(new BranchMapper), boost::shared_ptr< DelayedReader > rtrv=boost::shared_ptr< DelayedReader >(new NoDelayedReader))
unsigned int gtpe_getorbit(const unsigned char *)
static Timestamp const & invalidTimestamp()
Definition: Timestamp.cc:83
void defaultWebPage(xgi::Input *in, xgi::Output *out)
Definition: DaqSource.cc:497
void setLumiPrematurelyRead()
Definition: InputSource.h:322
virtual int fillRawData(edm::EventID &eID, edm::Timestamp &tstamp, FEDRawDataCollection *&data)=0
unsigned int lumiSegmentSizeInEvents_
Definition: DaqSource.h:62
Timestamp const & timestamp() const
Accessor for the current time, as seen by the input source.
Definition: InputSource.h:221
unsigned int getevtyp(const unsigned char *)
virtual EventPrincipal * readIt(EventID const &eventID)
Definition: DaqSource.cc:426
bool useEventCounter_
Definition: DaqSource.h:63
static int const invalidStoreNumber
static Timestamp const & beginOfTime()
Definition: Timestamp.cc:96
unsigned int gtpe_getbx(const unsigned char *)
void reset() const
Definition: InputSource.h:309
#define Output(cl)
Definition: vmac.h:193
virtual ~DaqSource()
Definition: DaqSource.cc:108
pthread_mutex_t mutex_
Definition: DaqSource.h:76
virtual void setRunNumber(edm::RunNumber_t runNumber)
set the run number
Definition: DaqBaseReader.h:37
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
bool eventCached_
Definition: DaqSource.h:73
tuple query
Definition: o2o.py:269
unsigned int thisEventLSid
Definition: DaqSource.h:88
ModuleDescription const & moduleDescription() const
Accessor for &#39;module&#39; description.
Definition: InputSource.h:187
unsigned int RunNumber_t
Definition: EventRange.h:32
unsigned int gtpe_getlbn(const unsigned char *)
bool noMoreEvents_
Definition: DaqSource.h:70
T first(std::pair< T, U > const &p)
virtual void setLumi(LuminosityBlockNumber_t lb)
Definition: DaqSource.cc:419
virtual boost::shared_ptr< RunAuxiliary > readRunAuxiliary_()
Definition: DaqSource.cc:384
unsigned int getgpslow(const unsigned char *)
xdata::InfoSpace * is_
Definition: DaqSource.h:85
T get(const Candidate &c)
Definition: component.h:56
xdata::UnsignedInteger32 * lastLumiPrescaleIndex_
Definition: DaqSource.h:81
virtual EventPrincipal * readEvent_()
Definition: DaqSource.cc:404
bool alignLsToLast_
Definition: DaqSource.h:74
std::string category() const
Definition: Exception.cc:74