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
 
const std::vector
< edm::BranchDescription > & 
getBranchDescriptions () const
 
virtual const std::string getBranchNameFor (const std::type_info &, const char *, const char *, const char *) const
 
virtual bool getByLabel (const std::type_info &, const char *, const char *, const char *, void *) const
 
edm::EDProduct const * getByProductID (edm::ProductID const &) const
 
fwlite::LuminosityBlock const & getLuminosityBlock ()
 
const std::vector< std::string > & getProcessHistory () const
 
fwlite::Run const & getRun ()
 
TFile * getTFile () const
 
TFile * getTFileSec () const
 
bool isValid () const
 
 MultiChainEvent (const std::vector< std::string > &iFileNames1, const std::vector< std::string > &iFileNames2, bool useSecFileMapSorted=false)
 
 operator bool () const
 
const MultiChainEventoperator++ ()
 
ChainEvent const * primary () 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<class T >
bool getByLabel (const InputTag &, 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 (const std::type_info &, const char *, const char *, const char *)
 

Private Member Functions

 MultiChainEvent (const Event &)
 
const MultiChainEventoperator= (const Event &)
 
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 48 of file MultiChainEvent.h.

Member Typedef Documentation

Definition at line 54 of file MultiChainEvent.h.

Definition at line 53 of file MultiChainEvent.h.

Definition at line 55 of file MultiChainEvent.h.

Constructor & Destructor Documentation

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

Definition at line 53 of file MultiChainEvent.cc.

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

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

Definition at line 156 of file MultiChainEvent.cc.

157 {
158 }
fwlite::MultiChainEvent::MultiChainEvent ( const Event )
private

Member Function Documentation

bool MultiChainEvent::atEnd ( ) const
virtual

Implements fwlite::EventBase.

Definition at line 377 of file MultiChainEvent.cc.

References event1_.

378 {
379  return event1_->atEnd();
380 }
boost::shared_ptr< ChainEvent > event1_
edm::EventAuxiliary const & MultiChainEvent::eventAuxiliary ( ) const
virtual

Implements edm::EventBase.

Definition at line 329 of file MultiChainEvent.cc.

References event1_.

330 {
331  return event1_->eventAuxiliary();
332 }
boost::shared_ptr< ChainEvent > event1_
Long64_t fwlite::MultiChainEvent::eventIndex ( ) const
inline

Definition at line 104 of file MultiChainEvent.h.

References event1_.

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

Definition at line 105 of file MultiChainEvent.h.

References event2_.

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

Reimplemented from fwlite::EventBase.

Definition at line 116 of file MultiChainEvent.h.

References event1_.

Referenced by python.Events::fileIndicies().

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

Definition at line 317 of file MultiChainEvent.cc.

References event1_.

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

Implements fwlite::EventBase.

Definition at line 308 of file MultiChainEvent.cc.

References event1_.

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

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

Implements fwlite::EventBase.

Definition at line 335 of file MultiChainEvent.cc.

References event1_, and event2_.

340 {
341  bool ret1 = event1_->getByLabel(iType,iModule,iInstance,iProcess,iValue);
342  if ( !ret1 ) {
343  (const_cast<MultiChainEvent*>(this))->toSec(event1_->id());
344  bool ret2 = event2_->getByLabel(iType,iModule,iInstance,iProcess,iValue);
345  if ( !ret2 ) return false;
346  }
347  return true;
348 }
boost::shared_ptr< ChainEvent > event2_
boost::shared_ptr< ChainEvent > event1_
edm::EDProduct const * MultiChainEvent::getByProductID ( edm::ProductID const &  iID) const

Definition at line 350 of file MultiChainEvent.cc.

References event1_, event2_, edm::hlt::Exception, and CrabTask::prod.

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

351 {
352  // First try the first file
353  edm::EDProduct const * prod = event1_->getByProductID(iID);
354  // Did not find the product, try secondary file
355  if ( 0 == prod ) {
356  (const_cast<MultiChainEvent*>(this))->toSec(event1_->id());
357  prod = event2_->getByProductID(iID);
358  if ( 0 == prod ) {
359  throw cms::Exception("ProductNotFound") << "Cannot find product " << iID;
360  }
361  }
362  return prod;
363 }
boost::shared_ptr< ChainEvent > event2_
boost::shared_ptr< ChainEvent > event1_
tuple prod
Definition: CrabTask.py:87
fwlite::LuminosityBlock const& fwlite::MultiChainEvent::getLuminosityBlock ( )
inline

Definition at line 107 of file MultiChainEvent.h.

References event1_.

107  {
108  return event1_->getLuminosityBlock();
109  }
boost::shared_ptr< ChainEvent > event1_
const std::vector< std::string > & MultiChainEvent::getProcessHistory ( ) const

Definition at line 323 of file MultiChainEvent.cc.

References event1_.

324 {
325  return event1_->getProcessHistory();
326 }
boost::shared_ptr< ChainEvent > event1_
fwlite::Run const& fwlite::MultiChainEvent::getRun ( )
inline

Definition at line 111 of file MultiChainEvent.h.

References event1_.

111  {
112  return event1_->getRun();
113  }
boost::shared_ptr< ChainEvent > event1_
TFile* fwlite::MultiChainEvent::getTFile ( ) const
inline

Definition at line 97 of file MultiChainEvent.h.

References event1_.

97  {
98  return event1_->getTFile();
99  }
boost::shared_ptr< ChainEvent > event1_
TFile* fwlite::MultiChainEvent::getTFileSec ( ) const
inline

Definition at line 100 of file MultiChainEvent.h.

References event2_.

100  {
101  return event2_->getTFile();
102  }
boost::shared_ptr< ChainEvent > event2_
bool MultiChainEvent::isValid ( void  ) const

Definition at line 367 of file MultiChainEvent.cc.

References event1_.

368 {
369  return event1_->isValid();
370 }
boost::shared_ptr< ChainEvent > event1_
MultiChainEvent::operator bool ( ) const

Definition at line 371 of file MultiChainEvent.cc.

372 {
373  return *event1_;
374 }
boost::shared_ptr< ChainEvent > event1_
const MultiChainEvent & MultiChainEvent::operator++ ( )
virtual

Implements fwlite::EventBase.

Definition at line 177 of file MultiChainEvent.cc.

References event1_.

178 {
179  event1_->operator++();
180  return *this;
181 }
boost::shared_ptr< ChainEvent > event1_
const MultiChainEvent& fwlite::MultiChainEvent::operator= ( const Event )
private
ChainEvent const* fwlite::MultiChainEvent::primary ( ) const
inline

Definition at line 128 of file MultiChainEvent.h.

References event1_.

128 { return &*event1_;}
boost::shared_ptr< ChainEvent > event1_
ChainEvent const* fwlite::MultiChainEvent::secondary ( ) const
inline

Definition at line 129 of file MultiChainEvent.h.

References event2_.

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

Reimplemented from fwlite::EventBase.

Definition at line 118 of file MultiChainEvent.h.

References event2_.

Referenced by python.Events::fileIndicies().

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

Definition at line 383 of file MultiChainEvent.cc.

References event1_.

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

Definition at line 439 of file MultiChainEvent.cc.

References fwlite::ChainEvent::throwProductNotFoundException().

442  {
443  ChainEvent::throwProductNotFoundException(iType,iModule,iInstance,iProcess);
444 }
static void throwProductNotFoundException(const std::type_info &, const char *, const char *, const char *)
Definition: ChainEvent.cc:321
bool MultiChainEvent::to ( Long64_t  iIndex)

Go to the event at index iIndex.

Definition at line 185 of file MultiChainEvent.cc.

References event1_.

Referenced by to().

186 {
187  return event1_->to( iIndex );
188 }
boost::shared_ptr< ChainEvent > event1_
bool MultiChainEvent::to ( edm::EventID  id)

Go to event with event id "id".

Definition at line 193 of file MultiChainEvent.cc.

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

194 {
195  return to(id.run(), id.luminosityBlock(), id.event());
196 }
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 207 of file MultiChainEvent.cc.

References to().

208 {
209  return to( run, 0U, event );
210 }
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 200 of file MultiChainEvent.cc.

References event1_.

201 {
202  return event1_->to( run, lumi, event );
203 }
tuple lumi
Definition: fjr2json.py:41
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 298 of file MultiChainEvent.cc.

References event1_.

299 {
300  event1_->toBegin();
301  return *this;
302 }
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 215 of file MultiChainEvent.cc.

References event2_.

Referenced by toSec().

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

Definition at line 222 of file MultiChainEvent.cc.

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

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

References toSec().

284 {
285  return toSec( edm::EventID( run, lumi, event) );
286 }
tuple lumi
Definition: fjr2json.py:41
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 291 of file MultiChainEvent.cc.

References toSec().

292 {
293  return toSec( edm::EventID( run, 0U, event) );
294 }
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 389 of file MultiChainEvent.cc.

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

390 {
391  edm::TriggerNames const* names = triggerNames_(triggerResults);
392  if (names != 0) return *names;
393 
394  event1_->fillParameterSetRegistry();
395  names = triggerNames_(triggerResults);
396  if (names != 0) return *names;
397 
398  // If we cannot find it in the primary file, this probably will
399  // not help but try anyway
400  event2_->to( event1_->id() );
401  event2_->fillParameterSetRegistry();
402  names = triggerNames_(triggerResults);
403  if (names != 0) return *names;
404 
405  throw cms::Exception("TriggerNamesNotFound")
406  << "TriggerNames not found in ParameterSet registry";
407  return *names;
408 }
boost::shared_ptr< ChainEvent > event2_
boost::shared_ptr< ChainEvent > event1_
static TriggerNames const * triggerNames_(edm::TriggerResults const &triggerResults)
Definition: EventBase.cc:42
static const HistoName names[]
edm::TriggerResultsByName MultiChainEvent::triggerResultsByName ( std::string const &  process) const
virtual

Implements edm::EventBase.

Definition at line 411 of file MultiChainEvent.cc.

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

411  {
412 
413  fwlite::Handle<edm::TriggerResults> hTriggerResults;
414  hTriggerResults.getByLabel(*this,"TriggerResults","",process.c_str());
415  if ( !hTriggerResults.isValid()) {
416  return edm::TriggerResultsByName(0,0);
417  }
418 
419  edm::TriggerNames const* names = triggerNames_(*hTriggerResults);
420 
421  if (names == 0) {
422  event1_->fillParameterSetRegistry();
423  names = triggerNames_(*hTriggerResults);
424  }
425 
426  if (names == 0) {
427  event2_->to( event1_->id() );
428  event2_->fillParameterSetRegistry();
429  names = triggerNames_(*hTriggerResults);
430  }
431 
432  return edm::TriggerResultsByName(hTriggerResults.product(), names);
433 }
bool isValid() const
Definition: Handle.h:58
boost::shared_ptr< ChainEvent > event2_
void getByLabel(const P &iP, const char *iModuleLabel, const char *iProductInstanceLabel=0, const char *iProcessLabel=0)
Definition: Handle.h:88
boost::shared_ptr< ChainEvent > event1_
static TriggerNames const * triggerNames_(edm::TriggerResults const &triggerResults)
Definition: EventBase.cc:42
tuple process
Definition: align_tpl.py:3
T const * product() const
Definition: Handle.h:63
static const HistoName names[]

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 155 of file MultiChainEvent.h.

Referenced by MultiChainEvent().

sec_file_range_index_map fwlite::MultiChainEvent::secFileMapSorted_
private

Definition at line 162 of file MultiChainEvent.h.

Referenced by MultiChainEvent(), and toSec().

bool fwlite::MultiChainEvent::useSecFileMapSorted_
private

Definition at line 161 of file MultiChainEvent.h.

Referenced by MultiChainEvent().