Skip to content

Commit ecdea27

Browse files
committed
ITS3: add TopoDict print
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 617e4fc commit ecdea27

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

Detectors/Upgrades/ITS3/base/include/ITS3Base/SpecsV2.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ constexpr std::array<double, nLayers> radiiInner{radii[0] - silicon::thicknessIn
135135
constexpr std::array<double, nLayers> radiiOuter{radii[0] + silicon::thicknessOut, radii[1] + silicon::thicknessOut, radii[2] + silicon::thicknessOut}; // outer silicon radius
136136
constexpr std::array<double, nLayers> radiiMiddle{(radiiInner[0] + radiiOuter[0]) / 2., (radiiInner[1] + radiiOuter[1]) / 2., (radiiInner[2] + radiiOuter[2]) / 2.}; // middle silicon radius
137137
constexpr double nominalYShift{-metalstack::thickness / 2.}; // shift to position in silicion volume to the chip volume (silicon+metalstack)
138-
/*constexpr double nominalYShift{0}; // shift to position in silicion volume to the chip volume (silicon+metalstack)*/
139138

140139
// extra information of pixels and their response functions
141140
namespace pixelarray::pixels

Detectors/Upgrades/ITS3/macros/test/CheckClustersITS3.C

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
void CheckClustersITS3(const std::string& clusfile = "o2clus_its.root",
4343
const std::string& hitfile = "o2sim_HitsIT3.root",
4444
const std::string& inputGeom = "",
45-
std::string dictfile = "../ccdb/IT3/Calib/ClusterDictionary/snapshot.root",
45+
std::string dictfile = "./ccdb/IT3/Calib/ClusterDictionary/snapshot.root",
4646
bool batch = false)
4747
{
4848
gROOT->SetBatch(batch);
@@ -63,7 +63,8 @@ void CheckClustersITS3(const std::string& clusfile = "o2clus_its.root",
6363
std::vector<HitVec*> hitVecPool;
6464
std::vector<MC2HITS_map> mc2hitVec;
6565

66-
ULong_t cPattValid{0}, cPattInvalid{0}, cLabelInvalid{0}, cNoMC{0};
66+
ULong_t cPattValidIB{0}, cPattInvalidIB{0}, cLabelInvalidIB{0}, cNoMCIB{0};
67+
ULong_t cPattValidOB{0}, cPattInvalidOB{0}, cLabelInvalidOB{0}, cNoMCOB{0};
6768

6869
TFile fout("CheckClusters.root", "recreate");
6970
TNtuple nt("ntc", "cluster ntuple", "ev:lab:hlx:hlz:hgx:hgz:tx:tz:cgx:cgy:cgz:clx:cly:clz:dx:dy:dz:ex:ez:patid:rof:npx:id:eta:row:col:lay");
@@ -103,6 +104,7 @@ void CheckClustersITS3(const std::string& clusfile = "o2clus_its.root",
103104
} else {
104105
LOG(info) << "Running without dictionary !";
105106
}
107+
dict.print();
106108

107109
// ROFrecords
108110
std::vector<ROFRec> rofRecVec, *rofRecVecP = &rofRecVec;
@@ -179,22 +181,22 @@ void CheckClustersITS3(const std::string& clusfile = "o2clus_its.root",
179181
o2::itsmft::ClusterPattern patt(pattIt);
180182
locC = dict.getClusterCoordinates(cluster, patt, false);
181183
LOGP(debug, "I am invalid and I am on chip {}", chipID);
182-
++cPattInvalid;
184+
(isIB) ? ++cPattInvalidIB : ++cPattInvalidOB;
183185
continue;
184186
} else {
185187
locC = dict.getClusterCoordinates(cluster);
186188
errX = dict.getErrX(pattID, isIB);
187189
errZ = dict.getErrZ(pattID, isIB);
188190
npix = dict.getNpixels(pattID, isIB);
189-
++cPattValid;
191+
(isIB) ? ++cPattValidIB : ++cPattValidOB;
190192
}
191193

192194
// Transformation to the local --> global
193195
auto gloC = gman->getMatrixL2G(chipID)(locC);
194196
const auto& lab = (clusLabArr->getLabels(clEntry))[0];
195197

196198
if (!lab.isValid()) {
197-
++cLabelInvalid;
199+
(isIB) ? ++cLabelInvalidIB : ++cLabelInvalidOB;
198200
continue;
199201
}
200202

@@ -206,7 +208,7 @@ void CheckClustersITS3(const std::string& clusfile = "o2clus_its.root",
206208
auto hitEntry = mc2hit.find(key);
207209
if (hitEntry == mc2hit.end()) {
208210
LOG(debug) << "Failed to find MC hit entry for Tr" << trID << " chipID" << chipID;
209-
++cNoMC;
211+
(isIB) ? ++cNoMCIB : ++cNoMCOB;
210212
continue;
211213
}
212214
const auto& hit = (*hitArray)[hitEntry->second];
@@ -261,8 +263,10 @@ void CheckClustersITS3(const std::string& clusfile = "o2clus_its.root",
261263
}
262264
}
263265

264-
LOGP(info, "There were {} valid PatternIDs and {} ({:.1f}%) invalid ones", cPattValid, cPattInvalid, ((float)cPattInvalid / (float)(cPattInvalid + cPattValid)) * 100);
265-
LOGP(info, "There were {} invalid Labels and {} with No MC Hit information ", cLabelInvalid, cNoMC);
266+
LOGP(info, "IB {} valid PatternIDs and {} ({:.1f}%) invalid ones", cPattValidIB, cPattInvalidIB, ((float)cPattInvalidIB / (float)(cPattInvalidIB + cPattValidIB)) * 100);
267+
LOGP(info, "IB {} invalid Labels and {} with No MC Hit information ", cLabelInvalidIB, cNoMCIB);
268+
LOGP(info, "OB {} valid PatternIDs and {} ({:.1f}%) invalid ones", cPattValidOB, cPattInvalidOB, ((float)cPattInvalidOB / (float)(cPattInvalidOB + cPattValidOB)) * 100);
269+
LOGP(info, "OB {} invalid Labels and {} with No MC Hit information ", cLabelInvalidOB, cNoMCOB);
266270

267271
auto canvCgXCgY = new TCanvas("canvCgXCgY", "", 1600, 1600);
268272
canvCgXCgY->Divide(2, 2);

Detectors/Upgrades/ITS3/reconstruction/include/ITS3Reconstruction/TopologyDictionary.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class TopologyDictionary
5959
/// Reads the dictionary from a binary file
6060
void readBinaryFile(const std::string& fileName);
6161
void readFromFile(const std::string& fileName);
62+
void print() const noexcept;
6263

6364
/// Returns the x position of the COG for the n_th element
6465
[[nodiscard]] float getXCOG(int n, bool IB) const

Detectors/Upgrades/ITS3/reconstruction/src/TopologyDictionary.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ TopologyDictionary::TopologyDictionary(const std::string& fileName)
4040
readFromFile(fileName);
4141
}
4242

43+
void TopologyDictionary::print() const noexcept
44+
{
45+
LOG(info) << "ITS3 TopologyDictionary";
46+
LOG(info) << "InnerBarrel";
47+
mDataIB.print();
48+
LOG(info) << "OuterBarrel";
49+
mDataOB.print();
50+
}
51+
4352
void TopologyDictionary::reset() noexcept
4453
{
4554
mDataIB.mSmallTopologiesLUT.fill(-1);

0 commit comments

Comments
 (0)