6 #include "GaudiKernel/ITHistSvc.h"
16 #include "CaloDetDescr/CaloDetDescrElement.h"
40 , m_h_badCellA(nullptr)
41 , m_h_badCellBC(nullptr)
42 , m_h_badCellD(nullptr)
43 , m_h_badCellGap(nullptr)
44 , m_h_badCell(nullptr)
130 m_h_badCellA =
new TH2F(
"m_h_badCellA",
"Etaphi_maskedCell A", 34, -1.7, 1.7, 64, -3.2, 3.2);
131 m_h_badCellBC =
new TH2F(
"m_h_badCellBC",
"Etaphi_maskedCell BC", 34, -1.7, 1.7, 64, -3.2, 3.2);
132 m_h_badCellD =
new TH2F(
"m_h_badCellD",
"Etaphi_maskedCell D", 34, -1.7, 1.7, 64, -3.2, 3.2);
133 m_h_badCellGap =
new TH2F(
"m_h_badCellGap",
"Etaphi_maskedCell Gap", 34, -1.7, 1.7, 64, -3.2, 3.2);
134 m_h_badCell =
new TH2F(
"m_h_badCell",
"Etaphi_maskedCell All", 34, -1.7, 1.7, 64, -3.2, 3.2);
142 return StatusCode::SUCCESS;
181 return StatusCode::SUCCESS;
196 msg(MSG::INFO) <<
ros <<
"/" << std::setw(2)
197 <<
drawer <<
"/" << std::setw(2)
199 <<
adc <<
" : " << std::fixed << std::right << std::setw(9) << std::setprecision(5)
201 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
203 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
205 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
211 msg(MSG::INFO) << std::fixed << std::right << std::setw(9) << std::setprecision(5)
212 << chanCalMeV <<
" (total)";
216 msg(MSG::INFO) << std::fixed << std::right << std::setw(9) << std::setprecision(5)
219 <<
" (onlMev->oflADC)";
232 ATH_MSG_INFO(
"Performing an energy scan to test CIS LUT" );
234 unsigned int ros = 1;
238 for (
int adcCounts = 0; adcCounts <=
m_i_ADCmax; ++adcCounts) {
239 double energy =
static_cast<float>(adcCounts);
241 <<
"ADC counts = " << adcCounts
262 msg(MSG::INFO) <<
ros <<
"/" << std::setw(2) <<
drawer <<
"/" << std::setw(2) <<
channel <<
"/" <<
adc <<
" : "
263 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
265 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
267 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
269 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
274 msg(MSG::INFO) << std::fixed << std::right << std::setw(9) << std::setprecision(5)
275 << chanCalMeV <<
" (total)";
298 msg(MSG::INFO) <<
ros <<
"/" << std::setw(2)
299 <<
drawer <<
"/" << std::setw(2)
302 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
304 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
306 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
308 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
329 for (
unsigned int adc = 0;
adc < 6; ++
adc) {
356 const EventContext &ctx = Gaudi::Hive::currentContext();
358 std::vector<float> vecAutoCr;
371 msg(MSG::INFO) <<
ros <<
"/"
380 for (
unsigned int i = 0;
i < vecAutoCr.size(); ++
i) {
381 msg(MSG::INFO) << vecAutoCr[
i] <<
" ";
397 const EventContext &ctx = Gaudi::Hive::currentContext();
399 std::vector<float> vecAutoCr;
431 ATH_MSG_INFO(
"Athena Online mode detected: only channel offset available." );
478 unsigned int ros = 0;
487 float startpoint = -100.0;
488 float endpoint = 150.0;
490 const EventContext &ctx = Gaudi::Hive::currentContext();
497 for (
unsigned int point = 0; point < npoint; ++point) {
502 <<
drawer <<
"/" << std::setw(2)
505 <<
"Time, Y, DY: " << std::fixed << std::right << std::setw(9) << std::setprecision(6) <<
time
506 <<
" " << std::fixed << std::right << std::setw(11) << std::setprecision(8) <<
y
507 <<
" " << std::fixed << std::right << std::setw(11) << std::setprecision(8) <<
dy );
521 std::vector<std::string> vmod;
523 std::ostringstream sSum;
524 std::ostringstream sDet;
527 const unsigned int npar = 4;
528 unsigned int bchn[npar];
529 unsigned int badc[npar];
530 for (
unsigned int ros = 0;
ros < npar; ++
ros) {
536 sDet <<
">>>>>>>>>>>>>>> Detailed list of BAD Channels/ADCs <<<<<<<<<<<<<<<<" << std::endl;
542 unsigned int badadc = 0;
543 unsigned int badchn = 0;
549 if (
status.isAffected()) {
553 <<
"has at least one problem: " <<
status.getString() << std::endl;
562 <<
"has at least one problem: " <<
status.getString() << std::endl;
569 <<
"/ch" <<
channel <<
"/" <<
adc <<
" : " <<
status.getString() << std::endl;
577 <<
"/ch" <<
channel <<
"/" <<
adc <<
" : " <<
status.getString() << std::endl;
585 std::ostringstream myStream;
587 vmod.push_back(myStream.str());
597 sSum <<
">>> Summary of BAD channels/ADCs per drawer (in LBA, LBC, EBA, EBC) <<<<" << std::endl;
599 sSum <<
"There are no bad ADCs in LBA, LBC, EBA and EBC" << std::endl;
601 unsigned int totchn = 0;
602 unsigned int totadc = 0;
604 for (
unsigned int ros = 0;
ros < npar; ++
ros) {
609 sSum <<
"Total number of bad channels/ADC: " << totchn <<
"/" << totadc << std::endl;
610 sSum <<
"Bad channels/ADC in LBA : " << bchn[0] <<
"/" << badc[0] << std::endl;
611 sSum <<
"Bad channels/ADC in LBC : " << bchn[1] <<
"/" << badc[1] << std::endl;
612 sSum <<
"Bad channels/ADC in EBA : " << bchn[2] <<
"/" << badc[2] << std::endl;
613 sSum <<
"Bad channels/ADC in EBC : " << bchn[3] <<
"/" << badc[3] << std::endl;
616 for (
const std::string&
s : vmod)
617 sSum <<
s << std::endl;
623 std::ofstream fcout(
"tileBadChannelsAdcs.txt");
624 fcout << sSum.str() << std::endl;
625 fcout << sDet.str() << std::endl;
636 float seta = elem->
eta() - 0.5 * (elem->
deta() -
step);
637 for (
int e = 0;
e < nstep;
e++)
654 std::ostringstream sSum;
655 std::ostringstream sDet;
658 sDet <<
">>>>>>>>>>>>>>> Detailed list of BAD Cells <<<<<<<<<<<<<<<<" << std::endl;
659 sDet <<
"tower 0-15: numbered by pseudorapidity from 0 with 0.1 increment in eta" << std::endl;
661 int badcell_N = (
run2) ? 0 : 4;
666 int badcell_GapA = 0;
667 int badcell_GapC = (
run2) ? 0 : 4;
672 const EventContext &ctx = Gaudi::Hive::currentContext();
676 for (
int i = 0;
i < ncells; ++
i) {
699 if (ch1_status.
isBad() && ch2_status.
isBad()) {
744 sDet <<
"sampling A";
750 sDet <<
"sampling BC";
752 sDet <<
"sampling B";
757 sDet <<
"sampling D";
762 sDet <<
"gap and crack scintillators";
767 sDet <<
"individual tiles, used for Cesium calibration";
773 sDet <<
", eta x phi = " << elem->
eta()
774 <<
" x " << elem->
phi()
775 <<
", channels: " << ich1 <<
", " << ich2 << std::endl;
782 sDet <<
"!!! Four cells in GapC are also bad but not listed above: EBC04 ch 1, EBC35 ch 0, EBC54 ch 1, and EBC61 ch 1 " << std::endl;
787 float fncells =
static_cast<float>(ncells);
791 fncells = fncells - 2;
795 sSum <<
">>>>>>>>>>>>>>> Tilecal BAD Cells Summary <<<<<<<<<<<<<<<<" << std::endl;
796 sSum <<
"Total number of cells including MBTS: " << fncells << std::endl;
797 sSum <<
"Total number of bad cells: " << badcell_N
798 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_N) / fncells <<
" %)" << std::endl;
800 sSum <<
"Bad cells in LBA(+cell D0): " << badcell_LBA
801 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_LBA) / fncells <<
" %)" << std::endl;
803 sSum <<
"Bad cells in LBC: " << badcell_LBC
804 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_LBC) / fncells <<
" %)" << std::endl;
806 sSum <<
"Bad cells in EBA: " << badcell_EBA
807 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_EBA) / fncells <<
" %)" << std::endl;
809 sSum <<
"Bad cells in EBC: " << badcell_EBC
810 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_EBC) / fncells <<
" %)" << std::endl;
812 sSum <<
"Bad cells in Gap A(ITC+E1-4): " << badcell_GapA
813 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_GapA) / fncells <<
" %)" << std::endl;
815 sSum <<
"Bad cells in Gap C(ITC+E1-4): " << badcell_GapC
816 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_GapC) / fncells <<
" %)" << std::endl;
821 std::ofstream fcout(
"tileBadCells.txt");
822 fcout << sSum.str() << std::endl;
823 fcout << sDet.str() << std::endl;
832 float thr_low_value = -999.;
833 float thr_high_value = -999.;
840 ATH_MSG_INFO(
" Cell_ID, Threshold detector(TileCal=5)/section/side/module/tower/sampling" );
842 for (
int i = 0;
i < ncells; ++
i) {
851 <<
" Threshold low/high " << thr_low_value <<
" " << thr_high_value
865 unsigned int gain = 0;
873 const EventContext &ctx = Gaudi::Hive::currentContext();
876 int phase_step =
round(
static_cast<double>(Phamax - Phamin) / (std::abs(NPhases) - 1));
879 <<
" nPhases " << NPhases
880 <<
" nFields " << NFields
898 msg(MSG::INFO) <<
"OFC A";
900 msg(MSG::INFO) <<
" " << weights.
w_a[
i];
903 msg(MSG::INFO) <<
"OFC B";
905 msg(MSG::INFO) <<
" " << weights.
w_b[
i];
908 msg(MSG::INFO) <<
"OFC C";
910 msg(MSG::INFO) <<
" " << weights.
w_c[
i];
913 msg(MSG::INFO) <<
"OFC G";
915 msg(MSG::INFO) <<
" " << weights.
g[
i];
919 msg(MSG::INFO) <<
"OFC DG";
921 msg(MSG::INFO) <<
" " << weights.
dg[
i];
936 return StatusCode::SUCCESS;