4343#include "SimulationDataFormat/MCCompLabel.h"
4444#include "SimulationDataFormat/MCEventHeader.h"
4545#include "SimulationDataFormat/MCTrack.h"
46+ #include "ITS3Base/SpecsV2.h"
4647#endif
4748#define ENABLE_UPGRADES
4849#include "SimulationDataFormat/MCTruthContainer.h"
@@ -65,7 +66,11 @@ void checkFile(const std::unique_ptr<TFile>& file);
6566
6667inline auto hist_map (unsigned short id )
6768{
68- return std ::clamp (id , static_cast < unsigned short > (0 ), static_cast < unsigned short > (6 )) / 2 ;
69+ int lay = o2 ::its3 ::constants ::detID ::getDetID2Layer < int > (id );
70+ if (lay == -1 ) {
71+ return nLayers - 1 ;
72+ }
73+ return lay ;
6974}
7075
7176void CheckClusterSize (std ::string clusFileName = "o2clus_its.root" ,
@@ -133,7 +138,7 @@ void CheckClusterSize(std::string clusFileName = "o2clus_its.root",
133138 std ::vector < TH2D > hOtherSecondaryEta ;
134139 std ::vector < TH2D > hOtherSecondaryPt ;
135140 std ::vector < TH2D > hOtherSecondaryPhi ;
136- for (int i = 0 ; i < 4 ; ++ i ) {
141+ for (int i = 0 ; i < nLayers ; ++ i ) {
137142 hPrimary .emplace_back (Form ("primary/L%d" , i ), Form ("L%d Primary Cluster Size" , i ), maxClusterSize , 0 , maxClusterSize );
138143 hPrimaryEta .emplace_back (Form ("primary/EtaL%d" , i ), Form ("L%d Primary Cluster Size vs Eta" , i ), maxClusterSize , 0 , maxClusterSize , 100 , -3.0 , 3.0 );
139144 hPrimaryPt .emplace_back (Form ("primary/Pt%d" , i ), Form ("L%d Primary Cluster Size vs Pt" , i ), maxClusterSize , 0 , maxClusterSize , 100 , 0.0 , 10.0 );
@@ -238,14 +243,15 @@ void CheckClusterSize(std::string clusFileName = "o2clus_its.root",
238243 int nROFRec = (int )rofRecVec .size ();
239244 auto pattIt = patternsPtr -> cbegin ();
240245
246+ int cInvalid {0 }, cGood {0 };
241247 for (int irof = 0 ; irof < nROFRec ; irof ++ ) {
242248 const auto& rofRec = rofRecVec [irof ];
243- // rofRec.print();
249+ /* rofRec.print();*/
244250
245251 for (int icl = 0 ; icl < rofRec .getNEntries (); icl ++ ) {
246252 int clEntry = rofRec .getFirstEntry () + icl ;
247253 const auto& cluster = clusArr [clEntry ];
248- // cluster.print();
254+ /* cluster.print();*/
249255
250256 auto pattId = cluster .getPatternID ();
251257 auto id = cluster .getSensorID ();
@@ -260,13 +266,15 @@ void CheckClusterSize(std::string clusFileName = "o2clus_its.root",
260266
261267 const auto& label = (clusLabArr -> getLabels (clEntry ))[0 ];
262268 if (!label .isValid () || label .getSourceID () != 0 || !label .isCorrect ()) {
269+ ++ cInvalid ;
263270 continue ;
264271 }
272+ ++ cGood ;
265273
266274 const int trackID = label .getTrackID ();
267275 int evID = label .getEventID ();
268276 const auto& pInfo = info [evID ][trackID ];
269- if (id > 6 ) {
277+ if (! o2 :: its3 :: constants :: detID :: isDetITS3 ( id ) ) {
270278 hOuterBarrel .Fill (clusterSize );
271279 }
272280
@@ -332,6 +340,7 @@ void CheckClusterSize(std::string clusFileName = "o2clus_its.root",
332340 }
333341 }
334342 }
343+ std ::cout << "Good labels: " << cGood << "; invalid: " << cInvalid << '\n' ;
335344 std ::cout << "Done measuring cluster sizes:" << std ::endl ;
336345 for (int i = 0 ; i < nLayers ; ++ i ) {
337346 std ::cout << "* Layer " << i << ":\n" ;
0 commit comments