49 void operator()(
void*){}
65 return event_->getByProductID(iID);
76 unsigned int&
key)
const override {
77 return event_->getThinnedProduct(pid, key);
93 std::vector<edm::WrapperBase const*>& foundContainers,
94 std::vector<unsigned int>&
keys)
const override {
95 event_->getThinnedProducts(pid, foundContainers, keys);
111 Event::Event(TFile* iFile,
bool useCache,
std::function<
void (TBranch
const&)> baFunc):
120 parameterSetRegistryFilled_(
false),
121 dataHelper_(branchMap_.getEventTree(),
124 std::make_shared<internal::ProductGetter>(this),
126 if(
nullptr == iFile) {
127 throw cms::Exception(
"NoFile") <<
"The TFile pointer passed to the constructor was null";
144 <<
" does not contain a branch named 'EventAuxiliary'";
153 <<
" does not contain a branch named 'EventAux'";
196 if(eventIndex <
size()) {
211 if (iEntry <
size()) {
221 return to(run, 0
U, event);
274 return eventIndex != -1 and eventIndex <
size();
285 return eventIndex == -1
or eventIndex ==
size();
289 std::vector<std::string>
const&
302 char const* iModuleLabel,
303 char const* iProductInstanceLabel,
304 char const* iProcessLabel)
const {
310 std::type_info
const& iInfo,
311 char const* iModuleLabel,
312 char const* iProductInstanceLabel,
313 char const* iProcessLabel,
316 throw cms::Exception(
"OffEnd") <<
"You have requested data past the last event";
319 return dataHelper_.
getByLabel(iInfo, iModuleLabel, iProductInstanceLabel, iProcessLabel, oData, eventIndex);
331 if(
auxBranch_->GetEntryNumber() != eventIndex) {
354 if(
nullptr == meta) {
355 throw cms::Exception(
"NoMetaTree") <<
"The TFile does not appear to contain a TTree named " 362 b->SetAddress(&pPhm);
368 b->SetAddress(&pPhv);
370 for (
auto&
history : historyVector) {
382 if (!eventHistoryBranch)
384 <<
"Failed to find history branch in event history tree";
385 eventHistoryBranch->SetAddress(&pHistory);
391 b->SetAddress(&pEventProcessHistoryIDs);
418 std::vector<edm::WrapperBase const*>& foundContainers,
419 std::vector<unsigned int>&
keys)
const {
427 if (names !=
nullptr)
return *
names;
433 if (names !=
nullptr)
return *
names;
436 <<
"TriggerNames not found in ParameterSet registry";
446 if (
nullptr == meta) {
447 throw cms::Exception(
"NoMetaTree") <<
"The TFile does not contain a TTree named " 455 fft->SetAddress(&fftPtr);
459 typedef std::map<edm::ParameterSetID, edm::ParameterSetBlob> PsetMap;
461 TTree* psetTree(
nullptr);
463 PsetMap *psetMapPtr = &psetMap;
465 b->SetAddress(&psetMapPtr);
472 typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
474 IdToBlobs* pIdToBlob = &idToBlob;
476 for(
long long i = 0;
i != psetTree->GetEntries(); ++
i) {
477 psetTree->GetEntry(
i);
478 psetMap.insert(idToBlob);
487 for(
auto const& item : psetMap) {
489 pset.setID(item.first);
522 <<
"'\n productInstance='" << ((
nullptr != iProduct)?iProduct:
"") <<
"'\n process='" << ((
nullptr != iProcess) ? iProcess :
"") <<
"'\n" 523 "but no data is available for this Event";
530 lumi_ = std::make_shared<fwlite::LuminosityBlock> (std::shared_ptr<BranchMapReader>(&
branchMap_,NoDelete()),
535 lumi_->to(run, lumi);
std::vector< ProcessHistory > ProcessHistoryVector
std::string const & idToParameterSetBlobsBranchName()
edm::ProcessHistoryMap historyMap_
Long64_t indexFromEventId(edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event)
Find index of given event-id.
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
Event const & toBegin() override
Go to the very first Event.
fwlite::DataGetterHelper dataHelper_
edm::WrapperBase const * getThinnedProduct(edm::ProductID const &pid, unsigned int &key) const override
TrainProcessor *const proc
void getThinnedProducts(edm::ProductID const &pid, std::vector< edm::WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys) const override
bool updateEvent(Long_t eventEntry)
TFile const * getFile() const
edm::WrapperBase const * getIt(edm::ProductID const &iID) const override
unsigned long long EventNumber_t
virtual std::string const getBranchNameFor(std::type_info const &, char const *, char const *, char const *) const
edm::LuminosityBlockNumber_t luminosityBlock() const
std::string const & fileFormatVersionBranchName()
fwlite::Run const & getRun() const
std::shared_ptr< fwlite::Run > run_
ProcessHistoryID setProcessHistoryID()
TTree * eventHistoryTree_
bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *) const override
This function should only be called by fwlite::Handle<>
unsigned int LuminosityBlockNumber_t
void getThinnedProducts(edm::ProductID const &pid, std::vector< edm::WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys, Long_t eventEntry) const
std::string const getBranchNameFor(std::type_info const &, char const *iModuleLabel, char const *iProductInstanceLabel, char const *iProcessName) const override
Return the branch name in the TFile which contains the data.
Long64_t size() const
Returns number of events in the file.
fwlite::LuminosityBlock const & getLuminosityBlock() const
const std::string names[nVars_]
ProductGetter(Event *iEvent)
edm::EventAuxiliary const & eventAuxiliary() const override
EntryNumber_t findEvent(edm::RunNumber_t const &run, edm::LuminosityBlockNumber_t const &lumi, edm::EventNumber_t const &event) const
LuminosityBlockNumber_t luminosityBlock() const
std::string const & parameterSetsTreeName()
Long_t getEventEntry() const
bool atEnd() const override
static edm::ParameterSet const * parameterSetForID_(edm::ParameterSetID const &psID)
std::string const & processHistoryMapBranchName()
Event const & operator++() override
Advance to next event in the TFile.
edm::WrapperBase const * getByProductID(edm::ProductID const &pid, Long_t eventEntry) const
int getFileVersion(TFile *file)
edm::IndexIntoFile::EntryNumber_t EntryNumber_t
bool parameterSetRegistryFilled_
std::vector< std::string > procHistoryNames_
std::string const & eventHistoryBranchName()
ProcessHistoryID const & processHistoryID() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void draw(Option_t *opt)
Properly setup for edm::Ref, etc and then call TTree method.
void updateAux(Long_t eventIndex) const
bool to(Long64_t iIndex)
Go to the event at index iIndex.
std::map< ParameterSetID, ParameterSetID > ParameterSetIdConverter
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
bool insertMapped(value_type const &v, bool forceUpdate=false)
edm::EventAuxiliary const * pAux_
std::string const & metaDataTreeName()
TTree const * getEventTree() const
static std::string const triggerResults
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::string const & parameterSetMapBranchName()
std::vector< std::string > const & getProcessHistory() const
void getThinnedProducts(edm::ProductID const &pid, std::vector< edm::WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys) const
Hash< ProcessHistoryType > ProcessHistoryID
void fillIndex(BranchMapReader &branchMap)
static EntryNumber_t const invalidEntry
std::string const & processHistoryBranchName()
std::shared_ptr< fwlite::LuminosityBlock > lumi_
static TriggerNames const * triggerNames_(edm::TriggerResults const &triggerResults)
edm::ProcessHistory const & history() const
edm::WrapperBase const * getThinnedProduct(edm::ProductID const &pid, unsigned int &key) const
void conversion(EventAux const &from, EventAuxiliary &to)
fwlite::BranchMapReader branchMap_
edm::EDProductGetter const * getter() const
edm::TriggerResultsByName triggerResultsByName(edm::TriggerResults const &triggerResults) const override
unsigned int transitionIndex_() const override
std::vector< edm::EventProcessHistoryID > eventProcessHistoryIDs_
ProcessHistoryID const & processHistoryID() const
EventID const & id() const
virtual bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *, Long_t) const
static void throwProductNotFoundException(std::type_info const &, char const *, char const *, char const *)
std::string const & className() const
std::string const & eventTreeName()
std::vector< char const * > labels_
std::string const & BranchTypeToAuxBranchName(BranchType const &branchType)
edm::WrapperBase const * getThinnedProduct(edm::ProductID const &pid, unsigned int &key, Long_t eventEntry) const
void fillParameterSetRegistry() const
edm::ParameterSet const * parameterSet(edm::ParameterSetID const &psID) const override
std::string const & eventHistoryTreeName()
edm::EventAux const * pOldAux_
Long64_t scan(char const *varexp="", char const *selection="", Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0)
std::shared_ptr< RunFactory > runFactory_
std::map< ProcessHistoryID, ProcessHistory > ProcessHistoryMap
static Registry * instance()
edm::WrapperBase const * getByProductID(edm::ProductID const &) const override