Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rekovic hlt 802 seed unpacked gt (pruning on top of PR 13703) #13707

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 1 addition & 46 deletions HLTrigger/HLTfilters/interface/HLTL1TSeed.h
Expand Up @@ -60,9 +60,6 @@ class HLTL1TSeed : public HLTStreamFilter

private:

/// get the vector of object types for a condition cndName on the GTL chip chipNumber
//const std::vector<L1GtObject>* objectTypeVec(const int chipNumber, const std::string& cndName) const;

/// update the tokenNumber (holding the bit numbers) from m_l1AlgoLogicParser
/// for a new L1 Trigger menu
void inline updateAlgoLogicParser(const L1GtTriggerMenu*, const AlgorithmMap&) { };
Expand All @@ -72,38 +69,15 @@ class HLTL1TSeed : public HLTStreamFilter
void inline updateAlgoLogicParser(const std::vector<bool>& gtWord,
const std::vector<unsigned int>& triggerMask, const int physicsDaqPartition) { };

/// debug print grouped in a single function
/// can be called for a new menu (bool "true") or for a new event
//void debugPrint(bool) const;

/// seeding is done ignoring if a L1 object fired or not
/// if the event is selected at L1, fill all the L1 objects of types corresponding to the
/// L1 conditions from the seeding logical expression for bunch crosses F, 0, 1
/// directly from L1Extra and use them as seeds at HLT
/// method and filter return true if at least an object is filled
bool seedsAll(edm::Event &, trigger::TriggerFilterObjectWithRefs &) const;

/// seeding is done via L1 trigger object maps, considering the objects which fired in L1
bool seedsL1TriggerObjectMaps(
edm::Event &,
trigger::TriggerFilterObjectWithRefs &
//, const L1GtTriggerMask *,
//const L1GlobalTriggerReadoutRecord *,
//const int physicsDaqPartition
);
bool seedsL1TriggerObjectMaps( edm::Event &, trigger::TriggerFilterObjectWithRefs &);


/// detailed print of filter content
void dumpTriggerFilterObjectWithRefs(trigger::TriggerFilterObjectWithRefs &) const;

private:

// cached stuff

/// trigger menu
const L1GtTriggerMenu * m_utml1GtMenu;
unsigned long long m_l1GtMenuCacheID;

/// logic parser for m_l1SeedsLogicalExpression
L1GtLogicParser m_l1AlgoLogicParser;

Expand All @@ -119,26 +93,10 @@ class HLTL1TSeed : public HLTStreamFilter

private:

/// if true:
/// seeding done via L1 trigger object maps, with objects that fired
/// only objects from the central BxInEvent (L1A) are used
/// if false:
/// seeding is done ignoring if a L1 object fired or not,
/// adding all L1EXtra objects corresponding to the object types
/// used in all conditions from the algorithms in logical expression
/// for a given number of BxInEvent
bool m_l1UseL1TriggerObjectMaps;

/// option used forL1UseL1TriggerObjectMaps = False only
/// number of BxInEvent: 1: L1A=0; 3: -1, L1A=0, 1; 5: -2, -1, L1A=0, 1, 2
int m_l1NrBxInEvent;

/// seeding done via technical trigger bits, if value is "true"
bool m_l1TechTriggerSeeding;

/// seeding uses algorithm aliases instead of algorithm names, if value is "true"
bool m_l1UseAliasesForSeeding;

/// logical expression for the required L1 algorithms
/// the algorithms are specified by name
std::string m_l1SeedsLogicalExpression;
Expand Down Expand Up @@ -177,9 +135,6 @@ class HLTL1TSeed : public HLTStreamFilter
edm::InputTag m_l1EtSumTag;
edm::EDGetTokenT<l1t::EtSumBxCollection> m_l1EtSumToken;

/// replace string "L1GlobalDecision" with bool to speed up the "if"
bool m_l1GlobalDecision;

/// cache edm::isDebugEnabled()
bool m_isDebugEnabled;
};
Expand Down
190 changes: 9 additions & 181 deletions HLTrigger/HLTfilters/src/HLTL1TSeed.cc
Expand Up @@ -55,26 +55,17 @@ HLTL1TSeed::HLTL1TSeed(const edm::ParameterSet& parSet) :
m_isDebugEnabled(edm::isDebugEnabled())
{

if (m_l1SeedsLogicalExpression != "L1GlobalDecision") {
// check also the logical expression - add/remove spaces if needed
m_l1AlgoLogicParser = L1GtLogicParser(m_l1SeedsLogicalExpression);

// check also the logical expression - add/remove spaces if needed
m_l1AlgoLogicParser = L1GtLogicParser(m_l1SeedsLogicalExpression);
// list of required algorithms for seeding
// dummy values for tokenNumber and tokenResult
m_l1AlgoSeeds.reserve((m_l1AlgoLogicParser.operandTokenVector()).size());
m_l1AlgoSeeds = m_l1AlgoLogicParser.expressionSeedsOperandList();
size_t l1AlgoSeedsSize = m_l1AlgoSeeds.size();

// list of required algorithms for seeding
// dummy values for tokenNumber and tokenResult
m_l1AlgoSeeds.reserve((m_l1AlgoLogicParser.operandTokenVector()).size());
m_l1AlgoSeeds = m_l1AlgoLogicParser.expressionSeedsOperandList();
size_t l1AlgoSeedsSize = m_l1AlgoSeeds.size();

m_l1AlgoSeedsRpn.reserve(l1AlgoSeedsSize);
m_l1AlgoSeedsObjType.reserve(l1AlgoSeedsSize);

} else {


m_l1GlobalDecision = true;

}
m_l1AlgoSeedsRpn.reserve(l1AlgoSeedsSize);
m_l1AlgoSeedsObjType.reserve(l1AlgoSeedsSize);

}

Expand Down Expand Up @@ -134,8 +125,6 @@ bool HLTL1TSeed::hltFilter(edm::Event& iEvent, const edm::EventSetup& evSetup, t
//
rc = seedsL1TriggerObjectMaps(iEvent, filterproduct);

//seedsAll(iEvent, filterproduct);

if (m_isDebugEnabled) {
dumpTriggerFilterObjectWithRefs(filterproduct);
}
Expand All @@ -144,167 +133,6 @@ bool HLTL1TSeed::hltFilter(edm::Event& iEvent, const edm::EventSetup& evSetup, t

}

// seeding is done ignoring if a L1 object fired or not
// if the event is selected at L1, fill all the L1 objects of types corresponding to the
// L1 conditions from the seeding logical expression for bunch crosses F, 0, 1
// directly from L1Extra and use them as seeds at HLT
// method and filter return true if at least an object is filled
bool HLTL1TSeed::seedsAll(edm::Event & iEvent, trigger::TriggerFilterObjectWithRefs & filterproduct) const {

//
bool objectsInFilter = false;

// Muon L1T

edm::Handle<l1t::MuonBxCollection> muons;
iEvent.getByToken(m_l1MuonToken, muons);
if (!muons.isValid()){
edm::LogWarning("HLTL1TSeed")
<< " Warning: L1MuonBxCollection with input tag "
<< m_l1MuonTag
<< " requested in configuration, but not found in the event."
<< " No muons added to filterproduct."
<< endl;
} else {

l1t::MuonBxCollection::const_iterator iter;
for (iter = muons->begin(0); iter != muons->end(0); ++iter){
//objectsInFilter = true;
l1t::MuonRef myref(muons, muons->key(iter));
filterproduct.addObject(trigger::TriggerL1Mu, myref);
}
}

//l1t::MuonBxCollection::const_iterator iter;

// EGamma L1T

edm::Handle<l1t::EGammaBxCollection> egammas;
iEvent.getByToken(m_l1EGammaToken, egammas);
if (!egammas.isValid()){
edm::LogWarning("HLTL1TSeed")
<< " Warning: L1EGammaBxCollection with input tag "
<< m_l1EGammaTag
<< " requested in configuration, but not found in the event."
<< " No egammas added to filterproduct."
<< endl;
} else {

l1t::EGammaBxCollection::const_iterator iter;
for (iter = egammas->begin(0); iter != egammas->end(0); ++iter){
//objectsInFilter = true;
l1t::EGammaRef myref(egammas, egammas->key(iter));
filterproduct.addObject(trigger::TriggerL1EG, myref);
}
}

//l1t::EGammaBxCollection::const_iterator iter;

// Jet L1T

edm::Handle<l1t::JetBxCollection> jets;
iEvent.getByToken(m_l1JetToken, jets);
if (!jets.isValid()){
edm::LogWarning("HLTL1TSeed")
<< " Warning: L1JetBxCollection with input tag "
<< m_l1JetTag
<< " requested in configuration, but not found in the event."
<< " No jets added to filterproduct."
<< endl;
} else {

l1t::JetBxCollection::const_iterator iter;
for (iter = jets->begin(0); iter != jets->end(0); ++iter){
//objectsInFilter = true;
l1t::JetRef myref(jets, jets->key(iter));
filterproduct.addObject(trigger::TriggerL1Jet, myref);
}
}

//l1t::JetBxCollection::const_iterator iter;

// Tau L1T

edm::Handle<l1t::TauBxCollection> taus;
iEvent.getByToken(m_l1TauToken, taus);
if (!taus.isValid()){
edm::LogWarning("HLTL1TSeed")
<< " Warning: L1TauBxCollection with input tag "
<< m_l1TauTag
<< " requested in configuration, but not found in the event."
<< " No taus added to filterproduct."
<< endl;
} else {

l1t::TauBxCollection::const_iterator iter;
for (iter = taus->begin(0); iter != taus->end(0); ++iter){
//objectsInFilter = true;
l1t::TauRef myref(taus, taus->key(iter));
filterproduct.addObject(trigger::TriggerL1Tau, myref);
}
}

//l1t::TauBxCollection::const_iterator iter;

// EtSum L1T

edm::Handle<l1t::EtSumBxCollection> etsums;
iEvent.getByToken(m_l1EtSumToken, etsums);
if (!etsums.isValid()){
edm::LogWarning("HLTL1TSeed")
<< " Warning: L1EtSumBxCollection with input tag "
<< m_l1EtSumTag
<< " requested in configuration, but not found in the event."
<< " No etsums added to filterproduct."
<< endl;
} else {

LogTrace("HLTL1TSeed") << "\nHLT1TSeed::seedsAll: L1EtSum objects found in the EtSumBxCollection " << endl;
l1t::EtSumBxCollection::const_iterator iter;
for (iter = etsums->begin(0); iter != etsums->end(0); ++iter){

//objectsInFilter = true;
l1t::EtSumRef myref(etsums, etsums->key(iter));

LogTrace("HLTL1TSeed") << "pt="<<myref->pt() << "\ttype = " << iter->getType() << endl;

switch(iter->getType()) {
case l1t::EtSum::kTotalEt :
filterproduct.addObject(trigger::TriggerL1ETT, myref);
break;
case l1t::EtSum::kTotalHt :
filterproduct.addObject(trigger::TriggerL1HTT, myref);
break;
case l1t::EtSum::kMissingEt:
filterproduct.addObject(trigger::TriggerL1ETM, myref);
break;
case l1t::EtSum::kMissingHt:
filterproduct.addObject(trigger::TriggerL1HTM, myref);
break;
default:
LogTrace("HLTL1TSeed") << " L1EtSum seed of currently unsuported HLT TriggerType. l1t::EtSum type: " << iter->getType() << "\n";
}
}
}

//l1t::EtSumBxCollection::const_iterator iter;

/*
int iObj = -1;

iObj++;
int bxNr = objIter->bx();
if ((bxNr >= minBxInEvent) && (bxNr <= maxBxInEvent))
objectsInFilter = true;
filterproduct.addObject(
trigger::TriggerL1Mu,
l1extra::L1MuonParticleRef(
l1Muon, iObj));
*/

return objectsInFilter;
}

// detailed print of filter content
void HLTL1TSeed::dumpTriggerFilterObjectWithRefs(trigger::TriggerFilterObjectWithRefs & filterproduct) const
{
Expand Down