CbmRoot
Loading...
Searching...
No Matches
CbmStsParSetModule.h
Go to the documentation of this file.
1/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer] */
4
11#ifndef CBMSTSPARSETMODULE_H
12#define CBMSTSPARSETMODULE_H 1
13
14#include "CbmStsParModule.h" // for CbmStsParModule
15
16#include <FairParGenericSet.h> // for FairParGenericSet
17
18#include <Rtypes.h> // for THashConsistencyHolder, ClassDef
19#include <RtypesCore.h> // for UInt_t, Bool_t, kFALSE, kTRUE
20
21#include <map> // for map
22#include <string> // for string
23
24class FairParamList;
25
34class CbmStsParSetModule : public FairParGenericSet {
35
36public:
42 CbmStsParSetModule(const char* name = "CbmParSetModule", const char* title = "STS parameters",
43 const char* context = "Default");
44
45
47 virtual ~CbmStsParSetModule();
48
49
51 virtual void clear();
52
53
58 UInt_t DeactivateRandomChannels(Double_t fraction);
59
60
65 virtual Bool_t getParams(FairParamList* parList);
66
67
72 const CbmStsParModule& GetParModule(UInt_t address);
73
74
81 Bool_t IsSet() const { return (fUseGlobal || (!fParams.empty())); }
82
83
84 virtual void putParams(FairParamList* parList);
85
86
90 void SetGlobalPar(const CbmStsParModule& params)
91 {
92 fGlobalParams = params;
93 fUseGlobal = kTRUE;
94 }
95
100 void SetParModule(UInt_t address, const CbmStsParModule& par);
101
102
104 std::string ToString() const;
105
106
107private:
109 Bool_t fUseGlobal = kFALSE;
110
113
115 std::map<UInt_t, CbmStsParModule> fParams {};
116
117
119};
120
121#endif /* CBMSTSPARSETMODULE */
Parameters for one STS module.
Parameters container for CbmStsParModule.
virtual void putParams(FairParamList *parList)
virtual Bool_t getParams(FairParamList *parList)
Reading parameters from ASCII. Abstract in base class.
ClassDef(CbmStsParSetModule, 1)
void SetGlobalPar(const CbmStsParModule &params)
Set global parameters (for all modules)
CbmStsParModule fGlobalParams
Global parameters, used for all modules.
std::map< UInt_t, CbmStsParModule > fParams
Map of parameters. Key is module address.
Bool_t fUseGlobal
Flag for using global parameters.
CbmStsParSetModule(const char *name="CbmParSetModule", const char *title="STS parameters", const char *context="Default")
Constructor.
const CbmStsParModule & GetParModule(UInt_t address)
Get condition parameters of a sensor.
virtual void clear()
Reset all parameters.
void SetParModule(UInt_t address, const CbmStsParModule &par)
Set the parameters for a module.
UInt_t DeactivateRandomChannels(Double_t fraction)
Randomly deactivate a fraction of the channels.
std::string ToString() const
Info to string.
virtual ~CbmStsParSetModule()
Destructor.
Bool_t IsSet() const
Check whether parameter container is set.