40 double dphi = fabs(phi1 - phi2);
41 if(dphi>acos(-1)) dphi = 2*acos(-1)-dphi;
42 double dr =
sqrt(dphi*dphi +
pow(eta1-eta2,2));
52 for (
int i=1;
i<21;
i++)
54 if (fabs(eta)<(
i*0.087)&&fabs(eta)>(
i-1)*0.087) ieta=int(fabs(eta)/eta)*
i;
56 if (fabs(eta)>1.740&&fabs(eta)<=1.830) ieta=int(fabs(eta)/eta)*21;
57 if (fabs(eta)>1.830&&fabs(eta)<=1.930) ieta=int(fabs(eta)/eta)*22;
58 if (fabs(eta)>1.930&&fabs(eta)<=2.043) ieta=int(fabs(eta)/eta)*23;
59 if (fabs(eta)>2.043&&fabs(eta)<=2.172) ieta=int(fabs(eta)/eta)*24;
62 double delta=phi+0.174532925;
63 if (delta<0) delta=delta+2*acos(-1);
66 for (
int i=0;
i<72;
i++)
68 if (delta<(
i+1)*0.087266462&&delta>
i*0.087266462) iphi=
i;
73 for (
int i=0;
i<36;
i++)
75 if (delta<2*(
i+1)*0.087266462&&delta>2*
i*0.087266462) iphi=2*
i;
79 return std::pair<int,int>(ieta,iphi);
97 for (std::vector<edm::ParameterSet>::iterator inTrig = triggers.begin(); inTrig != triggers.end(); inTrig++)
99 trigNames_.push_back(inTrig->getParameter<std::string>(
"triggerName"));
100 l1filterLabels_.push_back(inTrig->getParameter<std::string>(
"hltL1filterLabel"));
101 l2filterLabels_.push_back(inTrig->getParameter<std::string>(
"hltL2filterLabel"));
102 l3filterLabels_.push_back(inTrig->getParameter<std::string>(
"hltL3filterLabel"));
117 if(!triggerObj.
isValid())
return;
119 for (
unsigned int trInd=0; trInd<
triggers.size(); trInd++)
122 std::vector<l1extra::L1JetParticleRef> l1CenJets;
123 std::vector<l1extra::L1JetParticleRef> l1ForJets;
124 std::vector<l1extra::L1JetParticleRef> l1TauJets;
128 if (l1filterIndex<triggerObj->
size())
135 if (l1CenJets.size()>0||l1ForJets.size()>0||l1TauJets.size()>0)
141 if (!l1pass)
continue;
142 std::vector<reco::IsolatedPixelTrackCandidateRef> l2tracks;
147 std::vector<reco::IsolatedPixelTrackCandidateRef> l3tracks;
155 if (l2tracks.size()>0)
163 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator l3it=l3col->begin(); l3it!=l3col->end(); ++l3it)
167 for (
unsigned int il2=0; il2<l2tracks.size(); il2++)
169 double drl2l3=
reco::deltaR(l3it->eta(),l3it->phi(),l2tracks[il2]->eta(),l2tracks[il2]->phi());
176 if (selL2tr!=-1&&drmin<0.03&&l2tracks[selL2tr]->
p()!=0)
hL3candL2rat[trInd]->
Fill(l3it->p()/l2tracks[selL2tr]->p(),1);
182 if (l3tracks.size()>0)
hL2L3acc[trInd]->
Fill(3+0.0001,1);
187 for (
unsigned int i=0;
i<l1CenJets.size();
i++)
189 if (l1CenJets[
i]->pt()>l1maxPt)
191 l1maxPt=l1CenJets[
i]->pt();
192 maxPtJet=l1CenJets[
i];
195 for (
unsigned int i=0;
i<l1ForJets.size();
i++)
197 if (l1ForJets[
i]->pt()>l1maxPt)
199 l1maxPt=l1ForJets[
i]->pt();
200 maxPtJet=l1ForJets[
i];
203 for (
unsigned int i=0;
i<l1TauJets.size();
i++)
205 if (l1TauJets[
i]->pt()>l1maxPt)
207 l1maxPt=l1TauJets[
i]->pt();
208 maxPtJet=l1TauJets[
i];
221 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator l2it=l2col->begin(); l2it!=l2col->end(); l2it++)
227 for (
unsigned int i=0;
i<l2tracks.size();
i++)
232 for (
unsigned int i=0;
i<l3tracks.size();
i++)
249 std::sprintf(tmp1,
"hL2L3acc_%s",
trigNames_[
i].c_str());
250 std::sprintf(tmp2,
"number of L1, L2 and L3 accepts; [%s]",
trigNames_[
i].c_str());
254 hL2L3acc[
i]->setAxisTitle(
"trigger level",1);
256 std::sprintf(tmp1,
"hL2L3trackMatch_%s",
trigNames_[
i].c_str());
257 std::sprintf(tmp2,
"R from L3 object to L2 object; [%s]",
trigNames_[
i].c_str());
262 std::sprintf(tmp1,
"hL2L3rat_%s",
trigNames_[
i].c_str());
263 std::sprintf(tmp2,
"ratio of L3 to L2 momentum measurement; [%s]",
trigNames_[
i].c_str());
268 std::sprintf(tmp1,
"hL1eta_%s",
trigNames_[
i].c_str());
269 std::sprintf(tmp2,
"eta distribution of L1 triggers; [%s]",
trigNames_[
i].c_str());
271 hL1eta.push_back(hL1etaBuf);
272 hL1eta[
i]->setAxisTitle(
"eta",1);
274 std::sprintf(tmp1,
"hL1phi_%s",
trigNames_[
i].c_str());
275 std::sprintf(tmp2,
"phi distribution of L1 triggers; [%s]",
trigNames_[
i].c_str());
277 hL1phi.push_back(hL1phiBuf);
278 hL1phi[
i]->setAxisTitle(
"phi",1);
280 std::sprintf(tmp1,
"hL2isolation_%s",
trigNames_[
i].c_str());
281 std::sprintf(tmp2,
"isolation momentum at L2; [%s]",
trigNames_[
i].c_str());
286 std::sprintf(tmp1,
"hL2occupancy_%s",
trigNames_[
i].c_str());
287 std::sprintf(tmp2,
"tower occupancy at L2; [%s]",
trigNames_[
i].c_str());
296 std::sprintf(tmp1,
"hL3occupancy_%s",
trigNames_[
i].c_str());
297 std::sprintf(tmp2,
"tower occupancy at L3; [%s]",
trigNames_[
i].c_str());
HLTMonHcalIsoTrack(const edm::ParameterSet &)
T getParameter(std::string const &) const
std::vector< MonitorElement * > hL2L3acc
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
std::string hltRAWEventTag_
std::string outRootFileName_
std::vector< std::string > l2collectionLabels_
#define DEFINE_FWK_MODULE(type)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
virtual void analyze(const edm::Event &, const edm::EventSetup &)
double getDist(double, double, double, double)
std::vector< MonitorElement * > hL2isolationP
double deltaR(double eta1, double phi1, double eta2, double phi2)
std::vector< MonitorElement * > hL2TowerOccupancy
bool isNonnull() const
Checks for non-null.
std::vector< std::string > l3collectionLabels_
std::vector< MonitorElement * > hL3L2trackMatch
std::pair< int, int > towerIndex(double, double)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::vector< MonitorElement * > hL1eta
std::vector< std::string > l2filterLabels_
std::vector< std::string > l3filterLabels_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
std::vector< edm::ParameterSet > triggers
std::vector< std::string > l1filterLabels_
std::vector< MonitorElement * > hL3TowerOccupancy
std::vector< MonitorElement * > hL3candL2rat
std::vector< MonitorElement * > hL1phi
bool useProducerCollections_
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
tuple size
Write out results.
Power< A, B >::type pow(const A &a, const B &b)
void setCurrentFolder(const std::string &fullpath)
std::string hltAODEventTag_
std::vector< std::string > trigNames_