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> seedsL1EtSumHTM;
281 const size_t sizeSeedsL1EtSumHTM = seedsL1EtSumHTM.size();
283 <<
"\n L1EtSum HTM seeds: " << sizeSeedsL1EtSumHTM << endl << endl;
285 for (
size_t i = 0;
i != sizeSeedsL1EtSumHTM;
i++) {
289 <<
"\tL1EtSum HTM" <<
"\t" <<
"pt = " 290 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
291 <<
"\t" <<
"phi = " << obj->phi();
294 LogTrace(
"HLTL1TSeed") <<
" \n\n" << endl;
311 std::list<int> listMuon;
313 std::list<int> listEG;
315 std::list<int> listJet;
316 std::list<int> listTau;
318 std::list<int> listETM;
319 std::list<int> listETT;
320 std::list<int> listHTT;
321 std::list<int> listHTM;
323 std::list<int> listJetCounts;
329 if (!uGtAlgoBlocks.
isValid()) {
332 <<
" Warning: GlobalAlgBlkBxCollection with input tag " 334 <<
" requested in configuration, but not found in the event." << std::endl;
340 if(uGtAlgoBlocks->
size() == 0) {
343 <<
" Warning: GlobalAlgBlkBxCollection with input tag " 345 <<
" is empty." << std::endl;
354 if (!gtObjectMapRecord.
isValid()) {
357 <<
" Warning: GlobalObjectMapRecord with input tag " 359 <<
" requested in configuration, but not found in the event." << std::endl;
366 const std::vector<GlobalObjectMap>& objMaps = gtObjectMapRecord->
gtObjectMap();
370 <<
"\n---------------------------------------------------------------------------------------------------------------------";
373 <<
"\n\tAlgorithms in L1TriggerObjectMapRecord and GT results ( emulated | initial | prescaled | final ) " << endl;
376 <<
"\n\tmap" <<
"\tAlgoBit" << std::setw(40) <<
"algoName" <<
"\t (emul|ini|pre|fin)" << endl;
379 <<
"---------------------------------------------------------------------------------------------------------------------";
381 for (
size_t imap =0; imap < objMaps.size(); imap++) {
383 int bit = objMaps[imap].algoBitNumber();
385 int emulDecision = objMaps[imap].algoGtlResult();
388 int initDecision = (uGtAlgoBlocks->
at(0,0)).getAlgoDecisionInitial(bit);
389 int presDecision = (uGtAlgoBlocks->
at(0,0)).getAlgoDecisionInterm(bit);
390 int finlDecision = (uGtAlgoBlocks->
at(0,0)).getAlgoDecisionFinal(bit);
392 if(emulDecision != initDecision) {
395 <<
"L1T decision (emulated vs. unpacked initial) is not the same:" 396 <<
"\n\tbit = " << std::setw(3) << bit
397 << std::setw(40) << objMaps[imap].algoName()
398 <<
"\t emulated decision = " << emulDecision <<
"\t unpacked initial decision = " << initDecision
399 <<
"\nThis should not happen. Include the L1TGtEmulCompare module in the sequence."<< endl;
405 <<
"\t" << std::setw(3) << imap
406 <<
"\tbit = " << std::setw(3) << bit
407 << std::setw(40) << objMaps[imap].algoName()
408 <<
"\t ( " << emulDecision <<
" | " << initDecision <<
" | " << presDecision <<
" | " << finlDecision <<
" ) ";
422 return (uGtAlgoBlocks->
at(0,0)).getFinalOR();
429 std::vector<GlobalLogicParser::OperandToken>& algOpTokenVector =
432 for (
auto &
i : algOpTokenVector) {
436 i.tokenResult =
false;
442 for (
auto &
i : algOpTokenVector) {
448 if(objMap ==
nullptr) {
451 <<
", requested as seed by a HLT path, cannot be matched to a L1 algo name in any GlobalObjectMap\n" 452 <<
"Please check if algorithm " << algoName <<
" is present in the L1 menu\n" << std::endl;
460 bool finalAlgoDecision = (uGtAlgoBlocks->
at(0,0)).getAlgoDecisionFinal(bit);
461 i.tokenResult = finalAlgoDecision;
475 <<
"\n Result for logical expression after update of algOpTokens: " << seedsResult <<
"\n" 482 for (std::vector<GlobalLogicParser::OperandToken>::const_iterator
488 <<
"\n ---------------- algo seed name = " << algoSeedName << endl;
492 if(objMap ==
nullptr) {
496 throw cms::Exception(
"FailModule") <<
"\nAlgorithm " << algoSeedName
497 <<
", requested as seed by a HLT path, cannot be matched to a L1 algo name in any GlobalObjectMap\n" 498 <<
"Please check if algorithm " << algoSeedName <<
" is present in the L1 menu\n" << std::endl;
509 <<
"\n\tAlgo seed " << algoSeedName <<
" result emulated | final = " << algoSeedResult <<
" | " << algoSeedResultMaskAndPresc << endl;
513 if(!algoSeedResultMaskAndPresc)
continue;
518 if(!algoSeedResult)
continue;
520 const std::vector<GlobalLogicParser::OperandToken>& opTokenVecObjMap = objMap->
operandTokenVector();
521 const std::vector<L1TObjectTypeInCond>& condObjTypeVec = objMap->
objectTypeVector();
522 const std::vector<CombinationsInCond>& condCombinations = objMap->
combinationVector();
525 <<
"\n\talgoName =" << objMap->
algoName()
526 <<
"\talgoBitNumber = " << algoSeedBitNumber
527 <<
"\talgoGtlResult = " << algoSeedResult << endl << endl;
530 if (opTokenVecObjMap.size() != condObjTypeVec.size() ) {
532 <<
"\nWarning: GlobalObjectMapRecord with input tag " 534 <<
"\nhas object map for bit number " << algoSeedBitNumber <<
" which contains different size vectors of operand tokens and of condition object types!" << std::endl;
536 assert(opTokenVecObjMap.size() == condObjTypeVec.size());
539 if (opTokenVecObjMap.size() != condCombinations.size()) {
541 <<
"\nWarning: GlobalObjectMapRecord with input tag " 543 <<
"\nhas object map for bit number " << algoSeedBitNumber <<
" which contains different size vectors of operand tokens and of condition object combinations!" << std::endl;
545 assert(opTokenVecObjMap.size() == condCombinations.size());
550 for (
size_t condNumber = 0; condNumber < opTokenVecObjMap.size(); condNumber++) {
552 std::vector<l1t::GlobalObject> condObjType = condObjTypeVec[condNumber];
554 for (
auto & jOb : condObjType) {
557 << setw(15) <<
"\tcondObjType = " << jOb << endl;
561 const std::string condName = opTokenVecObjMap[condNumber].tokenName;
562 bool condResult = opTokenVecObjMap[condNumber].tokenResult;
575 << setw(15) <<
"\tcondCombinations = " << condComb->size() << endl;
577 for (
auto const & itComb : (*condComb)) {
580 << setw(15) <<
"\tnew combination" << endl;
584 for (
auto itObject = itComb.begin(); itObject != itComb.end(); itObject++) {
588 if(condObjType.size() == 0) {
591 <<
"\talgoName = " << objMap->
algoName() <<
" is object-less L1 algorithm, so do not attempt to store any objects to the list of seeds.\n" 605 <<
"\tAdd object of type " << objTypeVal <<
" and index " << (*itObject) <<
" to the seed list." 615 switch (objTypeVal) {
617 listMuon.push_back(*itObject);
622 listEG.push_back(*itObject);
626 listJet.push_back(*itObject);
630 listTau.push_back(*itObject);
634 listETM.push_back(*itObject);
639 listETT.push_back(*itObject);
645 listHTT.push_back(*itObject);
651 listHTM.push_back(*itObject);
665 <<
"\n HLTL1TSeed::hltFilter " 666 <<
"\n Unknown object of type " << objTypeVal
667 <<
" and index " << (*itObject) <<
" in the seed list." 709 listJetCounts.sort();
710 listJetCounts.unique();
717 if (!listMuon.empty()) {
724 <<
"\nWarning: L1MuonBxCollection with input tag " 726 <<
"\nrequested in configuration, but not found in the event." 727 <<
"\nNo muons added to filterproduct." 732 for (std::list<int>::const_iterator itObj = listMuon.begin(); itObj != listMuon.end(); ++itObj) {
748 if (!listEG.empty()) {
754 <<
"\nWarning: L1EGammaBxCollection with input tag " <<
m_l1EGammaTag 755 <<
"\nrequested in configuration, but not found in the event." 756 <<
"\nNo egammas added to filterproduct." 761 for (std::list<int>::const_iterator itObj = listEG.begin(); itObj != listEG.end(); ++itObj) {
776 if (!listJet.empty()) {
783 <<
"\nWarning: L1JetBxCollection with input tag " <<
m_l1JetTag 784 <<
"\nrequested in configuration, but not found in the event." 785 <<
"\nNo jets added to filterproduct." 790 for (std::list<int>::const_iterator itObj = listJet.begin(); itObj != listJet.end(); ++itObj) {
805 if (!listTau.empty()) {
812 <<
"\nWarning: L1TauBxCollection with input tag " <<
m_l1TauTag 813 <<
"\nrequested in configuration, but not found in the event." 814 <<
"\nNo taus added to filterproduct." 819 for (std::list<int>::const_iterator itObj = listTau.begin(); itObj != listTau.end(); ++itObj) {
838 <<
"\nWarning: L1EtSumBxCollection with input tag " 840 <<
"\nrequested in configuration, but not found in the event." 841 <<
"\nNo etsums added to filterproduct." 847 for (iter = etsums->
begin(0); iter != etsums->
end(0); ++iter){
851 switch(iter->getType()) {
870 LogTrace(
"HLTL1TSeed") <<
" L1EtSum seed of currently unsuported HLT TriggerType. l1t::EtSum type: " << iter->getType() <<
"\n";
898 <<
"\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)
virtual ~HLTL1TSeed()
destructor
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...
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
virtual 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