Skip to content

Commit 662dd53

Browse files
committed
try to fix macro compilation
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent e00107b commit 662dd53

File tree

5 files changed

+49
-33
lines changed

5 files changed

+49
-33
lines changed

Detectors/ITSMFT/ITS/macros/test/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,6 @@ o2_add_test_root_macro(CheckDROF.C
122122
o2_add_test_root_macro(CheckStaggering.C
123123
PUBLIC_LINK_LIBRARIES O2::DataFormatsITS
124124
O2::DataFormatsITSMFT
125-
LABELS its)
125+
O2::ITSMFTReconstruction
126+
O2::DCAFitter
127+
LABELS its COMPILE_ONLY)

Detectors/ITSMFT/ITS/macros/test/CheckDROF.C

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@
3939
#include "SimulationDataFormat/MCTruthContainer.h"
4040
#include "DataFormatsITSMFT/CompCluster.h"
4141
#include "DataFormatsITS/TrackITS.h"
42+
#include "DataFormatsITS/Vertex.h"
4243
#include "DataFormatsITSMFT/ROFRecord.h"
4344
#include "SimulationDataFormat/DigitizationContext.h"
4445

4546
#endif
4647

4748
using namespace std;
48-
using Vertex = o2::dataformats::Vertex<o2::dataformats::TimeStamp<int>>;
4949

5050
void plotHistos(TFile* fWO, TFile* f, const char* append = "");
5151

@@ -93,9 +93,9 @@ struct ParticleInfo { // particle level information for tracks
9393
#pragma link C++ class ParticleInfo + ;
9494
#pragma link C++ class std::vector < ParticleInfo> + ;
9595

96-
struct VertexInfo { // Vertex level info
97-
float purity; // fraction of main cont. labels to all
98-
Vertex vertex; // reconstructed vertex
96+
struct VertexInfo { // Vertex level info
97+
float purity; // fraction of main cont. labels to all
98+
o2::its::Vertex vertex; // reconstructed vertex
9999
int bcInROF{-1};
100100
int rofId{-1};
101101
int event{-1}; // corresponding MC event
@@ -199,7 +199,7 @@ void CheckDROF(bool plot = false, bool write = false, const std::string& tracfil
199199
std::vector<o2::itsmft::ROFRecord> rofRecVec, *rofRecVecP = &rofRecVec;
200200
recTree->SetBranchAddress("ITSTracksROF", &rofRecVecP);
201201
// Vertices
202-
std::vector<Vertex>* recVerArr = nullptr;
202+
std::vector<o2::its::Vertex>* recVerArr = nullptr;
203203
recTree->SetBranchAddress("Vertices", &recVerArr);
204204
std::vector<ROFRecord>* recVerROFArr = nullptr;
205205
recTree->SetBranchAddress("VerticesROF", &recVerROFArr);
@@ -876,11 +876,12 @@ void CheckDROF(bool plot = false, bool write = false, const std::string& tracfil
876876
if (!trk.hasHitOnLayer(iL) || !trk.isFakeOnLayer(iL) || (part.clusters & (0x1 << iL)) == 0) {
877877
continue;
878878
}
879-
if (trk.hasHitInNextROF()) {
880-
hFakMig->Fill(trk.getPt(), trk.getNClusters(), iL);
881-
} else {
882-
hFakVal->Fill(trk.getPt(), trk.getNClusters(), iL);
883-
}
879+
// TODO: figure out how to find hit migration
880+
// if (trk.hasHitInNextROF()) {
881+
// hFakMig->Fill(trk.getPt(), trk.getNClusters(), iL);
882+
// } else {
883+
// hFakVal->Fill(trk.getPt(), trk.getNClusters(), iL);
884+
// }
884885
}
885886
}
886887
}

Detectors/ITSMFT/ITS/macros/test/CheckStaggering.C

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
1+
// Copyright 2019-2026 CERN and copyright holders of ALICE O2.
22
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
33
// All rights not expressly granted are reserved.
44
//
@@ -44,7 +44,6 @@
4444
#include "DataFormatsParameters/GRPMagField.h"
4545
#include "DataFormatsParameters/GRPLHCIFData.h"
4646
#include "ReconstructionDataFormats/Vertex.h"
47-
#include "Framework/Logger.h"
4847
#include "DetectorsVertexing/SVertexHypothesis.h"
4948
#include "DCAFitter/DCAFitterN.h"
5049
#endif
@@ -65,25 +64,25 @@ void CheckStaggering(int runNumber, int max = -1, const std::string& dir = "")
6564
{
6665
gStyle->SetOptStat(0);
6766
auto dirs = findDirs(dir);
68-
LOGP(info, "Will iterate over {} input dirs", dirs.size());
67+
printf("Will iterate over %zu input dirs", dirs.size());
6968
if (dirs.empty()) {
70-
LOGP(error, "No input found");
69+
printf("No input found");
7170
return;
7271
}
7372
if (max > 0 && (int)dirs.size() > max) {
7473
std::random_device rd;
7574
std::mt19937 g(rd());
7675
std::shuffle(dirs.begin(), dirs.end(), g);
7776
dirs.resize(max);
78-
LOGP(info, "restricting to {} dirs", max);
77+
printf("restricting to %ddirs", max);
7978
}
8079

8180
auto& ccdbmgr = o2::ccdb::BasicCCDBManager::instance();
8281
ccdbmgr.setURL("https://alice-ccdb.cern.ch");
8382
auto runDuration = ccdbmgr.getRunDuration(runNumber);
8483
auto tRun = runDuration.first + (runDuration.second - runDuration.first) / 2; // time stamp for the middle of the run duration
8584
ccdbmgr.setTimestamp(tRun);
86-
LOGP(info, "Run {} has TS {}", runNumber, tRun);
85+
printf("Run %d has TS %lld", runNumber, tRun);
8786
auto geoAligned = ccdbmgr.get<TGeoManager>("GLO/Config/GeometryAligned");
8887
auto magField = ccdbmgr.get<o2::parameters::GRPMagField>("GLO/Config/GRPMagField");
8988
auto grpLHC = ccdbmgr.get<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF");
@@ -170,17 +169,14 @@ void CheckStaggering(int runNumber, int max = -1, const std::string& dir = "")
170169
fflush(stdout);
171170

172171
const auto& d = dirs[iDir];
173-
LOGP(debug, "\nEntering {}", d.c_str());
174172
auto fTrks = TFile::Open((d / tracFile).c_str());
175173
auto fCls = TFile::Open((d / clsFile).c_str());
176174
if (!fTrks || !fCls || fTrks->IsZombie() || fCls->IsZombie()) {
177-
LOGP(error, "\nCould not open files");
178175
continue;
179176
}
180177
auto tTrks = fTrks->Get<TTree>("o2sim");
181178
auto tCls = fCls->Get<TTree>("o2sim");
182179
if (!tTrks || !tCls) {
183-
LOGP(error, "\nCould not retrieve trees");
184180
continue;
185181
}
186182

@@ -198,7 +194,6 @@ void CheckStaggering(int runNumber, int max = -1, const std::string& dir = "")
198194
for (int i{0}; i < 7; ++i) {
199195
ncls += clsArr[i]->size();
200196
}
201-
LOGP(debug, "\n\tTF:{:03} {} trks {} vtx {} cls", iTF, trkArr.size(), vtxArr.size(), ncls);
202197

203198
// for each TF built pool of positive and negaitve tracks
204199
std::vector<const o2::its::TrackITS*> posPool, negPool;

macro/run_rawdecoding_its.C

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
// Copyright 2019-2026 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+
112
#if !defined(__CLING__) || defined(__ROOTCLING__)
213

314
#include <TTree.h>
@@ -42,7 +53,7 @@ void run_rawdecoding_its(std::string inpName = "rawits.bin", // input binary dat
4253
TStopwatch sw;
4354
sw.Start();
4455
uint32_t roFrame = 0;
45-
o2::InteractionRecord irHB, irTrig;
56+
o2::InteractionRecord irTrig;
4657
std::vector<o2::itsmft::Digit> digits, *digitsPtr = &digits;
4758
std::vector<o2::itsmft::ROFRecord> rofRecVec, *rofRecVecPtr = &rofRecVec;
4859
std::size_t rofEntry = 0, nrofdig = 0;
@@ -62,12 +73,11 @@ void run_rawdecoding_its(std::string inpName = "rawits.bin", // input binary dat
6273
}
6374

6475
if (outTreeDig) { // >> store digits
65-
if (irHB != rawReader.getInteractionRecordHB() || irTrig != rawReader.getInteractionRecord()) {
76+
if (irTrig != rawReader.getInteractionRecord()) {
6677
if (!irTrig.isDummy()) {
67-
rofRecVec.emplace_back(irHB, roFrame, rofEntry, nrofdig); // registed finished ROF
78+
rofRecVec.emplace_back(irTrig, roFrame, rofEntry, nrofdig); // registed finished ROF
6879
roFrame++;
6980
}
70-
irHB = rawReader.getInteractionRecordHB();
7181
irTrig = rawReader.getInteractionRecord();
7282
rofEntry = digits.size();
7383
nrofdig = 0;
@@ -79,15 +89,14 @@ void run_rawdecoding_its(std::string inpName = "rawits.bin", // input binary dat
7989
}
8090

8191
printf("ROF %7d ch: %5d IR: ", roFrame, chipData.getChipID());
82-
irHB.print();
8392

8493
} // << store digits
8594
//
8695
}
8796

8897
if (outTreeDig) {
8998
// register last ROF
90-
rofRecVec.emplace_back(irHB, roFrame, rofEntry, nrofdig); // registed finished ROF
99+
rofRecVec.emplace_back(irTrig, roFrame, rofEntry, nrofdig); // registed finished ROF
91100

92101
// fill last (and the only one?) entry
93102
outTreeDig->Fill();

macro/run_rawdecoding_mft.C

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
// Copyright 2019-2026 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+
112
#if !defined(__CLING__) || defined(__ROOTCLING__)
213

314
#include <TTree.h>
@@ -42,7 +53,7 @@ void run_rawdecoding_mft(std::string inpName = "06282019_1854_output.bin", // in
4253
TStopwatch sw;
4354
sw.Start();
4455
uint32_t roFrame = 0;
45-
o2::InteractionRecord irHB, irTrig;
56+
o2::InteractionRecord irTrig;
4657
std::vector<o2::itsmft::Digit> digits, *digitsPtr = &digits;
4758
std::vector<o2::itsmft::ROFRecord> rofRecVec, *rofRecVecPtr = &rofRecVec;
4859
int rofEntry = 0, nrofdig = 0;
@@ -62,12 +73,11 @@ void run_rawdecoding_mft(std::string inpName = "06282019_1854_output.bin", // in
6273
}
6374

6475
if (outTreeDig) { // >> store digits
65-
if (irHB != rawReader.getInteractionRecordHB() || irTrig != rawReader.getInteractionRecord()) {
76+
if (irTrig != rawReader.getInteractionRecord()) {
6677
if (!irTrig.isDummy()) {
67-
rofRecVec.emplace_back(irHB, roFrame, rofEntry, nrofdig); // registed finished ROF
78+
rofRecVec.emplace_back(irTrig, roFrame, rofEntry, nrofdig); // registed finished ROF
6879
roFrame++;
6980
}
70-
irHB = rawReader.getInteractionRecordHB();
7181
irTrig = rawReader.getInteractionRecord();
7282
rofEntry = digits.size();
7383
nrofdig = 0;
@@ -79,15 +89,14 @@ void run_rawdecoding_mft(std::string inpName = "06282019_1854_output.bin", // in
7989
}
8090

8191
printf("ROF %7d ch: %5d IR: ", roFrame, chipData.getChipID());
82-
irHB.print();
8392

8493
} // << store digits
8594
//
8695
}
8796

8897
if (outTreeDig) {
8998
// register last ROF
90-
rofRecVec.emplace_back(irHB, roFrame, rofEntry, nrofdig); // registed finished ROF
99+
rofRecVec.emplace_back(irTrig, roFrame, rofEntry, nrofdig); // registed finished ROF
91100

92101
// fill last (and the only one?) entry
93102
outTreeDig->Fill();

0 commit comments

Comments
 (0)