Skip to content

Commit abb836b

Browse files
mconcasshahor02
authored andcommitted
ITS: Improve CheckClusters.C, mv CheckTopologies.C
1 parent f754608 commit abb836b

5 files changed

Lines changed: 31 additions & 17 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ o2_add_test_root_macro(CheckDigits.C
3333
# O2::DataFormatsITSMFT
3434
# LABELS its)
3535

36-
o2_add_test_root_macro(CheckTopologies.C
36+
o2_add_test_root_macro(CreateDictionaries.C
3737
PUBLIC_LINK_LIBRARIES O2::MathUtils
3838
O2::ITSBase
3939
O2::ITSMFTReconstruction

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

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// \file CheckDigits.C
1+
/// \file CheckClusters.C
22
/// \brief Simple macro to check ITSU clusters
33

44
#if !defined(__CLING__) || defined(__ROOTCLING__)
@@ -43,7 +43,7 @@ void CheckClusters(std::string clusfile = "o2clus_its.root", std::string hitfile
4343
std::vector<MC2HITS_map> mc2hitVec;
4444

4545
TFile fout("CheckClusters.root", "recreate");
46-
TNtuple nt("ntc", "cluster ntuple", "ev:lab:hlx:hlz:tx:tz:cgx:cgy:cgz:dx:dy:dz:rof:npx:id");
46+
TNtuple nt("ntc", "cluster ntuple", "ev:lab:hlx:hlz:tx:tz:cgx:cgy:cgz:dx:dy:dz:ex:ez:rof:npx:id");
4747

4848
// Geometry
4949
o2::base::GeometryManager::loadGeometry(inputGeom);
@@ -147,6 +147,8 @@ void CheckClusters(std::string clusfile = "o2clus_its.root", std::string hitfile
147147

148148
const auto& cluster = (*clusArr)[clEntry];
149149

150+
float errX{0.f};
151+
float errZ{0.f};
150152
int npix = 0;
151153
auto pattID = cluster.getPatternID();
152154
o2::math_utils::Point3D<float> locC;
@@ -155,6 +157,8 @@ void CheckClusters(std::string clusfile = "o2clus_its.root", std::string hitfile
155157
locC = dict.getClusterCoordinates(cluster, patt, false);
156158
} else {
157159
locC = dict.getClusterCoordinates(cluster);
160+
errX = dict.getErrX(pattID);
161+
errZ = dict.getErrZ(pattID);
158162
npix = dict.getNpixels(pattID);
159163
}
160164
auto chipID = cluster.getSensorID();
@@ -191,11 +195,13 @@ void CheckClusters(std::string clusfile = "o2clus_its.root", std::string hitfile
191195
auto r = (0.5 * (Segmentation::SensorLayerThickness - Segmentation::SensorLayerThicknessEff) - y0) / dlty;
192196
locH.SetXYZ(x0 + r * dltx, y0 + r * dlty, z0 + r * dltz);
193197
//locH.SetXYZ(0.5 * (locH.X() + locHsta.X()), 0.5 * (locH.Y() + locHsta.Y()), 0.5 * (locH.Z() + locHsta.Z()));
194-
nt.Fill(lab.getEventID(), trID,
195-
locH.X(), locH.Z(), dltx / dlty, dltz / dlty,
196-
gloC.X(), gloC.Y(), gloC.Z(),
197-
locC.X() - locH.X(), locC.Y() - locH.Y(), locC.Z() - locH.Z(),
198-
rofRec.getROFrame(), npix, chipID);
198+
std::array<float, 17> data = {(float)lab.getEventID(), (float)trID,
199+
locH.X(), locH.Z(), dltx / dlty, dltz / dlty,
200+
gloC.X(), gloC.Y(), gloC.Z(),
201+
locC.X() - locH.X(), locC.Y() - locH.Y(), locC.Z() - locH.Z(),
202+
errX, errZ,
203+
(float)rofRec.getROFrame(), (float)npix, (float)chipID};
204+
nt.Fill(data.data());
199205
}
200206
}
201207

@@ -205,6 +211,14 @@ void CheckClusters(std::string clusfile = "o2clus_its.root", std::string hitfile
205211
nt.Draw("dz:dx", "abs(dz)<0.01 && abs(dx)<0.01");
206212
new TCanvas;
207213
nt.Draw("dz:tz", "abs(dz)<0.005 && abs(tz)<2");
214+
auto c1 = new TCanvas("p1","pullX");
215+
c1->cd();
216+
c1->SetLogy();
217+
nt.Draw("dx/ex", "abs(dx/ex)<10");
218+
auto c2 = new TCanvas("p2","pullZ");
219+
c2->cd();
220+
c2->SetLogy();
221+
nt.Draw("dz/ez", "abs(dz/ez)<10");
208222
fout.cd();
209223
nt.Write();
210224
}

Detectors/ITSMFT/ITS/macros/test/CheckTopologies.C renamed to Detectors/ITSMFT/ITS/macros/test/CreateDictionaries.C

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/// \file CheckTopologies.C
1+
/// \file CreateDictionaries.C
22
/// Macros to test the generation of a dictionary of topologies. Three dictionaries are generated: one with signal-cluster only, one with noise-clusters only and one with all the clusters.
33

44
#if !defined(__CLING__) || defined(__ROOTCLING__)
@@ -32,12 +32,12 @@
3232
#include <unordered_map>
3333
#endif
3434

35-
void CheckTopologies(std::string clusfile = "o2clus_its.root",
36-
std::string hitfile = "o2sim_HitsITS.root",
37-
std::string collContextfile = "collisioncontext.root",
38-
std::string inputGeom = "",
39-
float checkOutliers = 2., // reject outliers (MC dX or dZ exceeds row/col span by a factor above the threshold)
40-
float minPtMC = 0.01) // account only MC hits with pT above threshold
35+
void CreateDictionaries(std::string clusfile = "o2clus_its.root",
36+
std::string hitfile = "o2sim_HitsITS.root",
37+
std::string collContextfile = "collisioncontext.root",
38+
std::string inputGeom = "",
39+
float checkOutliers = 2., // reject outliers (MC dX or dZ exceeds row/col span by a factor above the threshold)
40+
float minPtMC = 0.01) // account only MC hits with pT above threshold
4141
{
4242
const int QEDSourceID = 99; // Clusters from this MC source correspond to QED electrons
4343

Detectors/ITSMFT/ITS/macros/test/run_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ root -b -q $O2_ROOT/share/macro/run_clus_itsSA.C+\(\"itsdigits.root\",\"o2clus_i
1818

1919
root.exe -b -q CheckClusters.C+ >& CheckClusters.log
2020

21-
#root.exe -b -q CheckTopologies.C+ >& CheckTopologies.log
21+
#root.exe -b -q CreateDictionaries.C+ >& CreateDictionaries.log
2222

2323
root.exe -b -q $O2_ROOT/share/macro/run_trac_its.C+ >& trac_its.log
2424

Detectors/ITSMFT/ITS/macros/test/run_workflows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ o2-its-reco-workflow >& reco.log
88
# These macros can be run to check the quality of the results
99
# root.exe CheckDigits.C+
1010
# root.exe CheckClusters.C+
11-
# root.exe CheckTopologies.C+
11+
# root.exe CreateDictionaries.C+
1212
# root.exe CheckTracks.C+
1313
# root.exe DisplayTrack.C+
1414

0 commit comments

Comments
 (0)