27 uint64_t maxRunNr = 1000000;
28 if (timestamp < maxRunNr) {
29 LOG(info) <<
"assuming input is run " << timestamp <<
" will convert it to timstamp";
30 auto [sor, eor] = ccdbMgr.getRunDuration(timestamp);
31 uint64_t sixtySec = 60000;
32 timestamp = eor - sixtySec;
33 LOG(info) <<
"set timestamp to " << timestamp;
37 std::map<std::string, std::string> metadata;
43 std::map<unsigned short, float> mapSMTemperature;
44 for (
unsigned short i = 0;
i < mNCells; ++
i) {
46 if (mapSMTemperature.count(iSM) == 0) {
49 float corrFac =
params->getTempCalibParamA0(
i) +
params->getTempCalibParamSlope(
i) * mapSMTemperature[iSM];
50 mGainCalibFactors[
i] = corrFac;
56 if (iSM < 0 || iSM > 20) {
57 LOG(error) <<
"SM " << iSM <<
"does not exist!";
63 std::vector<float> vecTemperature;
64 for (
const auto& iSensor : vecSensorID) {
66 if (temp < mAcceptedTempRange[0] || temp > mAcceptedTempRange[1]) {
69 vecTemperature.push_back(temp);
72 const unsigned int nEntries = vecTemperature.size();
74 LOG(warning) <<
"No sensor data between " << mAcceptedTempRange[0] <<
" and " << mAcceptedTempRange[1] <<
"degree found... for SM " << iSM <<
" Setting to default 20 degree";
81 std::sort(vecTemperature.begin(), vecTemperature.end());
82 if (nEntries % 2 == 0) {
84 tempSM = (vecTemperature[nEntries / 2 - 1] + vecTemperature[nEntries / 2]) / 2.0;
87 tempSM = vecTemperature[nEntries / 2];
90 float sum = std::accumulate(vecTemperature.begin(), vecTemperature.end(), 0.0);
91 tempSM =
sum / vecTemperature.size();
107 unsigned short nSensors = 8;
108 if (iSM == 10 || iSM == 11 || iSM == 18 || iSM == 19) {
112 std::vector<unsigned short> vecSensorID;
113 for (
unsigned short iELMBSensor = iSM * 8; iELMBSensor < iSM * 8 + nSensors; iELMBSensor++) {
114 vecSensorID.push_back(iELMBSensor);