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,
52 std::vector<TrigCodes::TrigBitSet> partTrigBits(particles.size());
53 const double maxDeltaR=0.1;
54 for(
size_t filterNrInVec=0;filterNrInVec<filters.size();filterNrInVec++){
58 if(filterNrInEvt<trigEvt->sizeFilters()){
61 for(
size_t partNr=0;partNr<particles.size();partNr++){
62 for(trigger::Keys::const_iterator keyIt=trigKeys.begin();keyIt!=trigKeys.end();++keyIt){
63 float trigObjEta = trigObjColl[*keyIt].eta();
64 float trigObjPhi = trigObjColl[*keyIt].phi();
65 if (
reco::deltaR(particles[partNr].
eta(),particles[partNr].
phi(),trigObjEta,trigObjPhi) < maxDeltaR){
66 partTrigBits[partNr] |= filterCode;
74 for(
size_t l1FilterNrInVec=0;l1FilterNrInVec<l1PreAndSeedFilters.size();l1FilterNrInVec++){
76 if((filterCode&evtTrigBits)==filterCode){
80 if(filterNrInEvt<trigEvt->sizeFilters()){
83 for(
size_t partNr=0;partNr<particles.size();partNr++){
84 for(trigger::Keys::const_iterator keyIt=trigKeys.begin();keyIt!=trigKeys.end();++keyIt){
85 float trigObjEta = trigObjColl[*keyIt].eta();
86 float trigObjPhi = trigObjColl[*keyIt].phi();
87 if (
reco::deltaR(particles[partNr].
eta(),particles[partNr].
phi(),trigObjEta,trigObjPhi) < maxDeltaR){
88 partTrigBits[partNr] |= filterCode;
96 for(
size_t partNr=0;partNr<particles.size();partNr++) particles[partNr].setTrigBits(partTrigBits[partNr]);
101 template <
class T,
class U>
104 const std::vector<std::string>&
filters,
108 std::vector<TrigCodes::TrigBitSet> partTrigBits(1);
109 const double maxDeltaR=0.1;
110 for(
size_t filterNrInVec=0;filterNrInVec<filters.size();filterNrInVec++){
113 if(filterNrInEvt<trigEvt->sizeFilters()){
116 for(trigger::Keys::const_iterator keyIt=trigKeys.begin();keyIt!=trigKeys.end();++keyIt){
117 float trigObjEta = trigObjColl[*keyIt].eta();
118 float trigObjPhi = trigObjColl[*keyIt].phi();
119 float trigObjE = trigObjColl[*keyIt].energy();
120 if (
reco::deltaR(particle.superCluster()->eta(),particle.superCluster()->phi(),trigObjEta,trigObjPhi) < maxDeltaR){
121 hltData.HLTeta=trigObjEta;
122 hltData.HLTphi=trigObjPhi;
123 hltData.HLTenergy=trigObjE;
The single EDProduct to be saved for each event (AOD case)
static TrigBitSet getCode(const std::string &descript)
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