20 std::vector<int> count_mon;
21 std::vector<int> scount_mon;
23 std::vector<float> tmp_val_mon;
24 std::vector<float> secLayer;
25 std::vector<int> mphi_true;
26 std::vector<int> mphi_false;
27 std::vector<int> scount_phi_false;
28 std::vector<int> scount_phi_true;
29 std::vector<int> scount_eta_false;
30 std::vector<int> scount_eta_true;
78 return StatusCode::FAILURE;
92 int clusCount[33][9], sigclusCount[33][9];
93 unsigned int nEtaClusWidthCnt = 0, nPhiClusWidthCnt = 0;
94 for(
unsigned int kl = 0;
kl < 33;
kl++ ) {
95 for(
unsigned int km = 0;
km < 9;
km++ ) {
96 clusCount[
kl][
km] = 0;
97 sigclusCount[
kl][
km] = 0;
101 float stripsSum_EA = 0.;
102 float stripsSum_EAtest = -50.;
103 float stripsSum_EC = 0.;
104 float stripsSum_ECtest = -50.;
106 ATH_MSG_DEBUG (
" Begin loop over clusters ============================");
110 const std::vector<Identifier>& stripIds = iClus.
rdoList();
111 float clu_charge = iClus.
charge();
114 ATH_MSG_DEBUG(
" cluster charge = " << clu_charge <<
"\t cluster time = " << clu_time );
116 unsigned int noStrips = stripIds.size();
118 Identifier clusId = iClus.
identify();
123 int chamberType = stationString ==
"CSS" ? 0 : 1;
126 int wireLayer =
m_idHelperSvc->cscIdHelper().wireLayer(clusId);
127 int measuresPhi =
m_idHelperSvc->cscIdHelper().measuresPhi(clusId);
134 fill(
"CscClusMonitor",
z,
r);
135 fill(
"CscClusMonitor",
y,
x);
140 int xfac = measuresPhi ? -1 : 1;
144 stripsSum_EA = stripsSum_EA + noStrips;
146 if(stripsSum_EA > stripsSum_EAtest) {
147 stripsSum_EAtest = stripsSum_EA;
150 if(secLayer < 0. || secLayer == 0.) {
151 stripsSum_EC = stripsSum_EC + noStrips;
153 if(stripsSum_EC > stripsSum_ECtest) {
154 stripsSum_ECtest = stripsSum_EC;
158 int ns = sectorNo < 0 ? sectorNo*(-1) : sectorNo+16;
159 int nl = (measuresPhi ? wireLayer : wireLayer+4);
166 ATH_MSG_DEBUG(
" ns = " <<
ns <<
"\tm_nl = " << nl <<
"\tm_sec = " << sectorNo <<
"\t m_lay= " << wireLayer <<
"\tmPhi = " << measuresPhi);
173 bool cluster_status = ( (
stat ==
"unspoiled") ||
174 (
stat ==
"unspoiled with split") ||
179 bool eta_cluster_status = cluster_status && ( noStrips > 2 ) && (measuresPhi == 0);
182 bool phi_cluster_status = cluster_status && ( noStrips > 0 ) && (measuresPhi == 1);
184 ATH_MSG_DEBUG (
" ClusterStatus eta = " << eta_cluster_status <<
" ,phi = " << phi_cluster_status);
186 << measuresPhi <<
",wire:" << wireLayer <<
") = " << secLayer <<
" status = "
187 <<
stat <<
" #of strips = " << noStrips );
190 if(eta_cluster_status || phi_cluster_status ) {
192 bool found_id =
true;
193 std::vector <const CscStripPrepData*> stripVec;
194 std::vector <float> fStripIDs;
196 float maxStripCharge = 0., maxStipId = 0.;
197 int sIdx = 0, mxIdx = 0;
201 fill(
"CscClusMonitor",noStrips_mon, secLayer,clus_phi_mon, clus_eta_mon);
211 for ( std::vector<Identifier>::const_iterator sId = stripIds.begin(); sId != stripIds.end(); ++sId, sIdx++ ) {
212 Identifier
id = *sId;
215 fStripIDs.push_back(stripid);
217 fill(
"CscClusMonitor",stripid, secLayer);
221 if (
icol ==
nullptr ) {
229 bool found_strip =
false;
230 float maxsampChVal = 0.;
233 found_strip = ( *istrip )->identify() ==
id ;
235 stripVec.push_back(*istrip);
236 std::vector<float> samp_charges = ( *istrip )->sampleCharges();
237 for(
unsigned int i = 0;
i < samp_charges.size();
i++ ) {
238 if(samp_charges[
i] > maxsampChVal) maxsampChVal = samp_charges[
i];
240 if(maxsampChVal > maxStripCharge ) {
241 maxStripCharge = maxsampChVal;
248 ATH_MSG_DEBUG (
" " << (found_strip?
"FoundStrip " :
"NoStripFound ") <<
" with max sampling = " << maxsampChVal);
253 ATH_MSG_DEBUG (
" Max Strip charge = " << maxStripCharge <<
" and strip Id = " << maxStipId <<
" and index = " << mxIdx);
254 float qmax = 0., qleft = 0., qright = 0., qsum = 0.;
257 bool size_ids_coll = (noStrips == stripVec.size() ? true :
false) ;
259 if(found_id && size_ids_coll ) {
261 std::vector<ICscStripFitter::Result>
res;
263 bool range_check = (mxIdx > -1) && (mxIdx <
int(noStrips));
265 ATH_MSG_DEBUG (
" Range check = (" << mxIdx <<
" > -1 ) && (" << mxIdx <<
" < " << noStrips <<
" ) = " << range_check
266 <<
"\t size of vec check " << noStrips <<
" == " << stripVec.size());
272 qleft =
res[0].charge;
276 <<
res[0].dwidth <<
"\t status= " <<
res[0].
status <<
"\t chisq= " <<
res[0].chsq);
280 qmax =
res[1].charge;
284 <<
res[1].dwidth <<
"\t status= " <<
res[1].
status <<
"\t chisq= " <<
res[1].chsq);
286 if(mxIdx+1 <
int(noStrips)) {
288 qright =
res[2].charge;
292 <<
res[2].dwidth <<
"\t status= " <<
res[2].
status <<
"\t chisq= " <<
res[2].chsq);
300 float kiloele = 1.0e-3;
332 fill(
"CscClusMonitor",fStripIDs_col, QmaxADC, secLayer, noStrips_mon, QsumADC, clu_time, clu_charge_kiloele, clus_phi, clus_eta, clus_phiSig, clus_etaSig, clus_phiNoise, clus_etaNoise, signal_mon, noise_mon,
sideA,
sideC, sideA_phiSig, sideC_phiSig);
341 fill(
"CscClusMonitor",stripsSum_EA_mon, stripsSum_EC_mon);
344 ATH_MSG_DEBUG (
" End loop over clusters ============================");
347 fill(
"CscClusMonitor",nPhiClusWidthCnt_mon,nEtaClusWidthCnt_mon);
350 int numeta = 0, numphi = 0;
351 int numetasignal = 0, numphisignal = 0;
354 for(
int kl = 1;
kl < 33;
kl++ ) {
357 int eta_hits[4] = {0,0,0,0};
358 bool chamber_empty =
true;
359 int sec =
kl < 17 ?
kl*(-1) :
kl;
360 for(
int km = 1;
km < 9;
km++ ) {
361 int lay = (
km > 4 &&
km < 9) ?
km-4 :
km;
362 bool mphi = (
km > 0 &&
km < 5) ?
true :
false;
363 std::string wlay = mphi ?
"Phi-Layer " :
"Eta-Layer: ";
368 ATH_MSG_DEBUG (
"sec[" << sec <<
"]\t" << wlay <<
"[" << lay <<
"] = " << monstruct.secLayer.back() <<
"= " <<
"\tNsig = " <<
scount <<
", Ntot = " <<
count);
372 chamber_empty =
false;
380 chamber_empty =
false;
384 ATH_MSG_DEBUG ( wlay <<
"Counts sec: [" <<
kl-16 <<
"]\tlayer: [" <<
km <<
"] = " << monstruct.secLayer.back() <<
"\t = " <<
count <<
"\t" <<
scount);
387 monstruct.count_mon.push_back(
count);
388 monstruct.scount_mon.push_back(
scount);
390 monstruct.mphi_true.push_back((
int)mphi &&
count);
391 monstruct.mphi_false.push_back((
int)!(mphi) &&
count);
392 monstruct.scount_phi_true.push_back((
int)mphi &&
count &&
scount);
393 monstruct.scount_phi_false.push_back((
int)mphi &&
count && !
scount);
394 monstruct.scount_eta_true.push_back((
int)!(mphi) &&
count &&
scount);
395 monstruct.scount_eta_false.push_back((
int)!(mphi) &&
count && !
scount);
396 monstruct.secLayer.push_back((sec + 0.2 * (lay - 1) + 0.1));
400 int segNum_new = -999.;
402 std::ostringstream nseglist;
403 std::bitset<4> segNum;
404 for(
unsigned int mm = 0;
mm < 4;
mm++) {
405 bool set = (eta_hits[
mm] > 0 ? true :
false);
406 if(
set) segNum.set(
mm);
407 nseglist << (
set ?
"1" :
"0");
409 segNum_new = segNum.to_ulong();
410 ATH_MSG_DEBUG(
"segments= " << nseglist.str() <<
"\t = " << segNum.to_ulong());
414 fill(
"CscClusMonitor", segNum_mon, sec_mon);
417 ATH_MSG_DEBUG(
" numphi = " << numphi <<
"\t numeta = " << numeta <<
"\tm_sphi = " << numphisignal <<
"\t m_seta = " << numetasignal);
424 auto num_num_noise_mon =
Monitored::Scalar<int>(
"num_num_noise_mon", (numphi-numphisignal)+(numeta-numetasignal));
428 fill(
"CscClusMonitor",numphi_mon,numeta_mon,numphi_sig_mon,numeta_sig_mon,numphi_numeta_mon,numphi_numeta_sig_mon,num_num_noise_mon,numphi_diff_mon,numeta_diff_mon);
443 fill(
"CscClusMonitor", count_mon, scount_mon,
count_diff, secLayer, mphi_true, mphi_false, scount_phi_true, scount_phi_false, scount_eta_true, scount_eta_false);