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

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  enforceGUIDInFileName_(pset.getUntrackedParameter<bool>("enforceGUIDInFileName", false)) {
47 
48  if(noFiles()) {
49  throw Exception(errors::Configuration) << "RootEmbeddedFileSequence no input files specified for secondary input source.\n";
50  }
51  //
52  // The SiteLocalConfig controls the TTreeCache size and the prefetching settings.
54  if(pSLC.isAvailable()) {
55  enablePrefetching_ = pSLC->enablePrefetching();
56  }
57 
58  // Set the pointer to the function that reads an event.
59  if(sameLumiBlock_) {
60  if(sequential_) {
62  } else {
64  }
65  } else {
66  if(sequential_) {
68  } else {
70  }
71  }
72 
73  // For the secondary input source we do not stage in.
74  if(sequential_) {
75  // We open the first file
76  if(!atFirstFile()) {
78  initFile(false);
79  }
80  assert(rootFile());
81  rootFile()->setAtEventEntry(IndexIntoFile::invalidEntry);
82  if(!sameLumiBlock_) {
84  }
85  } else {
86  // We randomly choose the first file to open.
87  // We cannot use the random number service yet.
88  std::ifstream f("/dev/urandom");
89  unsigned int seed;
90  f.read(reinterpret_cast<char*>(&seed), sizeof(seed));
91  std::default_random_engine dre(seed);
92  size_t count = numberOfFiles();
93  std::uniform_int_distribution<int> distribution(0, count - 1);
94  while(!rootFile() && count != 0) {
95  --count;
96  int offset = distribution(dre);
99  }
100  }
101  if(rootFile()) {
102  input_.productRegistryUpdate().updateFromInput(rootFile()->productRegistry()->productList());
103  }
104  }
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 106 of file RootEmbeddedFileSequence.cc.

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

Member Function Documentation

void edm::RootEmbeddedFileSequence::closeFile_ ( )
overridevirtual

Implements edm::RootInputFileSequence.

Definition at line 114 of file RootEmbeddedFileSequence.cc.

References edm::RootInputFileSequence::rootFile().

Referenced by endJob().

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

Definition at line 110 of file RootEmbeddedFileSequence.cc.

References closeFile_().

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

Definition at line 321 of file RootEmbeddedFileSequence.cc.

References edm::ParameterSetDescription::addUntracked().

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

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

Implements edm::RootInputFileSequence.

Definition at line 121 of file RootEmbeddedFileSequence.cc.

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

121  {
122  initTheFile(skipBadFiles, false, nullptr, "mixingFiles", InputType::SecondarySource);
123  }
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 126 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().

126  {
127  size_t currentIndexIntoFile = sequenceNumberOfFile();
128  return std::make_shared<RootFile>(
129  fileName(),
130  ProcessConfiguration(),
131  logicalFileName(),
132  filePtr,
133  input_.nStreams(),
135  input_.runHelper(),
140  currentIndexIntoFile,
145  }
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 314 of file RootEmbeddedFileSequence.cc.

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

314  {
315  assert(!sameLumiBlock_ || id != nullptr);
316  assert(sequential_ || engine != nullptr);
317  return (this->*fptr_)(cache, fileNameHash, engine, id);
318  }
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 242 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().

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

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

164  {
165  assert(rootFile());
166  rootFile()->nextEventEntry();
167  bool found = rootFile()->readCurrentEvent(cache);
168  if(!found) {
169  setAtNextFile();
170  if(noMoreFiles()) {
171  setAtFirstFile();
172  }
173  initFile(false);
174  assert(rootFile());
175  rootFile()->setAtEventEntry(IndexIntoFile::invalidEntry);
176  return readOneSequential(cache, fileNameHash, nullptr, nullptr);
177  }
178  fileNameHash = lfnHash();
179  return true;
180  }
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 183 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().

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

224  {
225  EventID const& id = idx.eventID();
226  bool found = skipToItem(id.run(), id.luminosityBlock(), id.event(), idx.fileNameHash());
227  if(!found) {
228  throw Exception(errors::NotFound) <<
229  "RootEmbeddedFileSequence::readOneSpecified(): Secondary Input files" <<
230  " do not contain specified event:\n" << id << "\n";
231  }
232  assert(rootFile());
233  found = rootFile()->readCurrentEvent(cache);
234  assert(found);
235  fileNameHash = idx.fileNameHash();
236  if(fileNameHash == 0U) {
237  fileNameHash = lfnHash();
238  }
239  }
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 148 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().

148  {
149  // offset is decremented by the number of events actually skipped.
150  bool completed = rootFile()->skipEntries(offset);
151  while(!completed) {
152  setAtNextFile();
153  if(noMoreFiles()) {
154  setAtFirstFile();
155  }
156  initFile(false);
157  assert(rootFile());
158  rootFile()->setAtEventEntry(IndexIntoFile::invalidEntry);
159  completed = rootFile()->skipEntries(offset);
160  }
161  }
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().