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
 
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<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 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 ( const std::vector< std::string > &  iFileNames1,
const std::vector< std::string > &  iFileNames2,
bool  useSecFileMapSorted = false 
)

Definition at line 54 of file MultiChainEvent.cc.

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

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

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

Member Function Documentation

bool MultiChainEvent::atEnd ( ) const
virtual

Implements fwlite::EventBase.

Definition at line 384 of file MultiChainEvent.cc.

References event1_.

385 {
386  return event1_->atEnd();
387 }
boost::shared_ptr< ChainEvent > event1_
edm::EventAuxiliary const & MultiChainEvent::eventAuxiliary ( ) const
virtual

Implements edm::EventBase.

Definition at line 336 of file MultiChainEvent.cc.

References event1_.

337 {
338  return event1_->eventAuxiliary();
339 }
boost::shared_ptr< ChainEvent > event1_
Long64_t fwlite::MultiChainEvent::eventIndex ( ) const
inline

Definition at line 108 of file MultiChainEvent.h.

References event1_.

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

Definition at line 109 of file MultiChainEvent.h.

References event2_.

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

Reimplemented from fwlite::EventBase.

Definition at line 120 of file MultiChainEvent.h.

References event1_.

Referenced by python.Events::fileIndicies().

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

Definition at line 318 of file MultiChainEvent.cc.

References event1_.

319 {
320  return event1_->getBranchDescriptions();
321 }
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 309 of file MultiChainEvent.cc.

References event1_.

313 {
314  return event1_->getBranchNameFor(iType,iModule,iInstance,iProcess);
315 }
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 342 of file MultiChainEvent.cc.

References event1_, and event2_.

347 {
348  bool ret1 = event1_->getByLabel(iType,iModule,iInstance,iProcess,iValue);
349  if ( !ret1 ) {
350  (const_cast<MultiChainEvent*>(this))->toSec(event1_->id());
351  bool ret2 = event2_->getByLabel(iType,iModule,iInstance,iProcess,iValue);
352  if ( !ret2 ) return false;
353  }
354  return true;
355 }
boost::shared_ptr< ChainEvent > event2_
boost::shared_ptr< ChainEvent > event1_
edm::EDProduct const * MultiChainEvent::getByProductID ( edm::ProductID const &  iID) const

Definition at line 357 of file MultiChainEvent.cc.

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

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

358 {
359  // First try the first file
360  edm::EDProduct const * prod = event1_->getByProductID(iID);
361  // Did not find the product, try secondary file
362  if ( 0 == prod ) {
363  (const_cast<MultiChainEvent*>(this))->toSec(event1_->id());
364  prod = event2_->getByProductID(iID);
365  if ( 0 == prod ) {
366  throw cms::Exception("ProductNotFound") << "Cannot find product " << iID;
367  }
368  }
369  return prod;
370 }
boost::shared_ptr< ChainEvent > event2_
boost::shared_ptr< ChainEvent > event1_
fwlite::LuminosityBlock const& fwlite::MultiChainEvent::getLuminosityBlock ( )
inline

Definition at line 111 of file MultiChainEvent.h.

References event1_.

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

Definition at line 324 of file MultiChainEvent.cc.

References event1_.

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

Definition at line 115 of file MultiChainEvent.h.

References event1_.

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

Definition at line 101 of file MultiChainEvent.h.

References event1_.

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

Definition at line 104 of file MultiChainEvent.h.

References event2_.

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

Definition at line 374 of file MultiChainEvent.cc.

References event1_.

375 {
376  return event1_->isValid();
377 }
boost::shared_ptr< ChainEvent > event1_
MultiChainEvent::operator bool ( ) const

Definition at line 378 of file MultiChainEvent.cc.

379 {
380  return *event1_;
381 }
boost::shared_ptr< ChainEvent > event1_
const MultiChainEvent & MultiChainEvent::operator++ ( )
virtual

Implements fwlite::EventBase.

Definition at line 178 of file MultiChainEvent.cc.

References event1_.

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

Definition at line 132 of file MultiChainEvent.h.

References event1_.

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

Implements edm::EventBase.

Definition at line 330 of file MultiChainEvent.cc.

References event1_.

331 {
332  return event1_->processHistory();
333 }
boost::shared_ptr< ChainEvent > event1_
ChainEvent const* fwlite::MultiChainEvent::secondary ( ) const
inline

Definition at line 133 of file MultiChainEvent.h.

References event2_.

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

Reimplemented from fwlite::EventBase.

Definition at line 122 of file MultiChainEvent.h.

References event2_.

Referenced by python.Events::fileIndicies().

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

Definition at line 390 of file MultiChainEvent.cc.

References event1_.

391 {
392  return event1_->size();
393 }
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 446 of file MultiChainEvent.cc.

References fwlite::ChainEvent::throwProductNotFoundException().

449  {
450  ChainEvent::throwProductNotFoundException(iType,iModule,iInstance,iProcess);
451 }
static void throwProductNotFoundException(const std::type_info &, const char *, const char *, const char *)
Definition: ChainEvent.cc:328
bool MultiChainEvent::to ( Long64_t  iIndex)

Go to the event at index iIndex.

Definition at line 186 of file MultiChainEvent.cc.

References event1_.

Referenced by to().

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

Go to event with event id "id".

Definition at line 194 of file MultiChainEvent.cc.

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

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

References to().

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

References event1_.

202 {
203  return event1_->to( run, lumi, event );
204 }
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 299 of file MultiChainEvent.cc.

References event1_.

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

References event2_.

Referenced by toSec().

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

Definition at line 223 of file MultiChainEvent.cc.

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

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

References toSec().

285 {
286  return toSec( edm::EventID( run, lumi, event) );
287 }
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 292 of file MultiChainEvent.cc.

References toSec().

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

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

397 {
398  edm::TriggerNames const* names = triggerNames_(triggerResults);
399  if (names != 0) return *names;
400 
401  event1_->fillParameterSetRegistry();
402  names = triggerNames_(triggerResults);
403  if (names != 0) return *names;
404 
405  // If we cannot find it in the primary file, this probably will
406  // not help but try anyway
407  event2_->to( event1_->id() );
408  event2_->fillParameterSetRegistry();
409  names = triggerNames_(triggerResults);
410  if (names != 0) return *names;
411 
412  throw cms::Exception("TriggerNamesNotFound")
413  << "TriggerNames not found in ParameterSet registry";
414  return *names;
415 }
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 418 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_().

418  {
419 
420  fwlite::Handle<edm::TriggerResults> hTriggerResults;
421  hTriggerResults.getByLabel(*this,"TriggerResults","",process.c_str());
422  if ( !hTriggerResults.isValid()) {
423  return edm::TriggerResultsByName(0,0);
424  }
425 
426  edm::TriggerNames const* names = triggerNames_(*hTriggerResults);
427 
428  if (names == 0) {
429  event1_->fillParameterSetRegistry();
430  names = triggerNames_(*hTriggerResults);
431  }
432 
433  if (names == 0) {
434  event2_->to( event1_->id() );
435  event2_->fillParameterSetRegistry();
436  names = triggerNames_(*hTriggerResults);
437  }
438 
439  return edm::TriggerResultsByName(hTriggerResults.product(), names);
440 }
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 159 of file MultiChainEvent.h.

Referenced by MultiChainEvent().

sec_file_range_index_map fwlite::MultiChainEvent::secFileMapSorted_
private

Definition at line 166 of file MultiChainEvent.h.

Referenced by MultiChainEvent(), and toSec().

bool fwlite::MultiChainEvent::useSecFileMapSorted_
private

Definition at line 165 of file MultiChainEvent.h.

Referenced by MultiChainEvent().