Skip to content

Commit 2407c9a

Browse files
committed
Add table for ECAL
1 parent 72559d5 commit 2407c9a

File tree

3 files changed

+133
-0
lines changed

3 files changed

+133
-0
lines changed

ALICE3/DataModel/ECAL.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
///
13+
/// \file ECAL.h
14+
/// \author Nicolo' Jacazio
15+
/// \since 14/09/2021
16+
/// \brief Set of tables for the ALICE3 ECAL information
17+
///
18+
19+
#ifndef O2_ANALYSIS_ALICE3_ECAL_H_
20+
#define O2_ANALYSIS_ALICE3_ECAL_H_
21+
22+
// O2 includes
23+
#include "Framework/AnalysisDataModel.h"
24+
25+
namespace o2::aod
26+
{
27+
namespace alice3ecal
28+
{
29+
DECLARE_SOA_INDEX_COLUMN(Track, track); //! Index to travel from track to ECAL
30+
DECLARE_SOA_COLUMN(Energy, energy, float); //! Signal in ECAL
31+
DECLARE_SOA_COLUMN(PosX, posX, float); //! Error on the ECAL signal
32+
DECLARE_SOA_COLUMN(PosY, posY, float); //! signal - exp. signal for electrons
33+
DECLARE_SOA_COLUMN(PosZ, posZ, float); //! signal - exp. signal for muons
34+
} // namespace alice3ecal
35+
36+
DECLARE_SOA_TABLE(ECALs, "AOD", "A3ECAL", //! Table for the ALICE3 ECAL detector
37+
o2::soa::Index<>,
38+
alice3ecal::TrackId,
39+
alice3ecal::Energy,
40+
alice3ecal::PosX,
41+
alice3ecal::PosY,
42+
alice3ecal::PosZ);
43+
44+
using ECAL = ECALs::iterator;
45+
46+
} // namespace o2::aod
47+
48+
#endif // O2_ANALYSIS_ALICE3_ECAL_H_

ALICE3/Tasks/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ o2physics_add_dpl_workflow(alice3-pid-rich-qa
2929
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
3030
COMPONENT_NAME Analysis)
3131

32+
o2physics_add_dpl_workflow(alice3-ecal-qa
33+
SOURCES ECALqa.cxx
34+
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore
35+
COMPONENT_NAME Analysis)
36+
3237
o2physics_add_dpl_workflow(alice3-pid-ftof-qa
3338
SOURCES pidFTOFqa.cxx
3439
PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore

ALICE3/Tasks/ECALqa.cxx

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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+
///
13+
/// \file ECALqa.cxx
14+
/// \author Nicolo' Jacazio
15+
/// \since 14/09/2021
16+
/// \brief Task to use the ALICE3 ECAL table
17+
///
18+
19+
// O2 includes
20+
#include "Framework/AnalysisTask.h"
21+
#include "ALICE3/DataModel/ECAL.h"
22+
#include "Common/Core/MC.h"
23+
#include "Common/Core/PID/PIDResponse.h"
24+
#include "ReconstructionDataFormats/PID.h"
25+
#include "Framework/HistogramRegistry.h"
26+
#include "Framework/runDataProcessing.h"
27+
28+
using namespace o2;
29+
using namespace o2::track;
30+
using namespace o2::framework;
31+
using namespace o2::framework::expressions;
32+
33+
namespace o2::aod
34+
{
35+
36+
namespace indices
37+
{
38+
DECLARE_SOA_INDEX_COLUMN(Track, track);
39+
DECLARE_SOA_INDEX_COLUMN(ECAL, ecal);
40+
} // namespace indices
41+
42+
DECLARE_SOA_INDEX_TABLE_USER(ECALTracksIndex, Tracks, "ECALTRK", indices::TrackId, indices::ECALId);
43+
} // namespace o2::aod
44+
45+
struct ecalIndexBuilder { // Builder of the ECAL-track index linkage
46+
Builds<o2::aod::ECALTracksIndex> ind;
47+
void init(o2::framework::InitContext&)
48+
{
49+
}
50+
};
51+
52+
struct ecalQaMc {
53+
HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::QAObject};
54+
55+
void init(o2::framework::InitContext&)
56+
{
57+
histos.add("energy", ";Energy;Entries", HistType::kTH1F, {{1000, 0, 10000}});
58+
}
59+
60+
using Trks = soa::Join<aod::Tracks, aod::ECALTracksIndex, aod::TracksExtra>;
61+
void process(const aod::McParticles& mcParticles,
62+
const Trks& tracks,
63+
const aod::McTrackLabels& labels,
64+
const aod::ECALs&,
65+
const aod::Collisions& colls)
66+
{
67+
for (auto& track : tracks) {
68+
if (!track.has_ecal())
69+
continue;
70+
histos.fill(HIST("energy"), track.ecal().energy());
71+
}
72+
}
73+
};
74+
75+
WorkflowSpec defineDataProcessing(ConfigContext const& cfg)
76+
{
77+
auto workflow = WorkflowSpec{adaptAnalysisTask<ecalIndexBuilder>(cfg)};
78+
workflow.push_back(adaptAnalysisTask<ecalQaMc>(cfg));
79+
return workflow;
80+
}

0 commit comments

Comments
 (0)