3535void CheckTopologies (std ::string clusfile = "o2clus_its.root" ,
3636 std ::string hitfile = "o2sim_HitsITS.root" ,
3737 std ::string collContextfile = "collisioncontext.root" ,
38- std ::string inputGeom = "" )
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
3941{
4042 const int QEDSourceID = 99 ; // Clusters from this MC source correspond to QED electrons
4143
@@ -57,7 +59,7 @@ void CheckTopologies(std::string clusfile = "o2clus_its.root",
5759 const o2 ::steer ::DigitizationContext * digContext = nullptr ;
5860 TStopwatch sw ;
5961 sw .Start ();
60-
62+ float minPtMC2 = minPtMC > 0 ? minPtMC * minPtMC : -1 ;
6163 // Geometry
6264 o2 ::base ::GeometryManager ::loadGeometry (inputGeom );
6365 auto gman = o2 ::its ::GeometryTGeo ::Instance ();
@@ -205,12 +207,20 @@ void CheckTopologies(std::string clusfile = "o2clus_its.root",
205207 auto hitEntry = mc2hit .find (key );
206208 if (hitEntry != mc2hit .end ()) {
207209 const auto& hit = (* hitArray )[hitEntry -> second ];
208- auto locH = gman -> getMatrixL2G (chipID ) ^ (hit .GetPos ()); // inverse conversion from global to local
209- auto locHsta = gman -> getMatrixL2G (chipID ) ^ (hit .GetPosStart ());
210- locH .SetXYZ (0.5 * (locH .X () + locHsta .X ()), 0.5 * (locH .Y () + locHsta .Y ()), 0.5 * (locH .Z () + locHsta .Z ()));
211- const auto locC = o2 ::itsmft ::TopologyDictionary ::getClusterCoordinates (cluster , pattern , false );
212- dX = locH .X () - locC .X ();
213- dZ = locH .Z () - locC .Z ();
210+ if (minPtMC < 0.f || hit .GetMomentum ().Perp2 () > minPtMC2 ) {
211+ auto locH = gman -> getMatrixL2G (chipID ) ^ (hit .GetPos ()); // inverse conversion from global to local
212+ auto locHsta = gman -> getMatrixL2G (chipID ) ^ (hit .GetPosStart ());
213+ locH .SetXYZ (0.5 * (locH .X () + locHsta .X ()), 0.5 * (locH .Y () + locHsta .Y ()), 0.5 * (locH .Z () + locHsta .Z ()));
214+ const auto locC = o2 ::itsmft ::TopologyDictionary ::getClusterCoordinates (cluster , pattern , false );
215+ dX = locH .X () - locC .X ();
216+ dZ = locH .Z () - locC .Z ();
217+ if (checkOutliers > 0. ) {
218+ if (std ::abs (dX ) > topology .getRowSpan () * o2 ::itsmft ::SegmentationAlpide ::PitchRow * checkOutliers ||
219+ std ::abs (dZ ) > topology .getColumnSpan () * o2 ::itsmft ::SegmentationAlpide ::PitchCol * checkOutliers ) { // ignore outlier
220+ dX = dZ = BuildTopologyDictionary ::IgnoreVal ;
221+ }
222+ }
223+ }
214224 } else {
215225 printf ("Failed to find MC hit entry for Tr:%d chipID:%d\n" , trID , chipID );
216226 lab .print ();
0 commit comments