30 : FairParGenericSet(name, title, context)
56 LOG(fatal) << GetName() <<
": ASCII input is not defined!";
106 if (
fGlobal) { LOG(warn) << GetName() <<
": Previously defined global settings will be ignored."; }
108 LOG(warn) << GetName() <<
": Overwriting previously defined parameter sets.";
114 TString inputFile = fileName;
117 inFile.open(inputFile.Data());
120 if (!inFile.is_open()) {
121 inputFile = gSystem->Getenv(
"VMCWORKDIR");
122 inputFile +=
"/parameters/sts/" + TString(fileName);
123 inFile.open(inputFile.Data());
127 if (!inFile.is_open()) {
128 LOG(fatal) << GetName() <<
": Cannot read file " << fileName <<
" nor " << inputFile;
136 Double_t vDep = -1.e10;
137 Double_t vBias = -1.e10;
138 Double_t temperature = -1.e10;
139 Double_t cCoupling = -1.e10;
140 Double_t cInterstrip = -1.e10;
143 if (inFile.eof())
break;
144 getline(inFile, input);
145 if (input.empty() || input[0] ==
'#')
continue;
146 std::stringstream line(input);
147 line >> sName >> address >> vDep >> vBias >> temperature >> cCoupling >> cInterstrip;
150 if (vDep < 1.e-9 || vBias < 1.e-9 || temperature < 1.e-9 || cCoupling < 1.e-9 || cInterstrip < 1.e-9) {
151 LOG(fatal) << GetName() <<
": Missing or illegal condition parameters for address " << address <<
"; " << vDep
152 <<
" " << vBias <<
" " << temperature <<
" " << cCoupling <<
" " << cInterstrip;
158 LOG(fatal) << GetName() <<
": Multiple occurence of address " << address <<
" in input file";
163 fParams[address].SetParams(vDep, vBias, temperature, cCoupling, cInterstrip);
168 LOG(info) << GetName() <<
": Read conditions of " << nSensors << (nSensors == 1 ?
" sensor" :
" sensors") <<
" from "
178 Double_t cInterstrip)
180 if (
fGlobal) LOG(warn) << GetName() <<
": Overwriting current global settings!";
190 Double_t vFd = conditions.
GetVfd();
191 Double_t vBias = conditions.
GetVbias();
195 SetGlobalPar(vFd, vBias, temperature, cCoupling, cInterstrip);
204 std::stringstream ss;
205 if (!
IsSet()) ss <<
"Empty";
209 ss <<
"Conditions for " <<
fParams.size() <<
" sensors";
ClassImp(CbmStsParSetSensorCond) CbmStsParSetSensorCond
Parameters for operating conditions of a STS sensor.
Double_t GetVbias() const
Bias voltage.
std::string ToString() const
String output.
void SetParams(Double_t vFd, Double_t vBias, Double_t temperature, Double_t cCoupling, Double_t cInterstrip)
Set the condition parameters.
Double_t GetCcoupling() const
Coupling capacitance.
Double_t GetTemperature() const
Temperature.
void Init()
Calculate the derived parameters.
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.