CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends

fwlite::Event Class Reference

#include <Event.h>

Inheritance diagram for fwlite::Event:
fwlite::EventBase edm::EventBase

List of all members.

Public Member Functions

virtual bool atEnd () const
void draw (Option_t *opt)
 Properly setup for edm::Ref, etc and then call TTree method.
Long64_t draw (char const *varexp, const TCut &selection, Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0)
Long64_t draw (char const *varexp, char const *selection, Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0)
 Event (TFile *iFile)
virtual edm::EventAuxiliary const & eventAuxiliary () const
std::vector
< edm::BranchDescription >
const & 
getBranchDescriptions () const
virtual std::string const getBranchNameFor (std::type_info const &, char const *iModuleLabel, char const *iProductInstanceLabel, char const *iProcessName) const
 Return the branch name in the TFile which contains the data.
virtual bool getByLabel (std::type_info const &, char const *, char const *, char const *, void *) const
 This function should only be called by fwlite::Handle<>
virtual bool getByLabel (std::type_info const &, char const *, char const *, char const *, edm::WrapperHolder &) const
edm::WrapperHolder getByProductID (edm::ProductID const &) const
fwlite::LuminosityBlock const & getLuminosityBlock () const
std::vector< std::string > const & getProcessHistory () const
fwlite::Run const & getRun () const
TFile * getTFile () const
Long64_t indexFromEventId (edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event)
 Find index of given event-id.
bool isValid () const
 operator bool () const
Event const & operator++ ()
 Advance to next event in the TFile.
virtual edm::ProcessHistory const & processHistory () const
Long64_t scan (char const *varexp="", char const *selection="", Option_t *option="", Long64_t nentries=1000000000, Long64_t firstentry=0)
Long64_t size () const
 Returns number of events in the file.
bool to (edm::RunNumber_t run, edm::EventNumber_t event)
bool to (const edm::EventID &id)
 Go to event by Run & Event number.
bool to (Long64_t iIndex)
 Go to the event at index iIndex.
bool to (edm::RunNumber_t run, edm::LuminosityBlockNumber_t lumi, edm::EventNumber_t event)
Event const & toBegin ()
 Go to the very first Event.
virtual edm::TriggerNames const & triggerNames (edm::TriggerResults const &triggerResults) const
virtual edm::TriggerResultsByName triggerResultsByName (std::string const &process) const
virtual ~Event ()

Static Public Member Functions

static void throwProductNotFoundException (std::type_info const &, char const *, char const *, char const *)

Private Member Functions

 Event (Event const &)
void fillParameterSetRegistry () const
edm::ProcessHistory const & history () const
Event const & operator= (Event const &)
void setGetter (boost::shared_ptr< edm::EDProductGetter > getter)
void updateAux (Long_t eventIndex) const

Private Attributes

edm::EventAuxiliary aux_
TBranch * auxBranch_
fwlite::BranchMapReader branchMap_
fwlite::DataGetterHelper dataHelper_
EntryFinder entryFinder_
TTree * eventHistoryTree_
std::vector
< edm::EventProcessHistoryID
eventProcessHistoryIDs_
TFile * file_
int fileVersion_
edm::ProcessHistoryMap historyMap_
std::vector< char const * > labels_
boost::shared_ptr
< fwlite::LuminosityBlock
lumi_
bool parameterSetRegistryFilled_
edm::EventAuxiliarypAux_
edm::EventAuxpOldAux_
std::vector< std::string > procHistoryNames_
boost::shared_ptr< fwlite::Runrun_
boost::shared_ptr< RunFactoryrunFactory_

Friends

class ChainEvent
class EventHistoryGetter
class internal::ProductGetter

Detailed Description

Definition at line 86 of file Event.h.


Constructor & Destructor Documentation

Event::Event ( TFile *  iFile)

Definition at line 74 of file Event.cc.

References auxBranch_, branchMap_, edm::BranchTypeToAuxBranchName(), edm::BranchTypeToAuxiliaryBranchName(), eventHistoryTree_, edm::poolNames::eventHistoryTreeName(), edm::poolNames::eventTreeName(), Exception, fileVersion_, fwlite::BranchMapReader::getEventTree(), fwlite::BranchMapReader::getFileVersion(), edm::InEvent, pAux_, pOldAux_, runFactory_, and fwlite::BranchMapReader::updateEvent().

                          :
  file_(iFile),
//  eventTree_(0),
  eventHistoryTree_(0),
//  eventIndex_(-1),
  branchMap_(iFile),
  pAux_(&aux_),
  pOldAux_(0),
  fileVersion_(-1),
  parameterSetRegistryFilled_(false),
  dataHelper_(branchMap_.getEventTree(),
              boost::shared_ptr<HistoryGetterBase>(new EventHistoryGetter(this)),
              boost::shared_ptr<BranchMapReader>(&branchMap_,NoDelete()),
              boost::shared_ptr<edm::EDProductGetter>(new internal::ProductGetter(this)),
              true) {
    if(0 == iFile) {
      throw cms::Exception("NoFile") << "The TFile pointer passed to the constructor was null";
    }

    if(0 == branchMap_.getEventTree()) {
      throw cms::Exception("NoEventTree") << "The TFile contains no TTree named " << edm::poolNames::eventTreeName();
    }
    //need to know file version in order to determine how to read the basic event info
    fileVersion_ = branchMap_.getFileVersion(iFile);

    //got this logic from IOPool/Input/src/RootFile.cc

    TTree* eventTree = branchMap_.getEventTree();
    if(fileVersion_ >= 3) {
      auxBranch_ = eventTree->GetBranch(edm::BranchTypeToAuxiliaryBranchName(edm::InEvent).c_str());
      if(0 == auxBranch_) {
        throw cms::Exception("NoEventAuxilliary") << "The TTree "
        << edm::poolNames::eventTreeName()
        << " does not contain a branch named 'EventAuxiliary'";
      }
      auxBranch_->SetAddress(&pAux_);
    } else {
      pOldAux_ = new edm::EventAux();
      auxBranch_ = eventTree->GetBranch(edm::BranchTypeToAuxBranchName(edm::InEvent).c_str());
      if(0 == auxBranch_) {
        throw cms::Exception("NoEventAux") << "The TTree "
          << edm::poolNames::eventTreeName()
          << " does not contain a branch named 'EventAux'";
      }
      auxBranch_->SetAddress(&pOldAux_);
    }
    branchMap_.updateEvent(0);

    if(fileVersion_ >= 7 && fileVersion_ < 17) {
      eventHistoryTree_ = dynamic_cast<TTree*>(iFile->Get(edm::poolNames::eventHistoryTreeName().c_str()));
    }
    runFactory_ =  boost::shared_ptr<RunFactory>(new RunFactory());

}
Event::~Event ( ) [virtual]

Definition at line 134 of file Event.cc.

References labels_, and pOldAux_.

              {
  for(std::vector<char const*>::iterator it = labels_.begin(), itEnd = labels_.end();
      it != itEnd;
      ++it) {
    delete [] *it;
  }
  delete pOldAux_;
}
fwlite::Event::Event ( Event const &  ) [private]

Member Function Documentation

bool Event::atEnd ( ) const [virtual]

Implements fwlite::EventBase.

Definition at line 248 of file Event.cc.

References branchMap_, fwlite::BranchMapReader::getEventEntry(), and size().

Referenced by FWHLTTriggerTableView::fillAverageAcceptFractions(), FWFileEntry::filterEventsWithCustomParser(), getByLabel(), and main().

                   {
  Long_t eventIndex = branchMap_.getEventEntry();
  return eventIndex == -1 or eventIndex == size();
}
void Event::draw ( Option_t *  opt)

Properly setup for edm::Ref, etc and then call TTree method.

Definition at line 213 of file Event.cc.

References branchMap_, dataHelper_, fwlite::BranchMapReader::getEventTree(), and fwlite::DataGetterHelper::getter().

                                    {
   GetterOperate op(dataHelper_.getter());
   branchMap_.getEventTree()->Draw(opt);
}
Long64_t Event::draw ( char const *  varexp,
const TCut &  selection,
Option_t *  option = "",
Long64_t  nentries = 1000000000,
Long64_t  firstentry = 0 
)

Definition at line 217 of file Event.cc.

References branchMap_, dataHelper_, fwlite::BranchMapReader::getEventTree(), and fwlite::DataGetterHelper::getter().

                                                                                                                          {
   GetterOperate op(dataHelper_.getter());
   return branchMap_.getEventTree()->Draw(varexp,selection,option,nentries,firstentry);
}
Long64_t Event::draw ( char const *  varexp,
char const *  selection,
Option_t *  option = "",
Long64_t  nentries = 1000000000,
Long64_t  firstentry = 0 
)

Definition at line 221 of file Event.cc.

References branchMap_, dataHelper_, fwlite::BranchMapReader::getEventTree(), and fwlite::DataGetterHelper::getter().

                                                                                                                          {
   GetterOperate op(dataHelper_.getter());
   return branchMap_.getEventTree()->Draw(varexp,selection,option,nentries,firstentry);
}
edm::EventAuxiliary const & Event::eventAuxiliary ( ) const [virtual]

Implements edm::EventBase.

Definition at line 303 of file Event.cc.

References aux_, branchMap_, fwlite::BranchMapReader::getEventEntry(), and updateAux().

Referenced by getLuminosityBlock(), and getRun().

                            {
   Long_t eventIndex = branchMap_.getEventEntry();
   updateAux(eventIndex);
   return aux_;
}
void Event::fillParameterSetRegistry ( ) const [private]

Definition at line 409 of file Event.cc.

References b, branchMap_, Exception, edm::poolNames::fileFormatVersionBranchName(), fwlite::BranchMapReader::getFile(), i, edm::poolNames::idToParameterSetBlobsBranchName(), edm::detail::ThreadSafeRegistry< KEY, T, E >::insertMapped(), instance, edm::poolNames::metaDataTreeName(), edm::poolNames::parameterSetMapBranchName(), parameterSetRegistryFilled_, edm::FileFormatVersion::parameterSetsByReference(), edm::poolNames::parameterSetsTreeName(), edm::ParameterSet::setID(), and edm::FileFormatVersion::triggerPathsTracked().

Referenced by triggerNames(), and triggerResultsByName().

                                      {
  if (parameterSetRegistryFilled_) return;
  parameterSetRegistryFilled_ = true;

  TTree* meta = dynamic_cast<TTree*>(branchMap_.getFile()->Get(edm::poolNames::metaDataTreeName().c_str()));
  if (0 == meta) {
    throw cms::Exception("NoMetaTree") << "The TFile does not contain a TTree named "
      << edm::poolNames::metaDataTreeName();
  }

  edm::FileFormatVersion fileFormatVersion;
  edm::FileFormatVersion *fftPtr = &fileFormatVersion;
  if(meta->FindBranch(edm::poolNames::fileFormatVersionBranchName().c_str()) != 0) {
    TBranch *fft = meta->GetBranch(edm::poolNames::fileFormatVersionBranchName().c_str());
    fft->SetAddress(&fftPtr);
    fft->GetEntry(0);
  }

  typedef std::map<edm::ParameterSetID, edm::ParameterSetBlob> PsetMap;
  PsetMap psetMap;
  TTree* psetTree(0);
  if (meta->FindBranch(edm::poolNames::parameterSetMapBranchName().c_str()) != 0) {
    PsetMap *psetMapPtr = &psetMap;
    TBranch* b = meta->GetBranch(edm::poolNames::parameterSetMapBranchName().c_str());
    b->SetAddress(&psetMapPtr);
    b->GetEntry(0);
  } else if(0 == (psetTree = dynamic_cast<TTree *>(branchMap_.getFile()->Get(edm::poolNames::parameterSetsTreeName().c_str())))) {
    throw cms::Exception("NoParameterSetMapTree")
    << "The TTree "
    << edm::poolNames::parameterSetsTreeName() << " could not be found in the file.";
  } else {
    typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
    IdToBlobs idToBlob;
    IdToBlobs* pIdToBlob = &idToBlob;
    psetTree->SetBranchAddress(edm::poolNames::idToParameterSetBlobsBranchName().c_str(), &pIdToBlob);
    for(long long i = 0; i != psetTree->GetEntries(); ++i) {
      psetTree->GetEntry(i);
      psetMap.insert(idToBlob);
    }
  }
  edm::ParameterSetConverter::ParameterSetIdConverter psetIdConverter;
  if(!fileFormatVersion.triggerPathsTracked()) {
    edm::ParameterSetConverter converter(psetMap, psetIdConverter, fileFormatVersion.parameterSetsByReference());
  } else {
    // Merge into the parameter set registry.
    edm::pset::Registry& psetRegistry = *edm::pset::Registry::instance();
    for(PsetMap::const_iterator i = psetMap.begin(), iEnd = psetMap.end();
        i != iEnd; ++i) {
      edm::ParameterSet pset(i->second.pset());
      pset.setID(i->first);
      psetRegistry.insertMapped(pset);
    }
  }
}
std::vector<edm::BranchDescription> const& fwlite::Event::getBranchDescriptions ( ) const [inline]
std::string const Event::getBranchNameFor ( std::type_info const &  iInfo,
char const *  iModuleLabel,
char const *  iProductInstanceLabel,
char const *  iProcessName 
) const [virtual]

Return the branch name in the TFile which contains the data.

Implements fwlite::EventBase.

Definition at line 268 of file Event.cc.

References dataHelper_, and fwlite::DataGetterHelper::getBranchNameFor().

Referenced by FWFileEntry::runFilter().

                                                   {
    return dataHelper_.getBranchNameFor(iInfo, iModuleLabel, iProductInstanceLabel, iProcessLabel);
}
bool Event::getByLabel ( std::type_info const &  iInfo,
char const *  iModuleLabel,
char const *  iProductInstanceLabel,
char const *  iProcessLabel,
void *  oData 
) const [virtual]

This function should only be called by fwlite::Handle<>

Implements fwlite::EventBase.

Definition at line 276 of file Event.cc.

References atEnd(), branchMap_, dataHelper_, Exception, fwlite::DataGetterHelper::getByLabel(), and fwlite::BranchMapReader::getEventEntry().

                                     {
    if(atEnd()) {
        throw cms::Exception("OffEnd") << "You have requested data past the last event";
    }
    Long_t eventIndex = branchMap_.getEventEntry();
    return dataHelper_.getByLabel(iInfo, iModuleLabel, iProductInstanceLabel, iProcessLabel, oData, eventIndex);
}
bool Event::getByLabel ( std::type_info const &  iInfo,
char const *  iModuleLabel,
char const *  iProductInstanceLabel,
char const *  iProcessLabel,
edm::WrapperHolder holder 
) const [virtual]

Implements fwlite::EventBase.

Definition at line 290 of file Event.cc.

References atEnd(), branchMap_, dataHelper_, Exception, fwlite::DataGetterHelper::getByLabel(), and fwlite::BranchMapReader::getEventEntry().

                                                  {
    if(atEnd()) {
        throw cms::Exception("OffEnd") << "You have requested data past the last event";
    }
    Long_t eventIndex = branchMap_.getEventEntry();
    return dataHelper_.getByLabel(iInfo, iModuleLabel, iProductInstanceLabel, iProcessLabel, holder, eventIndex);
}
edm::WrapperHolder Event::getByProductID ( edm::ProductID const &  iID) const
fwlite::LuminosityBlock const & Event::getLuminosityBlock ( ) const

Definition at line 493 of file Event.cc.

References branchMap_, eventAuxiliary(), fjr2json::lumi, lumi_, edm::EventAuxiliary::luminosityBlock(), edm::EventAuxiliary::run(), DTTTrigCorrFirst::run, and runFactory_.

Referenced by main().

                                                             {
  if (not lumi_) {
    // Branch map pointer not really being shared, owned by event, have to trick Lumi
    lumi_ = boost::shared_ptr<fwlite::LuminosityBlock> (
             new fwlite::LuminosityBlock(boost::shared_ptr<BranchMapReader>(&branchMap_,NoDelete()),
             runFactory_)
          );
  }
  edm::RunNumber_t             run  = eventAuxiliary().run();
  edm::LuminosityBlockNumber_t lumi = eventAuxiliary().luminosityBlock();
  lumi_->to(run, lumi);
  return *lumi_;
}
std::vector< std::string > const & Event::getProcessHistory ( ) const

Definition at line 255 of file Event.cc.

References edm::ProcessHistory::begin(), edm::ProcessHistory::end(), h, history(), and procHistoryNames_.

Referenced by FWLiteJobMetadataManager::doUpdate().

                               {
  if (procHistoryNames_.empty()) {
    const edm::ProcessHistory& h = history();
    for (edm::ProcessHistory::const_iterator iproc = h.begin(), eproc = h.end();
         iproc != eproc; ++iproc) {
      procHistoryNames_.push_back(iproc->processName());
    }
  }
  return procHistoryNames_;
}
fwlite::Run const & Event::getRun ( ) const

Definition at line 507 of file Event.cc.

References branchMap_, eventAuxiliary(), edm::EventAuxiliary::run(), DTTTrigCorrFirst::run, run_, and runFactory_.

Referenced by FWMagField::checkFieldInfo(), FWL1TriggerTableView::fillTable(), and main().

                                     {
  run_ = runFactory_->makeRun(boost::shared_ptr<BranchMapReader>(&branchMap_,NoDelete()));
  edm::RunNumber_t run = eventAuxiliary().run();
  run_->to(run);
  return *run_;
}
TFile* fwlite::Event::getTFile ( ) const [inline]

Definition at line 144 of file Event.h.

References branchMap_, and fwlite::BranchMapReader::getFile().

                                 {
            return branchMap_.getFile();
         }
const edm::ProcessHistory & Event::history ( ) const [private]

Definition at line 321 of file Event.cc.

References aux_, b, branchMap_, alignCSCRings::e, edm::poolNames::eventHistoryBranchName(), eventHistoryTree_, eventProcessHistoryIDs_, Exception, edm::errors::FatalRootError, fileVersion_, fwlite::BranchMapReader::getEventEntry(), fwlite::BranchMapReader::getFile(), historyMap_, i, edm::EventAuxiliary::id(), edm::poolNames::metaDataTreeName(), edm::poolNames::processHistoryBranchName(), edm::EventAuxiliary::processHistoryID(), edm::History::processHistoryID(), edm::poolNames::processHistoryMapBranchName(), procHistoryNames_, filterCSVwithJSON::target, and updateAux().

Referenced by getProcessHistory(), fwlite::EventHistoryGetter::history(), and processHistory().

                     {
  edm::ProcessHistoryID processHistoryID;

  bool newFormat = (fileVersion_ >= 5);

  Long_t eventIndex = branchMap_.getEventEntry();
  updateAux(eventIndex);
  if (!newFormat) {
    processHistoryID = aux_.processHistoryID();
  }
  if(historyMap_.empty() || newFormat) {
    procHistoryNames_.clear();
    TTree *meta = dynamic_cast<TTree*>(branchMap_.getFile()->Get(edm::poolNames::metaDataTreeName().c_str()));
    if(0 == meta) {
      throw cms::Exception("NoMetaTree") << "The TFile does not appear to contain a TTree named "
      << edm::poolNames::metaDataTreeName();
    }
    if (historyMap_.empty()) {
      if (fileVersion_ < 11) {
        edm::ProcessHistoryMap* pPhm = &historyMap_;
        TBranch* b = meta->GetBranch(edm::poolNames::processHistoryMapBranchName().c_str());
        b->SetAddress(&pPhm);
        b->GetEntry(0);
      } else {
        edm::ProcessHistoryVector historyVector;
        edm::ProcessHistoryVector* pPhv = &historyVector;
        TBranch* b = meta->GetBranch(edm::poolNames::processHistoryBranchName().c_str());
        b->SetAddress(&pPhv);
        b->GetEntry(0);
        for (edm::ProcessHistoryVector::const_iterator i = historyVector.begin(), e = historyVector.end();
            i != e; ++i) {
          historyMap_.insert(std::make_pair(i->id(), *i));
        }
      }
    }
    if (newFormat) {
      if (fileVersion_ >= 17) {
        processHistoryID = aux_.processHistoryID();
      } else if (fileVersion_ >= 7) {
        edm::History history;
        edm::History* pHistory = &history;
        TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(edm::poolNames::eventHistoryBranchName().c_str());
        if (!eventHistoryBranch)
          throw edm::Exception(edm::errors::FatalRootError)
            << "Failed to find history branch in event history tree";
        eventHistoryBranch->SetAddress(&pHistory);
        eventHistoryTree_->GetEntry(eventIndex);
        processHistoryID = history.processHistoryID();
      } else {
        std::vector<edm::EventProcessHistoryID> *pEventProcessHistoryIDs = &eventProcessHistoryIDs_;
        TBranch* b = meta->GetBranch(edm::poolNames::eventHistoryBranchName().c_str());
        b->SetAddress(&pEventProcessHistoryIDs);
        b->GetEntry(0);
        edm::EventProcessHistoryID target(aux_.id(), edm::ProcessHistoryID());
        processHistoryID = std::lower_bound(eventProcessHistoryIDs_.begin(), eventProcessHistoryIDs_.end(), target)->processHistoryID();
      }
    }

  }

  return historyMap_[processHistoryID];
}
Long64_t Event::indexFromEventId ( edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi,
edm::EventNumber_t  event 
)
bool Event::isValid ( void  ) const

Definition at line 237 of file Event.cc.

References branchMap_, fwlite::BranchMapReader::getEventEntry(), and size().

Referenced by operator bool().

                     {
  Long_t eventIndex = branchMap_.getEventEntry();
  return eventIndex != -1 and eventIndex < size();
}
Event::operator bool ( ) const

Definition at line 243 of file Event.cc.

References isValid().

                           {
  return isValid();
}
Event const & Event::operator++ ( ) [virtual]

Advance to next event in the TFile.

Implements fwlite::EventBase.

Definition at line 159 of file Event.cc.

References branchMap_, fwlite::BranchMapReader::getEventEntry(), size(), and fwlite::BranchMapReader::updateEvent().

                  {
   Long_t eventIndex = branchMap_.getEventEntry();
   if(eventIndex < size()) {
      branchMap_.updateEvent(++eventIndex);
   }
   return *this;
}
Event const& fwlite::Event::operator= ( Event const &  ) [private]
virtual edm::ProcessHistory const& fwlite::Event::processHistory ( ) const [inline, virtual]

Implements edm::EventBase.

Definition at line 154 of file Event.h.

References history().

{return history();}
Long64_t Event::scan ( char const *  varexp = "",
char const *  selection = "",
Option_t *  option = "",
Long64_t  nentries = 1000000000,
Long64_t  firstentry = 0 
)

Definition at line 225 of file Event.cc.

References branchMap_, dataHelper_, fwlite::BranchMapReader::getEventTree(), and fwlite::DataGetterHelper::getter().

                                                                                                                          {
   GetterOperate op(dataHelper_.getter());
   return branchMap_.getEventTree()->Scan(varexp,selection,option,nentries,firstentry);
}
void fwlite::Event::setGetter ( boost::shared_ptr< edm::EDProductGetter getter) [inline, private]

Definition at line 175 of file Event.h.

References dataHelper_, and fwlite::DataGetterHelper::setGetter().

{ return dataHelper_.setGetter(getter);}
Long64_t Event::size ( void  ) const

Returns number of events in the file.

Definition at line 232 of file Event.cc.

References branchMap_, and fwlite::BranchMapReader::getEventTree().

Referenced by atEnd(), FWHLTTriggerTableView::fillAverageAcceptFractions(), isValid(), operator++(), and to().

                  {
  return branchMap_.getEventTree()->GetEntries();
}
void Event::throwProductNotFoundException ( std::type_info const &  iType,
char const *  iModule,
char const *  iProduct,
char const *  iProcess 
) [static]

Definition at line 485 of file Event.cc.

References edm::TypeID::className(), Exception, and edm::errors::ProductNotFound.

                                                                                                                               {
    edm::TypeID type(iType);
  throw edm::Exception(edm::errors::ProductNotFound) << "A branch was found for \n  type ='" << type.className() << "'\n  module='" << iModule
    << "'\n  productInstance='" << ((0!=iProduct)?iProduct:"") << "'\n  process='" << ((0 != iProcess) ? iProcess : "") << "'\n"
    "but no data is available for this Event";
}
bool Event::to ( Long64_t  iIndex)

Go to the event at index iIndex.

Definition at line 175 of file Event.cc.

References branchMap_, size(), and fwlite::BranchMapReader::updateEvent().

Referenced by FWHLTTriggerTableView::fillAverageAcceptFractions(), FWFileEntry::filterEventsWithCustomParser(), and to().

                         {
   if (iEntry < size()) {
      // this is a valid entry
      return branchMap_.updateEvent(iEntry);
   }
   // if we're here, then iEntry was not valid
   return false;
}
bool Event::to ( edm::RunNumber_t  run,
edm::EventNumber_t  event 
)

Definition at line 185 of file Event.cc.

References to().

                                                    {
   return to(run, 0U, event);
}
bool Event::to ( const edm::EventID id)

Go to event by Run & Event number.

Definition at line 200 of file Event.cc.

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

                              {
   return to(id.run(), id.luminosityBlock(), id.event());
}
bool Event::to ( edm::RunNumber_t  run,
edm::LuminosityBlockNumber_t  lumi,
edm::EventNumber_t  event 
)
Event const & Event::toBegin ( ) [virtual]
edm::TriggerNames const & Event::triggerNames ( edm::TriggerResults const &  triggerResults) const [virtual]

Implements edm::EventBase.

Definition at line 393 of file Event.cc.

References Exception, fillParameterSetRegistry(), cscdqm::h::names, parameterSetRegistryFilled_, and edm::EventBase::triggerNames_().

Referenced by FWHLTTriggerTableView::fillAverageAcceptFractions(), and FWFileEntry::filterEventsWithCustomParser().

                                                                 {
  edm::TriggerNames const* names = triggerNames_(triggerResults);
  if (names != 0) return *names;

  if (!parameterSetRegistryFilled_) {
    fillParameterSetRegistry();
    names = triggerNames_(triggerResults);
  }
  if (names != 0) return *names;

  throw cms::Exception("TriggerNamesNotFound")
    << "TriggerNames not found in ParameterSet registry";
  return *names;
}
edm::TriggerResultsByName Event::triggerResultsByName ( std::string const &  process) const [virtual]

Implements edm::EventBase.

Definition at line 465 of file Event.cc.

References fillParameterSetRegistry(), fwlite::Handle< T >::getByLabel(), fwlite::Handle< T >::isValid(), cscdqm::h::names, parameterSetRegistryFilled_, fwlite::Handle< T >::product(), and edm::EventBase::triggerNames_().

                                                          {

  fwlite::Handle<edm::TriggerResults> hTriggerResults;
  hTriggerResults.getByLabel(*this, "TriggerResults", "", process.c_str());
  if (!hTriggerResults.isValid()) {
    return edm::TriggerResultsByName(0,0);
  }

  edm::TriggerNames const* names = triggerNames_(*hTriggerResults);
  if (names == 0 && !parameterSetRegistryFilled_) {
    fillParameterSetRegistry();
    names = triggerNames_(*hTriggerResults);
  }
  return edm::TriggerResultsByName(hTriggerResults.product(), names);
}
void Event::updateAux ( Long_t  eventIndex) const [private]

Definition at line 310 of file Event.cc.

References aux_, auxBranch_, edm::conversion(), and pOldAux_.

Referenced by eventAuxiliary(), and history().

                                        {
  if(auxBranch_->GetEntryNumber() != eventIndex) {
    auxBranch_->GetEntry(eventIndex);
    //handling dealing with old version
    if(0 != pOldAux_) {
      conversion(*pOldAux_,aux_);
    }
  }
}

Friends And Related Function Documentation

friend class ChainEvent [friend]

Definition at line 165 of file Event.h.

friend class EventHistoryGetter [friend]

Definition at line 166 of file Event.h.

friend class internal::ProductGetter [friend]

Definition at line 164 of file Event.h.


Member Data Documentation

Definition at line 191 of file Event.h.

Referenced by eventAuxiliary(), history(), and updateAux().

TBranch* fwlite::Event::auxBranch_ [private]

Definition at line 195 of file Event.h.

Referenced by Event(), and updateAux().

Definition at line 199 of file Event.h.

Referenced by draw(), getBranchNameFor(), getByLabel(), getByProductID(), scan(), and setGetter().

Definition at line 192 of file Event.h.

Referenced by indexFromEventId(), and to().

Definition at line 180 of file Event.h.

Referenced by Event(), and history().

Definition at line 189 of file Event.h.

Referenced by history().

TFile* fwlite::Event::file_ [private]

Definition at line 178 of file Event.h.

Definition at line 196 of file Event.h.

Referenced by Event(), and history().

Definition at line 188 of file Event.h.

Referenced by history().

std::vector<char const*> fwlite::Event::labels_ [mutable, private]

Definition at line 187 of file Event.h.

Referenced by ~Event().

boost::shared_ptr<fwlite::LuminosityBlock> fwlite::Event::lumi_ [mutable, private]

Definition at line 182 of file Event.h.

Referenced by getLuminosityBlock().

Definition at line 197 of file Event.h.

Referenced by fillParameterSetRegistry(), triggerNames(), and triggerResultsByName().

Definition at line 193 of file Event.h.

Referenced by Event().

Definition at line 194 of file Event.h.

Referenced by Event(), updateAux(), and ~Event().

std::vector<std::string> fwlite::Event::procHistoryNames_ [mutable, private]

Definition at line 190 of file Event.h.

Referenced by getProcessHistory(), and history().

boost::shared_ptr<fwlite::Run> fwlite::Event::run_ [mutable, private]

Definition at line 183 of file Event.h.

Referenced by getRun().

boost::shared_ptr<RunFactory> fwlite::Event::runFactory_ [mutable, private]

Definition at line 200 of file Event.h.

Referenced by Event(), getLuminosityBlock(), and getRun().