1 #ifndef DQMOFFLINE_TRIGGER_EGHLTTRIGTOOLS 2 #define DQMOFFLINE_TRIGGER_EGHLTTRIGTOOLS 23 void getActiveFilters(
const HLTConfigProvider& hltConfig,std::vector<std::string>& activeFilters,std::vector<std::string>& activeEleFilters,std::vector<std::string>& activeEle2LegFilters,std::vector<std::string>& activePhoFilters,std::vector<std::string>& activePho2LegFilters);
28 void filterInactiveTriggers(std::vector<std::string>& namesToFilter,std::vector<std::string>& activeFilters);
49 const std::vector<std::pair<std::string,std::string> >& l1PreAndSeedFilters,
54 std::vector<TrigCodes::TrigBitSet> partTrigBits(particles.size());
56 for(
size_t filterNrInVec=0;filterNrInVec<filters.size();filterNrInVec++){
60 if(filterNrInEvt<trigEvt->sizeFilters()){
63 for(
size_t partNr=0;partNr<particles.size();partNr++){
64 for(trigger::Keys::const_iterator keyIt=trigKeys.begin();keyIt!=trigKeys.end();++keyIt){
65 float trigObjEta = trigObjColl[*keyIt].eta();
66 float trigObjPhi = trigObjColl[*keyIt].phi();
67 if (
reco::deltaR(particles[partNr].
eta(),particles[partNr].phi(),trigObjEta,trigObjPhi) < maxDeltaR){
68 partTrigBits[partNr] |= filterCode;
76 for(
size_t l1FilterNrInVec=0;l1FilterNrInVec<l1PreAndSeedFilters.size();l1FilterNrInVec++){
78 if((filterCode&evtTrigBits)==filterCode){
82 if(filterNrInEvt<trigEvt->sizeFilters()){
85 for(
size_t partNr=0;partNr<particles.size();partNr++){
86 for(trigger::Keys::const_iterator keyIt=trigKeys.begin();keyIt!=trigKeys.end();++keyIt){
87 float trigObjEta = trigObjColl[*keyIt].eta();
88 float trigObjPhi = trigObjColl[*keyIt].phi();
89 if (
reco::deltaR(particles[partNr].
eta(),particles[partNr].phi(),trigObjEta,trigObjPhi) < maxDeltaR){
90 partTrigBits[partNr] |= filterCode;
98 for(
size_t partNr=0;partNr<particles.size();partNr++) particles[partNr].setTrigBits(partTrigBits[partNr]);
103 template <
class T,
class U>
106 const std::vector<std::string>&
filters,
110 std::vector<TrigCodes::TrigBitSet> partTrigBits(1);
112 for(
size_t filterNrInVec=0;filterNrInVec<filters.size();filterNrInVec++){
115 if(filterNrInEvt<trigEvt->sizeFilters()){
118 for(trigger::Keys::const_iterator keyIt=trigKeys.begin();keyIt!=trigKeys.end();++keyIt){
119 float trigObjEta = trigObjColl[*keyIt].eta();
120 float trigObjPhi = trigObjColl[*keyIt].phi();
121 float trigObjE = trigObjColl[*keyIt].energy();
122 if (
reco::deltaR(particle.superCluster()->eta(),particle.superCluster()->phi(),trigObjEta,trigObjPhi) < maxDeltaR){
123 hltData.HLTeta=trigObjEta;
124 hltData.HLTphi=trigObjPhi;
125 hltData.HLTenergy=trigObjE;
The single EDProduct to be saved for each event (AOD case)
TrigBitSet getCode(const char *descript) const
const Keys & filterKeys(trigger::size_type index) const
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
std::vector< TPRegexp > filters
U second(std::pair< T, U > const &p)
const TriggerObjectCollection & getObjects() const
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
std::vector< size_type > Keys
std::bitset< maxNrBits_ > TrigBitSet