54 const std::vector<std::string>& iFileNames2,
55 bool useSecFileMapSorted)
63 event2_->setGetter( getter_ );
68 std::cout <<
"------------------------------------------------------------------------" << std::endl;
69 std::cout <<
"WARNING! What you are about to do may be very slow." << std::endl;
70 std::cout <<
"The 2-file solution in FWLite works with very simple assumptions." << std::endl;
71 std::cout <<
"It will linearly search through the files in the secondary file list for Products." << std::endl;
72 std::cout <<
"There are speed improvements available to make this run faster." << std::endl;
73 std::cout <<
"***If your secondary files are sorted with a run-range within a file, (almost always the case) " << std::endl;
74 std::cout <<
"***please use the option useSecFileMapSorted=true in this constructor. " << std::endl;
75 std::cout <<
" > usage: MultiChainEvent( primaryFiles, secondaryFiles, true);" << std::endl;
76 std::cout <<
"------------------------------------------------------------------------" << std::endl;
82 std::cout <<
"------------------------------------------------------------------------" << std::endl;
83 std::cout <<
"This MultiChainEvent is now creating a (run_range)_2 ---> file_index_2 map" << std::endl;
84 std::cout <<
"for the 2-file solution. " << std::endl;
85 std::cout <<
"This is assuming the files you are giving me are sorted by run,event pairs within each secondary file." << std::endl;
86 std::cout <<
"If this is not true (rarely the case), set this option to false." << std::endl;
87 std::cout <<
" > usage: MultiChainEvent( primaryFiles, secondaryFiles, false);" << std::endl;
88 std::cout <<
"------------------------------------------------------------------------" << std::endl;
95 std::pair<event_id_range,Long64_t> eventRange;
96 bool firstFile =
true;
98 bool foundAny =
false;
100 for( event2_->toBegin();
104 if ( lastFile != event2_->getTFile() ) {
114 eventRange.first.first = event2_->event()->id();
115 lastFile = event2_->getTFile();
121 eventRange.first.second = event2_->event()->id();
122 eventRange.second = event2_->eventIndex();
202 return event1_->to( run, lumi, event );
209 return to( run, 0U, event );
225 if (
event2_->event_->to(
id ) )
233 for ( sec_file_range_index_map::const_iterator mBegin =
240 if ( id < mit->
first.first ||
id > mit->first.second )
251 event2_->switchToFile( mit->second );
275 <<
" in secondary list. Exiting."
310 const char* iInstance,
311 const char* iProcess)
const
313 return event1_->getBranchNameFor(iType,iModule,iInstance,iProcess);
316 const std::vector<edm::BranchDescription>&
319 return event1_->getBranchDescriptions();
322 const std::vector<std::string>&
325 return event1_->getProcessHistory();
331 return event1_->eventAuxiliary();
337 const char* iInstance,
338 const char* iProcess,
341 bool ret1 =
event1_->getByLabel(iType,iModule,iInstance,iProcess,iValue);
344 bool ret2 =
event2_->getByLabel(iType,iModule,iInstance,iProcess,iValue);
345 if ( !ret2 )
return false;
357 prod =
event2_->getByProductID(iID);
359 throw cms::Exception(
"ProductNotFound") <<
"Cannot find product " << iID;
392 if (names != 0)
return *
names;
394 event1_->fillParameterSetRegistry();
396 if (names != 0)
return *
names;
401 event2_->fillParameterSetRegistry();
403 if (names != 0)
return *
names;
406 <<
"TriggerNames not found in ParameterSet registry";
414 hTriggerResults.
getByLabel(*
this,
"TriggerResults",
"",process.c_str());
415 if ( !hTriggerResults.
isValid()) {
422 event1_->fillParameterSetRegistry();
428 event2_->fillParameterSetRegistry();
441 const char* iInstance,
442 const char* iProcess) {
virtual const std::string getBranchNameFor(const std::type_info &, const char *, const char *, const char *) const
static void throwProductNotFoundException(const std::type_info &, const char *, const char *, const char *)
MultiChainEvent(const std::vector< std::string > &iFileNames1, const std::vector< std::string > &iFileNames2, bool useSecFileMapSorted=false)
unsigned int EventNumber_t
MultiProductGetter(MultiChainEvent const *iEvent)
const std::vector< std::string > & getProcessHistory() const
MultiChainEvent const * event_
virtual bool getByLabel(const std::type_info &, const char *, const char *, const char *, void *) const
boost::shared_ptr< ChainEvent > event2_
virtual ~MultiChainEvent()
edm::LuminosityBlockNumber_t luminosityBlock() const
const MultiChainEvent & operator++()
unsigned int LuminosityBlockNumber_t
bool to(Long64_t iIndex)
Go to the event at index iIndex.
const std::vector< edm::BranchDescription > & getBranchDescriptions() const
void getByLabel(const P &iP, const char *iModuleLabel, const char *iProductInstanceLabel=0, const char *iProcessLabel=0)
const MultiChainEvent & toBegin()
bool toSec(Long64_t iIndex)
Go to the event from secondary files at index iIndex.
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
bool useSecFileMapSorted_
boost::shared_ptr< ChainEvent > event1_
boost::shared_ptr< internal::MultiProductGetter > getter_
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::EDProduct const * getByProductID(edm::ProductID const &) const
sec_file_range_index_map secFileMapSorted_
static TriggerNames const * triggerNames_(edm::TriggerResults const &triggerResults)
virtual edm::EventAuxiliary const & eventAuxiliary() const
std::pair< edm::EventID, edm::EventID > event_id_range
virtual edm::EDProduct const * getIt(edm::ProductID const &iID) const
virtual edm::TriggerResultsByName triggerResultsByName(std::string const &process) const
static void throwProductNotFoundException(const std::type_info &, const char *, const char *, const char *)
T const * product() const
static const HistoName names[]