ATLAS Offline Software
PixelModuleConfigCondAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 #include "GaudiKernel/EventIDRange.h"
8 #include <memory>
9 #include <sstream>
10 
12 
13 
14 PixelModuleConfigCondAlg::PixelModuleConfigCondAlg(const std::string& name, ISvcLocator* pSvcLocator):
15  ::AthReentrantAlgorithm(name, pSvcLocator)
16 {
17 }
18 
21  ATH_MSG_DEBUG("PixelModuleConfigCondAlg::initialize()");
22  return m_writeKey.initialize();
23 }
24 
25 StatusCode PixelModuleConfigCondAlg::execute(const EventContext& ctx) const {
26  ATH_MSG_DEBUG("PixelModuleConfigCondAlg::execute()");
27 
29  if (writeHandle.isValid()) {
30  ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid.. In theory this should not be called, but may happen if multiple concurrent events are being processed out of order.");
31  return StatusCode::SUCCESS;
32  }
33 
34  // Construct the output Cond Object and fill it in
35  std::unique_ptr<PixelModuleData> writeCdo(std::make_unique<PixelModuleData>());
36 
37  const EventIDBase start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0,
38  0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
39  const EventIDBase stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1,
40  EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
41 
42  writeCdo -> setDefaultBarrelAnalogThreshold(m_BarrelAnalogThreshold);
43  writeCdo -> setDefaultEndcapAnalogThreshold(m_EndcapAnalogThreshold);
44  writeCdo -> setDefaultBarrelAnalogThresholdSigma(m_BarrelAnalogThresholdSigma);
45  writeCdo -> setDefaultEndcapAnalogThresholdSigma(m_EndcapAnalogThresholdSigma);
46  writeCdo -> setDefaultBarrelAnalogThresholdNoise(m_BarrelAnalogThresholdNoise);
47  writeCdo -> setDefaultEndcapAnalogThresholdNoise(m_EndcapAnalogThresholdNoise);
48  writeCdo -> setDefaultBarrelInTimeThreshold(m_BarrelInTimeThreshold);
49  writeCdo -> setDefaultEndcapInTimeThreshold(m_EndcapInTimeThreshold);
50  writeCdo -> setBarrelThermalNoise(m_BarrelThermalNoise);
51  writeCdo -> setEndcapThermalNoise(m_EndcapThermalNoise);
52 
53  // FEI3-specific parameters... only write if they are set
54  if (!m_FEI3BarrelLatency.empty()) {
55  // Use the above as the check... worth adding checks to see that all FEI3 vectors are non-zero?
56  writeCdo -> setFEI3BarrelLatency(m_FEI3BarrelLatency);
57  writeCdo -> setFEI3BarrelTimingSimTune(m_FEI3BarrelTimingSimTune);
58  writeCdo -> setFEI3EndcapLatency(m_FEI3EndcapLatency);
59  writeCdo -> setFEI3EndcapTimingSimTune(m_FEI3EndcapTimingSimTune);
60  }
61 
62  // DBM-specific parameters... only write if they are set
63  if (!m_DBMToTThreshold.empty()) {
64  writeCdo -> setDefaultDBMAnalogThreshold(m_DBMAnalogThreshold);
65  writeCdo -> setDefaultDBMAnalogThresholdSigma(m_DBMAnalogThresholdSigma);
66  writeCdo -> setDefaultDBMAnalogThresholdNoise(m_DBMAnalogThresholdNoise);
67  writeCdo -> setDefaultDBMInTimeThreshold(m_DBMInTimeThreshold);
68  writeCdo -> setDBMThermalNoise(m_DBMThermalNoise);
69  }
70 
71  // Charge calibration parameters
72  writeCdo -> setDefaultQ2TotA(m_CalibrationParameterA);
73  writeCdo -> setDefaultQ2TotE(m_CalibrationParameterE);
74  writeCdo -> setDefaultQ2TotC(m_CalibrationParameterC);
75 
76  // DCS parameters
77  writeCdo -> setDefaultBiasVoltage(m_biasVoltage);
78 
79 
80  // Cabling parameters
81  writeCdo -> setCablingMapToFile(m_cablingMapToFile);
82  writeCdo -> setCablingMapFileName(m_cablingMapFileName);
83 
84  // mapping files for radiation damage simulation
85  std::vector<std::string> mapsPath_list;
86  std::vector<std::string> mapsPath_list3D;
87 
88  writeCdo -> setBarrelToTThreshold(m_BarrelToTThreshold);
89  writeCdo -> setBarrelCrossTalk(m_BarrelCrossTalk);
90  writeCdo -> setBarrelNoiseOccupancy(m_BarrelNoiseOccupancy);
91  writeCdo -> setBarrelDisableProbability(m_BarrelDisableProbability);
92 
93  writeCdo -> setEndcapToTThreshold(m_EndcapToTThreshold);
94  writeCdo -> setEndcapCrossTalk(m_EndcapCrossTalk);
95  writeCdo -> setEndcapNoiseOccupancy(m_EndcapNoiseOccupancy);
96  writeCdo -> setEndcapDisableProbability(m_EndcapDisableProbability);
97 
99  writeCdo -> setEndcapNoiseShape(std::vector<std::vector<float>>(m_EndcapToTThreshold.size(), m_PixelNoiseShape));
100 
101  // Radiation damage simulation
102  writeCdo -> setFluenceLayer(m_BarrelFluence);
103  for (size_t i=0; i<m_BarrelFluenceMap.size(); i++) {
104  mapsPath_list.push_back(PathResolverFindCalibFile(m_BarrelFluenceMap[i]));
105  }
106 
107  // Radiation damage simulation for 3D sensor
108  writeCdo -> setFluenceLayer3D(m_3DFluence);
109  for (size_t i=0; i<m_3DFluenceMap.size(); i++) {
110  mapsPath_list3D.push_back(PathResolverFindCalibFile(m_3DFluenceMap[i]));
111  }
112 
113  //=======================
114  // Combine time interval
115  //=======================
116  EventIDRange rangeW{start, stop};
117  if (rangeW.stop().isValid() && rangeW.start()>rangeW.stop()) {
118  ATH_MSG_FATAL("Invalid intersection rangeW: " << rangeW);
119  return StatusCode::FAILURE;
120  }
121 
122  if (writeHandle.record(rangeW, std::move(writeCdo)).isFailure()) {
123  ATH_MSG_FATAL("Could not record PixelModuleData " << writeHandle.key() << " with EventRange " << rangeW << " into Conditions Store");
124  return StatusCode::FAILURE;
125  }
126  ATH_MSG_INFO("recorded new CDO " << writeHandle.key() << " with range " << rangeW << " into Conditions Store");
127 
128  return StatusCode::SUCCESS;
129 }
PixelModuleConfigCondAlg::m_BarrelFluenceMap
Gaudi::Property< std::vector< std::string > > m_BarrelFluenceMap
Definition: PixelModuleConfigCondAlg.h:74
PixelModuleConfigCondAlg::m_FEI3EndcapLatency
Gaudi::Property< std::vector< int > > m_FEI3EndcapLatency
Definition: PixelModuleConfigCondAlg.h:189
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
PixelModuleConfigCondAlg::m_cablingMapFileName
Gaudi::Property< std::string > m_cablingMapFileName
Definition: PixelModuleConfigCondAlg.h:250
PixelModuleConfigCondAlg::initialize
virtual StatusCode initialize() override final
Definition: PixelModuleConfigCondAlg.cxx:20
PixelModuleConfigCondAlg::m_EndcapDisableProbability
Gaudi::Property< std::vector< double > > m_EndcapDisableProbability
Definition: PixelModuleConfigCondAlg.h:113
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PixelModuleConfigCondAlg::m_BarrelAnalogThreshold
Gaudi::Property< std::vector< int > > m_BarrelAnalogThreshold
Definition: PixelModuleConfigCondAlg.h:132
PixelModuleConfigCondAlg::m_EndcapThermalNoise
Gaudi::Property< std::vector< double > > m_EndcapThermalNoise
Definition: PixelModuleConfigCondAlg.h:222
PixelModuleConfigCondAlg::m_BarrelAnalogThresholdSigma
Gaudi::Property< std::vector< int > > m_BarrelAnalogThresholdSigma
Definition: PixelModuleConfigCondAlg.h:141
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
PixelModuleFeMask_create_db.stop
int stop
Definition: PixelModuleFeMask_create_db.py:76
PixelModuleConfigCondAlg::PixelModuleConfigCondAlg
PixelModuleConfigCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: PixelModuleConfigCondAlg.cxx:14
SG::WriteCondHandle::record
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Definition: WriteCondHandle.h:157
PixelModuleConfigCondAlg::m_3DFluence
Gaudi::Property< std::vector< double > > m_3DFluence
Definition: PixelModuleConfigCondAlg.h:120
PixelModuleConfigCondAlg::m_DBMAnalogThresholdSigma
Gaudi::Property< std::vector< int > > m_DBMAnalogThresholdSigma
Definition: PixelModuleConfigCondAlg.h:147
PixelModuleConfigCondAlg::m_DBMAnalogThreshold
Gaudi::Property< std::vector< int > > m_DBMAnalogThreshold
Definition: PixelModuleConfigCondAlg.h:138
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
PixelModuleConfigCondAlg::m_cablingMapToFile
Gaudi::Property< bool > m_cablingMapToFile
Definition: PixelModuleConfigCondAlg.h:247
PixelModuleConfigCondAlg::m_BarrelInTimeThreshold
Gaudi::Property< std::vector< int > > m_BarrelInTimeThreshold
Definition: PixelModuleConfigCondAlg.h:159
PixelModuleConfigCondAlg::m_BarrelFluence
Gaudi::Property< std::vector< double > > m_BarrelFluence
Definition: PixelModuleConfigCondAlg.h:71
PixelModuleConfigCondAlg::m_BarrelCrossTalk
Gaudi::Property< std::vector< double > > m_BarrelCrossTalk
Definition: PixelModuleConfigCondAlg.h:78
SG::WriteCondHandle::fullKey
const DataObjID & fullKey() const
Definition: WriteCondHandle.h:41
PixelModuleConfigCondAlg::m_DBMInTimeThreshold
Gaudi::Property< std::vector< int > > m_DBMInTimeThreshold
Definition: PixelModuleConfigCondAlg.h:216
PixelModuleConfigCondAlg::m_InnermostNoiseShape
Gaudi::Property< std::vector< float > > m_InnermostNoiseShape
Definition: PixelModuleConfigCondAlg.h:91
PixelModuleConfigCondAlg.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
PixelModuleConfigCondAlg::m_CalibrationParameterC
Gaudi::Property< float > m_CalibrationParameterC
Definition: PixelModuleConfigCondAlg.h:236
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PixelModuleConfigCondAlg::m_DBMAnalogThresholdNoise
Gaudi::Property< std::vector< int > > m_DBMAnalogThresholdNoise
Definition: PixelModuleConfigCondAlg.h:156
PixelModuleConfigCondAlg::m_BarrelDisableProbability
Gaudi::Property< std::vector< double > > m_BarrelDisableProbability
Definition: PixelModuleConfigCondAlg.h:84
PixelModuleConfigCondAlg::m_EndcapAnalogThresholdNoise
Gaudi::Property< std::vector< int > > m_EndcapAnalogThresholdNoise
Definition: PixelModuleConfigCondAlg.h:153
PixelModuleConfigCondAlg::m_FEI3EndcapTimingSimTune
Gaudi::Property< std::vector< int > > m_FEI3EndcapTimingSimTune
Definition: PixelModuleConfigCondAlg.h:198
PixelModuleConfigCondAlg::m_BarrelNoiseOccupancy
Gaudi::Property< std::vector< double > > m_BarrelNoiseOccupancy
Definition: PixelModuleConfigCondAlg.h:81
PixelModuleConfigCondAlg::m_EndcapNoiseOccupancy
Gaudi::Property< std::vector< double > > m_EndcapNoiseOccupancy
Definition: PixelModuleConfigCondAlg.h:110
PixelModuleConfigCondAlg::m_NextInnermostNoiseShape
Gaudi::Property< std::vector< float > > m_NextInnermostNoiseShape
Definition: PixelModuleConfigCondAlg.h:94
PathResolver.h
PixelModuleConfigCondAlg::m_CalibrationParameterA
Gaudi::Property< float > m_CalibrationParameterA
Definition: PixelModuleConfigCondAlg.h:230
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
PixelModuleConfigCondAlg::m_FEI3BarrelTimingSimTune
Gaudi::Property< std::vector< int > > m_FEI3BarrelTimingSimTune
Definition: PixelModuleConfigCondAlg.h:186
SG::WriteCondHandle::key
const std::string & key() const
Definition: WriteCondHandle.h:40
PixelModuleConfigCondAlg::m_biasVoltage
Gaudi::Property< float > m_biasVoltage
Definition: PixelModuleConfigCondAlg.h:240
IdentifierHash.h
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
PixelModuleConfigCondAlg::m_EndcapToTThreshold
Gaudi::Property< std::vector< int > > m_EndcapToTThreshold
Definition: PixelModuleConfigCondAlg.h:101
PathResolverFindCalibFile
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
Definition: PathResolver.cxx:431
PixelModuleConfigCondAlg::m_EndcapCrossTalk
Gaudi::Property< std::vector< double > > m_EndcapCrossTalk
Definition: PixelModuleConfigCondAlg.h:107
PixelModuleConfigCondAlg::m_BarrelToTThreshold
Gaudi::Property< std::vector< int > > m_BarrelToTThreshold
Definition: PixelModuleConfigCondAlg.h:65
SG::WriteCondHandle::isValid
bool isValid() const
Definition: WriteCondHandle.h:248
PixelModuleConfigCondAlg::m_BarrelAnalogThresholdNoise
Gaudi::Property< std::vector< int > > m_BarrelAnalogThresholdNoise
Definition: PixelModuleConfigCondAlg.h:150
PixelModuleConfigCondAlg::m_DBMToTThreshold
Gaudi::Property< std::vector< int > > m_DBMToTThreshold
Definition: PixelModuleConfigCondAlg.h:201
PixelModuleConfigCondAlg::m_EndcapInTimeThreshold
Gaudi::Property< std::vector< int > > m_EndcapInTimeThreshold
Definition: PixelModuleConfigCondAlg.h:162
PixelModuleConfigCondAlg::m_PixelNoiseShape
Gaudi::Property< std::vector< float > > m_PixelNoiseShape
Definition: PixelModuleConfigCondAlg.h:97
PixelModuleConfigCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: PixelModuleConfigCondAlg.cxx:25
PixelModuleConfigCondAlg::m_EndcapAnalogThreshold
Gaudi::Property< std::vector< int > > m_EndcapAnalogThreshold
Definition: PixelModuleConfigCondAlg.h:135
PixelModuleConfigCondAlg::m_DBMThermalNoise
Gaudi::Property< std::vector< double > > m_DBMThermalNoise
Definition: PixelModuleConfigCondAlg.h:225
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
PixelModuleConfigCondAlg::m_writeKey
SG::WriteCondHandleKey< PixelModuleData > m_writeKey
Definition: PixelModuleConfigCondAlg.h:31
PixelModuleConfigCondAlg::m_FEI3BarrelLatency
Gaudi::Property< std::vector< int > > m_FEI3BarrelLatency
Definition: PixelModuleConfigCondAlg.h:177
PixelModuleConfigCondAlg::m_BarrelThermalNoise
Gaudi::Property< std::vector< double > > m_BarrelThermalNoise
Definition: PixelModuleConfigCondAlg.h:219
PixelModuleConfigCondAlg::m_CalibrationParameterE
Gaudi::Property< float > m_CalibrationParameterE
Definition: PixelModuleConfigCondAlg.h:233
PixelModuleConfigCondAlg::m_EndcapAnalogThresholdSigma
Gaudi::Property< std::vector< int > > m_EndcapAnalogThresholdSigma
Definition: PixelModuleConfigCondAlg.h:144
PixelModuleConfigCondAlg::m_3DFluenceMap
Gaudi::Property< std::vector< std::string > > m_3DFluenceMap
Definition: PixelModuleConfigCondAlg.h:123