-
Notifications
You must be signed in to change notification settings - Fork 652
Expand file tree
/
Copy pathspectraNucleiAnalyser.cxx
More file actions
72 lines (58 loc) · 2.55 KB
/
spectraNucleiAnalyser.cxx
File metadata and controls
72 lines (58 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
// O2 includes
#include "DataModel/LFDerived.h"
#include "Common/DataModel/TrackSelectionTables.h"
#include "Framework/ASoAHelpers.h"
#include "Framework/AnalysisDataModel.h"
#include "Framework/AnalysisTask.h"
#include "Framework/HistogramRegistry.h"
#include "Framework/runDataProcessing.h"
#include "ReconstructionDataFormats/Track.h"
#include <TLorentzVector.h>
#include <cmath>
using namespace o2;
using namespace o2::framework;
using namespace o2::framework::expressions;
struct NucleiSpectraAnalyserTask {
Configurable<float> yMin{"yMin", -0.8, "Maximum rapidity"};
Configurable<float> yMax{"yMax", 0.8, "Minimum rapidity"};
Configurable<float> yBeam{"yBeam", 0., "Beam rapidity"};
Configurable<float> nSigmaCutLow{"nSigmaCutLow", -30.0, "Value of the Nsigma cut"};
Configurable<float> nSigmaCutHigh{"nSigmaCutHigh", +3., "Value of the Nsigma cut"};
HistogramRegistry spectra{"spectra", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
void init(o2::framework::InitContext&)
{
spectra.add("fCollZpos", "collision z position", HistType::kTH1F, {{600, -20., +20., "z position (cm)"}});
spectra.add("fHePt", "He pT", HistType::kTH1F, {{60, 0.0, 30., "#it{p}_{T} (GeV/#it{c})"}});
}
void process(aod::LFCollision const& collision, aod::LFNucleiTracks const& tracks)
{
spectra.fill(HIST("fCollZpos"), collision.posZ());
for (auto track : tracks) { // start loop over tracks
TLorentzVector cutVector{};
cutVector.SetPtEtaPhiM(track.pt() * 2.0, track.eta(), track.phi(), constants::physics::MassHelium3);
if (cutVector.Rapidity() < yMin + yBeam || cutVector.Rapidity() > yMax + yBeam) {
continue;
}
float nsigma = track.tpcNSigmaHe();
if (nsigma < nSigmaCutLow || nsigma > nSigmaCutHigh) {
continue;
}
spectra.fill(HIST("fHePt"), track.pt());
}
}
};
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<NucleiSpectraAnalyserTask>(cfgc, TaskName{"nucleispectra-task-skim-analyser"})};
}