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
9
10
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
70 Bool_t LoadParASCII(std::string file_name);
71
72
77 const CbmStsParModule& GetParModule(UInt_t address);
78
79
86 Bool_t IsSet() const { return (fUseGlobal || (!fParams.empty())); }
87
88
89 virtual void putParams(FairParamList* parList);
90
91
95 void SetGlobalPar(const CbmStsParModule& params)
96 {
97 fGlobalParams = params;
98 fUseGlobal = kTRUE;
99 }
100
105 void SetParModule(UInt_t address, const CbmStsParModule& par);
106
107
109 std::string ToString() const;
110
111
112private:
115
118
120 std::map<UInt_t, CbmStsParModule> fParams {};
121
122
124};
125
126#endif /* CBMSTSPARSETMODULE */
bool Bool_t
Parameters for one STS module.
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.
Bool_t LoadParASCII(std::string file_name)
Reading parameters from ASCII.
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.