30 class LuminosityBlockID;
32 class ThinnedAssociationsHelper;
35 void checkHistoryConsistency(Principal
const& primary, Principal
const& secondary) {
36 ProcessHistory
const& ph1 = primary.processHistory();
37 ProcessHistory
const& ph2 = secondary.processHistory();
40 "The secondary file is not an ancestor of the primary file\n";
43 void checkConsistency(EventPrincipal
const& primary, EventPrincipal
const& secondary) {
46 primary.id() <<
" has inconsistent EventAuxiliary data in the primary and secondary file\n";
49 void checkConsistency(LuminosityBlockAuxiliary
const& primary, LuminosityBlockAuxiliary
const& secondary) {
50 if(primary.id() != secondary.id()) {
52 primary.id() <<
" has inconsistent LuminosityBlockAuxiliary data in the primary and secondary file\n";
55 void checkConsistency(RunAuxiliary
const& primary, RunAuxiliary
const& secondary) {
56 if(primary.id() != secondary.id()) {
58 primary.id() <<
" has inconsistent RunAuxiliary data in the primary and secondary file\n";
65 rootServiceChecker_(),
71 secondaryRunPrincipal_(),
72 secondaryLumiPrincipal_(),
73 secondaryEventPrincipals_(),
74 branchIDsToReplace_(),
75 resourceSharedWithDelayedReaderPtr_(primary()?
80 unsigned int nStreams = desc.allocations_->numberOfStreams();
86 std::make_shared<ThinnedAssociationsHelper const>(),
94 std::set<BranchID> associationsFromSecondary;
95 typedef ProductRegistry::ProductList::const_iterator const_iterator;
96 typedef ProductRegistry::ProductList::iterator iterator;
99 for(const_iterator it = secondary.begin(), itEnd = secondary.end(); it != itEnd; ++it) {
100 if(it->second.present()) {
101 idsToReplace[it->second.branchType()].insert(it->second.branchID());
102 if(it->second.branchType() ==
InEvent &&
103 it->second.unwrappedType() ==
typeid(ThinnedAssociation)) {
104 associationsFromSecondary.insert(it->second.branchID());
107 iterator itFound = fullList.find(it->first);
108 if(itFound != fullList.end()) {
109 itFound->second.setDropped(
false);
113 for(const_iterator it = primary.begin(), itEnd = primary.end(); it != itEnd; ++it) {
114 if(it->second.present()) {
115 idsToReplace[it->second.branchType()].erase(it->second.branchID());
116 associationsFromSecondary.erase(it->second.branchID());
124 for(std::set<BranchID>::const_iterator it = idsToReplace[
i].
begin(), itEnd = idsToReplace[
i].
end();
143 std::unique_ptr<FileBlock>
156 std::shared_ptr<RunAuxiliary>
161 std::shared_ptr<LuminosityBlockAuxiliary>
173 checkConsistency(runPrincipal.
aux(), *secondaryAuxiliary);
178 runPrincipal.
index()));
184 <<
" Run " << runPrincipal.
run()
185 <<
" is not found in the secondary input files\n";
196 std::shared_ptr<LuminosityBlockAuxiliary> secondaryAuxiliary =
secondaryFileSequence_->readLuminosityBlockAuxiliary_();
197 checkConsistency(lumiPrincipal.
aux(), *secondaryAuxiliary);
202 lumiPrincipal.
index()));
208 <<
" Run " << lumiPrincipal.
run()
210 <<
" is not found in the secondary input files\n";
225 checkConsistency(eventPrincipal, secondaryEventPrincipal);
226 checkHistoryConsistency(eventPrincipal, secondaryEventPrincipal);
232 eventPrincipal.
id() <<
" is not found in the secondary input files\n";
240 if(!found)
return false;
334 descriptions.
add(
"source", desc);
PoolSource(ParameterSet const &pset, InputSourceDescription const &desc)
EventNumber_t event() const
SharedResourcesAcquirer createAcquirerForSourceDelayedReader()
bool isSameEvent(EventAuxiliary const &a, EventAuxiliary const &b)
std::unique_ptr< SharedResourcesAcquirer > resourceSharedWithDelayedReaderPtr_
virtual std::unique_ptr< FileBlock > readFile_()
virtual ProcessingController::ForwardState forwardState_() const
virtual bool goToEvent_(EventID const &eventID)
std::shared_ptr< RunPrincipal > secondaryRunPrincipal_
std::map< BranchKey, BranchDescription > ProductList
EventID const & id() const
virtual void readOneRandom(EventPrincipal &cache, size_t &fileNameHash, CLHEP::HepRandomEngine *) override
std::unique_ptr< RootInputFileSequence > secondaryFileSequence_
unsigned long long EventNumber_t
LuminosityBlockAuxiliary const & aux() const
void mergeProvenanceRetrievers(EventPrincipal const &other)
LuminosityBlockIndex index() const
LuminosityBlockNumber_t luminosityBlock() const
unsigned int LuminosityBlockNumber_t
static EventNumber_t const invalidEvent
virtual void dropUnwantedBranches_(std::vector< std::string > const &wantedBranches)
void setComment(std::string const &value)
std::shared_ptr< LuminosityBlockPrincipal > secondaryLumiPrincipal_
bool isAncestor(ProcessHistory const &a, ProcessHistory const &b)
LuminosityBlockNumber_t luminosityBlock() const
virtual bool randomAccess_() const
static RunNumber_t const invalidRun
virtual ProcessingController::ReverseState reverseState_() const
static SharedResourcesRegistry * instance()
virtual bool readOneSequentialWithID(EventPrincipal &cache, size_t &fileNameHash, LuminosityBlockID const &lumiID)
StreamID streamID() const
RunAuxiliary const & aux() const
SharedResourcesAcquirer * resourceSharedWithDelayedReader_() const override
virtual void readRun_(RunPrincipal &runPrincipal)
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
virtual std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_()
virtual void readOneSpecified(EventPrincipal &cache, size_t &fileNameHash, SecondaryEventIDAndFileInfo const &id)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
unsigned int value() const
virtual bool readOneSequential(EventPrincipal &cache, size_t &fileNameHash)
static LuminosityBlockNumber_t const invalidLumi
virtual bool readIt(EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext) override
virtual void readEvent_(EventPrincipal &eventPrincipal)
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
ProductList & productListUpdator()
virtual void closeFile_()
std::unique_ptr< RootInputFileSequence > primaryFileSequence_
virtual bool readOneRandomWithID(EventPrincipal &cache, size_t &fileNameHash, LuminosityBlockID const &lumiID, CLHEP::HepRandomEngine *) override
virtual ItemType getNextItemType()
virtual void skip(int offset)
virtual void preForkReleaseResources()
void recombine(Principal &other, std::vector< BranchID > const &bids)
std::vector< std::unique_ptr< EventPrincipal > > secondaryEventPrincipals_
tuple size
Write out results.
virtual std::shared_ptr< RunAuxiliary > readRunAuxiliary_()
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal)