CMS 3D CMS Logo

fwlite::Event Class Reference

#include <DataFormats/FWLite/interface/Event.h>

List of all members.

Public Member Functions

bool atEnd () const
 Event (TFile *iFile)
 NOTE: Does NOT take ownership so iFile must remain around at least as long as Event.
const std::vector
< edm::BranchDescription > & 
getBranchDescriptions () const
const std::string getBranchNameFor (const std::type_info &, const char *, const char *, const char *) const
void getByLabel (const std::type_info &, const char *, const char *, const char *, void *) const
 This function should only be called by fwlite::Handle<>.
const std::vector< std::string > & getProcessHistory () const
edm::EventID id () const
bool isValid () const
 operator bool () const
const Eventoperator++ ()
Long64_t size () const
const edm::Timestamptime () const
bool to (edm::RunNumber_t run, edm::EventNumber_t event)
bool to (edm::EventID id)
const Eventto (Long64_t iIndex)
 Go to the event at index iIndex.
const EventtoBegin ()
 Go to the very first Event.
virtual ~Event ()

Static Public Member Functions

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

Private Types

typedef std::map
< internal::DataKey,
boost::shared_ptr
< internal::Data > > 
KeyToDataMap

Private Member Functions

 Event (const Event &)
void fillFileIndex () const
internal::DatagetBranchDataFor (const std::type_info &, const char *, const char *, const char *) const
edm::EDProduct const * getByProductID (edm::ProductID const &) const
const edm::ProcessHistoryhistory () const
const Eventoperator= (const Event &)
void updateAux (Long_t eventIndex) const

Private Attributes

edm::EventAuxiliary aux_
TBranch * auxBranch_
fwlite::BranchMapReader branchMap_
KeyToDataMap data_
TTree * eventHistoryTree_
std::vector
< edm::EventProcessHistoryID
eventProcessHistoryIDs_
edm::FileIndex fileIndex_
int fileVersion_
std::auto_ptr
< edm::EDProductGetter
getter_
edm::ProcessHistoryMap historyMap_
std::map< edm::ProductID,
boost::shared_ptr
< internal::Data > > 
idToData_
std::vector< const char * > labels_
edm::EventAuxiliarypAux_
edm::EventAuxpOldAux_
std::vector< std::string > procHistoryNames_

Friends

class internal::ProductGetter


Detailed Description

Definition at line 118 of file Event.h.


Member Typedef Documentation

typedef std::map<internal::DataKey, boost::shared_ptr<internal::Data> > fwlite::Event::KeyToDataMap [private]

Definition at line 187 of file Event.h.


Constructor & Destructor Documentation

Event::Event ( TFile *  iFile  ) 

NOTE: Does NOT take ownership so iFile must remain around at least as long as Event.

Definition at line 68 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(), getter_, edm::InEvent, pAux_, pOldAux_, and fwlite::BranchMapReader::updateEvent().

00068                           :
00069 //  file_(iFile),
00070 //  eventTree_(0),
00071   eventHistoryTree_(0),
00072 //  eventIndex_(-1),
00073   branchMap_(iFile),
00074   pAux_(&aux_),
00075   pOldAux_(0),
00076   fileVersion_(-1)
00077 {
00078     if(0==iFile) {
00079       throw cms::Exception("NoFile")<<"The TFile pointer passed to the constructor was null";
00080     }
00081     
00082     if(0==branchMap_.getEventTree()) {
00083       throw cms::Exception("NoEventTree")<<"The TFile contains no TTree named "<<edm::poolNames::eventTreeName();
00084     }
00085     //need to know file version in order to determine how to read the basic event info
00086     fileVersion_ = branchMap_.getFileVersion(iFile);
00087 
00088     //got this logic from IOPool/Input/src/RootFile.cc
00089     
00090     TTree* eventTree = branchMap_.getEventTree();
00091     if(fileVersion_ >= 3 ) {
00092       auxBranch_ = eventTree->GetBranch(edm::BranchTypeToAuxiliaryBranchName(edm::InEvent).c_str());
00093       if(0==auxBranch_) {
00094         throw cms::Exception("NoEventAuxilliary")<<"The TTree "
00095         <<edm::poolNames::eventTreeName()
00096         <<" does not contain a branch named 'EventAuxiliary'";
00097       }
00098       auxBranch_->SetAddress(&pAux_);
00099     } else {
00100       pOldAux_ = new edm::EventAux();
00101       auxBranch_ = eventTree->GetBranch(edm::BranchTypeToAuxBranchName(edm::InEvent).c_str());
00102       if(0==auxBranch_) {
00103         throw cms::Exception("NoEventAux")<<"The TTree "
00104           <<edm::poolNames::eventTreeName()
00105           <<" does not contain a branch named 'EventAux'";
00106       }
00107       auxBranch_->SetAddress(&pOldAux_);
00108     }
00109     branchMap_.updateEvent(0);
00110 
00111     if(fileVersion_ >= 7 ) {
00112       eventHistoryTree_ = dynamic_cast<TTree*>(iFile->Get(edm::poolNames::eventHistoryTreeName().c_str()));
00113     }
00114     
00115     getter_ = std::auto_ptr<edm::EDProductGetter>(new internal::ProductGetter(this));
00116 }

Event::~Event (  )  [virtual]

Definition at line 123 of file Event.cc.

References it.

00124 {
00125   for(std::vector<const char*>::iterator it = labels_.begin(), itEnd=labels_.end();
00126       it != itEnd;
00127       ++it) {
00128     delete [] *it;
00129   }
00130   delete pOldAux_;
00131 }

fwlite::Event::Event ( const Event  )  [private]


Member Function Documentation

bool Event::atEnd (  )  const

Definition at line 235 of file Event.cc.

References size.

00236 {
00237   Long_t eventIndex = branchMap_.getEventEntry();
00238   return eventIndex==-1 or eventIndex == size();
00239 }

void Event::fillFileIndex (  )  const [private]

Definition at line 166 of file Event.cc.

References b, Exception, edm::poolNames::fileIndexBranchName(), and edm::poolNames::metaDataTreeName().

00167 {
00168   if (fileIndex_.empty()) {
00169     TTree* meta = dynamic_cast<TTree*>(branchMap_.getFile()->Get(edm::poolNames::metaDataTreeName().c_str()));
00170     if (0==meta) {
00171       throw cms::Exception("NoMetaTree")<<"The TFile does not contain a TTree named "
00172         <<edm::poolNames::metaDataTreeName();
00173     }
00174     if (meta->FindBranch(edm::poolNames::fileIndexBranchName().c_str()) != 0) {
00175       edm::FileIndex* findexPtr = &fileIndex_;
00176       TBranch* b = meta->GetBranch(edm::poolNames::fileIndexBranchName().c_str());
00177       b->SetAddress(&findexPtr);
00178       b->GetEntry(0);
00179     } else {
00180       // TBD: fill the FileIndex for old file formats (prior to CMSSW 2_0_0)
00181       throw cms::Exception("NoFileIndexTree")<<"The TFile does not contain a TTree named "
00182         <<edm::poolNames::fileIndexBranchName();
00183     }
00184   }      
00185   assert(!fileIndex_.empty());
00186 }

internal::Data & Event::getBranchDataFor ( const std::type_info &  iInfo,
const char *  iModuleLabel,
const char *  iProductInstanceLabel,
const char *  iProcessLabel 
) const [private]

Definition at line 303 of file Event.cc.

References fwlite::branchNotFound, Exception, fwlite::findBranch(), edm::TypeID::friendlyClassName(), h, getDQMSummary::key, fwlite::internal::DataKey::module(), name, VarParsing::obj, fwlite::internal::DataKey::process(), fwlite::internal::DataKey::product(), edm::ProcessHistory::rbegin(), and edm::ProcessHistory::rend().

00307 {
00308   //std::cout <<iInfo.name()<<" '"<<iModuleLabel<<"' '"<< (( 0!=iProductInstanceLabel)?iProductInstanceLabel:"")<<"' '"
00309   //<<((0!=iProcessLabel)?iProcessLabel:"")<<"'"<<std::endl;
00310   //std::cout <<iInfo.name()<<std::endl;
00311   edm::TypeID type(iInfo);
00312   internal::DataKey key(type, iModuleLabel, iProductInstanceLabel, iProcessLabel);
00313   
00314   boost::shared_ptr<internal::Data> theData;
00315   DataMap::iterator itFind = data_.find(key);
00316   if(itFind == data_.end() ) {
00317     //std::cout <<"did not find the key"<<std::endl;
00318     //see if such a branch actually exists
00319     const std::string sep("_");
00320     //CHANGE: If this fails, need to lookup the the friendly name which was used to write the file
00321     std::string name(type.friendlyClassName());
00322     name +=sep+std::string(key.module());
00323     name +=sep+std::string(key.product())+sep;
00324 
00325     //if we have to lookup the process label, remember it and register the product again
00326     std::string foundProcessLabel;
00327     TBranch* branch = 0;
00328     TTree* eventTree = branchMap_.getEventTree();
00329     if (0==iProcessLabel || iProcessLabel==internal::DataKey::kEmpty ||
00330         strlen(iProcessLabel)==0) 
00331     {
00332       const std::string* lastLabel=0;
00333       //have to search in reverse order since newest are on the bottom
00334       const edm::ProcessHistory& h = history();
00335       for (edm::ProcessHistory::const_reverse_iterator iproc = h.rbegin(), eproc = h.rend();
00336            iproc != eproc;
00337            ++iproc) {
00338         lastLabel = &(iproc->processName());
00339         branch=findBranch(eventTree,name,iproc->processName());
00340         if(0!=branch) { break; }
00341       }
00342       if(0==branch) {
00343         return branchNotFound;
00344       }
00345       //do we already have this one?
00346       if(0!=lastLabel) {
00347         //std::cout <<" process name "<<*lastLabel<<std::endl;
00348         internal::DataKey fullKey(type,iModuleLabel,iProductInstanceLabel,lastLabel->c_str());
00349         itFind = data_.find(fullKey);
00350         if(itFind != data_.end()) {
00351           //remember the data we've found
00352           //std::cout <<"  key already exists"<<std::endl;
00353           theData = itFind->second;
00354         } else {
00355           //only set this if we don't already have it 
00356           // since it this string is not empty we re-register
00357           //std::cout <<"  key does not already exists"<<std::endl;
00358           foundProcessLabel = *lastLabel;
00359         }
00360       }
00361     }else {
00362       //we have all the pieces
00363       branch = findBranch(eventTree,name,key.process());
00364       if(0==branch){
00365         return branchNotFound;
00366       }
00367     }
00368     //cache the info
00369     char* newModule = new char[strlen(iModuleLabel)+1];
00370     std::strcpy(newModule,iModuleLabel);
00371     labels_.push_back(newModule);
00372     
00373     char* newProduct = const_cast<char*>(key.product());
00374     if(newProduct[0] != 0) {
00375       newProduct = new char[strlen(newProduct)+1];
00376       std::strcpy(newProduct,key.product());
00377       labels_.push_back(newProduct);
00378     }
00379     char* newProcess = const_cast<char*>(key.process());
00380     if(newProcess[0]!=0) {
00381       newProcess = new char[strlen(newProcess)+1];
00382       std::strcpy(newProcess,key.process());
00383       labels_.push_back(newProcess);
00384     }
00385     internal::DataKey newKey(edm::TypeID(iInfo),newModule,newProduct,newProcess);
00386     
00387     if(0 == theData.get() ) {
00388       //We do not already have this data as another key
00389       
00390       //Use Reflex to create an instance of the object to be used as a buffer
00391       ROOT::Reflex::Type rType = ROOT::Reflex::Type::ByTypeInfo(iInfo);
00392       if(rType == ROOT::Reflex::Type()) {
00393         throw cms::Exception("UnknownType")<<"No Reflex dictionary exists for type "<<iInfo.name();
00394       }
00395       ROOT::Reflex::Object obj = rType.Construct();
00396       
00397       if(obj.Address() == 0) {
00398         throw cms::Exception("ConstructionFailed")<<"failed to construct an instance of "<<rType.Name();
00399       }
00400       boost::shared_ptr<internal::Data> newData(new internal::Data() );
00401       newData->branch_ = branch;
00402       newData->obj_ = obj;
00403       newData->lastEvent_=-1;
00404       newData->pObj_ = obj.Address();
00405       newData->pProd_ = 0;
00406       branch->SetAddress(&(newData->pObj_));
00407       theData = newData;
00408     }
00409     itFind = data_.insert(std::make_pair(newKey, theData)).first;
00410     
00411     if(foundProcessLabel.size()) {
00412       //also remember it with the process label
00413       newProcess = new char[foundProcessLabel.size()+1];
00414       std::strcpy(newProcess,foundProcessLabel.c_str());
00415       labels_.push_back(newProcess);
00416       internal::DataKey newKey(edm::TypeID(iInfo),newModule,newProduct,newProcess);
00417 
00418       data_.insert(std::make_pair(newKey,theData));
00419     }
00420   }
00421   return *(itFind->second);
00422 }

const std::vector<edm::BranchDescription>& fwlite::Event::getBranchDescriptions (  )  const [inline]

Definition at line 155 of file Event.h.

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

00155                                                                            { 
00156         return branchMap_.getBranchDescriptions();
00157       }

const std::string Event::getBranchNameFor ( const std::type_info &  iInfo,
const char *  iModuleLabel,
const char *  iProductInstanceLabel,
const char *  iProcessLabel 
) const

Definition at line 425 of file Event.cc.

References fwlite::internal::Data::branch_.

Referenced by fwlite::Handle< T >::getBranchNameFor().

00429 {
00430   internal::Data& theData = 
00431     Event::getBranchDataFor(iInfo, iModuleLabel, iProductInstanceLabel, iProcessLabel);
00432 
00433   if (0 != theData.branch_) {
00434     return std::string(theData.branch_->GetName());
00435   }
00436   return std::string("");
00437 }

void Event::getByLabel ( const std::type_info &  iInfo,
const char *  iModuleLabel,
const char *  iProductInstanceLabel,
const char *  iProcessLabel,
void oData 
) const

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

Definition at line 440 of file Event.cc.

References fwlite::internal::Data::branch_, Exception, fwlite::getBranchData(), fwlite::internal::Data::lastEvent_, and fwlite::internal::Data::obj_.

Referenced by fwlite::Handle< T >::getByLabel().

00445 {
00446   if(atEnd()) {
00447     throw cms::Exception("OffEnd")<<"You have requested data past the last event";
00448   }
00449   void** pOData = reinterpret_cast<void**>(oData);
00450   *pOData = 0;
00451 
00452   internal::Data& theData = 
00453     Event::getBranchDataFor(iInfo, iModuleLabel, iProductInstanceLabel, iProcessLabel);
00454                       
00455   if (0 != theData.branch_) {
00456     Long_t eventIndex = branchMap_.getEventEntry();
00457     if(eventIndex != theData.lastEvent_) {
00458       //haven't gotten the data for this event
00459       //std::cout <<" getByLabel getting data"<<std::endl;
00460       getBranchData(getter_.get(), eventIndex, theData);
00461     }
00462     *pOData = theData.obj_.Address();
00463   }
00464   //std::cout << "getByLabel " << *pOData << std::endl;
00465 }

edm::EDProduct const * Event::getByProductID ( edm::ProductID const &  iID  )  const [private]

Definition at line 548 of file Event.cc.

References edm::BranchDescription::branchID(), dummy, Exception, edm::BranchDescription::fullClassName(), fwlite::getBranchData(), k, edm::BranchDescription::moduleLabel(), edm::BranchDescription::processName(), edm::BranchDescription::productInstanceName(), and edm::wrappedClassName().

Referenced by fwlite::internal::ProductGetter::getIt().

00549 {
00550   //std::cout <<"getByProductID"<<std::endl;
00551   std::map<edm::ProductID,boost::shared_ptr<internal::Data> >::const_iterator itFound = idToData_.find(iID);
00552   if(itFound == idToData_.end() ) {
00553     //std::cout <<" not found"<<std::endl;
00554     edm::BranchDescription bDesc = branchMap_.productToBranch(iID);
00555 
00556     if (!bDesc.branchID().isValid()) {
00557       return 0;
00558     }
00559 
00560     //std::cout <<"  get Type for class"<<std::endl;
00561     //Calculate the key from the branch description
00562     ROOT::Reflex::Type type( ROOT::Reflex::Type::ByName(edm::wrappedClassName(bDesc.fullClassName())));
00563     assert( ROOT::Reflex::Type() != type) ;
00564 
00565     //std::cout <<"  build key"<<std::endl;
00566     //Only the product instance label may be empty
00567     const char* pIL = bDesc.productInstanceName().c_str();
00568     if(pIL[0] == 0) {
00569       pIL = 0;
00570     }
00571     internal::DataKey k(edm::TypeID(type.TypeInfo()), 
00572                         bDesc.moduleLabel().c_str(),
00573                         pIL,
00574                         bDesc.processName().c_str());
00575     
00576     //has this already been gotten?
00577     KeyToDataMap::iterator itData = data_.find(k);
00578     if(data_.end() == itData) {
00579       //std::cout <<" calling getByLabel"<<std::endl;
00580       //ask for the data
00581       void* dummy = 0;
00582       getByLabel(type.TypeInfo(),
00583                  k.module(),
00584                  k.product(),
00585                  k.process(),
00586                  &dummy);
00587       //std::cout <<"  called"<<std::endl;
00588       if (0 == dummy) {
00589         return 0;
00590       }
00591       itData = data_.find(k);
00592       assert(itData != data_.end());
00593       //assert(0!=dummy);
00594       assert(dummy == itData->second->obj_.Address());
00595     }
00596     itFound = idToData_.insert(std::make_pair(iID,itData->second)).first;
00597   }
00598   Long_t eventIndex = branchMap_.getEventEntry();
00599   if(eventIndex != itFound->second->lastEvent_) {
00600     //haven't gotten the data for this event
00601     getBranchData(getter_.get(), eventIndex, *(itFound->second));
00602   }  
00603   if(0==itFound->second->pProd_) {
00604     //std::cout <<"  need to convert"<<std::endl;
00605     //need to convert pointer to proper type
00606     static ROOT::Reflex::Type sEDProd( ROOT::Reflex::Type::ByTypeInfo(typeid(edm::EDProduct)));
00607     //assert( sEDProd != ROOT::Reflex::Type() );
00608     ROOT::Reflex::Object edProdObj = itFound->second->obj_.CastObject( sEDProd );
00609         
00610     itFound->second->pProd_ = reinterpret_cast<edm::EDProduct*>(edProdObj.Address());
00611 
00612     //std::cout <<" type "<<typeid(itFound->second->pProd_).name()<<std::endl;
00613     if(0==itFound->second->pProd_) {
00614       cms::Exception("FailedConversion")
00615       <<"failed to convert a '"<<itFound->second->obj_.TypeOf().Name()<<"' to a edm::EDProduct";
00616     }
00617   }
00618   //std::cout <<"finished getByProductID"<<std::endl;
00619   return itFound->second->pProd_;
00620 }

const std::vector< std::string > & Event::getProcessHistory (  )  const

Definition at line 288 of file Event.cc.

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

00289 {
00290   if (procHistoryNames_.empty()) {
00291     // std::cout << "Getting new process history" << std::endl;
00292     const edm::ProcessHistory& h = history();
00293     for (edm::ProcessHistory::const_iterator iproc = h.begin(), eproc = h.end();
00294          iproc != eproc; ++iproc) {
00295       procHistoryNames_.push_back(iproc->processName());
00296       // std::cout << iproc->processName() << std::endl;
00297     }
00298   }
00299   return procHistoryNames_;
00300 }

const edm::ProcessHistory & Event::history (  )  const [private]

Definition at line 497 of file Event.cc.

References b, edm::poolNames::eventHistoryBranchName(), Exception, edm::errors::FatalRootError, edm::poolNames::metaDataTreeName(), edm::History::processHistoryID(), edm::poolNames::processHistoryMapBranchName(), and target.

00498 {
00499   edm::ProcessHistoryID processHistoryID;
00500 
00501   bool newFormat = (fileVersion_ >= 5);
00502 
00503   Long_t eventIndex = branchMap_.getEventEntry();
00504   updateAux(eventIndex);
00505   if (!newFormat) {
00506     processHistoryID = aux_.processHistoryID();
00507   }
00508   if(historyMap_.empty() || newFormat) {
00509     procHistoryNames_.clear();
00510     TTree *meta = dynamic_cast<TTree*>(branchMap_.getFile()->Get(edm::poolNames::metaDataTreeName().c_str()));
00511     if(0==meta) {
00512       throw cms::Exception("NoMetaTree")<<"The TFile does not appear to contain a TTree named "
00513       <<edm::poolNames::metaDataTreeName();
00514     }
00515     if (historyMap_.empty()) {
00516       edm::ProcessHistoryMap* pPhm=&historyMap_;
00517       TBranch* b = meta->GetBranch(edm::poolNames::processHistoryMapBranchName().c_str());
00518       b->SetAddress(&pPhm);
00519       b->GetEntry(0);
00520     }
00521     if (newFormat) {
00522       if (fileVersion_ >= 7) {
00523         edm::History history;
00524         edm::History* pHistory = &history;
00525         TBranch* eventHistoryBranch = eventHistoryTree_->GetBranch(edm::poolNames::eventHistoryBranchName().c_str());
00526         if (!eventHistoryBranch)
00527           throw edm::Exception(edm::errors::FatalRootError)
00528             << "Failed to find history branch in event history tree";
00529         eventHistoryBranch->SetAddress(&pHistory);
00530         eventHistoryTree_->GetEntry(eventIndex);
00531         processHistoryID = history.processHistoryID();
00532       } else {
00533         std::vector<edm::EventProcessHistoryID> *pEventProcessHistoryIDs = &eventProcessHistoryIDs_;
00534         TBranch* b = meta->GetBranch(edm::poolNames::eventHistoryBranchName().c_str());
00535         b->SetAddress(&pEventProcessHistoryIDs);
00536         b->GetEntry(0);
00537         edm::EventProcessHistoryID target(aux_.id(), edm::ProcessHistoryID());
00538         processHistoryID = std::lower_bound(eventProcessHistoryIDs_.begin(), eventProcessHistoryIDs_.end(), target)->processHistoryID_;
00539       } 
00540     } 
00541 
00542   }
00543   
00544   return historyMap_[processHistoryID];
00545 }

edm::EventID Event::id ( void   )  const

Definition at line 468 of file Event.cc.

00469 {
00470   Long_t eventIndex = branchMap_.getEventEntry();
00471   updateAux(eventIndex);
00472   return aux_.id();
00473 }

bool Event::isValid ( void   )  const

Definition at line 222 of file Event.cc.

References and, and size.

00223 {
00224   Long_t eventIndex = branchMap_.getEventEntry();
00225   return eventIndex!=-1 and eventIndex < size(); 
00226 }

Event::operator bool (  )  const

Definition at line 229 of file Event.cc.

00230 {
00231   return isValid();
00232 }

const Event & Event::operator++ (  ) 

Definition at line 149 of file Event.cc.

References size.

00150 {
00151   Long_t eventIndex = branchMap_.getEventEntry();
00152   if(eventIndex < size()) {
00153     branchMap_.updateEvent(++eventIndex);
00154   }
00155   return *this;
00156 }

const Event& fwlite::Event::operator= ( const Event  )  [private]

Long64_t Event::size ( void   )  const

Definition at line 216 of file Event.cc.

00217 {
00218   return branchMap_.getEventTree()->GetEntries();
00219 }

void Event::throwProductNotFoundException ( const std::type_info &  iType,
const char *  iModule,
const char *  iProduct,
const char *  iProcess 
) [static]

Definition at line 626 of file Event.cc.

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

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

const edm::Timestamp & Event::time (  )  const

Definition at line 476 of file Event.cc.

00477 {
00478   Long_t eventIndex = branchMap_.getEventEntry();
00479   updateAux(eventIndex);
00480   return aux_.time();
00481 }

bool Event::to ( edm::RunNumber_t  run,
edm::EventNumber_t  event 
)

Definition at line 189 of file Event.cc.

References i.

00190 {
00191   fillFileIndex();
00192   edm::FileIndex::const_iterator i = fileIndex_.findEventPosition(run, 0, event, true);
00193   if (fileIndex_.end() != i) {
00194     return branchMap_.updateEvent(i->entry_);
00195   }
00196   return false;
00197 }

bool Event::to ( edm::EventID  id  ) 

Definition at line 200 of file Event.cc.

References event(), and mergeAndRegister_online::run.

00201 {
00202   return to(id.run(), id.event());
00203 }

const Event & Event::to ( Long64_t  iIndex  ) 

Go to the event at index iIndex.

Definition at line 159 of file Event.cc.

00160 {
00161   branchMap_.updateEvent(iEntry);
00162   return *this;
00163 }

const Event & Event::toBegin (  ) 

Go to the very first Event.

Definition at line 206 of file Event.cc.

00207 {
00208   branchMap_.updateEvent(0);
00209   return *this;
00210 }

void Event::updateAux ( Long_t  eventIndex  )  const [private]

Definition at line 485 of file Event.cc.

References edm::conversion().

00486 {
00487   if(auxBranch_->GetEntryNumber() != eventIndex) {
00488     auxBranch_->GetEntry(eventIndex);
00489     //handling dealing with old version
00490     if(0 != pOldAux_) {
00491       conversion(*pOldAux_,aux_);
00492     }
00493   }
00494 }


Friends And Related Function Documentation

friend class internal::ProductGetter [friend]

Definition at line 166 of file Event.h.


Member Data Documentation

edm::EventAuxiliary fwlite::Event::aux_ [mutable, private]

Definition at line 194 of file Event.h.

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

Definition at line 198 of file Event.h.

Referenced by Event().

fwlite::BranchMapReader fwlite::Event::branchMap_ [mutable, private]

Definition at line 184 of file Event.h.

Referenced by Event(), and getBranchDescriptions().

KeyToDataMap fwlite::Event::data_ [mutable, private]

Definition at line 188 of file Event.h.

TTree* fwlite::Event::eventHistoryTree_ [private]

Definition at line 182 of file Event.h.

Referenced by Event().

std::vector<edm::EventProcessHistoryID> fwlite::Event::eventProcessHistoryIDs_ [mutable, private]

Definition at line 192 of file Event.h.

edm::FileIndex fwlite::Event::fileIndex_ [mutable, private]

Definition at line 195 of file Event.h.

int fwlite::Event::fileVersion_ [private]

Definition at line 199 of file Event.h.

Referenced by Event().

std::auto_ptr<edm::EDProductGetter> fwlite::Event::getter_ [private]

Definition at line 207 of file Event.h.

Referenced by Event().

edm::ProcessHistoryMap fwlite::Event::historyMap_ [mutable, private]

Definition at line 191 of file Event.h.

std::map<edm::ProductID,boost::shared_ptr<internal::Data> > fwlite::Event::idToData_ [mutable, private]

Definition at line 202 of file Event.h.

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

Definition at line 190 of file Event.h.

edm::EventAuxiliary* fwlite::Event::pAux_ [private]

Definition at line 196 of file Event.h.

Referenced by Event().

edm::EventAux* fwlite::Event::pOldAux_ [private]

Definition at line 197 of file Event.h.

Referenced by Event().

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

Definition at line 193 of file Event.h.


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:47:05 2009 for CMSSW by  doxygen 1.5.4