-
Notifications
You must be signed in to change notification settings - Fork 677
[PWGMM] New MM task computing MFT tracks histograms #363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 26102f8
First version of analyse-mft-tracks, a task computing histograms for …
sarahherrmann 15d0f91
First version of analyse-mft-tracks, a task computing histograms for …
sarahherrmann 9a85f1b
First version of analyse-mft-tracks, a task computing histograms for …
sarahherrmann 16209fa
Change in processGen that runs
sarahherrmann b4243b8
Change in processGen that runs
sarahherrmann 282a381
Merge branch 'master' into branchSarah
aalkin da398b2
Merge branch 'master' into branchSarah
aalkin 1c1ada2
My version of CMakeList adding mft-tracks-for-comparison
sarahherrmann 6f81129
The task analyse-mft-tracks with the wanted modifications
sarahherrmann 24bc0df
New CMakeLists with the task analyse-mft-tracks added
sarahherrmann 6195247
message
sarahherrmann 08b88eb
The new task analyse-mft-tracks with wanted modifications
sarahherrmann 6d1c20c
blabla
sarahherrmann fb7d9b2
Merge branch 'AliceO2Group:master' into branchSarah
sarahherrmann 92e0ace
updated CMakeLists.txt
sarahherrmann 776cc9b
Update CMakeLists.txt
sarahherrmann 1d48d4d
Update CMakeLists.txt
sarahherrmann bee9d9e
Update CMakeLists.txt
sarahherrmann 48d6ab2
Update CMakeLists.txt
sarahherrmann 4a84053
Update analyse-mft-tracks.cxx
sarahherrmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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()) { | ||
| 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), | ||
| }; | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.