#include <LArRampAdHocPatchingAlg.h>
Definition at line 24 of file LArRampAdHocPatchingAlg.h.
◆ LArRampObj
◆ StoreGateSvc_t
◆ patchMethod
◆ LArRampAdHocPatchingAlg()
| LArRampAdHocPatchingAlg::LArRampAdHocPatchingAlg |
( |
const std::string & | name, |
|
|
ISvcLocator * | pSvcLocator ) |
regular Algorithm constructor
Definition at line 9 of file LArRampAdHocPatchingAlg.cxx.
13{
16
20
24
28
30 "True: Use separate correction COOL channel, False: Correction + data in the same channel");
31}
AthAlgorithm()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::vector< unsigned > m_patchesToBeAppliedMG
std::vector< std::vector< double > > m_valuesToBeAppliedHG
std::vector< unsigned > m_channelsToBePatchedLG
std::vector< unsigned > m_channelsToBePatchedMG
std::vector< unsigned > m_channelsToBePatchedHG
std::vector< unsigned > m_patchesToBeAppliedHG
const LArRampComplete * m_contIn
std::vector< std::vector< double > > m_valuesToBeAppliedMG
std::string m_containerKey
std::vector< std::vector< double > > m_valuesToBeAppliedLG
LArRampComplete * m_contOut
std::string m_newContainerKey
std::vector< unsigned > m_patchesToBeAppliedLG
◆ ~LArRampAdHocPatchingAlg()
| LArRampAdHocPatchingAlg::~LArRampAdHocPatchingAlg |
( |
| ) |
|
|
default |
◆ ApplyAdHocPatches()
| StatusCode LArRampAdHocPatchingAlg::ApplyAdHocPatches |
( |
std::vector< unsigned > & | channelsToBePatched, |
|
|
std::vector< unsigned > & | patchesTobeApplied, |
|
|
std::vector< std::vector< double > > & | valuesToBeApplied, |
|
|
unsigned | gain ) |
|
private |
Definition at line 129 of file LArRampAdHocPatchingAlg.cxx.
130{
131 if (channelsToBePatched.size() != patchesToBeApplied.size())
132 return StatusCode::FAILURE;
133 unsigned putcount=0;
134 for (unsigned ich=0;ich<channelsToBePatched.size();++ich ) {
135 const HWIdentifier chid = (HWIdentifier)channelsToBePatched[ich];
136
137 const unsigned patchMethod = patchesToBeApplied[ich];
138
141
142 if (
m_contIn->get(chid,gain).isEmpty())
continue;
144 break;
145 }
147 if ( valuesToBeApplied[putcount].
empty() )
return StatusCode::FAILURE;
149 ++putcount;
150 break;
151 }
152 }
153
154
155
156
157
158
159
160 }
161 return StatusCode::SUCCESS;
162}
static const Attributes_t empty
bool ZeroTheIntercept(HWIdentifier chid, unsigned gain)
bool PutTheValues(HWIdentifier chid, std::vector< double > &rvalues, unsigned gain)
◆ declareGaudiProperty()
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
158 {
161 hndl.documentation());
162
163 }
◆ declareProperty()
Definition at line 145 of file AthCommonDataStore.h.
145 {
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
◆ detStore()
◆ evtStore()
◆ execute()
| StatusCode LArRampAdHocPatchingAlg::execute |
( |
| ) |
|
|
inline |
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ extraOutputDeps()
| const DataObjIDColl & AthAlgorithm::extraOutputDeps |
( |
| ) |
const |
|
overridevirtualinherited |
Return the list of extra output dependencies.
This list is extended to include symlinks implied by inheritance relations.
Definition at line 50 of file AthAlgorithm.cxx.
51{
52
53
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects
◆ finalize()
| StatusCode LArRampAdHocPatchingAlg::finalize |
( |
| ) |
|
|
inline |
◆ initialize()
| StatusCode LArRampAdHocPatchingAlg::initialize |
( |
| ) |
|
Initialize method.
- Returns
- Gaudi status code. Analyzes and verifies the jobOption settings
Definition at line 38 of file LArRampAdHocPatchingAlg.cxx.
39{
40 ATH_MSG_INFO (
"Initialing LArRampAdHocPatchingAlg..." );
44
47 return StatusCode::FAILURE;
48 } else {
52 return StatusCode::FAILURE;
53 } else {
55 }
56 }
57
60 return StatusCode::FAILURE;
61 } else {
64 ATH_MSG_ERROR (
"Wrong size of MEDIUM gain values vector !" );
65 return StatusCode::FAILURE;
66 } else {
68 }
69 }
70
73 return StatusCode::FAILURE;
74 } else {
78 return StatusCode::FAILURE;
79 } else {
81 }
82 }
83
84 return StatusCode::SUCCESS;
85}
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ msg()
◆ msgLvl()
| bool AthCommonMsg< Algorithm >::msgLvl |
( |
const MSG::Level | lvl | ) |
const |
|
inlineinherited |
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ PutTheValues()
| bool LArRampAdHocPatchingAlg::PutTheValues |
( |
HWIdentifier | chid, |
|
|
std::vector< double > & | rvalues, |
|
|
unsigned | gain ) |
|
private |
Definition at line 189 of file LArRampAdHocPatchingAlg.cxx.
190{
191 unsigned s = rvalues.size();
193 patch.m_vRamp.clear();
194 patch.m_vRamp.resize(s);
196 if(s==0) return false;
197 for (
unsigned i=0;
i<
s;++
i){
198 patch.m_vRamp[
i] = rvalues[
i];
199 }
202 catch(...) {
ATH_MSG_INFO (
"Skipping insert of corrections, maybe it's not about this partition");}
203 if (
sc.isFailure()) {
205 << MSG::hex << chid.
get_compact() << MSG::dec <<
", gain " << gain <<
"." );
206 return false;
207 } else {
208 ATH_MSG_INFO (
"Successfully put the values for channel 0x"
209 << MSG::hex << chid.
get_compact() << MSG::dec <<
", gain " << gain <<
"." );
210 return true;
211 }
212}
value_type get_compact() const
Get the compact id.
LArRampComplete::LArCondObj LArRampObj
::StatusCode StatusCode
StatusCode definition for legacy code.
◆ renounce()
Definition at line 380 of file AthCommonDataStore.h.
381 {
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)
◆ renounceArray()
◆ stop()
| StatusCode LArRampAdHocPatchingAlg::stop |
( |
| ) |
|
Finalize method.
- Returns
- Gaudi status code. All the job is done here
Definition at line 88 of file LArRampAdHocPatchingAlg.cxx.
89{
91
101 }
102 else {
106 }
107
109 ATH_MSG_INFO (
"Going to apply ad-hoc patches to HIGH gain ramps." );
111 }
112
114 ATH_MSG_INFO (
"Going to apply ad-hoc patches to MEDIUM gain ramps." );
116 }
117
119 ATH_MSG_INFO (
"Going to apply ad-hoc patches to LOW gain ramps." );
121 }
122
124 return StatusCode::SUCCESS;
125}
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
GroupingType
Grouping type.
StatusCode ApplyAdHocPatches(std::vector< unsigned > &channelsToBePatched, std::vector< unsigned > &patchesTobeApplied, std::vector< std::vector< double > > &valuesToBeApplied, unsigned gain)
retrieve(aClass, aKey=None)
◆ sysInitialize()
| StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
Override sysInitialize.
Override sysInitialize from the base class.
Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc
Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc
Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.
Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.
Definition at line 66 of file AthAlgorithm.cxx.
66 {
68
71 }
72 ServiceHandle<ICondSvc> cs(
"CondSvc",
name());
74 if (
h->isCondition() &&
h->mode() == Gaudi::DataHandle::Writer) {
75
76 if ( cs.retrieve().isFailure() ) {
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR(
"unable to register WriteCondHandle " <<
h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
88}
#define ATH_MSG_WARNING(x)
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
Definition at line 308 of file AthCommonDataStore.h.
308 {
309
310
313 for (
auto k :
keys) {
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka
◆ ZeroTheIntercept()
| bool LArRampAdHocPatchingAlg::ZeroTheIntercept |
( |
HWIdentifier | chid, |
|
|
unsigned | gain ) |
|
private |
Definition at line 165 of file LArRampAdHocPatchingAlg.cxx.
166{
167 unsigned s =
m_contIn->get(chid,gain).m_vRamp.size();
169 patch.m_vRamp.clear();
170 patch.m_vRamp.resize(s);
172 if(s==0) return false;
173 patch.m_vRamp[0] = 0.;
174 for (
unsigned i=1;
i<
s;++
i){
175 patch.m_vRamp[
i] =
m_contIn->get(chid,gain).m_vRamp[
i];
176 }
178 if (
sc.isFailure()) {
179 ATH_MSG_ERROR (
"Failed to zero the ramp intercept channel 0x"
180 << MSG::hex << chid.
get_compact() << MSG::dec <<
", gain " << gain <<
"." );
181 return false;
182 } else {
183 ATH_MSG_INFO (
"Successfully zeroed the ramp intercept channel 0x"
184 << MSG::hex << chid.
get_compact() << MSG::dec <<
", gain " << gain <<
"." );
185 return true;
186 }
187}
◆ m_channelsToBePatchedHG
| std::vector<unsigned> LArRampAdHocPatchingAlg::m_channelsToBePatchedHG |
|
private |
◆ m_channelsToBePatchedLG
| std::vector<unsigned> LArRampAdHocPatchingAlg::m_channelsToBePatchedLG |
|
private |
◆ m_channelsToBePatchedMG
| std::vector<unsigned> LArRampAdHocPatchingAlg::m_channelsToBePatchedMG |
|
private |
◆ m_containerKey
| std::string LArRampAdHocPatchingAlg::m_containerKey |
|
private |
◆ m_contIn
◆ m_contOut
◆ m_detStore
◆ m_evtStore
◆ m_extendedExtraObjects
| DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_newContainerKey
| std::string LArRampAdHocPatchingAlg::m_newContainerKey |
|
private |
◆ m_patchesToBeAppliedHG
| std::vector<unsigned> LArRampAdHocPatchingAlg::m_patchesToBeAppliedHG |
|
private |
◆ m_patchesToBeAppliedLG
| std::vector<unsigned> LArRampAdHocPatchingAlg::m_patchesToBeAppliedLG |
|
private |
◆ m_patchesToBeAppliedMG
| std::vector<unsigned> LArRampAdHocPatchingAlg::m_patchesToBeAppliedMG |
|
private |
◆ m_useCorrChannel
| bool LArRampAdHocPatchingAlg::m_useCorrChannel = false |
|
private |
◆ m_valuesToBeAppliedHG
| std::vector<std::vector<double> > LArRampAdHocPatchingAlg::m_valuesToBeAppliedHG |
|
private |
◆ m_valuesToBeAppliedLG
| std::vector<std::vector<double> > LArRampAdHocPatchingAlg::m_valuesToBeAppliedLG |
|
private |
◆ m_valuesToBeAppliedMG
| std::vector<std::vector<double> > LArRampAdHocPatchingAlg::m_valuesToBeAppliedMG |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files: