]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Select primary track candidates on their bending slope instead of their bending momen...
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Apr 2008 12:59:56 +0000 (12:59 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Apr 2008 12:59:56 +0000 (12:59 +0000)
MUON/AliMUONRecoParam.cxx
MUON/AliMUONRecoParam.h
MUON/AliMUONTrackExtrap.cxx
MUON/AliMUONTrackExtrap.h
MUON/AliMUONVTrackReconstructor.cxx

index 6bfe46ee60a7bcd888e5dfc9e7b161fed09815b4..389fa23b796398de71c3f684c055d80996dba35f 100644 (file)
@@ -42,6 +42,7 @@ AliMUONRecoParam::AliMUONRecoParam()
   fMinBendingMomentum(0.),
   fMaxBendingMomentum(0.),
   fMaxNonBendingSlope(0.),
+  fMaxBendingSlope(0.),
   fNonBendingVertexDispersion(0.),
   fBendingVertexDispersion(0.),
   fMaxNonBendingDistanceToTrack(0.),
@@ -131,6 +132,7 @@ void AliMUONRecoParam::SetLowFluxParam()
   fMinBendingMomentum = 1.;
   fMaxBendingMomentum = 3000.;
   fMaxNonBendingSlope = 0.3;
+  fMaxBendingSlope = 0.4;
   fNonBendingVertexDispersion = 10.;
   fBendingVertexDispersion = 10.;
   fMaxNonBendingDistanceToTrack = 1.;
@@ -162,6 +164,7 @@ void AliMUONRecoParam::SetHighFluxParam()
   fMinBendingMomentum = 1.;
   fMaxBendingMomentum = 3000.;
   fMaxNonBendingSlope = 0.3;
+  fMaxBendingSlope = 0.4;
   fNonBendingVertexDispersion = 10.;
   fBendingVertexDispersion = 10.;
   fMaxNonBendingDistanceToTrack = 1.;
@@ -193,6 +196,7 @@ void AliMUONRecoParam::SetCosmicParam()
   fMinBendingMomentum = 1.;
   fMaxBendingMomentum = 10000000.;
   fMaxNonBendingSlope = 0.3;
+  fMaxBendingSlope = 0.4;
   fNonBendingVertexDispersion = 10.;
   fBendingVertexDispersion = 10.;
   fMaxNonBendingDistanceToTrack = 10.;
@@ -243,6 +247,8 @@ void AliMUONRecoParam::Print(Option_t *option) const
   
   cout<<Form("Maximum non bending slope = %5.2f",fMaxNonBendingSlope)<<endl;
   
+  cout<<Form("Maximum bending slope (used only if B=0) = %5.2f",fMaxBendingSlope)<<endl;
+  
   if (strstr(fTrackingMode,"ORIGINAL"))
     cout<<Form("Vertex dispertion = (%5.2f,%5.2f)",fNonBendingVertexDispersion,fBendingVertexDispersion)<<endl;
   else if (strstr(option,"FULL"))
index 5f04858f5730ef92f04dfe57b339928e6177bbe6..d5ec883233c6c478b8bd5c8793206ef34c22e47d 100644 (file)
@@ -68,6 +68,10 @@ class AliMUONRecoParam : public AliDetectorRecoParam
   void     SetMaxNonBendingSlope(Double_t val) {fMaxNonBendingSlope = val;}
   /// return the maximum value of the non bending slope
   Double_t GetMaxNonBendingSlope() const {return fMaxNonBendingSlope;}
+  /// set the maximum value of the bending slope
+  void     SetMaxBendingSlope(Double_t val) {fMaxBendingSlope = val;}
+  /// return the maximum value of the bending slope
+  Double_t GetMaxBendingSlope() const {return fMaxBendingSlope;}
   
   /// set the vertex dispersion (cm) in non bending plane (used for original tracking only)
   void     SetNonBendingVertexDispersion(Double_t val) {fNonBendingVertexDispersion = val;} 
@@ -173,6 +177,7 @@ class AliMUONRecoParam : public AliDetectorRecoParam
   Double32_t fMinBendingMomentum; ///< minimum value (GeV/c) of momentum in bending plane
   Double32_t fMaxBendingMomentum; ///< maximum value (GeV/c) of momentum in bending plane
   Double32_t fMaxNonBendingSlope; ///< maximum value of the non bending slope
+  Double32_t fMaxBendingSlope;    ///< maximum value of the bending slope (used only if B = 0)
   
   Double32_t fNonBendingVertexDispersion; ///< vertex dispersion (cm) in non bending plane (used for original tracking only)
   Double32_t fBendingVertexDispersion;    ///< vertex dispersion (cm) in bending plane (used for original tracking only)
@@ -223,7 +228,7 @@ class AliMUONRecoParam : public AliDetectorRecoParam
   void SetCosmicParam();
   
   
-  ClassDef(AliMUONRecoParam,4) // MUON reco parameters
+  ClassDef(AliMUONRecoParam,5) // MUON reco parameters
 };
 
 #endif
index a91c5a4b6783311a7207a93fa64dbc0ca5b79a0a..f53af5330855cec744cf1ca69dbac148addef32f 100644 (file)
@@ -40,11 +40,39 @@ ClassImp(AliMUONTrackExtrap) // Class implementation in ROOT context
 /// \endcond
 
 const AliMagF* AliMUONTrackExtrap::fgkField = 0x0;
+const Double_t AliMUONTrackExtrap::fgkSimpleBPosition = 0.5 * (AliMUONConstants::CoilZ() + AliMUONConstants::YokeZ());
+const Double_t AliMUONTrackExtrap::fgkSimpleBLength = 0.5 * (AliMUONConstants::CoilL() + AliMUONConstants::YokeL());
+      Double_t AliMUONTrackExtrap::fgSimpleBValue = 0.;
+      Bool_t   AliMUONTrackExtrap::fgFieldON = kFALSE;
 const Bool_t   AliMUONTrackExtrap::fgkUseHelix = kFALSE;
 const Int_t    AliMUONTrackExtrap::fgkMaxStepNumber = 5000;
 const Double_t AliMUONTrackExtrap::fgkHelixStepLength = 6.;
 const Double_t AliMUONTrackExtrap::fgkRungeKuttaMaxResidue = 0.002;
 
+//__________________________________________________________________________
+void AliMUONTrackExtrap::SetField(const AliMagF* magField)
+{
+  /// set magnetic field
+  
+  // set field map
+  fgkField = magField;
+  if (!fgkField) {
+    cout<<"E-AliMUONTrackExtrap::SetField: fgkField = 0x0"<<endl;
+    return;
+  }
+  
+  // set field on/off flag
+  fgFieldON = (fgkField->Factor() == 0.) ? kFALSE : kTRUE;
+  
+  // set field at the centre of the dipole
+  if (fgFieldON) {
+    Float_t b[3] = {0.,0.,0.}, x[3] = {50.,50.,(Float_t) fgkSimpleBPosition};
+    fgkField->Field(x,b);
+    fgSimpleBValue = (Double_t) b[0];
+  } else fgSimpleBValue = 0.;
+  
+}
+
 //__________________________________________________________________________
 Double_t AliMUONTrackExtrap::GetImpactParamFromBendingMomentum(Double_t bendingMomentum)
 {
@@ -55,18 +83,14 @@ Double_t AliMUONTrackExtrap::GetImpactParamFromBendingMomentum(Double_t bendingM
   
   if (bendingMomentum == 0.) return 1.e10;
   
-  const Double_t kCorrectionFactor = 0.9; // impact parameter is 10% overestimated
-  Double_t simpleBPosition = 0.5 * (AliMUONConstants::CoilZ() + AliMUONConstants::YokeZ());
-  Double_t simpleBLength = 0.5 * (AliMUONConstants::CoilL() + AliMUONConstants::YokeL());
-  Float_t b[3], x[3] = {50.,50.,(Float_t) simpleBPosition};
-  if (fgkField) fgkField->Field(x,b);
-  else {
+  if (!fgkField) {
     cout<<"F-AliMUONTrackExtrap::GetField: fgkField = 0x0"<<endl;
     exit(-1);
   }
-  Double_t simpleBValue = (Double_t) b[0];
   
-  return kCorrectionFactor * (-0.0003 * simpleBValue * simpleBLength * simpleBPosition / bendingMomentum);
+  const Double_t kCorrectionFactor = 0.9; // impact parameter is 10% overestimated
+  
+  return kCorrectionFactor * (-0.0003 * fgSimpleBValue * fgkSimpleBLength * fgkSimpleBPosition / bendingMomentum);
 }
 
 //__________________________________________________________________________
@@ -79,23 +103,19 @@ Double_t AliMUONTrackExtrap::GetBendingMomentumFromImpactParam(Double_t impactPa
   
   if (impactParam == 0.) return 1.e10;
   
-  const Double_t kCorrectionFactor = 1.1; // bending momentum is 10% underestimated
-  Double_t simpleBPosition = 0.5 * (AliMUONConstants::CoilZ() + AliMUONConstants::YokeZ());
-  Double_t simpleBLength = 0.5 * (AliMUONConstants::CoilL() + AliMUONConstants::YokeL());
-  Float_t b[3], x[3] = {50.,50.,(Float_t) simpleBPosition};
-  if (fgkField) fgkField->Field(x,b);
-  else {
+  if (!fgkField) {
     cout<<"F-AliMUONTrackExtrap::GetField: fgkField = 0x0"<<endl;
     exit(-1);
   }
-  Double_t simpleBValue = (Double_t) b[0];
   
-  if (TMath::Abs(simpleBValue) > 0.01) return kCorrectionFactor * (-0.0003 * simpleBValue * simpleBLength * simpleBPosition / impactParam);
+  const Double_t kCorrectionFactor = 1.1; // bending momentum is 10% underestimated
+  
+  if (fgFieldON) return kCorrectionFactor * (-0.0003 * fgSimpleBValue * fgkSimpleBLength * fgkSimpleBPosition / impactParam);
   else return AliMUONReconstructor::GetRecoParam()->GetMostProbBendingMomentum();
 }
 
 //__________________________________________________________________________
-void AliMUONTrackExtrap::LinearExtrapToZ(AliMUONTrackParam* trackParam, Double_t zEnd)
+void AliMUONTrackExtrap::LinearExtrapToZ(AliMUONTrackParam* trackParam, Double_t zEnd, Bool_t updatePropagator)
 {
   /// Track parameters (and their covariances if any) linearly extrapolated to the plane at "zEnd".
   /// On return, results from the extrapolation are updated in trackParam.
@@ -118,6 +138,16 @@ void AliMUONTrackExtrap::LinearExtrapToZ(AliMUONTrackParam* trackParam, Double_t
     paramCov(2,3) += dZ * paramCov(3,3);
     paramCov(3,2) = paramCov(2,3);
     trackParam->SetCovariances(paramCov);
+    
+    // Update the propagator if required
+    if (updatePropagator) {
+      TMatrixD jacob(5,5);
+      jacob.UnitMatrix();
+      jacob(0,1) = dZ;
+      jacob(2,3) = dZ;
+      trackParam->UpdatePropagator(jacob);
+    }
+    
   }
   
 }
@@ -127,7 +157,8 @@ void AliMUONTrackExtrap::ExtrapToZ(AliMUONTrackParam* trackParam, Double_t zEnd)
 {
   /// Interface to track parameter extrapolation to the plane at "Z" using Helix or Rungekutta algorithm.
   /// On return, the track parameters resulting from the extrapolation are updated in trackParam.
-  if (fgkUseHelix) AliMUONTrackExtrap::ExtrapToZHelix(trackParam,zEnd);
+  if (!fgFieldON) AliMUONTrackExtrap::LinearExtrapToZ(trackParam,zEnd);
+  else if (fgkUseHelix) AliMUONTrackExtrap::ExtrapToZHelix(trackParam,zEnd);
   else AliMUONTrackExtrap::ExtrapToZRungekutta(trackParam,zEnd);
 }
 
@@ -268,6 +299,11 @@ void AliMUONTrackExtrap::ExtrapToZCov(AliMUONTrackParam* trackParam, Double_t zE
   
   if (trackParam->GetZ() == zEnd) return; // nothing to be done if same z
   
+  if (!fgFieldON) { // linear extrapolation if no magnetic field
+    AliMUONTrackExtrap::LinearExtrapToZ(trackParam,zEnd,updatePropagator);
+    return;
+  }
+  
   // No need to propagate the covariance matrix if it does not exist
   if (!trackParam->CovariancesExist()) {
     cout<<"W-AliMUONTrackExtrap::ExtrapToZCov: Covariance matrix does not exist"<<endl;
index 0aa0f3d5b36c70c35ec58e58ff554fe3df48c550..53ab61c917d9a9461aea75ebb00cfe6b3f6b9af4 100644 (file)
@@ -28,14 +28,16 @@ class AliMUONTrackExtrap : public TObject
        /// Destructor
   virtual ~AliMUONTrackExtrap(){};
   
-       /// set field map
-  static void SetField(const AliMagF* magField) {fgkField = magField;}
+  static void SetField(const AliMagF* magField);
+  
+  /// return kTRUE if the field is switched ON
+  static Bool_t IsFieldON() {return fgFieldON;}
   
   static Double_t GetImpactParamFromBendingMomentum(Double_t bendingMomentum);
   static Double_t GetBendingMomentumFromImpactParam(Double_t impactParam);
   
   // Linearly extrapolate track parameters and covariances
-  static void LinearExtrapToZ(AliMUONTrackParam* trackParam, Double_t zEnd);
+  static void LinearExtrapToZ(AliMUONTrackParam* trackParam, Double_t zEnd, Bool_t updatePropagator = kFALSE);
   
   // Extrapolate track parameters in magnetic field
   static void ExtrapToZ(AliMUONTrackParam *trackParam, Double_t zEnd);
@@ -73,6 +75,10 @@ class AliMUONTrackExtrap : public TObject
   
  private:
   static const AliMagF* fgkField;              //!< field map
+  static const Double_t fgkSimpleBPosition;     //!< position of the dipole
+  static const Double_t fgkSimpleBLength;       //!< length of the dipole
+  static       Double_t fgSimpleBValue;         //!< magnetic field value at the centre
+  static       Bool_t   fgFieldON;              //!< kTRUE if the field is switched ON
   static const Bool_t   fgkUseHelix;           //!< Tell whether to use Helix or not (default is Runge-Kutta)
   static const Int_t    fgkMaxStepNumber;      //!< Maximum number of steps for track extrapolation
   static const Double_t fgkHelixStepLength;    //!< Step lenght for track extrapolation (used in Helix)
index 547e8990290353f4ee5bbfed4eb0b6ef3925522a..fc9dce1ac3bbe10f03561cc3a55d8e2bc145d7f1 100644 (file)
@@ -200,33 +200,42 @@ TClonesArray* AliMUONVTrackReconstructor::MakeSegmentsBetweenChambers(const AliM
       // non bending slope
       nonBendingSlope = (cluster1->GetX() - cluster2->GetX()) / (cluster1->GetZ() - cluster2->GetZ());
       
+      // check if non bending slope is within tolerances
+      if (TMath::Abs(nonBendingSlope) > AliMUONReconstructor::GetRecoParam()->GetMaxNonBendingSlope()) continue;
+      
       // bending slope
       bendingSlope = (cluster1->GetY() - cluster2->GetY()) / (cluster1->GetZ() - cluster2->GetZ());
       
-      // impact parameter
-      impactParam = cluster1->GetY() - cluster1->GetZ() * bendingSlope;
-     
-      // absolute value of bending momentum
-      bendingMomentum = TMath::Abs(AliMUONTrackExtrap::GetBendingMomentumFromImpactParam(impactParam));
-      
-      // check for non bending slope and bending momentum within tolerances
-      if (TMath::Abs(nonBendingSlope) < AliMUONReconstructor::GetRecoParam()->GetMaxNonBendingSlope() &&
-         bendingMomentum < AliMUONReconstructor::GetRecoParam()->GetMaxBendingMomentum() &&
-         bendingMomentum > AliMUONReconstructor::GetRecoParam()->GetMinBendingMomentum()) {
-        
-       // make new segment
-        segment = new ((*segments)[segments->GetLast()+1]) AliMUONObjectPair(cluster1, cluster2, kFALSE, kFALSE);
-        
-       // Printout for debug
-       if (AliLog::GetGlobalDebugLevel() > 1) {
-          cout << "segmentIndex(0...): " << segments->GetLast() << endl;
-          segment->Dump();
-          cout << "Cluster in first chamber" << endl;
-          cluster1->Print();
-          cout << "Cluster in second chamber" << endl;
-          cluster2->Print();
-        }
+      // check the bending momentum of the bending slope depending if the field is ON or OFF
+      if (AliMUONTrackExtrap::IsFieldON()) {
+       
+       // impact parameter
+       impactParam = cluster1->GetY() - cluster1->GetZ() * bendingSlope;
        
+       // absolute value of bending momentum
+       bendingMomentum = TMath::Abs(AliMUONTrackExtrap::GetBendingMomentumFromImpactParam(impactParam));
+       
+       // check if bending momentum is within tolerances
+       if (bendingMomentum < AliMUONReconstructor::GetRecoParam()->GetMinBendingMomentum() ||
+           bendingMomentum > AliMUONReconstructor::GetRecoParam()->GetMaxBendingMomentum()) continue;
+       
+      } else {
+       
+       // check if non bending slope is within tolerances
+       if (TMath::Abs(bendingSlope) > AliMUONReconstructor::GetRecoParam()->GetMaxBendingSlope()) continue;
+      
+      }
+      // make new segment
+      segment = new ((*segments)[segments->GetLast()+1]) AliMUONObjectPair(cluster1, cluster2, kFALSE, kFALSE);
+      
+      // Printout for debug
+      if (AliLog::GetGlobalDebugLevel() > 1) {
+       cout << "segmentIndex(0...): " << segments->GetLast() << endl;
+       segment->Dump();
+       cout << "Cluster in first chamber" << endl;
+       cluster1->Print();
+       cout << "Cluster in second chamber" << endl;
+       cluster2->Print();
       }
       
     }