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(
const auto &
filter : filters){
60 if(filterNrInEvt<trigEvt->sizeFilters()){
63 for(
size_t partNr=0;partNr<particles.size();partNr++){
64 for(
unsigned short trigKey : trigKeys){
65 float trigObjEta = trigObjColl[trigKey].eta();
66 float trigObjPhi = trigObjColl[trigKey].phi();
67 if (
reco::deltaR(particles[partNr].
eta(),particles[partNr].phi(),trigObjEta,trigObjPhi) < maxDeltaR){
68 partTrigBits[partNr] |= filterCode;
76 for(
const auto & l1PreAndSeedFilter : l1PreAndSeedFilters){
78 if((filterCode&evtTrigBits)==filterCode){
82 if(filterNrInEvt<trigEvt->sizeFilters()){
85 for(
size_t partNr=0;partNr<particles.size();partNr++){
86 for(
unsigned short trigKey : trigKeys){
87 float trigObjEta = trigObjColl[trigKey].eta();
88 float trigObjPhi = trigObjColl[trigKey].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(
const auto &
filter : filters){
115 if(filterNrInEvt<trigEvt->sizeFilters()){
118 for(
unsigned short trigKey : trigKeys){
119 float trigObjEta = trigObjColl[trigKey].eta();
120 float trigObjPhi = trigObjColl[trigKey].phi();
121 float trigObjE = trigObjColl[trigKey].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
const TriggerObjectCollection & getObjects() const
constexpr 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