Skip to content

Commit ba5713d

Browse files
committed
ITS: let staggering macro also run over non-staggered data
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 5bd08b4 commit ba5713d

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

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

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ void CheckStaggering(int runNumber, int max = -1, const std::string& dir = "")
8080
auto& ccdbmgr = o2::ccdb::BasicCCDBManager::instance();
8181
ccdbmgr.setURL("https://alice-ccdb.cern.ch");
8282
auto runDuration = ccdbmgr.getRunDuration(runNumber);
83-
auto tRun = runDuration.first + (runDuration.second - runDuration.first) / 2; // time stamp for the middle of the run duration
83+
auto tRun = runDuration.first + ((runDuration.second - runDuration.first) / 2); // time stamp for the middle of the run duration
8484
ccdbmgr.setTimestamp(tRun);
85-
printf("Run %d has TS %lld", runNumber, tRun);
85+
printf("Run %d has TS %ld", runNumber, tRun);
8686
auto geoAligned = ccdbmgr.get<TGeoManager>("GLO/Config/GeometryAligned");
8787
auto magField = ccdbmgr.get<o2::parameters::GRPMagField>("GLO/Config/GRPMagField");
8888
auto grpLHC = ccdbmgr.get<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF");
@@ -183,8 +183,14 @@ void CheckStaggering(int runNumber, int max = -1, const std::string& dir = "")
183183

184184
tTrks->SetBranchAddress("ITSTrack", &trkArrPtr);
185185
tTrks->SetBranchAddress("Vertices", &vtxArrPtr);
186-
for (int i{0}; i < 7; ++i) {
187-
tCls->SetBranchAddress(Form("ITSClusterComp_%d", i), &clsArr[i]);
186+
bool isStaggered{true};
187+
if (tCls->GetBranchStatus("ITSClusterComp")) {
188+
tCls->SetBranchAddress("ITSClusterComp", &clsArr[0]);
189+
isStaggered = false;
190+
} else {
191+
for (int i{0}; i < 7; ++i) {
192+
tCls->SetBranchAddress(Form("ITSClusterComp_%d", i), &clsArr[i]);
193+
}
188194
}
189195

190196
for (int iTF{0}; tTrks->LoadTree(iTF) >= 0; ++iTF) {
@@ -193,7 +199,9 @@ void CheckStaggering(int runNumber, int max = -1, const std::string& dir = "")
193199

194200
size_t ncls = 0;
195201
for (int i{0}; i < 7; ++i) {
196-
ncls += clsArr[i]->size();
202+
if (clsArr[i]) {
203+
ncls += clsArr[i]->size();
204+
}
197205
}
198206

199207
// for each TF built pool of positive and negaitve tracks

0 commit comments

Comments
 (0)