Skip to content

Commit 6ec5e66

Browse files
committed
PWGLF: test fusion of track propagation and stra. building
1 parent 25541ee commit 6ec5e66

File tree

2 files changed

+2693
-0
lines changed

2 files changed

+2693
-0
lines changed
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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+
/// \file trackPropagationTester.cxx
13+
/// \brief testing ground for track propagation
14+
/// \author ALICE
15+
16+
//===============================================================
17+
//
18+
// Experimental version of the track propagation task
19+
// this utilizes an analysis task module that can be employed elsewhere
20+
// and allows for the re-utilization of a material LUT
21+
//
22+
// candidate approach for core service approach
23+
//
24+
//===============================================================
25+
26+
#include "Framework/AnalysisDataModel.h"
27+
#include "Framework/AnalysisTask.h"
28+
#include "Framework/runDataProcessing.h"
29+
#include "Framework/RunningWorkflowInfo.h"
30+
#include "Common/DataModel/TrackSelectionTables.h"
31+
#include "Common/Core/trackUtilities.h"
32+
#include "ReconstructionDataFormats/DCA.h"
33+
#include "DetectorsBase/Propagator.h"
34+
#include "DetectorsBase/GeometryManager.h"
35+
#include "CommonUtils/NameConf.h"
36+
#include "CCDB/CcdbApi.h"
37+
#include "DataFormatsParameters/GRPMagField.h"
38+
#include "CCDB/BasicCCDBManager.h"
39+
#include "Framework/HistogramRegistry.h"
40+
#include "DataFormatsCalibration/MeanVertexObject.h"
41+
#include "CommonConstants/GeomConstants.h"
42+
#include "PWGLF/Utils/strangenessBuilderModule.h"
43+
#include "Common/Tools/StandardCCDBLoader.h"
44+
45+
// The Run 3 AO2D stores the tracks at the point of innermost update. For a track with ITS this is the innermost (or second innermost)
46+
// ITS layer. For a track without ITS, this is the TPC inner wall or for loopers in the TPC even a radius beyond that.
47+
// In order to use the track parameters, the tracks have to be propagated to the collision vertex which is done by this task.
48+
// The task consumes the TracksIU and TracksCovIU tables and produces Tracks and TracksCov to which then the user analysis can subscribe.
49+
//
50+
// This task is not needed for Run 2 converted data.
51+
// There are two versions of the task (see process flags), one producing also the covariance matrix and the other only the tracks table.
52+
53+
using namespace o2;
54+
using namespace o2::framework;
55+
// using namespace o2::framework::expressions;
56+
57+
// use parameters + cov mat non-propagated, aux info + (extension propagated)
58+
using FullTracksExt = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov>;
59+
using FullTracksExtIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU>;
60+
using FullTracksExtWithPID = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa, aod::pidTPCFullHe>;
61+
using FullTracksExtIUWithPID = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa, aod::pidTPCFullHe>;
62+
using FullTracksExtLabeled = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::McTrackLabels>;
63+
using FullTracksExtLabeledIU = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::McTrackLabels>;
64+
using FullTracksExtLabeledWithPID = soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksCov, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa, aod::pidTPCFullHe, aod::McTrackLabels>;
65+
using FullTracksExtLabeledIUWithPID = soa::Join<aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa, aod::pidTPCFullHe, aod::McTrackLabels>;
66+
using TracksWithExtra = soa::Join<aod::Tracks, aod::TracksExtra>;
67+
68+
// For dE/dx association in pre-selection
69+
using TracksExtraWithPID = soa::Join<aod::TracksExtra, aod::pidTPCFullEl, aod::pidTPCFullPi, aod::pidTPCFullPr, aod::pidTPCFullKa, aod::pidTPCFullHe>;
70+
71+
struct StrangenessBuilderTester {
72+
// CCDB boilerplate declarations
73+
o2::framework::Configurable<std::string> ccdburl{"ccdburl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
74+
Service<o2::ccdb::BasicCCDBManager> ccdb;
75+
76+
// propagation stuff
77+
o2::common::StandardCCDBLoaderConfigurables standardCCDBLoaderConfigurables;
78+
o2::common::StandardCCDBLoader ccdbLoader;
79+
80+
// boilerplate: strangeness builder stuff
81+
o2::pwglf::strangenessbuilder::products products;
82+
o2::pwglf::strangenessbuilder::coreConfigurables baseOpts;
83+
o2::pwglf::strangenessbuilder::v0Configurables v0BuilderOpts;
84+
o2::pwglf::strangenessbuilder::cascadeConfigurables cascadeBuilderOpts;
85+
o2::pwglf::strangenessbuilder::preSelectOpts preSelectOpts;
86+
o2::pwglf::strangenessbuilder::BuilderModule strangenessBuilderModule;
87+
88+
// registry
89+
HistogramRegistry histos{"histos"};
90+
91+
void init(o2::framework::InitContext& initContext)
92+
{
93+
// CCDB boilerplate init
94+
ccdb->setCaching(true);
95+
ccdb->setLocalObjectValidityChecking();
96+
ccdb->setURL(ccdburl.value);
97+
98+
// task-specific
99+
strangenessBuilderModule.init(baseOpts, v0BuilderOpts, cascadeBuilderOpts, preSelectOpts, histos, initContext);
100+
}
101+
102+
void processRealData(soa::Join<aod::Collisions, aod::EvSels> const& collisions, aod::V0s const& v0s, aod::Cascades const& cascades, aod::TrackedCascades const& trackedCascades, FullTracksExtIU const& tracks, aod::BCsWithTimestamps const& bcs)
103+
{
104+
ccdbLoader.initCCDBfromBCs(standardCCDBLoaderConfigurables, ccdb, bcs);
105+
strangenessBuilderModule.dataProcess(ccdb, histos, collisions, static_cast<TObject*>(nullptr), v0s, cascades, trackedCascades, tracks, bcs, static_cast<TObject*>(nullptr), products);
106+
}
107+
108+
void processMonteCarlo(soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels> const& collisions, aod::McCollisions const& mccollisions, aod::V0s const& v0s, aod::Cascades const& cascades, aod::TrackedCascades const& trackedCascades, FullTracksExtLabeledIU const& tracks, aod::BCsWithTimestamps const& bcs, aod::McParticles const& mcParticles)
109+
{
110+
ccdbLoader.initCCDBfromBCs(standardCCDBLoaderConfigurables, ccdb, bcs);
111+
strangenessBuilderModule.dataProcess(ccdb, histos, collisions, mccollisions, v0s, cascades, trackedCascades, tracks, bcs, mcParticles, products);
112+
}
113+
114+
void processRealDataWithPID(soa::Join<aod::Collisions, aod::EvSels> const& collisions, aod::V0s const& v0s, aod::Cascades const& cascades, aod::TrackedCascades const& trackedCascades, FullTracksExtIUWithPID const& tracks, aod::BCsWithTimestamps const& bcs)
115+
{
116+
ccdbLoader.initCCDBfromBCs(standardCCDBLoaderConfigurables, ccdb, bcs);
117+
strangenessBuilderModule.dataProcess(ccdb, histos, collisions, static_cast<TObject*>(nullptr), v0s, cascades, trackedCascades, tracks, bcs, static_cast<TObject*>(nullptr), products);
118+
}
119+
120+
void processMonteCarloWithPID(soa::Join<aod::Collisions, aod::EvSels, aod::McCollisionLabels> const& collisions, aod::McCollisions const& mccollisions, aod::V0s const& v0s, aod::Cascades const& cascades, aod::TrackedCascades const& trackedCascades, FullTracksExtLabeledIUWithPID const& tracks, aod::BCsWithTimestamps const& bcs, aod::McParticles const& mcParticles)
121+
{
122+
ccdbLoader.initCCDBfromBCs(standardCCDBLoaderConfigurables, ccdb, bcs);
123+
strangenessBuilderModule.dataProcess(ccdb, histos, collisions, mccollisions, v0s, cascades, trackedCascades, tracks, bcs, mcParticles, products);
124+
}
125+
126+
PROCESS_SWITCH(StrangenessBuilderTester, processRealData, "process real data", true);
127+
PROCESS_SWITCH(StrangenessBuilderTester, processRealDataRun2, "process real data (Run 2)", false);
128+
PROCESS_SWITCH(StrangenessBuilderTester, processMonteCarlo, "process monte carlo", false);
129+
PROCESS_SWITCH(StrangenessBuilderTester, processMonteCarloRun2, "process monte carlo (Run 2)", false);
130+
PROCESS_SWITCH(StrangenessBuilderTester, processRealDataWithPID, "process real data", false);
131+
PROCESS_SWITCH(StrangenessBuilderTester, processRealDataRun2WithPID, "process real data (Run 2)", false);
132+
PROCESS_SWITCH(StrangenessBuilderTester, processMonteCarloWithPID, "process monte carlo", false);
133+
PROCESS_SWITCH(StrangenessBuilderTester, processMonteCarloRun2WithPID, "process monte carlo (Run 2)", false);
134+
};
135+
136+
//****************************************************************************************
137+
/**
138+
* Workflow definition.
139+
*/
140+
//****************************************************************************************
141+
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
142+
{
143+
WorkflowSpec workflow{adaptAnalysisTask<StrangenessBuilderTester>(cfgc)};
144+
return workflow;
145+
}

0 commit comments

Comments
 (0)