|
|
Go to the documentation of this file.
41 std::vector<edm::WrapperBase const*>& foundContainers,
42 std::vector<unsigned int>&
keys)
const override {
65 std::vector<std::string>
const& iFileNames2,
66 bool useSecFileMapSorted) {
67 event1_ = std::make_shared<ChainEvent>(iFileNames1);
68 event2_ = std::make_shared<ChainEvent>(iFileNames2);
70 getter_ = std::make_shared<internal::MultiProductGetter>(
this);
73 std::cout <<
"------------------------------------------------------------------------" << std::endl;
74 std::cout <<
"WARNING! MultiChainEvent: all primary files have zero events." << std::endl;
75 std::cout <<
"Trying to access the events may lead to a crash. " << std::endl;
76 std::cout <<
"------------------------------------------------------------------------" << std::endl;
85 std::cout <<
"------------------------------------------------------------------------" << std::endl;
86 std::cout <<
"WARNING! What you are about to do may be very slow." << std::endl;
87 std::cout <<
"The 2-file solution in FWLite works with very simple assumptions." << std::endl;
88 std::cout <<
"It will linearly search through the files in the secondary file list for Products." << std::endl;
89 std::cout <<
"There are speed improvements available to make this run faster." << std::endl;
90 std::cout <<
"***If your secondary files are sorted with a run-range within a file, (almost always the case) "
92 std::cout <<
"***please use the option useSecFileMapSorted=true in this constructor. " << std::endl;
93 std::cout <<
" > usage: MultiChainEvent(primaryFiles, secondaryFiles, true);" << std::endl;
94 std::cout <<
"------------------------------------------------------------------------" << std::endl;
98 std::cout <<
"------------------------------------------------------------------------" << std::endl;
99 std::cout <<
"This MultiChainEvent is now creating a (run_range)_2 ---> file_index_2 map" << std::endl;
100 std::cout <<
"for the 2-file solution. " << std::endl;
102 <<
"This is assuming the files you are giving me are sorted by run,event pairs within each secondary file."
104 std::cout <<
"If this is not true (rarely the case), set this option to false." << std::endl;
105 std::cout <<
" > usage: MultiChainEvent(primaryFiles, secondaryFiles, false);" << std::endl;
106 std::cout <<
"------------------------------------------------------------------------" << std::endl;
111 TFile* lastFile =
nullptr;
112 std::pair<event_id_range, Long64_t>
eventRange;
113 bool firstFile =
true;
115 bool foundAny =
false;
119 if (lastFile !=
event2_->getTFile()) {
129 lastFile =
event2_->getTFile();
219 for (sec_file_range_index_map::const_iterator mBegin =
secFileMapSorted_.begin(),
224 if (id < mit->
first.first ||
id > mit->first.second) {
234 event2_->switchToFile(mit->second);
254 <<
"Cannot find id " <<
id.run() <<
", " <<
id.event() <<
" in secondary list. Exiting." << std::endl;
281 char const* iInstance,
282 char const* iProcess)
const {
283 return event1_->getBranchNameFor(iType, iModule, iInstance, iProcess);
287 return event1_->getBranchDescriptions();
298 char const* iInstance,
299 char const* iProcess,
300 void* iValue)
const {
301 bool ret1 =
event1_->getByLabel(iType, iModule, iInstance, iProcess, iValue);
303 (const_cast<MultiChainEvent*>(
this))->
toSec(
event1_->id());
304 bool ret2 =
event2_->getByLabel(iType, iModule, iInstance, iProcess, iValue);
315 if (edp ==
nullptr) {
316 (const_cast<MultiChainEvent*>(
this))->
toSec(
event1_->id());
317 edp =
event2_->getByProductID(iID);
326 if (edp ==
nullptr) {
327 (const_cast<MultiChainEvent*>(
this))->
toSec(
event1_->id());
334 std::vector<edm::WrapperBase const*>& wrappers,
335 std::vector<unsigned int>&
keys)
const {
339 if (
std::find(wrappers.begin(), wrappers.end(),
nullptr) != wrappers.end()) {
340 (const_cast<MultiChainEvent*>(
this))->
toSec(
event1_->id());
354 if (
names !=
nullptr)
357 event1_->fillParameterSetRegistry();
359 if (
names !=
nullptr)
365 event2_->fillParameterSetRegistry();
367 if (
names !=
nullptr)
370 throw cms::Exception(
"TriggerNamesNotFound") <<
"TriggerNames not found in ParameterSet registry";
377 if (
names ==
nullptr) {
378 event1_->fillParameterSetRegistry();
382 if (
names ==
nullptr) {
384 event2_->fillParameterSetRegistry();
393 if (
nullptr ==
pset) {
403 char const* iInstance,
404 char const* iProcess) {
std::vector< std::string > const & getProcessHistory() const
const MultiChainEvent & operator++() override
bool atEnd() const override
std::shared_ptr< ChainEvent > event1_
static const std::string triggerResults
static void throwProductNotFoundException(std::type_info const &, char const *, char const *, char const *)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
unsigned int LuminosityBlockNumber_t
bool getByLabel(std::type_info const &, char const *, char const *, char const *, void *) const override
unsigned int transitionIndex_() const override
const std::string getBranchNameFor(std::type_info const &, char const *, char const *, char const *) const override
MultiChainEvent(std::vector< std::string > const &iFileNames1, std::vector< std::string > const &iFileNames2, bool useSecFileMapSorted=false)
bool useSecFileMapSorted_
const std::string names[nVars_]
void getThinnedProducts(edm::ProductID const &pid, std::vector< edm::WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys) const override
edm::WrapperBase const * getThinnedProduct(edm::ProductID const &pid, unsigned int &key) const override
unsigned long long EventNumber_t
static void throwProductNotFoundException(std::type_info const &, char const *, char const *, char const *)
void getThinnedProducts(edm::ProductID const &pid, std::vector< edm::WrapperBase const * > &foundContainers, std::vector< unsigned int > &keys) const
edm::WrapperBase const * getByProductID(edm::ProductID const &) const override
std::vector< edm::BranchDescription > const & getBranchDescriptions() const
edm::WrapperBase const * getThinnedProduct(edm::ProductID const &pid, unsigned int &key) const
std::shared_ptr< internal::MultiProductGetter const > getter_
edm::LuminosityBlockNumber_t luminosityBlock() const
bool to(Long64_t iIndex)
Go to the event at index iIndex.
MultiChainEvent const * event_
edm::WrapperBase const * getIt(edm::ProductID const &iID) const override
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
MultiProductGetter(MultiChainEvent const *iEvent)
edm::TriggerResultsByName triggerResultsByName(edm::TriggerResults const &triggerResults) const override
edm::ParameterSet const * parameterSet(edm::ParameterSetID const &psID) const override
bool toSec(Long64_t iIndex)
Go to the event from secondary files at index iIndex.
const MultiChainEvent & toBegin() override
std::shared_ptr< ChainEvent > event2_
static TriggerNames const * triggerNames_(edm::TriggerResults const &triggerResults)
sec_file_range_index_map secFileMapSorted_
std::pair< edm::EventID, edm::EventID > event_id_range
~MultiChainEvent() 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
edm::ProcessHistory const & processHistory() const override
edm::EventAuxiliary const & eventAuxiliary() const override