-
Notifications
You must be signed in to change notification settings - Fork 663
[PWGJE] Add diffusion wake analysis #16570
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
Draft
nicola-wilson
wants to merge
32
commits into
AliceO2Group:master
Choose a base branch
from
nicola-wilson:table_branch_14May
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+276
−0
Draft
Changes from 29 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
9a39814
Added table producer example
nicola-wilson 8e49699
PWGJE: add tableDiffWake task
nicola-wilson b6b1b56
PWGJE: add tableDiffWake task - restored myExample
nicola-wilson 5edc2ad
Updated format tableDiffWake
nicola-wilson 25d674a
Updated format tableDiffWake 2
nicola-wilson 13f091f
Updated format tableDiffWake 3
nicola-wilson e90d684
Updated format tableDiffWake 4
nicola-wilson 6542d38
Change data types for several SOA columns
wirthni 431f51b
Rename source files in CMakeLists.txt for jet workflows
wirthni 2780af4
Fix formatting of P column declaration
wirthni e993d81
Please consider the following formatting changes
alibuild e74c748
Merge pull request #2 from alibuild/alibot-cleanup-16570
wirthni 9ece9fb
Disable OSV Scanner
wirthni c139b63
Adjust pT axis and add momentum overflow checks
wirthni ba83b1e
Refactor tableDiffWake.cxx to clean up track properties
wirthni fd23dc5
Clean up includes and fix comment space
wirthni 3205395
Refactor variable types for memory optimization
wirthni 1b2127a
Refactor variable names for clarity in tableDiffWake
wirthni 86d80c6
rewrote comments
wirthni 2874fa1
Refactor configurable parameters in tableDiffWake
wirthni 691c4f3
Enhance documentation in tableDiffWake.cxx
wirthni 20a8eb1
Rename configurable variables and type alias
wirthni cf17915
Rename struct tableDiffWake to TableDiffWake
wirthni 59f4542
Refactor casts to use static_cast
wirthni 141512f
Remove REPOSITORY_OSV_SCANNER from mega-linter
wirthni cd6e89e
Refactor track iteration to use 'const auto&'
wirthni 397e95e
Remove unnecessary comment section in tableDiffWake.cxx
wirthni 45bfab2
Clean up comments in tableDiffWake.cxx
wirthni df6997d
Optimize particle momentum calculations using bitmasking
wirthni c7ea0d7
Fixed index column and syntax in momentum packing
nicola-wilson 138dea9
Rename tableDiffWake.cxx to diffWakeTreeProducer.cxx
nicola-wilson 030b2a4
Changed name of task
nicola-wilson 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,269 @@ | ||
| // 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. | ||
| /// | ||
| /// \file tableDiffWake.cxx | ||
| /// \brief This task writes a collision and track table which are further used in a diffusion wake analysis | ||
| /// \author Nicola Wilson <nicola.wilson@cern.ch> | ||
|
|
||
| #include "Common/CCDB/EventSelectionParams.h" | ||
| #include "Common/Core/EventPlaneHelper.h" | ||
| #include "Common/DataModel/Centrality.h" | ||
| #include "Common/DataModel/EventSelection.h" | ||
| #include "Common/DataModel/Multiplicity.h" | ||
| #include "Common/DataModel/Qvectors.h" | ||
| #include "Common/DataModel/TrackSelectionTables.h" | ||
|
|
||
| #include <Framework/ASoA.h> | ||
| #include <Framework/AnalysisDataModel.h> | ||
| #include <Framework/AnalysisHelpers.h> | ||
| #include <Framework/AnalysisTask.h> | ||
| #include <Framework/HistogramRegistry.h> | ||
| #include <Framework/HistogramSpec.h> | ||
| #include <Framework/InitContext.h> | ||
| #include <Framework/OutputObjHeader.h> | ||
| #include <Framework/runDataProcessing.h> | ||
|
|
||
| // Event selection: Only events that contain track above some threshold | ||
| // ------------------------------------------------------------------------------------------- | ||
| // TRACK DATA | ||
| // ------------------------------------------------------------------------------------------- | ||
| // BEFORE COMPRESSION AFTER COMPRESSION | ||
| // Name Data Type Size(b) Name Data Type Size(b) | ||
| // ColID int32_t 4 [same] | ||
| // Charge short 2 [same] | ||
| // Px, Py, Pz float 3x4 P unsigned long 8 | ||
| // DEdx float 4 DEdx unsigned short 2 | ||
| // DCAXY float 4 DCAXY short 2 | ||
| // DCAZ float 4 DCAZ short 2 | ||
| // Length float 4 Length unsigned short 2 | ||
|
|
||
| // OVERALL COMPRESSION 34b->22b | ||
|
|
||
| // ------------------------------------------------------------------------------------------- | ||
| // EVENT DATA | ||
| // ------------------------------------------------------------------------------------------- | ||
| // GI int64_t 8 [same] | ||
| // RN int 4 [same] | ||
| // Cent float 4 [same] | ||
| // Mult int 4 [same] | ||
| // VertexX float 4 [same] | ||
| // VertexY float 4 [same] | ||
| // VertexZ float 4 [same] | ||
| // Psi2 float 4 Psi2 short 2 | ||
| // Psi3 float 4 Psi3 short 2 | ||
|
|
||
| // OVERALL COMPRESSION 40b->36b | ||
| //-------------------------------------------------------- | ||
| namespace o2::aod | ||
| { | ||
| namespace testcol | ||
| { | ||
| // Event properties | ||
| // DECLARE_SOA_COLUMN(Gi, gi, int64_t); | ||
| DECLARE_SOA_COLUMN(Rn, rn, int32_t); // run number | ||
| DECLARE_SOA_COLUMN(Cent, cent, float); // FT0C centrality | ||
| DECLARE_SOA_COLUMN(Mult, mult, int32_t); // TPC multiplicity | ||
| DECLARE_SOA_COLUMN(Occu, occu, int32_t); // Occupancy ITS | ||
| DECLARE_SOA_COLUMN(Occuft0, occuft0, float); // Occupancy FT0C amplitudes | ||
| DECLARE_SOA_COLUMN(VertexX, vertexX, float); | ||
| DECLARE_SOA_COLUMN(VertexY, vertexY, float); | ||
| DECLARE_SOA_COLUMN(VertexZ, vertexZ, float); | ||
| DECLARE_SOA_COLUMN(Psi2, psi2, int16_t); | ||
| DECLARE_SOA_COLUMN(Psi3, psi3, int16_t); | ||
| } // namespace testcol | ||
|
|
||
| DECLARE_SOA_TABLE(TableCol, "AOD", "TABLECOL", | ||
| o2::soa::Index<>, | ||
| testcol::Rn, | ||
| testcol::Cent, | ||
| testcol::Mult, | ||
| testcol::Occu, | ||
| testcol::Occuft0, | ||
| testcol::VertexX, | ||
| testcol::VertexY, | ||
| testcol::VertexZ, | ||
| testcol::Psi2, | ||
| testcol::Psi3); | ||
| using Collision = TableCol::iterator; | ||
|
|
||
| namespace testtrack | ||
| { | ||
|
|
||
| // Track properties | ||
| DECLARE_SOA_INDEX_COLUMN(Collision, collision); | ||
| DECLARE_SOA_COLUMN(Charge, charge, int16_t); | ||
| DECLARE_SOA_COLUMN(P, p, uint64_t); | ||
| DECLARE_SOA_COLUMN(Dedx, dedx, uint16_t); | ||
| DECLARE_SOA_COLUMN(Dcaxy, dcaxy, int16_t); | ||
| DECLARE_SOA_COLUMN(Dcaz, dcaz, int16_t); | ||
| } // namespace testtrack | ||
|
|
||
| DECLARE_SOA_TABLE(TableTrack, "AOD", "TABLETRACK", | ||
| o2::soa::Index<>, | ||
| testtrack::CollisionId, | ||
| testtrack::Charge, | ||
| testtrack::P, | ||
| testtrack::Dedx, | ||
| testtrack::Dcaxy, | ||
| testtrack::Dcaz); | ||
| } // namespace o2::aod | ||
| //-------------------------------------------------------- | ||
| using namespace o2; | ||
| using namespace o2::framework; | ||
|
|
||
| struct TableDiffWake { | ||
|
|
||
| HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; | ||
| Configurable<int> nBinsPt{"nBinsPt", 100, "N bins in pT histo"}; | ||
| Configurable<double> ptThresh{"ptThresh", 20.0, "pT threshold"}; | ||
| Configurable<float> centMax{"centMax", 10, "centrality"}; | ||
| Configurable<float> zVertCut{"zVertCut", 10.0, "z_vertex cut"}; | ||
|
|
||
| Produces<o2::aod::TableCol> testcol; | ||
| Produces<o2::aod::TableTrack> testtrack; | ||
|
|
||
| EventPlaneHelper helperEP; | ||
|
|
||
| void init(InitContext const&) | ||
| { | ||
| const AxisSpec axisEta{30, -1.5, +1.5, "#eta"}; | ||
| const AxisSpec axispT{nBinsPt, 0, 250, "p_{T}"}; | ||
|
|
||
| histos.add("etaHistogram", "etaHistogram", kTH1F, {axisEta}); | ||
| histos.add("pTHistogram", "pTHistogram", kTH1F, {axispT}); | ||
| } | ||
|
|
||
| using Bcs = aod::BCs; | ||
| void process(soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::TPCMults, aod::QvectorFT0Cs>::iterator const& col, | ||
| soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection> const& tracks, | ||
| Bcs const&) | ||
| { | ||
| const float maxMomentum = 173.0; | ||
|
|
||
| // Event selection corresponds to sel8FullPbPb | ||
| if (!col.sel8()) | ||
| return; | ||
| if (col.centFT0C() > centMax) | ||
| return; // Centrality 0 - 10 % | ||
| if (std::abs(col.posZ()) > zVertCut) | ||
| return; // z position < 10 cm | ||
| if (!col.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) | ||
| return; | ||
| if (!col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) | ||
| return; | ||
|
|
||
| //------ Get Run number --------------------- | ||
| auto bc = col.bc_as<Bcs>(); | ||
| int run = bc.runNumber(); | ||
| //------------ EP --------------------------- | ||
| double ep2 = 0.0; | ||
| double ep3 = 0.0; | ||
| ep2 = helperEP.GetEventPlane(col.qvecFT0CRe(), col.qvecFT0CIm(), 2); | ||
| ep3 = helperEP.GetEventPlane(col.qvecFT0CRe(), col.qvecFT0CIm(), 3); | ||
|
|
||
| //------- Only events with track above some thresh ---------- | ||
|
|
||
| bool eventHighpT = false; | ||
| for (const auto& track : tracks) { | ||
|
|
||
| if (!track.isGlobalTrack()) | ||
| continue; | ||
| if (track.pt() > ptThresh) { | ||
| eventHighpT = true; | ||
| break; | ||
| } | ||
| } | ||
| if (!eventHighpT) | ||
| return; | ||
| //------------------------------------------------------------ | ||
| // Translate values to less memory consuming values | ||
| int16_t substituteEp2 = static_cast<int16_t>(ep2 * 1000); | ||
| int16_t substituteEp3 = static_cast<int16_t>(ep3 * 1000); | ||
|
|
||
| testcol(col.globalIndex(), | ||
| run, | ||
| col.centFT0C(), | ||
| col.multTPC(), | ||
| col.trackOccupancyInTimeRange(), | ||
| col.ft0cOccupancyInTimeRange(), | ||
| col.posX(), | ||
| col.posY(), | ||
| col.posZ(), | ||
| substituteEp2, | ||
| substituteEp3); | ||
|
|
||
| for (const auto& track : tracks) { | ||
|
|
||
| // Track cut | ||
| if (!track.isGlobalTrack()) | ||
| continue; // General track cuts | ||
|
|
||
| if (std::abs(track.px()) > maxMomentum || std::abs(track.py()) > maxMomentum || std::abs(track.pz()) > maxMomentum) | ||
| continue; // to avoid overflow in Substitute_p | ||
|
|
||
| histos.fill(HIST("etaHistogram"), track.eta()); | ||
| histos.fill(HIST("pTHistogram"), track.pt()); | ||
|
|
||
| //------------ Translate values to less memory consuming values -------------------- | ||
| // Px, Py, Pz | ||
| uint64_t substituteP = 0; | ||
| uint8_t uppermostBit = 20; | ||
| uint8_t lowermostBit = 0; | ||
| uint64_t bitmask20Bits = 0b11111111111111111111; | ||
|
|
||
| int64_t particlePx = (track.px() * 6000); | ||
| if (particlePx < 0) | ||
| substituteP |= static_cast<uint64_t>1 << uppermostBit; | ||
| if (particlePx < 0) | ||
| particlePx = (-1) * particlePx; | ||
| substituteP |= (particlePx & bitmask20Bits) << lowermostBit; | ||
|
|
||
| uppermostBit = 41; | ||
| lowermostBit = 21; | ||
| int64_t particlePy = (track.py() * 6000); | ||
| if (particlePy < 0) | ||
| substituteP |= static_cast<uint64_t>1 << uppermostBit; | ||
| if (particlePy < 0) | ||
| particlePy = (-1) * particlePy; | ||
| substituteP |= (particlePy & bitmask20Bits) << lowermostBit; | ||
|
|
||
| uppermostBit = 62; | ||
| lowermostBit = 42; | ||
| int64_t particlePz = (track.pz() * 6000); | ||
| if (particlePz < 0) | ||
| substituteP |= static_cast<uint64_t>1 << uppermostBit; | ||
| if (particlePz < 0) | ||
| particlePz = (-1) * particlePz; | ||
| substituteP |= (particlePz & bitmask20Bits) << lowermostBit; | ||
|
|
||
| // dEdx | ||
| uint16_t substituteDEDX = static_cast<uint16_t>(track.tpcSignal() * 10); | ||
|
|
||
| // DCA | ||
| int16_t substituteDCAXY = static_cast<int16_t>(track.dcaXY() * 100); | ||
| int16_t substituteDCAZ = static_cast<int16_t>(track.dcaZ() * 100); | ||
|
|
||
| //--------------- Fill track table ------------------ | ||
| testtrack(track.collisionId(), | ||
| track.sign(), | ||
| substituteP, | ||
| substituteDEDX, | ||
| substituteDCAXY, | ||
| substituteDCAZ); | ||
| } | ||
| } | ||
| }; | ||
|
|
||
| WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) | ||
| { | ||
| return WorkflowSpec{ | ||
| adaptAnalysisTask<TableDiffWake>(cfgc)}; | ||
| } |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files are not modified in this PR.