Skip to content

Commit 8d38eca

Browse files
committed
Add changes in calibration parameters
1 parent 65b0cff commit 8d38eca

File tree

1 file changed

+52
-22
lines changed

1 file changed

+52
-22
lines changed

PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx

Lines changed: 52 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,18 @@ struct FlattenictyPikp {
229229
Configurable<bool> cfgFillV0Hist{"cfgFillV0Hist", false, "fill V0 histograms"};
230230
Configurable<bool> cfgFillChrgType{"cfgFillChrgType", false, "fill histograms per charge types"};
231231
Configurable<bool> cfgFillChrgTypeV0s{"cfgFillChrgTypeV0s", false, "fill V0s histograms per charge types"};
232-
Configurable<std::vector<float>> paramsFuncMIPpos{"paramsFuncMIPpos", std::vector<float>{-1.f}, "parameters of pol2"};
233-
Configurable<std::vector<float>> paramsFuncMIPneg{"paramsFuncMIPneg", std::vector<float>{-1.f}, "parameters of pol2"};
234-
Configurable<std::vector<float>> paramsFuncMIPall{"paramsFuncMIPall", std::vector<float>{-1.f}, "parameters of pol2"};
235-
Configurable<std::vector<float>> paramsFuncPlateaUpos{"paramsFuncPlateaUpos", std::vector<float>{-1.f}, "parameters of pol2"};
236-
Configurable<std::vector<float>> paramsFuncPlateaUneg{"paramsFuncPlateaUneg", std::vector<float>{-1.f}, "parameters of pol2"};
237-
Configurable<std::vector<float>> paramsFuncPlateaUall{"paramsFuncPlateaUall", std::vector<float>{-1.f}, "parameters of pol2"};
232+
Configurable<std::vector<float>> paramsFuncMIPposEtaP{"paramsFuncMIPposEtaP", std::vector<float>{-1.f}, "parameters of pol2"};
233+
Configurable<std::vector<float>> paramsFuncMIPnegEtaP{"paramsFuncMIPnegEtaP", std::vector<float>{-1.f}, "parameters of pol2"};
234+
Configurable<std::vector<float>> paramsFuncMIPallEtaP{"paramsFuncMIPallEtaP", std::vector<float>{-1.f}, "parameters of pol2"};
235+
Configurable<std::vector<float>> paramsFuncMIPposEtaN{"paramsFuncMIPposEtaN", std::vector<float>{-1.f}, "parameters of pol2"};
236+
Configurable<std::vector<float>> paramsFuncMIPnegEtaN{"paramsFuncMIPnegEtaN", std::vector<float>{-1.f}, "parameters of pol2"};
237+
Configurable<std::vector<float>> paramsFuncMIPallEtaN{"paramsFuncMIPallEtaN", std::vector<float>{-1.f}, "parameters of pol2"};
238+
Configurable<std::vector<float>> paramsFuncPlateaUposEtaP{"paramsFuncPlateaUposEtaP", std::vector<float>{-1.f}, "parameters of pol2"};
239+
Configurable<std::vector<float>> paramsFuncPlateaUnegEtaP{"paramsFuncPlateaUnegEtaP", std::vector<float>{-1.f}, "parameters of pol2"};
240+
Configurable<std::vector<float>> paramsFuncPlateaUallEtaP{"paramsFuncPlateaUallEtaP", std::vector<float>{-1.f}, "parameters of pol2"};
241+
Configurable<std::vector<float>> paramsFuncPlateaUposEtaN{"paramsFuncPlateaUposEtaN", std::vector<float>{-1.f}, "parameters of pol2"};
242+
Configurable<std::vector<float>> paramsFuncPlateaUnegEtaN{"paramsFuncPlateaUnegEtaN", std::vector<float>{-1.f}, "parameters of pol2"};
243+
Configurable<std::vector<float>> paramsFuncPlateaUallEtaN{"paramsFuncPlateaUallEtaN", std::vector<float>{-1.f}, "parameters of pol2"};
238244
Configurable<std::string> cfgGainEqCcdbPath{"cfgGainEqCcdbPath", "Users/g/gbencedi/flattenicity/GainEq", "CCDB path for gain equalization constants"};
239245
Configurable<std::string> cfgVtxEqCcdbPath{"cfgVtxEqCcdbPath", "Users/g/gbencedi/flattenicity/ZvtxEq", "CCDB path for z-vertex equalization constants"};
240246
Configurable<std::string> cfgDeDxCalibCcdbPath{"cfgDeDxCalibCcdbPath", "Users/g/gbencedi/flattenicity/dEdxCalib", "CCDB path for dEdx calibration"};
@@ -403,25 +409,38 @@ struct FlattenictyPikp {
403409

404410
void init(InitContext&)
405411
{
406-
auto vecParamsMIPpos = (std::vector<float>)paramsFuncMIPpos;
407-
auto vecParamsMIPneg = (std::vector<float>)paramsFuncMIPneg;
408-
auto vecParamsMIPall = (std::vector<float>)paramsFuncMIPall;
409-
auto vecParamsPLApos = (std::vector<float>)paramsFuncPlateaUpos;
410-
auto vecParamsPLAneg = (std::vector<float>)paramsFuncPlateaUneg;
411-
auto vecParamsPLAall = (std::vector<float>)paramsFuncPlateaUall;
412+
auto vecParamsMIPposEtaP = (std::vector<float>)paramsFuncMIPposEtaP;
413+
auto vecParamsMIPposEtaN = (std::vector<float>)paramsFuncMIPposEtaN;
414+
auto vecParamsMIPnegEtaP = (std::vector<float>)paramsFuncMIPnegEtaP;
415+
auto vecParamsMIPnegEtaN = (std::vector<float>)paramsFuncMIPnegEtaN;
416+
auto vecParamsMIPallEtaP = (std::vector<float>)paramsFuncMIPallEtaP;
417+
auto vecParamsMIPallEtaN = (std::vector<float>)paramsFuncMIPallEtaN;
418+
419+
auto vecParamsPLAposEtaP = (std::vector<float>)paramsFuncPlateaUposEtaP;
420+
auto vecParamsPLAposEtaN = (std::vector<float>)paramsFuncPlateaUposEtaN;
421+
auto vecParamsPLAnegEtaP = (std::vector<float>)paramsFuncPlateaUnegEtaP;
422+
auto vecParamsPLAnegEtaN = (std::vector<float>)paramsFuncPlateaUnegEtaN;
423+
auto vecParamsPLAallEtaP = (std::vector<float>)paramsFuncPlateaUallEtaP;
424+
auto vecParamsPLAallEtaN = (std::vector<float>)paramsFuncPlateaUallEtaN;
412425

413426
auto addVec = [&](std::vector<std::vector<float>>& targetVec, const std::string& name, bool isMIP) {
414427
if (isMIP) {
415-
targetVec.emplace_back(vecParamsMIPpos);
416-
targetVec.emplace_back(vecParamsMIPneg);
417-
targetVec.emplace_back(vecParamsMIPall);
428+
targetVec.emplace_back(vecParamsMIPposEtaP);
429+
targetVec.emplace_back(vecParamsMIPnegEtaP);
430+
targetVec.emplace_back(vecParamsMIPallEtaP);
431+
targetVec.emplace_back(vecParamsMIPposEtaN);
432+
targetVec.emplace_back(vecParamsMIPnegEtaN);
433+
targetVec.emplace_back(vecParamsMIPallEtaN);
418434
if (!vecParamsMIP.size()) {
419435
LOG(info) << "size of " << name << "is zero.";
420436
}
421437
} else {
422-
targetVec.emplace_back(vecParamsPLApos);
423-
targetVec.emplace_back(vecParamsPLAneg);
424-
targetVec.emplace_back(vecParamsPLAall);
438+
targetVec.emplace_back(vecParamsPLAposEtaP);
439+
targetVec.emplace_back(vecParamsPLAnegEtaP);
440+
targetVec.emplace_back(vecParamsPLAallEtaP);
441+
targetVec.emplace_back(vecParamsPLAposEtaN);
442+
targetVec.emplace_back(vecParamsPLAnegEtaN);
443+
targetVec.emplace_back(vecParamsPLAallEtaN);
425444
if (!vecParamsPLA.size()) {
426445
LOG(info) << "size of " << name << "is zero.";
427446
}
@@ -1144,12 +1163,24 @@ struct FlattenictyPikp {
11441163
float valCalib = -1.;
11451164
if constexpr (isChrg) {
11461165
if (track.sign() * track.tpcInnerParam() > Cnull) {
1147-
valCalib = fCalib.at(0)->Eval(track.eta());
1166+
if (track.eta() >= 0) {
1167+
valCalib = fCalib.at(0)->Eval(track.eta());
1168+
} else {
1169+
valCalib = fCalib.at(3)->Eval(track.eta());
1170+
}
11481171
} else {
1149-
valCalib = fCalib.at(1)->Eval(track.eta());
1172+
if (track.eta() >= 0) {
1173+
valCalib = fCalib.at(1)->Eval(track.eta());
1174+
} else {
1175+
valCalib = fCalib.at(4)->Eval(track.eta());
1176+
}
11501177
}
11511178
} else {
1152-
valCalib = fCalib.at(2)->Eval(track.eta());
1179+
if (track.eta() >= 0) {
1180+
valCalib = fCalib.at(2)->Eval(track.eta());
1181+
} else {
1182+
valCalib = fCalib.at(5)->Eval(track.eta());
1183+
}
11531184
}
11541185
return valCalib;
11551186
}
@@ -2233,7 +2264,6 @@ struct FlattenictyPikp {
22332264

22342265
// using Particles = soa::Filtered<aod::McParticles>;
22352266
// expressions::Filter primaries = (aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary;
2236-
22372267
void processMCclosure(Colls::iterator const& collision,
22382268
MyPIDTracks const& tracks,
22392269
MyLabeledTracks const& mcTrackLabels,

0 commit comments

Comments
 (0)