1 #ifndef DQMOFFLINE_TRIGGER_EGHLTTRIGTOOLS
2 #define DQMOFFLINE_TRIGGER_EGHLTTRIGTOOLS
22 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);
27 void filterInactiveTriggers(std::vector<std::string>& namesToFilter,std::vector<std::string>& activeFilters);
48 const std::vector<std::pair<std::string,std::string> >& l1PreAndSeedFilters,
53 std::vector<TrigCodes::TrigBitSet> partTrigBits(particles.size());
54 const double maxDeltaR=0.1;
55 for(
size_t filterNrInVec=0;filterNrInVec<filters.size();filterNrInVec++){
59 if(filterNrInEvt<trigEvt->sizeFilters()){
62 for(
size_t partNr=0;partNr<particles.size();partNr++){
63 for(trigger::Keys::const_iterator keyIt=trigKeys.begin();keyIt!=trigKeys.end();++keyIt){
64 float trigObjEta = trigObjColl[*keyIt].eta();
65 float trigObjPhi = trigObjColl[*keyIt].phi();
66 if (
reco::deltaR(particles[partNr].
eta(),particles[partNr].
phi(),trigObjEta,trigObjPhi) < maxDeltaR){
67 partTrigBits[partNr] |= filterCode;
75 for(
size_t l1FilterNrInVec=0;l1FilterNrInVec<l1PreAndSeedFilters.size();l1FilterNrInVec++){
77 if((filterCode&evtTrigBits)==filterCode){
81 if(filterNrInEvt<trigEvt->sizeFilters()){
84 for(
size_t partNr=0;partNr<particles.size();partNr++){
85 for(trigger::Keys::const_iterator keyIt=trigKeys.begin();keyIt!=trigKeys.end();++keyIt){
86 float trigObjEta = trigObjColl[*keyIt].eta();
87 float trigObjPhi = trigObjColl[*keyIt].phi();
88 if (
reco::deltaR(particles[partNr].
eta(),particles[partNr].
phi(),trigObjEta,trigObjPhi) < maxDeltaR){
89 partTrigBits[partNr] |= filterCode;
97 for(
size_t partNr=0;partNr<particles.size();partNr++) particles[partNr].setTrigBits(partTrigBits[partNr]);
102 template <
class T,
class U>
105 const std::vector<std::string>&
filters,
109 std::vector<TrigCodes::TrigBitSet> partTrigBits(1);
110 const double maxDeltaR=0.1;
111 for(
size_t filterNrInVec=0;filterNrInVec<filters.size();filterNrInVec++){
114 if(filterNrInEvt<trigEvt->sizeFilters()){
117 for(trigger::Keys::const_iterator keyIt=trigKeys.begin();keyIt!=trigKeys.end();++keyIt){
118 float trigObjEta = trigObjColl[*keyIt].eta();
119 float trigObjPhi = trigObjColl[*keyIt].phi();
120 float trigObjE = trigObjColl[*keyIt].energy();
121 if (
reco::deltaR(particle.superCluster()->eta(),particle.superCluster()->phi(),trigObjEta,trigObjPhi) < maxDeltaR){
122 hltData.HLTeta=trigObjEta;
123 hltData.HLTphi=trigObjPhi;
124 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
double deltaR(const T1 &t1, const T2 &t2)
std::vector< TPRegexp > filters
U second(std::pair< T, U > const &p)
tuple path
else: Piece not in the list, fine.
const TriggerObjectCollection & getObjects() const
std::vector< TriggerObject > TriggerObjectCollection
collection of trigger physics objects (e.g., all isolated muons)
std::vector< size_type > Keys
std::bitset< maxNrBits_ > TrigBitSet