13 |
|
#include <vector> |
14 |
|
#include <sstream> |
15 |
|
|
16 |
< |
const double AnaEff::ptCuts[ AnaEff::nPtCuts] = { 0., 5., 10., 16., 30., 100.}; |
16 |
> |
const double AnaEff::ptCuts[ AnaEff::nPtCuts] ={0., 0.1, |
17 |
> |
1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 6., 7., 8., |
18 |
> |
10., 12., 14., 16., 18., 20., 25., 30., 35., 40., 45., |
19 |
> |
50., 60., 70., 80., 90., 100.}; |
20 |
> |
|
21 |
> |
|
22 |
|
std::string reg[5]={"_Bar","_Int","_End","_Qeq0","_Qgt0"}; |
23 |
|
|
24 |
|
|
29 |
|
hEfficRpcPtCut_N = new TH1D("hEfficRpcPtCut_N","hEfficRpcPtCut_N", L1PtScale::nPtBins, L1PtScale::ptBins); histos.Add(hEfficRpcPtCut_N); |
30 |
|
|
31 |
|
std::string base("hEff"); |
32 |
< |
std::string opt[2]={"_RpcPtCut","_OthPtCut"}; |
32 |
> |
std::string opt[4]={"_RpcPtCut","_OthPtCut","_GmtPtCut","_OtfPtCut"}; |
33 |
|
for (unsigned int ir=0; ir<5; ++ir) { |
34 |
|
std::string name=base+"_PtDenom"+reg[ir]; |
35 |
|
TH1D *h= new TH1D(name.c_str(),name.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins); |
36 |
|
histos.Add(h); hm[name]=h; |
37 |
< |
for (unsigned int iopt=0; iopt<2; ++iopt) { |
37 |
> |
for (unsigned int iopt=0; iopt<4; ++iopt) { |
38 |
|
if (iopt >0 && ir >2) continue; |
39 |
|
for (unsigned int icut=0; icut<AnaEff::nPtCuts; ++icut) { |
40 |
|
std::stringstream str; |
63 |
|
return result; |
64 |
|
} |
65 |
|
|
66 |
< |
void AnaEff::run( const MuonObj *muon, const L1ObjColl *l1RpcColl, const L1ObjColl *l1OtherColl) |
66 |
> |
void AnaEff::run( const TrackObj *muon, const L1ObjColl *l1Coll) |
67 |
|
{ |
68 |
|
double etaMu = fabs(muon->eta()); |
69 |
|
double ptMu = muon->pt(); |
70 |
< |
if (!muon->isGlobal()) return; |
70 |
> |
// if (!muon->isGlobal()) return; |
71 |
|
|
72 |
|
// if (ptMu < 6.) return; |
73 |
|
// if (ptMu > 7.) return; |
74 |
|
|
75 |
< |
//std::vector<L1Obj> l1Rpcs = l1RpcColl->getL1ObjsSelected(true, false, 0., 161., 0,0, -1.6, 1.6, -1.,7., -1,7 ); |
76 |
< |
std::vector<L1Obj> l1Rpcs = l1RpcColl->getL1ObjsSelected(); |
77 |
< |
//std::vector<L1Obj> l1Oths = l1OtherColl->getL1ObjsSelected(); |
78 |
< |
std::vector<L1Obj> l1Oths = l1OtherColl->getL1ObjsSelected(); |
75 |
> |
static double matchingdR = theConfig.getParameter<double>("maxDR"); |
76 |
> |
std::vector<L1Obj> l1Rpcs = l1Coll->l1RpcColl().selectByBx().selectByDeltaR( matchingdR); |
77 |
> |
std::vector<L1Obj> l1Oths = l1Coll->l1OthColl().selectByBx().selectByDeltaR( matchingdR).selectByEta(); |
78 |
> |
std::vector<L1Obj> l1Gmts = l1Coll->selectByType(L1Obj::GMT).selectByBx().selectByQuality(4,7).selectByDeltaR( matchingdR).selectByEta(); |
79 |
> |
std::vector<L1Obj> l1Otfs = l1Coll->selectByType(L1Obj::OTF); |
80 |
|
|
81 |
|
|
82 |
|
hEfficMuPt_D->Fill(ptMu); |
105 |
|
std::stringstream strPt; strPt << "hEff_OthPtCut"<< ptCuts[icut]<<reg[iregion]; |
106 |
|
hm[strPt.str()]->Fill(ptMu); |
107 |
|
} |
108 |
+ |
if (maxPt(l1Gmts)+epsilon > threshold) { |
109 |
+ |
std::stringstream strPt; strPt << "hEff_GmtPtCut"<< ptCuts[icut]<<reg[iregion]; |
110 |
+ |
hm[strPt.str()]->Fill(ptMu); |
111 |
+ |
} |
112 |
+ |
if (maxPt(l1Otfs)+epsilon > threshold) { |
113 |
+ |
std::stringstream strPt; strPt << "hEff_OtfPtCut"<< ptCuts[icut]<<reg[iregion]; |
114 |
+ |
hm[strPt.str()]->Fill(ptMu); |
115 |
+ |
} |
116 |
|
} |
117 |
|
|
118 |
|
|
123 |
|
for (unsigned int ir=3; ir <=4; ++ir) { |
124 |
|
hm["hEff_PtDenom"+reg[ir]]->Fill(ptMu); |
125 |
|
std::vector<L1Obj> l1RpcsQ; |
126 |
< |
if (ir==3) l1RpcsQ = l1RpcColl->getL1ObjsSelected(true, false,0.,161., 0,0, -1.6,1.6, 0.,7., 0,0); |
127 |
< |
if (ir==4) l1RpcsQ = l1RpcColl->getL1ObjsSelected(true, false,0.,161., 0,0, -1.6,1.6, 0.,7., 1,7); |
126 |
> |
L1ObjColl l1RpcCollQ = l1Coll->l1RpcColl().selectByDeltaR( matchingdR).selectByBx(); |
127 |
> |
if (ir==3) l1RpcsQ = l1RpcCollQ.selectByQuality(0,0).getL1Objs(); |
128 |
> |
if (ir==4) l1RpcsQ = l1RpcCollQ.selectByQuality(1,7).getL1Objs(); |
129 |
|
double epsilon=1.e-5; |
130 |
|
for (unsigned int icut=0; icut < AnaEff::nPtCuts; icut++) { |
131 |
|
double threshold = AnaEff::ptCuts[icut]; |