112 const int NLBCells = 23;
113 std::string LBCellName[NLBCells] = {
114 "A1",
"A2",
"A3",
"A4",
"A5",
"A6",
"A7",
"A8",
"A9",
"A10",
115 "B1",
"B2",
"B3",
"B4",
"B5",
"B6",
"B7",
"B8",
"B9",
116 "D0",
"D1",
"D2",
"D3"
119 const int NEBCells = 18;
120 std::string EBCellName[NEBCells] = {
121 "A12",
"A13",
"A14",
"A15",
"A16",
122 "B11",
"B12",
"B13",
"B14",
"B15",
124 "E1",
"E2",
"E3",
"E4",
"C10"
128 const int Npartitions = 4;
129 std::string PartitionName[Npartitions] = {
"EBA",
"LBA",
"LBC",
"EBC" };
131 const int Nmodules = 64;
133 std::string module_str;
140 for (
int imod = 0; imod < Nmodules; ++imod) {
142 std::ostringstream convert;
146 module_str =
"0" + convert.str();
149 module_str = convert.str();
155 for (
int icell = 0; icell < NLBCells; ++icell) {
159 "CellNoise_" + PartitionName[
PartLBA] + module_str +
"_" + LBCellName[icell],
160 "TileCellNoise - Run " + runNumStr +
" " + PartitionName[
PartLBA] + module_str +
" "
166 "CellNoise_" + PartitionName[
PartLBC] + module_str +
"_" + LBCellName[icell],
167 "TileCellNoise - Run " + runNumStr +
" " + PartitionName[
PartLBC] + module_str +
" "
173 for (
int icell = 0; icell < NEBCells; ++icell) {
177 "CellNoise_" + PartitionName[
PartEBA] + module_str +
"_" + EBCellName[icell],
178 "TileCellNoise - Run " + runNumStr +
" " + PartitionName[
PartEBA] + module_str +
" "
183 "CellNoise_" + PartitionName[
PartEBC] + module_str +
"_" + EBCellName[icell],
184 "TileCellNoise Run " + runNumStr +
" " + PartitionName[
PartEBC] + module_str +
" "
198 for (
int ipart = 0; ipart < 4; ++ipart) {
200 ,
"Sigma 1 - " + PartitionName[ipart], 23, 0., 23., 65, 0., 65.);
203 ,
"Sigma 2 - " + PartitionName[ipart], 23, 0., 23., 65, 0., 65.);
205 m_mapR[ipart] =
book2F(
"",
"map_R_" + PartitionName[ipart]
206 ,
"R (A_{1}/A_{2})- " + PartitionName[ipart], 23, 0., 23., 65, 0., 65.);
209 ,
"chi2 - " + PartitionName[ipart], 23, 0., 23., 65, 0., 65.);
212 ,
"chi2 prob. - " + PartitionName[ipart], 23, 0., 23., 65, 0., 65.);
215 ,
"RMS/ Sigma1 - " + PartitionName[ipart], 23, 0., 23., 65, 0., 65.);
218 ,
"RMS - " + PartitionName[ipart], 23, 0., 23., 65, 0., 65.);
221 if (PartitionName[ipart] ==
"LBA" || PartitionName[ipart] ==
"LBC") {
222 for (
int icell = 0; icell < NLBCells; ++icell) {
224 sprintf(CellName,
"%s ", LBCellName[icell].c_str());
225 m_mapSigma1[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
226 m_mapSigma2[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
227 m_mapR[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
228 m_mapChi2[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
229 m_mapChi2prb[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
230 m_mapRmsOsig[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
231 m_mapRms[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
234 if (PartitionName[ipart] ==
"EBA" || PartitionName[ipart] ==
"EBC") {
235 for (
int icell = 0; icell < NEBCells; ++icell) {
237 sprintf(CellName,
"%s ", EBCellName[icell].c_str());
238 m_mapSigma1[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
239 m_mapSigma2[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
240 m_mapR[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
241 m_mapChi2[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
242 m_mapChi2prb[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
243 m_mapRmsOsig[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
244 m_mapRms[ipart]->GetXaxis()->SetBinLabel(icell + 1, CellName);
248 for (
int imod = 1; imod < 65; imod = imod + 2) {
249 sprintf(modName,
"%s%s%i ", PartitionName[ipart].c_str(), (imod < 10 ?
"0" :
""), imod);
250 m_mapSigma1[ipart]->GetYaxis()->SetBinLabel(imod + 1, modName);
251 m_mapSigma2[ipart]->GetYaxis()->SetBinLabel(imod + 1, modName);
252 m_mapR[ipart]->GetYaxis()->SetBinLabel(imod + 1, modName);
253 m_mapChi2[ipart]->GetYaxis()->SetBinLabel(imod + 1, modName);
254 m_mapChi2prb[ipart]->GetYaxis()->SetBinLabel(imod + 1, modName);
255 m_mapRmsOsig[ipart]->GetYaxis()->SetBinLabel(imod + 1, modName);
256 m_mapRms[ipart]->GetYaxis()->SetBinLabel(imod + 1, modName);
261 return StatusCode::SUCCESS;
373 ATH_MSG_DEBUG(
"entering do2GFit(TH1F* h, double * fitresults, TF1* fitfunction) = " <<
h->GetName() );
378 float nentries =
h->GetEntries();
379 float rms =
h->GetRMS();
381 ATH_MSG_DEBUG(
"in do2GFit(...) : nentries = " << nentries <<
", rms = " << rms );
383 par[0] = 0.1 * nentries;
387 par[3] = 0.15 * par[0];
389 par[5] = 5. * par[2];
391 fitfunction->SetParameters(par);
393 float bin =
h->GetBinWidth(0);
395 float lim2 = std::max(rms * 1.05,
bin * 2.0);
396 float lim3 = std::max(rms * 10.0,
bin * 20.);
400 fitfunction->SetParLimits(0,0.,nentries);
403 fitfunction->FixParameter(1,0.);
404 fitfunction->SetParLimits(2,lim1,lim2);
407 fitfunction->SetParLimits(3,0.,nentries);
410 fitfunction->FixParameter(4,0.);
411 fitfunction->SetParLimits(5,lim2,lim3);
414 h->Fit(fitfunction,
"B");
416 fitresults [0] = fitfunction->GetParameter(0);
417 fitresults [1] = fitfunction->GetParameter(1);
418 fitresults [2] = fitfunction->GetParameter(2);
419 fitresults [3] = fitfunction->GetParameter(3);
420 fitresults [4] = fitfunction->GetParameter(4);
421 fitresults [5] = fitfunction->GetParameter(5);
422 fitresults [6] = fitfunction->GetChisquare();
434 fitresults[7] = fitfunction->GetProb();
435 fitresults[8] =
h->GetRMS();
449 int LBch2cellID[48] = {
450 19, 0, 10, 10, 0, 1, 11, 11, 1, 2, 2, 12,
451 12, 20, 20, 3, 13, 13, 3, 4, 4, 14, 14, 5,
452 21, 21, 5, 15, 15, 6, -1, -1, 6, 16, 16, 7,
453 8, 8, 7, 17, 17, 22, 18, -1, 22, 9, 9, 18
457 int EBch2cellID[48] = {
458 15, 16, 10, 10, 17, 17, 0, 0, 5, 5, 1, 1,
459 13, 14, 6, 6, 11, 11, 15, 16, 2, 2, 7, 7,
460 -1, -1, -1, -1, -1, -1, 8, 3, 3, -1, -1, 8,
461 9, 12, 12, 9, 4, 4, -1, -1, -1, -1, -1, -1
465 const int NLBCells = 23;
466 std::string LBCellName[NLBCells] = {
467 "A1",
"A2",
"A3",
"A4",
"A5",
"A6",
"A7",
"A8",
"A9",
"A10",
468 "B1",
"B2",
"B3",
"B4",
"B5",
"B6",
"B7",
"B8",
"B9",
469 "D0",
"D1",
"D2",
"D3"
472 const int NEBCells = 18;
473 std::string EBCellName[NEBCells] = {
474 "A12",
"A13",
"A14",
"A15",
"A16",
475 "B11",
"B12",
"B13",
"B14",
"B15",
477 "E1",
"E2",
"E3",
"E4",
"C10"
495 for ( ; iCell != lastCell; ++iCell) {
504 if (tile_cell == 0)
continue;
533 if (partition1 >= 4) partition1 =
getPartition(cell_ptr);
534 if (partition2 >= 4) partition2 = partition1;
537 if (partition1 >= 4) {
538 ATH_MSG_WARNING(
"TileCellNoiseMonTool:fillHistoPerCell : partition1 >= 5 ! - partition = " << partition1 );
539 ATH_MSG_WARNING(
"TileCellNoiseMonTool:fillHistoPerCell : skipping to next event " );
544 bool badch1 = (tile_cell->
badch1());
545 bool badch2 = (tile_cell->
badch2());
548 int cell_isbad = (int)badch1 + (
int)badch2;
550 int gn1 = tile_cell->
gain1();
551 int gn2 = tile_cell->
gain2();
557 double energy = cell_ptr -> energy();
558 double eta = cell_ptr ->
eta();
559 double phi = cell_ptr ->
phi();
561 if (partition1 == 0) {
563 }
else if (partition1 == 1) {
565 }
else if (partition1 == 2) {
567 }
else if (partition1 == 3) {
574 int CellID1=0, CellID2=0;
575 std::string CellName1 =
"";
576 std::string CellName2 =
"";
580 CellID1 = LBch2cellID[ch1];
582 CellID1 = EBch2cellID[ch1];
588 CellID2 = LBch2cellID[ch2];
590 CellID2 = EBch2cellID[ch2];
594 if (
msgLvl(MSG::DEBUG) && (fabs(energy - 1.) < 0.01)) {
595 msg(MSG::DEBUG) <<
"ch1 = " << ch1
597 <<
" CellID1 = " << CellID1
598 <<
" CellID2 = " << CellID2 <<
endmsg;
600 msg(MSG::DEBUG) <<
"partition1 = " << partition1 <<
endmsg;
601 msg(MSG::DEBUG) <<
"partition2 = " << partition2 <<
endmsg;
603 msg(MSG::DEBUG) <<
"gain1 = " << gn1 <<
endmsg;
604 msg(MSG::DEBUG) <<
"gain2 = " << gn2 <<
endmsg;
608 CellName1 = LBCellName[CellID1];
610 CellName1 = EBCellName[CellID1];
614 CellName2 = LBCellName[CellID2];
616 CellName2 = EBCellName[CellID2];
620 if (
msgLvl(MSG::DEBUG) && (fabs(energy - 1) < 0.01)) {
621 msg(MSG::DEBUG) <<
"CellName1 = " << CellName1 <<
endmsg;
622 msg(MSG::DEBUG) <<
"CellName2 = " << CellName2 <<
endmsg;
623 msg(MSG::DEBUG) <<
"Cell energy = " << energy <<
endmsg;
624 msg(MSG::DEBUG) <<
"ch1Ok = " << (ch1Ok ? 1 : 0) <<
" ch2Ok = " << (ch2Ok ? 1 : 0) <<
endmsg;
625 if (partition1 >= 0){
631 <<
" ch2Ok = " << ch2Ok
632 <<
" cell_isbad = " << cell_isbad
635 <<
" energy = " << energy );
638 if (ch1Ok && ch2Ok && cell_isbad == 0) {
641 if (partition1 >= 0){
644 ATH_MSG_ERROR(
"Attempting to access m_tileCellEne at index "<<partition1);
649 if (CellName1 != CellName2) {
650 ATH_MSG_WARNING(
" CellName1 and 2 are different : CellName1 = " << CellName1
651 <<
" CellName2 =" << CellName2 );
660 return StatusCode::SUCCESS;