36 m_l1SeedsLogicalExpression(parSet.getParameter<
string>(
"L1SeedsLogicalExpression")),
37 m_l1GtObjectMapTag(parSet.getParameter<
edm::InputTag> (
"L1ObjectMapInputTag")),
39 m_l1GlobalTag(parSet.getParameter<
edm::InputTag> (
"L1GlobalInputTag")),
41 m_l1MuonCollectionsTag(parSet.getParameter<
edm::InputTag>(
"L1MuonInputTag")),
42 m_l1MuonTag(m_l1MuonCollectionsTag),
44 m_l1EGammaCollectionsTag(parSet.getParameter<
edm::InputTag>(
"L1EGammaInputTag")),
45 m_l1EGammaTag(m_l1EGammaCollectionsTag),
47 m_l1JetCollectionsTag(parSet.getParameter<
edm::InputTag>(
"L1JetInputTag")),
48 m_l1JetTag(m_l1JetCollectionsTag),
50 m_l1TauCollectionsTag(parSet.getParameter<
edm::InputTag>(
"L1TauInputTag")),
51 m_l1TauTag(m_l1TauCollectionsTag),
53 m_l1EtSumCollectionsTag(parSet.getParameter<
edm::InputTag>(
"L1EtSumInputTag")),
54 m_l1EtSumTag(m_l1EtSumCollectionsTag),
56 m_l1GlobalDecision(
false),
62 throw cms::Exception(
"FailModule") <<
"\nTrying to seed with an empty L1SeedsLogicalExpression.\n" << std::endl;
106 desc.
add<
string>(
"L1SeedsLogicalExpression",
"");
114 descriptions.
add(
"hltL1TSeed", desc);
157 <<
"\nHLTL1TSeed::hltFilter " 158 <<
"\n Dump TriggerFilterObjectWithRefs\n" << endl;
160 vector<l1t::MuonRef> seedsL1Mu;
162 const size_t sizeSeedsL1Mu = seedsL1Mu.size();
168 <<
"\n L1Mu seeds: " << sizeSeedsL1Mu << endl << endl;
170 for (
size_t i = 0;
i != sizeSeedsL1Mu;
i++) {
176 <<
"\tL1Mu " <<
"\t" <<
"q = " << obj->hwCharge()
177 <<
"\t" <<
"pt = " << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
178 <<
"\t" <<
"phi = " << obj->phi();
181 vector<l1t::EGammaRef> seedsL1EG;
183 const size_t sizeSeedsL1EG = seedsL1EG.size();
186 <<
"\n L1EG seeds: " << sizeSeedsL1EG << endl << endl;
188 for (
size_t i = 0;
i != sizeSeedsL1EG;
i++) {
194 <<
"\tL1EG " <<
"\t" <<
"pt = " 195 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
196 <<
"\t" <<
"phi = " << obj->phi();
199 vector<l1t::JetRef> seedsL1Jet;
201 const size_t sizeSeedsL1Jet = seedsL1Jet.size();
204 <<
"\n L1Jet seeds: " << sizeSeedsL1Jet << endl << endl;
206 for (
size_t i = 0;
i != sizeSeedsL1Jet;
i++) {
211 LogTrace(
"HLTL1TSeed") <<
"\tL1Jet " <<
"\t" <<
"pt = " 212 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
213 <<
"\t" <<
"phi = " << obj->phi();
216 vector<l1t::TauRef> seedsL1Tau;
218 const size_t sizeSeedsL1Tau = seedsL1Tau.size();
221 <<
"\n L1Tau seeds: " << sizeSeedsL1Tau << endl << endl;
223 for (
size_t i = 0;
i != sizeSeedsL1Tau;
i++) {
229 <<
"\tL1Tau " <<
"\t" <<
"pt = " 230 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
231 <<
"\t" <<
"phi = " << obj->phi();
234 vector<l1t::EtSumRef> seedsL1EtSumETT;
236 const size_t sizeSeedsL1EtSumETT = seedsL1EtSumETT.size();
238 <<
"\n L1EtSum ETT seeds: " << sizeSeedsL1EtSumETT << endl << endl;
240 for (
size_t i = 0;
i != sizeSeedsL1EtSumETT;
i++) {
244 <<
"\tL1EtSum ETT" <<
"\t" <<
"pt = " 245 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
246 <<
"\t" <<
"phi = " << obj->phi();
249 vector<l1t::EtSumRef> seedsL1EtSumHTT;
251 const size_t sizeSeedsL1EtSumHTT = seedsL1EtSumHTT.size();
253 <<
"\n L1EtSum HTT seeds: " << sizeSeedsL1EtSumHTT << endl << endl;
255 for (
size_t i = 0;
i != sizeSeedsL1EtSumHTT;
i++) {
259 <<
"\tL1EtSum HTT" <<
"\t" <<
"pt = " 260 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
261 <<
"\t" <<
"phi = " << obj->phi();
264 vector<l1t::EtSumRef> seedsL1EtSumETM;
266 const size_t sizeSeedsL1EtSumETM = seedsL1EtSumETM.size();
268 <<
"\n L1EtSum ETM seeds: " << sizeSeedsL1EtSumETM << endl << endl;
270 for (
size_t i = 0;
i != sizeSeedsL1EtSumETM;
i++) {
274 <<
"\tL1EtSum ETM" <<
"\t" <<
"pt = " 275 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
276 <<
"\t" <<
"phi = " << obj->phi();
279 vector<l1t::EtSumRef> seedsL1EtSumETMHF;
281 const size_t sizeSeedsL1EtSumETMHF = seedsL1EtSumETMHF.size();
283 <<
"\n L1EtSum ETMHF seeds: " << sizeSeedsL1EtSumETMHF << endl << endl;
285 for (
size_t i = 0;
i != sizeSeedsL1EtSumETMHF;
i++) {
289 <<
"\tL1EtSum ETMHF" <<
"\t" <<
"pt = " 290 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
291 <<
"\t" <<
"phi = " << obj->phi();
294 vector<l1t::EtSumRef> seedsL1EtSumHTM;
296 const size_t sizeSeedsL1EtSumHTM = seedsL1EtSumHTM.size();
298 <<
"\n L1EtSum HTM seeds: " << sizeSeedsL1EtSumHTM << endl << endl;
300 for (
size_t i = 0;
i != sizeSeedsL1EtSumHTM;
i++) {
304 <<
"\tL1EtSum HTM" <<
"\t" <<
"pt = " 305 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
306 <<
"\t" <<
"phi = " << obj->phi();
309 LogTrace(
"HLTL1TSeed") <<
" \n\n" << endl;
326 std::list<int> listMuon;
328 std::list<int> listEG;
330 std::list<int> listJet;
331 std::list<int> listTau;
333 std::list<int> listETM;
334 std::list<int> listETT;
335 std::list<int> listHTT;
336 std::list<int> listHTM;
337 std::list<int> listETMHF;
339 std::list<int> listJetCounts;
345 if (!uGtAlgoBlocks.
isValid()) {
348 <<
" Warning: GlobalAlgBlkBxCollection with input tag " 350 <<
" requested in configuration, but not found in the event." << std::endl;
356 if(uGtAlgoBlocks->
size() == 0) {
359 <<
" Warning: GlobalAlgBlkBxCollection with input tag " 361 <<
" is empty." << std::endl;
370 if (!gtObjectMapRecord.
isValid()) {
373 <<
" Warning: GlobalObjectMapRecord with input tag " 375 <<
" requested in configuration, but not found in the event." << std::endl;
382 const std::vector<GlobalObjectMap>& objMaps = gtObjectMapRecord->
gtObjectMap();
386 <<
"\n---------------------------------------------------------------------------------------------------------------------";
389 <<
"\n\tAlgorithms in L1TriggerObjectMapRecord and GT results ( emulated | initial | prescaled | final ) " << endl;
392 <<
"\n\tmap" <<
"\tAlgoBit" << std::setw(40) <<
"algoName" <<
"\t (emul|ini|pre|fin)" << endl;
395 <<
"---------------------------------------------------------------------------------------------------------------------";
397 for (
size_t imap =0; imap < objMaps.size(); imap++) {
399 int bit = objMaps[imap].algoBitNumber();
401 int emulDecision = objMaps[imap].algoGtlResult();
404 int initDecision = (uGtAlgoBlocks->
at(0,0)).getAlgoDecisionInitial(bit);
405 int presDecision = (uGtAlgoBlocks->
at(0,0)).getAlgoDecisionInterm(bit);
406 int finlDecision = (uGtAlgoBlocks->
at(0,0)).getAlgoDecisionFinal(bit);
408 if(emulDecision != initDecision) {
411 <<
"L1T decision (emulated vs. unpacked initial) is not the same:" 412 <<
"\n\tbit = " << std::setw(3) << bit
413 << std::setw(40) << objMaps[imap].algoName()
414 <<
"\t emulated decision = " << emulDecision <<
"\t unpacked initial decision = " << initDecision
415 <<
"\nThis should not happen. Include the L1TGtEmulCompare module in the sequence."<< endl;
421 <<
"\t" << std::setw(3) << imap
422 <<
"\tbit = " << std::setw(3) << bit
423 << std::setw(40) << objMaps[imap].algoName()
424 <<
"\t ( " << emulDecision <<
" | " << initDecision <<
" | " << presDecision <<
" | " << finlDecision <<
" ) ";
438 return (uGtAlgoBlocks->
at(0,0)).getFinalOR();
445 std::vector<GlobalLogicParser::OperandToken>& algOpTokenVector =
448 for (
auto &
i : algOpTokenVector) {
452 i.tokenResult =
false;
458 for (
auto &
i : algOpTokenVector) {
464 if(objMap ==
nullptr) {
467 <<
", requested as seed by a HLT path, cannot be matched to a L1 algo name in any GlobalObjectMap\n" 468 <<
"Please check if algorithm " << algoName <<
" is present in the L1 menu\n" << std::endl;
476 bool finalAlgoDecision = (uGtAlgoBlocks->
at(0,0)).getAlgoDecisionFinal(bit);
477 i.tokenResult = finalAlgoDecision;
491 <<
"\n Result for logical expression after update of algOpTokens: " << seedsResult <<
"\n" 498 for (std::vector<GlobalLogicParser::OperandToken>::const_iterator
504 <<
"\n ---------------- algo seed name = " << algoSeedName << endl;
508 if(objMap ==
nullptr) {
512 throw cms::Exception(
"FailModule") <<
"\nAlgorithm " << algoSeedName
513 <<
", requested as seed by a HLT path, cannot be matched to a L1 algo name in any GlobalObjectMap\n" 514 <<
"Please check if algorithm " << algoSeedName <<
" is present in the L1 menu\n" << std::endl;
525 <<
"\n\tAlgo seed " << algoSeedName <<
" result emulated | final = " << algoSeedResult <<
" | " << algoSeedResultMaskAndPresc << endl;
529 if(!algoSeedResultMaskAndPresc)
continue;
534 if(!algoSeedResult)
continue;
536 const std::vector<GlobalLogicParser::OperandToken>& opTokenVecObjMap = objMap->
operandTokenVector();
537 const std::vector<L1TObjectTypeInCond>& condObjTypeVec = objMap->
objectTypeVector();
538 const std::vector<CombinationsInCond>& condCombinations = objMap->
combinationVector();
541 <<
"\n\talgoName =" << objMap->
algoName()
542 <<
"\talgoBitNumber = " << algoSeedBitNumber
543 <<
"\talgoGtlResult = " << algoSeedResult << endl << endl;
546 if (opTokenVecObjMap.size() != condObjTypeVec.size() ) {
548 <<
"\nWarning: GlobalObjectMapRecord with input tag " 550 <<
"\nhas object map for bit number " << algoSeedBitNumber <<
" which contains different size vectors of operand tokens and of condition object types!" << std::endl;
552 assert(opTokenVecObjMap.size() == condObjTypeVec.size());
555 if (opTokenVecObjMap.size() != condCombinations.size()) {
557 <<
"\nWarning: GlobalObjectMapRecord with input tag " 559 <<
"\nhas object map for bit number " << algoSeedBitNumber <<
" which contains different size vectors of operand tokens and of condition object combinations!" << std::endl;
561 assert(opTokenVecObjMap.size() == condCombinations.size());
566 for (
size_t condNumber = 0; condNumber < opTokenVecObjMap.size(); condNumber++) {
568 std::vector<l1t::GlobalObject> condObjType = condObjTypeVec[condNumber];
570 for (
auto & jOb : condObjType) {
573 << setw(15) <<
"\tcondObjType = " << jOb << endl;
577 const std::string condName = opTokenVecObjMap[condNumber].tokenName;
578 bool condResult = opTokenVecObjMap[condNumber].tokenResult;
591 << setw(15) <<
"\tcondCombinations = " << condComb->size() << endl;
593 for (
auto const & itComb : (*condComb)) {
596 << setw(15) <<
"\tnew combination" << endl;
600 for (
auto itObject = itComb.begin(); itObject != itComb.end(); itObject++) {
604 if(condObjType.empty()) {
607 <<
"\talgoName = " << objMap->
algoName() <<
" is object-less L1 algorithm, so do not attempt to store any objects to the list of seeds.\n" 621 <<
"\tAdd object of type " << objTypeVal <<
" and index " << (*itObject) <<
" to the seed list." 630 switch (objTypeVal) {
632 listMuon.push_back(*itObject);
637 listEG.push_back(*itObject);
641 listJet.push_back(*itObject);
645 listTau.push_back(*itObject);
649 listETM.push_back(*itObject);
653 listETT.push_back(*itObject);
657 listHTT.push_back(*itObject);
661 listHTM.push_back(*itObject);
665 listETMHF.push_back(*itObject);
678 <<
"\n HLTL1TSeed::hltFilter " 679 <<
"\n Unknown object of type " << objTypeVal
680 <<
" and index " << (*itObject) <<
" in the seed list." 725 listJetCounts.sort();
726 listJetCounts.unique();
733 if (!listMuon.empty()) {
740 <<
"\nWarning: L1MuonBxCollection with input tag " 742 <<
"\nrequested in configuration, but not found in the event." 743 <<
"\nNo muons added to filterproduct." 748 for (std::list<int>::const_iterator itObj = listMuon.begin(); itObj != listMuon.end(); ++itObj) {
764 if (!listEG.empty()) {
770 <<
"\nWarning: L1EGammaBxCollection with input tag " <<
m_l1EGammaTag 771 <<
"\nrequested in configuration, but not found in the event." 772 <<
"\nNo egammas added to filterproduct." 777 for (std::list<int>::const_iterator itObj = listEG.begin(); itObj != listEG.end(); ++itObj) {
792 if (!listJet.empty()) {
799 <<
"\nWarning: L1JetBxCollection with input tag " <<
m_l1JetTag 800 <<
"\nrequested in configuration, but not found in the event." 801 <<
"\nNo jets added to filterproduct." 806 for (std::list<int>::const_iterator itObj = listJet.begin(); itObj != listJet.end(); ++itObj) {
821 if (!listTau.empty()) {
828 <<
"\nWarning: L1TauBxCollection with input tag " <<
m_l1TauTag 829 <<
"\nrequested in configuration, but not found in the event." 830 <<
"\nNo taus added to filterproduct." 835 for (std::list<int>::const_iterator itObj = listTau.begin(); itObj != listTau.end(); ++itObj) {
854 <<
"\nWarning: L1EtSumBxCollection with input tag " 856 <<
"\nrequested in configuration, but not found in the event." 857 <<
"\nNo etsums added to filterproduct." 863 for (iter = etsums->
begin(0); iter != etsums->
end(0); ++iter){
867 switch(iter->getType()) {
886 if(!listETMHF.empty())
890 LogTrace(
"HLTL1TSeed") <<
" L1EtSum seed of currently unsuported HLT TriggerType. l1t::EtSum type: " << iter->getType() <<
"\n";
918 <<
"\nHLTL1Seed:seedsL1TriggerObjectMaps returning " << seedsResult << endl << endl;
BXVector< EGamma > EGammaBxCollection
const_iterator end(int bx) const
std::string m_l1SeedsLogicalExpression
virtual const bool expressionResult() const
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
edm::EDGetTokenT< l1t::EtSumBxCollection > m_l1EtSumToken
unsigned size(int bx) const
edm::Ref< TauBxCollection > TauRef
const GlobalObjectMap * getObjectMap(const std::string &algoNameVal) const
return the object map for the algorithm algoNameVal
std::vector< std::vector< const std::vector< l1t::GlobalObject > * > > m_l1AlgoSeedsObjType
vector of object-type vectors for each condition in the required algorithms for seeding ...
edm::Ref< EGammaBxCollection > EGammaRef
const std::vector< L1TObjectTypeInCond > & objectTypeVector() const
std::vector< bool > const & getAlgoDecisionFinal() const
edm::InputTag m_l1MuonTag
HLTL1TSeed(const edm::ParameterSet &)
constructor
bool getByToken(EDGetToken token, Handle< PROD > &result) const
enum start value shifted to 81 so as to avoid clashes with PDG codes
bool seedsL1TriggerObjectMaps(edm::Event &, trigger::TriggerFilterObjectWithRefs &)
seeding is done via L1 trigger object maps, considering the objects which fired in L1 ...
#define DEFINE_FWK_MODULE(type)
unsigned int key(const_iterator &iter) const
bool algoGtlResult() const
const std::vector< GlobalObjectMap > & gtObjectMap() const
get / set the vector of object maps
BXVector< Tau > TauBxCollection
std::vector< GlobalLogicParser::OperandToken > expressionSeedsOperandList()
edm::Ref< MuonBxCollection > MuonRef
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
edm::Ref< JetBxCollection > JetRef
BXVector< EtSum > EtSumBxCollection
edm::InputTag m_l1GtObjectMapTag
InputTag for L1 Global Trigger object maps. This is done per menu. Should be part of Run...
~HLTL1TSeed() override
destructor
edm::EDGetTokenT< l1t::JetBxCollection > m_l1JetToken
std::vector< OperandToken > & operandTokenVector()
return the vector of operand tokens
GlobalLogicParser m_l1AlgoLogicParser
logic parser for m_l1SeedsLogicalExpression
edm::EDGetTokenT< l1t::EGammaBxCollection > m_l1EGammaToken
edm::InputTag m_l1EtSumTag
std::vector< const std::vector< GlobalLogicParser::TokenRPN > * > m_l1AlgoSeedsRpn
vector of Rpn vectors for the required algorithms for seeding
int algoBitNumber() const
get / set bit number for algorithm in the object map
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const std::vector< CombinationsInCond > & combinationVector() const
BXVector< Muon > MuonBxCollection
const std::vector< GlobalLogicParser::OperandToken > & operandTokenVector() const
bool m_isDebugEnabled
cache edm::isDebugEnabled()
std::vector< GlobalLogicParser::OperandToken > m_l1AlgoSeeds
list of required algorithms for seeding
const std::string & algoName() const
destructor
BXVector< Jet > JetBxCollection
edm::InputTag m_l1EGammaTag
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::Ref< EtSumBxCollection > EtSumRef
edm::InputTag m_l1GlobalTag
InputTag for L1 Global Trigger.
edm::EDGetTokenT< GlobalAlgBlkBxCollection > m_l1GlobalToken
const CombinationsInCond * getCombinationsInCond(const std::string &condNameVal) const
return all the combinations passing the requirements imposed in condition condNameVal ...
void dumpTriggerFilterObjectWithRefs(trigger::TriggerFilterObjectWithRefs &) const
detailed print of filter content
bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) override
filter the event
bool m_l1GlobalDecision
flag to pass if L1TGlobal accept
std::vector< SingleCombInCond > CombinationsInCond
all the object combinations evaluated to true in the condition
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
parameter description
const_iterator begin(int bx) const
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
edm::EDGetTokenT< l1t::MuonBxCollection > m_l1MuonToken
std::vector< EtSum >::const_iterator const_iterator
edm::EDGetTokenT< l1t::TauBxCollection > m_l1TauToken
edm::EDGetTokenT< GlobalObjectMapRecord > m_l1GtObjectMapToken
const T & at(int bx, unsigned i) const