Skip to content

Commit 8a36206

Browse files
authored
TPC/simulation: Add PT correction to gas density using configurable p… (#13048)
* TPC/simulation: Add PT correction to gas density using configurable parameters
1 parent 17f8c92 commit 8a36206

File tree

2 files changed

+26
-5
lines changed

2 files changed

+26
-5
lines changed

Detectors/TPC/base/include/TPCBase/ParameterGas.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ struct ParameterGas : public o2::conf::ConfigurableParamHelper<ParameterGas> {
3939
float Nprim = 14.f; ///< Number of primary electrons per MIP and cm [1/cm]
4040
float ScaleFactorG4 = 0.85f; ///< Scale factor to tune WION for GEANT4
4141
float FanoFactorG4 = 0.7f; ///< Parameter for smearing the number of ionizations (nel) using GEANT4
42+
float Pressure = 1013.25f; ///< Pressure [mbar]
43+
float Temperature = 20.0f; ///< Temperature [°C]
4244
float BetheBlochParam[5] = {0.820172e-1f, 9.94795f, 8.97292e-05f, 2.05873f, 1.65272f}; ///< Parametrization of Bethe-Bloch
4345

4446
O2ParamDef(ParameterGas, "TPCGasParam");

Detectors/TPC/simulation/src/Detector.cxx

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ void Detector::CreateMaterials()
315315
// Origin: Marek Kowalski IFJ, Krakow, Marek.Kowalski@ifj.edu.pl
316316
//-----------------------------------------------------------------
317317

318+
const auto& gasParam = ParameterGas::Instance();
319+
318320
Int_t iSXFLD = 2;
319321
Float_t sXMGMX = 10.0;
320322
// init the field tracking params
@@ -326,6 +328,23 @@ void Detector::CreateMaterials()
326328

327329
Float_t density;
328330

331+
// TODO: load pressure and temperature values from CCDB
332+
const Double_t pressure = gasParam.Pressure; // in mbar
333+
const Double_t temperature = gasParam.Temperature + 273.15; // in K
334+
335+
// densities were taken for these values
336+
const Double_t t1 = 293.15; // 20°C in K
337+
const Double_t p1 = 1013.25; // 1 atm in mbars
338+
339+
// sanity check - temperature between 10 and 30 deg, pressure between 800 and 1200 mbar
340+
Double_t ptCorr = 1.;
341+
if (TMath::Abs(temperature - 293.15) > 10. || TMath::Abs(pressure - 1000.) > 200.) {
342+
ptCorr = 1.;
343+
} else {
344+
ptCorr = (pressure * t1) / (p1 * temperature);
345+
}
346+
LOG(info) << "Setting gas density correction to: " << ptCorr;
347+
329348
//***************** Gases *************************
330349

331350
//--------------------------------------------------------------
@@ -345,7 +364,7 @@ void Detector::CreateMaterials()
345364

346365
density = 1.842e-3;
347366

348-
o2::base::Detector::Mixture(10, "CO2", amat, zmat, density, 2, wmat);
367+
o2::base::Detector::Mixture(10, "CO2", amat, zmat, density * ptCorr, 2, wmat);
349368
//
350369
// Air
351370
//
@@ -360,7 +379,7 @@ void Detector::CreateMaterials()
360379
//
361380
density = 0.001205;
362381

363-
o2::base::Detector::Mixture(11, "Air", amat, zmat, density, 2, wmat);
382+
o2::base::Detector::Mixture(11, "Air", amat, zmat, density * ptCorr, 2, wmat);
364383

365384
//----------------------------------------------------------------
366385
// drift gases 5 mixtures, 5 materials
@@ -466,9 +485,9 @@ void Detector::CreateMaterials()
466485
}
467486

468487
//
469-
o2::base::Detector::Mixture(12, gname1.Data(), amat1, zmat1, density, cnt, wmat1); // nonsensitive
470-
o2::base::Detector::Mixture(13, gname2.Data(), amat1, zmat1, density, cnt, wmat1); // sensitive
471-
o2::base::Detector::Mixture(40, gname3.Data(), amat1, zmat1, density, cnt, wmat1); // sensitive Kr
488+
o2::base::Detector::Mixture(12, gname1.Data(), amat1, zmat1, density * ptCorr, cnt, wmat1); // nonsensitive
489+
o2::base::Detector::Mixture(13, gname2.Data(), amat1, zmat1, density * ptCorr, cnt, wmat1); // sensitive
490+
o2::base::Detector::Mixture(40, gname3.Data(), amat1, zmat1, density * ptCorr, cnt, wmat1); // sensitive Kr
472491

473492
//----------------------------------------------------------------------
474493
// solid materials

0 commit comments

Comments
 (0)