32 class LuminosityBlockID;
34 class ThinnedAssociationsHelper;
37 void checkHistoryConsistency(Principal
const& primary, Principal
const& secondary) {
38 ProcessHistory
const& ph1 = primary.processHistory();
39 ProcessHistory
const& ph2 = secondary.processHistory();
42 "The secondary file is not an ancestor of the primary file\n";
45 void checkConsistency(EventPrincipal
const& primary, EventPrincipal
const& secondary) {
48 primary.id() <<
" has inconsistent EventAuxiliary data in the primary and secondary file\n";
51 void checkConsistency(LuminosityBlockAuxiliary
const& primary, LuminosityBlockAuxiliary
const& secondary) {
52 if(primary.id() != secondary.id()) {
54 primary.id() <<
" has inconsistent LuminosityBlockAuxiliary data in the primary and secondary file\n";
57 void checkConsistency(RunAuxiliary
const& primary, RunAuxiliary
const& secondary) {
58 if(primary.id() != secondary.id()) {
60 primary.id() <<
" has inconsistent RunAuxiliary data in the primary and secondary file\n";
67 rootServiceChecker_(),
68 catalog_(pset.getUntrackedParameter<std::vector<std::
string> >(
"fileNames"),
69 pset.getUntrackedParameter<std::
string>(
"overrideCatalog", std::
string())),
70 secondaryCatalog_(pset.getUntrackedParameter<std::vector<std::
string> >(
"secondaryFileNames", std::vector<std::
string>()),
71 pset.getUntrackedParameter<std::
string>(
"overrideCatalog", std::
string())),
72 secondaryRunPrincipal_(),
73 secondaryLumiPrincipal_(),
74 secondaryEventPrincipals_(),
75 branchIDsToReplace_(),
77 skipBadFiles_(pset.getUntrackedParameter<bool>(
"skipBadFiles")),
78 bypassVersionCheck_(pset.getUntrackedParameter<bool>(
"bypassVersionCheck")),
79 treeMaxVirtualSize_(pset.getUntrackedParameter<int>(
"treeMaxVirtualSize")),
80 productSelectorRules_(pset,
"inputCommands",
"InputSource"),
81 dropDescendants_(pset.getUntrackedParameter<bool>(
"dropDescendantsOfDroppedBranches")),
82 labelRawDataLikeMC_(pset.getUntrackedParameter<bool>(
"labelRawDataLikeMC")),
88 secondaryFileSequence_(secondaryCatalog_.empty() ?
nullptr :
91 if (secondaryCatalog_.empty() &&
pset.getUntrackedParameter<
bool>(
"needSecondaryFileNames",
false)) {
94 if(secondaryFileSequence_) {
95 secondaryEventPrincipals_.reserve(nStreams_);
97 secondaryEventPrincipals_.emplace_back(
new EventPrincipal(secondaryFileSequence_->fileProductRegistry(),
98 secondaryFileSequence_->fileBranchIDListHelper(),
99 std::make_shared<ThinnedAssociationsHelper const>(),
107 std::set<BranchID> associationsFromSecondary;
110 for(
auto const& item : secondary) {
111 if(item.second.present()) {
112 idsToReplace[item.second.branchType()].insert(item.second.branchID());
113 if(item.second.branchType() ==
InEvent &&
114 item.second.unwrappedType() ==
typeid(ThinnedAssociation)) {
115 associationsFromSecondary.insert(item.second.branchID());
118 auto itFound = fullList.find(item.first);
119 if(itFound != fullList.end()) {
120 itFound->second.setDropped(
false);
124 for(
auto const& item : primary) {
125 if(item.second.present()) {
126 idsToReplace[item.second.branchType()].erase(item.second.branchID());
127 associationsFromSecondary.erase(item.second.branchID());
131 secondaryFileSequence_ =
nullptr;
134 branchIDsToReplace_[
i].reserve(idsToReplace[
i].
size());
135 for(
auto const&
id : idsToReplace[
i]) {
136 branchIDsToReplace_[
i].push_back(
id);
139 secondaryFileSequence_->initAssociationsFromSecondary(associationsFromSecondary);
153 std::unique_ptr<FileBlock>
166 std::shared_ptr<RunAuxiliary>
171 std::shared_ptr<LuminosityBlockAuxiliary>
183 checkConsistency(runPrincipal.
aux(), *secondaryAuxiliary);
188 runPrincipal.
index());
190 checkHistoryConsistency(runPrincipal, *secondaryRunPrincipal_);
194 <<
" Run " << runPrincipal.
run()
195 <<
" is not found in the secondary input files\n";
206 std::shared_ptr<LuminosityBlockAuxiliary> secondaryAuxiliary =
secondaryFileSequence_->readLuminosityBlockAuxiliary_();
207 checkConsistency(lumiPrincipal.
aux(), *secondaryAuxiliary);
212 lumiPrincipal.
index());
214 checkHistoryConsistency(lumiPrincipal, *secondaryLumiPrincipal_);
218 <<
" Run " << lumiPrincipal.
run()
220 <<
" is not found in the secondary input files\n";
235 checkConsistency(eventPrincipal, secondaryEventPrincipal);
236 checkHistoryConsistency(eventPrincipal, secondaryEventPrincipal);
242 eventPrincipal.
id() <<
" is not found in the secondary input files\n";
250 if(!found)
return false;
304 std::vector<std::string> defaultStrings;
306 desc.
addUntracked<std::vector<std::string> >(
"fileNames")
307 ->setComment(
"Names of files to be processed.");
308 desc.
addUntracked<std::vector<std::string> >(
"secondaryFileNames", defaultStrings)
309 ->setComment(
"Names of secondary files to be processed.");
310 desc.
addUntracked<
bool>(
"needSecondaryFileNames",
false)
311 ->setComment(
"If True, 'secondaryFileNames' must be specified and be non-empty.");
314 ->setComment(
"True: Ignore any missing or unopenable input file.\n"
315 "False: Throw exception if missing or unopenable input file.");
317 ->setComment(
"True: Bypass release version check.\n"
318 "False: Throw exception if reading file in a release prior to the release in which the file was written.");
320 ->setComment(
"Size of ROOT TTree TBasket cache. Affects performance.");
321 desc.
addUntracked<
bool>(
"dropDescendantsOfDroppedBranches",
true)
322 ->setComment(
"If True, also drop on input any descendent of any branch dropped on input.");
324 ->setComment(
"If True: replace module label for raw data to match MC. Also use 'LHC' as process.");
330 descriptions.
add(
"source", desc);
virtual void preForkReleaseResources() override
edm::propagate_const< std::unique_ptr< RootSecondaryFileSequence > > secondaryFileSequence_
PoolSource(ParameterSet const &pset, InputSourceDescription const &desc)
EventNumber_t event() const
SharedResourcesAcquirer createAcquirerForSourceDelayedReader()
virtual bool goToEvent_(EventID const &eventID) override
bool isSameEvent(EventAuxiliary const &a, EventAuxiliary const &b)
static void fillDescription(ParameterSetDescription &desc, char const *parameterName)
std::unique_ptr< SharedResourcesAcquirer > resourceSharedWithDelayedReaderPtr_
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
edm::propagate_const< std::unique_ptr< RunHelperBase > > runHelper_
std::map< BranchKey, BranchDescription > ProductList
static void fillDescription(ParameterSetDescription &desc)
edm::propagate_const< std::shared_ptr< RunPrincipal > > secondaryRunPrincipal_
EventID const & id() const
unsigned long long EventNumber_t
LuminosityBlockAuxiliary const & aux() const
virtual void readLuminosityBlock_(LuminosityBlockPrincipal &lumiPrincipal) override
LuminosityBlockIndex index() const
LuminosityBlockNumber_t luminosityBlock() const
static void fillDescription(ParameterSetDescription &desc)
unsigned int LuminosityBlockNumber_t
static EventNumber_t const invalidEvent
virtual std::shared_ptr< LuminosityBlockAuxiliary > readLuminosityBlockAuxiliary_() override
virtual bool randomAccess_() const override
void mergeProvenanceRetrievers(EventPrincipal &other)
virtual ProcessingController::ReverseState reverseState_() const override
SharedResourcesAcquirer * resourceSharedWithDelayedReader_() override
void setComment(std::string const &value)
virtual void readRun_(RunPrincipal &runPrincipal) override
std::vector< edm::propagate_const< std::unique_ptr< EventPrincipal > > > secondaryEventPrincipals_
bool isAncestor(ProcessHistory const &a, ProcessHistory const &b)
LuminosityBlockNumber_t luminosityBlock() const
virtual void readEvent_(EventPrincipal &eventPrincipal) override
static RunNumber_t const invalidRun
static SharedResourcesRegistry * instance()
StreamID streamID() const
virtual std::shared_ptr< RunAuxiliary > readRunAuxiliary_() override
RunAuxiliary const & aux() const
virtual ItemType getNextItemType() override
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::unique_ptr< RunHelperBase > makeRunHelper(ParameterSet const &pset)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
unsigned int value() const
virtual ProcessingController::ForwardState forwardState_() const override
static LuminosityBlockNumber_t const invalidLumi
virtual bool readIt(EventID const &id, EventPrincipal &eventPrincipal, StreamContext &streamContext) override
std::array< std::vector< BranchID >, NumBranchTypes > branchIDsToReplace_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual void endJob() override
virtual void skip(int offset) override
virtual std::unique_ptr< FileBlock > readFile_() override
virtual void rewind_() override
edm::propagate_const< std::shared_ptr< LuminosityBlockPrincipal > > secondaryLumiPrincipal_
void recombine(Principal &other, std::vector< BranchID > const &bids)
tuple size
Write out results.
edm::propagate_const< std::unique_ptr< RootPrimaryFileSequence > > primaryFileSequence_
virtual void closeFile_() override