20 #include "Reflex/Type.h"
62 void set(boost::shared_ptr<ProductRegistry const> iReg) { reg_ = iReg;}
66 return std::auto_ptr<EventEntryDescription>();
70 boost::shared_ptr<ProductRegistry const>(reg_);
73 std::auto_ptr<EDProduct>
75 ProductRegistry::ProductList::const_iterator itFind= reg_->productList().find(k);
76 if(itFind == reg_->productList().end()) {
84 <<
"could not find branch named '"<<bDesc.
branchName()<<
"'"
85 <<
"\n Perhaps the data being requested was not saved in this file?";
92 <<
"could not find dictionary for type '"<<fullName<<
"'"
93 <<
"\n Please make sure all the necessary libraries are available.";
94 return std::auto_ptr<EDProduct>();
98 Reflex::Object wrapperObj = classType.Construct();
99 if(0 == wrapperObj.Address()) {
100 throw cms::Exception(
"FailedToCreate") <<
"could not create an instance of '"<<fullName<<
"'";
102 void*
address = wrapperObj.Address();
103 branch->SetAddress(&address);
105 Reflex::Object edProdObj = wrapperObj.CastObject(Reflex::Type::ByName(
"edm::EDProduct"));
111 <<
"failed to convert a '" << fullName
112 <<
"' to a edm::EDProduct."
113 <<
"Please contact developers since something is very wrong.";
116 return std::auto_ptr<EDProduct>(
prod);
136 boost::shared_ptr<ProductRegistry>
reg_;
138 boost::shared_ptr<FWLiteDelayedReader>
reader_;
141 std::vector<EventEntryDescription>
prov_;
147 boost::shared_ptr<edm::EventPrincipal>
ep_;
166 everythingOK_(
false) {
221 TFile*
file =
m_->tree_->GetCurrentFile();
224 TChain* chain =
dynamic_cast<TChain*
>(
m_->tree_);
229 file = chain->GetFile();
259 branch->SetAddress(&pAux);
260 branch->GetEntry(iEntry);
275 if (!eventSelectionsBranch) {
277 <<
"Failed to find event Selections branch in event tree";
279 eventSelectionsBranch->SetAddress(&pEventSelectionIDVector);
280 eventSelectionsBranch->GetEntry(iEntry);
285 if (!branchListIndexBranch) {
287 <<
"Failed to find branch list index branch in event tree";
289 branchListIndexBranch->SetAddress(&pBranchListIndexes);
290 branchListIndexBranch->GetEntry(iEntry);
293 m_->reader_->setEntry(iEntry);
296 boost::shared_ptr<edm::LuminosityBlockAuxiliary> lumiAux(
298 boost::shared_ptr<edm::LuminosityBlockPrincipal>lbp(
300 m_->ep_->fillEventPrincipal(eaux, lbp, eventSelectionIDs_, branchListIndexes_,
m_->mapper_,
m_->reader_);
301 m_->processNames_ =
m_->ep_->processHistory();
306 Operate sentry(
m_->ep_->prodGetter());
309 std::cout <<
"While processing entry "<<iEntry<<
" the following exception was caught \n"
310 << iEx.what() << std::endl;
312 std::cout <<
"While processing entry "<<iEntry<<
" an unknown exception was caught" << std::endl;
349 m_->reg_->setFrozen();
351 typedef std::map<edm::ParameterSetID, edm::ParameterSetBlob> PsetMap;
353 PsetMap *psetMapPtr = &psetMap;
360 <<
" in the input file.\n";
362 typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
364 IdToBlobs* pIdToBlob = &idToBlob;
366 for(
long long i = 0;
i != psetTree->GetEntries(); ++
i) {
367 psetTree->GetEntry(
i);
368 psetMap.insert(idToBlob);
391 metaDataTree->GetEntry(0);
395 for (PsetMap::const_iterator
i = psetMap.begin(), iEnd = psetMap.end();
398 pset.setID(
i->first);
405 m_->productMap_.erase(
m_->productMap_.begin(),
m_->productMap_.end());
406 m_->pointerToBranchBuffer_.erase(
m_->pointerToBranchBuffer_.begin(),
407 m_->pointerToBranchBuffer_.end());
415 for(edm::ProductRegistry::ProductList::const_iterator it = prodList.begin(), itEnd = prodList.end();
421 newReg->copyProduct(prod);
424 if(
m_->fileFormatVersion_.splitProductIDs()) {
426 <<
"Cannot change friendly class name algorithm without more development work\n"
427 <<
"to update BranchIDLists. Contact the framework group.\n";
431 newReg->copyProduct(newBD);
438 m_->reg_.reset(newReg.release());
444 std::vector<edm::EventEntryDescription>::iterator itB =
m_->prov_.begin();
445 m_->pointerToBranchBuffer_.reserve(prodList2.size());
447 for (edm::ProductRegistry::ProductList::const_iterator it = prodList2.begin(), itEnd = prodList2.end();
448 it != itEnd; ++it, ++itB) {
453 if (
m_->tree_->GetBranch(prod.
branchName().c_str())==0) {
456 m_->productMap_.insert(std::make_pair(it->second.oldProductID(), it->second));
std::string const & idToParameterSetBlobsBranchName()
virtual void terminate(TList &out)=0
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
BranchType const & branchType() const
virtual ~TFWLiteSelectorBasic()
std::vector< EventEntryDescription * > pointerToBranchBuffer_
void setTree(TTree *iTree)
virtual void preProcessing(const TList *in, TList &out)=0
std::string & branchName() const
std::vector< EventEntryDescription > prov_
std::map< BranchKey, BranchDescription > ProductList
virtual void SlaveTerminate()
static bool updateFromInput(BranchIDLists const &bidlists, std::string const &fileName)
virtual std::auto_ptr< EventEntryDescription > getProvenance_(BranchKey const &) const
virtual Bool_t Process(Long64_t)
boost::shared_ptr< ProductRegistry > reg_
Timestamp const & time() const
std::map< ProductID, BranchDescription > ProductMap
void setRefCoreStreamer(bool resetAll=false)
virtual void SlaveBegin(TTree *)
std::string const & fileFormatVersionBranchName()
virtual void postProcessing(TList &out)=0
std::string const & eventSelectionsBranchName()
edm::ModuleDescription md_
bool insertMapped(value_type const &v)
boost::shared_ptr< edm::EventPrincipal > ep_
virtual void process(const edm::Event &event)=0
void fillProductRegistryTransients(std::vector< ProcessConfiguration > const &pcVec, ProductRegistry const &preg, bool okToRegister=false)
std::vector< EventSelectionID > EventSelectionIDVector
std::string const & parameterSetsTreeName()
ProcessConfigurationRegistry::vector_type ProcessConfigurationVector
FileFormatVersion fileFormatVersion_
std::vector< BranchListIndex > BranchListIndexes
std::string const & className() const
std::string friendlyName(std::string const &iFullName)
std::string const & friendlyClassName() const
void updateFriendlyClassName()
std::string const & metaDataTreeName()
edm::ProcessConfiguration pc_
void insertCollection(collection_type const &c)
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::string const & processHistoryBranchName()
boost::shared_ptr< edm::root::TFWLiteSelectorMembers > m_
ProcessHistory processNames_
void setupNewFile(TFile &)
void setTree(TTree *iTree)
void set(boost::shared_ptr< ProductRegistry const > iReg)
std::string wrappedClassName(std::string const &iFullName)
virtual void Init(TTree *)
std::string const & productDescriptionBranchName()
std::string const & processConfigurationBranchName()
boost::shared_ptr< FWLiteDelayedReader > reader_
author Stefano ARGIRO author Bill Tanenbaum
std::vector< value_type > vector_type
virtual std::auto_ptr< EDProduct > getProduct_(BranchKey const &k, EDProductGetter const *ep) const
std::vector< value_type > collection_type
std::string const & branchIDListBranchName()
std::string const & branchListIndexesBranchName()
static ThreadSafeRegistry * instance()
virtual void Begin(TTree *)
void setEntry(Long64_t iEntry)
virtual void begin(TList *&in)=0
string root
initialization
boost::shared_ptr< edm::BranchMapper > mapper_