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

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
void closeFile ()
 
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

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

Private Attributes

bool enablePrefetching_
 
bool enforceGUIDInFileName_
 
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().

30  input_(input),
32  sequential_(pset.getUntrackedParameter<bool>("sequential", false)),
33  sameLumiBlock_(pset.getUntrackedParameter<bool>("sameLumiBlock", false)),
34  fptr_(nullptr),
36  // The default value provided as the second argument to the getUntrackedParameter function call
37  // is not used when the ParameterSet has been validated and the parameters are not optional
38  // in the description. This is currently true when PoolSource is the primary input source.
39  // The modules that use PoolSource as a SecSource have not defined their fillDescriptions function
40  // yet, so the ParameterSet does not get validated yet. As soon as all the modules with a SecSource
41  // have defined descriptions, the defaults in the getUntrackedParameterSet function calls can
42  // and should be deleted from the code.
43  initialNumberOfEventsToSkip_(pset.getUntrackedParameter<unsigned int>("skipEvents", 0U)),
44  enablePrefetching_(false),
45  enforceGUIDInFileName_(pset.getUntrackedParameter<bool>("enforceGUIDInFileName", false)) {
46  if (noFiles()) {
47  throw Exception(errors::Configuration) << "RootEmbeddedFileSequence no input files specified for secondary input source.\n";
48  }
49  //
50  // The SiteLocalConfig controls the TTreeCache size and the prefetching settings.
52  if (pSLC.isAvailable()) {
53  enablePrefetching_ = pSLC->enablePrefetching();
54  }
55 
56  // Set the pointer to the function that reads an event.
57  if (sameLumiBlock_) {
58  if (sequential_) {
60  } else {
62  }
63  } else {
64  if (sequential_) {
66  } else {
68  }
69  }
70 
71  // For the secondary input source we do not stage in.
72  if (sequential_) {
73  // We open the first file
74  if (!atFirstFile()) {
76  initFile(false);
77  }
78  assert(rootFile());
79  rootFile()->setAtEventEntry(IndexIntoFile::invalidEntry);
80  if (!sameLumiBlock_) {
82  }
83  } else {
84  // We randomly choose the first file to open.
85  // We cannot use the random number service yet.
86  std::ifstream f("/dev/urandom");
87  unsigned int seed;
88  f.read(reinterpret_cast<char*>(&seed), sizeof(seed));
89  std::default_random_engine dre(seed);
90  size_t count = numberOfFiles();
91  std::uniform_int_distribution<int> distribution(0, count - 1);
92  while (!rootFile() && count != 0) {
93  --count;
94  int offset = distribution(dre);
97  }
98  }
99  if (rootFile()) {
100  input_.productRegistryUpdate().updateFromInput(rootFile()->productRegistry()->productList());
101  }
102  }
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 104 of file RootEmbeddedFileSequence.cc.

104 {}
edm::RootEmbeddedFileSequence::RootEmbeddedFileSequence ( RootEmbeddedFileSequence const &  )
delete

Member Function Documentation

void edm::RootEmbeddedFileSequence::closeFile_ ( )
overrideprivatevirtual

Implements edm::RootInputFileSequence.

Definition at line 108 of file RootEmbeddedFileSequence.cc.

References edm::RootInputFileSequence::rootFile().

108  {
109  // delete the RootFile object.
110  if (rootFile()) {
111  rootFile().reset();
112  }
113  }
std::shared_ptr< RootFile const > rootFile() const
void edm::RootEmbeddedFileSequence::endJob ( void  )
void edm::RootEmbeddedFileSequence::fillDescription ( ParameterSetDescription desc)
static

Definition at line 311 of file RootEmbeddedFileSequence.cc.

References edm::ParameterSetDescription::addUntracked().

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

311  {
312  desc.addUntracked<bool>("sequential", false)
313  ->setComment(
314  "True: loopEvents() reads events sequentially from beginning of first file.\n"
315  "False: loopEvents() first reads events beginning at random event. New files also chosen randomly");
316  desc.addUntracked<bool>("sameLumiBlock", false)
317  ->setComment(
318  "True: loopEvents() reads events only in same lumi as the specified event.\n"
319  "False: loopEvents() reads events regardless of lumi.");
320  desc.addUntracked<unsigned int>("skipEvents", 0U)
321  ->setComment(
322  "Skip the first 'skipEvents' events. Used only if 'sequential' is True and 'sameLumiBlock' is False");
323  desc.addUntracked<bool>("enforceGUIDInFileName", false)
324  ->setComment(
325  "True: file name part is required to be equal to the GUID of the file\n"
326  "False: file name can be anything");
327  }
void edm::RootEmbeddedFileSequence::initFile_ ( bool  skipBadFiles)
overrideprivatevirtual

Implements edm::RootInputFileSequence.

Definition at line 115 of file RootEmbeddedFileSequence.cc.

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

115  {
116  initTheFile(skipBadFiles, false, nullptr, "mixingFiles", InputType::SecondarySource);
117  }
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 119 of file RootEmbeddedFileSequence.cc.

References edm::EmbeddedRootSource::bypassVersionCheck(), enablePrefetching_, enforceGUIDInFileName_, 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().

120  {
121  size_t currentIndexIntoFile = sequenceNumberOfFile();
122  return std::make_shared<RootFile>(fileName(),
123  ProcessConfiguration(),
124  logicalFileName(),
125  filePtr,
126  input_.nStreams(),
128  input_.runHelper(),
133  currentIndexIntoFile,
138  }
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 305 of file RootEmbeddedFileSequence.cc.

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

305  {
306  assert(!sameLumiBlock_ || id != nullptr);
307  assert(sequential_ || engine != nullptr);
308  return (this->*fptr_)(cache, fileNameHash, engine, id);
309  }
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 234 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().

234  {
235  assert(rootFile());
236  assert(engine);
237  unsigned int currentSeqNumber = sequenceNumberOfFile();
238  while (eventsRemainingInFile_ == 0) {
239  unsigned int newSeqNumber = CLHEP::RandFlat::shootInt(engine, fileCatalogItems().size());
240  setAtFileSequenceNumber(newSeqNumber);
241  if (newSeqNumber != currentSeqNumber) {
242  initFile(false);
243  currentSeqNumber = newSeqNumber;
244  }
245  eventsRemainingInFile_ = rootFile()->eventTree().entries();
246  if (eventsRemainingInFile_ == 0) {
247  throw Exception(errors::NotFound) << "RootEmbeddedFileSequence::readOneRandom(): Secondary Input file "
248  << fileName() << " contains no events.\n";
249  }
250  rootFile()->setAtEventEntry(CLHEP::RandFlat::shootInt(engine, eventsRemainingInFile_) - 1);
251  }
252  rootFile()->nextEventEntry();
253 
254  bool found = rootFile()->readCurrentEvent(cache);
255  if (!found) {
256  rootFile()->setAtEventEntry(0);
257  bool found = rootFile()->readCurrentEvent(cache);
258  assert(found);
259  }
260  fileNameHash = lfnHash();
262  return true;
263  }
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 266 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().

266  {
267  assert(engine);
268  assert(idp);
269  EventID const& id = *idp;
270  if (noMoreFiles() || !rootFile() || rootFile()->indexIntoFileIter().run() != id.run() ||
271  rootFile()->indexIntoFileIter().lumi() != id.luminosityBlock()) {
272  bool found = skipToItem(id.run(), id.luminosityBlock(), 0);
273  if (!found) {
274  return false;
275  }
276  int eventsInLumi = 0;
277  assert(rootFile());
278  while (rootFile()->setEntryAtNextEventInLumi(id.run(), id.luminosityBlock()))
279  ++eventsInLumi;
280  found = skipToItem(id.run(), id.luminosityBlock(), 0);
281  assert(found);
282  int eventInLumi = CLHEP::RandFlat::shootInt(engine, eventsInLumi);
283  for (int i = 0; i < eventInLumi; ++i) {
284  bool found = rootFile()->setEntryAtNextEventInLumi(id.run(), id.luminosityBlock());
285  assert(found);
286  }
287  }
288  assert(rootFile());
289  bool found = rootFile()->setEntryAtNextEventInLumi(id.run(), id.luminosityBlock());
290  if (found) {
291  found = rootFile()->readCurrentEvent(cache);
292  }
293  if (!found) {
294  bool found = rootFile()->setEntryAtItem(id.run(), id.luminosityBlock(), 0);
295  if (!found) {
296  return false;
297  }
298  return readOneRandomWithID(cache, fileNameHash, engine, idp);
299  }
300  fileNameHash = lfnHash();
301  return true;
302  }
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 156 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().

156  {
157  assert(rootFile());
158  rootFile()->nextEventEntry();
159  bool found = rootFile()->readCurrentEvent(cache);
160  if (!found) {
161  setAtNextFile();
162  if (noMoreFiles()) {
163  setAtFirstFile();
164  }
165  initFile(false);
166  assert(rootFile());
167  rootFile()->setAtEventEntry(IndexIntoFile::invalidEntry);
168  return readOneSequential(cache, fileNameHash, nullptr, nullptr);
169  }
170  fileNameHash = lfnHash();
171  return true;
172  }
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 175 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().

175  {
176  assert(idp);
177  EventID const& id = *idp;
180  if (offset > 0) {
181  assert(rootFile());
182  while (offset > 0) {
183  bool found = readOneSequentialWithID(cache, fileNameHash, nullptr, idp);
184  if (!found) {
185  return false;
186  }
187  --offset;
188  }
189  }
190  assert(rootFile());
191  if (noMoreFiles() || rootFile()->indexIntoFileIter().run() != id.run() ||
192  rootFile()->indexIntoFileIter().lumi() != id.luminosityBlock()) {
193  bool found = skipToItem(id.run(), id.luminosityBlock(), 0, 0, false);
194  if (!found) {
195  return false;
196  }
197  }
198  assert(rootFile());
199  bool found = rootFile()->setEntryAtNextEventInLumi(id.run(), id.luminosityBlock());
200  if (found) {
201  found = rootFile()->readCurrentEvent(cache);
202  }
203  if (!found) {
204  found = skipToItemInNewFile(id.run(), id.luminosityBlock(), 0);
205  if (!found) {
206  return false;
207  }
208  return readOneSequentialWithID(cache, fileNameHash, nullptr, idp);
209  }
210  fileNameHash = lfnHash();
211  return true;
212  }
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 214 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().

216  {
217  EventID const& id = idx.eventID();
218  bool found = skipToItem(id.run(), id.luminosityBlock(), id.event(), idx.fileNameHash());
219  if (!found) {
220  throw Exception(errors::NotFound) << "RootEmbeddedFileSequence::readOneSpecified(): Secondary Input files"
221  << " do not contain specified event:\n"
222  << id << "\n";
223  }
224  assert(rootFile());
225  found = rootFile()->readCurrentEvent(cache);
226  assert(found);
227  fileNameHash = idx.fileNameHash();
228  if (fileNameHash == 0U) {
229  fileNameHash = lfnHash();
230  }
231  }
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 140 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().

140  {
141  // offset is decremented by the number of events actually skipped.
142  bool completed = rootFile()->skipEntries(offset);
143  while (!completed) {
144  setAtNextFile();
145  if (noMoreFiles()) {
146  setAtFirstFile();
147  }
148  initFile(false);
149  assert(rootFile());
150  rootFile()->setAtEventEntry(IndexIntoFile::invalidEntry);
151  completed = rootFile()->skipEntries(offset);
152  }
153  }
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().

bool edm::RootEmbeddedFileSequence::enforceGUIDInFileName_
private

Definition at line 67 of file RootEmbeddedFileSequence.h.

Referenced by makeRootFile().

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().