35 m_l1SeedsLogicalExpression(parSet.getParameter<
string>(
"L1SeedsLogicalExpression")),
36 m_l1GtObjectMapTag(parSet.getParameter<edm::
InputTag> (
"L1ObjectMapInputTag")),
38 m_l1GlobalTag(parSet.getParameter<edm::
InputTag> (
"L1GlobalInputTag")),
40 m_l1MuonCollectionsTag(parSet.getParameter<edm::
InputTag>(
"L1MuonInputTag")),
41 m_l1MuonTag(m_l1MuonCollectionsTag),
43 m_l1EGammaCollectionsTag(parSet.getParameter<edm::
InputTag>(
"L1EGammaInputTag")),
44 m_l1EGammaTag(m_l1EGammaCollectionsTag),
46 m_l1JetCollectionsTag(parSet.getParameter<edm::
InputTag>(
"L1JetInputTag")),
47 m_l1JetTag(m_l1JetCollectionsTag),
49 m_l1TauCollectionsTag(parSet.getParameter<edm::
InputTag>(
"L1TauInputTag")),
50 m_l1TauTag(m_l1TauCollectionsTag),
52 m_l1EtSumCollectionsTag(parSet.getParameter<edm::
InputTag>(
"L1EtSumInputTag")),
53 m_l1EtSumTag(m_l1EtSumCollectionsTag),
99 desc.
add<
string>(
"L1SeedsLogicalExpression",
"");
100 desc.
add<
bool>(
"SaveTags",
true);
108 descriptions.
add(
"hltL1TSeed", desc);
156 bool objectsInFilter =
false;
164 <<
"\nWarning: L1MuonBxCollection with input tag "
166 <<
"\nrequested in configuration, but not found in the event."
167 <<
"\nNo muons added to filterproduct."
172 for (iter = muons->begin(0); iter != muons->end(0); ++iter){
187 <<
"\nWarning: L1EGammaBxCollection with input tag "
189 <<
"\nrequested in configuration, but not found in the event."
190 <<
"\nNo egammas added to filterproduct."
195 for (iter = egammas->begin(0); iter != egammas->end(0); ++iter){
210 <<
"\nWarning: L1JetBxCollection with input tag "
212 <<
"\nrequested in configuration, but not found in the event."
213 <<
"\nNo jets added to filterproduct."
218 for (iter = jets->begin(0); iter != jets->end(0); ++iter){
233 <<
"\nWarning: L1TauBxCollection with input tag "
235 <<
"\nrequested in configuration, but not found in the event."
236 <<
"\nNo taus added to filterproduct."
241 for (iter = taus->begin(0); iter != taus->end(0); ++iter){
256 <<
"\nWarning: L1EtSumBxCollection with input tag "
258 <<
"\nrequested in configuration, but not found in the event."
259 <<
"\nNo etsums added to filterproduct."
263 LogTrace(
"HLTL1TSeed") <<
"\nHLT1TSeed::seedsAll: L1EtSum objects found in the EtSumBxCollection " << endl;
265 for (iter = etsums->begin(0); iter != etsums->end(0); ++iter){
270 LogTrace(
"HLTL1TSeed") <<
"pt="<<myref->pt() <<
"\ttype = " << iter->getType() << endl;
272 switch(iter->getType()) {
286 LogTrace(
"HLTL1TSeed") <<
" L1EtSum seed of currently unsuported HLT TriggerType. l1t::EtSum type: " << iter->getType() <<
"\n";
306 return objectsInFilter;
314 <<
"\nHLTL1TSeed::hltFilter "
315 <<
"\n Dump TriggerFilterObjectWithRefs\n" << endl;
317 vector<l1t::MuonRef> seedsL1Mu;
319 const size_t sizeSeedsL1Mu = seedsL1Mu.size();
325 <<
"\n L1Mu seeds: " << sizeSeedsL1Mu << endl << endl;
327 for (
size_t i = 0;
i != sizeSeedsL1Mu;
i++) {
333 <<
"\tL1Mu " <<
"\t" <<
"q = " << obj->hwCharge()
334 <<
"\t" <<
"pt = " << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
335 <<
"\t" <<
"phi = " << obj->phi();
338 vector<l1t::EGammaRef> seedsL1EG;
340 const size_t sizeSeedsL1EG = seedsL1EG.size();
343 <<
"\n L1EG seeds: " << sizeSeedsL1EG << endl << endl;
345 for (
size_t i = 0;
i != sizeSeedsL1EG;
i++) {
351 <<
"\tL1EG " <<
"\t" <<
"pt = "
352 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
353 <<
"\t" <<
"phi = " << obj->phi();
356 vector<l1t::JetRef> seedsL1Jet;
358 const size_t sizeSeedsL1Jet = seedsL1Jet.size();
361 <<
"\n L1Jet seeds: " << sizeSeedsL1Jet << endl << endl;
363 for (
size_t i = 0;
i != sizeSeedsL1Jet;
i++) {
368 LogTrace(
"HLTL1TSeed") <<
"\tL1Jet " <<
"\t" <<
"pt = "
369 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
370 <<
"\t" <<
"phi = " << obj->phi();
373 vector<l1t::TauRef> seedsL1Tau;
375 const size_t sizeSeedsL1Tau = seedsL1Tau.size();
378 <<
"\n L1Tau seeds: " << sizeSeedsL1Tau << endl << endl;
380 for (
size_t i = 0;
i != sizeSeedsL1Tau;
i++) {
386 <<
"\tL1Tau " <<
"\t" <<
"pt = "
387 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
388 <<
"\t" <<
"phi = " << obj->phi();
391 vector<l1t::EtSumRef> seedsL1EtSumETT;
393 const size_t sizeSeedsL1EtSumETT = seedsL1EtSumETT.size();
395 <<
"\n L1EtSum ETT seeds: " << sizeSeedsL1EtSumETT << endl << endl;
397 for (
size_t i = 0;
i != sizeSeedsL1EtSumETT;
i++) {
401 <<
"\tL1EtSum ETT" <<
"\t" <<
"pt = "
402 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
403 <<
"\t" <<
"phi = " << obj->phi();
406 vector<l1t::EtSumRef> seedsL1EtSumHTT;
408 const size_t sizeSeedsL1EtSumHTT = seedsL1EtSumHTT.size();
410 <<
"\n L1EtSum HTT seeds: " << sizeSeedsL1EtSumHTT << endl << endl;
412 for (
size_t i = 0;
i != sizeSeedsL1EtSumHTT;
i++) {
416 <<
"\tL1EtSum HTT" <<
"\t" <<
"pt = "
417 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
418 <<
"\t" <<
"phi = " << obj->phi();
421 vector<l1t::EtSumRef> seedsL1EtSumETM;
423 const size_t sizeSeedsL1EtSumETM = seedsL1EtSumETM.size();
425 <<
"\n L1EtSum ETM seeds: " << sizeSeedsL1EtSumETM << endl << endl;
427 for (
size_t i = 0;
i != sizeSeedsL1EtSumETM;
i++) {
431 <<
"\tL1EtSum ETM" <<
"\t" <<
"pt = "
432 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
433 <<
"\t" <<
"phi = " << obj->phi();
436 vector<l1t::EtSumRef> seedsL1EtSumHTM;
438 const size_t sizeSeedsL1EtSumHTM = seedsL1EtSumHTM.size();
440 <<
"\n L1EtSum HTM seeds: " << sizeSeedsL1EtSumHTM << endl << endl;
442 for (
size_t i = 0;
i != sizeSeedsL1EtSumHTM;
i++) {
446 <<
"\tL1EtSum HTM" <<
"\t" <<
"pt = "
447 << obj->pt() <<
"\t" <<
"eta = " << obj->eta()
448 <<
"\t" <<
"phi = " << obj->phi();
451 LogTrace(
"HLTL1TSeed") <<
" \n\n" << endl;
463 std::list<int> listMuon;
465 std::list<int> listEG;
467 std::list<int> listJet;
468 std::list<int> listTau;
470 std::list<int> listETM;
471 std::list<int> listETT;
472 std::list<int> listHTT;
473 std::list<int> listHTM;
475 std::list<int> listJetCounts;
481 if (!uGtAlgoBlocks.
isValid()) {
484 <<
"\nWarning: GlobalAlgBlkBxCollection with input tag "
486 <<
"\nrequested in configuration, but not found in the event." << std::endl;
495 if (!gtObjectMapRecord.
isValid()) {
498 <<
"\nWarning: L1GlobalTriggerObjectMapRecord with input tag "
500 <<
"\nrequested in configuration, but not found in the event." << std::endl;
507 const std::vector<L1GlobalTriggerObjectMap>& objMaps = gtObjectMapRecord->gtObjectMap();
511 <<
"\n---------------------------------------------------------------------------------------------------------------------";
514 <<
"\n\tAlgorithms in L1TriggerObjectMapRecord and GT results ( emulated | initial | prescaled | final ) " << endl;
517 <<
"\n\tmap" <<
"\tAlgoBit" << std::setw(40) <<
"algoName" <<
"\t (emul|ini|pre|fin)" << endl;
520 <<
"---------------------------------------------------------------------------------------------------------------------";
522 for (
size_t imap =0; imap < objMaps.size(); imap++) {
524 int bit = objMaps[imap].algoBitNumber();
526 int emulDecision = objMaps[imap].algoGtlResult();
529 int initDecision = (uGtAlgoBlocks->at(0,0)).getAlgoDecisionInitial(bit);
530 int presDecision = (uGtAlgoBlocks->at(0,0)).getAlgoDecisionPreScaled(bit);
531 int finlDecision = (uGtAlgoBlocks->at(0,0)).getAlgoDecisionFinal(bit);
534 <<
"\t" << std::setw(3) << imap
535 <<
"\tbit = " << std::setw(3) << bit
536 << std::setw(40) << objMaps[imap].algoName()
537 <<
"\t ( " << emulDecision <<
" | " << initDecision <<
" | " << presDecision <<
" | " << finlDecision <<
" ) ";
547 std::vector<L1GtLogicParser::OperandToken>& algOpTokenVector =
550 for (
size_t i = 0;
i < algOpTokenVector.size(); ++
i) {
554 (algOpTokenVector[
i]).tokenResult =
false;
560 for (
size_t i = 0;
i < algOpTokenVector.size(); ++
i) {
569 <<
"\nWarning: seed with name " << algoName <<
" cannot be matched to a L1 algo name in any L1GlobalTriggerObjectMap" << std::endl;
587 <<
"\n Result for logical expression after update of algOpTokens: " << seedsResult <<
"\n"
600 for (std::vector<L1GtLogicParser::OperandToken>::const_iterator
606 <<
"\n ---------------- algo seed name = " << algoSeedName << endl;
615 <<
"\nWarning: seed with name " << algoSeedName <<
" cannot be matched to a L1 algo name in any L1GlobalTriggerObjectMap" << std::endl;
624 bool algoSeedRsultMaskAndPresc = uGtAlgoBlocks->at(0,0).getAlgoDecisionFinal(algoSeedBitNumber);
627 <<
"\n\tAlgo seed " << algoSeedName <<
" result emulated (initial) | final = " << algoSeedResult <<
" | " << algoSeedRsultMaskAndPresc << endl;
632 if ( !algoSeedResult)
continue;
636 if(!algoSeedRsultMaskAndPresc)
continue;
638 const std::vector<L1GtLogicParser::OperandToken>& opTokenVecObjMap = objMap->
operandTokenVector();
639 const std::vector<ObjectTypeInCond>& condObjTypeVec = objMap->
objectTypeVector();
640 const std::vector<CombinationsInCond>& condCombinations = objMap->
combinationVector();
643 <<
"\n\talgoName =" << objMap->
algoName()
644 <<
"\talgoBitNumber = " << algoSeedBitNumber
645 <<
"\talgoGtlResult = " << algoSeedResult << endl << endl;
648 if (opTokenVecObjMap.size() != condObjTypeVec.size() ) {
650 <<
"\nWarning: L1GlobalTriggerObjectMapRecord with input tag "
652 <<
"\nhas object map for bit number " << algoSeedBitNumber <<
" which contains different size vectors of operand tokens and of condition object types!" << std::endl;
654 assert(opTokenVecObjMap.size() == condObjTypeVec.size());
657 if (opTokenVecObjMap.size() != condCombinations.size()) {
659 <<
"\nWarning: L1GlobalTriggerObjectMapRecord with input tag "
661 <<
"\nhas object map for bit number " << algoSeedBitNumber <<
" which contains different size vectors of operand tokens and of condition object combinations!" << std::endl;
663 assert(opTokenVecObjMap.size() == condCombinations.size());
668 for (
size_t condNumber = 0; condNumber < opTokenVecObjMap.size(); condNumber++) {
670 std::vector<L1GtObject> condObjType = condObjTypeVec[condNumber];
672 for (
size_t jOb =0; jOb < condObjType.size(); jOb++) {
675 << setw(15) <<
"\tcondObjType = " << condObjType[jOb] << endl;
679 const std::string condName = opTokenVecObjMap[condNumber].tokenName;
680 bool condResult = opTokenVecObjMap[condNumber].tokenResult;
693 << setw(15) <<
"\tcondCombinations = " << condComb->size() << endl;
695 for (std::vector<SingleCombInCond>::const_iterator itComb = (*condComb).begin(); itComb != (*condComb).end(); itComb++) {
699 for (SingleCombInCond::const_iterator itObject = (*itComb).begin(); itObject != (*itComb).end(); itObject++) {
703 for (
size_t iType =0; iType < condObjType.size(); iType++) {
707 const L1GtObject objTypeVal = condObjType.at(iType);
710 <<
"\tAdd object of type " << objTypeVal <<
" and index " << (*itObject) <<
" to the seed list."
713 switch (objTypeVal) {
715 listMuon.push_back(*itObject);
720 listEG.push_back(*itObject);
725 listEG.push_back(*itObject);
730 listJet.push_back(*itObject);
735 listJet.push_back(*itObject);
740 listTau.push_back(*itObject);
749 int hfInd = (*itObject);
750 if(condName.find(
"Ind0")!=std::string::npos)
752 else if(condName.find(
"Ind1")!=std::string::npos)
754 else if(condName.find(
"Ind2")!=std::string::npos)
756 else if(condName.find(
"Ind3")!=std::string::npos)
758 listTau.push_back(hfInd);
763 listETM.push_back(*itObject);
769 listETT.push_back(*itObject);
775 listHTT.push_back(*itObject);
781 listHTM.push_back(*itObject);
787 listJetCounts.push_back(*itObject);
795 <<
"\n HLTL1TSeed::hltFilter "
796 <<
"\n Unknown object of type " << objTypeVal
797 <<
" and index " << (*itObject) <<
" in the seed list."
841 listJetCounts.sort();
842 listJetCounts.unique();
849 if (!listMuon.empty()) {
856 <<
"\nWarning: L1MuonBxCollection with input tag "
858 <<
"\nrequested in configuration, but not found in the event."
859 <<
"\nNo muons added to filterproduct."
864 for (std::list<int>::const_iterator itObj = listMuon.begin(); itObj != listMuon.end(); ++itObj) {
876 if (!listEG.empty()) {
882 <<
"\nWarning: L1EGammaBxCollection with input tag " <<
m_l1EGammaTag
883 <<
"\nrequested in configuration, but not found in the event."
884 <<
"\nNo egammas added to filterproduct."
889 for (std::list<int>::const_iterator itObj = listEG.begin(); itObj != listEG.end(); ++itObj) {
901 if (!listJet.empty()) {
908 <<
"\nWarning: L1JetBxCollection with input tag " <<
m_l1JetTag
909 <<
"\nrequested in configuration, but not found in the event."
910 <<
"\nNo jets added to filterproduct."
915 for (std::list<int>::const_iterator itObj = listJet.begin(); itObj != listJet.end(); ++itObj) {
925 if (!listTau.empty()) {
932 <<
"\nWarning: L1TauBxCollection with input tag " <<
m_l1TauTag
933 <<
"\nrequested in configuration, but not found in the event."
934 <<
"\nNo taus added to filterproduct."
939 for (std::list<int>::const_iterator itObj = listTau.begin(); itObj != listTau.end(); ++itObj) {
953 <<
"\nWarning: L1EtSumBxCollection with input tag "
955 <<
"\nrequested in configuration, but not found in the event."
956 <<
"\nNo etsums added to filterproduct."
962 for (iter = etsums->begin(0); iter != etsums->end(0); ++iter){
966 switch(iter->getType()) {
985 LogTrace(
"HLTL1TSeed") <<
" L1EtSum seed of currently unsuported HLT TriggerType. l1t::EtSum type: " << iter->getType() <<
"\n";
1013 <<
"\nHLTL1Seed:seedsL1TriggerObjectMaps returning " << seedsResult << endl << endl;
BXVector< EGamma > EGammaBxCollection
std::vector< L1GtLogicParser::OperandToken > expressionSeedsOperandList()
std::string m_l1SeedsLogicalExpression
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > m_l1GtObjectMapToken
const std::vector< CombinationsInCond > & combinationVector() const
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
edm::EDGetTokenT< l1t::EtSumBxCollection > m_l1EtSumToken
edm::Ref< TauBxCollection > TauRef
std::vector< const std::vector< L1GtLogicParser::TokenRPN > * > m_l1AlgoSeedsRpn
vector of Rpn vectors for 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)
const std::vector< L1GtLogicParser::OperandToken > & operandTokenVector() const
virtual ~HLTL1TSeed()
destructor
const std::vector< ObjectTypeInCond > & objectTypeVector() const
BXVector< Tau > TauBxCollection
bool algoGtlResult() const
bool seedsAll(edm::Event &, trigger::TriggerFilterObjectWithRefs &) 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
const std::string & algoName() const
get / set name for algorithm in the object map
std::vector< std::vector< const std::vector< L1GtObject > * > > m_l1AlgoSeedsObjType
vector of object-type vectors for each condition in the required algorithms for seeding ...
edm::InputTag m_l1GtObjectMapTag
InputTag for L1 Global Trigger object maps. This is done per menu. Should be part of Run...
std::vector< OperandToken > & operandTokenVector()
return the vector of operand tokens
const CombinationsInCond * getCombinationsInCond(const std::string &condNameVal) const
return all the combinations passing the requirements imposed in condition condNameVal ...
edm::EDGetTokenT< l1t::JetBxCollection > m_l1JetToken
edm::EDGetTokenT< l1t::EGammaBxCollection > m_l1EGammaToken
edm::InputTag m_l1EtSumTag
std::vector< L1GtLogicParser::OperandToken > m_l1AlgoSeeds
list of required algorithms for seeding
L1GtLogicParser m_l1AlgoLogicParser
logic parser for m_l1SeedsLogicalExpression
ParameterDescriptionBase * add(U const &iLabel, T const &value)
BXVector< Muon > MuonBxCollection
bool m_isDebugEnabled
cache edm::isDebugEnabled()
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
void dumpTriggerFilterObjectWithRefs(trigger::TriggerFilterObjectWithRefs &) const
detailed print of filter content
int algoBitNumber() const
get / set bit number for algorithm in the object map
virtual bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) override
filter the event
bool m_l1GlobalDecision
replace string "L1GlobalDecision" with bool to speed up the "if"
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< Muon >::const_iterator const_iterator
edm::EDGetTokenT< l1t::TauBxCollection > m_l1TauToken
virtual const bool expressionResult() const