54 #include "Reflex/Type.h"
63 void set(std::shared_ptr<ProductRegistry const> iReg) { reg_ = iReg;}
68 return std::auto_ptr<EventEntryDescription>();
74 std::shared_ptr<ProductRegistry const>(reg_);
77 std::unique_ptr<WrapperBase>
82 std::unique_ptr<WrapperBase>
84 ProductRegistry::ProductList::const_iterator itFind= reg_->productList().find(k);
85 if(itFind == reg_->productList().end()) {
91 if(
nullptr == branch) {
93 <<
"could not find branch named '" << bDesc.
branchName() <<
"'"
94 <<
"\n Perhaps the data being requested was not saved in this file?";
101 <<
"could not find dictionary for type '" << fullName <<
"'"
102 <<
"\n Please make sure all the necessary libraries are available.";
106 Reflex::Object wrapperObj = classType.Construct();
107 if(
nullptr == wrapperObj.Address()) {
108 throw cms::Exception(
"FailedToCreate") <<
"could not create an instance of '" << fullName <<
"'";
110 void* address = wrapperObj.Address();
111 branch->SetAddress(&address);
112 Reflex::Object edProdObj = wrapperObj.CastObject(Reflex::Type::ByName(
"edm::WrapperBase"));
116 if(
nullptr == prod) {
118 <<
"failed to convert a '" << fullName
119 <<
"' to a edm::WrapperBase."
120 <<
"Please contact developers since something is very wrong.";
123 return std::unique_ptr<WrapperBase>(
prod);
151 std::shared_ptr<ProductRegistry>
reg_;
152 std::shared_ptr<ProcessHistoryRegistry>
phreg_;
157 std::vector<EventEntryDescription>
prov_;
163 std::shared_ptr<edm::EventPrincipal>
ep_;
182 everythingOK_(
false) {
222 if(iTree ==
nullptr)
return;
232 if(
nullptr ==
m_->tree_) {
236 TFile*
file =
m_->tree_->GetCurrentFile();
237 if(
nullptr == file) {
239 TChain*
chain =
dynamic_cast<TChain*
>(
m_->tree_);
240 if(
nullptr == chain) {
244 file = chain->GetFile();
245 if(
nullptr == file) {
274 branch->SetAddress(&pAux);
275 branch->GetEntry(iEntry);
287 if(!eventSelectionsBranch) {
289 <<
"Failed to find event Selections branch in event tree";
291 eventSelectionsBranch->SetAddress(&pEventSelectionIDVector);
292 eventSelectionsBranch->GetEntry(iEntry);
297 if(!branchListIndexBranch) {
299 <<
"Failed to find branch list index branch in event tree";
301 branchListIndexBranch->SetAddress(&pBranchListIndexes);
302 branchListIndexBranch->GetEntry(iEntry);
303 m_->branchIDListHelper_->fixBranchListIndexes(branchListIndexes);
306 m_->reader_->setEntry(iEntry);
307 auto runAux = std::make_shared<edm::RunAuxiliary>(aux.
run(), aux.
time(), aux.
time());
308 auto rp = std::make_shared<edm::RunPrincipal>(runAux,
m_->reg_,
m_->pc_,
nullptr, 0);
309 auto lumiAux = std::make_shared<edm::LuminosityBlockAuxiliary>(rp->run(), 1, aux.
time(), aux.
time());
310 auto lbp = std::make_shared<edm::LuminosityBlockPrincipal>(lumiAux,
m_->reg_,
m_->pc_,
nullptr, 0);
311 m_->ep_->fillEventPrincipal(*eaux,
313 std::move(eventSelectionIDs),
314 std::move(branchListIndexes),
315 *(
m_->provRetriever_),
317 lbp->setRunPrincipal(rp);
318 m_->ep_->setLuminosityBlockPrincipal(lbp);
319 m_->processNames_ =
m_->ep_->processHistory();
324 Operate sentry(
m_->ep_->prodGetter());
327 std::cout <<
"While processing entry " << iEntry <<
" the following exception was caught \n"
328 << iEx.what() << std::endl;
330 std::cout <<
"While processing entry " << iEntry <<
" an unknown exception was caught" << std::endl;
367 typedef std::map<edm::ParameterSetID, edm::ParameterSetBlob> PsetMap;
369 PsetMap *psetMapPtr = &psetMap;
374 if(
nullptr == psetTree) {
376 <<
" in the input file.\n";
378 typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
380 IdToBlobs* pIdToBlob = &idToBlob;
382 for(
long long i = 0;
i != psetTree->GetEntries(); ++
i) {
383 psetTree->GetEntry(
i);
384 psetMap.insert(idToBlob);
401 auto branchIDListsHelper = std::make_shared<edm::BranchIDListHelper>();
407 metaDataTree->GetEntry(0);
409 for(
auto&
prod :
m_->reg_->productListUpdator()) {
415 for(
auto const& entry : psetMap) {
417 pset.
setID(entry.first);
421 for(
auto const& ph : pHistVector) {
422 m_->phreg_->registerProcessHistory(ph);
425 m_->pointerToBranchBuffer_.erase(
m_->pointerToBranchBuffer_.begin(),
426 m_->pointerToBranchBuffer_.end());
432 for(
auto& item : prodList) {
437 newReg->copyProduct(prod);
439 if(
m_->fileFormatVersion_.splitProductIDs()) {
441 <<
"Cannot change friendly class name algorithm without more development work\n"
442 <<
"to update BranchIDLists. Contact the framework group.\n";
446 newReg->copyProduct(newBD);
451 m_->reg_.reset(newReg.release());
457 m_->pointerToBranchBuffer_.reserve(prodList2.size());
459 for(
auto& item : prodList2) {
464 if(
m_->tree_->GetBranch(prod.
branchName().c_str()) ==
nullptr) {
476 m_->branchIDListHelper_->updateFromInput(*branchIDListsPtr);
477 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< ThinnedAssociationsHelper > thinnedAssociationsHelper_
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