39 double dphi = fabs(phi1 - phi2);
40 if(dphi>acos(-1)) dphi = 2*acos(-1)-dphi;
41 double dr =
sqrt(dphi*dphi +
pow(eta1-eta2,2));
51 for (
int i=1;
i<21;
i++)
53 if (fabs(eta)<(
i*0.087)&&fabs(eta)>(
i-1)*0.087) ieta=int(fabs(eta)/eta)*
i;
55 if (fabs(eta)>1.740&&fabs(eta)<=1.830) ieta=int(fabs(eta)/eta)*21;
56 if (fabs(eta)>1.830&&fabs(eta)<=1.930) ieta=int(fabs(eta)/eta)*22;
57 if (fabs(eta)>1.930&&fabs(eta)<=2.043) ieta=int(fabs(eta)/eta)*23;
58 if (fabs(eta)>2.043&&fabs(eta)<=2.172) ieta=int(fabs(eta)/eta)*24;
61 double delta=phi+0.174532925;
62 if (delta<0) delta=delta+2*acos(-1);
65 for (
int i=0;
i<72;
i++)
67 if (delta<(
i+1)*0.087266462&&delta>
i*0.087266462) iphi=
i;
72 for (
int i=0;
i<36;
i++)
74 if (delta<2*(
i+1)*0.087266462&&delta>2*
i*0.087266462) iphi=2*
i;
78 return std::pair<int,int>(ieta,iphi);
96 for (std::vector<edm::ParameterSet>::iterator inTrig = triggers.begin(); inTrig != triggers.end(); inTrig++)
121 if(!triggerObj.
isValid())
return;
123 for (
unsigned int trInd=0; trInd<
triggers.size(); trInd++)
126 std::vector<l1extra::L1JetParticleRef> l1CenJets;
127 std::vector<l1extra::L1JetParticleRef> l1ForJets;
128 std::vector<l1extra::L1JetParticleRef> l1TauJets;
132 if (l1filterIndex<triggerObj->
size())
139 if (l1CenJets.size()>0||l1ForJets.size()>0||l1TauJets.size()>0)
145 if (!l1pass)
continue;
146 std::vector<reco::IsolatedPixelTrackCandidateRef> l2tracks;
151 std::vector<reco::IsolatedPixelTrackCandidateRef> l3tracks;
159 if (l2tracks.size()>0)
167 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator l3it=l3col->begin(); l3it!=l3col->end(); ++l3it)
171 for (
unsigned int il2=0; il2<l2tracks.size(); il2++)
173 double drl2l3=
reco::deltaR(l3it->eta(),l3it->phi(),l2tracks[il2]->eta(),l2tracks[il2]->phi());
180 if (selL2tr!=-1&&drmin<0.03&&l2tracks[selL2tr]->
p()!=0)
hL3candL2rat[trInd]->
Fill(l3it->p()/l2tracks[selL2tr]->p(),1);
186 if (l3tracks.size()>0)
hL2L3acc[trInd]->
Fill(3+0.0001,1);
191 for (
unsigned int i=0;
i<l1CenJets.size();
i++)
193 if (l1CenJets[
i]->
pt()>l1maxPt)
195 l1maxPt=l1CenJets[
i]->pt();
196 maxPtJet=l1CenJets[
i];
199 for (
unsigned int i=0;
i<l1ForJets.size();
i++)
201 if (l1ForJets[
i]->
pt()>l1maxPt)
203 l1maxPt=l1ForJets[
i]->pt();
204 maxPtJet=l1ForJets[
i];
207 for (
unsigned int i=0;
i<l1TauJets.size();
i++)
209 if (l1TauJets[
i]->
pt()>l1maxPt)
211 l1maxPt=l1TauJets[
i]->pt();
212 maxPtJet=l1TauJets[
i];
225 for (reco::IsolatedPixelTrackCandidateCollection::const_iterator l2it=l2col->begin(); l2it!=l2col->end(); l2it++)
231 for (
unsigned int i=0;
i<l2tracks.size();
i++)
236 for (
unsigned int i=0;
i<l3tracks.size();
i++)
253 std::sprintf(tmp1,
"hL2L3acc_%s",
trigNames_[
i].c_str());
254 std::sprintf(tmp2,
"number of L1, L2 and L3 accepts; [%s]",
trigNames_[
i].c_str());
258 hL2L3acc[
i]->setAxisTitle(
"trigger level",1);
260 std::sprintf(tmp1,
"hL2L3trackMatch_%s",
trigNames_[
i].c_str());
261 std::sprintf(tmp2,
"R from L3 object to L2 object; [%s]",
trigNames_[
i].c_str());
266 std::sprintf(tmp1,
"hL2L3rat_%s",
trigNames_[
i].c_str());
267 std::sprintf(tmp2,
"ratio of L3 to L2 momentum measurement; [%s]",
trigNames_[
i].c_str());
272 std::sprintf(tmp1,
"hL1eta_%s",
trigNames_[
i].c_str());
273 std::sprintf(tmp2,
"eta distribution of L1 triggers; [%s]",
trigNames_[
i].c_str());
275 hL1eta.push_back(hL1etaBuf);
276 hL1eta[
i]->setAxisTitle(
"eta",1);
278 std::sprintf(tmp1,
"hL1phi_%s",
trigNames_[
i].c_str());
279 std::sprintf(tmp2,
"phi distribution of L1 triggers; [%s]",
trigNames_[
i].c_str());
281 hL1phi.push_back(hL1phiBuf);
282 hL1phi[
i]->setAxisTitle(
"phi",1);
284 std::sprintf(tmp1,
"hL2isolation_%s",
trigNames_[
i].c_str());
285 std::sprintf(tmp2,
"isolation momentum at L2; [%s]",
trigNames_[
i].c_str());
290 std::sprintf(tmp1,
"hL2occupancy_%s",
trigNames_[
i].c_str());
291 std::sprintf(tmp2,
"tower occupancy at L2; [%s]",
trigNames_[
i].c_str());
300 std::sprintf(tmp1,
"hL3occupancy_%s",
trigNames_[
i].c_str());
301 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_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::string outRootFileName_
std::vector< std::string > l2collectionLabels_
#define DEFINE_FWK_MODULE(type)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
double deltaR(const T1 &t1, const T2 &t2)
double getDist(double, double, double, double)
std::vector< MonitorElement * > hL2isolationP
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< edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > > l2collectionToken_
std::vector< std::string > l3filterLabels_
std::vector< edm::ParameterSet > triggers
std::vector< std::string > l1filterLabels_
edm::EDGetTokenT< trigger::TriggerEventWithRefs > toLabToken_
std::vector< MonitorElement * > hL3TowerOccupancy
std::vector< edm::EDGetTokenT< reco::IsolatedPixelTrackCandidateCollection > > l3collectionToken_
std::vector< MonitorElement * > hL3candL2rat
std::vector< MonitorElement * > hL1phi
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", const uint32_t run=0, const uint32_t lumi=0, SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE", const bool resetMEsAfterWriting=false)
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_