55 |
|
// if (hitRawId != 637599914) return; |
56 |
|
// if (hitRawId != 637632682 ) return; |
57 |
|
RPCDetIdUtil idHit( hitRawId ); |
58 |
+ |
bool barrelRefHit = idHit.isBarrel(); |
59 |
|
|
60 |
|
// |
61 |
|
// correlation betweem sim hit position@RPC and digi |
99 |
|
// |
100 |
|
// for given fixed hit postion in RPC check distributions |
101 |
|
// |
102 |
< |
bool precisePos = ( fabs(hitSpec->position().phi()-1.025) < 0.0003); |
102 |
> |
bool precisePos = ( fabs(hitSpec->position().phi()-1.025) < 0.001); |
103 |
|
// bool precisePos = ( |
104 |
|
// fabs(hitSpec->position().phi()-0.99) < 0.001 |
105 |
|
// || fabs(hitSpec->position().phi()-0.89) < 0.001 ); |
114 |
|
RPCDetId rpcId(digi.rawId()); |
115 |
|
RPCDetIdUtil util(digi.rawId()); |
116 |
|
if (util.isBarrel()) { |
117 |
< |
if (theRpcBPos.find(digi.rawId())==theRpcBPos.end()) { |
117 |
> |
if (barrelRefHit && (theRpcBPosB.find(digi.rawId())==theRpcBPosB.end()) ){ |
118 |
|
std::stringstream str; |
119 |
< |
str<<"hDigiSpec_RpcBVsPt_Pos_"<<digi.rawId(); |
119 |
> |
str<<"hDigiSpec_RpcBVsPt_PosB_"<<digi.rawId(); |
120 |
|
std::string hName = str.str(); |
121 |
|
str<<"_la"<<util.layer()<<"sc"<<rpcId.sector()<<"ro"<<rpcId.roll(); |
122 |
|
std::string hTitle = str.str(); |
123 |
< |
theRpcBPos[digi.rawId()] = new TH2D(hName.c_str(), hTitle.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 191,2.,193.); |
123 |
> |
theRpcBPosB[digi.rawId()] = new TH2D(hName.c_str(), hTitle.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 191,2.,193.); |
124 |
|
} |
125 |
< |
if (precisePos) theRpcBPos[digi.rawId()]->Fill(simu->pt(), digi.halfStrip()); |
125 |
> |
if (!barrelRefHit && (theRpcBPosE.find(digi.rawId())==theRpcBPosE.end()) ) { |
126 |
> |
std::stringstream str; |
127 |
> |
str<<"hDigiSpec_RpcBVsPt_PosE_"<<digi.rawId(); |
128 |
> |
std::string hName = str.str(); |
129 |
> |
str<<"_la"<<util.layer()<<"sc"<<rpcId.sector()<<"ro"<<rpcId.roll(); |
130 |
> |
std::string hTitle = str.str(); |
131 |
> |
theRpcBPosE[digi.rawId()] = new TH2D(hName.c_str(), hTitle.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 191,2.,193.); |
132 |
> |
} |
133 |
> |
if (precisePos && barrelRefHit) theRpcBPosB[digi.rawId()]->Fill(simu->pt(), digi.halfStrip()); |
134 |
> |
if (precisePos && !barrelRefHit) theRpcBPosE[digi.rawId()]->Fill(simu->pt(), digi.halfStrip()); |
135 |
|
} else { |
136 |
< |
if (theRpcEPos.find(digi.rawId())==theRpcEPos.end()) { |
136 |
> |
if (barrelRefHit && (theRpcEPosB.find(digi.rawId())==theRpcEPosB.end()) ) { |
137 |
|
std::stringstream str; |
138 |
< |
str<<"hDigiSpec_RpcEVsPt_Pos_"<<digi.rawId(); |
138 |
> |
str<<"hDigiSpec_RpcEVsPt_PosB_"<<digi.rawId(); |
139 |
|
std::string hName = str.str(); |
140 |
|
str<<"_la"<<util.layer()<<"ch"<<(rpcId.sector()-1)*6+rpcId.subsector()<<"ro"<<rpcId.roll(); |
141 |
|
std::string hTitle = str.str(); |
142 |
< |
theRpcEPos[digi.rawId()] = new TH2D(hName.c_str(), hTitle.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 191,2.,193.); |
142 |
> |
theRpcEPosB[digi.rawId()] = new TH2D(hName.c_str(), hTitle.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 191,2.,193.); |
143 |
|
} |
144 |
< |
if (precisePos) theRpcEPos[digi.rawId()]->Fill(simu->pt(), digi.halfStrip()); |
144 |
> |
if (!barrelRefHit && (theRpcEPosE.find(digi.rawId())==theRpcEPosE.end()) ) { |
145 |
> |
std::stringstream str; |
146 |
> |
str<<"hDigiSpec_RpcEVsPt_PosE_"<<digi.rawId(); |
147 |
> |
std::string hName = str.str(); |
148 |
> |
str<<"_la"<<util.layer()<<"ch"<<(rpcId.sector()-1)*6+rpcId.subsector()<<"rn"<<rpcId.ring()<<"ro"<<rpcId.roll(); |
149 |
> |
std::string hTitle = str.str(); |
150 |
> |
theRpcEPosE[digi.rawId()] = new TH2D(hName.c_str(), hTitle.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 191,2.,193.); |
151 |
> |
} |
152 |
> |
if (precisePos && barrelRefHit) theRpcEPosB[digi.rawId()]->Fill(simu->pt(), digi.halfStrip()); |
153 |
> |
if (precisePos && !barrelRefHit) theRpcEPosE[digi.rawId()]->Fill(simu->pt(), digi.halfStrip()); |
154 |
|
} |
155 |
|
break; |
156 |
|
} |
158 |
|
case MuonSubdetId::DT: { |
159 |
|
DTphDigiSpec digi(is->first, is->second); |
160 |
|
DTChamberId dt(digi.rawId()); |
161 |
< |
if (theDtPos.find(digi.rawId())==theDtPos.end()) { |
161 |
> |
if (barrelRefHit && (theDtPosB.find(digi.rawId())==theDtPosB.end()) ) { |
162 |
> |
std::stringstream str1, str2; |
163 |
> |
str1<<"hDigiSpec_DtVsPt_PosB_"<<digi.rawId(); |
164 |
> |
str2<<"hDigiSpec_DtVsPt_BendB_"<<digi.rawId(); |
165 |
> |
std::string hName1 = str1.str(); |
166 |
> |
std::string hName2 = str2.str(); |
167 |
> |
str1<<"_s"<<dt.station()<<"sc"<<dt.sector(); |
168 |
> |
str2<<"_s"<<dt.station()<<"sc"<<dt.sector(); |
169 |
> |
std::string hTitle1 = str1.str(); |
170 |
> |
std::string hTitle2 = str2.str(); |
171 |
> |
theDtPosB[digi.rawId()] = new TH2D(hName1.c_str(), hTitle1.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 100,-2048.,2048.); |
172 |
> |
theDtBendB[digi.rawId()] = new TH2D(hName2.c_str(), hTitle2.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 1100,-550.,550.); |
173 |
> |
} |
174 |
> |
if (!barrelRefHit && (theDtPosE.find(digi.rawId())==theDtPosE.end()) ) { |
175 |
|
std::stringstream str1, str2; |
176 |
< |
str1<<"hDigiSpec_DtVsPt_Pos_"<<digi.rawId(); |
177 |
< |
str2<<"hDigiSpec_DtVsPt_Bend_"<<digi.rawId(); |
176 |
> |
str1<<"hDigiSpec_DtVsPt_PosE_"<<digi.rawId(); |
177 |
> |
str2<<"hDigiSpec_DtVsPt_BendE_"<<digi.rawId(); |
178 |
|
std::string hName1 = str1.str(); |
179 |
|
std::string hName2 = str2.str(); |
180 |
|
str1<<"_s"<<dt.station()<<"sc"<<dt.sector(); |
181 |
|
str2<<"_s"<<dt.station()<<"sc"<<dt.sector(); |
182 |
|
std::string hTitle1 = str1.str(); |
183 |
|
std::string hTitle2 = str2.str(); |
184 |
< |
theDtPos[digi.rawId()] = new TH2D(hName1.c_str(), hTitle1.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 100,-2048.,2048.); |
185 |
< |
theDtBend[digi.rawId()] = new TH2D(hName2.c_str(), hTitle2.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 1100,-550.,550.); |
184 |
> |
theDtPosE[digi.rawId()] = new TH2D(hName1.c_str(), hTitle1.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 100,-2048.,2048.); |
185 |
> |
theDtBendE[digi.rawId()] = new TH2D(hName2.c_str(), hTitle2.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 1100,-550.,550.); |
186 |
|
} |
187 |
< |
if (precisePos) theDtPos[digi.rawId()]->Fill(simu->pt(), digi.phi()); |
188 |
< |
theDtBend[digi.rawId()]->Fill(simu->pt(), digi.phiB()); |
187 |
> |
if (precisePos && barrelRefHit) theDtPosB[digi.rawId()]->Fill(simu->pt(), digi.phi()); |
188 |
> |
if (precisePos && barrelRefHit) theDtBendB[digi.rawId()]->Fill(simu->pt(), digi.phiB()); |
189 |
> |
if (precisePos && !barrelRefHit) theDtPosE[digi.rawId()]->Fill(simu->pt(), digi.phi()); |
190 |
> |
if (precisePos && !barrelRefHit) theDtBendE[digi.rawId()]->Fill(simu->pt(), digi.phiB()); |
191 |
|
break; |
192 |
|
} |
193 |
|
|
194 |
|
case MuonSubdetId::CSC: { |
161 |
– |
if (idHit.isBarrel()) break; |
195 |
|
CSCDigiSpec digi(is->first, is->second); |
196 |
|
CSCDetId csc(digi.rawId()); |
197 |
< |
if (theCscPos.find(digi.rawId())==theCscPos.end()) { |
197 |
> |
if ( barrelRefHit && (theCscPosB.find(digi.rawId())==theCscPosB.end()) ) { |
198 |
|
std::stringstream str1, str2; |
199 |
< |
str1<<"hDigiSpec_CscVsPt_Pos_"<<digi.rawId(); |
200 |
< |
str2<<"hDigiSpec_CscVsPt_Bend_"<<digi.rawId(); |
199 |
> |
str1<<"hDigiSpec_CscVsPt_PosB_"<<digi.rawId(); |
200 |
> |
str2<<"hDigiSpec_CscVsPt_BendB_"<<digi.rawId(); |
201 |
|
std::string hName1 = str1.str(); |
202 |
|
std::string hName2 = str2.str(); |
203 |
< |
str1<<"_s"<<csc.station()<<"ch"<<csc.chamber()<<"ri"<<csc.ring(); |
204 |
< |
str2<<"_s"<<csc.station()<<"ch"<<csc.chamber()<<"ri"<<csc.ring(); |
203 |
> |
str1<<"_s"<<csc.station()<<"ch"<<csc.chamber()<<"rn"<<csc.ring(); |
204 |
> |
str2<<"_s"<<csc.station()<<"ch"<<csc.chamber()<<"rn"<<csc.ring(); |
205 |
|
std::string hTitle1 = str1.str(); |
206 |
|
std::string hTitle2 = str2.str(); |
207 |
< |
theCscPos[digi.rawId()] = new TH2D(hName1.c_str(), hTitle1.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 100,0.,160.); |
208 |
< |
theCscBend[digi.rawId()] = new TH2D(hName2.c_str(), hTitle2.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 11,0.5,11.5); |
207 |
> |
theCscPosB[digi.rawId()] = new TH2D(hName1.c_str(), hTitle1.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 100,0.,160.); |
208 |
> |
theCscBendB[digi.rawId()] = new TH2D(hName2.c_str(), hTitle2.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 11,0.5,11.5); |
209 |
|
} |
210 |
< |
if (precisePos) theCscPos[digi.rawId()]->Fill(simu->pt(), digi.strip()); |
211 |
< |
theCscBend[digi.rawId()]->Fill(simu->pt(), digi.pattern()); |
210 |
> |
if (!barrelRefHit && (theCscPosE.find(digi.rawId())==theCscPosE.end()) ) { |
211 |
> |
std::stringstream str1, str2; |
212 |
> |
str1<<"hDigiSpec_CscVsPt_PosE_"<<digi.rawId(); |
213 |
> |
str2<<"hDigiSpec_CscVsPt_BendE_"<<digi.rawId(); |
214 |
> |
std::string hName1 = str1.str(); |
215 |
> |
std::string hName2 = str2.str(); |
216 |
> |
str1<<"_s"<<csc.station()<<"ch"<<csc.chamber()<<"rn"<<csc.ring(); |
217 |
> |
str2<<"_s"<<csc.station()<<"ch"<<csc.chamber()<<"rn"<<csc.ring(); |
218 |
> |
std::string hTitle1 = str1.str(); |
219 |
> |
std::string hTitle2 = str2.str(); |
220 |
> |
theCscPosE[digi.rawId()] = new TH2D(hName1.c_str(), hTitle1.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 100,0.,160.); |
221 |
> |
theCscBendE[digi.rawId()] = new TH2D(hName2.c_str(), hTitle2.c_str(), L1PtScale::nPtBins, L1PtScale::ptBins, 11,0.5,11.5); |
222 |
> |
} |
223 |
> |
if ( barrelRefHit && precisePos) theCscPosB[digi.rawId()]->Fill(simu->pt(), digi.strip()); |
224 |
> |
if ( barrelRefHit && precisePos) theCscBendB[digi.rawId()]->Fill(simu->pt(), digi.pattern()); |
225 |
> |
if (!barrelRefHit && precisePos) theCscPosE[digi.rawId()]->Fill(simu->pt(), digi.strip()); |
226 |
> |
if (!barrelRefHit && precisePos) theCscBendE[digi.rawId()]->Fill(simu->pt(), digi.pattern()); |
227 |
|
break; |
228 |
|
} |
229 |
|
|
234 |
|
|
235 |
|
void AnaDigiSpec::resume(TObjArray& histos) |
236 |
|
{ |
237 |
< |
std::cout <<" AnaDigiSpec, size of HMaps: CscPos="<<theCscPos.size() |
238 |
< |
<<", CscBend="<<theCscBend.size() |
239 |
< |
<<", DtPos="<<theDtPos.size() |
240 |
< |
<<", DtBend="<<theDtBend.size() |
241 |
< |
<<", RpcBPos="<<theRpcBPos.size() |
242 |
< |
<<", RpcEPos="<<theRpcEPos.size()<<std::endl; |
243 |
< |
VHisto aCscPos = topN(theCscPos, 9); |
244 |
< |
VHisto aRpcBPos = topN(theRpcBPos, 9); |
245 |
< |
VHisto aRpcEPos = topN(theRpcEPos, 9); |
246 |
< |
VHisto aDtPos = topN(theDtPos, 9); |
247 |
< |
VHisto aCscBend = topN(theCscBend, 9); |
248 |
< |
VHisto aDtBend = topN(theDtBend, 9); |
237 |
> |
std::cout <<" AnaDigiSpec, size of HMaps (barrel ref hit): CscPosB="<<theCscPosB.size() |
238 |
> |
<<", CscBendB="<<theCscBendB.size() |
239 |
> |
<<", DtPosB="<<theDtPosB.size() |
240 |
> |
<<", DtBendB="<<theDtBendB.size() |
241 |
> |
<<", RpcBPosB="<<theRpcBPosB.size() |
242 |
> |
<<", RpcEPosB="<<theRpcEPosB.size()<<std::endl; |
243 |
> |
std::cout <<" AnaDigiSpec, size of HMaps (endcal ref hit): CscPosE="<<theCscPosE.size() |
244 |
> |
<<", CscBendE="<<theCscBendE.size() |
245 |
> |
<<", DtPosE="<<theDtPosE.size() |
246 |
> |
<<", DtBendE="<<theDtBendE.size() |
247 |
> |
<<", RpcBPosE="<<theRpcBPosE.size() |
248 |
> |
<<", RpcEPosE="<<theRpcEPosE.size()<<std::endl; |
249 |
> |
VHisto aCscPos = topN(theCscPosB, 9); |
250 |
> |
VHisto aRpcBPos = topN(theRpcBPosB, 9); |
251 |
> |
VHisto aRpcEPos = topN(theRpcEPosB, 9); |
252 |
> |
VHisto aDtPos = topN(theDtPosB, 9); |
253 |
> |
VHisto aCscBend = topN(theCscBendB, 9); |
254 |
> |
VHisto aDtBend = topN(theDtBendB, 9); |
255 |
|
typedef VHisto::const_iterator IV; |
256 |
|
for (IV iv = aCscPos.begin(); iv != aCscPos.end(); ++iv) histos.Add(*iv); |
257 |
|
for (IV iv = aRpcBPos.begin(); iv != aRpcBPos.end(); ++iv) histos.Add(*iv); |
258 |
|
for (IV iv = aRpcEPos.begin(); iv != aRpcEPos.end(); ++iv) histos.Add(*iv); |
259 |
+ |
for (IV iv = aDtPos.begin(); iv != aDtPos.end(); ++iv) histos.Add(*iv); |
260 |
+ |
for (IV iv = aDtBend.begin(); iv != aDtBend.end(); ++iv) histos.Add(*iv); |
261 |
+ |
for (IV iv = aCscBend.begin(); iv != aCscBend.end(); ++iv) histos.Add(*iv); |
262 |
+ |
|
263 |
+ |
aCscPos = topN(theCscPosE, 9); |
264 |
+ |
aRpcBPos = topN(theRpcBPosE, 9); |
265 |
+ |
aRpcEPos = topN(theRpcEPosE, 9); |
266 |
+ |
aDtPos = topN(theDtPosE, 9); |
267 |
+ |
aCscBend = topN(theCscBendE, 9); |
268 |
+ |
aDtBend = topN(theDtBendE, 9); |
269 |
+ |
for (IV iv = aCscPos.begin(); iv != aCscPos.end(); ++iv) histos.Add(*iv); |
270 |
+ |
for (IV iv = aRpcBPos.begin(); iv != aRpcBPos.end(); ++iv) histos.Add(*iv); |
271 |
+ |
for (IV iv = aRpcEPos.begin(); iv != aRpcEPos.end(); ++iv) histos.Add(*iv); |
272 |
|
for (IV iv = aDtPos.begin(); iv != aDtPos.end(); ++iv) histos.Add(*iv); |
273 |
|
for (IV iv = aDtBend.begin(); iv != aDtBend.end(); ++iv) histos.Add(*iv); |
274 |
|
for (IV iv = aCscBend.begin(); iv != aCscBend.end(); ++iv) histos.Add(*iv); |