Improving method of track matching.
authorszostak <szostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Oct 2007 11:59:22 +0000 (11:59 +0000)
committerszostak <szostak@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Oct 2007 11:59:22 +0000 (11:59 +0000)
HLT/MUON/macros/MakeHitsTable.C
HLT/MUON/macros/MakeTrackTable.C
HLT/MUON/macros/MakeTriggerTable.C

index 685c3a7..9c18686 100644 (file)
@@ -52,7 +52,14 @@ using std::endl;
 void MakeHitsTable(
                Int_t firstEvent = 0,
                Int_t lastEvent = -1,
-               const char* dHLToutputfile = "output_0x00000000.root"
+               const char* dHLToutputfile = "output_0x00000000.root",
+               Float_t maxSigma = 4., // 4 standard deviations
+               Float_t sigmaX = 0.1,  // 1 mm resolution
+               Float_t sigmaY = 0.01, // 100 micron resolution
+               Float_t sigmaZ = 0.02,  // 200 microns resolution
+               Float_t sigmaXtrg = 0.5,  // 5 mm resolution
+               Float_t sigmaYtrg = 0.5,  // 5 mm resolution
+               Float_t sigmaZtrg = 0.02  // 2 microns resolution
        )
 {
        gSystem->Load("libAliHLTMUON.so");
@@ -184,7 +191,13 @@ void MakeHitsTable(
                                        continue;
                                TVector3 hV(hitX[ch][ti], hitY[ch][ti], hitZ[ch][ti]);
                                TVector3 diff = hV - hit->Coordinate();
-                               Double_t fitQuality = diff.Mag2(); // Use the square of diff. More Chi^2 like properties.
+                               Double_t diffX = diff.X() / sigmaX;
+                               Double_t diffY = diff.Y() / sigmaY;
+                               Double_t diffZ = diff.Z() / sigmaZ;
+                               if (diffX > maxSigma) continue;
+                               if (diffY > maxSigma) continue;
+                               if (diffZ > maxSigma) continue;
+                               Double_t fitQuality = diffX*diffX + diffY*diffY + diffZ*diffZ;
 
                                // Now check the fit quality.
                                if (fitQuality < bestFitQuality)
@@ -232,7 +245,13 @@ void MakeHitsTable(
                                                continue;
                                        TVector3 hV(hitX[ch][ti], hitY[ch][ti], hitZ[ch][ti]);
                                        TVector3 diff = hV - hit;
-                                       Double_t fitQuality = diff.Mag2(); // Use the square of diff. More Chi^2 like properties.
+                                       Double_t diffX = diff.X() / sigmaXtrg;
+                                       Double_t diffY = diff.Y() / sigmaYtrg;
+                                       Double_t diffZ = diff.Z() / sigmaZtrg;
+                                       if (diffX > maxSigma) continue;
+                                       if (diffY > maxSigma) continue;
+                                       if (diffZ > maxSigma) continue;
+                                       Double_t fitQuality = diffX*diffX + diffY*diffY + diffZ*diffZ;
 
                                        // Now check the fit quality.
                                        if (fitQuality < bestFitQuality)
index 492ca26..c946ec4 100644 (file)
@@ -29,6 +29,7 @@
 #include "TNtuple.h"
 #include "TFile.h"
 #include "TError.h"
+#include "TMath.h"
 
 #include "AliLoader.h"
 #include "AliRunLoader.h"
@@ -51,7 +52,14 @@ using std::endl;
 void MakeTrackTable(
                Int_t firstEvent = 0,
                Int_t lastEvent = -1,
-               const char* dHLToutputfile = "output_0x00000000.root"
+               const char* dHLToutputfile = "output_0x00000000.root",
+               Float_t maxSigma = 4., // 4 standard deviations
+               Float_t sigmaX = 0.1,  // 1 mm resolution
+               Float_t sigmaY = 0.01, // 100 micron resolution
+               Float_t sigmaZ = 0.02,  // 200 microns resolution
+               Float_t sigmaXtrg = 0.5,  // 5 mm resolution
+               Float_t sigmaYtrg = 0.5,  // 5 mm resolution
+               Float_t sigmaZtrg = 0.02  // 2 microns resolution
        )
 {
        gSystem->Load("libAliHLTMUON.so");
@@ -258,7 +266,13 @@ void MakeTrackTable(
                                        
                                        TVector3 hV(hitX[j-1][kinetrack], hitY[j-1][kinetrack], hitZ[j-1][kinetrack]);
                                        TVector3 diff = hV - hit->Coordinate();
-                                       sumOfDiffs += diff.Mag2(); // Use the square of diff. More Chi^2 like properties.
+                                       Double_t diffX = diff.X() / sigmaX;
+                                       Double_t diffY = diff.Y() / sigmaY;
+                                       Double_t diffZ = diff.Z() / sigmaZ;
+                                       if (diffX > maxSigma) continue;
+                                       if (diffY > maxSigma) continue;
+                                       if (diffZ > maxSigma) continue;
+                                       sumOfDiffs += diffX*diffX + diffY*diffY + diffZ*diffZ;
                                        hitsMatched++;
                                }
                                if (mtrack->TriggerRecord() != NULL)
@@ -272,14 +286,20 @@ void MakeTrackTable(
                                                
                                                TVector3 hV(hitX[j-1][kinetrack], hitY[j-1][kinetrack], hitZ[j-1][kinetrack]);
                                                TVector3 diff = hV - hit;
-                                               sumOfDiffs += diff.Mag2(); // Use the square of diff. More Chi^2 like properties.
+                                               Double_t diffX = diff.X() / sigmaXtrg;
+                                               Double_t diffY = diff.Y() / sigmaYtrg;
+                                               Double_t diffZ = diff.Z() / sigmaZtrg;
+                                               if (diffX > maxSigma) continue;
+                                               if (diffY > maxSigma) continue;
+                                               if (diffZ > maxSigma) continue;
+                                               sumOfDiffs += diffX*diffX + diffY*diffY + diffZ*diffZ;
                                                hitsMatched++;
                                        }
                                }
                                
                                // Now check the fit quality.
                                if (hitsMatched <= 0) continue;
-                               Double_t fitQuality = sumOfDiffs / hitsMatched;
+                               Double_t fitQuality = TMath::Sqrt(sumOfDiffs) / hitsMatched;
                                if (fitQuality < bestFitQuality)
                                {
                                        bestFitQuality = fitQuality;
index a27a913..86ff641 100644 (file)
@@ -51,7 +51,11 @@ using std::endl;
 void MakeTriggerTable(
                Int_t firstEvent = 0,
                Int_t lastEvent = -1,
-               const char* L0outputfile = "output_0x00000000.root"
+               const char* L0outputfile = "output_0x00000000.root",
+               Float_t maxSigma = 4., // 4 standard deviations
+               Float_t sigmaXtrg = 0.5,  // 5 mm resolution
+               Float_t sigmaYtrg = 0.5,  // 5 mm resolution
+               Float_t sigmaZtrg = 0.02  // 2 microns resolution
        )
 {
        gSystem->Load("libAliHLTMUON.so");
@@ -240,7 +244,13 @@ void MakeTriggerTable(
                                        TVector3 hV(hitX[j-11][kinetrack], hitY[j-11][kinetrack], hitZ[j-11][kinetrack]);
                                        if (hV == TVector3(0,0,0)) continue;
                                        TVector3 diff = hV - hit;
-                                       sumOfDiffs += diff.Mag2(); // Use the square of diff. More Chi^2 like properties.
+                                       Double_t diffX = diff.X() / sigmaXtrg;
+                                       Double_t diffY = diff.Y() / sigmaYtrg;
+                                       Double_t diffZ = diff.Z() / sigmaZtrg;
+                                       if (diffX > maxSigma) continue;
+                                       if (diffY > maxSigma) continue;
+                                       if (diffZ > maxSigma) continue;
+                                       sumOfDiffs += diffX*diffX + diffY*diffY + diffZ*diffZ;
                                        hitsMatched++;
                                }