60 #include <unordered_map> 69 void set(std::shared_ptr<std::unordered_map<unsigned int, BranchDescription const*>> iMap) {
bidToDesc_ =
std::move(iMap);}
74 return std::unique_ptr<EventEntryDescription>();
88 std::shared_ptr<std::unordered_map<unsigned int, BranchDescription const*>>
bidToDesc_;
91 std::unique_ptr<WrapperBase>
96 std::unique_ptr<WrapperBase>
105 if(
nullptr == branch) {
107 <<
"could not find branch named '" << bDesc.
branchName() <<
"'" 108 <<
"\n Perhaps the data being requested was not saved in this file?";
113 if(!
bool(classType)) {
115 <<
"could not find dictionary for type '" << fullName <<
"'" 116 <<
"\n Please make sure all the necessary libraries are available.";
121 if(
nullptr == wrapperObj.
address()) {
122 throw cms::Exception(
"FailedToCreate") <<
"could not create an instance of '" << fullName <<
"'";
124 void* address = wrapperObj.
address();
125 branch->SetAddress(&address);
130 if(
nullptr == prod) {
132 <<
"failed to convert a '" << fullName
133 <<
"' to a edm::WrapperBase." 134 <<
"Please contact developers since something is very wrong.";
137 return std::unique_ptr<WrapperBase>(
prod);
157 pointerToBranchBuffer_(),
163 reader_->setTree(iTree);
182 std::vector<EventEntryDescription>
prov_;
207 everythingOK_(
false) {
247 if(iTree ==
nullptr)
return;
257 if(
nullptr ==
m_->tree_) {
261 TFile*
file =
m_->tree_->GetCurrentFile();
262 if(
nullptr == file) {
264 TChain*
chain =
dynamic_cast<TChain*
>(
m_->tree());
265 if(
nullptr == chain) {
269 file = chain->GetFile();
270 if(
nullptr == file) {
294 std::unique_ptr<edm::EventAuxiliary> eaux = std::make_unique<edm::EventAuxiliary>();
299 branch->SetAddress(&pAux);
300 branch->GetEntry(iEntry);
312 if(!eventSelectionsBranch) {
314 <<
"Failed to find event Selections branch in event tree";
316 eventSelectionsBranch->SetAddress(&pEventSelectionIDVector);
317 eventSelectionsBranch->GetEntry(iEntry);
322 if(!branchListIndexBranch) {
324 <<
"Failed to find branch list index branch in event tree";
326 branchListIndexBranch->SetAddress(&pBranchListIndexes);
327 branchListIndexBranch->GetEntry(iEntry);
328 m_->branchIDListHelper_->fixBranchListIndexes(branchListIndexes);
331 m_->reader_->setEntry(iEntry);
332 auto runAux = std::make_shared<edm::RunAuxiliary>(aux.run(), aux.time(), aux.time());
333 auto rp = std::make_shared<edm::RunPrincipal>(runAux,
m_->reg(),
m_->pc_,
nullptr, 0);
334 auto lbp = std::make_shared<edm::LuminosityBlockPrincipal>(
m_->reg(),
m_->pc_,
nullptr, 0);
336 m_->ep_->fillEventPrincipal(*eaux,
340 *(
m_->provRetriever_),
342 lbp->setRunPrincipal(rp);
343 m_->ep_->setLuminosityBlockPrincipal(lbp.get());
344 m_->processNames_ =
m_->ep_->processHistory();
349 Operate sentry(
m_->ep_->prodGetter());
352 std::cout <<
"While processing entry " << iEntry <<
" the following exception was caught \n" 353 << iEx.what() << std::endl;
355 std::cout <<
"While processing entry " << iEntry <<
" an unknown exception was caught" << std::endl;
392 typedef std::map<edm::ParameterSetID, edm::ParameterSetBlob> PsetMap;
394 PsetMap *psetMapPtr = &psetMap;
399 if(
nullptr == psetTree) {
401 <<
" in the input file.\n";
403 typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
405 IdToBlobs* pIdToBlob = &idToBlob;
407 for(
long long i = 0;
i != psetTree->GetEntries(); ++
i) {
408 psetTree->GetEntry(
i);
409 psetMap.insert(idToBlob);
426 auto branchIDListsHelper = std::make_shared<edm::BranchIDListHelper>();
432 metaDataTree->GetEntry(0);
434 for(
auto&
prod :
m_->reg_->productListUpdator()) {
440 for(
auto const&
entry : psetMap) {
446 for(
auto const& ph : pHistVector) {
447 m_->phreg_->registerProcessHistory(ph);
450 m_->pointerToBranchBuffer_.erase(
m_->pointerToBranchBuffer_.begin(),
451 m_->pointerToBranchBuffer_.end());
453 std::unique_ptr<edm::ProductRegistry> newReg = std::make_unique<edm::ProductRegistry>();
457 for(
auto& item : prodList) {
462 newReg->copyProduct(prod);
464 if(
m_->fileFormatVersion_.splitProductIDs()) {
466 <<
"Cannot change friendly class name algorithm without more development work\n" 467 <<
"to update BranchIDLists. Contact the framework group.\n";
471 newReg->copyProduct(newBD);
476 m_->reg().reset(newReg.release());
482 m_->pointerToBranchBuffer_.reserve(prodList2.size());
484 for(
auto& item : prodList2) {
489 if(
m_->tree_->GetBranch(prod.
branchName().c_str()) ==
nullptr) {
501 m_->branchIDListHelper_->updateFromInput(*branchIDListsPtr);
502 m_->reg_->setFrozen();
503 m_->bidToDesc_->clear();
504 for(
auto const&
p:
m_->reg_->productList()) {
505 m_->bidToDesc_->emplace(
p.second.branchID().id(),&
p.second);
507 m_->ep_ = std::make_shared<edm::EventPrincipal>(
m_->reg(),
m_->branchIDListHelper(),
m_->thinnedAssociationsHelper(),
m_->pc_,
nullptr);
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const * preEventReadFromSourceSignal() const override
std::vector< EventEntryDescription const * > pointerToBranchBuffer_
std::string const & idToParameterSetBlobsBranchName()
virtual void terminate(TList &out)=0
std::vector< ProcessConfiguration > ProcessConfigurationVector
std::string const & branchName() const
std::shared_ptr< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
std::shared_ptr< std::unordered_map< unsigned int, BranchDescription const * > > bidToDesc_
BranchType const & branchType() const
std::vector< BranchIDList > BranchIDLists
std::shared_ptr< BranchIDListHelper const > branchIDListHelper() const
virtual std::unique_ptr< EventEntryDescription > getProvenance_(BranchKey const &) const
void setTree(TTree *iTree)
virtual void preProcessing(const TList *in, TList &out)=0
std::vector< EventEntryDescription > prov_
edm::propagate_const< TTree * > tree_
edm::propagate_const< std::shared_ptr< edm::root::TFWLiteSelectorMembers > > m_
ObjectWithDict castObject(TypeWithDict const &) const
std::map< BranchKey, BranchDescription > ProductList
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
void mergeReaders_(DelayedReader *) override
void setRefCoreStreamer(bool resetAll=false)
std::string const & fileFormatVersionBranchName()
virtual void postProcessing(TList &out)=0
std::string const & eventSelectionsBranchName()
TTree const * tree() const
edm::ModuleDescription md_
edm::propagate_const< std::shared_ptr< edm::ProductProvenanceRetriever > > provRetriever_
std::shared_ptr< BranchIDListHelper > & branchIDListHelper()
virtual void process(const edm::Event &event)=0
void Terminate() override
signalslot::Signal< void(StreamContext const &, ModuleCallingContext const &)> const * postEventReadFromSourceSignal() const override
std::vector< EventSelectionID > EventSelectionIDVector
std::string const & parameterSetsTreeName()
static TypeWithDict byName(std::string const &name)
FileFormatVersion fileFormatVersion_
std::vector< BranchListIndex > BranchListIndexes
std::string const & className() const
std::string friendlyName(std::string const &iFullName)
~TFWLiteSelectorBasic() override
edm::propagate_const< std::shared_ptr< ProductRegistry > > reg_
edm::propagate_const< std::shared_ptr< FWLiteDelayedReader > > reader_
edm::propagate_const< std::shared_ptr< BranchIDListHelper > > branchIDListHelper_
std::string const & friendlyClassName() const
void setDropped(bool isDropped)
bool insertMapped(value_type const &v, bool forceUpdate=false)
void updateFriendlyClassName()
std::string const & metaDataTreeName()
std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
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::shared_ptr< ProductRegistry > & reg()
std::string const & parameterSetMapBranchName()
element_type const * get() const
ProcessHistoryVector vector_type
std::string const & processHistoryBranchName()
edm::propagate_const< std::shared_ptr< edm::EventPrincipal > > ep_
ProcessHistory processNames_
void setupNewFile(TFile &)
void SlaveTerminate() override
void setTree(TTree *iTree)
void SlaveBegin(TTree *) override
std::string wrappedClassName(std::string const &iFullName)
void Begin(TTree *) override
std::unique_ptr< WrapperBase > getProduct_(BranchID const &k, EDProductGetter const *ep) override
std::string const & productDescriptionBranchName()
std::string const & processConfigurationBranchName()
std::shared_ptr< ThinnedAssociationsHelper > & thinnedAssociationsHelper()
Bool_t Process(Long64_t) override
std::unique_ptr< WrapperBase > getTheProduct(BranchID const &k) const
edm::propagate_const< std::shared_ptr< ProcessHistoryRegistry > > phreg_
std::shared_ptr< ProductRegistry const > reg() const
std::string const & branchIDListBranchName()
std::string const & branchListIndexesBranchName()
void setEntry(Long64_t iEntry)
static Registry * instance()
void Init(TTree *) override
virtual void begin(TList *&in)=0