29 : FairParGenericSet(name, title, context)
55 LOG(fatal) << GetName() <<
": ASCII input is not defined!";
105 if (
fGlobal) { LOG(warn) << GetName() <<
": Previously defined global settings will be ignored."; }
107 LOG(warn) << GetName() <<
": Overwriting previously defined parameter sets.";
113 TString inputFile = fileName;
116 inFile.open(inputFile.Data());
119 if (!inFile.is_open()) {
120 inputFile = gSystem->Getenv(
"VMCWORKDIR");
121 inputFile +=
"/parameters/sts/" + TString(fileName);
122 inFile.open(inputFile.Data());
126 if (!inFile.is_open()) {
127 LOG(fatal) << GetName() <<
": Cannot read file " << fileName <<
" nor " << inputFile;
135 Double_t vDep = -1.e10;
136 Double_t vBias = -1.e10;
137 Double_t temperature = -1.e10;
138 Double_t cCoupling = -1.e10;
139 Double_t cInterstrip = -1.e10;
142 if (inFile.eof())
break;
143 getline(inFile, input);
144 if (input.empty() || input[0] ==
'#')
continue;
145 std::stringstream line(input);
146 line >> sName >> address >> vDep >> vBias >> temperature >> cCoupling >> cInterstrip;
149 if (vDep < 1.e-9 || vBias < 1.e-9 || temperature < 1.e-9 || cCoupling < 1.e-9 || cInterstrip < 1.e-9) {
150 LOG(fatal) << GetName() <<
": Missing or illegal condition parameters for address " << address <<
"; " << vDep
151 <<
" " << vBias <<
" " << temperature <<
" " << cCoupling <<
" " << cInterstrip;
157 LOG(fatal) << GetName() <<
": Multiple occurence of address " << address <<
" in input file";
162 fParams[address].SetParams(vDep, vBias, temperature, cCoupling, cInterstrip);
167 LOG(info) << GetName() <<
": Read conditions of " << nSensors << (nSensors == 1 ?
" sensor" :
" sensors") <<
" from "
177 Double_t cInterstrip)
179 if (
fGlobal) LOG(warn) << GetName() <<
": Overwriting current global settings!";
180 fGlobalParams.SetParams(vFd, vBias, temperature, cCoupling, cInterstrip);
189 Double_t vFd = conditions.
GetVfd();
190 Double_t vBias = conditions.
GetVbias();
194 SetGlobalPar(vFd, vBias, temperature, cCoupling, cInterstrip);
203 std::stringstream ss;
204 if (!
IsSet()) ss <<
"Empty";
208 ss <<
"Conditions for " <<
fParams.size() <<
" sensors";
ClassImp(CbmStsParSetSensorCond) CbmStsParSetSensorCond
Parameters for operating conditions of a STS sensor.
Double_t GetVbias() const
Bias voltage.
Double_t GetCcoupling() const
Coupling capacitance.
Double_t GetTemperature() const
Temperature.
Double_t GetCinterstrip() const
Inter-strip capacitance.
Parameters container for CbmStsParSensorCond.
std::string ToString()
Info to string.
void Init()
Initialise all condition parameters.
UInt_t ReadParams(const char *fileName)
Read sensor conditions from file.
virtual void putParams(FairParamList *parList)
Writing parameters to ASCII. Abstract in base class.
void SetGlobalPar(Double_t vDep, Double_t vBias, Double_t temperature, Double_t cCoupling, Double_t cInterstrip)
Set global conditions (for all sensors)
CbmStsParSensorCond fGlobalParams
Global parameters, used for all sensors.
Bool_t fGlobal
Use global parameters for all sensors.
std::map< UInt_t, CbmStsParSensorCond > fParams
Map of parameters. Key is sensor address.
CbmStsParSetSensorCond(const char *name="CbmStsParSetSensorCond", const char *title="STS parameters", const char *context="Default")
Constructor.
virtual void clear()
Reset all parameters.
const CbmStsParSensorCond & GetParSensor(UInt_t address)
Get condition parameters of a sensor.
virtual Bool_t getParams(FairParamList *parList)
Reading parameters from ASCII. Abstract in base class.
Bool_t IsSet() const
Check for parameter set being filled.
virtual ~CbmStsParSetSensorCond()
Destructor.