ATLAS Offline Software
CalibFrontEndInfo.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //***********************************************************************************************
6 // CalibFrontEndInfo - Class to store the calibration information
7 // ---------------------------------------
8 // begin : 01 11 2023
9 // email : sergi.rodriguez@cern.ch
10 //***********************************************************************************************
11 
12 #include "CalibFrontEndInfo.h"
13 
14 std::stringstream CalibFrontEndInfo::printDBformat() const {
15 
16  std::stringstream mytext;
17 
18  if(m_FEid == 0) mytext << m_MODid_str << " " << m_MODid << "\n";
19 
20  if(m_NormalFitParams.size() == 3 && m_LongFitParams.size() == 3 && m_SigFitParams.size() == 2){
21  mytext << "I" << m_FEid
22  << " " << m_NormalThreshold << " " << m_NormalRms << " " << m_NormalNoise << " " << m_NormalIntime
23  << " " << m_LongThreshold << " " << m_LongRms << " " << m_LongNoise << " " << m_LongIntime
24  << " " << m_GangedThreshold << " " << m_GangedRms << " " << m_GangedNoise << " " << m_GangedIntime
25 
26  << " " << m_NormalFitParams.at(0) << " " << m_NormalFitParams.at(1) << " " << m_NormalFitParams.at(2)
27  << " " << m_LongFitParams.at(0) << " " << m_LongFitParams.at(1) << " " << m_LongFitParams.at(2)
28  << " " << m_SigFitParams.at(0) << " " << m_SigFitParams.at(1) ;
29  }
30  else{
31  printf( " ERROR - Is the module disabled for TOT Scan? - m_NormalFitParams.size = %2zu , m_LongFitParams.size = %2zu, m_SigFitParams.size = %2zu \n",m_NormalFitParams.size() ,m_LongFitParams.size(),m_SigFitParams.size());
32  mytext << "I" << m_FEid
33  << " " << m_NormalThreshold << " " << m_NormalRms << " " << m_NormalNoise << " " << m_NormalIntime
34  << " " << m_LongThreshold << " " << m_LongRms << " " << m_LongNoise << " " << m_LongIntime
35  << " " << m_GangedThreshold << " " << m_GangedRms << " " << m_GangedNoise << " " << m_GangedIntime
36 
37  << " " << 0 << " " << 0 << " " << 0
38  << " " << 0 << " " << 0 << " " << 0
39  << " " << 0 << " " << 0 ;
40  }
41 
42 
43 
44 
45  return mytext;
46 
47 };
48 
50 
51  if(m_FEid == 0) printf("ROD: %s -> MOD: %s\n",m_RODid_str.c_str(),m_MODid_str.c_str());
52  printf("I%02d | %4d %3d %3d %4d | %4d %3d %3d %4d | %4d %3d %3d %4d | %11.4e %11.4e %11.4e (%6.1f/%6.1f) | %11.4e %11.4e %11.4e (%6.1f/%6.1f) | %11.4e %11.4e (%6.1f/%6.1f) ---> %d\n",
53 
54  m_FEid,
55 
59 
62 
65  );
66  return;
67 };
68 
69 
71 
72  printf("******************************************************************************************************\n");
73  printf("%-6s: %s - %-9s:%5d / %s - %-12s:%3d\n", "ROD ID", m_RODid_str.c_str(), "Module ID", m_MODid,m_MODid_str.c_str(), "Front End ID", m_FEid);
74 
75  printf("-----------------------------------------------------------------------\n");
76  printf("| %-9s | %9s | %9s | %9s | %9s |\n","", "Threshold", " RMS", " Noise", " Intime" );
77  printf("-----------------------------------------------------------------------\n");
78  printf("| %-9s | %9d | %9d | %9d | %9d |\n","Normal", m_NormalThreshold, m_NormalRms, m_NormalNoise, m_NormalIntime);
79  printf("| %-9s | %9d | %9d | %9d | %9d |\n","Long" , m_LongThreshold , m_LongRms , m_LongNoise , m_LongIntime );
80  printf("| %-9s | %9d | %9d | %9d | %9d |\n","Ganged", m_GangedThreshold, m_GangedRms, m_GangedNoise, m_GangedIntime);
81  printf("-----------------------------------------------------------------------\n\n");
82 
83  if(m_NormalFitParams.size() == 3 ) {
84  printf("%-40s: %11.2f / %11.2f / %11.2f\n","Fitting parameters for normal pixel",m_NormalFitParams.at(0),m_NormalFitParams.at(1),m_NormalFitParams.at(2));
85  }
86  else {
87  printf("%-40s: %11s / %11s / %11s\n","Fitting parameters for normal pixel","not set","not set","not set");
88  }
89  if(m_LongFitParams.size() == 3 ) {
90  printf("%-40s: %11.2f / %11.2f / %11.2f\n","Fitting parameters for long pixel",m_LongFitParams.at(0),m_LongFitParams.at(1),m_LongFitParams.at(2));
91  }
92  else {
93  printf("%-40s: %11s / %11s / %11s\n","Fitting parameters for long pixel","not set","not set","not set");
94  }
95  if(m_SigFitParams.size() == 2 ) {
96  printf("%-40s: %11.7f / %.5e\n\n","Fitting parameters for sig (linear fit)",m_SigFitParams.at(0),m_SigFitParams.at(1));
97  }
98  else {
99  printf("%-40s: %11s / %11s\n\n","Fitting parameters for sig (linear fit)","not set","not set");
100  }
101  return;
102 };
103 
104 //Prints the information stored in case of error - needs more implementation.
106 
107  bool error = false;
108 
112  };
113 
114  for(const auto &val : vals) {
115  if(val <= 0) error = true;
116  }
117 
118  if(error) printVals();
119 
120  return;
121 };
122 
123 
124 
CalibFrontEndInfo::printDBformat
std::stringstream printDBformat() const
Definition: CalibFrontEndInfo.cxx:14
CalibFrontEndInfo::m_NormalFitParams
std::vector< float > m_NormalFitParams
Definition: CalibFrontEndInfo.h:120
CalibFrontEndInfo::m_MODid_str
std::string m_MODid_str
Definition: CalibFrontEndInfo.h:97
CalibFrontEndInfo::printVals
void printVals() const
Definition: CalibFrontEndInfo.cxx:70
CalibFrontEndInfo::m_FEid
int m_FEid
Definition: CalibFrontEndInfo.h:101
CalibFrontEndInfo::m_LongFitParams
std::vector< float > m_LongFitParams
Definition: CalibFrontEndInfo.h:121
CalibFrontEndInfo::printBeautyformat
void printBeautyformat() const
Definition: CalibFrontEndInfo.cxx:49
CalibFrontEndInfo.h
CalibFrontEndInfo::m_RODid_str
std::string m_RODid_str
Definition: CalibFrontEndInfo.h:98
CalibFrontEndInfo::m_LongIntime
int m_LongIntime
Definition: CalibFrontEndInfo.h:111
CalibFrontEndInfo::m_LongNoise
int m_LongNoise
Definition: CalibFrontEndInfo.h:110
CalibFrontEndInfo::printMODerr
void printMODerr() const
Definition: CalibFrontEndInfo.cxx:105
CalibFrontEndInfo::m_NormalNoise
int m_NormalNoise
Definition: CalibFrontEndInfo.h:105
CalibFrontEndInfo::m_MODid
int m_MODid
Definition: CalibFrontEndInfo.h:100
CalibFrontEndInfo::m_NormalRms
int m_NormalRms
Definition: CalibFrontEndInfo.h:104
CalibFrontEndInfo::m_SigFitParams
std::vector< float > m_SigFitParams
Definition: CalibFrontEndInfo.h:122
CalibFrontEndInfo::m_SigFitParamsQuality
std::vector< float > m_SigFitParamsQuality
Definition: CalibFrontEndInfo.h:126
CalibFrontEndInfo::m_LongThreshold
int m_LongThreshold
Definition: CalibFrontEndInfo.h:108
CalibFrontEndInfo::m_GangedNoise
int m_GangedNoise
Definition: CalibFrontEndInfo.h:115
CalibFrontEndInfo::m_times_fitted
int m_times_fitted
Definition: CalibFrontEndInfo.h:118
CalibFrontEndInfo::m_GangedIntime
int m_GangedIntime
Definition: CalibFrontEndInfo.h:116
CalibFrontEndInfo::m_GangedRms
int m_GangedRms
Definition: CalibFrontEndInfo.h:114
CalibFrontEndInfo::m_LongRms
int m_LongRms
Definition: CalibFrontEndInfo.h:109
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
CalibFrontEndInfo::m_NormalIntime
int m_NormalIntime
Definition: CalibFrontEndInfo.h:106
CalibFrontEndInfo::m_NormalThreshold
int m_NormalThreshold
Definition: CalibFrontEndInfo.h:103
CalibFrontEndInfo::m_NormalFitParamsQuality
std::vector< float > m_NormalFitParamsQuality
Definition: CalibFrontEndInfo.h:124
error
Definition: IImpactPoint3dEstimator.h:70
CalibFrontEndInfo::m_GangedThreshold
int m_GangedThreshold
Definition: CalibFrontEndInfo.h:113
CalibFrontEndInfo::m_LongFitParamsQuality
std::vector< float > m_LongFitParamsQuality
Definition: CalibFrontEndInfo.h:125
PlotCalibFromCool.vals
vals
Definition: PlotCalibFromCool.py:474