ATLAS Offline Software
LArReadParamsFromFile.h
Go to the documentation of this file.
1 //Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 
16 #ifndef LARREADPARAMSFROMFILE_H
17 #define LARREADPARAMSFROMFILE_H
19 //#include "GaudiKernel/SmartDataPtr.h"
21 
22 #include <fstream>
23 #include <stdio.h>
24 #include <string>
25 
27 
28 #include "GaudiKernel/Bootstrap.h"
29 #include "GaudiKernel/ISvcLocator.h"
30 #include "GaudiKernel/IToolSvc.h"
31 
37 //using namespace LArParamsProperties ;
38 
39 template <class DATA>
41 {
42  public:
43  LArReadParamsFromFile(const std::string & name, ISvcLocator * pSvcLocator);
45 
46  //standard algorithm methods
47  virtual StatusCode initialize() override;
48  virtual StatusCode execute() override {return StatusCode::SUCCESS;}
49  virtual StatusCode stop ATLAS_NOT_THREAD_SAFE () override;
50 
51  private:
53  const LArEM_ID* m_emId;
56  SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
57  // LArConditionsContainerBase::GroupingType m_groupingType ;
59  std::string m_groupingName ;
60 
61  std::string m_file ;
63  std::string m_chIdType ;
64  std::string m_customKey;
65 
66  DATA * m_dataclass ;
67 
69 
70  // define 'set' method for each foreseen data class:
71  //---------------------------------------------------
72 
73  StatusCode set(LArCaliPulseParamsComplete* complete, HWIdentifier chid, int gain, const std::vector<float>& data) {
74  complete->set(chid, gain, data[0], data[1], data[2], data[3], (short)data[4]) ;
75  return StatusCode::SUCCESS ;
76  } ;
77  StatusCode set(LArDetCellParamsComplete* complete, HWIdentifier chid, int gain, const std::vector<float>& data) {
78  complete->set(chid, gain, data[0], data[1]) ;
79  return StatusCode::SUCCESS ;
80  } ;
81  StatusCode set(LArPhysCaliTdiffComplete* complete, HWIdentifier chid, int gain, const std::vector<float>& data) {
82  complete->set(chid, gain, data[0]) ;
83  return StatusCode::SUCCESS ;
84  } ;
85  StatusCode set(LArTdriftComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
86  complete->set(chid, data[0]) ;
87  return StatusCode::SUCCESS ;
88  } ;
89  StatusCode set(LArMphysOverMcalComplete* complete, HWIdentifier chid, int gain, const std::vector<float>& data) {
90  complete->set(chid, gain, data[0]) ;
91  return StatusCode::SUCCESS ;
92  } ;
93  StatusCode set(LArRinjComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
94  complete->set(chid, data[0]) ;
95  return StatusCode::SUCCESS ;
96  } ;
97  StatusCode set(LArTshaperComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
98  complete->set(chid, data[0]) ;
99  return StatusCode::SUCCESS ;
100  } ;
101  StatusCode set(LArEMEC_CphiComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
102  complete->set(chid, data[0]) ;
103  return StatusCode::SUCCESS ;
104  } ;
105  StatusCode set(LArEMEC_HValphaComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
106  complete->set(chid, data[0]) ;
107  return StatusCode::SUCCESS ;
108  } ;
109  StatusCode set(LArEMEC_HVbetaComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
110  complete->set(chid, data[0]) ;
111  return StatusCode::SUCCESS ;
112  } ;
113  StatusCode set(LArCableLengthComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
114  complete->set(chid, data[0]) ;
115  return StatusCode::SUCCESS ;
116  } ;
117  StatusCode set(LArCableAttenuationComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
118  complete->set(chid, data[0]) ;
119  return StatusCode::SUCCESS ;
120  } ;
121 
122  //StatusCode set(LArCaliPulseParamsVsCalib* calib, HWIdentifier chid, int /*gain*/, std::vector<float> data) {
123  // calib->set(chid, data[0], data[1], data[2], data[3], (short)data[4]) ;
124  // return StatusCode::SUCCESS ;
125  //`} ;
126 
127  // define symLink for all classes
128  //--------------------------------
129 
133  StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArTdriftComplete* data) { return detStore()->symLink(data,(ILArTdrift*)data).ignore() ; } ;
135  StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArRinjComplete* data) { return detStore()->symLink(data,(ILArRinj*)data).ignore() ; } ;
136  StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArTshaperComplete* data) { return detStore()->symLink(data,(ILArTshaper*)data).ignore() ; } ;
142 // StatusCode do_symLink(const LArCaliPulseParamsVsCalib* data) { return detStore()->symLink(data,(ILArCaliPulseParams*)data).ignore() ; };
143 
144 };
145 
147 
148 #endif
ILArEMEC_Cphi
Definition: ILArEMEC_Cphi.h:14
LArMphysOverMcalComplete::set
void set(const HWIdentifier &CellID, int gain, float vMphysOverMcal)
Definition: LArMphysOverMcalComplete.cxx:14
ILArEMEC_HVbeta
Definition: ILArEMEC_HVbeta.h:13
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
LArEMEC_CphiComplete
This class implements the ILArEMEC_Cphi interface.
Definition: LArEMEC_CphiComplete.h:28
LArReadParamsFromFile.icc
LArEM_ID.h
LArReadParamsFromFile::set
StatusCode set(LArTdriftComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
Definition: LArReadParamsFromFile.h:85
LArTdriftComplete
This class implements the ILArTdrift interface.
Definition: LArTdriftComplete.h:23
LArReadParamsFromFile::m_useCalibLines
bool m_useCalibLines
Definition: LArReadParamsFromFile.h:62
LArReadParamsFromFile::set
StatusCode set(LArRinjComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
Definition: LArReadParamsFromFile.h:93
LArReadParamsFromFile::set
StatusCode set(LArCableAttenuationComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
Definition: LArReadParamsFromFile.h:117
LArReadParamsFromFile::ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArTshaperComplete *data)
Definition: LArReadParamsFromFile.h:136
ILArEMEC_HValpha
Definition: ILArEMEC_HValpha.h:13
LArDetCellParamsComplete::set
void set(const HWIdentifier &CellID, int gain, float omega0, float taur)
Definition: LArDetCellParamsComplete.cxx:12
LArReadParamsFromFile::ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArMphysOverMcalComplete *data)
Definition: LArReadParamsFromFile.h:134
LArReadParamsFromFile::~LArReadParamsFromFile
~LArReadParamsFromFile()
ILArDetCellParams
Definition: ILArDetCellParams.h:13
LArReadParamsFromFile::m_fcalId
const LArFCAL_ID * m_fcalId
Definition: LArReadParamsFromFile.h:55
LArReadParamsFromFile
This algorithm reads an ascii file and fill a paremeters structure into the detector store.
Definition: LArReadParamsFromFile.h:41
LArReadParamsFromFile::m_file
std::string m_file
Definition: LArReadParamsFromFile.h:61
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArReadParamsFromFile::set
StatusCode set(LArCaliPulseParamsComplete *complete, HWIdentifier chid, int gain, const std::vector< float > &data)
Definition: LArReadParamsFromFile.h:73
LArHEC_ID
Helper class for LArHEC offline identifiers.
Definition: LArHEC_ID.h:85
PixelModuleFeMask_create_db.stop
int stop
Definition: PixelModuleFeMask_create_db.py:76
LArHEC_ID.h
HWIdentifier
Definition: HWIdentifier.h:13
LArReadParamsFromFile::m_emId
const LArEM_ID * m_emId
Definition: LArReadParamsFromFile.h:53
LArReadParamsFromFile::ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArTdriftComplete *data)
Definition: LArReadParamsFromFile.h:133
LArCableLengthComplete
This class implements the ILArCableLength interface.
Definition: LArCableLengthComplete.h:26
LArEMEC_HValphaComplete::set
void set(const HWIdentifier &CellID, float vEMEC_HValpha)
Definition: LArEMEC_HValphaComplete.cxx:24
LArReadParamsFromFile::ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArCaliPulseParamsComplete *data)
Definition: LArReadParamsFromFile.h:130
CaloCell_ID.h
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
LArEMEC_CphiComplete::set
void set(const HWIdentifier &CellID, float vEMEC_Cphi)
Definition: LArEMEC_CphiComplete.cxx:24
LArReadParamsFromFile::readFile
StatusCode readFile()
LArRinjComplete
This class implements the ILArRinj interface.
Definition: LArRinjComplete.h:26
AthAlgorithm.h
ILArTdrift
Definition: ILArTdrift.h:12
LArCableLengthComplete::set
void set(const HWIdentifier &CellID, float vCableLength)
Definition: LArCableLengthComplete.cxx:13
LArReadParamsFromFile::ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArRinjComplete *data)
Definition: LArReadParamsFromFile.h:135
LArReadParamsFromFile::set
StatusCode set(LArEMEC_HValphaComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
Definition: LArReadParamsFromFile.h:105
LArReadParamsFromFile::m_dataclass
DATA * m_dataclass
Definition: LArReadParamsFromFile.h:66
LArReadParamsFromFile::m_chIdType
std::string m_chIdType
Definition: LArReadParamsFromFile.h:63
ILArRinj
Definition: ILArRinj.h:12
LArReadParamsFromFile::m_groupingType
int m_groupingType
Definition: LArReadParamsFromFile.h:58
LArReadParamsFromFile::ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArEMEC_HVbetaComplete *data)
Definition: LArReadParamsFromFile.h:139
LArOnOffIdMapping.h
LArMphysOverMcalComplete
This class implements the ILArMphysOverMcal interface.
Definition: LArMphysOverMcalComplete.h:29
LArReadParamsFromFile::ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArDetCellParamsComplete *data)
Definition: LArReadParamsFromFile.h:131
LArTdriftComplete::set
void set(const HWIdentifier &CellID, float tdrift)
Definition: LArTdriftComplete.cxx:14
LArPhysCaliTdiffComplete
This class implements the ILArPhysCaliTdiff interface ` *.
Definition: LArPhysCaliTdiffComplete.h:22
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArReadParamsFromFile::m_customKey
std::string m_customKey
Definition: LArReadParamsFromFile.h:64
LArReadParamsFromFile::ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArEMEC_HValphaComplete *data)
Definition: LArReadParamsFromFile.h:138
LArEMEC_HVbetaComplete
This class implements the ILArEMEC_HVbeta interface.
Definition: LArEMEC_HVbetaComplete.h:28
LArEMEC_HVbetaComplete::set
void set(const HWIdentifier &CellID, float vEMEC_HVbeta)
Definition: LArEMEC_HVbetaComplete.cxx:24
LArReadParamsFromFile::m_useOfflineIdentifier
bool m_useOfflineIdentifier
Definition: LArReadParamsFromFile.h:62
LArEMEC_HValphaComplete
This class implements the ILArEMEC_HValpha interface.
Definition: LArEMEC_HValphaComplete.h:28
LArCableAttenuationComplete
This class implements the ILArCableAttenuation interface.
Definition: LArCableAttenuationComplete.h:26
ILArCableLength
Definition: ILArCableLength.h:13
LArCaliPulseParamsComplete
This class implements the ILArCaliPulseParams interface.
Definition: LArCaliPulseParamsComplete.h:27
AthAlgorithm
Definition: AthAlgorithm.h:47
LArReadParamsFromFile::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArReadParamsFromFile.h:56
ILArTshaper
Definition: ILArTshaper.h:12
LArReadParamsFromFile::ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArPhysCaliTdiffComplete *data)
Definition: LArReadParamsFromFile.h:132
LArReadParamsFromFile::ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArCableLengthComplete *data)
Definition: LArReadParamsFromFile.h:140
LArReadParamsFromFile::initialize
virtual StatusCode initialize() override
ILArMphysOverMcal
Definition: ILArMphysOverMcal.h:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
LArCableAttenuationComplete::set
void set(const HWIdentifier &CellID, float vCableAttenuation)
Definition: LArCableAttenuationComplete.cxx:14
LArOnlineID
Definition: LArOnlineID.h:20
LArReadParamsFromFile::set
StatusCode set(LArTshaperComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
Definition: LArReadParamsFromFile.h:97
LArReadParamsFromFile::ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArEMEC_CphiComplete *data)
Definition: LArReadParamsFromFile.h:137
LArCaliPulseParamsComplete::set
void set(const HWIdentifier &CellID, int gain, float tcal, float fstep)
Definition: LArCaliPulseParamsComplete.cxx:14
SG::ReadCondHandleKey< LArOnOffIdMapping >
LArFCAL_ID.h
LArReadParamsFromFile::ATLAS_NOT_THREAD_SAFE
virtual StatusCode stop ATLAS_NOT_THREAD_SAFE() override
ILArPhysCaliTdiff
Definition: ILArPhysCaliTdiff.h:13
LArTshaperComplete::set
void set(const HWIdentifier &CellID, float vTshaper)
Definition: LArTshaperComplete.cxx:13
LArReadParamsFromFile::ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArCableAttenuationComplete *data)
Definition: LArReadParamsFromFile.h:141
LArReadParamsFromFile::set
StatusCode set(LArPhysCaliTdiffComplete *complete, HWIdentifier chid, int gain, const std::vector< float > &data)
Definition: LArReadParamsFromFile.h:81
ILArCableAttenuation
Definition: ILArCableAttenuation.h:14
LArReadParamsFromFile::set
StatusCode set(LArDetCellParamsComplete *complete, HWIdentifier chid, int gain, const std::vector< float > &data)
Definition: LArReadParamsFromFile.h:77
LArRinjComplete::set
void set(const HWIdentifier &CellID, float vRinj)
Definition: LArRinjComplete.cxx:14
LArReadParamsFromFile::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: LArReadParamsFromFile.h:52
LArReadParamsFromFile::set
StatusCode set(LArCableLengthComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
Definition: LArReadParamsFromFile.h:113
LArEM_ID
Helper class for LArEM offline identifiers.
Definition: LArEM_ID.h:118
LArParamsProperties.h
LArReadParamsFromFile::set
StatusCode set(LArEMEC_HVbetaComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
Definition: LArReadParamsFromFile.h:109
LArReadParamsFromFile::execute
virtual StatusCode execute() override
Definition: LArReadParamsFromFile.h:48
LArFCAL_ID
Helper class for LArFCAL offline identifiers.
Definition: LArFCAL_ID.h:60
LArPhysCaliTdiffComplete::set
void set(const HWIdentifier &CellID, int gain, float tdiff)
Definition: LArPhysCaliTdiffComplete.cxx:27
LArReadParamsFromFile::set
StatusCode set(LArEMEC_CphiComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
Definition: LArReadParamsFromFile.h:101
LArReadParamsFromFile::LArReadParamsFromFile
LArReadParamsFromFile(const std::string &name, ISvcLocator *pSvcLocator)
LArReadParamsFromFile::set
StatusCode set(LArMphysOverMcalComplete *complete, HWIdentifier chid, int gain, const std::vector< float > &data)
Definition: LArReadParamsFromFile.h:89
ILArCaliPulseParams
Definition: ILArCaliPulseParams.h:14
LArOnlineID.h
LArDetCellParamsComplete
This class implements the ILArDetCellParams interface.
Definition: LArDetCellParamsComplete.h:24
LArReadParamsFromFile::m_hecId
const LArHEC_ID * m_hecId
Definition: LArReadParamsFromFile.h:54
LArReadParamsFromFile::m_groupingName
std::string m_groupingName
Definition: LArReadParamsFromFile.h:59
LArTshaperComplete
This class implements the ILArTshaper interface.
Definition: LArTshaperComplete.h:26