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-2026 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 using AthReentrantAlgorithm::AthReentrantAlgorithm;
43
44 //standard algorithm methods
45 virtual StatusCode initialize() override;
46 virtual StatusCode execute(const EventContext&) const override {return StatusCode::SUCCESS;}
47 virtual StatusCode stop ATLAS_NOT_THREAD_SAFE () override;
48
49 private:
50 const LArOnlineID* m_onlineHelper = nullptr;
51 const LArEM_ID* m_emId = nullptr;
52 const LArHEC_ID* m_hecId = nullptr;
53 const LArFCAL_ID* m_fcalId = nullptr;
54 SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
56
57 // assign grouping type (only for LArConditionsContainer-based classes)
58 StringProperty m_groupingName { this, "GroupingType", "Unknown" };
59 // file name to be read
60 StringProperty m_file { this, "File", "" };
61 // choose whether use offline ID (default is online)
62 BooleanProperty m_useOfflineIdentifier { this, "UseOfflineIdentifier", false };
63 StringProperty m_chIdType { this, "ChannelIdType", "UNKNOWN" };
64 StringProperty m_customKey { this, "CustomKey", "" };
65
66 bool m_useCalibLines = false;
67 DATA * m_dataclass = nullptr;
68
69 StatusCode readFile() ;
70
71 // define 'set' method for each foreseen data class:
72 //---------------------------------------------------
73
74 StatusCode set(LArCaliPulseParamsComplete* complete, HWIdentifier chid, int gain, const std::vector<float>& data) {
75 complete->set(chid, gain, data[0], data[1], data[2], data[3], (short)data[4]) ;
76 return StatusCode::SUCCESS ;
77 } ;
78 StatusCode set(LArDetCellParamsComplete* complete, HWIdentifier chid, int gain, const std::vector<float>& data) {
79 complete->set(chid, gain, data[0], data[1]) ;
80 return StatusCode::SUCCESS ;
81 } ;
82 StatusCode set(LArPhysCaliTdiffComplete* complete, HWIdentifier chid, int gain, const std::vector<float>& data) {
83 complete->set(chid, gain, data[0]) ;
84 return StatusCode::SUCCESS ;
85 } ;
86 StatusCode set(LArTdriftComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
87 complete->set(chid, data[0]) ;
88 return StatusCode::SUCCESS ;
89 } ;
90 StatusCode set(LArMphysOverMcalComplete* complete, HWIdentifier chid, int gain, const std::vector<float>& data) {
91 complete->set(chid, gain, data[0]) ;
92 return StatusCode::SUCCESS ;
93 } ;
94 StatusCode set(LArRinjComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
95 complete->set(chid, data[0]) ;
96 return StatusCode::SUCCESS ;
97 } ;
98 StatusCode set(LArTshaperComplete* 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_CphiComplete* 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_HValphaComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
107 complete->set(chid, data[0]) ;
108 return StatusCode::SUCCESS ;
109 } ;
110 StatusCode set(LArEMEC_HVbetaComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
111 complete->set(chid, data[0]) ;
112 return StatusCode::SUCCESS ;
113 } ;
114 StatusCode set(LArCableLengthComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
115 complete->set(chid, data[0]) ;
116 return StatusCode::SUCCESS ;
117 } ;
118 StatusCode set(LArCableAttenuationComplete* complete, HWIdentifier chid, int /*gain*/, const std::vector<float>& data) {
119 complete->set(chid, data[0]) ;
120 return StatusCode::SUCCESS ;
121 } ;
122
123 //StatusCode set(LArCaliPulseParamsVsCalib* calib, HWIdentifier chid, int /*gain*/, std::vector<float> data) {
124 // calib->set(chid, data[0], data[1], data[2], data[3], (short)data[4]) ;
125 // return StatusCode::SUCCESS ;
126 //`} ;
127
128 // define symLink for all classes
129 //--------------------------------
130
131 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArCaliPulseParamsComplete* data) { return detStore()->symLink(data,static_cast<const ILArCaliPulseParams*>(data)); } ;
132 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArDetCellParamsComplete* data) { return detStore()->symLink(data,static_cast<const ILArDetCellParams*>(data)); } ;
133 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArPhysCaliTdiffComplete* data) { return detStore()->symLink(data,static_cast<const ILArPhysCaliTdiff*>(data)); } ;
134 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArTdriftComplete* data) { return detStore()->symLink(data,static_cast<const ILArTdrift*>(data)); } ;
135 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArMphysOverMcalComplete* data) { return detStore()->symLink(data,static_cast<const ILArMphysOverMcal*>(data)); } ;
136 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArRinjComplete* data) { return detStore()->symLink(data,static_cast<const ILArRinj*>(data)); } ;
137 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArTshaperComplete* data) { return detStore()->symLink(data,static_cast<const ILArTshaper*>(data)); } ;
138 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArEMEC_CphiComplete* data) { return detStore()->symLink(data,static_cast<const ILArEMEC_Cphi*>(data)); } ;
139 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArEMEC_HValphaComplete* data) { return detStore()->symLink(data,static_cast<const ILArEMEC_HValpha*>(data)); } ;
140 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArEMEC_HVbetaComplete* data) { return detStore()->symLink(data,static_cast<const ILArEMEC_HVbeta*>(data)); } ;
141 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArCableLengthComplete* data) { return detStore()->symLink(data,static_cast<const ILArCableLength*>(data)); } ;
142 StatusCode do_symLink ATLAS_ARGUMENT_NOT_CONST_THREAD_SAFE (const LArCableAttenuationComplete* data){ return detStore()->symLink(data,static_cast<const ILArCableAttenuation*>(data)); } ;
143
144};
145
147
148#endif
const ServiceHandle< StoreGateSvc > & detStore() const
An algorithm that can be simultaneously executed in multiple threads.
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 algorithm reads an ascii file and fill a paremeters structure into the detector store.
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)
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)
virtual ~LArReadParamsFromFile()
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 execute(const EventContext &) const override
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)
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)