Skip to content

Commit 6407681

Browse files
committed
Thread-safety: make all DTConfigManager::getDTConfig..() const to return a const pointer
1 parent 1c1d004 commit 6407681

File tree

22 files changed

+65
-69
lines changed

22 files changed

+65
-69
lines changed

DQM/DTMonitorClient/src/DTFineDelayCorr.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void DTFineDelayCorr::runClientDiagnostic() {
124124

125125
// ** Retrieve Delays Loaded in MiniCrates **
126126
if(readOldFromDb) { // read from db
127-
DTConfigPedestals *pedestals = dtConfig->getDTConfigPedestals();
127+
const DTConfigPedestals *pedestals = dtConfig->getDTConfigPedestals();
128128
const DTLayer *layer = muonGeom->layer(DTLayerId(chId,1,1));
129129
float delay = pedestals->getOffset(DTWireId(layer->id(),layer->specificTopology().firstChannel()));
130130
coarseDelay = int(delay/25.);

L1Trigger/DTBti/interface/DTBtiCard.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class DTBtiCard : public BTICache, public DTGeomSupplier {
133133
std::vector<DTDigi*> _digis;
134134

135135
bool _debug;
136-
DTConfigPedestals* _pedestals;
136+
const DTConfigPedestals* _pedestals;
137137

138138
bool _flag_acc;
139139
};

L1Trigger/DTSectorCollector/interface/DTSC.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class DTSC{
5252
// non-const methods
5353

5454
/// Set configuration
55-
void setConfig(DTConfigSectColl *conf) { _config=conf; };
55+
void setConfig(const DTConfigSectColl *conf) { _config=conf; };
5656

5757
//! Add a TSM candidate to the Sect Coll, ifs is first/second track flag
5858
void addPhCand(DTSectCollPhCand* cand);
@@ -83,7 +83,7 @@ class DTSC{
8383
// const methods
8484

8585
//! Configuration set
86-
inline DTConfigSectColl* config() const { return _config; }
86+
inline const DTConfigSectColl* config() const { return _config; }
8787

8888
//! Return the number of Phi input tracks (first/second)
8989
unsigned nCandPh (int ifs) const;
@@ -118,7 +118,7 @@ class DTSC{
118118
private:
119119

120120
// Configuration
121-
DTConfigSectColl* _config;
121+
const DTConfigSectColl* _config;
122122

123123
// input phi data
124124
std::vector<DTSectCollPhCand*> _incand_ph[2];

L1Trigger/DTSectorCollector/interface/DTSectColl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class DTSectColl : public DTSCPhCache, public DTSCThCache {
7474
inline DTTSTheta* getTSTheta(int istat) const { return _tstheta[istat-1]; }
7575

7676
//!Configuration
77-
inline DTConfigSectColl* config() const { return _config; }
77+
inline const DTConfigSectColl* config() const { return _config; }
7878

7979
// non-const methods
8080

@@ -182,7 +182,7 @@ class DTSectColl : public DTSCPhCache, public DTSCThCache {
182182
private:
183183

184184
// Configuration
185-
DTConfigSectColl* _config;
185+
const DTConfigSectColl* _config;
186186

187187
// SC Id
188188
DTSectCollId _sectcollid;

L1Trigger/DTSectorCollector/interface/DTSectCollPhCand.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class DTSectCollPhCand {
7575
// Const methods
7676

7777
//! Configuration set
78-
inline DTConfigSectColl* config() const { return _tsc->config(); }
78+
inline const DTConfigSectColl* config() const { return _tsc->config(); }
7979

8080
//! Return the DTTSS
8181
inline DTSC* tsc() const { return _tsc; }

L1Trigger/DTSectorCollector/interface/DTSectCollThCand.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class DTSectCollThCand {
5454
// Const methods
5555

5656
//! Configuration set
57-
inline DTConfigSectColl* config() const { return _tsc->config(); }
57+
inline const DTConfigSectColl* config() const { return _tsc->config(); }
5858

5959
//! Return the DTTSS
6060
inline DTSC* tsc() const { return _tsc; }

L1Trigger/DTTraco/interface/DTTracoCard.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class DTTracoCard : public TRACOCache, public DTGeomSupplier {
105105
virtual void reconstruct() { clearCache(); loadTRACO(); runTRACO(); }
106106

107107
/// Return LUTS config for this chamber (=minicrate)
108-
DTConfigLUTs* config_luts() const { return _conf_luts; }
108+
const DTConfigLUTs* config_luts() const { return _conf_luts; }
109109

110110
/// Return acceptance flag
111111
inline bool useAcceptParamFlag() { return _flag_acc; }
@@ -143,7 +143,7 @@ class DTTracoCard : public TRACOCache, public DTGeomSupplier {
143143
TRACOContainer _tracomap;
144144
ConfTracoMap _conf_traco_map; //bti configuration map for this chamber
145145

146-
DTConfigLUTs* _conf_luts;
146+
const DTConfigLUTs* _conf_luts;
147147

148148
bool _debug;
149149

L1Trigger/DTTraco/interface/Lut.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ class Lut {
3333

3434
public:
3535
Lut() {};
36-
Lut(DTConfigLUTs* conf, int ntc, float SL_shift);
36+
Lut(const DTConfigLUTs* conf, int ntc, float SL_shift);
3737
~Lut();
3838

3939
// set lut parameters methods
4040
void setForTestBeam( int station, int board, int traco );
4141

4242
// get luts
43-
int get_x( int addr );
44-
int get_k( int addr );
43+
int get_x( int addr ) const;
44+
int get_k( int addr ) const;
4545

4646
// DSP <-> IEEE32 conversions
4747
void IEEE32toDSP(float f, short *DSPmantissa, short *DSPexp);
@@ -56,7 +56,7 @@ class Lut {
5656
private:
5757
float m_pitch_d_ST; //=pitch/ST private:
5858

59-
DTConfigLUTs* _conf_luts;
59+
const DTConfigLUTs* _conf_luts;
6060

6161
};
6262
#endif

L1Trigger/DTTraco/src/Lut.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// Constructors --
1212
//----------------
1313

14-
Lut::Lut(DTConfigLUTs* conf, int ntc, float SL_shift): _conf_luts(conf) {
14+
Lut::Lut(const DTConfigLUTs* conf, int ntc, float SL_shift): _conf_luts(conf) {
1515

1616
// set parameters from configuration
1717
m_d = _conf_luts->D();
@@ -106,7 +106,7 @@ void Lut::setForTestBeam( int station, int board, int traco ) {
106106
}
107107

108108

109-
int Lut::get_k( int addr ) {
109+
int Lut::get_k( int addr ) const{
110110
//FIX attenzione controlla addr - 511 o -512???
111111
int i;
112112
float x;
@@ -120,7 +120,7 @@ int Lut::get_k( int addr ) {
120120
return (int)x;
121121
}
122122

123-
int Lut::get_x( int addr ) {
123+
int Lut::get_x( int addr ) const{
124124
int i;
125125
float a,b,x;
126126

L1Trigger/DTTriggerServerPhi/interface/DTTSCand.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class DTTSCand {
7777
inline void clear();
7878

7979
/// Configuration set
80-
inline DTConfigTSPhi* config() const { return _tss->config(); }
80+
inline const DTConfigTSPhi* config() const { return _tss->config(); }
8181

8282
/// Return associated TRACO trigger
8383
inline const DTTracoTrigData* tracoTr() const { return _tctrig; }

L1Trigger/DTTriggerServerPhi/interface/DTTSM.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DTTSM {
5050
inline int number() const { return _n; }
5151

5252
/// Set configuration
53-
void setConfig(DTConfigTSPhi *config) { _config=config; }
53+
void setConfig(const DTConfigTSPhi *config) { _config=config; }
5454

5555
/// Add a TSS candidate to the TSM, ifs is first/second track flag
5656
void addCand(DTTSCand* cand);
@@ -72,7 +72,7 @@ class DTTSM {
7272
void clear();
7373

7474
/// Configuration set
75-
inline DTConfigTSPhi* config() const { return _config; }
75+
inline const DTConfigTSPhi* config() const { return _config; }
7676

7777
/// Return the number of input tracks (first/second)
7878
unsigned nCand(int ifs) const;
@@ -97,7 +97,7 @@ class DTTSM {
9797

9898
private:
9999

100-
DTConfigTSPhi* _config;
100+
const DTConfigTSPhi* _config;
101101

102102

103103
// SM double TSM

L1Trigger/DTTriggerServerPhi/interface/DTTSPhi.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class DTTSPhi : public DTTSPhiManager, public DTGeomSupplier {
6161
~DTTSPhi();
6262

6363
/// Return the configuration class
64-
inline DTConfigTSPhi* config() const {return _config; }
64+
inline const DTConfigTSPhi* config() const {return _config; }
6565

6666
/// Set configuration
6767
void setConfig(const DTConfigManager *conf);
@@ -111,7 +111,7 @@ class DTTSPhi : public DTTSPhiManager, public DTGeomSupplier {
111111

112112
DTTracoCard* _tracocard;
113113

114-
DTConfigTSPhi* _config;
114+
const DTConfigTSPhi* _config;
115115

116116
// Components
117117
std::vector<DTTSS*> _tss[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1];

L1Trigger/DTTriggerServerPhi/interface/DTTSS.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class DTTSS {
4747
void addDTTSCand(DTTSCand* cand);
4848

4949
/// Set configuration
50-
void setConfig(DTConfigTSPhi *config) { _config=config; }
50+
void setConfig(const DTConfigTSPhi *config) { _config=config; }
5151

5252
/// Set a flag to skip sort2
5353
void ignoreSecondTrack() { _ignoreSecondTrack=1; }
@@ -68,7 +68,7 @@ class DTTSS {
6868
inline int number() const { return _n; }
6969

7070
/// Configuration set
71-
inline DTConfigTSPhi* config() const { return _config; }
71+
inline const DTConfigTSPhi* config() const { return _config; }
7272

7373
/// Return the number of input tracks (first/second)
7474
unsigned nTracoT(int ifs) const;
@@ -99,7 +99,7 @@ class DTTSS {
9999

100100
private:
101101

102-
DTConfigTSPhi* _config;
102+
const DTConfigTSPhi* _config;
103103

104104
// identification
105105
int _n;

L1Trigger/DTTriggerServerTheta/interface/DTTSTheta.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class DTTSTheta : public DTTSThetaManager, public DTGeomSupplier {
5353
~DTTSTheta();
5454

5555
/// Return configuration
56-
inline DTConfigTSTheta* config() const { return _config; }
56+
inline const DTConfigTSTheta* config() const { return _config; }
5757

5858
/// Set configuration
5959
void setConfig(const DTConfigManager *conf);
@@ -106,7 +106,7 @@ class DTTSTheta : public DTTSThetaManager, public DTGeomSupplier {
106106

107107
DTBtiCard* _bticard;
108108

109-
DTConfigTSTheta* _config;
109+
const DTConfigTSTheta* _config;
110110

111111
// Input data
112112
BitArray<DTConfigTSTheta::NCELLTH> _trig[DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1];

L1TriggerConfig/DTTPGConfig/interface/DTConfigLUTs.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ class DTConfigLUTs : public DTConfig {
7575
void print() const ;
7676

7777
//! DSP to IEEE32 conversion
78-
void DSPtoIEEE32(short DSPmantissa, short DSPexp, float *f);
78+
void DSPtoIEEE32(short DSPmantissa, short DSPexp, float *f) const;
7979

8080
//! IEEE32 to DSP conversion
81-
void IEEE32toDSP(float f, short int & DSPmantissa, short int & DSPexp);
81+
void IEEE32toDSP(float f, short int & DSPmantissa, short int & DSPexp) const;
8282

8383
/* //! Return pointer to parameter set */
8484
/* const edm::ParameterSet* getParameterSet() { return m_ps; } */

L1TriggerConfig/DTTPGConfig/interface/DTConfigManager.h

+6-6
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,22 @@ class DTConfigManager {
8282
const std::map<DTTracoId,DTConfigTraco>& getDTConfigTracoMap(DTChamberId) const;
8383

8484
//! Get desired Trigger Server Theta configuration
85-
DTConfigTSTheta* getDTConfigTSTheta(DTChamberId) const;
85+
const DTConfigTSTheta* getDTConfigTSTheta(DTChamberId) const;
8686

8787
//! Get desired Trigger Server Phi configuration
88-
DTConfigTSPhi* getDTConfigTSPhi(DTChamberId) const;
88+
const DTConfigTSPhi* getDTConfigTSPhi(DTChamberId) const;
8989

9090
//! Get desired Trigger Unit configuration
91-
DTConfigTrigUnit* getDTConfigTrigUnit(DTChamberId) const;
91+
const DTConfigTrigUnit* getDTConfigTrigUnit(DTChamberId) const;
9292

9393
//! Get desired LUT configuration
94-
DTConfigLUTs* getDTConfigLUTs(DTChamberId) const;
94+
const DTConfigLUTs* getDTConfigLUTs(DTChamberId) const;
9595

9696
//! Get desired SectorCollector configuration
97-
DTConfigSectColl* getDTConfigSectColl(DTSectCollId) const;
97+
const DTConfigSectColl* getDTConfigSectColl(DTSectCollId) const;
9898

9999
//! Get desired Pedestals configuration
100-
DTConfigPedestals* getDTConfigPedestals() const;
100+
const DTConfigPedestals* getDTConfigPedestals() const;
101101

102102
//! Get global debug flag
103103
inline bool getDTTPGDebug() const { return my_dttpgdebug; };

L1TriggerConfig/DTTPGConfig/interface/DTConfigPedestals.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class DTConfigPedestals : DTConfig {
4545
~DTConfigPedestals();
4646

4747
//! Get wire by wire delay
48-
float getOffset(const DTWireId& wire);
48+
float getOffset(const DTWireId& wire) const;
4949

5050
//! Set parameters from ES
5151
void setES(DTTPGParameters const *tpgParams,

L1TriggerConfig/DTTPGConfig/interface/DTConfigTSPhi.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class DTConfigTSPhi : public DTConfig {
139139

140140
// DBSM-doubleTSM
141141
//! Return the max nb. of TSSs in input to a single TSMD (called ONLY in back-up mode)
142-
int TSSinTSMD(int stat, int sect);
142+
int TSSinTSMD(int stat, int sect) const;
143143

144144
// Set Methods
145145
//! Set debug flag
@@ -221,18 +221,18 @@ class DTConfigTSPhi : public DTConfig {
221221
inline void setTsmStatus(int i, int val) { m_tsmword.set(i,val); };
222222

223223
//! Number of correctly configured TSS
224-
int nValidTSS();
224+
int nValidTSS() const;
225225

226226
//! Number of correctly configured TSS
227-
int nValidTSM();
227+
int nValidTSM() const;
228228

229229
//! Print the setup
230230
void print() const ;
231231

232232
private:
233233

234234
//! Check mask correctness
235-
bool checkMask(unsigned short);
235+
bool checkMask(unsigned short) const;
236236

237237
//! Load pset values into class variables
238238
void setDefaults(const edm:: ParameterSet& ps);
@@ -263,7 +263,7 @@ class DTConfigTSPhi : public DTConfig {
263263

264264
BitArray<24> m_tstren; // Enabled TRACOs
265265
BitArray<8> m_tsmword; // TSM backup mode word
266-
unsigned short int m_ntsstsmd; // nb tss to one of the tsmd (only if back-up mode)
266+
//unsigned short int m_ntsstsmd; // nb tss to one of the tsmd (only if back-up mode)
267267

268268
short int m_ntss;
269269
short int m_ntsm;

L1TriggerConfig/DTTPGConfig/src/DTConfigLUTs.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ DTConfigLUTs::print() const {
113113
}
114114

115115
void
116-
DTConfigLUTs::DSPtoIEEE32(short DSPmantissa, short DSPexp, float *f)
116+
DTConfigLUTs::DSPtoIEEE32(short DSPmantissa, short DSPexp, float *f) const
117117
{
118118
DSPexp -= 15;
119119
*f = DSPmantissa * (float)pow( 2.0, DSPexp );
@@ -122,7 +122,7 @@ DTConfigLUTs::DSPtoIEEE32(short DSPmantissa, short DSPexp, float *f)
122122

123123

124124
void
125-
DTConfigLUTs::IEEE32toDSP(float f, short int & DSPmantissa, short int & DSPexp)
125+
DTConfigLUTs::IEEE32toDSP(float f, short int & DSPmantissa, short int & DSPexp) const
126126
{
127127
long int *pl=0, lm;
128128
bool sign=false;

0 commit comments

Comments
 (0)