Skip to content

Commit 0f70e14

Browse files
Add FITExtras table
1 parent 25e19da commit 0f70e14

4 files changed

Lines changed: 194 additions & 1 deletion

File tree

Common/DataModel/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ o2physics_add_header_only_library(DataModel
1414
Centrality.h
1515
EventSelection.h
1616
FT0Corrected.h
17+
FITExtra.h
1718
Multiplicity.h
1819
PIDResponse.h
1920
PIDResponseITS.h

Common/DataModel/FITExtra.h

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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+
12+
#ifndef COMMON_DATAMODEL_FITEXTRA_H_
13+
#define COMMON_DATAMODEL_FITEXTRA_H_
14+
15+
#include "Framework/ASoA.h"
16+
#include "Framework/AnalysisDataModel.h"
17+
18+
namespace o2::aod
19+
{
20+
namespace fit
21+
{
22+
// Quantities copied straight from AOD
23+
DECLARE_SOA_COLUMN(PV, pv, float); //! Primary vertex position in cm (o2::aod::‌collision::PosZ)
24+
DECLARE_SOA_COLUMN(NContrib, nContrib, int); //! Number of contributors to primary vertex (o2::aod::‌collision::NumContrib)
25+
DECLARE_SOA_COLUMN(FT0TimeA, ft0timeA, float); //! FT0-A average time in ns (o2::aod::ft0::TimeA)
26+
DECLARE_SOA_COLUMN(FT0TimeC, ft0timeC, float); //! FT0-C average time in ns (o2::aod::ft0::TimeC)
27+
DECLARE_SOA_COLUMN(FT0TimeACorr, ft0timeACorr, float); //! FT0-A average time in ns corrected PV (o2::aod::ft0::T0ACorrected)
28+
DECLARE_SOA_COLUMN(FT0TimeCCorr, ft0timeCCorr, float); //! FT0-C average time in ns corrected PV (o2::aod::ft0::T0CCorrected)
29+
DECLARE_SOA_COLUMN(FT0Time, ft0time, float); //! FT0 collision time in ns (o2::aod::ft0::CollTime)
30+
DECLARE_SOA_COLUMN(FT0TimeRes, ft0timeRes, float); //! FT0 collision time resolution in ns (o2::aod::ft0::T0Resolution)
31+
DECLARE_SOA_COLUMN(FT0Vtx, ft0vtx, float); //! FT0 vertex in cm (o2::aod::ft0::PosZ)
32+
DECLARE_SOA_COLUMN(FV0Time, fv0time, float); //! FV0 average time in ns (o2::aod::fv0a::Time)
33+
DECLARE_SOA_COLUMN(FDDTimeA, fddtimeA, float); //! FDD-A average time in ns (o2::aod::fdd::TimeA)
34+
DECLARE_SOA_COLUMN(FDDTimeC, fddtimeC, float); //! FDD-C average time in ns (o2::aod::fdd::TimeC)
35+
36+
// Derived quantities
37+
38+
// Event selection conditions straigt from AOD
39+
DECLARE_SOA_COLUMN(Sel8, sel8, bool); //! (o2::aod::evsel::Sel8)
40+
DECLARE_SOA_COLUMN(HasFT0, hasFT0, bool); //! (o2::aod::collision::has_foundFT0())
41+
DECLARE_SOA_COLUMN(HasFV0, hasFV0, bool); //! (o2::aod::collision::has_foundFV0())
42+
DECLARE_SOA_COLUMN(HasFDD, hasFDD, bool); //! (o2::aod::collision::has_foundFDD())
43+
DECLARE_SOA_COLUMN(FT0Triggers, ft0Triggers, uint8_t); //! FT0 trigger mask
44+
DECLARE_SOA_COLUMN(FV0Triggers, fv0Triggers, uint8_t); //! FV0 trigger mask
45+
DECLARE_SOA_COLUMN(FDDTriggers, fddTriggers, uint8_t); //! FDD trigger mask
46+
} // namespace fit
47+
DECLARE_SOA_TABLE(FITExtras, "AOD", "FITEXTRA", //! Table with extra FIT information
48+
fit::Sel8, fit::HasFT0, fit::HasFV0, fit::HasFDD,
49+
fit::FT0Triggers, fit::FV0Triggers, fit::FDDTriggers,
50+
fit::PV, fit::NContrib,
51+
fit::FT0TimeA, fit::FT0TimeC, fit::FT0TimeACorr, fit::FT0TimeCCorr,
52+
fit::FT0Time, fit::FT0TimeRes, fit::FT0Vtx,
53+
fit::FV0Time, fit::FDDTimeA, fit::FDDTimeC);
54+
using FITExtra = FITExtras::iterator;
55+
} // namespace o2::aod
56+
57+
#endif // COMMON_DATAMODEL_FITEXTRA_H_

Common/TableProducer/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ o2physics_add_dpl_workflow(weak-decay-indices
7373
o2physics_add_dpl_workflow(ft0-corrected-table
7474
SOURCES ft0CorrectedTable.cxx
7575
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
76-
COMPONENT_NAME Analysis)
76+
COMPONENT_NAME Analysis)
77+
78+
o2physics_add_dpl_workflow(fit-extra-table
79+
SOURCES fitExtraTable.cxx
80+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
81+
COMPONENT_NAME Analysis)
7782

7883
o2physics_add_dpl_workflow(track-propagation
7984
SOURCES trackPropagation.cxx
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
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+
12+
#include "Common/DataModel/EventSelection.h"
13+
#include "Common/DataModel/FITExtra.h"
14+
#include "Common/DataModel/FT0Corrected.h"
15+
16+
#include <CommonConstants/PhysicsConstants.h>
17+
#include <Framework/AnalysisDataModel.h>
18+
#include <Framework/AnalysisTask.h>
19+
20+
using namespace o2;
21+
using namespace o2::framework;
22+
23+
#include "Framework/runDataProcessing.h"
24+
25+
struct fitExtraTable {
26+
// Producer
27+
Produces<o2::aod::FITExtra> table;
28+
29+
// using CollisionEvSel = soa::Join<aod::Collisions, aod::EvSels>::iterator;
30+
static constexpr float invLightSpeedCm2NS = 1.f / o2::constants::physics::LightSpeedCm2NS;
31+
32+
void init(InitContext const&)
33+
{
34+
}
35+
36+
void process(soa::Join<aod::Collisions, aod::EvSels, aod::FT0sCorrected> const& collisions,
37+
aod::FT0s const&, aod::FV0As const&, aod::FDDs const&) {
38+
table.reserve(collisions.size());
39+
40+
float pv = -200;
41+
int nContrib = -1;
42+
43+
float ft0timeA = -200;
44+
float ft0timeC = -200;
45+
float ft0timeACorr = -200;
46+
float ft0timeCCorr = -200;
47+
float ft0time = -200;
48+
float ft0timeRes = -200;
49+
float ft0vtx = -200;
50+
float fv0time = -200;
51+
float fddtimeA = -200;
52+
float fddtimeC = -200;
53+
54+
bool sel8, hasFT0, hasFV0, hasFDD;
55+
uint8_t ft0Triggers, fv0Triggers, fddTriggers;
56+
57+
for (const auto& collision : collisions) {
58+
pv = collision.posZ();
59+
nContrib = collision.numContrib();
60+
sel8 = collision.sel8();
61+
62+
ft0timeA = -200;
63+
ft0timeC = -200;
64+
ft0timeACorr = -200;
65+
ft0timeCCorr = -200;
66+
ft0time = -200;
67+
ft0timeRes = -200;
68+
ft0vtx = -200;
69+
fv0time = -200;
70+
fddtimeA = -200;
71+
fddtimeC = -200;
72+
73+
hasFT0 = collision.has_foundFT0();
74+
hasFV0 = collision.has_foundFV0();
75+
hasFDD = collision.has_foundFDD();
76+
ft0Triggers = 0;
77+
fv0Triggers = 0;
78+
fddTriggers = 0;
79+
80+
if (hasFT0) {
81+
auto ft0 = collision.foundFT0();
82+
ft0timeA = ft0.timeA();
83+
ft0timeC = ft0.timeC();
84+
ft0time = ft0.collTime();
85+
ft0vtx = ft0.posZ();
86+
ft0timeACorr = collision.t0ACorrected();
87+
ft0timeCCorr = collision.t0CCorrected();
88+
ft0timeRes = collision.t0resolution();
89+
ft0Triggers = ft0.triggerMask();
90+
}
91+
if (hasFV0) {
92+
auto fv0 = collision.foundFV0();
93+
fv0time = fv0.time();
94+
fv0Triggers = fv0.triggerMask();
95+
}
96+
if (hasFDD) {
97+
auto fdd = collision.foundFDD();
98+
fddtimeA = fdd.timeA();
99+
fddtimeC = fdd.timeC();
100+
fddTriggers = fdd.triggerMask();
101+
}
102+
103+
table(pv,
104+
nContrib,
105+
ft0timeA,
106+
ft0timeC,
107+
ft0timeACorr,
108+
ft0timeCCorr,
109+
ft0time,
110+
ft0timeRes,
111+
ft0vtx,
112+
fv0time,
113+
fddtimeA,
114+
fddtimeC,
115+
sel8,
116+
hasFT0,
117+
hasFV0,
118+
hasFDD,
119+
ft0Triggers,
120+
fv0Triggers,
121+
fddTriggers);
122+
}
123+
}
124+
};
125+
126+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
127+
{
128+
WorkflowSpec workflow{adaptAnalysisTask<fitExtraTable>(cfgc)};
129+
return workflow;
130+
}

0 commit comments

Comments
 (0)