37 m_l1SeedsLogicalExpression(parSet.getParameter<
string>(
"L1SeedsLogicalExpression")),
38 m_l1GtObjectMapTag(parSet.getParameter<edm::
InputTag> (
"L1ObjectMapInputTag")),
40 m_l1GlobalTag(parSet.getParameter<edm::
InputTag> (
"L1GlobalInputTag")),
42 m_l1MuonCollectionsTag(parSet.getParameter<edm::
InputTag>(
"L1MuonInputTag")),
43 m_l1MuonTag(m_l1MuonCollectionsTag),
45 m_l1EGammaCollectionsTag(parSet.getParameter<edm::
InputTag>(
"L1EGammaInputTag")),
46 m_l1EGammaTag(m_l1EGammaCollectionsTag),
48 m_l1JetCollectionsTag(parSet.getParameter<edm::
InputTag>(
"L1JetInputTag")),
49 m_l1JetTag(m_l1JetCollectionsTag),
51 m_l1TauCollectionsTag(parSet.getParameter<edm::
InputTag>(
"L1TauInputTag")),
52 m_l1TauTag(m_l1TauCollectionsTag),
54 m_l1EtSumCollectionsTag(parSet.getParameter<edm::
InputTag>(
"L1EtSumInputTag")),
55 m_l1EtSumTag(m_l1EtSumCollectionsTag),
57 m_l1GlobalDecision(
false),
63 throw cms::Exception(
"FailModule") <<
"\nTrying to seed with an empty L1SeedsLogicalExpression.\n" << std::endl;
107 desc.
add<
string>(
"L1SeedsLogicalExpression",
"");
115 descriptions.
add(
"hltL1TSeed", desc);
158 <<
"\nHLTL1TSeed::hltFilter "
159 <<
"\n Dump TriggerFilterObjectWithRefs\n" << endl;
161 vector<l1t::MuonRef> seedsL1Mu;
163 const size_t sizeSeedsL1Mu = seedsL1Mu.size();
169 <<
"\n L1Mu seeds: " << sizeSeedsL1Mu << endl << endl;
171 for (
size_t i = 0;
i != sizeSeedsL1Mu;
i++) {
177 <<
"\tL1Mu " <<
"\t" <<
"q = " << obj->hwCharge()
178 <<
"\t" <<
"pt = " << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
179 <<
"\t" <<
"phi = " << obj->phi();
182 vector<l1t::EGammaRef> seedsL1EG;
184 const size_t sizeSeedsL1EG = seedsL1EG.size();
187 <<
"\n L1EG seeds: " << sizeSeedsL1EG << endl << endl;
189 for (
size_t i = 0;
i != sizeSeedsL1EG;
i++) {
195 <<
"\tL1EG " <<
"\t" <<
"pt = "
196 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
197 <<
"\t" <<
"phi = " << obj->phi();
200 vector<l1t::JetRef> seedsL1Jet;
202 const size_t sizeSeedsL1Jet = seedsL1Jet.size();
205 <<
"\n L1Jet seeds: " << sizeSeedsL1Jet << endl << endl;
207 for (
size_t i = 0;
i != sizeSeedsL1Jet;
i++) {
212 LogTrace(
"HLTL1TSeed") <<
"\tL1Jet " <<
"\t" <<
"pt = "
213 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
214 <<
"\t" <<
"phi = " << obj->phi();
217 vector<l1t::TauRef> seedsL1Tau;
219 const size_t sizeSeedsL1Tau = seedsL1Tau.size();
222 <<
"\n L1Tau seeds: " << sizeSeedsL1Tau << endl << endl;
224 for (
size_t i = 0;
i != sizeSeedsL1Tau;
i++) {
230 <<
"\tL1Tau " <<
"\t" <<
"pt = "
231 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
232 <<
"\t" <<
"phi = " << obj->phi();
235 vector<l1t::EtSumRef> seedsL1EtSumETT;
237 const size_t sizeSeedsL1EtSumETT = seedsL1EtSumETT.size();
239 <<
"\n L1EtSum ETT seeds: " << sizeSeedsL1EtSumETT << endl << endl;
241 for (
size_t i = 0;
i != sizeSeedsL1EtSumETT;
i++) {
245 <<
"\tL1EtSum ETT" <<
"\t" <<
"pt = "
246 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
247 <<
"\t" <<
"phi = " << obj->phi();
250 vector<l1t::EtSumRef> seedsL1EtSumHTT;
252 const size_t sizeSeedsL1EtSumHTT = seedsL1EtSumHTT.size();
254 <<
"\n L1EtSum HTT seeds: " << sizeSeedsL1EtSumHTT << endl << endl;
256 for (
size_t i = 0;
i != sizeSeedsL1EtSumHTT;
i++) {
260 <<
"\tL1EtSum HTT" <<
"\t" <<
"pt = "
261 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
262 <<
"\t" <<
"phi = " << obj->phi();
265 vector<l1t::EtSumRef> seedsL1EtSumETM;
267 const size_t sizeSeedsL1EtSumETM = seedsL1EtSumETM.size();
269 <<
"\n L1EtSum ETM seeds: " << sizeSeedsL1EtSumETM << endl << endl;
271 for (
size_t i = 0;
i != sizeSeedsL1EtSumETM;
i++) {
275 <<
"\tL1EtSum ETM" <<
"\t" <<
"pt = "
276 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
277 <<
"\t" <<
"phi = " << obj->phi();
280 vector<l1t::EtSumRef> seedsL1EtSumHTM;
282 const size_t sizeSeedsL1EtSumHTM = seedsL1EtSumHTM.size();
284 <<
"\n L1EtSum HTM seeds: " << sizeSeedsL1EtSumHTM << endl << endl;
286 for (
size_t i = 0;
i != sizeSeedsL1EtSumHTM;
i++) {
290 <<
"\tL1EtSum HTM" <<
"\t" <<
"pt = "
291 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
292 <<
"\t" <<
"phi = " << obj->phi();
295 LogTrace(
"HLTL1TSeed") <<
" \n\n" << endl;
312 std::list<int> listMuon;
314 std::list<int> listEG;
316 std::list<int> listJet;
317 std::list<int> listTau;
319 std::list<int> listETM;
320 std::list<int> listETT;
321 std::list<int> listHTT;
322 std::list<int> listHTM;
324 std::list<int> listJetCounts;
330 if (!uGtAlgoBlocks.
isValid()) {
333 <<
" Warning: GlobalAlgBlkBxCollection with input tag "
335 <<
" requested in configuration, but not found in the event." << std::endl;
341 if(uGtAlgoBlocks->size() == 0) {
344 <<
" Warning: GlobalAlgBlkBxCollection with input tag "
346 <<
" is empty." << std::endl;
355 if (!gtObjectMapRecord.
isValid()) {
358 <<
" Warning: GlobalObjectMapRecord with input tag "
360 <<
" requested in configuration, but not found in the event." << std::endl;
367 const std::vector<GlobalObjectMap>& objMaps = gtObjectMapRecord->gtObjectMap();
371 <<
"\n---------------------------------------------------------------------------------------------------------------------";
374 <<
"\n\tAlgorithms in L1TriggerObjectMapRecord and GT results ( emulated | initial | prescaled | final ) " << endl;
377 <<
"\n\tmap" <<
"\tAlgoBit" << std::setw(40) <<
"algoName" <<
"\t (emul|ini|pre|fin)" << endl;
380 <<
"---------------------------------------------------------------------------------------------------------------------";
382 for (
size_t imap =0; imap < objMaps.size(); imap++) {
384 int bit = objMaps[imap].algoBitNumber();
386 int emulDecision = objMaps[imap].algoGtlResult();
389 int initDecision = (uGtAlgoBlocks->at(0,0)).getAlgoDecisionInitial(bit);
390 int presDecision = (uGtAlgoBlocks->at(0,0)).getAlgoDecisionInterm(bit);
391 int finlDecision = (uGtAlgoBlocks->at(0,0)).getAlgoDecisionFinal(bit);
393 if(emulDecision != initDecision) {
396 <<
"L1T decision (emulated vs. unpacked initial) is not the same:"
397 <<
"\n\tbit = " << std::setw(3) << bit
398 << std::setw(40) << objMaps[imap].algoName()
399 <<
"\t emulated decision = " << emulDecision <<
"\t unpacked initial decision = " << initDecision
400 <<
"\nThis should not happen. Include the L1TGtEmulCompare module in the sequence."<< endl;
406 <<
"\t" << std::setw(3) << imap
407 <<
"\tbit = " << std::setw(3) << bit
408 << std::setw(40) << objMaps[imap].algoName()
409 <<
"\t ( " << emulDecision <<
" | " << initDecision <<
" | " << presDecision <<
" | " << finlDecision <<
" ) ";
423 return (uGtAlgoBlocks->at(0,0)).getFinalOR();
430 std::vector<GlobalLogicParser::OperandToken>& algOpTokenVector =
433 for (
size_t i = 0;
i < algOpTokenVector.size(); ++
i) {
437 (algOpTokenVector[
i]).tokenResult =
false;
443 for (
size_t i = 0;
i < algOpTokenVector.size(); ++
i) {
447 const GlobalObjectMap* objMap = gtObjectMapRecord->getObjectMap(algoName);
452 <<
", requested as seed by a HLT path, cannot be matched to a L1 algo name in any GlobalObjectMap\n"
453 <<
"Please check if algorithm " << algoName <<
" is present in the L1 menu\n" << std::endl;
461 bool finalAlgoDecision = (uGtAlgoBlocks->at(0,0)).getAlgoDecisionFinal(bit);
462 (algOpTokenVector[
i]).tokenResult = finalAlgoDecision;
476 <<
"\n Result for logical expression after update of algOpTokens: " << seedsResult <<
"\n"
483 for (std::vector<GlobalLogicParser::OperandToken>::const_iterator
489 <<
"\n ---------------- algo seed name = " << algoSeedName << endl;
491 const GlobalObjectMap* objMap = gtObjectMapRecord->getObjectMap(algoSeedName);
497 throw cms::Exception(
"FailModule") <<
"\nAlgorithm " << algoSeedName
498 <<
", requested as seed by a HLT path, cannot be matched to a L1 algo name in any GlobalObjectMap\n"
499 <<
"Please check if algorithm " << algoSeedName <<
" is present in the L1 menu\n" << std::endl;
507 bool algoSeedResultMaskAndPresc = uGtAlgoBlocks->at(0,0).getAlgoDecisionFinal(algoSeedBitNumber);
510 <<
"\n\tAlgo seed " << algoSeedName <<
" result emulated | final = " << algoSeedResult <<
" | " << algoSeedResultMaskAndPresc << endl;
514 if(!algoSeedResultMaskAndPresc)
continue;
519 if(!algoSeedResult)
continue;
521 const std::vector<GlobalLogicParser::OperandToken>& opTokenVecObjMap = objMap->
operandTokenVector();
522 const std::vector<ObjectTypeInCond>& condObjTypeVec = objMap->
objectTypeVector();
523 const std::vector<CombinationsInCond>& condCombinations = objMap->
combinationVector();
526 <<
"\n\talgoName =" << objMap->
algoName()
527 <<
"\talgoBitNumber = " << algoSeedBitNumber
528 <<
"\talgoGtlResult = " << algoSeedResult << endl << endl;
531 if (opTokenVecObjMap.size() != condObjTypeVec.size() ) {
533 <<
"\nWarning: GlobalObjectMapRecord with input tag "
535 <<
"\nhas object map for bit number " << algoSeedBitNumber <<
" which contains different size vectors of operand tokens and of condition object types!" << std::endl;
537 assert(opTokenVecObjMap.size() == condObjTypeVec.size());
540 if (opTokenVecObjMap.size() != condCombinations.size()) {
542 <<
"\nWarning: GlobalObjectMapRecord with input tag "
544 <<
"\nhas object map for bit number " << algoSeedBitNumber <<
" which contains different size vectors of operand tokens and of condition object combinations!" << std::endl;
546 assert(opTokenVecObjMap.size() == condCombinations.size());
551 for (
size_t condNumber = 0; condNumber < opTokenVecObjMap.size(); condNumber++) {
553 std::vector<l1t::GlobalObject> condObjType = condObjTypeVec[condNumber];
555 for (
size_t jOb =0; jOb < condObjType.size(); jOb++) {
558 << setw(15) <<
"\tcondObjType = " << condObjType[jOb] << endl;
562 const std::string condName = opTokenVecObjMap[condNumber].tokenName;
563 bool condResult = opTokenVecObjMap[condNumber].tokenResult;
576 << setw(15) <<
"\tcondCombinations = " << condComb->size() << endl;
578 for (std::vector<SingleCombInCond>::const_iterator itComb = (*condComb).begin(); itComb != (*condComb).end(); itComb++) {
581 << setw(15) <<
"\tnew combination" << endl;
585 for (SingleCombInCond::const_iterator itObject = (*itComb).begin(); itObject != (*itComb).end(); itObject++) {
589 if(condObjType.size() == 0) {
592 <<
"\talgoName = " << objMap->
algoName() <<
" is object-less L1 algorithm, so do not attempt to store any objects to the list of seeds.\n"
606 <<
"\tAdd object of type " << objTypeVal <<
" and index " << (*itObject) <<
" to the seed list."
616 switch (objTypeVal) {
618 listMuon.push_back(*itObject);
623 listEG.push_back(*itObject);
627 listJet.push_back(*itObject);
631 listTau.push_back(*itObject);
635 listETM.push_back(*itObject);
640 listETT.push_back(*itObject);
646 listHTT.push_back(*itObject);
652 listHTM.push_back(*itObject);
666 <<
"\n HLTL1TSeed::hltFilter "
667 <<
"\n Unknown object of type " << objTypeVal
668 <<
" and index " << (*itObject) <<
" in the seed list."
710 listJetCounts.sort();
711 listJetCounts.unique();
718 if (!listMuon.empty()) {
725 <<
"\nWarning: L1MuonBxCollection with input tag "
727 <<
"\nrequested in configuration, but not found in the event."
728 <<
"\nNo muons added to filterproduct."
733 for (std::list<int>::const_iterator itObj = listMuon.begin(); itObj != listMuon.end(); ++itObj) {
737 unsigned int index = muons->begin(0) - muons->begin() + *itObj;
749 if (!listEG.empty()) {
755 <<
"\nWarning: L1EGammaBxCollection with input tag " <<
m_l1EGammaTag
756 <<
"\nrequested in configuration, but not found in the event."
757 <<
"\nNo egammas added to filterproduct."
762 for (std::list<int>::const_iterator itObj = listEG.begin(); itObj != listEG.end(); ++itObj) {
765 unsigned int index = egammas->begin(0) - egammas->begin() + *itObj;
777 if (!listJet.empty()) {
784 <<
"\nWarning: L1JetBxCollection with input tag " <<
m_l1JetTag
785 <<
"\nrequested in configuration, but not found in the event."
786 <<
"\nNo jets added to filterproduct."
791 for (std::list<int>::const_iterator itObj = listJet.begin(); itObj != listJet.end(); ++itObj) {
794 unsigned int index = jets->begin(0) - jets->begin() + *itObj;
806 if (!listTau.empty()) {
813 <<
"\nWarning: L1TauBxCollection with input tag " <<
m_l1TauTag
814 <<
"\nrequested in configuration, but not found in the event."
815 <<
"\nNo taus added to filterproduct."
820 for (std::list<int>::const_iterator itObj = listTau.begin(); itObj != listTau.end(); ++itObj) {
823 unsigned int index = taus->begin(0) - taus->begin() + *itObj;
839 <<
"\nWarning: L1EtSumBxCollection with input tag "
841 <<
"\nrequested in configuration, but not found in the event."
842 <<
"\nNo etsums added to filterproduct."
848 for (iter = etsums->begin(0); iter != etsums->end(0); ++iter){
852 switch(iter->getType()) {
871 LogTrace(
"HLTL1TSeed") <<
" L1EtSum seed of currently unsuported HLT TriggerType. l1t::EtSum type: " << iter->getType() <<
"\n";
899 <<
"\nHLTL1Seed:seedsL1TriggerObjectMaps returning " << seedsResult << endl << endl;
BXVector< EGamma > EGammaBxCollection
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
edm::Ref< TauBxCollection > TauRef
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
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
bool algoGtlResult() const
BXVector< Tau > TauBxCollection
std::vector< GlobalLogicParser::OperandToken > expressionSeedsOperandList()
const std::vector< ObjectTypeInCond > & objectTypeVector() const
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
volatile std::atomic< bool > shutdown_flag false
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
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
edm::EDGetTokenT< l1t::MuonBxCollection > m_l1MuonToken
tuple size
Write out results.
std::vector< EtSum >::const_iterator const_iterator
edm::EDGetTokenT< l1t::TauBxCollection > m_l1TauToken
edm::EDGetTokenT< GlobalObjectMapRecord > m_l1GtObjectMapToken