Skip to content

Commit 664776b

Browse files
Rename and modify stradautracksconverter task + create a new converter for daughter extra + remove daughter extra info from v0coresconverter task
1 parent 31a40b7 commit 664776b

3 files changed

Lines changed: 106 additions & 15 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
#include "Framework/runDataProcessing.h"
12+
#include "Framework/AnalysisTask.h"
13+
#include "Framework/AnalysisDataModel.h"
14+
#include "PWGLF/DataModel/LFStrangenessTables.h"
15+
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"
16+
17+
using namespace o2;
18+
using namespace o2::framework;
19+
20+
// Converts V0 version 001 to 002
21+
struct stradautracksextraconverter {
22+
Produces<aod::DauTrackExtras_001> dauTrackExtras_001;
23+
24+
void process(aod::DauTrackExtras_000 const& dauTrackExtras_000)
25+
{
26+
for (auto& values : dauTrackExtras_000) {
27+
dauTrackExtras_001(0,
28+
values.detectorMap(),
29+
values.itsClusterSizes(),
30+
values.tpcClusters(),
31+
values.tpcCrossedRows());
32+
}
33+
}
34+
};
35+
36+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
37+
{
38+
return WorkflowSpec{
39+
adaptAnalysisTask<stradautracksextraconverter>(cfgc)};
40+
}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2+
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3+
// All rights not expressly granted are reserved.
4+
//
5+
// This software is distributed under the terms of the GNU General Public
6+
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7+
//
8+
// In applying this license CERN does not waive the privileges and immunities
9+
// granted to it by virtue of its status as an Intergovernmental Organization
10+
// or submit itself to any jurisdiction.
11+
#include "Framework/runDataProcessing.h"
12+
#include "Framework/AnalysisTask.h"
13+
#include "Framework/AnalysisDataModel.h"
14+
#include "PWGLF/DataModel/LFStrangenessTables.h"
15+
#include "PWGLF/DataModel/LFStrangenessPIDTables.h"
16+
17+
using namespace o2;
18+
using namespace o2::framework;
19+
20+
// Converts V0 version 001 to 002
21+
struct stradautrackstofpidconverter {
22+
Produces<aod::DauTrackTOFPIDs> dautracktofpids;
23+
24+
void process(soa::Join<aod::V0Cores, aod::V0Extras, aod::V0TOFs> const& v0s, soa::Join<aod::CascCores, aod::CascExtras, aod::CascTOFs> const& cascs, aod::DauTrackExtras const& dauTracks)
25+
{
26+
// prepare arrays with the relevant information
27+
std::vector<float> lLengths, lTOFSignals, lTOFEvTimes;
28+
lLengths.reserve(dauTracks.size());
29+
lTOFSignals.reserve(dauTracks.size());
30+
lTOFEvTimes.reserve(dauTracks.size());
31+
for (int ii = 0; ii < dauTracks.size(); ii++) {
32+
lLengths[ii] = 1e+6;
33+
lTOFSignals[ii] = -1e+3f;
34+
lTOFEvTimes[ii] = -1e+3f;
35+
}
36+
for (auto& v0 : v0s) {
37+
lLengths[v0.posTrackExtraId()] = v0.posTOFLengthToPV();
38+
lTOFSignals[v0.posTrackExtraId()] = v0.posTOFSignal();
39+
lTOFEvTimes[v0.posTrackExtraId()] = v0.posTOFEventTime();
40+
lLengths[v0.negTrackExtraId()] = v0.negTOFLengthToPV();
41+
lTOFSignals[v0.negTrackExtraId()] = v0.negTOFSignal();
42+
lTOFEvTimes[v0.negTrackExtraId()] = v0.negTOFEventTime();
43+
}
44+
for (auto& casc : cascs) {
45+
lLengths[casc.posTrackExtraId()] = casc.posTOFLengthToPV();
46+
lTOFSignals[casc.posTrackExtraId()] = casc.posTOFSignal();
47+
lTOFEvTimes[casc.posTrackExtraId()] = casc.posTOFEventTime();
48+
lLengths[casc.negTrackExtraId()] = casc.negTOFLengthToPV();
49+
lTOFSignals[casc.negTrackExtraId()] = casc.negTOFSignal();
50+
lTOFEvTimes[casc.negTrackExtraId()] = casc.negTOFEventTime();
51+
lLengths[casc.bachTrackExtraId()] = casc.bachTOFLengthToPV();
52+
lTOFSignals[casc.bachTrackExtraId()] = casc.bachTOFSignal();
53+
lTOFEvTimes[casc.bachTrackExtraId()] = casc.bachTOFEventTime();
54+
}
55+
for (int ii = 0; ii < dauTracks.size(); ii++) {
56+
dautracktofpids(lTOFSignals[ii], lTOFEvTimes[ii], lLengths[ii]);
57+
}
58+
}
59+
};
60+
61+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
62+
{
63+
return WorkflowSpec{
64+
adaptAnalysisTask<stradautrackstofpidconverter>(cfgc)};
65+
}

PWGLF/TableProducer/converters/v0coresconverter.cxx

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,9 @@ using namespace o2::framework;
1818

1919
// Converts V0 version 001 to 002
2020
struct v0coresconverter {
21-
Produces<aod::DauTrackExtras_001> dauTrackExtras_001;
2221
Produces<aod::V0MCCores_001> v0MCCores_001;
2322

24-
void processRecoInfo000to001(aod::DauTrackExtras_000 const& dauTrackExtras_000)
25-
{
26-
for (auto& values : dauTrackExtras_000) {
27-
dauTrackExtras_001(0,
28-
values.detectorMap(),
29-
values.itsClusterSizes(),
30-
values.tpcClusters(),
31-
values.tpcCrossedRows());
32-
}
33-
}
34-
void processMCInfo000to001(aod::V0MCCores_000 const& v0MCCores_000)
23+
void process(aod::V0MCCores_000 const& v0MCCores_000)
3524
{
3625
for (auto& values : v0MCCores_000) {
3726
v0MCCores_001(0,
@@ -51,9 +40,6 @@ struct v0coresconverter {
5140
values.pzNegMC());
5241
}
5342
}
54-
55-
PROCESS_SWITCH(v0coresconverter, processRecoInfo000to001, "from reco 000 to 001", false);
56-
PROCESS_SWITCH(v0coresconverter, processMCInfo000to001, "from MC 000 to 001", false);
5743
};
5844

5945
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)

0 commit comments

Comments
 (0)