Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6ceb289
First version probably not working of analyseMFTTracks.cxx
sarahherrmann Nov 18, 2021
26102f8
First version of analyse-mft-tracks, a task computing histograms for …
sarahherrmann Nov 29, 2021
15d0f91
First version of analyse-mft-tracks, a task computing histograms for …
sarahherrmann Nov 29, 2021
9a85f1b
First version of analyse-mft-tracks, a task computing histograms for …
sarahherrmann Nov 29, 2021
16209fa
Change in processGen that runs
sarahherrmann Nov 29, 2021
b4243b8
Change in processGen that runs
sarahherrmann Nov 29, 2021
282a381
Merge branch 'master' into branchSarah
aalkin Dec 2, 2021
da398b2
Merge branch 'master' into branchSarah
aalkin Dec 3, 2021
1c1ada2
My version of CMakeList adding mft-tracks-for-comparison
sarahherrmann Dec 8, 2021
6f81129
The task analyse-mft-tracks with the wanted modifications
sarahherrmann Dec 10, 2021
24bc0df
New CMakeLists with the task analyse-mft-tracks added
sarahherrmann Dec 10, 2021
6195247
message
sarahherrmann Dec 10, 2021
08b88eb
The new task analyse-mft-tracks with wanted modifications
sarahherrmann Dec 10, 2021
6d1c20c
blabla
sarahherrmann Dec 13, 2021
fb7d9b2
Merge branch 'AliceO2Group:master' into branchSarah
sarahherrmann Dec 13, 2021
92e0ace
updated CMakeLists.txt
sarahherrmann Dec 20, 2021
776cc9b
Update CMakeLists.txt
sarahherrmann Dec 21, 2021
1d48d4d
Update CMakeLists.txt
sarahherrmann Dec 21, 2021
bee9d9e
Update CMakeLists.txt
sarahherrmann Dec 21, 2021
48d6ab2
Update CMakeLists.txt
sarahherrmann Dec 21, 2021
4a84053
Update analyse-mft-tracks.cxx
sarahherrmann Jan 10, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions PWGMM/Tasks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ o2physics_add_dpl_workflow(dndeta
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(analyse-mft-tracks
SOURCES analyse-mft-tracks.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
COMPONENT_NAME Analysis)

o2physics_add_dpl_workflow(ue-charged
SOURCES uecharged.cxx
PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore
Expand Down
101 changes: 101 additions & 0 deletions PWGMM/Tasks/analyse-mft-tracks.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// 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.

#include "Framework/runDataProcessing.h"
#include "Framework/AnalysisTask.h"

#include "TDatabasePDG.h"
#include "Common/Core/MC.h"

using namespace o2;
using namespace o2::framework;

using Particles = aod::McParticles;

//the task analyseMFTTracks loops over MFT tracks and generated particles and fills basic histograms

struct analyseMFTTracks {
int icoll = 0;
Service<TDatabasePDG> pdg;
HistogramRegistry registry{
"registry",
{
{"TracksPhiEta_in_coll", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, -M_PI, M_PI}, {35, -4.5, -1.}}}}, //
{"TracksEtaZvtx", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, //
{"NtrkZvtx", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, //
{"NtrkEta", "#eta; N_{trk}; events", {HistType::kTH1F, {{35, -4.5, -1.}}}}, //
{"TracksPhiEtaGen", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {35, -4.5, -1.}}}}, //
{"TracksEtaZvtxGen", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{35, -4.5, -1.}, {201, -20.1, 20.1}}}}, //
//{"NtrkZvtxGen", "; N_{trk}; Z_{vtx}; events", {HistType::kTH2F, {{301, -0.5, 300.5}, {201, -20.1, 20.1}}}}, //
{"NtrkEtaGen", "#eta; N_{trk}; events", {HistType::kTH1F, {{35, -4.5, -1.}}}}, //
} //
};

void processRec(o2::aod::Collision const& collision, o2::aod::MFTTracks const& tracks)
{

auto z = collision.posZ();
registry.fill(HIST("NtrkZvtx"), tracks.size(), z);

for (auto& track : tracks) {
registry.fill(HIST("TracksPhiEta_in_coll"), track.phi(), track.eta());
registry.fill(HIST("TracksEtaZvtx"), track.eta(), z);
registry.fill(HIST("NtrkEta"), track.eta());
}
icoll++;
}
//end of processRec
PROCESS_SWITCH(analyseMFTTracks, processRec, "Process rec level", true);

void processGen(aod::McCollisions::iterator const& mcCollision, Particles const& particles)
{

int nChargedPrimaryParticles = 0;
auto z = mcCollision.posZ();

for (auto& particle : particles) {
auto p = pdg->GetParticle(particle.pdgCode());
int charge = 0;
if (p == nullptr) {
// unknown particles will be skipped
if (particle.pdgCode() > 1000000000) {
// auto x = (std::trunc(particle.pdgCode() / 10000) - 100000);
// charge = x - std::trunc(x / 1000) * 1000;
LOGF(debug, "[{}] Nucleus with PDG code {}", particle.globalIndex(), particle.pdgCode() /*, charge*/); // (charge %d)
} else {
LOGF(debug, "[{}] Unknown particle with PDG code {}", particle.globalIndex(), particle.pdgCode());
}
} else {
charge = p->Charge();
}
if (charge != 0 && particle.isPhysicalPrimary()) {
Comment thread
sarahherrmann marked this conversation as resolved.
registry.fill(HIST("TracksEtaZvtxGen"), particle.eta(), z);
registry.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta());

registry.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta());
registry.fill(HIST("NtrkEtaGen"), particle.eta());
nChargedPrimaryParticles++;
}
}

registry.fill(HIST("NtrkZvtxGen"), nChargedPrimaryParticles, mcCollision.posZ());
}

PROCESS_SWITCH(analyseMFTTracks, processGen, "Process gen level", true);
};
//end of the task analyseMFTTracks

WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
{
return WorkflowSpec{
adaptAnalysisTask<analyseMFTTracks>(cfgc),
};
}