Skip to content

Commit 53fc054

Browse files
author
Romain Schotter
committed
Add converters for new data model
1 parent b04f601 commit 53fc054

3 files changed

Lines changed: 181 additions & 0 deletions

File tree

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 "PWGLF/DataModel/LFStrangenessTables.h"
12+
13+
#include "CCDB/BasicCCDBManager.h"
14+
#include "DataFormatsParameters/AggregatedRunInfo.h"
15+
#include "Framework/AnalysisDataModel.h"
16+
#include "Framework/AnalysisTask.h"
17+
#include "Framework/runDataProcessing.h"
18+
19+
using namespace o2;
20+
using namespace o2::framework;
21+
using namespace o2::aod::evsel;
22+
23+
// Converts straevselsextrasconverter1 converts StraEvSelExtras_000 into StraEvSelExtras_001
24+
struct straevselextrasconverter {
25+
Produces<aod::StraEvSelExtras_001> straEvSelExtras_001;
26+
27+
void process(soa::Join<aod::StraEvSels_005, aod::StraEvSelExtras_000> const& straEvSels_005)
28+
{
29+
for (auto& values : straEvSels_005) {
30+
straEvSelExtras_001(values.multZNA(),
31+
values.multZNC(),
32+
values.multZEM1(),
33+
values.multZEM2(),
34+
values.multZPA(),
35+
values.multZPC(),
36+
values.multNTracksITSTPC(),
37+
values.multAllTracksTPCOnly(),
38+
values.multAllTracksITSTPC(),
39+
values.trackOccupancyInTimeRange(),
40+
values.ft0cOccupancyInTimeRange(),
41+
values.timeFDDA(),
42+
values.timeFDDC(),
43+
values.timeFV0A(),
44+
values.timeFT0A(),
45+
values.timeFT0C(),
46+
values.triggerMaskFT0(),
47+
values.gapSide(),
48+
values.totalFT0AmplitudeA(),
49+
values.totalFT0AmplitudeC(),
50+
values.totalFV0AmplitudeA(),
51+
values.totalFDDAmplitudeA(),
52+
values.totalFDDAmplitudeC(),
53+
values.timeZNA(),
54+
values.timeZNC(),
55+
values.energyCommonZNA(),
56+
values.energyCommonZNC());
57+
}
58+
}
59+
};
60+
61+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
62+
{
63+
return WorkflowSpec{
64+
adaptAnalysisTask<straevselextrasconverter>(cfgc)};
65+
}
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 "PWGLF/DataModel/LFStrangenessTables.h"
12+
13+
#include "CCDB/BasicCCDBManager.h"
14+
#include "DataFormatsParameters/AggregatedRunInfo.h"
15+
#include "Framework/AnalysisDataModel.h"
16+
#include "Framework/AnalysisTask.h"
17+
#include "Framework/runDataProcessing.h"
18+
19+
using namespace o2;
20+
using namespace o2::framework;
21+
using namespace o2::aod::evsel;
22+
23+
// Produce dummy StraEvSelExtras for analysis subscribing to StraEvSelExtras but not saved in the strangeness derived data (typically when running over pp strangeness derived data)
24+
struct straevselextrasconverter2 {
25+
Produces<aod::StraEvSelExtras> straEvSelExtras;
26+
27+
void process(aod::StraEvSels const& straEvSels)
28+
{
29+
for (auto& values : straEvSels) {
30+
straEvSelExtras(-999., // dummy multZNA,
31+
-999., // dummy multZNC,
32+
-999., // dummy multZEM1,
33+
-999., // dummy multZEM2,
34+
-999., // dummy multZPA,
35+
-999., // dummy multZPC,
36+
-999., // dummy multNTracksITSTPC,
37+
-999., // dummy multAllTracksTPCOnly,
38+
-999., // dummy multAllTracksITSTPC,
39+
-999., // dummy trackOccupancyInTimeRange,
40+
-999., // dummy ft0cOccupancyInTimeRange,
41+
-999., // dummy timeFDDA,
42+
-999., // dummy timeFDDC,
43+
-999., // dummy timeFV0A,
44+
-999., // dummy timeFT0A,
45+
-999., // dummy timeFT0C,
46+
0, // dummy triggerMaskFT0,
47+
-999, // dummy gapSide,
48+
-999., // dummy totalFT0AmplitudeA,
49+
-999., // dummy totalFT0AmplitudeC,
50+
-999., // dummy totalFV0AmplitudeA,
51+
-999., // dummy totalFDDAmplitudeA,
52+
-999., // dummy totalFDDAmplitudeC,
53+
-999., // dummy timeZNA,
54+
-999., // dummy timeZNC,
55+
-999., // dummy energyCommonZNA,
56+
-999.); // dummy energyCommonZNC);
57+
}
58+
}
59+
};
60+
61+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
62+
{
63+
return WorkflowSpec{
64+
adaptAnalysisTask<straevselextrasconverter2>(cfgc)};
65+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
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 "PWGLF/DataModel/LFStrangenessTables.h"
12+
13+
#include "CCDB/BasicCCDBManager.h"
14+
#include "DataFormatsParameters/AggregatedRunInfo.h"
15+
#include "Framework/AnalysisDataModel.h"
16+
#include "Framework/AnalysisTask.h"
17+
#include "Framework/runDataProcessing.h"
18+
19+
using namespace o2;
20+
using namespace o2::framework;
21+
using namespace o2::aod::evsel;
22+
23+
// Converts Stra Event selections from 005 to 006
24+
struct straevselsconverter6 {
25+
Produces<aod::StraEvSels_006> straEvSels_006;
26+
27+
void process(aod::StraEvSels_005 const& straEvSels_005)
28+
{
29+
for (auto& values : straEvSels_005) {
30+
straEvSels_006(values.sel8(),
31+
values.selection_raw(),
32+
values.multFT0A(),
33+
values.multFT0C(),
34+
values.multFT0A(),
35+
values.multFDDA(),
36+
values.multFDDC(),
37+
values.multNTracksPVeta1(),
38+
values.multPVTotalContributors(),
39+
values.multNTracksGlobal(),
40+
values.flags(),
41+
values.alias_raw(),
42+
values.rct_raw());
43+
}
44+
}
45+
};
46+
47+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
48+
{
49+
return WorkflowSpec{
50+
adaptAnalysisTask<straevselsconverter6>(cfgc)};
51+
}

0 commit comments

Comments
 (0)