CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
fwlite::MultiChainEvent Class Reference

#include <MultiChainEvent.h>

Inheritance diagram for fwlite::MultiChainEvent:
fwlite::EventBase edm::EventBase

Public Types

typedef std::pair
< edm::EventID, edm::EventID
event_id_range
 
typedef std::map< edm::EventID,
Long64_t > 
sec_file_index_map
 
typedef std::map
< event_id_range, Long64_t > 
sec_file_range_index_map
 

Public Member Functions

bool atEnd () const
 
virtual edm::EventAuxiliary const & eventAuxiliary () const
 
Long64_t eventIndex () const
 
Long64_t eventIndexSec () const
 
virtual Long64_t fileIndex () const
 
std::vector
< edm::BranchDescription >
const & 
getBranchDescriptions () const
 
virtual std::string const getBranchNameFor (std::type_info const &, char const *, char const *, char const *) const
 
virtual bool getByLabel (std::type_info const &, char const *, char const *, char const *, void *) const
 
virtual bool getByLabel (std::type_info const &, char const *, char const *, char const *, edm::WrapperHolder &) const
 
edm::WrapperHolder getByProductID (edm::ProductID const &) const
 
fwlite::LuminosityBlock const & getLuminosityBlock ()
 
std::vector< std::string > const & getProcessHistory () const
 
fwlite::Run const & getRun ()
 
TFile * getTFile () const
 
TFile * getTFileSec () const
 
bool isValid () const
 
 MultiChainEvent (std::vector< std::string > const &iFileNames1, std::vector< std::string > const &iFileNames2, bool useSecFileMapSorted=false)
 
 operator bool () const
 
const MultiChainEventoperator++ ()
 
ChainEvent const * primary () const
 
edm::ProcessHistory const & processHistory () const
 
ChainEvent const * secondary () const
 
virtual Long64_t secondaryFileIndex () const
 
Long64_t size () const
 
bool to (Long64_t iIndex)
 Go to the event at index iIndex. More...
 
bool to (edm::EventID id)
 Go to event with event id "id". More...
 
bool to (edm::RunNumber_t run, edm::EventNumber_t event)
 Go to event with given run and event number. More...
 
bool to (edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event)
 Go to event with given run , lumi (if non-zero), and event number. More...
 
const MultiChainEventtoBegin ()
 
virtual edm::TriggerNames const & triggerNames (edm::TriggerResults const &triggerResults) const
 
virtual edm::TriggerResultsByName triggerResultsByName (std::string const &process) const
 
virtual ~MultiChainEvent ()
 
- Public Member Functions inherited from fwlite::EventBase
 EventBase ()
 
virtual ~EventBase ()
 
- Public Member Functions inherited from edm::EventBase
int bunchCrossing () const
 
 EventBase ()
 
edm::EventAuxiliary::ExperimentType experimentType () const
 
template<typename T >
bool getByLabel (InputTag const &, Handle< T > &) const
 
template<>
bool getByLabel (edm::InputTag const &tag, Handle< FWGenericObject > &result) const
 Specialize the getByLabel method to work with a Handle<FWGenericObject> More...
 
edm::EventID id () const
 
bool isRealData () const
 
edm::LuminosityBlockNumber_t luminosityBlock () const
 
int orbitNumber () const
 
edm::Timestamp time () const
 

Static Public Member Functions

static void throwProductNotFoundException (std::type_info const &, char const *, char const *, char const *)
 

Private Member Functions

 MultiChainEvent (Event const &)
 
const MultiChainEventoperator= (Event const &)
 
bool toSec (Long64_t iIndex)
 Go to the event from secondary files at index iIndex. More...
 
bool toSec (const edm::EventID &id)
 
bool toSec (edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event)
 Go to event with given run, lumi, and event number. More...
 
bool toSec (edm::RunNumber_t run, edm::EventNumber_t event)
 Go to event with given run and event number. More...
 

Private Attributes

boost::shared_ptr< ChainEventevent1_
 
boost::shared_ptr< ChainEventevent2_
 
boost::shared_ptr
< internal::MultiProductGetter
getter_
 
sec_file_range_index_map secFileMapSorted_
 
bool useSecFileMapSorted_
 

Additional Inherited Members

- Static Protected Member Functions inherited from edm::EventBase
static TriggerNames const * triggerNames_ (edm::TriggerResults const &triggerResults)
 

Detailed Description

Definition at line 50 of file MultiChainEvent.h.

Member Typedef Documentation

Definition at line 56 of file MultiChainEvent.h.

Definition at line 55 of file MultiChainEvent.h.

Definition at line 57 of file MultiChainEvent.h.

Constructor & Destructor Documentation

MultiChainEvent::MultiChainEvent ( std::vector< std::string > const &  iFileNames1,
std::vector< std::string > const &  iFileNames2,
bool  useSecFileMapSorted = false 
)

Definition at line 58 of file MultiChainEvent.cc.

References gather_cfg::cout, event1_, event2_, getter_, secFileMapSorted_, makeLayoutFileForGui::toAdd, and useSecFileMapSorted_.

61 {
62  event1_ = boost::shared_ptr<ChainEvent> (new ChainEvent(iFileNames1));
63  event2_ = boost::shared_ptr<ChainEvent> (new ChainEvent(iFileNames2));
64 
65  getter_ = boost::shared_ptr<internal::MultiProductGetter>(new internal::MultiProductGetter(this));
66 
67  event1_->setGetter(getter_);
68  event2_->setGetter(getter_);
69 
70  useSecFileMapSorted_ = useSecFileMapSorted;
71 
72  if (!useSecFileMapSorted_) {
73  std::cout << "------------------------------------------------------------------------" << std::endl;
74  std::cout << "WARNING! What you are about to do may be very slow." << std::endl;
75  std::cout << "The 2-file solution in FWLite works with very simple assumptions." << std::endl;
76  std::cout << "It will linearly search through the files in the secondary file list for Products." << std::endl;
77  std::cout << "There are speed improvements available to make this run faster." << std::endl;
78  std::cout << "***If your secondary files are sorted with a run-range within a file, (almost always the case) " << std::endl;
79  std::cout << "***please use the option useSecFileMapSorted=true in this constructor. " << std::endl;
80  std::cout << " > usage: MultiChainEvent(primaryFiles, secondaryFiles, true);" << std::endl;
81  std::cout << "------------------------------------------------------------------------" << std::endl;
82 
83  }
84 
86 
87  std::cout << "------------------------------------------------------------------------" << std::endl;
88  std::cout << "This MultiChainEvent is now creating a (run_range)_2 ---> file_index_2 map" << std::endl;
89  std::cout << "for the 2-file solution. " << std::endl;
90  std::cout << "This is assuming the files you are giving me are sorted by run,event pairs within each secondary file." << std::endl;
91  std::cout << "If this is not true (rarely the case), set this option to false." << std::endl;
92  std::cout << " > usage: MultiChainEvent(primaryFiles, secondaryFiles, false);" << std::endl;
93  std::cout << "------------------------------------------------------------------------" << std::endl;
94  // speed up secondary file access with a (run,event)_1 ---> index_2 map
95 
96 
97  // Loop over events, when a new file is encountered, store the first run number from this file,
98  // and the last run number from the last file.
99  TFile * lastFile = 0;
100  std::pair<event_id_range,Long64_t> eventRange;
101  bool firstFile = true;
102 
103  bool foundAny = false;
104 
105  for(event2_->toBegin();
106  ! event2_->atEnd();
107  ++(*event2_)) {
108  // if we have a new file, cache the "first"
109  if (lastFile != event2_->getTFile()) {
110 
111  // if this is not the first file, we have an entry.
112  // Add it to the list.
113  if (!firstFile) {
114  foundAny = true;
115  event_id_range toAdd = eventRange.first;
116  secFileMapSorted_[ toAdd ] = eventRange.second;
117  }
118  // always add the "first" event id to the cached event range
119  eventRange.first.first = event2_->event()->id();
120  lastFile = event2_->getTFile();
121  }
122  // otherwise, cache the "second" event id in the cached event range.
123  // Upon the discovery of a new file, this will be used as the
124  // "last" event id in the cached event range.
125  else {
126  eventRange.first.second = event2_->event()->id();
127  eventRange.second = event2_->eventIndex();
128  }
129  firstFile = false;
130  }
131  // due to the invailability of a "look ahead" operation, we have one additional "put" to make
132  // after the loop (which puts the "last" event, not "this" event.
133  if (foundAny) {
134  event_id_range toAdd = eventRange.first;
135  secFileMapSorted_[ toAdd ] = eventRange.second;
136  }
137 // std::cout << "Dumping run range to event id list:" << std::endl;
138 // for (sec_file_range_index_map::const_iterator mBegin = secFileMapSorted_.begin(),
139 // mEnd = secFileMapSorted_.end(),
140 // mit = mBegin;
141 // mit != mEnd; ++mit) {
142 // char buff[1000];
143 // event2_->to(mit->second);
144 // sprintf(buff, "[%10d,%10d - %10d,%10d] ---> %10d",
145 // mit->first.first.run(),
146 // mit->first.first.event(),
147 // mit->first.second.run(),
148 // mit->first.second.event(),
149 // mit->second);
150 // std::cout << buff << std::endl;
151 // }
152  }
153 
154 }
boost::shared_ptr< ChainEvent > event2_
boost::shared_ptr< ChainEvent > event1_
boost::shared_ptr< internal::MultiProductGetter > getter_
sec_file_range_index_map secFileMapSorted_
std::pair< edm::EventID, edm::EventID > event_id_range
tuple cout
Definition: gather_cfg.py:121
MultiChainEvent::~MultiChainEvent ( )
virtual

Definition at line 161 of file MultiChainEvent.cc.

162 {
163 }
fwlite::MultiChainEvent::MultiChainEvent ( Event const &  )
private

Member Function Documentation

bool MultiChainEvent::atEnd ( ) const
virtual

Implements fwlite::EventBase.

Definition at line 405 of file MultiChainEvent.cc.

References event1_.

406 {
407  return event1_->atEnd();
408 }
boost::shared_ptr< ChainEvent > event1_
edm::EventAuxiliary const & MultiChainEvent::eventAuxiliary ( ) const
virtual

Implements edm::EventBase.

Definition at line 340 of file MultiChainEvent.cc.

References event1_.

341 {
342  return event1_->eventAuxiliary();
343 }
boost::shared_ptr< ChainEvent > event1_
Long64_t fwlite::MultiChainEvent::eventIndex ( ) const
inline

Definition at line 107 of file MultiChainEvent.h.

References event1_.

107 { return event1_->eventIndex(); }
boost::shared_ptr< ChainEvent > event1_
Long64_t fwlite::MultiChainEvent::eventIndexSec ( ) const
inline

Definition at line 108 of file MultiChainEvent.h.

References event2_.

108 { return event2_->eventIndex(); }
boost::shared_ptr< ChainEvent > event2_
virtual Long64_t fwlite::MultiChainEvent::fileIndex ( ) const
inlinevirtual

Reimplemented from fwlite::EventBase.

Definition at line 119 of file MultiChainEvent.h.

References event1_.

Referenced by python.Events::fileIndicies().

120  { return event1_->eventIndex(); }
boost::shared_ptr< ChainEvent > event1_
std::vector< edm::BranchDescription > const & MultiChainEvent::getBranchDescriptions ( ) const

Definition at line 322 of file MultiChainEvent.cc.

References event1_.

323 {
324  return event1_->getBranchDescriptions();
325 }
boost::shared_ptr< ChainEvent > event1_
std::string const MultiChainEvent::getBranchNameFor ( std::type_info const &  iType,
char const *  iModule,
char const *  iInstance,
char const *  iProcess 
) const
virtual

Implements fwlite::EventBase.

Definition at line 313 of file MultiChainEvent.cc.

References event1_.

317 {
318  return event1_->getBranchNameFor(iType,iModule,iInstance,iProcess);
319 }
boost::shared_ptr< ChainEvent > event1_
bool MultiChainEvent::getByLabel ( std::type_info const &  iType,
char const *  iModule,
char const *  iInstance,
char const *  iProcess,
void *  iValue 
) const
virtual

This function should only be called by fwlite::Handle<>

Implements fwlite::EventBase.

Definition at line 346 of file MultiChainEvent.cc.

References event1_, and event2_.

352 {
353  bool ret1 = event1_->getByLabel(iType, iModule, iInstance, iProcess, iValue);
354  if (!ret1) {
355  (const_cast<MultiChainEvent*>(this))->toSec(event1_->id());
356  bool ret2 = event2_->getByLabel(iType,iModule,iInstance,iProcess,iValue);
357  if (!ret2) return false;
358  }
359  return true;
360 }
boost::shared_ptr< ChainEvent > event2_
boost::shared_ptr< ChainEvent > event1_
bool MultiChainEvent::getByLabel ( std::type_info const &  iType,
char const *  iModule,
char const *  iInstance,
char const *  iProcess,
edm::WrapperHolder holder 
) const
virtual

Implements fwlite::EventBase.

Definition at line 363 of file MultiChainEvent.cc.

References event1_, and event2_.

368  {
369  bool ret1 = event1_->getByLabel(iType, iModule, iInstance, iProcess, holder);
370  if(!ret1) {
371  (const_cast<MultiChainEvent*>(this))->toSec(event1_->id());
372  bool ret2 = event2_->getByLabel(iType, iModule, iInstance, iProcess, holder);
373  if(!ret2) return false;
374  }
375  return true;
376 }
boost::shared_ptr< ChainEvent > event2_
boost::shared_ptr< ChainEvent > event1_
edm::WrapperHolder MultiChainEvent::getByProductID ( edm::ProductID const &  iID) const

Definition at line 378 of file MultiChainEvent.cc.

References event1_, event2_, edm::hlt::Exception, and edm::WrapperHolder::isValid().

Referenced by fwlite::internal::MultiProductGetter::getIt().

379 {
380  // First try the first file
381  edm::WrapperHolder edp = event1_->getByProductID(iID);
382  // Did not find the product, try secondary file
383  if (!edp.isValid()) {
384  (const_cast<MultiChainEvent*>(this))->toSec(event1_->id());
385  edp = event2_->getByProductID(iID);
386  if (!edp.isValid()) {
387  throw cms::Exception("ProductNotFound") << "Cannot find product " << iID;
388  }
389  }
390  return edp;
391 }
boost::shared_ptr< ChainEvent > event2_
boost::shared_ptr< ChainEvent > event1_
bool isValid() const
Definition: WrapperHolder.h:27
fwlite::LuminosityBlock const& fwlite::MultiChainEvent::getLuminosityBlock ( )
inline

Definition at line 110 of file MultiChainEvent.h.

References event1_.

110  {
111  return event1_->getLuminosityBlock();
112  }
boost::shared_ptr< ChainEvent > event1_
std::vector< std::string > const & MultiChainEvent::getProcessHistory ( ) const

Definition at line 328 of file MultiChainEvent.cc.

References event1_.

329 {
330  return event1_->getProcessHistory();
331 }
boost::shared_ptr< ChainEvent > event1_
fwlite::Run const& fwlite::MultiChainEvent::getRun ( )
inline

Definition at line 114 of file MultiChainEvent.h.

References event1_.

114  {
115  return event1_->getRun();
116  }
boost::shared_ptr< ChainEvent > event1_
TFile* fwlite::MultiChainEvent::getTFile ( ) const
inline

Definition at line 100 of file MultiChainEvent.h.

References event1_.

100  {
101  return event1_->getTFile();
102  }
boost::shared_ptr< ChainEvent > event1_
TFile* fwlite::MultiChainEvent::getTFileSec ( ) const
inline

Definition at line 103 of file MultiChainEvent.h.

References event2_.

103  {
104  return event2_->getTFile();
105  }
boost::shared_ptr< ChainEvent > event2_
bool MultiChainEvent::isValid ( void  ) const

Definition at line 395 of file MultiChainEvent.cc.

References event1_.

396 {
397  return event1_->isValid();
398 }
boost::shared_ptr< ChainEvent > event1_
MultiChainEvent::operator bool ( ) const

Definition at line 399 of file MultiChainEvent.cc.

400 {
401  return *event1_;
402 }
boost::shared_ptr< ChainEvent > event1_
const MultiChainEvent & MultiChainEvent::operator++ ( )
virtual

Implements fwlite::EventBase.

Definition at line 182 of file MultiChainEvent.cc.

References event1_.

183 {
184  event1_->operator++();
185  return *this;
186 }
boost::shared_ptr< ChainEvent > event1_
const MultiChainEvent& fwlite::MultiChainEvent::operator= ( Event const &  )
private
ChainEvent const* fwlite::MultiChainEvent::primary ( ) const
inline

Definition at line 131 of file MultiChainEvent.h.

References event1_.

131 { return &*event1_;}
boost::shared_ptr< ChainEvent > event1_
edm::ProcessHistory const & MultiChainEvent::processHistory ( ) const
virtual

Implements edm::EventBase.

Definition at line 334 of file MultiChainEvent.cc.

References event1_.

335 {
336  return event1_->processHistory();
337 }
boost::shared_ptr< ChainEvent > event1_
ChainEvent const* fwlite::MultiChainEvent::secondary ( ) const
inline

Definition at line 132 of file MultiChainEvent.h.

References event2_.

132 { return &*event2_;}
boost::shared_ptr< ChainEvent > event2_
virtual Long64_t fwlite::MultiChainEvent::secondaryFileIndex ( ) const
inlinevirtual

Reimplemented from fwlite::EventBase.

Definition at line 121 of file MultiChainEvent.h.

References event2_.

Referenced by python.Events::fileIndicies().

122  { return event2_->eventIndex(); }
boost::shared_ptr< ChainEvent > event2_
Long64_t MultiChainEvent::size ( void  ) const

Definition at line 411 of file MultiChainEvent.cc.

References event1_.

412 {
413  return event1_->size();
414 }
boost::shared_ptr< ChainEvent > event1_
void MultiChainEvent::throwProductNotFoundException ( std::type_info const &  iType,
char const *  iModule,
char const *  iInstance,
char const *  iProcess 
)
static

Definition at line 467 of file MultiChainEvent.cc.

References fwlite::ChainEvent::throwProductNotFoundException().

470  {
471  ChainEvent::throwProductNotFoundException(iType,iModule,iInstance,iProcess);
472 }
static void throwProductNotFoundException(std::type_info const &, char const *, char const *, char const *)
Definition: ChainEvent.cc:337
bool MultiChainEvent::to ( Long64_t  iIndex)

Go to the event at index iIndex.

Definition at line 190 of file MultiChainEvent.cc.

References event1_.

Referenced by to().

191 {
192  return event1_->to(iIndex);
193 }
boost::shared_ptr< ChainEvent > event1_
bool MultiChainEvent::to ( edm::EventID  id)

Go to event with event id "id".

Definition at line 198 of file MultiChainEvent.cc.

References event(), edm::EventBase::luminosityBlock(), DTTTrigCorrFirst::run, and to().

199 {
200  return to(id.run(), id.luminosityBlock(), id.event());
201 }
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
bool to(Long64_t iIndex)
Go to the event at index iIndex.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool MultiChainEvent::to ( edm::RunNumber_t  run,
edm::EventNumber_t  event 
)

Go to event with given run and event number.

Definition at line 212 of file MultiChainEvent.cc.

References to().

213 {
214  return to(run, 0U, event);
215 }
bool to(Long64_t iIndex)
Go to the event at index iIndex.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool MultiChainEvent::to ( edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi,
edm::EventNumber_t  event 
)

Go to event with given run , lumi (if non-zero), and event number.

Definition at line 205 of file MultiChainEvent.cc.

References event1_.

206 {
207  return event1_->to(run, lumi, event);
208 }
tuple lumi
Definition: fjr2json.py:35
boost::shared_ptr< ChainEvent > event1_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
const MultiChainEvent & MultiChainEvent::toBegin ( )
virtual

Implements fwlite::EventBase.

Definition at line 303 of file MultiChainEvent.cc.

References event1_.

304 {
305  event1_->toBegin();
306  return *this;
307 }
boost::shared_ptr< ChainEvent > event1_
bool MultiChainEvent::toSec ( Long64_t  iIndex)
private

Go to the event from secondary files at index iIndex.

Go to the event at index iIndex.

Definition at line 220 of file MultiChainEvent.cc.

References event2_.

Referenced by toSec().

221 {
222  return event2_->to(iIndex);
223 }
boost::shared_ptr< ChainEvent > event2_
bool MultiChainEvent::toSec ( const edm::EventID id)
private

Definition at line 227 of file MultiChainEvent.cc.

References event2_, edm::hlt::Exception, first, and secFileMapSorted_.

228 {
229  // First try this file.
230  if (event2_->event_->to(id))
231  {
232  // Found it, return.
233  return true;
234  }
235  // Second, assume that the secondary files are each in run/event
236  // order. So, let's loop over all files and see if we can figure
237  // out where the event ought to be.
238  for (sec_file_range_index_map::const_iterator mBegin =
239  secFileMapSorted_.begin(),
240  mEnd = secFileMapSorted_.end(),
241  mit = mBegin;
242  mit != mEnd;
243  ++mit)
244  {
245  if (id < mit->first.first || id > mit->first.second)
246  {
247  // We don't expect this event to be in this file, so don't
248  // bother checking it right now.
249  continue;
250  }
251  // If we're here, then we have a reasonable belief that this
252  // event is in this secondary file. This part is
253  // expensive. switchToFile does memory allocations and opens the
254  // files which becomes very time consuming. This should be done
255  // as infrequently as possible.
256  event2_->switchToFile(mit->second);
257  // Is it here?
258  if (event2_->to(id))
259  {
260  // Yes!
261  return true;
262  }
263  // if we assumed that the secondary files were not each in
264  // order, but were non-overlapping, we could break here. But at
265  // this point, we might as well keep going.
266  } // for loop over files
267 
268  // if we are still here, then we did not find the id in question,
269  // do it the old fashioned way. This will open up each secondary
270  // file and explicitly check to see if the event is there.
271  if (event2_->to(id))
272  {
273  return true;
274  }
275  // if we're still here, then there really is no matching event in
276  // the secondary files. Throw.
277  throw cms::Exception("ProductNotFound") << "Cannot find id "
278  << id.run() << ", "
279  << id.event()
280  << " in secondary list. Exiting."
281  << std::endl;
282  // to make the compiler happy
283  return false;
284 }
boost::shared_ptr< ChainEvent > event2_
bool first
Definition: L1TdeRCT.cc:79
sec_file_range_index_map secFileMapSorted_
bool MultiChainEvent::toSec ( edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi,
edm::EventNumber_t  event 
)
private

Go to event with given run, lumi, and event number.

Definition at line 288 of file MultiChainEvent.cc.

References toSec().

289 {
290  return toSec(edm::EventID(run, lumi, event));
291 }
tuple lumi
Definition: fjr2json.py:35
bool toSec(Long64_t iIndex)
Go to the event from secondary files at index iIndex.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool MultiChainEvent::toSec ( edm::RunNumber_t  run,
edm::EventNumber_t  event 
)
private

Go to event with given run and event number.

Definition at line 296 of file MultiChainEvent.cc.

References toSec().

297 {
298  return toSec(edm::EventID(run, 0U, event));
299 }
bool toSec(Long64_t iIndex)
Go to the event from secondary files at index iIndex.
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
edm::TriggerNames const & MultiChainEvent::triggerNames ( edm::TriggerResults const &  triggerResults) const
virtual

Implements edm::EventBase.

Definition at line 417 of file MultiChainEvent.cc.

References event1_, event2_, edm::hlt::Exception, cscdqm::h::names, and edm::EventBase::triggerNames_().

418 {
420  if (names != 0) return *names;
421 
422  event1_->fillParameterSetRegistry();
423  names = triggerNames_(triggerResults);
424  if (names != 0) return *names;
425 
426  // If we cannot find it in the primary file, this probably will
427  // not help but try anyway
428  event2_->to(event1_->id());
429  event2_->fillParameterSetRegistry();
430  names = triggerNames_(triggerResults);
431  if (names != 0) return *names;
432 
433  throw cms::Exception("TriggerNamesNotFound")
434  << "TriggerNames not found in ParameterSet registry";
435  return *names;
436 }
static const HistoName names[]
boost::shared_ptr< ChainEvent > event2_
boost::shared_ptr< ChainEvent > event1_
static std::string const triggerResults
Definition: EdmProvDump.cc:41
static TriggerNames const * triggerNames_(edm::TriggerResults const &triggerResults)
Definition: EventBase.cc:42
edm::TriggerResultsByName MultiChainEvent::triggerResultsByName ( std::string const &  process) const
virtual

Implements edm::EventBase.

Definition at line 439 of file MultiChainEvent.cc.

References event1_, event2_, fwlite::Handle< T >::getByLabel(), fwlite::Handle< T >::isValid(), cscdqm::h::names, fwlite::Handle< T >::product(), and edm::EventBase::triggerNames_().

439  {
440 
441  fwlite::Handle<edm::TriggerResults> hTriggerResults;
442  hTriggerResults.getByLabel(*this,"TriggerResults","",process.c_str());
443  if (!hTriggerResults.isValid()) {
444  return edm::TriggerResultsByName(0,0);
445  }
446 
447  edm::TriggerNames const* names = triggerNames_(*hTriggerResults);
448 
449  if (names == 0) {
450  event1_->fillParameterSetRegistry();
451  names = triggerNames_(*hTriggerResults);
452  }
453 
454  if (names == 0) {
455  event2_->to(event1_->id());
456  event2_->fillParameterSetRegistry();
457  names = triggerNames_(*hTriggerResults);
458  }
459 
460  return edm::TriggerResultsByName(hTriggerResults.product(), names);
461 }
static const HistoName names[]
bool isValid() const
Definition: Handle.h:64
boost::shared_ptr< ChainEvent > event2_
void getByLabel(const P &iP, const char *iModuleLabel, const char *iProductInstanceLabel=0, const char *iProcessLabel=0)
Definition: Handle.h:94
boost::shared_ptr< ChainEvent > event1_
static TriggerNames const * triggerNames_(edm::TriggerResults const &triggerResults)
Definition: EventBase.cc:42
T const * product() const
Definition: Handle.h:69
tuple process
Definition: LaserDQM_cfg.py:3

Member Data Documentation

boost::shared_ptr<ChainEvent> fwlite::MultiChainEvent::event1_
private
boost::shared_ptr<ChainEvent> fwlite::MultiChainEvent::event2_
private
boost::shared_ptr<internal::MultiProductGetter> fwlite::MultiChainEvent::getter_
private

Definition at line 158 of file MultiChainEvent.h.

Referenced by MultiChainEvent().

sec_file_range_index_map fwlite::MultiChainEvent::secFileMapSorted_
private

Definition at line 165 of file MultiChainEvent.h.

Referenced by MultiChainEvent(), and toSec().

bool fwlite::MultiChainEvent::useSecFileMapSorted_
private

Definition at line 164 of file MultiChainEvent.h.

Referenced by MultiChainEvent().