CMS 3D CMS Logo

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

#include <RootEmbeddedFileSequence.h>

Inheritance diagram for edm::RootEmbeddedFileSequence:
edm::RootInputFileSequence

Public Member Functions

virtual void closeFile_ () override
 
void endJob ()
 
RootEmbeddedFileSequenceoperator= (RootEmbeddedFileSequence const &)=delete
 
bool readOneEvent (EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *id)
 
bool readOneRandom (EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *)
 
bool readOneRandomWithID (EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *id)
 
bool readOneSequential (EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *)
 
bool readOneSequentialWithID (EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *id)
 
void readOneSpecified (EventPrincipal &cache, size_t &fileNameHash, SecondaryEventIDAndFileInfo const &id)
 
 RootEmbeddedFileSequence (ParameterSet const &pset, EmbeddedRootSource &input, InputFileCatalog const &catalog)
 
 RootEmbeddedFileSequence (RootEmbeddedFileSequence const &)=delete
 
void skipEntries (unsigned int offset)
 
virtual ~RootEmbeddedFileSequence ()
 
- Public Member Functions inherited from edm::RootInputFileSequence
bool containedInCurrentFile (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event) const
 
std::shared_ptr
< BranchIDListHelper const > 
fileBranchIDListHelper () const
 
std::shared_ptr
< ProductRegistry const > 
fileProductRegistry () const
 
RootInputFileSequenceoperator= (RootInputFileSequence const &)=delete
 
void readEvent (EventPrincipal &cache)
 
void readLuminosityBlock_ (LuminosityBlockPrincipal &lumiPrincipal)
 
std::shared_ptr
< LuminosityBlockAuxiliary
readLuminosityBlockAuxiliary_ ()
 
void readRun_ (RunPrincipal &runPrincipal)
 
std::shared_ptr< RunAuxiliaryreadRunAuxiliary_ ()
 
 RootInputFileSequence (ParameterSet const &pset, InputFileCatalog const &catalog)
 
 RootInputFileSequence (RootInputFileSequence const &)=delete
 
bool skipToItem (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, size_t fileNameHash=0U, bool currentFileFirst=true)
 
virtual ~RootInputFileSequence ()
 

Static Public Member Functions

static void fillDescription (ParameterSetDescription &desc)
 

Private Member Functions

virtual void initFile_ (bool skipBadFiles) override
 
virtual RootFileSharedPtr makeRootFile (std::shared_ptr< InputFile > filePtr) override
 

Private Attributes

bool enablePrefetching_
 
int eventsRemainingInFile_
 
bool(RootEmbeddedFileSequence::* fptr_ )(EventPrincipal &, size_t &, CLHEP::HepRandomEngine *, EventID const *)
 
int initialNumberOfEventsToSkip_
 
EmbeddedRootSourceinput_
 
std::vector< ProcessHistoryIDorderedProcessHistoryIDs_
 
bool sameLumiBlock_
 
bool sequential_
 

Additional Inherited Members

- Protected Types inherited from edm::RootInputFileSequence
typedef std::shared_ptr< RootFileRootFileSharedPtr
 
- Protected Member Functions inherited from edm::RootInputFileSequence
bool atFirstFile () const
 
bool atLastFile () const
 
std::string const & fallbackFileName () const
 
std::vector< FileCatalogItem >
const & 
fileCatalogItems () const
 
std::string const & fileName () const
 
std::vector< std::shared_ptr
< IndexIntoFile > > const & 
indexesIntoFiles () const
 
void initFile (bool skipBadFiles)
 
void initTheFile (bool skipBadFiles, bool deleteIndexIntoFile, InputSource *input, char const *inputTypeName, InputType inputType)
 
std::string const & lfn () const
 
size_t lfnHash () const
 
std::string const & logicalFileName () const
 
bool noFiles () const
 
bool noMoreFiles () const
 
size_t numberOfFiles () const
 
std::shared_ptr< RootFile const > rootFile () const
 
std::shared_ptr< RootFile > & rootFile ()
 
size_t sequenceNumberOfFile () const
 
void setAtFileSequenceNumber (size_t offset)
 
void setAtFirstFile ()
 
void setAtNextFile ()
 
void setAtPreviousFile ()
 
void setIndexIntoFile (size_t index)
 
void setNoMoreFiles ()
 
bool skipToItemInNewFile (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
 
bool skipToItemInNewFile (RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, size_t fileNameHash)
 
bool usedFallback () const
 

Detailed Description

Definition at line 32 of file RootEmbeddedFileSequence.h.

Constructor & Destructor Documentation

edm::RootEmbeddedFileSequence::RootEmbeddedFileSequence ( ParameterSet const &  pset,
EmbeddedRootSource input,
InputFileCatalog const &  catalog 
)
explicit

Definition at line 26 of file RootEmbeddedFileSequence.cc.

References assert(), edm::RootInputFileSequence::atFirstFile(), edm::errors::Configuration, KineDebug3::count(), enablePrefetching_, Exception, f, fptr_, edm::RootInputFileSequence::initFile(), initialNumberOfEventsToSkip_, input_, edm::IndexIntoFile::invalidEntry, edm::Service< T >::isAvailable(), edm::RootInputFileSequence::noFiles(), edm::RootInputFileSequence::numberOfFiles(), hltrates_dqm_sourceclient-live_cfg::offset, edm::VectorInputSource::productRegistryUpdate(), readOneRandom(), readOneRandomWithID(), readOneSequential(), readOneSequentialWithID(), edm::RootInputFileSequence::rootFile(), sameLumiBlock_, fileCollector::seed, sequential_, edm::RootInputFileSequence::setAtFileSequenceNumber(), edm::RootInputFileSequence::setAtFirstFile(), edm::EmbeddedRootSource::skipBadFiles(), skipEntries(), and edm::ProductRegistry::updateFromInput().

29  :
31  input_(input),
33  sequential_(pset.getUntrackedParameter<bool>("sequential", false)),
34  sameLumiBlock_(pset.getUntrackedParameter<bool>("sameLumiBlock", false)),
35  fptr_(nullptr),
37  // The default value provided as the second argument to the getUntrackedParameter function call
38  // is not used when the ParameterSet has been validated and the parameters are not optional
39  // in the description. This is currently true when PoolSource is the primary input source.
40  // The modules that use PoolSource as a SecSource have not defined their fillDescriptions function
41  // yet, so the ParameterSet does not get validated yet. As soon as all the modules with a SecSource
42  // have defined descriptions, the defaults in the getUntrackedParameterSet function calls can
43  // and should be deleted from the code.
44  initialNumberOfEventsToSkip_(pset.getUntrackedParameter<unsigned int>("skipEvents", 0U)),
45  enablePrefetching_(false) {
46 
47  if(noFiles()) {
48  throw Exception(errors::Configuration) << "RootEmbeddedFileSequence no input files specified for secondary input source.\n";
49  }
50  //
51  // The SiteLocalConfig controls the TTreeCache size and the prefetching settings.
53  if(pSLC.isAvailable()) {
54  enablePrefetching_ = pSLC->enablePrefetching();
55  }
56 
57  // Set the pointer to the function that reads an event.
58  if(sameLumiBlock_) {
59  if(sequential_) {
61  } else {
63  }
64  } else {
65  if(sequential_) {
67  } else {
69  }
70  }
71 
72  // For the secondary input source we do not stage in.
73  if(sequential_) {
74  // We open the first file
75  if(!atFirstFile()) {
77  initFile(false);
78  }
79  assert(rootFile());
80  rootFile()->setAtEventEntry(IndexIntoFile::invalidEntry);
81  if(!sameLumiBlock_) {
83  }
84  } else {
85  // We randomly choose the first file to open.
86  // We cannot use the random number service yet.
87  std::ifstream f("/dev/urandom");
88  unsigned int seed;
89  f.read(reinterpret_cast<char*>(&seed), sizeof(seed));
90  std::default_random_engine dre(seed);
91  size_t count = numberOfFiles();
92  std::uniform_int_distribution<int> distribution(0, count - 1);
93  while(!rootFile() && count != 0) {
94  --count;
95  int offset = distribution(dre);
98  }
99  }
100  if(rootFile()) {
101  input_.productRegistryUpdate().updateFromInput(rootFile()->productRegistry()->productList());
102  }
103  }
bool(RootEmbeddedFileSequence::* fptr_)(EventPrincipal &, size_t &, CLHEP::HepRandomEngine *, EventID const *)
ProductRegistry & productRegistryUpdate()
void initFile(bool skipBadFiles)
void setAtFileSequenceNumber(size_t offset)
assert(m_qm.get())
static std::string const input
Definition: EdmProvDump.cc:44
bool readOneRandomWithID(EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *id)
bool readOneSequential(EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *)
bool readOneRandom(EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *)
double f[11][100]
bool readOneSequentialWithID(EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *id)
std::shared_ptr< RootFile const > rootFile() const
static EntryNumber_t const invalidEntry
void updateFromInput(ProductList const &other)
RootInputFileSequence(ParameterSet const &pset, InputFileCatalog const &catalog)
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
void skipEntries(unsigned int offset)
edm::RootEmbeddedFileSequence::~RootEmbeddedFileSequence ( )
virtual

Definition at line 105 of file RootEmbeddedFileSequence.cc.

105  {
106  }
edm::RootEmbeddedFileSequence::RootEmbeddedFileSequence ( RootEmbeddedFileSequence const &  )
delete

Member Function Documentation

void edm::RootEmbeddedFileSequence::closeFile_ ( )
overridevirtual

Implements edm::RootInputFileSequence.

Definition at line 113 of file RootEmbeddedFileSequence.cc.

References edm::RootInputFileSequence::rootFile().

Referenced by endJob().

113  {
114  // delete the RootFile object.
115  if(rootFile()) {
116  rootFile().reset();
117  }
118  }
std::shared_ptr< RootFile const > rootFile() const
void edm::RootEmbeddedFileSequence::endJob ( void  )

Definition at line 109 of file RootEmbeddedFileSequence.cc.

References closeFile_().

109  {
110  closeFile_();
111  }
void edm::RootEmbeddedFileSequence::fillDescription ( ParameterSetDescription desc)
static

Definition at line 319 of file RootEmbeddedFileSequence.cc.

References edm::ParameterSetDescription::addUntracked().

Referenced by edm::EmbeddedRootSource::fillDescriptions().

319  {
320  desc.addUntracked<bool>("sequential", false)
321  ->setComment("True: loopEvents() reads events sequentially from beginning of first file.\n"
322  "False: loopEvents() first reads events beginning at random event. New files also chosen randomly");
323  desc.addUntracked<bool>("sameLumiBlock", false)
324  ->setComment("True: loopEvents() reads events only in same lumi as the specified event.\n"
325  "False: loopEvents() reads events regardless of lumi.");
326  desc.addUntracked<unsigned int>("skipEvents", 0U)
327  ->setComment("Skip the first 'skipEvents' events. Used only if 'sequential' is True and 'sameLumiBlock' is False");
328  }
void edm::RootEmbeddedFileSequence::initFile_ ( bool  skipBadFiles)
overrideprivatevirtual

Implements edm::RootInputFileSequence.

Definition at line 120 of file RootEmbeddedFileSequence.cc.

References edm::RootInputFileSequence::initTheFile(), and edm::SecondarySource.

120  {
121  initTheFile(skipBadFiles, false, nullptr, "mixingFiles", InputType::SecondarySource);
122  }
void initTheFile(bool skipBadFiles, bool deleteIndexIntoFile, InputSource *input, char const *inputTypeName, InputType inputType)
tuple skipBadFiles
Definition: example_cfg.py:64
RootEmbeddedFileSequence::RootFileSharedPtr edm::RootEmbeddedFileSequence::makeRootFile ( std::shared_ptr< InputFile filePtr)
overrideprivatevirtual

Implements edm::RootInputFileSequence.

Definition at line 125 of file RootEmbeddedFileSequence.cc.

References edm::EmbeddedRootSource::bypassVersionCheck(), enablePrefetching_, edm::RootInputFileSequence::fileName(), edm::RootInputFileSequence::indexesIntoFiles(), input_, edm::RootInputFileSequence::logicalFileName(), edm::EmbeddedRootSource::nStreams(), orderedProcessHistoryIDs_, edm::VectorInputSource::processHistoryRegistryForUpdate(), edm::EmbeddedRootSource::productSelectorRules(), edm::EmbeddedRootSource::runHelper(), edm::SecondarySource, edm::RootInputFileSequence::sequenceNumberOfFile(), and edm::EmbeddedRootSource::treeMaxVirtualSize().

125  {
126  size_t currentIndexIntoFile = sequenceNumberOfFile();
127  return std::make_shared<RootFile>(
128  fileName(),
129  ProcessConfiguration(),
130  logicalFileName(),
131  filePtr,
132  input_.nStreams(),
134  input_.runHelper(),
139  currentIndexIntoFile,
143  }
std::string const & logicalFileName() const
ProcessHistoryRegistry & processHistoryRegistryForUpdate()
std::string const & fileName() const
unsigned int nStreams() const
std::vector< std::shared_ptr< IndexIntoFile > > const & indexesIntoFiles() const
bool bypassVersionCheck() const
RunHelperBase * runHelper()
ProductSelectorRules const & productSelectorRules() const
std::vector< ProcessHistoryID > orderedProcessHistoryIDs_
RootEmbeddedFileSequence& edm::RootEmbeddedFileSequence::operator= ( RootEmbeddedFileSequence const &  )
delete
bool edm::RootEmbeddedFileSequence::readOneEvent ( EventPrincipal cache,
size_t &  fileNameHash,
CLHEP::HepRandomEngine *  engine,
EventID const *  id 
)

Definition at line 312 of file RootEmbeddedFileSequence.cc.

References assert(), fptr_, sameLumiBlock_, and sequential_.

312  {
313  assert(!sameLumiBlock_ || id != nullptr);
314  assert(sequential_ || engine != nullptr);
315  return (this->*fptr_)(cache, fileNameHash, engine, id);
316  }
bool(RootEmbeddedFileSequence::* fptr_)(EventPrincipal &, size_t &, CLHEP::HepRandomEngine *, EventID const *)
assert(m_qm.get())
bool edm::RootEmbeddedFileSequence::readOneRandom ( EventPrincipal cache,
size_t &  fileNameHash,
CLHEP::HepRandomEngine *  engine,
EventID const *   
)

Definition at line 240 of file RootEmbeddedFileSequence.cc.

References assert(), eventsRemainingInFile_, Exception, edm::RootInputFileSequence::fileCatalogItems(), edm::RootInputFileSequence::fileName(), newFWLiteAna::found, edm::RootInputFileSequence::initFile(), edm::RootInputFileSequence::lfnHash(), edm::errors::NotFound, edm::RootInputFileSequence::rootFile(), edm::RootInputFileSequence::sequenceNumberOfFile(), edm::RootInputFileSequence::setAtFileSequenceNumber(), and findQualityFiles::size.

Referenced by RootEmbeddedFileSequence().

240  {
241  assert(rootFile());
242  assert(engine);
243  unsigned int currentSeqNumber = sequenceNumberOfFile();
244  while(eventsRemainingInFile_ == 0) {
245 
246  unsigned int newSeqNumber = CLHEP::RandFlat::shootInt(engine, fileCatalogItems().size());
247  setAtFileSequenceNumber(newSeqNumber);
248  if(newSeqNumber != currentSeqNumber) {
249  initFile(false);
250  currentSeqNumber = newSeqNumber;
251  }
252  eventsRemainingInFile_ = rootFile()->eventTree().entries();
253  if(eventsRemainingInFile_ == 0) {
254  throw Exception(errors::NotFound) <<
255  "RootEmbeddedFileSequence::readOneRandom(): Secondary Input file " << fileName() << " contains no events.\n";
256  }
257  rootFile()->setAtEventEntry(CLHEP::RandFlat::shootInt(engine, eventsRemainingInFile_) - 1);
258  }
259  rootFile()->nextEventEntry();
260 
261  bool found = rootFile()->readCurrentEvent(cache);
262  if(!found) {
263  rootFile()->setAtEventEntry(0);
264  bool found = rootFile()->readCurrentEvent(cache);
265  assert(found);
266  }
267  fileNameHash = lfnHash();
269  return true;
270  }
void initFile(bool skipBadFiles)
std::string const & fileName() const
void setAtFileSequenceNumber(size_t offset)
assert(m_qm.get())
std::vector< FileCatalogItem > const & fileCatalogItems() const
std::shared_ptr< RootFile const > rootFile() const
tuple size
Write out results.
bool edm::RootEmbeddedFileSequence::readOneRandomWithID ( EventPrincipal cache,
size_t &  fileNameHash,
CLHEP::HepRandomEngine *  engine,
EventID const *  id 
)

Definition at line 273 of file RootEmbeddedFileSequence.cc.

References assert(), newFWLiteAna::found, i, edm::RootInputFileSequence::lfnHash(), fjr2json::lumi, edm::RootInputFileSequence::noMoreFiles(), edm::RootInputFileSequence::rootFile(), DTTTrigCorrFirst::run, and edm::RootInputFileSequence::skipToItem().

Referenced by RootEmbeddedFileSequence().

273  {
274  assert(engine);
275  assert(idp);
276  EventID const& id = *idp;
277  if(noMoreFiles() || !rootFile() ||
278  rootFile()->indexIntoFileIter().run() != id.run() ||
279  rootFile()->indexIntoFileIter().lumi() != id.luminosityBlock()) {
280  bool found = skipToItem(id.run(), id.luminosityBlock(), 0);
281  if(!found) {
282  return false;
283  }
284  int eventsInLumi = 0;
285  assert(rootFile());
286  while(rootFile()->setEntryAtNextEventInLumi(id.run(), id.luminosityBlock())) ++eventsInLumi;
287  found = skipToItem(id.run(), id.luminosityBlock(), 0);
288  assert(found);
289  int eventInLumi = CLHEP::RandFlat::shootInt(engine, eventsInLumi);
290  for(int i = 0; i < eventInLumi; ++i) {
291  bool found = rootFile()->setEntryAtNextEventInLumi(id.run(), id.luminosityBlock());
292  assert(found);
293  }
294  }
295  assert(rootFile());
296  bool found = rootFile()->setEntryAtNextEventInLumi(id.run(), id.luminosityBlock());
297  if(found) {
298  found = rootFile()->readCurrentEvent(cache);
299  }
300  if(!found) {
301  bool found = rootFile()->setEntryAtItem(id.run(), id.luminosityBlock(), 0);
302  if(!found) {
303  return false;
304  }
305  return readOneRandomWithID(cache, fileNameHash, engine, idp);
306  }
307  fileNameHash = lfnHash();
308  return true;
309  }
int i
Definition: DBlmapReader.cc:9
tuple lumi
Definition: fjr2json.py:35
assert(m_qm.get())
bool readOneRandomWithID(EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *id)
std::shared_ptr< RootFile const > rootFile() const
bool skipToItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, size_t fileNameHash=0U, bool currentFileFirst=true)
bool edm::RootEmbeddedFileSequence::readOneSequential ( EventPrincipal cache,
size_t &  fileNameHash,
CLHEP::HepRandomEngine *  ,
EventID const *   
)

Definition at line 162 of file RootEmbeddedFileSequence.cc.

References assert(), newFWLiteAna::found, edm::RootInputFileSequence::initFile(), edm::IndexIntoFile::invalidEntry, edm::RootInputFileSequence::lfnHash(), edm::RootInputFileSequence::noMoreFiles(), edm::RootInputFileSequence::rootFile(), edm::RootInputFileSequence::setAtFirstFile(), and edm::RootInputFileSequence::setAtNextFile().

Referenced by RootEmbeddedFileSequence().

162  {
163  assert(rootFile());
164  rootFile()->nextEventEntry();
165  bool found = rootFile()->readCurrentEvent(cache);
166  if(!found) {
167  setAtNextFile();
168  if(noMoreFiles()) {
169  setAtFirstFile();
170  }
171  initFile(false);
172  assert(rootFile());
173  rootFile()->setAtEventEntry(IndexIntoFile::invalidEntry);
174  return readOneSequential(cache, fileNameHash, nullptr, nullptr);
175  }
176  fileNameHash = lfnHash();
177  return true;
178  }
void initFile(bool skipBadFiles)
assert(m_qm.get())
bool readOneSequential(EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *)
std::shared_ptr< RootFile const > rootFile() const
static EntryNumber_t const invalidEntry
bool edm::RootEmbeddedFileSequence::readOneSequentialWithID ( EventPrincipal cache,
size_t &  fileNameHash,
CLHEP::HepRandomEngine *  ,
EventID const *  id 
)

Definition at line 181 of file RootEmbeddedFileSequence.cc.

References assert(), newFWLiteAna::found, initialNumberOfEventsToSkip_, edm::RootInputFileSequence::lfnHash(), fjr2json::lumi, edm::RootInputFileSequence::noMoreFiles(), hltrates_dqm_sourceclient-live_cfg::offset, edm::RootInputFileSequence::rootFile(), DTTTrigCorrFirst::run, edm::RootInputFileSequence::skipToItem(), and edm::RootInputFileSequence::skipToItemInNewFile().

Referenced by RootEmbeddedFileSequence().

181  {
182  assert(idp);
183  EventID const& id = *idp;
186  if(offset > 0) {
187  assert(rootFile());
188  while(offset > 0) {
189  bool found = readOneSequentialWithID(cache, fileNameHash, nullptr, idp);
190  if(!found) {
191  return false;
192  }
193  --offset;
194  }
195  }
196  assert(rootFile());
197  if(noMoreFiles() ||
198  rootFile()->indexIntoFileIter().run() != id.run() ||
199  rootFile()->indexIntoFileIter().lumi() != id.luminosityBlock()) {
200  bool found = skipToItem(id.run(), id.luminosityBlock(), 0, 0, false);
201  if(!found) {
202  return false;
203  }
204  }
205  assert(rootFile());
206  bool found = rootFile()->setEntryAtNextEventInLumi(id.run(), id.luminosityBlock());
207  if(found) {
208  found = rootFile()->readCurrentEvent(cache);
209  }
210  if(!found) {
211  found = skipToItemInNewFile(id.run(), id.luminosityBlock(), 0);
212  if(!found) {
213  return false;
214  }
215  return readOneSequentialWithID(cache, fileNameHash, nullptr, idp);
216  }
217  fileNameHash = lfnHash();
218  return true;
219  }
tuple lumi
Definition: fjr2json.py:35
assert(m_qm.get())
bool readOneSequentialWithID(EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *, EventID const *id)
std::shared_ptr< RootFile const > rootFile() const
bool skipToItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, size_t fileNameHash=0U, bool currentFileFirst=true)
bool skipToItemInNewFile(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event)
void edm::RootEmbeddedFileSequence::readOneSpecified ( EventPrincipal cache,
size_t &  fileNameHash,
SecondaryEventIDAndFileInfo const &  id 
)

Definition at line 222 of file RootEmbeddedFileSequence.cc.

References assert(), event(), edm::SecondaryEventIDAndFileInfo::eventID(), Exception, edm::SecondaryEventIDAndFileInfo::fileNameHash(), newFWLiteAna::found, edm::RootInputFileSequence::lfnHash(), edm::errors::NotFound, edm::RootInputFileSequence::rootFile(), DTTTrigCorrFirst::run, and edm::RootInputFileSequence::skipToItem().

222  {
223  EventID const& id = idx.eventID();
224  bool found = skipToItem(id.run(), id.luminosityBlock(), id.event(), idx.fileNameHash());
225  if(!found) {
226  throw Exception(errors::NotFound) <<
227  "RootEmbeddedFileSequence::readOneSpecified(): Secondary Input files" <<
228  " do not contain specified event:\n" << id << "\n";
229  }
230  assert(rootFile());
231  found = rootFile()->readCurrentEvent(cache);
232  assert(found);
233  fileNameHash = idx.fileNameHash();
234  if(fileNameHash == 0U) {
235  fileNameHash = lfnHash();
236  }
237  }
assert(m_qm.get())
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
std::shared_ptr< RootFile const > rootFile() const
bool skipToItem(RunNumber_t run, LuminosityBlockNumber_t lumi, EventNumber_t event, size_t fileNameHash=0U, bool currentFileFirst=true)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
void edm::RootEmbeddedFileSequence::skipEntries ( unsigned int  offset)

Definition at line 146 of file RootEmbeddedFileSequence.cc.

References assert(), edm::RootInputFileSequence::initFile(), edm::IndexIntoFile::invalidEntry, edm::RootInputFileSequence::noMoreFiles(), edm::RootInputFileSequence::rootFile(), edm::RootInputFileSequence::setAtFirstFile(), and edm::RootInputFileSequence::setAtNextFile().

Referenced by RootEmbeddedFileSequence().

146  {
147  // offset is decremented by the number of events actually skipped.
148  bool completed = rootFile()->skipEntries(offset);
149  while(!completed) {
150  setAtNextFile();
151  if(noMoreFiles()) {
152  setAtFirstFile();
153  }
154  initFile(false);
155  assert(rootFile());
156  rootFile()->setAtEventEntry(IndexIntoFile::invalidEntry);
157  completed = rootFile()->skipEntries(offset);
158  }
159  }
void initFile(bool skipBadFiles)
assert(m_qm.get())
std::shared_ptr< RootFile const > rootFile() const
static EntryNumber_t const invalidEntry

Member Data Documentation

bool edm::RootEmbeddedFileSequence::enablePrefetching_
private

Definition at line 66 of file RootEmbeddedFileSequence.h.

Referenced by makeRootFile(), and RootEmbeddedFileSequence().

int edm::RootEmbeddedFileSequence::eventsRemainingInFile_
private

Definition at line 64 of file RootEmbeddedFileSequence.h.

Referenced by readOneRandom().

bool(RootEmbeddedFileSequence::* edm::RootEmbeddedFileSequence::fptr_)(EventPrincipal &, size_t &, CLHEP::HepRandomEngine *, EventID const *)
private

Definition at line 63 of file RootEmbeddedFileSequence.h.

Referenced by readOneEvent(), and RootEmbeddedFileSequence().

int edm::RootEmbeddedFileSequence::initialNumberOfEventsToSkip_
private

Definition at line 65 of file RootEmbeddedFileSequence.h.

Referenced by readOneSequentialWithID(), and RootEmbeddedFileSequence().

EmbeddedRootSource& edm::RootEmbeddedFileSequence::input_
private

Definition at line 57 of file RootEmbeddedFileSequence.h.

Referenced by makeRootFile(), and RootEmbeddedFileSequence().

std::vector<ProcessHistoryID> edm::RootEmbeddedFileSequence::orderedProcessHistoryIDs_
private

Definition at line 59 of file RootEmbeddedFileSequence.h.

Referenced by makeRootFile().

bool edm::RootEmbeddedFileSequence::sameLumiBlock_
private

Definition at line 62 of file RootEmbeddedFileSequence.h.

Referenced by readOneEvent(), and RootEmbeddedFileSequence().

bool edm::RootEmbeddedFileSequence::sequential_
private

Definition at line 61 of file RootEmbeddedFileSequence.h.

Referenced by readOneEvent(), and RootEmbeddedFileSequence().