Skip to content

Commit 76fd54a

Browse files
committed
read sqrtSNN from CCDB
1 parent b72b72b commit 76fd54a

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

DPG/Tasks/TPC/tpcSkimsTableCreator.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ struct TreeWriterTpcV0 {
9393
Configurable<double> dwnSmplFactorPr{"dwnSmplFactorPr", 1., "downsampling factor for protons, default fraction to keep is 1."};
9494
Configurable<double> dwnSmplFactorEl{"dwnSmplFactorEl", 1., "downsampling factor for electrons, default fraction to keep is 1."};
9595
Configurable<double> dwnSmplFactorKa{"dwnSmplFactorKa", 1., "downsampling factor for kaons, default fraction to keep is 1."};
96-
Configurable<float> sqrtSNN{"sqrtSNN", 5360., "sqrt(s_NN), used for downsampling with the Tsallis distribution"};
9796
Configurable<float> downsamplingTsalisPions{"downsamplingTsalisPions", -1., "Downsampling factor to reduce the number of pions"};
9897
Configurable<float> downsamplingTsalisProtons{"downsamplingTsalisProtons", -1., "Downsampling factor to reduce the number of protons"};
9998
Configurable<float> downsamplingTsalisElectrons{"downsamplingTsalisElectrons", -1., "Downsampling factor to reduce the number of electrons"};
@@ -424,6 +423,7 @@ struct TreeWriterTpcV0 {
424423
aod::pidits::ITSNSigmaKa, aod::pidits::ITSNSigmaPr>(myTracks);
425424

426425
std::string irSource{};
426+
float sqrtSNN{};
427427
bool isFirstCollision{true};
428428
for (const auto& collision : collisions) {
429429
if (!isEventSelected(collision, applyEvSel)) {
@@ -438,7 +438,7 @@ struct TreeWriterTpcV0 {
438438
const auto cascs = myCascs.sliceBy(perCollisionCascs, static_cast<int>(collision.globalIndex()));
439439
const auto bc = collision.bc_as<BCType>();
440440
if (isFirstCollision) {
441-
irSource = evaluateIrSource(ccdb, ccdbPathGrpLhcIf, bc.timestamp());
441+
evaluateIrSourceAndSqrtSnn(ccdb, ccdbPathGrpLhcIf, bc.timestamp(), irSource, sqrtSNN);
442442
}
443443
isFirstCollision = false;
444444
const int runnumber = bc.runNumber();
@@ -632,7 +632,6 @@ struct TreeWriterTpcTof {
632632
Configurable<float> nSigmaTofTpctofPi{"nSigmaTofTpctofPi", 4., "number of sigma for TOF cut for TPC and TOF combined pion"};
633633
Configurable<double> dwnSmplFactorPi{"dwnSmplFactorPi", 1., "downsampling factor for pions, default fraction to keep is 1."};
634634
/// pT dependent downsampling
635-
Configurable<float> sqrtSNN{"sqrtSNN", 5360., "sqrt(s_NN), used for downsampling with the Tsallis distribution"};
636635
Configurable<float> downsamplingTsalisTritons{"downsamplingTsalisTritons", -1., "Downsampling factor to reduce the number of tritons"};
637636
Configurable<float> downsamplingTsalisDeuterons{"downsamplingTsalisDeuterons", -1., "Downsampling factor to reduce the number of deuterons"};
638637
Configurable<float> downsamplingTsalisProtons{"downsamplingTsalisProtons", -1., "Downsampling factor to reduce the number of protons"};
@@ -812,6 +811,7 @@ struct TreeWriterTpcTof {
812811
}
813812
}
814813
std::string irSource{};
814+
float sqrtSNN{};
815815
bool isFirstCollision{true};
816816
for (const auto& collision : collisions) {
817817
const auto tracks = myTracks.sliceBy(perCollisionTracksType, collision.globalIndex());
@@ -833,7 +833,7 @@ struct TreeWriterTpcTof {
833833

834834
const auto bc = collision.bc_as<BCType>();
835835
if (isFirstCollision) {
836-
irSource = evaluateIrSource(ccdb, ccdbPathGrpLhcIf, bc.timestamp());
836+
evaluateIrSourceAndSqrtSnn(ccdb, ccdbPathGrpLhcIf, bc.timestamp(), irSource, sqrtSNN);
837837
}
838838
isFirstCollision = false;
839839
const int runnumber = bc.runNumber();

DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,24 +118,25 @@ double tpcSignalGeneric(const TrkType& track)
118118
}
119119
}
120120

121-
/// Determine inteaction rate source from CCDB
122-
std::string evaluateIrSource(const o2::framework::Service<o2::ccdb::BasicCCDBManager>& ccdb, const std::string& ccdbPathGrpLhcIf, const uint64_t timestamp)
121+
/// Determine interaction rate source and sqrtSNN from CCDB
122+
void evaluateIrSourceAndSqrtSnn(const o2::framework::Service<o2::ccdb::BasicCCDBManager>& ccdb, const std::string& ccdbPathGrpLhcIf, const uint64_t timestamp, std::string& irSource, float& sqrtSNN)
123123
{
124-
std::string irSource{};
125124
o2::parameters::GRPLHCIFData* genRunParams = ccdb->template getForTimeStamp<o2::parameters::GRPLHCIFData>(ccdbPathGrpLhcIf, timestamp);
126125
if (genRunParams != nullptr) {
127-
o2::common::core::CollisionSystemType::collType collSys = CollisionSystemType::getCollisionTypeFromGrp(genRunParams);
126+
const auto collSys = CollisionSystemType::getCollisionTypeFromGrp(genRunParams);
128127
if (collSys == CollisionSystemType::kCollSyspp) {
129128
irSource = "T0VTX";
130129
} else {
131130
irSource = "ZNC hadronic";
132131
}
132+
sqrtSNN = genRunParams->getSqrtS();
133133
LOG(info) << "irSource determined from General Run Parameters: " << irSource;
134+
LOG(info) << "sqrtSNN determined from General Run Parameters: " << sqrtSNN << " GeV";
134135
} else {
135-
LOG(info) << "No General Run Parameters object found. irSource will remain undefined";
136+
irSource = "";
137+
sqrtSNN = 5360.f;
138+
LOG(warning) << "No General Run Parameters object found. irSource will remain undefined, sqrtSNN defaulted to 5360 GeV";
136139
}
137-
138-
return irSource;
139140
}
140141

141142
struct OccupancyValues {

0 commit comments

Comments
 (0)