ATLAS Offline Software
Loading...
Searching...
No Matches
LArReadParamsFromFile.h
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
6
7
15
16#ifndef LARREADPARAMSFROMFILE_H
17#define LARREADPARAMSFROMFILE_H
19
21
22#include <fstream>
23#include <string>
24
26
27#include "GaudiKernel/Bootstrap.h"
28#include "GaudiKernel/ISvcLocator.h"
29#include "GaudiKernel/IToolSvc.h"
30
36
37template <class DATA>
39{
40 public:
41 LArReadParamsFromFile(const std::string & name, ISvcLocator * pSvcLocator);
43
44 //standard algorithm methods
45 virtual StatusCode initialize() override;
46 virtual StatusCode execute() override {return StatusCode::SUCCESS;}
47 virtual StatusCode stop ATLAS_NOT_THREAD_SAFE () override;
48
49 private:
54 SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
56 std::string m_groupingName ;
57
58 std::string m_file ;
60 std::string m_chIdType ;
61 std::string m_customKey;
62
63 DATA * m_dataclass ;
64
65 StatusCode readFile() ;
66
67 // define 'set' method for each foreseen data class:
68 //---------------------------------------------------
69
70 StatusCode set(LArCaliPulseParamsComplete* complete, HWIdentifier chid, int gain, const std::vector<float>& data) {
71 complete->set(chid, gain, data[0], data[1], data[2], data[3], (short)data[4]) ;
72 return StatusCode::SUCCESS ;
73 } ;
74 StatusCode set(LArDetCellParamsComplete* complete, HWIdentifier chid, int gain, const std::vector<float>& data) {
75 complete->set(chid, gain, data[0], data[1]) ;
76 return StatusCode::SUCCESS ;
77 } ;
78 StatusCode set(LArPhysCaliTdiffComplete* complete, HWIdentifier chid, int gain, const std::vector<float>& data) {
79 complete->set(chid, gain, data[0]) ;
80 return StatusCode::SUCCESS ;
81 } ;
82 StatusCode set(LArTdriftComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
83 complete->set(chid, data[0]) ;
84 return StatusCode::SUCCESS ;
85 } ;
86 StatusCode set(LArMphysOverMcalComplete* complete, HWIdentifier chid, int gain, const std::vector<float>& data) {
87 complete->set(chid, gain, data[0]) ;
88 return StatusCode::SUCCESS ;
89 } ;
90 StatusCode set(LArRinjComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
91 complete->set(chid, data[0]) ;
92 return StatusCode::SUCCESS ;
93 } ;
94 StatusCode set(LArTshaperComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
95 complete->set(chid, data[0]) ;
96 return StatusCode::SUCCESS ;
97 } ;
98 StatusCode set(LArEMEC_CphiComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
99 complete->set(chid, data[0]) ;
100 return StatusCode::SUCCESS ;
101 } ;
102 StatusCode set(LArEMEC_HValphaComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
103 complete->set(chid, data[0]) ;
104 return StatusCode::SUCCESS ;
105 } ;
106 StatusCode set(LArEMEC_HVbetaComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
107 complete->set(chid, data[0]) ;
108 return StatusCode::SUCCESS ;
109 } ;
110 StatusCode set(LArCableLengthComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
111 complete->set(chid, data[0]) ;
112 return StatusCode::SUCCESS ;
113 } ;
114 StatusCode set(LArCableAttenuationComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
115 complete->set(chid, data[0]) ;
116 return StatusCode::SUCCESS ;
117 } ;
118
119 //StatusCode set(LArCaliPulseParamsVsCalib* calib, HWIdentifier chid, int /*gain*/, std::vector<float> data) {
120 // calib->set(chid, data[0], data[1], data[2], data[3], (short)data[4]) ;
121 // return StatusCode::SUCCESS ;
122 //`} ;
123
124 // define symLink for all classes
125 //--------------------------------
126
127 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArCaliPulseParamsComplete* data) { return detStore()->symLink(data,static_cast<const ILArCaliPulseParams*>(data)).ignore() ; } ;
128 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArDetCellParamsComplete* data) { return detStore()->symLink(data,static_cast<const ILArDetCellParams*>(data)).ignore() ; } ;
129 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArPhysCaliTdiffComplete* data) { return detStore()->symLink(data,static_cast<const ILArPhysCaliTdiff*>(data)).ignore() ; } ;
130 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArTdriftComplete* data) { return detStore()->symLink(data,static_cast<const ILArTdrift*>(data)).ignore() ; } ;
131 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArMphysOverMcalComplete* data) { return detStore()->symLink(data,static_cast<const ILArMphysOverMcal*>(data)).ignore() ; } ;
132 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArRinjComplete* data) { return detStore()->symLink(data,static_cast<const ILArRinj*>(data)).ignore() ; } ;
133 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArTshaperComplete* data) { return detStore()->symLink(data,static_cast<const ILArTshaper*>(data)).ignore() ; } ;
134 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArEMEC_CphiComplete* data) { return detStore()->symLink(data,static_cast<const ILArEMEC_Cphi*>(data)).ignore() ; } ;
135 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArEMEC_HValphaComplete* data) { return detStore()->symLink(data,static_cast<const ILArEMEC_HValpha*>(data)).ignore() ; } ;
136 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArEMEC_HVbetaComplete* data) { return detStore()->symLink(data,static_cast<const ILArEMEC_HVbeta*>(data)).ignore() ; } ;
137 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArCableLengthComplete* data) { return detStore()->symLink(data,static_cast<const ILArCableLength*>(data)).ignore() ; } ;
138 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArCableAttenuationComplete* data){ return detStore()->symLink(data,static_cast<const ILArCableAttenuation*>(data)).ignore(); } ;
139
140};
141
143
144#endif
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
const ServiceHandle< StoreGateSvc > & detStore() const
This class implements the ILArCableAttenuation interface.
void set(const HWIdentifier &CellID, float vCableAttenuation)
This class implements the ILArCableLength interface.
void set(const HWIdentifier &CellID, float vCableLength)
This class implements the ILArCaliPulseParams interface.
void set(const HWIdentifier &CellID, int gain, float tcal, float fstep)
This class implements the ILArDetCellParams interface.
void set(const HWIdentifier &CellID, int gain, float omega0, float taur)
This class implements the ILArEMEC_Cphi interface.
void set(const HWIdentifier &CellID, float vEMEC_Cphi)
This class implements the ILArEMEC_HValpha interface.
void set(const HWIdentifier &CellID, float vEMEC_HValpha)
This class implements the ILArEMEC_HVbeta interface.
void set(const HWIdentifier &CellID, float vEMEC_HVbeta)
Helper class for LArEM offline identifiers.
Definition LArEM_ID.h:111
Helper class for LArFCAL offline identifiers.
Definition LArFCAL_ID.h:49
Helper class for LArHEC offline identifiers.
Definition LArHEC_ID.h:76
This class implements the ILArMphysOverMcal interface.
void set(const HWIdentifier &CellID, int gain, float vMphysOverMcal)
This class implements the ILArPhysCaliTdiff interface ` *.
void set(const HWIdentifier &CellID, int gain, float tdiff)
StatusCode set(LArEMEC_HValphaComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
StatusCode set(LArMphysOverMcalComplete *complete, HWIdentifier chid, int gain, const std::vector< float > &data)
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArCableLengthComplete *data)
LArReadParamsFromFile(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArTshaperComplete *data)
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArMphysOverMcalComplete *data)
StatusCode set(LArTdriftComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
StatusCode set(LArEMEC_CphiComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArCaliPulseParamsComplete *data)
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArPhysCaliTdiffComplete *data)
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArEMEC_HVbetaComplete *data)
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArEMEC_HValphaComplete *data)
virtual StatusCode initialize() override
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArDetCellParamsComplete *data)
virtual StatusCode stop ATLAS_NOT_THREAD_SAFE() override
StatusCode readFile()
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArRinjComplete *data)
StatusCode set(LArCableLengthComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
StatusCode set(LArTshaperComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
virtual StatusCode execute() override
StatusCode set(LArCaliPulseParamsComplete *complete, HWIdentifier chid, int gain, const std::vector< float > &data)
StatusCode set(LArPhysCaliTdiffComplete *complete, HWIdentifier chid, int gain, const std::vector< float > &data)
StatusCode set(LArEMEC_HVbetaComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
StatusCode set(LArRinjComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArCableAttenuationComplete *data)
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArEMEC_CphiComplete *data)
StatusCode set(LArDetCellParamsComplete *complete, HWIdentifier chid, int gain, const std::vector< float > &data)
StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE(const LArTdriftComplete *data)
StatusCode set(LArCableAttenuationComplete *complete, HWIdentifier chid, int, const std::vector< float > &data)
This class implements the ILArRinj interface.
void set(const HWIdentifier &CellID, float vRinj)
This class implements the ILArTdrift interface.
void set(const HWIdentifier &CellID, float tdrift)
This class implements the ILArTshaper interface.
void set(const HWIdentifier &CellID, float vTshaper)