]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
- Added protection to prevent crash when the option "BypassSt45()"
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Apr 2008 20:28:59 +0000 (20:28 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Apr 2008 20:28:59 +0000 (20:28 +0000)
  is activated
- Slightly modified the tracking algorithm to better reconstruct cosmic
  data and to run without magnetic field
- New set of reconstruction parameters for cosmic data:
  use AliMUONRecoParam::GetCosmicParam();
(Philippe P.)

MUON/AliMUONRecoParam.cxx
MUON/AliMUONRecoParam.h
MUON/AliMUONTrackExtrap.cxx
MUON/AliMUONTrackParam.cxx
MUON/AliMUONTrackReconstructor.cxx
MUON/AliMUONTrackReconstructorK.cxx
MUON/AliMUONVTrackReconstructor.cxx
MUON/runDataReconstruction.C

index 616022b9a6baa056d4e60e18f197a0e35274cade..6bfe46ee60a7bcd888e5dfc9e7b161fed09815b4 100644 (file)
@@ -38,6 +38,7 @@ AliMUONRecoParam::AliMUONRecoParam()
 : AliDetectorRecoParam(),
   fClusteringMode("MLEM"),
   fTrackingMode("KALMAN"),
+  fMostProbBendingMomentum(0.),
   fMinBendingMomentum(0.),
   fMaxBendingMomentum(0.),
   fMaxNonBendingSlope(0.),
@@ -110,11 +111,23 @@ AliMUONRecoParam *AliMUONRecoParam::GetHighFluxParam()
   return param;
 }
 
+//_____________________________________________________________________________
+AliMUONRecoParam *AliMUONRecoParam::GetCosmicParam() 
+{
+  /// Return default reconstruction parameters for high flux environment
+  
+  AliMUONRecoParam *param = new AliMUONRecoParam();
+  param->SetCosmicParam();
+  
+  return param;
+}
+
 //_____________________________________________________________________________
 void AliMUONRecoParam::SetLowFluxParam() 
 {
   /// Set reconstruction parameters for low flux environment
   
+  fMostProbBendingMomentum = 2.;
   fMinBendingMomentum = 1.;
   fMaxBendingMomentum = 3000.;
   fMaxNonBendingSlope = 0.3;
@@ -145,6 +158,7 @@ void AliMUONRecoParam::SetHighFluxParam()
 {
   /// Set reconstruction parameters for high flux environment
   
+  fMostProbBendingMomentum = 2.;
   fMinBendingMomentum = 1.;
   fMaxBendingMomentum = 3000.;
   fMaxNonBendingSlope = 0.3;
@@ -170,6 +184,39 @@ void AliMUONRecoParam::SetHighFluxParam()
   
 }
 
+//_____________________________________________________________________________
+void AliMUONRecoParam::SetCosmicParam() 
+{
+  /// Set reconstruction parameters for high flux environment
+  
+  fMostProbBendingMomentum = 2.;
+  fMinBendingMomentum = 1.;
+  fMaxBendingMomentum = 10000000.;
+  fMaxNonBendingSlope = 0.3;
+  fNonBendingVertexDispersion = 10.;
+  fBendingVertexDispersion = 10.;
+  fMaxNonBendingDistanceToTrack = 10.;
+  fMaxBendingDistanceToTrack = 10.;
+  fSigmaCutForTracking = 20.;
+  fSigmaCutForImprovement = 20.;
+  fSigmaCutForTrigger = 8.;
+  fMaxNormChi2MatchTrigger = 16.;
+  fPercentOfFullClusterInESD = 100.;
+  fCombinedClusterTrackReco = kFALSE;
+  fTrackAllTracks = kTRUE;
+  fRecoverTracks = kTRUE;
+  fMakeTrackCandidatesFast = kFALSE;
+  fMakeMoreTrackCandidates = kFALSE;
+  fComplementTracks = kTRUE;
+  fImproveTracks = kTRUE;
+  fUseSmoother = kTRUE;
+  fSaveFullClusterInESD = kTRUE;
+  for (Int_t iCh = 0; iCh < 10; iCh++) fUseChamber[iCh] = kTRUE;
+  for (Int_t iSt = 0; iSt < 5; iSt++) fRequestStation[iSt] = kTRUE;
+  fBypassSt45 = kFALSE;
+  
+}
+
 //_____________________________________________________________________________
 void AliMUONRecoParam::Print(Option_t *option) const
 {
@@ -190,6 +237,8 @@ void AliMUONRecoParam::Print(Option_t *option) const
   if (fSaveFullClusterInESD) cout<<Form("Save all cluster info in ESD for %5.2f %% of events",fPercentOfFullClusterInESD)<<endl;
   else cout<<"Save partial cluster info in ESD"<<endl;
   
+  cout<<Form("Most probable bending momentum (used only if B=0) = %5.2f",fMostProbBendingMomentum)<<endl;
+  
   cout<<Form("Bending momentum range = [%5.2f,%5.2f]",fMinBendingMomentum,fMaxBendingMomentum)<<endl;
   
   cout<<Form("Maximum non bending slope = %5.2f",fMaxNonBendingSlope)<<endl;
@@ -278,14 +327,6 @@ void AliMUONRecoParam::Print(Option_t *option) const
   } while (++st < 5);
   if (discardedSt) cout<<endl;
   
-  if (strstr(option,"FULL")) {
-    cout<<"Bypass stations 4 and 5 (use trigger tracks as primary track candidates): ";
-    if (fBypassSt45) cout<<"ON"<<endl;
-    else cout<<"OFF"<<endl;
-  } else if (fBypassSt45)
-    cout<<"Bypass stations 4 and 5 (use trigger tracks as primary track candidates)"<<endl;
-  
-  
   cout<<"\t-------------------------------------"<<endl<<endl;
   
 }
index bad7a970f9baddfc3bc4a069568780b15c1f1e53..5f04858f5730ef92f04dfe57b339928e6177bbe6 100644 (file)
@@ -20,6 +20,7 @@ class AliMUONRecoParam : public AliDetectorRecoParam
   
   static AliMUONRecoParam *GetLowFluxParam();
   static AliMUONRecoParam *GetHighFluxParam();
+  static AliMUONRecoParam *GetCosmicParam();
   
   /// set the calibration mode (see GetCalibrationMode() for possible modes)
   void SetCalibrationMode(Option_t* mode) { fCalibrationMode = mode; fCalibrationMode.ToUpper();}
@@ -49,6 +50,12 @@ class AliMUONRecoParam : public AliDetectorRecoParam
   /// return the percentage of events for which all cluster info are stored in ESD
   Double_t  GetPercentOfFullClusterInESD() const {return fPercentOfFullClusterInESD;}
   
+  /// set the most probable value (GeV/c) of momentum in bending plane
+  /// needed to get some "reasonable" corrections for MCS and E loss even if B = 0
+  void     SetMostProbBendingMomentum(Double_t val) {fMostProbBendingMomentum = val;}
+  /// return the most probable value (GeV/c) of momentum in bending plane
+  Double_t GetMostProbBendingMomentum() const {return fMostProbBendingMomentum;}
+  
   /// set the minimum value (GeV/c) of momentum in bending plane
   void     SetMinBendingMomentum(Double_t val) {fMinBendingMomentum = val;}
   /// return the minimum value (GeV/c) of momentum in bending plane
@@ -161,6 +168,8 @@ class AliMUONRecoParam : public AliDetectorRecoParam
   /// tracking mode: ORIGINAL, KALMAN
   TString fTrackingMode; ///< \brief name of the tracking mode
   
+  Double32_t fMostProbBendingMomentum; ///< most probable value (GeV/c) of muon momentum in bending plane (used when B = 0)
+  
   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
@@ -211,9 +220,10 @@ class AliMUONRecoParam : public AliDetectorRecoParam
   // functions
   void SetLowFluxParam();
   void SetHighFluxParam();
+  void SetCosmicParam();
   
   
-  ClassDef(AliMUONRecoParam,3) // MUON reco parameters
+  ClassDef(AliMUONRecoParam,4) // MUON reco parameters
 };
 
 #endif
index 94fa55ddb146d0947a2614f92046550cdc6e506d..a91c5a4b6783311a7207a93fa64dbc0ca5b79a0a 100644 (file)
@@ -25,6 +25,8 @@
 #include "AliMUONTrackExtrap.h" 
 #include "AliMUONTrackParam.h"
 #include "AliMUONConstants.h"
+#include "AliMUONReconstructor.h"
+#include "AliMUONRecoParam.h"
 
 #include "AliMagF.h" 
 
@@ -88,7 +90,8 @@ Double_t AliMUONTrackExtrap::GetBendingMomentumFromImpactParam(Double_t impactPa
   }
   Double_t simpleBValue = (Double_t) b[0];
   
-  return kCorrectionFactor * (-0.0003 * simpleBValue * simpleBLength * simpleBPosition / impactParam);
+  if (TMath::Abs(simpleBValue) > 0.01) return kCorrectionFactor * (-0.0003 * simpleBValue * simpleBLength * simpleBPosition / impactParam);
+  else return AliMUONReconstructor::GetRecoParam()->GetMostProbBendingMomentum();
 }
 
 //__________________________________________________________________________
index abcb58e3c06a7feb1bc468e204cedaaa9d77604d..42f218a496062dd943e35964225480214c6be251 100644 (file)
@@ -191,53 +191,49 @@ AliMUONTrackParam::Clear(Option_t* /*opt*/)
 Double_t AliMUONTrackParam::Px() const
 {
   /// return p_x from track parameters
-  Double_t pYZ, pZ, pX;
-  pYZ = 0;
-  if (  TMath::Abs(fParameters(4,0)) > 0 )
-    pYZ = TMath::Abs(1.0 / fParameters(4,0));
-  pZ = -pYZ / (TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0)));  // spectro. (z<0)
-  pX = pZ * fParameters(1,0); 
-  return pX;
+  Double_t pZ;
+  if (TMath::Abs(fParameters(4,0)) > 0) {
+    Double_t pYZ = (TMath::Abs(fParameters(4,0)) > 0) ? TMath::Abs(1.0 / fParameters(4,0)) : FLT_MAX;
+    pZ = - pYZ / (TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0)));  // spectro. (z<0)
+  } else {
+    pZ = - FLT_MAX / TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0) + fParameters(1,0) * fParameters(1,0));
+  }
+  return pZ * fParameters(1,0); 
 }
 
   //__________________________________________________________________________
 Double_t AliMUONTrackParam::Py() const
 {
   /// return p_y from track parameters
-  Double_t pYZ, pZ, pY;
-  pYZ = 0;
-  if (  TMath::Abs(fParameters(4,0)) > 0 )
-    pYZ = TMath::Abs(1.0 / fParameters(4,0));
-  pZ = -pYZ / (TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0)));  // spectro. (z<0)
-  pY = pZ * fParameters(3,0); 
-  return pY;
+  Double_t pZ;
+  if (TMath::Abs(fParameters(4,0)) > 0) {
+    Double_t pYZ = (TMath::Abs(fParameters(4,0)) > 0) ? TMath::Abs(1.0 / fParameters(4,0)) : FLT_MAX;
+    pZ = - pYZ / (TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0)));  // spectro. (z<0)
+  } else {
+    pZ = - FLT_MAX / TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0) + fParameters(1,0) * fParameters(1,0));
+  }
+  return pZ * fParameters(3,0); 
 }
 
   //__________________________________________________________________________
 Double_t AliMUONTrackParam::Pz() const
 {
   /// return p_z from track parameters
-  Double_t pYZ, pZ;
-  pYZ = 0;
-  if (  TMath::Abs(fParameters(4,0)) > 0 )
-    pYZ = TMath::Abs(1.0 / fParameters(4,0));
-  pZ = -pYZ / (TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0)));  // spectro. (z<0)
-  return pZ;
+  if (TMath::Abs(fParameters(4,0)) > 0) {
+    Double_t pYZ = TMath::Abs(1.0 / fParameters(4,0));
+    return - pYZ / (TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0)));  // spectro. (z<0)
+  } else return - FLT_MAX / TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0) + fParameters(1,0) * fParameters(1,0));
 }
 
   //__________________________________________________________________________
 Double_t AliMUONTrackParam::P() const
 {
   /// return p from track parameters
-  Double_t  pYZ, pZ, p;
-  pYZ = 0;
-  if (  TMath::Abs(fParameters(4,0)) > 0 )
-    pYZ = TMath::Abs(1.0 / fParameters(4,0));
-  pZ = -pYZ / (TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0)));  // spectro. (z<0)
-  p = TMath::Abs(pZ) * 
-    TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0) + fParameters(1,0) * fParameters(1,0));
-  return p;
-  
+  if (TMath::Abs(fParameters(4,0)) > 0) {
+    Double_t pYZ = TMath::Abs(1.0 / fParameters(4,0));
+    Double_t pZ = - pYZ / (TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0)));  // spectro. (z<0)
+    return TMath::Abs(pZ) * TMath::Sqrt(1.0 + fParameters(3,0) * fParameters(3,0) + fParameters(1,0) * fParameters(1,0));
+  } else return FLT_MAX;
 }
 
   //__________________________________________________________________________
index 59dc5384189fb942cc25a0f16700a9c7c763cf64..a722197095268346a6f30b90f490a041fc9a7166 100644 (file)
@@ -1263,9 +1263,6 @@ void AliMUONTrackReconstructor::ComplementTracks(const AliMUONVClusterStore& clu
   AliMUONVCluster* cluster;
   AliMUONTrackParam *trackParam, *nextTrackParam, copyOfTrackParam, trackParamAtCluster, bestTrackParamAtCluster;
   
-  // Remove double track to complete only "good" tracks
-  RemoveDoubleTracks();
-  
   AliMUONTrack *track = (AliMUONTrack*) fRecTracksPtr->First();
   while (track) {
     trackModified = kFALSE;
@@ -1311,6 +1308,16 @@ void AliMUONTrackReconstructor::ComplementTracks(const AliMUONVClusterStore& clu
       
       // add new cluster if any
       if (foundOneCluster) {
+       
+       // Printout for debuging
+       if ((AliLog::GetDebugLevel("MUON","AliMUONTrackReconstructor") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
+         cout << "ComplementTracks: found one cluster in chamber(1..): " << chamberId+1 << endl;
+         bestTrackParamAtCluster.GetClusterPtr()->Print();
+         cout<<endl<<"Track parameters and covariances at cluster:"<<endl;
+         bestTrackParamAtCluster.GetParameters().Print();
+         bestTrackParamAtCluster.GetCovariances().Print();
+       }
+       
        trackParam->SetRemovable(kTRUE);
        bestTrackParamAtCluster.SetRemovable(kTRUE);
        track->AddTrackParamAtCluster(bestTrackParamAtCluster,*(bestTrackParamAtCluster.GetClusterPtr()));
index e15560e7762aedad4a64c6a118c515d71ff7b0ad..71a6b8860a8a1a22ac11fcd45f9b46ac142e4b72 100644 (file)
@@ -278,6 +278,11 @@ void AliMUONTrackReconstructorK::RetraceTrack(AliMUONTrack &trackCandidate, Bool
     // parameters at last but one cluster
     AliMUONTrackParam* previousTrackParam = (AliMUONTrackParam*) trackCandidate.GetTrackParamAtCluster()->Before(lastTrackParam);
     AliMUONVCluster* cluster1 = previousTrackParam->GetClusterPtr();
+    // make sure it is on the previous chamber (can have 2 clusters in the same chamber after "ComplementTrack")
+    if (cluster2->GetChamberId() == cluster1->GetChamberId()) {
+      previousTrackParam = (AliMUONTrackParam*) trackCandidate.GetTrackParamAtCluster()->Before(previousTrackParam);
+      cluster1 = previousTrackParam->GetClusterPtr();
+    }
     Double_t x1 = cluster1->GetX();
     Double_t y1 = cluster1->GetY();
     Double_t z1 = cluster1->GetZ();
@@ -1323,9 +1328,6 @@ void AliMUONTrackReconstructorK::ComplementTracks(const AliMUONVClusterStore& cl
   AliMUONVCluster *cluster;
   AliMUONTrackParam *trackParam, *previousTrackParam, *nextTrackParam, trackParamAtCluster, bestTrackParamAtCluster;
   
-  // Remove double track to complete only "good" tracks
-  RemoveDoubleTracks();
-  
   AliMUONTrack *track = (AliMUONTrack*) fRecTracksPtr->First();
   while (track) {
     trackModified = kFALSE;
@@ -1377,6 +1379,16 @@ void AliMUONTrackReconstructorK::ComplementTracks(const AliMUONVClusterStore& cl
       
       // add new cluster if any
       if (foundOneCluster) {
+       
+       // Printout for debuging
+       if ((AliLog::GetDebugLevel("MUON","AliMUONTrackReconstructorK") >= 1) || (AliLog::GetGlobalDebugLevel() >= 1)) {
+         cout << "ComplementTracks: found one cluster in chamber(1..): " << chamberId+1 << endl;
+         bestTrackParamAtCluster.GetClusterPtr()->Print();
+         cout<<endl<<"Track parameters and covariances at cluster:"<<endl;
+         bestTrackParamAtCluster.GetParameters().Print();
+         bestTrackParamAtCluster.GetCovariances().Print();
+       }
+       
        trackParam->SetRemovable(kTRUE);
        bestTrackParamAtCluster.SetRemovable(kTRUE);
        track->AddTrackParamAtCluster(bestTrackParamAtCluster,*(bestTrackParamAtCluster.GetClusterPtr()));
index 6eedfe7bb1ce7f5a868a59e41c5d82025dd8a260..7cdb2d0c0aeda4279f61d83667eaa98fedff43d3 100644 (file)
@@ -913,9 +913,6 @@ void AliMUONVTrackReconstructor::ImproveTracks()
   
   AliMUONTrack *track, *nextTrack;
   
-  // Remove double track to improve only "good" tracks
-  RemoveDoubleTracks();
-  
   track = (AliMUONTrack*) fRecTracksPtr->First();
   while (track) {
     
index 5b0948fe970755af721f7dc846c96672a04d34be..8b3ee6d1ea041d4c5014d5ea9914e72d908d61ea 100644 (file)
@@ -37,7 +37,8 @@
 #endif
 
 // Data file, OCDB on Grid
-TString input="alien:///alice/data/2008/LHC08a/000021931/raw/08000021931001.50.root";
+TString input="alien:///alice/data/2008/LHC08a/000024841/raw/08000024841010.10.root";
+//TString input="alien:///alice/data/2008/LHC08a/000021931/raw/08000021931001.50.root";
 TString ocdbPath = "alien://folder=/alice/data/2008/LHC08a/OCDB";
 
 // Data file, OCDB locally
@@ -52,20 +53,21 @@ Int_t seed = 1234567;
 void runDataReconstruction(Int_t calib = 1)
 { 
   TGrid::Connect("alien://");
-
+  
   AliCDBManager* man = AliCDBManager::Instance();
   man->SetDefaultStorage(ocdbPath.Data());
   //man->SetSpecificStorage("MUON/Calib/Mapping","local://$ALICE_ROOT");
   //man->SetSpecificStorage("MUON/Calib/DDLStore","local://$ALICE_ROOT");
   //man->SetSpecificStorage("MUON/Calib/Gains","local://$ALICE_ROOT");
-
+  
   gRandom->SetSeed(seed);
   
-  AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 1., 10., AliMagFMaps::k5kG);
+  // no magnetic field --> factor (4th parameter) = 0
+  AliMagFMaps* field = new AliMagFMaps("Maps","Maps", 1, 0., 10., AliMagFMaps::k5kG);
   AliTracker::SetFieldMap(field, kFALSE);
   AliReconstruction *MuonRec = new AliReconstruction();
-
+  
+  
   MuonRec->SetInput(input.Data());
   MuonRec->SetRunVertexFinder(kFALSE);
   MuonRec->SetRunLocalReconstruction("MUON");
@@ -77,8 +79,9 @@ void runDataReconstruction(Int_t calib = 1)
   //  MuonRec->SetEventRange(319,319);
   MuonRec->SetWriteAOD();
   //MuonRec.SetEventRange(0,100); 
-  AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLowFluxParam();
-  muonRecoParam->CombineClusterTrackReco(kFALSE);
+  AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetCosmicParam();
+  muonRecoParam->BypassSt45(kTRUE);
+  muonRecoParam->RequestStation(2,kFALSE);
   TString caliboption = caliboption1;
   if ( calib == 2 ) caliboption = caliboption2;
   muonRecoParam->SetCalibrationMode(caliboption.Data());