Skip to content

Commit 3099154

Browse files
f3schalcaliva
authored andcommitted
IT3: Full simulation + Glo-tracking (#13069)
* IT3: Rename branches, ROFBias, IOUtils * IT3: GlobalTracking Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * IT3: fix stray assertion Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * IT3: Propagate cluster sizes Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * IT3: Fix cluster errors for matching Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * IT3: more verbose macro Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * IT3: Add library for macro Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * IT3: Fix cluster errors Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * IT3: Debug dca projections Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * IT3: Change lines back Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> --------- Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> (cherry picked from commit 5ba6226)
1 parent 00006eb commit 3099154

File tree

54 files changed

+1854
-407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1854
-407
lines changed

DataFormats/Detectors/GlobalTracking/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# granted to it by virtue of its status as an Intergovernmental Organization
1010
# or submit itself to any jurisdiction.
1111

12+
#add_compile_options(-O0 -g -fPIC -fno-omit-frame-pointer)
13+
1214
o2_add_library(
1315
DataFormatsGlobalTracking
1416
SOURCES src/RecoContainer.cxx
@@ -35,6 +37,7 @@ o2_add_library(
3537
O2::DataFormatsPHOS
3638
O2::DataFormatsEMCAL
3739
O2::GPUDataTypeHeaders
40+
$<$<BOOL:${ENABLE_UPGRADES}>:O2::ITS3Reconstruction>
3841
PRIVATE_LINK_LIBRARIES
3942
O2::Framework)
4043

DataFormats/Detectors/GlobalTracking/include/DataFormatsGlobalTracking/RecoContainer.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@ struct DataRequest {
247247
void requestStrangeTracks(bool mc);
248248

249249
void requestIRFramesITS();
250+
251+
#ifdef ENABLE_UPGRADES
252+
void requestIT3Clusters(bool mc);
253+
#endif
250254
};
251255

252256
// Helper class to requested data.
@@ -402,6 +406,10 @@ struct RecoContainer {
402406

403407
void addIRFramesITS(o2::framework::ProcessingContext& pc);
404408

409+
#ifdef ENABLE_UPGRADES
410+
void addIT3Clusters(o2::framework::ProcessingContext& pc, bool mc);
411+
#endif
412+
405413
// custom getters
406414

407415
// get contributors from single detectors: return array with sources set to all contributing GTrackIDs

DataFormats/Detectors/GlobalTracking/src/RecoContainer.cxx

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
#include "Framework/DataRefUtils.h"
4343
#include "Framework/CCDBParamSpec.h"
4444

45+
#ifdef ENABLE_UPGRADES
46+
#include "ITS3Reconstruction/TopologyDictionary.h"
47+
#endif
48+
4549
using namespace o2::globaltracking;
4650
using namespace o2::framework;
4751
namespace o2d = o2::dataformats;
@@ -227,14 +231,29 @@ void DataRequest::requestITSClusters(bool mc)
227231
addInput({"clusITS", "ITS", "COMPCLUSTERS", 0, Lifetime::Timeframe});
228232
addInput({"clusITSPatt", "ITS", "PATTERNS", 0, Lifetime::Timeframe});
229233
addInput({"clusITSROF", "ITS", "CLUSTERSROF", 0, Lifetime::Timeframe});
230-
addInput({"cldictITS", "ITS", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("ITS/Calib/ClusterDictionary")});
231234
addInput({"alpparITS", "ITS", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/AlpideParam")});
232235
if (mc) {
233236
addInput({"clusITSMC", "ITS", "CLUSTERSMCTR", 0, Lifetime::Timeframe});
234237
}
238+
addInput({"cldictITS", "ITS", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("ITS/Calib/ClusterDictionary")});
235239
requestMap["clusITS"] = mc;
236240
}
237241

242+
#ifdef ENABLE_UPGRADES
243+
void DataRequest::requestIT3Clusters(bool mc)
244+
{
245+
addInput({"clusITS", "ITS", "COMPCLUSTERS", 0, Lifetime::Timeframe});
246+
addInput({"clusITSPatt", "ITS", "PATTERNS", 0, Lifetime::Timeframe});
247+
addInput({"clusITSROF", "ITS", "CLUSTERSROF", 0, Lifetime::Timeframe});
248+
addInput({"alpparITS", "ITS", "ALPIDEPARAM", 0, Lifetime::Condition, ccdbParamSpec("ITS/Config/AlpideParam")});
249+
if (mc) {
250+
addInput({"clusITSMC", "ITS", "CLUSTERSMCTR", 0, Lifetime::Timeframe});
251+
}
252+
addInput({"cldictIT3", "IT3", "CLUSDICT", 0, Lifetime::Condition, ccdbParamSpec("IT3/Calib/ClusterDictionary")});
253+
requestMap["clusIT3"] = mc;
254+
}
255+
#endif
256+
238257
void DataRequest::requestMFTClusters(bool mc)
239258
{
240259
addInput({"clusMFT", "MFT", "COMPCLUSTERS", 0, Lifetime::Timeframe});
@@ -673,6 +692,13 @@ void RecoContainer::collectData(ProcessingContext& pc, const DataRequest& reques
673692
addITSClusters(pc, req->second);
674693
}
675694

695+
#ifdef ENABLE_UPGRADES
696+
req = reqMap.find("clusIT3");
697+
if (req != reqMap.end()) {
698+
addIT3Clusters(pc, req->second);
699+
}
700+
#endif
701+
676702
req = reqMap.find("clusMFT");
677703
if (req != reqMap.end()) {
678704
addMFTClusters(pc, req->second);
@@ -1047,6 +1073,22 @@ void RecoContainer::addITSClusters(ProcessingContext& pc, bool mc)
10471073
}
10481074
}
10491075

1076+
#ifdef ENABLE_UPGRADES
1077+
void RecoContainer::addIT3Clusters(ProcessingContext& pc, bool mc)
1078+
{
1079+
if (pc.services().get<o2::framework::TimingInfo>().globalRunNumberChanged) { // this params need to be queried only once
1080+
pc.inputs().get<o2::itsmft::DPLAlpideParam<o2::detectors::DetID::ITS>*>("alpparITS"); // note: configurable param does not need finaliseCCDB
1081+
pc.inputs().get<o2::its3::TopologyDictionary*>("cldictIT3"); // just to trigger the finaliseCCDB
1082+
}
1083+
commonPool[GTrackID::ITS].registerContainer(pc.inputs().get<gsl::span<o2::itsmft::ROFRecord>>("clusITSROF"), CLUSREFS);
1084+
commonPool[GTrackID::ITS].registerContainer(pc.inputs().get<gsl::span<o2::itsmft::CompClusterExt>>("clusITS"), CLUSTERS);
1085+
commonPool[GTrackID::ITS].registerContainer(pc.inputs().get<gsl::span<unsigned char>>("clusITSPatt"), PATTERNS);
1086+
if (mc) {
1087+
mcITSClusters = pc.inputs().get<const dataformats::MCTruthContainer<MCCompLabel>*>("clusITSMC");
1088+
}
1089+
}
1090+
#endif
1091+
10501092
//__________________________________________________________
10511093
void RecoContainer::addMFTClusters(ProcessingContext& pc, bool mc)
10521094
{

Detectors/Base/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ o2_add_library(DetectorsBase
2626
src/GRPGeomHelper.cxx
2727
src/Stack.cxx
2828
src/VMCSeederService.cxx
29+
src/GlobalParams.cxx
2930
PUBLIC_LINK_LIBRARIES FairRoot::Base
3031
O2::CommonUtils
3132
O2::DetectorsCommonDataFormats
@@ -57,7 +58,8 @@ o2_target_root_dictionary(DetectorsBase
5758
include/DetectorsBase/MatLayerCylSet.h
5859
include/DetectorsBase/Aligner.h
5960
include/DetectorsBase/Stack.h
60-
include/DetectorsBase/SimFieldUtils.h)
61+
include/DetectorsBase/SimFieldUtils.h
62+
include/DetectorsBase/GlobalParams.h)
6163

6264
if(BUILD_SIMULATION)
6365
if (NOT APPLE)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
#ifndef DETECTORS_BASE_GLOBALPARAMS_H_
13+
#define DETECTORS_BASE_GLOBALPARAMS_H_
14+
15+
#include "CommonUtils/ConfigurableParam.h"
16+
#include "CommonUtils/ConfigurableParamHelper.h"
17+
18+
namespace o2
19+
{
20+
21+
struct GlobalParams : public o2::conf::ConfigurableParamHelper<GlobalParams> {
22+
bool withITS3 = false; // detector geometry includes ITS3
23+
24+
O2ParamDef(GlobalParams, "GlobalParams");
25+
};
26+
27+
} // namespace o2
28+
29+
#endif // DETECTORS_BASE_GLOBALPARAMS_H_

Detectors/Base/src/DetectorsBaseLinkDef.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
#pragma link C++ class o2::base::Aligner + ;
3737
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::base::Aligner> + ;
3838

39+
#pragma link C++ class o2::GlobalParams + ;
40+
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::GlobalParams> + ;
41+
3942
#pragma link C++ class o2::data::Stack + ;
4043

4144
#endif
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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+
#include "DetectorsBase/GlobalParams.h"
13+
O2ParamImpl(o2::GlobalParams);

Detectors/GlobalTracking/CMakeLists.txt

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# In applying this license CERN does not waive the privileges and immunities
99
# granted to it by virtue of its status as an Intergovernmental Organization
1010
# or submit itself to any jurisdiction.
11-
# add_compile_options(-O0 -g -fPIC)
11+
#add_compile_options(-O0 -g -fPIC -fno-omit-frame-pointer)
1212

1313
o2_add_library(GlobalTracking
1414
TARGETVARNAME targetName
@@ -22,37 +22,36 @@ o2_add_library(GlobalTracking
2222
src/MatchGlobalFwdAssessment.cxx
2323
src/MatchGlobalFwdParam.cxx
2424
src/MatchTOFParams.cxx
25-
src/MatchITSTPCQC.cxx
26-
src/ITSTPCMatchingQCParams.cxx
27-
PUBLIC_LINK_LIBRARIES O2::Framework
28-
O2::DataFormatsTPC
29-
O2::DataFormatsITSMFT
30-
O2::DataFormatsITS
31-
O2::DataFormatsFT0
32-
O2::DataFormatsTOF
33-
O2::DataFormatsHMP
34-
O2::DataFormatsTRD
35-
O2::ITSReconstruction
36-
O2::FT0Reconstruction
37-
O2::TPCFastTransformation
38-
O2::GPUO2Interface
39-
O2::GPUTracking
40-
O2::TPCBase
41-
O2::TPCReconstruction
42-
O2::TPCCalibration
43-
O2::TOFBase
44-
O2::HMPIDReconstruction
45-
O2::TOFCalibration
46-
O2::TOFWorkflowUtils
47-
O2::SimConfig
48-
O2::DataFormatsFT0
49-
O2::DataFormatsGlobalTracking
50-
O2::ITStracking
51-
O2::MFTTracking
52-
O2::MCHTracking
53-
O2::MathUtils
54-
O2::ReconstructionDataFormats
55-
O2::Steer)
25+
PUBLIC_LINK_LIBRARIES O2::Framework
26+
O2::DataFormatsTPC
27+
O2::DataFormatsITSMFT
28+
O2::DataFormatsITS
29+
O2::DataFormatsFT0
30+
O2::DataFormatsTOF
31+
O2::DataFormatsHMP
32+
O2::DataFormatsTRD
33+
O2::ITSReconstruction
34+
O2::FT0Reconstruction
35+
O2::TPCFastTransformation
36+
O2::GPUO2Interface
37+
O2::GPUTracking
38+
O2::TPCBase
39+
O2::TPCReconstruction
40+
O2::TPCCalibration
41+
O2::TOFBase
42+
O2::HMPIDReconstruction
43+
O2::TOFCalibration
44+
O2::TOFWorkflowUtils
45+
O2::SimConfig
46+
O2::DataFormatsFT0
47+
O2::DataFormatsGlobalTracking
48+
O2::ITStracking
49+
O2::MFTTracking
50+
O2::MCHTracking
51+
O2::MathUtils
52+
O2::ReconstructionDataFormats
53+
O2::Steer
54+
$<$<BOOL:${ENABLE_UPGRADES}>:O2::ITS3Reconstruction>)
5655

5756
o2_target_root_dictionary(GlobalTracking
5857
HEADERS include/GlobalTracking/MatchTPCITSParams.h

Detectors/GlobalTracking/include/GlobalTracking/MatchTPCITS.h

Lines changed: 45 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@
5858
#if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__ROOTCLING__) && !defined(__CLING__)
5959
#include "MemoryResources/MemoryResources.h"
6060
#endif
61+
#ifdef ENABLE_UPGRADES
62+
#include "ITS3Reconstruction/TopologyDictionary.h"
63+
#endif
6164

6265
class TTree;
6366

@@ -137,7 +140,7 @@ struct TrackLocTPC : public o2::track::TrackParCov {
137140
}
138141
float getSignedDT(float dt) const // account for TPC side in time difference for dt=external_time - tpc.time0
139142
{
140-
return constraint == Constrained ? 0. : (constraint == ASide ? dt : -dt);
143+
return constraint == Constrained ? 0.f : (constraint == ASide ? dt : -dt);
141144
}
142145

143146
ClassDefNV(TrackLocTPC, 2);
@@ -298,12 +301,23 @@ struct ITSChipClustersRefs {
298301
///< contaner for sorted cluster indices for certain time window (usually ROF) and reference on the start and N clusters
299302
///< for every chip
300303
using ClusRange = o2::dataformats::RangeReference<int, int>;
301-
std::vector<int> clusterID; // indices of sorted clusters
304+
std::vector<int> clusterID; // indices of sorted clusters
305+
306+
#ifndef ENABLE_UPGRADES
302307
std::array<ClusRange, o2::its::RecoGeomHelper::getNChips()> chipRefs; // offset and number of clusters in each chip
303308
ITSChipClustersRefs(int nclIni = 50000)
304309
{
305310
clusterID.reserve(nclIni);
306311
}
312+
#else
313+
std::vector<ClusRange> chipRefs; // offset and number of clusters in each chip
314+
ITSChipClustersRefs(int nchips = o2::its::RecoGeomHelper::getNChips(), int nclIni = 50000)
315+
{
316+
clusterID.reserve(nclIni);
317+
chipRefs.resize(nchips, ClusRange());
318+
}
319+
#endif
320+
307321
void clear()
308322
{
309323
clusterID.clear();
@@ -356,7 +370,10 @@ class MatchTPCITS
356370
pmr::vector<o2::itsmft::TrkClusRef>& ABTrackletRefs, pmr::vector<o2::dataformats::Triplet<float, float, float>>& calib);
357371
bool refitABTrack(int iITSAB, const TPCABSeed& seed, pmr::vector<o2::dataformats::TrackTPCITS>& matchedTracks, pmr::vector<int>& ABTrackletClusterIDs, pmr::vector<o2::itsmft::TrkClusRef>& ABTrackletRefs);
358372
#endif // CLING
359-
void setSkipTPCOnly(bool v) { mSkipTPCOnly = v; }
373+
void setSkipTPCOnly(bool v)
374+
{
375+
mSkipTPCOnly = v;
376+
}
360377
void setCosmics(bool v) { mCosmics = v; }
361378
bool isCosmics() const { return mCosmics; }
362379
void setNThreads(int n);
@@ -395,6 +412,12 @@ class MatchTPCITS
395412

396413
// ==================== >> DPL-driven input >> =======================
397414
void setITSDictionary(const o2::itsmft::TopologyDictionary* d) { mITSDict = d; }
415+
#ifdef ENABLE_UPGRADES
416+
void setIT3Dictionary(const o2::its3::TopologyDictionary* d)
417+
{
418+
mIT3Dict = d;
419+
}
420+
#endif
398421

399422
///< set flag to use MC truth
400423
void setMCTruthOn(bool v)
@@ -560,13 +583,13 @@ class MatchTPCITS
560583
float correctTPCTrack(o2::track::TrackParCov& trc, const TrackLocTPC& tTPC, const InteractionCandidate& cand) const; // RS FIXME will be needed for refit
561584
//================================================================
562585

563-
bool mInitDone = false; ///< flag init already done
564-
bool mFieldON = true; ///< flag for field ON/OFF
565-
bool mCosmics = false; ///< flag cosmics mode
566-
bool mMCTruthON = false; ///< flag availability of MC truth
567-
float mBz = 0; ///< nominal Bz
568-
int mTFCount = 0; ///< internal TF counter for debugger
569-
int mNThreads = 1; ///< number of OMP threads
586+
bool mInitDone = false; ///< flag init already done
587+
bool mFieldON = true; ///< flag for field ON/OFF
588+
bool mCosmics = false; ///< flag cosmics mode
589+
bool mMCTruthON = false; ///< flag availability of MC truth
590+
float mBz = 0; ///< nominal Bz
591+
int mTFCount = 0; ///< internal TF counter for debugger
592+
int mNThreads = 1; ///< number of OMP threads
570593
int mNHBPerTF = 0;
571594
int mNTPCOccBinLength = 0; ///< TPC occ. histo bin length in TBs
572595
float mNTPCOccBinLengthInv;
@@ -646,6 +669,9 @@ class MatchTPCITS
646669
gsl::span<const unsigned int> mTPCRefitterOccMap; ///< externally set TPC clusters occupancy map
647670

648671
const o2::itsmft::TopologyDictionary* mITSDict{nullptr}; // cluster patterns dictionary
672+
#ifdef ENABLE_UPGRADES
673+
const o2::its3::TopologyDictionary* mIT3Dict{nullptr}; // cluster patterns dictionary
674+
#endif
649675

650676
const o2::tpc::ClusterNativeAccess* mTPCClusterIdxStruct = nullptr; ///< struct holding the TPC cluster indices
651677

@@ -659,23 +685,24 @@ class MatchTPCITS
659685
size_t mNMatchesControl = 0;
660686

661687
size_t mNABRefsClus = 0;
662-
float mAB2MatchGuess = 0.2; // heuristic guess about fraction of AB matches in total matches
663-
std::vector<InteractionCandidate> mInteractions; ///< possible interaction times
664-
std::vector<int> mInteractionMUSLUT; ///< LUT for interactions in 1MUS bins
688+
float mAB2MatchGuess = 0.2; // heuristic guess about fraction of AB matches in total matches
689+
std::vector<InteractionCandidate> mInteractions; ///< possible interaction times
690+
std::vector<int> mInteractionMUSLUT; ///< LUT for interactions in 1MUS bins
665691

666692
///< container for record the match of TPC track to single ITS track
667693
std::vector<MatchRecord> mMatchRecordsTPC; // RSS DEQ
668694
///< container for reference to MatchRecord involving particular ITS track
669695
std::vector<MatchRecord> mMatchRecordsITS; // RSS DEQ
670696

671697
//// std::vector<int> mITSROFofTPCBin; ///< aux structure for mapping of TPC time-bins on ITS ROFs
672-
std::vector<BracketF> mITSROFTimes; ///< min/max times of ITS ROFs in \mus
673-
std::vector<TrackLocTPC> mTPCWork; ///< TPC track params prepared for matching
674-
std::vector<TrackLocITS> mITSWork; ///< ITS track params prepared for matching
698+
std::vector<BracketF> mITSROFTimes; ///< min/max times of ITS ROFs in \mus
699+
std::vector<TrackLocTPC> mTPCWork; ///< TPC track params prepared for matching
700+
std::vector<TrackLocITS> mITSWork; ///< ITS track params prepared for matching
675701
std::vector<o2::MCCompLabel> mTPCLblWork; ///< TPC track labels
676702
std::vector<o2::MCCompLabel> mITSLblWork; ///< ITS track labels
677-
std::vector<float> mWinnerChi2Refit; ///< vector of refitChi2 for winners
678-
std::vector<float> mTBinClOcc; ///< TPC occupancy histo: i-th entry is the integrated occupancy for ~1 orbit starting from the TB = i*mNTPCOccBinLength
703+
std::vector<float> mWinnerChi2Refit; ///< vector of refitChi2 for winners
704+
std::vector<float> mTBinClOcc; ///< TPC occupancy histo: i-th entry is the integrated occupancy for ~1 orbit starting from the TB = i*mNTPCOccBinLength
705+
679706
// ------------------------------
680707
std::vector<TPCABSeed> mTPCABSeeds; ///< pool of primary TPC seeds for AB
681708
///< indices of selected track entries in mTPCWork (for tracks selected by AfterBurner)

0 commit comments

Comments
 (0)