ATLAS Offline Software
Loading...
Searching...
No Matches
LArCalorimeter
LArCalibUtils
LArCalibUtils
LArRTMParamExtractor.h
Go to the documentation of this file.
1
//Dear emacs, this is -*- c++ -*-
2
3
/*
4
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
8
/*
9
* LArRTMParamExtractor
10
*
11
* This algorithm reads LArCaliWaveContainers and extract from each of the
12
* LArCaliWaves the LArCaliPulseParams and LArDetCellParams parameters
13
* according to the corresponding RTM algorithms.
14
*
15
* Author: Marco.Delmastro@cen.ch
16
*
17
*/
18
19
#ifndef LArRTMPARAMEXTRACTOR_H
20
#define LArRTMPARAMEXTRACTOR_H
21
22
#include <string>
23
#include <vector>
24
#include <atomic>
25
26
#include "
AthenaBaseComps/AthAlgorithm.h
"
27
#include "GaudiKernel/ToolHandle.h"
28
#include "
LArCabling/LArOnOffIdMapping.h
"
29
#include "tbb/blocked_range.h"
30
#include "tbb/global_control.h"
31
#include "
LArRawConditions/LArWFParams.h
"
32
#include "
LArCalibUtils/LArWFParamTool.h
"
33
#include "
LArRawConditions/LArCaliWave.h
"
34
#include <memory>
35
36
#include "
CxxUtils/checker_macros.h
"
37
38
39
class
LArWFParamTool
;
40
41
class
ATLAS_NOT_THREAD_SAFE
LArRTMParamExtractor
:
public
AthAlgorithm
{
42
//Acutally this algo can do internal multi-threading at finalize
43
//but not the way regular athenaMT works, so the thread-safety checker complains
44
45
public
:
46
47
LArRTMParamExtractor
(
const
std::string & name, ISvcLocator * pSvcLocator);
48
49
~LArRTMParamExtractor
();
50
51
StatusCode
initialize
();
52
StatusCode
execute
() {
return
StatusCode::SUCCESS;}
53
StatusCode stop();
54
StatusCode
finalize
(){
return
StatusCode::SUCCESS;}
55
56
private
:
57
58
SG::ReadCondHandleKey<LArOnOffIdMapping>
m_cablingKey
{
this
,
"CablingKey"
,
"LArOnOffIdMap"
,
"SG Key of LArOnOffIdMapping object"
};
59
SG::ReadCondHandleKey<LArOnOffIdMapping>
m_cablingKeySC
{
this
,
"ScCablingKey"
,
"LArOnOffIdMapSC"
,
"SG Key of SC LArOnOffIdMapping object"
};
60
61
ToolHandle<LArWFParamTool>
m_larWFParamTool
{
this
,
"LArWFParamTool"
,
"LArWFParamTool"
};
62
63
std::vector<std::string>
m_keylist
;
64
bool
m_isSC
;
65
bool
m_testmode
,
m_dumpOmegaScan
,
m_dumpResOscill
;
66
std::string
m_omegaScanKey
,
m_resOscillKeyBefore
,
m_resOscillKeyAfter
;
67
68
bool
m_ignoreDACselection
;
69
std::vector<int>
m_DAC
;
70
71
bool
m_extractTcal
,
m_extractFstep
,
m_extractOmega0
,
m_extractTaur
;
72
float
m_defaultTcal
,
m_defaultFstep
,
m_defaultOmega0
,
m_defaultTaur
;
73
74
bool
m_recoverEmptyDB
;
75
76
std::string
m_suffixRetrievedCaliPulse
,
m_suffixRetrievedDetCell
;
77
std::string
m_keyRetrievedCaliPulse
,
m_keyRetrievedDetCell
;
78
79
std::string
m_suffixExtractedCaliPulse
,
m_suffixExtractedDetCell
;
80
std::string
m_keyExtractedCaliPulse
,
m_keyExtractedDetCell
;
81
82
// Grouping type
83
std::string
m_groupingType
;
84
85
// FT selection
86
std::vector<int>
m_FT
;
87
int
m_PosNeg
;
88
// Slot selection
89
std::vector<int>
m_Slot
;
90
// Calib line selection
91
bool
m_Calibselection
;
92
int
m_Cline
;
93
94
95
//Elements for TBB
96
97
int
m_nThreads
;
98
mutable
std::atomic<unsigned>
m_counter
{0};
99
100
class
helperParams
{
101
public
:
102
helperParams
(
const
LArCaliWave
* cw,
const
HWIdentifier
id
,
const
unsigned
g) :
103
caliWave
(cw),
chid
(id),
gain
(g) {};
104
105
const
LArCaliWave
*
caliWave
;
//Input object
106
std::optional<LArCaliWave>
omegaScan
;
//optional output object
107
std::optional<LArCaliWave>
resOscill0
;
//optional output object
108
std::optional<LArCaliWave>
resOscill1
;
//optional output object
109
LArWFParams
wfParams
;
//Outut object
110
HWIdentifier
chid
;
111
unsigned
gain
;
112
bool
success
=
true
;
113
};
114
115
class
ATLAS_NOT_THREAD_SAFE
Looper
{
116
//The way this class gets used is actually thread-safe
117
public
:
118
//Looper() = delete;
119
Looper
(std::vector<helperParams>* p,
const
LArOnOffIdMapping
* cabling,
const
LArWFParamTool
* t,
120
MsgStream& ms,std::atomic<unsigned>& cnt ) :
121
m_tbbparams
(p),
m_cabling
(cabling),
m_tool
(t),
122
m_msg
(ms),
m_counter
(cnt) {};
123
124
void
operator() (
const
tbb::blocked_range<size_t>&
r
)
const
;
125
126
private
:
127
std::vector<helperParams>*
m_tbbparams
;
128
const
LArOnOffIdMapping
*
m_cabling
;
129
const
LArWFParamTool
*
m_tool
;
130
MsgStream&
m_msg
;
131
std::atomic<unsigned>&
m_counter
;
132
};
133
134
135
136
};
137
138
#endif
AthAlgorithm.h
LArCaliWave.h
LArOnOffIdMapping.h
LArWFParamTool.h
LArWFParams.h
checker_macros.h
Define macros for attributes used to control the static checker.
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition
checker_macros.h:212
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Definition
AthAlgorithm.cxx:24
HWIdentifier
Definition
HWIdentifier.h:13
LArCaliWave
Definition
LArCaliWave.h:44
LArOnOffIdMapping
Definition
LArOnOffIdMapping.h:20
LArRTMParamExtractor::Looper::m_cabling
const LArOnOffIdMapping * m_cabling
Definition
LArRTMParamExtractor.h:128
LArRTMParamExtractor::Looper::Looper
Looper(std::vector< helperParams > *p, const LArOnOffIdMapping *cabling, const LArWFParamTool *t, MsgStream &ms, std::atomic< unsigned > &cnt)
Definition
LArRTMParamExtractor.h:119
LArRTMParamExtractor::Looper::m_counter
std::atomic< unsigned > & m_counter
Definition
LArRTMParamExtractor.h:131
LArRTMParamExtractor::Looper::m_tool
const LArWFParamTool * m_tool
Definition
LArRTMParamExtractor.h:129
LArRTMParamExtractor::Looper::m_msg
MsgStream & m_msg
Definition
LArRTMParamExtractor.h:130
LArRTMParamExtractor::Looper::m_tbbparams
std::vector< helperParams > * m_tbbparams
Definition
LArRTMParamExtractor.h:127
LArRTMParamExtractor::helperParams::resOscill1
std::optional< LArCaliWave > resOscill1
Definition
LArRTMParamExtractor.h:108
LArRTMParamExtractor::helperParams::omegaScan
std::optional< LArCaliWave > omegaScan
Definition
LArRTMParamExtractor.h:106
LArRTMParamExtractor::helperParams::success
bool success
Definition
LArRTMParamExtractor.h:112
LArRTMParamExtractor::helperParams::resOscill0
std::optional< LArCaliWave > resOscill0
Definition
LArRTMParamExtractor.h:107
LArRTMParamExtractor::helperParams::helperParams
helperParams(const LArCaliWave *cw, const HWIdentifier id, const unsigned g)
Definition
LArRTMParamExtractor.h:102
LArRTMParamExtractor::helperParams::caliWave
const LArCaliWave * caliWave
Definition
LArRTMParamExtractor.h:105
LArRTMParamExtractor::helperParams::wfParams
LArWFParams wfParams
Definition
LArRTMParamExtractor.h:109
LArRTMParamExtractor::helperParams::chid
HWIdentifier chid
Definition
LArRTMParamExtractor.h:110
LArRTMParamExtractor::helperParams::gain
unsigned gain
Definition
LArRTMParamExtractor.h:111
LArRTMParamExtractor::m_extractTcal
bool m_extractTcal
Definition
LArRTMParamExtractor.h:71
LArRTMParamExtractor::finalize
StatusCode finalize()
Definition
LArRTMParamExtractor.h:54
LArRTMParamExtractor::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition
LArRTMParamExtractor.h:58
LArRTMParamExtractor::m_keyRetrievedCaliPulse
std::string m_keyRetrievedCaliPulse
Definition
LArRTMParamExtractor.h:77
LArRTMParamExtractor::m_recoverEmptyDB
bool m_recoverEmptyDB
Definition
LArRTMParamExtractor.h:74
LArRTMParamExtractor::m_extractOmega0
bool m_extractOmega0
Definition
LArRTMParamExtractor.h:71
LArRTMParamExtractor::m_keyRetrievedDetCell
std::string m_keyRetrievedDetCell
Definition
LArRTMParamExtractor.h:77
LArRTMParamExtractor::m_larWFParamTool
ToolHandle< LArWFParamTool > m_larWFParamTool
Definition
LArRTMParamExtractor.h:61
LArRTMParamExtractor::m_isSC
bool m_isSC
Definition
LArRTMParamExtractor.h:64
LArRTMParamExtractor::m_suffixRetrievedDetCell
std::string m_suffixRetrievedDetCell
Definition
LArRTMParamExtractor.h:76
LArRTMParamExtractor::m_Calibselection
bool m_Calibselection
Definition
LArRTMParamExtractor.h:91
LArRTMParamExtractor::m_DAC
std::vector< int > m_DAC
Definition
LArRTMParamExtractor.h:69
LArRTMParamExtractor::m_keyExtractedDetCell
std::string m_keyExtractedDetCell
Definition
LArRTMParamExtractor.h:80
LArRTMParamExtractor::m_keylist
std::vector< std::string > m_keylist
Definition
LArRTMParamExtractor.h:63
LArRTMParamExtractor::LArRTMParamExtractor
LArRTMParamExtractor(const std::string &name, ISvcLocator *pSvcLocator)
Definition
LArRTMParamExtractor.cxx:23
LArRTMParamExtractor::m_counter
std::atomic< unsigned > m_counter
Definition
LArRTMParamExtractor.h:98
LArRTMParamExtractor::m_suffixExtractedDetCell
std::string m_suffixExtractedDetCell
Definition
LArRTMParamExtractor.h:79
LArRTMParamExtractor::m_extractFstep
bool m_extractFstep
Definition
LArRTMParamExtractor.h:71
LArRTMParamExtractor::m_dumpOmegaScan
bool m_dumpOmegaScan
Definition
LArRTMParamExtractor.h:65
LArRTMParamExtractor::m_extractTaur
bool m_extractTaur
Definition
LArRTMParamExtractor.h:71
LArRTMParamExtractor::m_Slot
std::vector< int > m_Slot
Definition
LArRTMParamExtractor.h:89
LArRTMParamExtractor::m_keyExtractedCaliPulse
std::string m_keyExtractedCaliPulse
Definition
LArRTMParamExtractor.h:80
LArRTMParamExtractor::m_resOscillKeyBefore
std::string m_resOscillKeyBefore
Definition
LArRTMParamExtractor.h:66
LArRTMParamExtractor::m_ignoreDACselection
bool m_ignoreDACselection
Definition
LArRTMParamExtractor.h:68
LArRTMParamExtractor::m_omegaScanKey
std::string m_omegaScanKey
Definition
LArRTMParamExtractor.h:66
LArRTMParamExtractor::~LArRTMParamExtractor
~LArRTMParamExtractor()
LArRTMParamExtractor::m_defaultTaur
float m_defaultTaur
Definition
LArRTMParamExtractor.h:72
LArRTMParamExtractor::execute
StatusCode execute()
Definition
LArRTMParamExtractor.h:52
LArRTMParamExtractor::m_suffixExtractedCaliPulse
std::string m_suffixExtractedCaliPulse
Definition
LArRTMParamExtractor.h:79
LArRTMParamExtractor::m_cablingKeySC
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKeySC
Definition
LArRTMParamExtractor.h:59
LArRTMParamExtractor::m_defaultTcal
float m_defaultTcal
Definition
LArRTMParamExtractor.h:72
LArRTMParamExtractor::m_FT
std::vector< int > m_FT
Definition
LArRTMParamExtractor.h:86
LArRTMParamExtractor::m_testmode
bool m_testmode
Definition
LArRTMParamExtractor.h:65
LArRTMParamExtractor::m_nThreads
int m_nThreads
Definition
LArRTMParamExtractor.h:97
LArRTMParamExtractor::m_resOscillKeyAfter
std::string m_resOscillKeyAfter
Definition
LArRTMParamExtractor.h:66
LArRTMParamExtractor::m_Cline
int m_Cline
Definition
LArRTMParamExtractor.h:92
LArRTMParamExtractor::m_defaultFstep
float m_defaultFstep
Definition
LArRTMParamExtractor.h:72
LArRTMParamExtractor::m_groupingType
std::string m_groupingType
Definition
LArRTMParamExtractor.h:83
LArRTMParamExtractor::m_suffixRetrievedCaliPulse
std::string m_suffixRetrievedCaliPulse
Definition
LArRTMParamExtractor.h:76
LArRTMParamExtractor::m_dumpResOscill
bool m_dumpResOscill
Definition
LArRTMParamExtractor.h:65
LArRTMParamExtractor::m_defaultOmega0
float m_defaultOmega0
Definition
LArRTMParamExtractor.h:72
LArRTMParamExtractor::m_PosNeg
int m_PosNeg
Definition
LArRTMParamExtractor.h:87
LArWFParamTool
Definition
LArWFParamTool.h:29
LArWFParams
Definition
LArWFParams.h:20
SG::ReadCondHandleKey
Definition
ReadCondHandleKey.h:21
r
int r
Definition
globals.cxx:22
initialize
void initialize()
Definition
run_EoverP.cxx:894
Generated on
for ATLAS Offline Software by
1.14.0