Skip to content

Commit 17b4937

Browse files
Update
1 parent 22b4893 commit 17b4937

6 files changed

Lines changed: 65 additions & 40 deletions

File tree

Common/Core/PID/PIDTOFParamService.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ void o2::pid::tof::TOFResponseImpl::inheritFromBaseTask(o2::framework::InitConte
3838
if (mIsInit) {
3939
LOG(fatal) << "TOFResponseImpl already initialized, cannot re-initialize";
4040
}
41-
LOG(info) << "couccou";
4241
getCfg(initContext, "ccdb-url", mUrl, task);
4342
getCfg(initContext, "ccdb-path-grplhcif", mPathGrpLhcIf, task);
4443
getCfg(initContext, "ccdb-timestamp", mTimestamp, task);
@@ -54,7 +53,6 @@ void o2::pid::tof::TOFResponseImpl::inheritFromBaseTask(o2::framework::InitConte
5453
getCfg(initContext, "enableTimeDependentResponse", mEnableTimeDependentResponse, task);
5554
getCfg(initContext, "collisionSystem", mCollisionSystem, task);
5655
getCfg(initContext, "autoSetProcessFunctions", mAutoSetProcessFunctions, task);
57-
LOG(info) << "couccou1";
5856
}
5957

6058
void o2::pid::tof::TOFResponseImpl::initSetup(o2::ccdb::BasicCCDBManager* ccdb,

PWGLF/DataModel/LFStrangenessPIDTables.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ DECLARE_SOA_COLUMN(PosTOFSignal, posTOFSignal, float); //! positive trac
198198
DECLARE_SOA_COLUMN(NegTOFSignal, negTOFSignal, float); //! negative track signal
199199
DECLARE_SOA_COLUMN(PosTOFEventTime, posTOFEventTime, float); //! positive track event time
200200
DECLARE_SOA_COLUMN(NegTOFEventTime, negTOFEventTime, float); //! negative track event time
201-
DECLARE_SOA_COLUMN(PosTOFLength, posTOFLength, float); //! positive track length, recalculated
202-
DECLARE_SOA_COLUMN(NegTOFLength, negTOFLength, float); //! negative track length, recalculated
201+
DECLARE_SOA_COLUMN(PosTOFLength, posTOFLength, float); //! positive track length, recalculated
202+
DECLARE_SOA_COLUMN(NegTOFLength, negTOFLength, float); //! negative track length, recalculated
203203

204204
// delta-times
205205
DECLARE_SOA_COLUMN(PosTOFDeltaTLaPi, posTOFDeltaTLaPi, float); //! positive track TOFDeltaT from pion <- lambda expectation

PWGLF/DataModel/LFStrangenessTables.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,14 @@ DECLARE_SOA_TABLE_VERSIONED(StraEvSels_005, "AOD", "STRAEVSELS", 5, //!
282282
stracollision::IsUPC<udcollision::GapSide>);
283283

284284
DECLARE_SOA_TABLE(StraEvSelExtras, "AOD", "STRAEVSELEXTRAS", //! debug information
285-
udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc
286-
udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc
287-
udcollision::TimeFDDA, // Average A-side time (ns)
288-
udcollision::TimeFDDC, // Average C-side time (ns)
289-
udcollision::TimeFV0A, // Average A-side time (ns)
290-
udcollision::TimeFT0A, // Average A-side time (ns)
291-
udcollision::TimeFT0C, // Average C-side time (ns)
292-
udcollision::TriggerMaskFT0); // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent
285+
udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc
286+
udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc
287+
udcollision::TimeFDDA, // Average A-side time (ns)
288+
udcollision::TimeFDDC, // Average C-side time (ns)
289+
udcollision::TimeFV0A, // Average A-side time (ns)
290+
udcollision::TimeFT0A, // Average A-side time (ns)
291+
udcollision::TimeFT0C, // Average C-side time (ns)
292+
udcollision::TriggerMaskFT0); // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent
293293

294294
DECLARE_SOA_TABLE(StraEvSelsRun2, "AOD", "STRAEVSELSRUN2", //! debug information
295295
evsel::Sel8, evsel::Sel7, evsel::Selection, //! event selection: sel8

PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
# granted to it by virtue of its status as an Intergovernmental Organization
1010
# or submit itself to any jurisdiction.
1111

12+
o2physics_add_dpl_workflow(stradautracksconverter
13+
SOURCES stradautracksconverter.cxx
14+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
15+
COMPONENT_NAME Analysis)
16+
1217
o2physics_add_dpl_workflow(stradautrackstpcpidconverter
1318
SOURCES stradautrackstpcpidconverter.cxx
1419
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
@@ -29,6 +34,11 @@ o2physics_add_dpl_workflow(stradautrackstofpidconverter3
2934
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
3035
COMPONENT_NAME Analysis)
3136

37+
o2physics_add_dpl_workflow(stradautracksextraconverter
38+
SOURCES stradautracksextraconverter.cxx
39+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
40+
COMPONENT_NAME Analysis)
41+
3242
o2physics_add_dpl_workflow(stradautracksextraconverter2
3343
SOURCES stradautracksextraconverter2.cxx
3444
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore

PWGLF/TableProducer/Strangeness/Converters/stradautrackstofpidconverter.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,20 @@ struct stradautrackstofpidconverter {
2828
lLengths.reserve(dauTracks.size());
2929
lTOFSignals.reserve(dauTracks.size());
3030
lTOFEvTimes.reserve(dauTracks.size());
31-
for (int ii = 0; ii < dauTracks.size(); ii++) {
31+
for (unsigned int ii = 0; ii < dauTracks.size(); ii++) {
3232
lLengths[ii] = 1e+6;
3333
lTOFSignals[ii] = -1e+3f;
3434
lTOFEvTimes[ii] = -1e+3f;
3535
}
36-
for (auto& v0 : v0s) {
36+
for (const auto& v0 : v0s) {
3737
lLengths[v0.posTrackExtraId()] = v0.posTOFLengthToPV();
3838
lTOFSignals[v0.posTrackExtraId()] = v0.posTOFSignal();
3939
lTOFEvTimes[v0.posTrackExtraId()] = v0.posTOFEventTime();
4040
lLengths[v0.negTrackExtraId()] = v0.negTOFLengthToPV();
4141
lTOFSignals[v0.negTrackExtraId()] = v0.negTOFSignal();
4242
lTOFEvTimes[v0.negTrackExtraId()] = v0.negTOFEventTime();
4343
}
44-
for (auto& casc : cascs) {
44+
for (const auto& casc : cascs) {
4545
lLengths[casc.posTrackExtraId()] = casc.posTOFLengthToPV();
4646
lTOFSignals[casc.posTrackExtraId()] = casc.posTOFSignal();
4747
lTOFEvTimes[casc.posTrackExtraId()] = casc.posTOFEventTime();
@@ -52,7 +52,7 @@ struct stradautrackstofpidconverter {
5252
lTOFSignals[casc.bachTrackExtraId()] = casc.bachTOFSignal();
5353
lTOFEvTimes[casc.bachTrackExtraId()] = casc.bachTOFEventTime();
5454
}
55-
for (int ii = 0; ii < dauTracks.size(); ii++) {
55+
for (unsigned int ii = 0; ii < dauTracks.size(); ii++) {
5656
dautracktofpids(-1, -1, lTOFSignals[ii], lTOFEvTimes[ii], 999.0f /*dummy event time error for TOF*/, lLengths[ii], 0.0f);
5757
}
5858
}
@@ -62,4 +62,4 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
6262
{
6363
return WorkflowSpec{
6464
adaptAnalysisTask<stradautrackstofpidconverter>(cfgc)};
65-
}
65+
}

PWGLF/TableProducer/Strangeness/strangenesstofpid.cxx

Lines changed: 40 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ struct strangenesstofpid {
189189
// very broad time axis
190190
ConfigurableAxis axisTimeLong{"axisTimeLong", {3000, -1500000.0f, 1500000.0f}, "time (ps)"};
191191
} axes; // aggregate axes fo simplicity of navigation in HY
192-
192+
193193
// for n-sigma calibration
194194
bool nSigmaCalibLoaded;
195195
TList* nSigmaCalibObjects = nullptr;
@@ -417,6 +417,23 @@ struct strangenesstofpid {
417417
}
418418
}
419419

420+
nSigmaCalibLoaded = false;
421+
nSigmaCalibObjects = nullptr;
422+
423+
// for n-sigma calibration
424+
hMeanPosLaPi = nullptr;
425+
hSigmaPosLaPi = nullptr;
426+
hMeanPosLaPr = nullptr;
427+
hSigmaPosLaPr = nullptr;
428+
hMeanNegLaPi = nullptr;
429+
hSigmaNegLaPi = nullptr;
430+
hMeanNegLaPr = nullptr;
431+
hSigmaNegLaPr = nullptr;
432+
hMeanPosK0Pi = nullptr;
433+
hSigmaNegK0Pi = nullptr;
434+
hMeanNegK0Pi = nullptr;
435+
hSigmaNegK0Pi = nullptr;
436+
420437
mRunNumber = 0;
421438
d_bz = 0;
422439
maxSnp = 0.85f; // could be changed later
@@ -867,7 +884,7 @@ struct strangenesstofpid {
867884
float velocityPositiveEl, velocityPositivePr, velocityPositivePi, lengthPositive;
868885
velocityPositiveEl = velocityPositivePr = velocityPositivePi = lengthPositive = o2::aod::v0data::kNoTOFValue;
869886

870-
if (pTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && pValidTOF) {
887+
if (pTof.hasTOF && pTof.tofEvTime > -1e+5 && pValidTOF) {
871888
// method 0: legacy standalone without use of primary particle TOF
872889
if (calculationMethod.value == 0) {
873890
velocityPositiveEl = velocity(posTrack.getP(), o2::constants::physics::MassElectron);
@@ -983,7 +1000,7 @@ struct strangenesstofpid {
9831000
}
9841001
float velocityNegativeEl, velocityNegativePr, velocityNegativePi, lengthNegative;
9851002
velocityNegativeEl = velocityNegativePr = velocityNegativePi = lengthNegative = o2::aod::v0data::kNoTOFValue;
986-
if (nTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && nValidTOF) {
1003+
if (nTof.hasTOF && nTof.tofEvTime > -1e+5 && nValidTOF) {
9871004
// method 0: legacy standalone without use of primary particle TOF
9881005
if (calculationMethod.value == 0) {
9891006
velocityNegativeEl = velocity(negTrack.getP(), o2::constants::physics::MassElectron);
@@ -1115,7 +1132,7 @@ struct strangenesstofpid {
11151132
// }
11161133

11171134
// calculation of delta-decay-time (no reliance on event time)
1118-
if (nTof.hasTOF && pTof.hasTOF > 0) { // does not depend on event time
1135+
if (nTof.hasTOF && pTof.hasTOF) { // does not depend on event time
11191136
v0tof.deltaDecayTimePhoton = (pTof.tofSignal - v0tof.timePositiveEl) - (nTof.tofSignal - v0tof.timeNegativeEl);
11201137
v0tof.deltaDecayTimeLambda = (pTof.tofSignal - v0tof.timePositivePr) - (nTof.tofSignal - v0tof.timeNegativePi);
11211138
v0tof.deltaDecayTimeAntiLambda = (pTof.tofSignal - v0tof.timePositivePi) - (nTof.tofSignal - v0tof.timeNegativePr);
@@ -1218,7 +1235,7 @@ struct strangenesstofpid {
12181235

12191236
//_____________________________________________________________________________________________
12201237
// Actual calculation
1221-
if (pTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && pValidTOF) {
1238+
if (pTof.hasTOF && pTof.tofEvTime > -1e+5 && pValidTOF) {
12221239
float velocityPositivePr, velocityPositivePi, lengthPositive;
12231240
velocityPositivePr = velocityPositivePi = lengthPositive = o2::aod::v0data::kNoTOFValue;
12241241
if (calculationMethod.value == 0) {
@@ -1354,7 +1371,7 @@ struct strangenesstofpid {
13541371
}
13551372
} // end positive
13561373

1357-
if (nTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && nValidTOF) {
1374+
if (nTof.hasTOF && nTof.tofEvTime > -1e+5 && nValidTOF) {
13581375
float velocityNegativePr, velocityNegativePi, lengthNegative;
13591376
velocityNegativePr = velocityNegativePi = lengthNegative = o2::aod::v0data::kNoTOFValue;
13601377
// method 0: legacy standalone without use of primary particle TOF
@@ -1491,7 +1508,7 @@ struct strangenesstofpid {
14911508
}
14921509
} // end negative
14931510

1494-
if (bTof.hasTOF && mapCollisionTime.find(collisionId) != mapCollisionTime.end() && bValidTOF) {
1511+
if (bTof.hasTOF && bTof.tofEvTime > -1e+5 && bValidTOF) {
14951512
float velocityBachelorKa, velocityBachelorPi, lengthBachelor;
14961513
velocityBachelorKa = velocityBachelorPi = lengthBachelor = o2::aod::v0data::kNoTOFValue;
14971514
// method 0: legacy standalone without use of primary particle TOF
@@ -1801,8 +1818,8 @@ struct strangenesstofpid {
18011818
pTof.hasTPC = pTra.hasTPC();
18021819
pTof.hasTOF = pTra.hasTOF();
18031820
pTof.tofExpMom = pTra.tofExpMom();
1804-
pTof.tofEvTime = reassociateTracks ? mapCollisionTime[cascade.collisionId()] : pTra.tofEvTime();
1805-
pTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[cascade.collisionId()] : pTra.tofEvTimeErr();
1821+
pTof.tofEvTime = reassociateTracks ? collisionEventTime[cascade.collisionId()] : pTra.tofEvTime();
1822+
pTof.tofEvTimeErr = reassociateTracks ? collisionEventTimeErr[cascade.collisionId()] : pTra.tofEvTimeErr();
18061823
// pTof.tofSignal = pTra.tofSignal() + (doBCshift ? deltaTimePos : 0.0f);
18071824
pTof.tofSignal = doBCshift && pTra.has_collision() ? pTra.tofSignalInAnotherBC(pTra.collision().bc_as<aod::BCsWithTimestamps>().globalBC(), cascade.collision().bc_as<aod::BCsWithTimestamps>().globalBC()) : pTra.tofSignal();
18081825
pTof.length = pTra.length();
@@ -1814,8 +1831,8 @@ struct strangenesstofpid {
18141831
nTof.hasTPC = nTra.hasTPC();
18151832
nTof.hasTOF = nTra.hasTOF();
18161833
nTof.tofExpMom = nTra.tofExpMom();
1817-
nTof.tofEvTime = reassociateTracks ? mapCollisionTime[cascade.collisionId()] : nTra.tofEvTime();
1818-
nTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[cascade.collisionId()] : nTra.tofEvTimeErr();
1834+
nTof.tofEvTime = reassociateTracks ? collisionEventTime[cascade.collisionId()] : nTra.tofEvTime();
1835+
nTof.tofEvTimeErr = reassociateTracks ? collisionEventTimeErr[cascade.collisionId()] : nTra.tofEvTimeErr();
18191836
// nTof.tofSignal = nTra.tofSignal() + (doBCshift ? deltaTimeNeg : 0.0f);
18201837
nTof.tofSignal = doBCshift && nTra.has_collision() ? nTra.tofSignalInAnotherBC(nTra.collision().bc_as<aod::BCsWithTimestamps>().globalBC(), cascade.collision().bc_as<aod::BCsWithTimestamps>().globalBC()) : nTra.tofSignal();
18211838
nTof.length = nTra.length();
@@ -1827,8 +1844,8 @@ struct strangenesstofpid {
18271844
bTof.hasTPC = bTra.hasTPC();
18281845
bTof.hasTOF = bTra.hasTOF();
18291846
bTof.tofExpMom = bTra.tofExpMom();
1830-
bTof.tofEvTime = reassociateTracks ? mapCollisionTime[cascade.collisionId()] : bTra.tofEvTime();
1831-
bTof.tofEvTimeErr = reassociateTracks ? mapCollisionTimeError[cascade.collisionId()] : bTra.tofEvTimeErr();
1847+
bTof.tofEvTime = reassociateTracks ? collisionEventTime[cascade.collisionId()] : bTra.tofEvTime();
1848+
bTof.tofEvTimeErr = reassociateTracks ? collisionEventTimeErr[cascade.collisionId()] : bTra.tofEvTimeErr();
18321849
// bTof.tofSignal = bTra.tofSignal() + (doBCshift ? deltaTimeBach : 0.0f);
18331850
bTof.tofSignal = doBCshift && bTra.has_collision() ? bTra.tofSignalInAnotherBC(bTra.collision().bc_as<aod::BCsWithTimestamps>().globalBC(), cascade.collision().bc_as<aod::BCsWithTimestamps>().globalBC()) : bTra.tofSignal();
18341851
bTof.length = bTra.length();
@@ -1944,8 +1961,8 @@ struct strangenesstofpid {
19441961
pTof.collisionId = pTofExt.straCollisionId();
19451962
pTof.tofExpMom = pTofExt.tofExpMom();
19461963
pTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTime();
1947-
// pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr();
1948-
pTof.tofEvTimeErr = pTofExt.tofEvTimeErr();
1964+
pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTimeErr() : pTofExt.tofEvTimeErr();
1965+
// pTof.tofEvTimeErr = pTofExt.tofEvTimeErr();
19491966
pTof.tofSignal = pTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f);
19501967
pTof.length = pTofExt.length();
19511968
}
@@ -1971,8 +1988,8 @@ struct strangenesstofpid {
19711988
nTof.collisionId = nTofExt.straCollisionId();
19721989
nTof.tofExpMom = nTofExt.tofExpMom();
19731990
nTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTime();
1974-
// nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr();
1975-
nTof.tofEvTimeErr = nTofExt.tofEvTimeErr();
1991+
nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTimeErr() : nTofExt.tofEvTimeErr();
1992+
// nTof.tofEvTimeErr = nTofExt.tofEvTimeErr();
19761993
nTof.tofSignal = nTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f);
19771994
nTof.length = nTofExt.length();
19781995
}
@@ -2040,8 +2057,8 @@ struct strangenesstofpid {
20402057
pTof.collisionId = pTofExt.straCollisionId();
20412058
pTof.tofExpMom = pTofExt.tofExpMom();
20422059
pTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTime();
2043-
// pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : pTofExt.tofEvTimeErr();
2044-
pTof.tofEvTimeErr = pTofExt.tofEvTimeErr();
2060+
pTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTimeErr() : pTofExt.tofEvTimeErr();
2061+
// pTof.tofEvTimeErr = pTofExt.tofEvTimeErr();
20452062
pTof.tofSignal = pTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f);
20462063
pTof.length = pTofExt.length();
20472064
}
@@ -2066,8 +2083,8 @@ struct strangenesstofpid {
20662083
nTof.collisionId = nTofExt.straCollisionId();
20672084
nTof.tofExpMom = nTofExt.tofExpMom();
20682085
nTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTime();
2069-
// nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr();
2070-
nTof.tofEvTimeErr = nTofExt.tofEvTimeErr();
2086+
nTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : nTofExt.tofEvTimeErr();
2087+
// nTof.tofEvTimeErr = nTofExt.tofEvTimeErr();
20712088
nTof.tofSignal = nTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f);
20722089
nTof.length = nTofExt.length();
20732090
}
@@ -2092,8 +2109,8 @@ struct strangenesstofpid {
20922109
bTof.collisionId = bTofExt.straCollisionId();
20932110
bTof.tofExpMom = bTofExt.tofExpMom();
20942111
bTof.tofEvTime = reassociateTracks.value ? collision.eventTime() : bTofExt.tofEvTime();
2095-
// bTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTime() : bTofExt.tofEvTimeErr();
2096-
bTof.tofEvTimeErr = bTofExt.tofEvTimeErr();
2112+
bTof.tofEvTimeErr = reassociateTracks.value ? collision.eventTimeErr() : bTofExt.tofEvTimeErr();
2113+
// bTof.tofEvTimeErr = bTofExt.tofEvTimeErr();
20972114
bTof.tofSignal = bTofExt.tofSignal() + (doBCshift.value ? deltaTimeBc : 0.0f);
20982115
bTof.length = bTofExt.length();
20992116
}

0 commit comments

Comments
 (0)