Skip to content

Commit

Permalink
Thread-safety: make all DTConfigManager::getDTConfig..() const to ret…
Browse files Browse the repository at this point in the history
…urn a const pointer
  • Loading branch information
smuzaffar committed Nov 12, 2013
1 parent 1c1d004 commit 6407681
Show file tree
Hide file tree
Showing 22 changed files with 65 additions and 69 deletions.
2 changes: 1 addition & 1 deletion DQM/DTMonitorClient/src/DTFineDelayCorr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void DTFineDelayCorr::runClientDiagnostic() {

// ** Retrieve Delays Loaded in MiniCrates **
if(readOldFromDb) { // read from db
DTConfigPedestals *pedestals = dtConfig->getDTConfigPedestals();
const DTConfigPedestals *pedestals = dtConfig->getDTConfigPedestals();
const DTLayer *layer = muonGeom->layer(DTLayerId(chId,1,1));
float delay = pedestals->getOffset(DTWireId(layer->id(),layer->specificTopology().firstChannel()));
coarseDelay = int(delay/25.);
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/DTBti/interface/DTBtiCard.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class DTBtiCard : public BTICache, public DTGeomSupplier {
std::vector<DTDigi*> _digis;

bool _debug;
DTConfigPedestals* _pedestals;
const DTConfigPedestals* _pedestals;

bool _flag_acc;
};
Expand Down
6 changes: 3 additions & 3 deletions L1Trigger/DTSectorCollector/interface/DTSC.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class DTSC{
// non-const methods

/// Set configuration
void setConfig(DTConfigSectColl *conf) { _config=conf; };
void setConfig(const DTConfigSectColl *conf) { _config=conf; };

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

//! Configuration set
inline DTConfigSectColl* config() const { return _config; }
inline const DTConfigSectColl* config() const { return _config; }

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

// Configuration
DTConfigSectColl* _config;
const DTConfigSectColl* _config;

// input phi data
std::vector<DTSectCollPhCand*> _incand_ph[2];
Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/DTSectorCollector/interface/DTSectColl.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class DTSectColl : public DTSCPhCache, public DTSCThCache {
inline DTTSTheta* getTSTheta(int istat) const { return _tstheta[istat-1]; }

//!Configuration
inline DTConfigSectColl* config() const { return _config; }
inline const DTConfigSectColl* config() const { return _config; }

// non-const methods

Expand Down Expand Up @@ -182,7 +182,7 @@ class DTSectColl : public DTSCPhCache, public DTSCThCache {
private:

// Configuration
DTConfigSectColl* _config;
const DTConfigSectColl* _config;

// SC Id
DTSectCollId _sectcollid;
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/DTSectorCollector/interface/DTSectCollPhCand.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class DTSectCollPhCand {
// Const methods

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

//! Return the DTTSS
inline DTSC* tsc() const { return _tsc; }
Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/DTSectorCollector/interface/DTSectCollThCand.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class DTSectCollThCand {
// Const methods

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

//! Return the DTTSS
inline DTSC* tsc() const { return _tsc; }
Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/DTTraco/interface/DTTracoCard.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class DTTracoCard : public TRACOCache, public DTGeomSupplier {
virtual void reconstruct() { clearCache(); loadTRACO(); runTRACO(); }

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

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

DTConfigLUTs* _conf_luts;
const DTConfigLUTs* _conf_luts;

bool _debug;

Expand Down
8 changes: 4 additions & 4 deletions L1Trigger/DTTraco/interface/Lut.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ class Lut {

public:
Lut() {};
Lut(DTConfigLUTs* conf, int ntc, float SL_shift);
Lut(const DTConfigLUTs* conf, int ntc, float SL_shift);
~Lut();

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

// get luts
int get_x( int addr );
int get_k( int addr );
int get_x( int addr ) const;
int get_k( int addr ) const;

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

DTConfigLUTs* _conf_luts;
const DTConfigLUTs* _conf_luts;

};
#endif
6 changes: 3 additions & 3 deletions L1Trigger/DTTraco/src/Lut.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// Constructors --
//----------------

Lut::Lut(DTConfigLUTs* conf, int ntc, float SL_shift): _conf_luts(conf) {
Lut::Lut(const DTConfigLUTs* conf, int ntc, float SL_shift): _conf_luts(conf) {

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


int Lut::get_k( int addr ) {
int Lut::get_k( int addr ) const{
//FIX attenzione controlla addr - 511 o -512???
int i;
float x;
Expand All @@ -120,7 +120,7 @@ int Lut::get_k( int addr ) {
return (int)x;
}

int Lut::get_x( int addr ) {
int Lut::get_x( int addr ) const{
int i;
float a,b,x;

Expand Down
2 changes: 1 addition & 1 deletion L1Trigger/DTTriggerServerPhi/interface/DTTSCand.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class DTTSCand {
inline void clear();

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

/// Return associated TRACO trigger
inline const DTTracoTrigData* tracoTr() const { return _tctrig; }
Expand Down
6 changes: 3 additions & 3 deletions L1Trigger/DTTriggerServerPhi/interface/DTTSM.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class DTTSM {
inline int number() const { return _n; }

/// Set configuration
void setConfig(DTConfigTSPhi *config) { _config=config; }
void setConfig(const DTConfigTSPhi *config) { _config=config; }

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

/// Configuration set
inline DTConfigTSPhi* config() const { return _config; }
inline const DTConfigTSPhi* config() const { return _config; }

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

private:

DTConfigTSPhi* _config;
const DTConfigTSPhi* _config;


// SM double TSM
Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/DTTriggerServerPhi/interface/DTTSPhi.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class DTTSPhi : public DTTSPhiManager, public DTGeomSupplier {
~DTTSPhi();

/// Return the configuration class
inline DTConfigTSPhi* config() const {return _config; }
inline const DTConfigTSPhi* config() const {return _config; }

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

DTTracoCard* _tracocard;

DTConfigTSPhi* _config;
const DTConfigTSPhi* _config;

// Components
std::vector<DTTSS*> _tss[DTConfigTSPhi::NSTEPL-DTConfigTSPhi::NSTEPF+1];
Expand Down
6 changes: 3 additions & 3 deletions L1Trigger/DTTriggerServerPhi/interface/DTTSS.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class DTTSS {
void addDTTSCand(DTTSCand* cand);

/// Set configuration
void setConfig(DTConfigTSPhi *config) { _config=config; }
void setConfig(const DTConfigTSPhi *config) { _config=config; }

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

/// Configuration set
inline DTConfigTSPhi* config() const { return _config; }
inline const DTConfigTSPhi* config() const { return _config; }

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

private:

DTConfigTSPhi* _config;
const DTConfigTSPhi* _config;

// identification
int _n;
Expand Down
4 changes: 2 additions & 2 deletions L1Trigger/DTTriggerServerTheta/interface/DTTSTheta.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class DTTSTheta : public DTTSThetaManager, public DTGeomSupplier {
~DTTSTheta();

/// Return configuration
inline DTConfigTSTheta* config() const { return _config; }
inline const DTConfigTSTheta* config() const { return _config; }

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

DTBtiCard* _bticard;

DTConfigTSTheta* _config;
const DTConfigTSTheta* _config;

// Input data
BitArray<DTConfigTSTheta::NCELLTH> _trig[DTConfigTSTheta::NSTEPL-DTConfigTSTheta::NSTEPF+1];
Expand Down
4 changes: 2 additions & 2 deletions L1TriggerConfig/DTTPGConfig/interface/DTConfigLUTs.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ class DTConfigLUTs : public DTConfig {
void print() const ;

//! DSP to IEEE32 conversion
void DSPtoIEEE32(short DSPmantissa, short DSPexp, float *f);
void DSPtoIEEE32(short DSPmantissa, short DSPexp, float *f) const;

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

/* //! Return pointer to parameter set */
/* const edm::ParameterSet* getParameterSet() { return m_ps; } */
Expand Down
12 changes: 6 additions & 6 deletions L1TriggerConfig/DTTPGConfig/interface/DTConfigManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,22 @@ class DTConfigManager {
const std::map<DTTracoId,DTConfigTraco>& getDTConfigTracoMap(DTChamberId) const;

//! Get desired Trigger Server Theta configuration
DTConfigTSTheta* getDTConfigTSTheta(DTChamberId) const;
const DTConfigTSTheta* getDTConfigTSTheta(DTChamberId) const;

//! Get desired Trigger Server Phi configuration
DTConfigTSPhi* getDTConfigTSPhi(DTChamberId) const;
const DTConfigTSPhi* getDTConfigTSPhi(DTChamberId) const;

//! Get desired Trigger Unit configuration
DTConfigTrigUnit* getDTConfigTrigUnit(DTChamberId) const;
const DTConfigTrigUnit* getDTConfigTrigUnit(DTChamberId) const;

//! Get desired LUT configuration
DTConfigLUTs* getDTConfigLUTs(DTChamberId) const;
const DTConfigLUTs* getDTConfigLUTs(DTChamberId) const;

//! Get desired SectorCollector configuration
DTConfigSectColl* getDTConfigSectColl(DTSectCollId) const;
const DTConfigSectColl* getDTConfigSectColl(DTSectCollId) const;

//! Get desired Pedestals configuration
DTConfigPedestals* getDTConfigPedestals() const;
const DTConfigPedestals* getDTConfigPedestals() const;

//! Get global debug flag
inline bool getDTTPGDebug() const { return my_dttpgdebug; };
Expand Down
2 changes: 1 addition & 1 deletion L1TriggerConfig/DTTPGConfig/interface/DTConfigPedestals.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class DTConfigPedestals : DTConfig {
~DTConfigPedestals();

//! Get wire by wire delay
float getOffset(const DTWireId& wire);
float getOffset(const DTWireId& wire) const;

//! Set parameters from ES
void setES(DTTPGParameters const *tpgParams,
Expand Down
10 changes: 5 additions & 5 deletions L1TriggerConfig/DTTPGConfig/interface/DTConfigTSPhi.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class DTConfigTSPhi : public DTConfig {

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

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

//! Number of correctly configured TSS
int nValidTSS();
int nValidTSS() const;

//! Number of correctly configured TSS
int nValidTSM();
int nValidTSM() const;

//! Print the setup
void print() const ;

private:

//! Check mask correctness
bool checkMask(unsigned short);
bool checkMask(unsigned short) const;

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

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

short int m_ntss;
short int m_ntsm;
Expand Down
4 changes: 2 additions & 2 deletions L1TriggerConfig/DTTPGConfig/src/DTConfigLUTs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ DTConfigLUTs::print() const {
}

void
DTConfigLUTs::DSPtoIEEE32(short DSPmantissa, short DSPexp, float *f)
DTConfigLUTs::DSPtoIEEE32(short DSPmantissa, short DSPexp, float *f) const
{
DSPexp -= 15;
*f = DSPmantissa * (float)pow( 2.0, DSPexp );
Expand All @@ -122,7 +122,7 @@ DTConfigLUTs::DSPtoIEEE32(short DSPmantissa, short DSPexp, float *f)


void
DTConfigLUTs::IEEE32toDSP(float f, short int & DSPmantissa, short int & DSPexp)
DTConfigLUTs::IEEE32toDSP(float f, short int & DSPmantissa, short int & DSPexp) const
{
long int *pl=0, lm;
bool sign=false;
Expand Down
Loading

0 comments on commit 6407681

Please sign in to comment.