68 void set(std::shared_ptr<ProductRegistry const> iReg) { reg_ = iReg;}
73 return std::unique_ptr<EventEntryDescription>();
79 std::shared_ptr<ProductRegistry const>(reg_);
82 std::unique_ptr<WrapperBase>
87 std::unique_ptr<WrapperBase>
89 ProductRegistry::ProductList::const_iterator itFind= reg_->productList().find(k);
90 if(itFind == reg_->productList().end()) {
96 if(
nullptr == branch) {
98 <<
"could not find branch named '" << bDesc.
branchName() <<
"'"
99 <<
"\n Perhaps the data being requested was not saved in this file?";
104 if(!
bool(classType)) {
106 <<
"could not find dictionary for type '" << fullName <<
"'"
107 <<
"\n Please make sure all the necessary libraries are available.";
112 if(
nullptr == wrapperObj.
address()) {
113 throw cms::Exception(
"FailedToCreate") <<
"could not create an instance of '" << fullName <<
"'";
115 void* address = wrapperObj.
address();
116 branch->SetAddress(&address);
121 if(
nullptr == prod) {
123 <<
"failed to convert a '" << fullName
124 <<
"' to a edm::WrapperBase."
125 <<
"Please contact developers since something is very wrong.";
128 return std::unique_ptr<WrapperBase>(
prod);
172 std::vector<EventEntryDescription>
prov_;
197 everythingOK_(
false) {
237 if(iTree ==
nullptr)
return;
247 if(
nullptr ==
m_->tree_) {
251 TFile*
file =
m_->tree_->GetCurrentFile();
252 if(
nullptr == file) {
254 TChain* chain =
dynamic_cast<TChain*
>(
m_->tree());
255 if(
nullptr == chain) {
259 file = chain->GetFile();
260 if(
nullptr == file) {
284 std::unique_ptr<edm::EventAuxiliary> eaux = std::make_unique<edm::EventAuxiliary>();
289 branch->SetAddress(&pAux);
290 branch->GetEntry(iEntry);
302 if(!eventSelectionsBranch) {
304 <<
"Failed to find event Selections branch in event tree";
306 eventSelectionsBranch->SetAddress(&pEventSelectionIDVector);
307 eventSelectionsBranch->GetEntry(iEntry);
312 if(!branchListIndexBranch) {
314 <<
"Failed to find branch list index branch in event tree";
316 branchListIndexBranch->SetAddress(&pBranchListIndexes);
317 branchListIndexBranch->GetEntry(iEntry);
318 m_->branchIDListHelper_->fixBranchListIndexes(branchListIndexes);
321 m_->reader_->setEntry(iEntry);
322 auto runAux = std::make_shared<edm::RunAuxiliary>(aux.run(), aux.time(), aux.time());
323 auto rp = std::make_shared<edm::RunPrincipal>(runAux,
m_->reg(),
m_->pc_,
nullptr, 0);
324 auto lumiAux = std::make_shared<edm::LuminosityBlockAuxiliary>(rp->run(), 1, aux.time(), aux.time());
325 auto lbp = std::make_shared<edm::LuminosityBlockPrincipal>(lumiAux,
m_->reg(),
m_->pc_,
nullptr, 0);
326 m_->ep_->fillEventPrincipal(*eaux,
330 *(
m_->provRetriever_),
332 lbp->setRunPrincipal(rp);
333 m_->ep_->setLuminosityBlockPrincipal(lbp);
334 m_->processNames_ =
m_->ep_->processHistory();
339 Operate sentry(
m_->ep_->prodGetter());
342 std::cout <<
"While processing entry " << iEntry <<
" the following exception was caught \n"
343 << iEx.what() << std::endl;
345 std::cout <<
"While processing entry " << iEntry <<
" an unknown exception was caught" << std::endl;
382 typedef std::map<edm::ParameterSetID, edm::ParameterSetBlob> PsetMap;
384 PsetMap *psetMapPtr = &psetMap;
389 if(
nullptr == psetTree) {
391 <<
" in the input file.\n";
393 typedef std::pair<edm::ParameterSetID, edm::ParameterSetBlob> IdToBlobs;
395 IdToBlobs* pIdToBlob = &idToBlob;
397 for(
long long i = 0;
i != psetTree->GetEntries(); ++
i) {
398 psetTree->GetEntry(
i);
399 psetMap.insert(idToBlob);
416 auto branchIDListsHelper = std::make_shared<edm::BranchIDListHelper>();
422 metaDataTree->GetEntry(0);
424 for(
auto&
prod :
m_->reg_->productListUpdator()) {
430 for(
auto const&
entry : psetMap) {
436 for(
auto const& ph : pHistVector) {
437 m_->phreg_->registerProcessHistory(ph);
440 m_->pointerToBranchBuffer_.erase(
m_->pointerToBranchBuffer_.begin(),
441 m_->pointerToBranchBuffer_.end());
443 std::unique_ptr<edm::ProductRegistry> newReg = std::make_unique<edm::ProductRegistry>();
447 for(
auto& item : prodList) {
452 newReg->copyProduct(prod);
454 if(
m_->fileFormatVersion_.splitProductIDs()) {
456 <<
"Cannot change friendly class name algorithm without more development work\n"
457 <<
"to update BranchIDLists. Contact the framework group.\n";
461 newReg->copyProduct(newBD);
466 m_->reg().reset(newReg.release());
472 m_->pointerToBranchBuffer_.reserve(prodList2.size());
474 for(
auto& item : prodList2) {
479 if(
m_->tree_->GetBranch(prod.
branchName().c_str()) ==
nullptr) {
491 m_->branchIDListHelper_->updateFromInput(*branchIDListsPtr);
492 m_->reg_->setFrozen();
493 m_->ep_ = std::make_shared<edm::EventPrincipal>(
m_->reg(),
m_->branchIDListHelper(),
m_->thinnedAssociationsHelper(),
m_->pc_,
nullptr);
std::vector< EventEntryDescription const * > pointerToBranchBuffer_
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< ThinnedAssociationsHelper const > thinnedAssociationsHelper() const
std::string const & BranchTypeToAuxiliaryBranchName(BranchType const &branchType)
BranchType const & branchType() const
virtual ~TFWLiteSelectorBasic()
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
virtual void SlaveTerminate()
virtual Bool_t Process(Long64_t)
edm::propagate_const< std::shared_ptr< ThinnedAssociationsHelper > > thinnedAssociationsHelper_
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()
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
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)
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)
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
void set(std::shared_ptr< ProductRegistry const > iReg)
ProcessHistoryVector vector_type
std::string const & processHistoryBranchName()
edm::propagate_const< std::shared_ptr< edm::EventPrincipal > > ep_
ProcessHistory processNames_
void setupNewFile(TFile &)
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< ThinnedAssociationsHelper > & thinnedAssociationsHelper()
edm::propagate_const< std::shared_ptr< ProcessHistoryRegistry > > phreg_
virtual std::unique_ptr< WrapperBase > getProduct_(BranchKey const &k, EDProductGetter const *ep) override
std::shared_ptr< ProductRegistry const > reg() const
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