53 #include "Reflex/Type.h"
62 void set(std::shared_ptr<ProductRegistry const> iReg) { reg_ = iReg;}
67 return std::auto_ptr<EventEntryDescription>();
73 std::shared_ptr<ProductRegistry const>(reg_);
76 std::unique_ptr<WrapperBase>
81 std::unique_ptr<WrapperBase>
83 ProductRegistry::ProductList::const_iterator itFind= reg_->productList().find(k);
84 if(itFind == reg_->productList().end()) {
90 if(
nullptr == branch) {
92 <<
"could not find branch named '" << bDesc.
branchName() <<
"'"
93 <<
"\n Perhaps the data being requested was not saved in this file?";
100 <<
"could not find dictionary for type '" << fullName <<
"'"
101 <<
"\n Please make sure all the necessary libraries are available.";
105 Reflex::Object wrapperObj = classType.Construct();
106 if(
nullptr == wrapperObj.Address()) {
107 throw cms::Exception(
"FailedToCreate") <<
"could not create an instance of '" << fullName <<
"'";
109 void* address = wrapperObj.Address();
110 branch->SetAddress(&address);
111 Reflex::Object edProdObj = wrapperObj.CastObject(Reflex::Type::ByName(
"edm::WrapperBase"));
115 if(
nullptr == prod) {
117 <<
"failed to convert a '" << fullName
118 <<
"' to a edm::WrapperBase."
119 <<
"Please contact developers since something is very wrong.";
122 return std::unique_ptr<WrapperBase>(
prod);
143 std::shared_ptr<ProductRegistry>
reg_;
144 std::shared_ptr<ProcessHistoryRegistry>
phreg_;
148 std::vector<EventEntryDescription>
prov_;
154 std::shared_ptr<edm::EventPrincipal>
ep_;
173 everythingOK_(
false) {
213 if(iTree ==
nullptr)
return;
223 if(
nullptr ==
m_->tree_) {
227 TFile*
file =
m_->tree_->GetCurrentFile();
228 if(
nullptr == file) {
230 TChain* chain =
dynamic_cast<TChain*
>(
m_->tree_);
231 if(
nullptr == chain) {
235 file = chain->GetFile();
236 if(
nullptr == file) {
265 branch->SetAddress(&pAux);
266 branch->GetEntry(iEntry);
278 if(!eventSelectionsBranch) {
280 <<
"Failed to find event Selections branch in event tree";
282 eventSelectionsBranch->SetAddress(&pEventSelectionIDVector);
283 eventSelectionsBranch->GetEntry(iEntry);
288 if(!branchListIndexBranch) {
290 <<
"Failed to find branch list index branch in event tree";
292 branchListIndexBranch->SetAddress(&pBranchListIndexes);
293 branchListIndexBranch->GetEntry(iEntry);
294 m_->branchIDListHelper_->fixBranchListIndexes(branchListIndexes);
297 m_->reader_->setEntry(iEntry);
298 auto runAux = std::make_shared<edm::RunAuxiliary>(aux.
run(), aux.
time(), aux.
time());
299 auto rp = std::make_shared<edm::RunPrincipal>(runAux,
m_->reg_,
m_->pc_,
nullptr, 0);
300 auto lumiAux = std::make_shared<edm::LuminosityBlockAuxiliary>(rp->run(), 1, aux.
time(), aux.
time());
301 auto lbp = std::make_shared<edm::LuminosityBlockPrincipal>(lumiAux,
m_->reg_,
m_->pc_,
nullptr, 0);
302 m_->ep_->fillEventPrincipal(*eaux,
304 std::move(eventSelectionIDs),
305 std::move(branchListIndexes),
306 *(
m_->provRetriever_),
308 lbp->setRunPrincipal(rp);
309 m_->ep_->setLuminosityBlockPrincipal(lbp);
310 m_->processNames_ =
m_->ep_->processHistory();
315 Operate sentry(
m_->ep_->prodGetter());
318 std::cout <<
"While processing entry " << iEntry <<
" the following exception was caught \n"
319 << iEx.what() << std::endl;
321 std::cout <<
"While processing entry " << iEntry <<
" an unknown exception was caught" << std::endl;
358 typedef std::map<edm::ParameterSetID, edm::ParameterSetBlob> PsetMap;
360 PsetMap *psetMapPtr = &psetMap;
365 if(
nullptr == psetTree) {
367 <<
" in the input file.\n";
369 typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
371 IdToBlobs* pIdToBlob = &idToBlob;
373 for(
long long i = 0;
i != psetTree->GetEntries(); ++
i) {
374 psetTree->GetEntry(
i);
375 psetMap.insert(idToBlob);
392 auto branchIDListsHelper = std::make_shared<edm::BranchIDListHelper>();
398 metaDataTree->GetEntry(0);
400 for(
auto&
prod :
m_->reg_->productListUpdator()) {
406 for(
auto const& entry : psetMap) {
408 pset.
setID(entry.first);
412 for(
auto const& ph : pHistVector) {
413 m_->phreg_->registerProcessHistory(ph);
416 m_->pointerToBranchBuffer_.erase(
m_->pointerToBranchBuffer_.begin(),
417 m_->pointerToBranchBuffer_.end());
423 for(
auto& item : prodList) {
428 newReg->copyProduct(prod);
430 if(
m_->fileFormatVersion_.splitProductIDs()) {
432 <<
"Cannot change friendly class name algorithm without more development work\n"
433 <<
"to update BranchIDLists. Contact the framework group.\n";
437 newReg->copyProduct(newBD);
442 m_->reg_.reset(newReg.release());
448 m_->pointerToBranchBuffer_.reserve(prodList2.size());
450 for(
auto& item : prodList2) {
455 if(
m_->tree_->GetBranch(prod.
branchName().c_str()) ==
nullptr) {
467 m_->branchIDListHelper_->updateFromInput(*branchIDListsPtr);
468 m_->reg_->setFrozen();
void setID(ParameterSetID const &id)
std::string const & idToParameterSetBlobsBranchName()
virtual void terminate(TList &out)=0
std::vector< ProcessConfiguration > ProcessConfigurationVector
virtual void mergeReaders_(DelayedReader *) override
std::string const & branchName() const
std::shared_ptr< edm::EventPrincipal > ep_
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
BranchType const & branchType() const
virtual ~TFWLiteSelectorBasic()
std::vector< BranchIDList > BranchIDLists
std::vector< EventEntryDescription * > pointerToBranchBuffer_
void setTree(TTree *iTree)
virtual void preProcessing(const TList *in, TList &out)=0
std::vector< EventEntryDescription > prov_
std::shared_ptr< FWLiteDelayedReader > reader_
std::map< BranchKey, BranchDescription > ProductList
virtual void SlaveTerminate()
virtual std::auto_ptr< EventEntryDescription > getProvenance_(BranchKey const &) const
virtual Bool_t Process(Long64_t)
std::shared_ptr< ProcessHistoryRegistry > phreg_
Timestamp const & time() const
void setRefCoreStreamer(bool resetAll=false)
virtual void SlaveBegin(TTree *)
std::string const & fileFormatVersionBranchName()
virtual void postProcessing(TList &out)=0
std::unique_ptr< WrapperBase > getTheProduct(BranchKey const &k) const
std::string const & eventSelectionsBranchName()
edm::ModuleDescription md_
virtual void process(const edm::Event &event)=0
std::vector< EventSelectionID > EventSelectionIDVector
std::string const & parameterSetsTreeName()
std::shared_ptr< BranchIDListHelper > branchIDListHelper_
FileFormatVersion fileFormatVersion_
std::vector< BranchListIndex > BranchListIndexes
std::string const & className() const
std::string friendlyName(std::string const &iFullName)
std::string const & friendlyClassName() const
void setDropped(bool isDropped)
void updateFriendlyClassName()
std::string const & metaDataTreeName()
edm::ProcessConfiguration pc_
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()
void set(std::shared_ptr< ProductRegistry const > iReg)
virtual std::unique_ptr< WrapperBase > getProduct_(BranchKey const &k, EDProductGetter const *ep) const override
ProcessHistoryVector vector_type
std::string const & processHistoryBranchName()
ProcessHistory processNames_
void setupNewFile(TFile &)
std::shared_ptr< ProductRegistry > reg_
void setTree(TTree *iTree)
std::string wrappedClassName(std::string const &iFullName)
virtual void reset_() override
virtual void Init(TTree *)
std::string const & productDescriptionBranchName()
std::string const & processConfigurationBranchName()
std::shared_ptr< edm::root::TFWLiteSelectorMembers > m_
std::shared_ptr< edm::ProductProvenanceRetriever > provRetriever_
std::string const & branchIDListBranchName()
std::string const & branchListIndexesBranchName()
volatile std::atomic< bool > shutdown_flag false
virtual void Begin(TTree *)
bool insertMapped(value_type const &v)
void setEntry(Long64_t iEntry)
static Registry * instance()
virtual void begin(TList *&in)=0
string root
initialization