32 class LuminosityBlockID;
34 class ThinnedAssociationsHelper;
37 void checkHistoryConsistency(Principal
const& primary, Principal
const& secondary) {
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_(),
73 secondaryRunPrincipal_(),
74 secondaryLumiPrincipal_(),
75 secondaryEventPrincipals_(),
76 branchIDsToReplace_(),
78 skipBadFiles_(
pset.getUntrackedParameter<
bool>(
"skipBadFiles")),
79 bypassVersionCheck_(
pset.getUntrackedParameter<
bool>(
"bypassVersionCheck")),
80 treeMaxVirtualSize_(
pset.getUntrackedParameter<
int>(
"treeMaxVirtualSize")),
81 productSelectorRules_(
pset,
"inputCommands",
"InputSource"),
82 dropDescendants_(
pset.getUntrackedParameter<
bool>(
"dropDescendantsOfDroppedBranches")),
83 labelRawDataLikeMC_(
pset.getUntrackedParameter<
bool>(
"labelRawDataLikeMC")),
84 delayReadingEventProducts_(
pset.getUntrackedParameter<
bool>(
"delayReadingEventProducts")),
86 resourceSharedWithDelayedReaderPtr_(),
90 secondaryFileSequence_(
104 std::make_shared<ThinnedAssociationsHelper const>(),
112 std::set<BranchID> associationsFromSecondary;
115 for (
auto const&
item : secondary) {
116 if (
item.second.present()) {
117 idsToReplace[
item.second.branchType()].insert(
item.second.branchID());
119 associationsFromSecondary.insert(
item.second.branchID());
122 auto itFound = fullList.find(
item.first);
123 if (itFound != fullList.end()) {
124 itFound->second.setDropped(
false);
128 for (
auto const&
item : primary) {
129 if (
item.second.present()) {
130 idsToReplace[
item.second.branchType()].erase(
item.second.branchID());
131 associationsFromSecondary.erase(
item.second.branchID());
139 for (
auto const&
id : idsToReplace[
i]) {
179 checkConsistency(runPrincipal.
aux(), *secondaryAuxiliary);
184 runPrincipal.
index());
190 <<
" Run " << runPrincipal.
run() <<
" is not found in the secondary input files\n";
200 std::shared_ptr<LuminosityBlockAuxiliary> secondaryAuxiliary =
202 checkConsistency(lumiPrincipal.
aux(), *secondaryAuxiliary);
211 <<
" Run " << lumiPrincipal.
run() <<
" LuminosityBlock " << lumiPrincipal.
luminosityBlock()
212 <<
" 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";
279 std::vector<std::string> defaultStrings;
280 desc.setComment(
"Reads EDM/Root files.");
281 desc.addUntracked<std::vector<std::string> >(
"fileNames")->setComment(
"Names of files to be processed.");
282 desc.addUntracked<std::vector<std::string> >(
"secondaryFileNames", defaultStrings)
283 ->setComment(
"Names of secondary files to be processed.");
284 desc.addUntracked<
bool>(
"needSecondaryFileNames",
false)
285 ->setComment(
"If True, 'secondaryFileNames' must be specified and be non-empty.");
287 desc.addUntracked<
bool>(
"skipBadFiles",
false)
289 "True: Ignore any missing or unopenable input file.\n"
290 "False: Throw exception if missing or unopenable input file.");
291 desc.addUntracked<
bool>(
"bypassVersionCheck",
false)
293 "True: Bypass release version check.\n"
294 "False: Throw exception if reading file in a release prior to the release in which the file was written.");
295 desc.addUntracked<
int>(
"treeMaxVirtualSize", -1)
296 ->setComment(
"Size of ROOT TTree TBasket cache. Affects performance.");
297 desc.addUntracked<
bool>(
"dropDescendantsOfDroppedBranches",
true)
298 ->setComment(
"If True, also drop on input any descendent of any branch dropped on input.");
299 desc.addUntracked<
bool>(
"labelRawDataLikeMC",
true)
300 ->setComment(
"If True: replace module label for raw data to match MC. Also use 'LHC' as process.");
301 desc.addUntracked<
bool>(
"delayReadingEventProducts",
true)
303 "If True: do not read a data product from the file until it is requested. If False: all event data "
304 "products are read upfront.");
310 descriptions.
add(
"source",
desc);