13 #include "CaloDetDescr/CaloDetDescrElement.h"
34 , m_thistSvc(
"THistSvc",
name)
37 , m_h_badCellA(nullptr)
38 , m_h_badCellBC(nullptr)
39 , m_h_badCellD(nullptr)
40 , m_h_badCellGap(nullptr)
41 , m_h_badCell(nullptr)
127 m_h_badCellA =
new TH2F(
"m_h_badCellA",
"Etaphi_maskedCell A", 34, -1.7, 1.7, 64, -3.2, 3.2);
128 m_h_badCellBC =
new TH2F(
"m_h_badCellBC",
"Etaphi_maskedCell BC", 34, -1.7, 1.7, 64, -3.2, 3.2);
129 m_h_badCellD =
new TH2F(
"m_h_badCellD",
"Etaphi_maskedCell D", 34, -1.7, 1.7, 64, -3.2, 3.2);
130 m_h_badCellGap =
new TH2F(
"m_h_badCellGap",
"Etaphi_maskedCell Gap", 34, -1.7, 1.7, 64, -3.2, 3.2);
131 m_h_badCell =
new TH2F(
"m_h_badCell",
"Etaphi_maskedCell All", 34, -1.7, 1.7, 64, -3.2, 3.2);
139 return StatusCode::SUCCESS;
178 return StatusCode::SUCCESS;
193 msg(MSG::INFO) <<
ros <<
"/" << std::setw(2)
194 <<
drawer <<
"/" << std::setw(2)
196 <<
adc <<
" : " << std::fixed << std::right << std::setw(9) << std::setprecision(5)
198 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
200 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
202 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
208 msg(MSG::INFO) << std::fixed << std::right << std::setw(9) << std::setprecision(5)
209 << chanCalMeV <<
" (total)";
213 msg(MSG::INFO) << std::fixed << std::right << std::setw(9) << std::setprecision(5)
216 <<
" (onlMev->oflADC)";
229 ATH_MSG_INFO(
"Performing an energy scan to test CIS LUT" );
231 unsigned int ros = 1;
235 for (
int adcCounts = 0; adcCounts <=
m_i_ADCmax; ++adcCounts) {
236 double energy =
static_cast<float>(adcCounts);
238 <<
"ADC counts = " << adcCounts
259 msg(MSG::INFO) <<
ros <<
"/" << std::setw(2) <<
drawer <<
"/" << std::setw(2) <<
channel <<
"/" <<
adc <<
" : "
260 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
262 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
264 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
266 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
271 msg(MSG::INFO) << std::fixed << std::right << std::setw(9) << std::setprecision(5)
272 << chanCalMeV <<
" (total)";
295 msg(MSG::INFO) <<
ros <<
"/" << std::setw(2)
296 <<
drawer <<
"/" << std::setw(2)
299 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
301 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
303 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
305 << std::fixed << std::right << std::setw(9) << std::setprecision(5)
326 for (
unsigned int adc = 0;
adc < 6; ++
adc) {
353 const EventContext &ctx = Gaudi::Hive::currentContext();
355 std::vector<float> vecAutoCr;
368 msg(MSG::INFO) <<
ros <<
"/"
377 for (
unsigned int i = 0;
i < vecAutoCr.size(); ++
i) {
378 msg(MSG::INFO) << vecAutoCr[
i] <<
" ";
394 const EventContext &ctx = Gaudi::Hive::currentContext();
396 std::vector<float> vecAutoCr;
428 ATH_MSG_INFO(
"Athena Online mode detected: only channel offset available." );
475 unsigned int ros = 0;
484 float startpoint = -100.0;
485 float endpoint = 150.0;
487 const EventContext &ctx = Gaudi::Hive::currentContext();
494 for (
unsigned int point = 0; point < npoint; ++point) {
499 <<
drawer <<
"/" << std::setw(2)
502 <<
"Time, Y, DY: " << std::fixed << std::right << std::setw(9) << std::setprecision(6) <<
time
503 <<
" " << std::fixed << std::right << std::setw(11) << std::setprecision(8) <<
y
504 <<
" " << std::fixed << std::right << std::setw(11) << std::setprecision(8) <<
dy );
518 std::vector<std::string> vmod;
520 std::ostringstream sSum;
521 std::ostringstream sDet;
524 const unsigned int npar = 4;
525 unsigned int bchn[npar];
526 unsigned int badc[npar];
527 for (
unsigned int ros = 0;
ros < npar; ++
ros) {
533 sDet <<
">>>>>>>>>>>>>>> Detailed list of BAD Channels/ADCs <<<<<<<<<<<<<<<<" << std::endl;
539 unsigned int badadc = 0;
540 unsigned int badchn = 0;
546 if (
status.isAffected()) {
550 <<
"has at least one problem: " <<
status.getString() << std::endl;
559 <<
"has at least one problem: " <<
status.getString() << std::endl;
566 <<
"/ch" <<
channel <<
"/" <<
adc <<
" : " <<
status.getString() << std::endl;
574 <<
"/ch" <<
channel <<
"/" <<
adc <<
" : " <<
status.getString() << std::endl;
582 std::ostringstream myStream;
584 vmod.push_back(myStream.str());
594 sSum <<
">>> Summary of BAD channels/ADCs per drawer (in LBA, LBC, EBA, EBC) <<<<" << std::endl;
596 sSum <<
"There are no bad ADCs in LBA, LBC, EBA and EBC" << std::endl;
598 unsigned int totchn = 0;
599 unsigned int totadc = 0;
601 for (
unsigned int ros = 0;
ros < npar; ++
ros) {
606 sSum <<
"Total number of bad channels/ADC: " << totchn <<
"/" << totadc << std::endl;
607 sSum <<
"Bad channels/ADC in LBA : " << bchn[0] <<
"/" << badc[0] << std::endl;
608 sSum <<
"Bad channels/ADC in LBC : " << bchn[1] <<
"/" << badc[1] << std::endl;
609 sSum <<
"Bad channels/ADC in EBA : " << bchn[2] <<
"/" << badc[2] << std::endl;
610 sSum <<
"Bad channels/ADC in EBC : " << bchn[3] <<
"/" << badc[3] << std::endl;
613 for (
const std::string&
s : vmod)
614 sSum <<
s << std::endl;
620 std::ofstream fcout(
"tileBadChannelsAdcs.txt");
621 fcout << sSum.str() << std::endl;
622 fcout << sDet.str() << std::endl;
633 float seta = elem->
eta() - 0.5 * (elem->
deta() -
step);
634 for (
int e = 0;
e < nstep;
e++)
651 std::ostringstream sSum;
652 std::ostringstream sDet;
655 sDet <<
">>>>>>>>>>>>>>> Detailed list of BAD Cells <<<<<<<<<<<<<<<<" << std::endl;
656 sDet <<
"tower 0-15: numbered by pseudorapidity from 0 with 0.1 increment in eta" << std::endl;
658 int badcell_N = (
run2) ? 0 : 4;
663 int badcell_GapA = 0;
664 int badcell_GapC = (
run2) ? 0 : 4;
669 const EventContext &ctx = Gaudi::Hive::currentContext();
673 for (
int i = 0;
i < ncells; ++
i) {
696 if (ch1_status.
isBad() && ch2_status.
isBad()) {
741 sDet <<
"sampling A";
747 sDet <<
"sampling BC";
749 sDet <<
"sampling B";
754 sDet <<
"sampling D";
759 sDet <<
"gap and crack scintillators";
764 sDet <<
"individual tiles, used for Cesium calibration";
770 sDet <<
", eta x phi = " << elem->
eta()
771 <<
" x " << elem->
phi()
772 <<
", channels: " << ich1 <<
", " << ich2 << std::endl;
779 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;
784 float fncells =
static_cast<float>(ncells);
788 fncells = fncells - 2;
792 sSum <<
">>>>>>>>>>>>>>> Tilecal BAD Cells Summary <<<<<<<<<<<<<<<<" << std::endl;
793 sSum <<
"Total number of cells including MBTS: " << fncells << std::endl;
794 sSum <<
"Total number of bad cells: " << badcell_N
795 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_N) / fncells <<
" %)" << std::endl;
797 sSum <<
"Bad cells in LBA(+cell D0): " << badcell_LBA
798 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_LBA) / fncells <<
" %)" << std::endl;
800 sSum <<
"Bad cells in LBC: " << badcell_LBC
801 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_LBC) / fncells <<
" %)" << std::endl;
803 sSum <<
"Bad cells in EBA: " << badcell_EBA
804 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_EBA) / fncells <<
" %)" << std::endl;
806 sSum <<
"Bad cells in EBC: " << badcell_EBC
807 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_EBC) / fncells <<
" %)" << std::endl;
809 sSum <<
"Bad cells in Gap A(ITC+E1-4): " << badcell_GapA
810 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_GapA) / fncells <<
" %)" << std::endl;
812 sSum <<
"Bad cells in Gap C(ITC+E1-4): " << badcell_GapC
813 <<
" (" << std::setprecision(4) << 100 *
static_cast<float>(badcell_GapC) / fncells <<
" %)" << std::endl;
818 std::ofstream fcout(
"tileBadCells.txt");
819 fcout << sSum.str() << std::endl;
820 fcout << sDet.str() << std::endl;
829 float thr_low_value = -999.;
830 float thr_high_value = -999.;
837 ATH_MSG_INFO(
" Cell_ID, Threshold detector(TileCal=5)/section/side/module/tower/sampling" );
839 for (
int i = 0;
i < ncells; ++
i) {
848 <<
" Threshold low/high " << thr_low_value <<
" " << thr_high_value
862 unsigned int gain = 0;
870 const EventContext &ctx = Gaudi::Hive::currentContext();
873 int phase_step =
round(
static_cast<double>(Phamax - Phamin) / (std::abs(NPhases) - 1));
876 <<
" nPhases " << NPhases
877 <<
" nFields " << NFields
895 msg(MSG::INFO) <<
"OFC A";
900 msg(MSG::INFO) <<
"OFC B";
905 msg(MSG::INFO) <<
"OFC C";
910 msg(MSG::INFO) <<
"OFC G";
916 msg(MSG::INFO) <<
"OFC DG";
933 return StatusCode::SUCCESS;