]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTracker.cxx
New class for AOD<->MC association
[u/mrichter/AliRoot.git] / MUON / AliMUONTracker.cxx
index f6149f9aa54adbc49431f647f7951fc996d3146d..937f5cdaec45ea9e8487c5ccc7947f0524565b6f 100644 (file)
 /// reconstruct tracks from recpoints
 ///
 /// Actual tracking is performed by some AliMUONVTrackReconstructor children
-/// Tracking modes (ORIGINAL, KALMAN) and associated options and parameters
-/// can be changed by using:
-/// AliMUONRecoParam *muonRecoParam = AliMUONRecoParam::GetLow(High)FluxParam();
-/// muonRecoParam->Set...(); // see methods in AliMUONRecoParam.h for details
-/// AliMUONReconstructor::SetRecoParam(muonRecoParam);
+/// Tracking modes (ORIGINAL, KALMAN) and associated options and parameters can be changed
+/// through the AliMUONRecoParam object set in the reconstruction macro or read from the CDB
+/// (see methods in AliMUONRecoParam.h file for details)
 ///
 /// \author Christian Finck and Laurent Aphecetche, SUBATECH Nantes
 //-----------------------------------------------------------------------------
@@ -53,7 +51,6 @@
 #include "AliMUONTriggerTrackStoreV1.h"
 #include "AliMUONTriggerTrack.h"
 #include "AliMUONLocalTrigger.h"
-#include "AliMUONVCluster.h"
 #include "AliMUONVClusterServer.h"
 #include "AliMUONVDigitStore.h"
 #include "AliMUONVTriggerStore.h"
@@ -67,28 +64,30 @@ ClassImp(AliMUONTracker)
 
 
 //_____________________________________________________________________________
-AliMUONTracker::AliMUONTracker(AliMUONVClusterServer* clusterServer,
+AliMUONTracker::AliMUONTracker(const AliMUONRecoParam* recoParam,
+                               AliMUONVClusterServer* clusterServer,
                                const AliMUONVDigitStore& digitStore,
                                const AliMUONDigitMaker* digitMaker,
                                const AliMUONGeometryTransformer* transformer,
                                const AliMUONTriggerCircuit* triggerCircuit)
 : AliTracker(),
-  fDigitMaker(digitMaker), // not owner
-  fTransformer(transformer), // not owner
-  fTriggerCircuit(triggerCircuit), // not owner
-  fTrackHitPatternMaker(0x0),
-  fTrackReco(0x0),
-  fClusterStore(0x0),
-  fTriggerStore(0x0),
-  fClusterServer(clusterServer), 
-  fIsOwnerOfClusterServer(kFALSE),
-  fDigitStore(digitStore), // not owner
-  fInputClusterStore(0x0),
-  fTriggerTrackStore(0x0)
+fDigitMaker(digitMaker), // not owner
+fTransformer(transformer), // not owner
+fTriggerCircuit(triggerCircuit), // not owner
+fTrackHitPatternMaker(0x0),
+fTrackReco(0x0),
+fClusterStore(0x0),
+fTriggerStore(0x0),
+fClusterServer(clusterServer), 
+fIsOwnerOfClusterServer(kFALSE),
+fDigitStore(digitStore), // not owner
+fInputClusterStore(0x0),
+fTriggerTrackStore(0x0),
+fRecoParam(recoParam)
 {
   /// constructor
   if (fTransformer && fDigitMaker)
-    fTrackHitPatternMaker = new AliMUONTrackHitPattern(*fTransformer,*fDigitMaker);
+    fTrackHitPatternMaker = new AliMUONTrackHitPattern(recoParam,*fTransformer,*fDigitMaker);
   
   if (!fClusterServer)
   {
@@ -173,7 +172,9 @@ Int_t AliMUONTracker::LoadClusters(TTree* clustersTree)
       fInputClusterStore->Connect(*clustersTree,kFALSE);
     }
     delete fClusterServer;
-    fClusterServer = new AliMUONLegacyClusterServer(*fTransformer,fInputClusterStore);
+    fClusterServer = new AliMUONLegacyClusterServer(*fTransformer,fInputClusterStore,
+                                                                                                                                                                                                               GetRecoParam()->BypassSt4(),
+                                                                                                                                                                                                               GetRecoParam()->BypassSt5());
     SetupClusterServer(*fClusterServer);
   }
   
@@ -193,7 +194,7 @@ Int_t AliMUONTracker::Clusters2Tracks(AliESDEvent* esd)
   
   if (!fTrackReco) 
   {
-    fTrackReco = CreateTrackReconstructor(AliMUONReconstructor::GetRecoParam()->GetTrackingMode(),fClusterServer);
+    fTrackReco = CreateTrackReconstructor(GetRecoParam(),fClusterServer);
   }
   
   // if the required tracking mode does not exist
@@ -217,7 +218,9 @@ Int_t AliMUONTracker::Clusters2Tracks(AliESDEvent* esd)
     fTrackReco->EventReconstructTrigger(*fTriggerCircuit,*fTriggerStore,*(TriggerTrackStore()));
   }
   
-  if ( AliMUONReconstructor::GetRecoParam()->BypassSt45() && TriggerTrackStore()->GetSize() > 5 ) 
+  if ( ( GetRecoParam()->BypassSt4() || 
+                                GetRecoParam()->BypassSt5() ) && 
+                       TriggerTrackStore()->GetSize() > 5 ) 
   {
     // Hard cut to reject shower events
     
@@ -268,8 +271,8 @@ void AliMUONTracker::FillESD(AliMUONVTrackStore& trackStore, AliESDEvent* esd) c
   AliMUONLocalTrigger* locTrg;
   AliESDMuonTrack esdTrack;
   TIter next(trackStore.CreateIterator());
-  if (AliMUONReconstructor::GetRecoParam()->SaveFullClusterInESD() && 
-      gRandom->Uniform(100.) <= AliMUONReconstructor::GetRecoParam()->GetPercentOfFullClusterInESD()) {
+  if (GetRecoParam()->SaveFullClusterInESD() && 
+      gRandom->Uniform(100.) <= GetRecoParam()->GetPercentOfFullClusterInESD()) {
     
     while ( ( track = static_cast<AliMUONTrack*>(next()) ) ) {
       
@@ -321,22 +324,22 @@ void AliMUONTracker::FillESD(AliMUONVTrackStore& trackStore, AliESDEvent* esd) c
 }
 
 //_____________________________________________________________________________
-AliMUONVTrackReconstructor* AliMUONTracker::CreateTrackReconstructor(const char* trackingMode, AliMUONVClusterServer* clusterServer)
+AliMUONVTrackReconstructor* AliMUONTracker::CreateTrackReconstructor(const AliMUONRecoParam* recoParam, AliMUONVClusterServer* clusterServer)
 {
   /// Create track reconstructor, depending on tracking mode set in RecoParam
   
   AliMUONVTrackReconstructor* trackReco(0x0);
   
-  TString opt(trackingMode);
+  TString opt(recoParam->GetTrackingMode());
   opt.ToUpper();
   
   if (strstr(opt,"ORIGINAL"))
   {
-    trackReco = new AliMUONTrackReconstructor(clusterServer);
+    trackReco = new AliMUONTrackReconstructor(recoParam,clusterServer);
   }
   else if (strstr(opt,"KALMAN"))
   {
-    trackReco = new AliMUONTrackReconstructorK(clusterServer);
+    trackReco = new AliMUONTrackReconstructorK(recoParam,clusterServer);
   }
   else
   {
@@ -365,18 +368,38 @@ AliMUONTracker::SetupClusterServer(AliMUONVClusterServer& clusterServer)
 {
   /// Setup the cluster server
   
-  if ( AliMUONReconstructor::GetRecoParam()->BypassSt45() )
+  if ( GetRecoParam()->BypassSt4() ||
+                        GetRecoParam()->BypassSt5() )
   {
     Bool_t ok = clusterServer.UseTriggerTrackStore(TriggerTrackStore());
   
+               TString msg1;
+               TString msg2;
+               
+               if ( GetRecoParam()->BypassSt45() )
+               {
+                       msg1 = "STATIONS 4 AND 5";
+                       msg2 = "THOSE TWO STATIONS";
+               }
+               else if ( GetRecoParam()->BypassSt4() )
+               {
+                       msg1 = "STATION 4";
+                       msg2 = "THAT STATION";
+               }
+               else if ( GetRecoParam()->BypassSt5() )
+               {
+                       msg1 = "STATION 5";
+                       msg2 = "THAT STATION";
+               }
+               
     if ( ok ) 
-    
     {
-      AliWarning("WILL USE TRIGGER TRACKS TO GENERATE CLUSTERS IN STATIONS 4 AND 5, THUS BYPASSING REAL CLUSTERS IN THOSE TWO STATIONS !!!");    
+      AliWarning(Form("WILL USE TRIGGER TRACKS TO GENERATE CLUSTERS IN %s, "
+                                                                                       "THUS BYPASSING REAL CLUSTERS IN %s!!!",msg1.Data(),msg2.Data()));    
     }
     else
     {
-      AliWarning("BYPASSING OF ST45 REQUESTED, BUT CLUSTERSERVER DOES NOT SEEM TO SUPPORT IT !!!");    
+      AliWarning("BYPASSING OF ST4 AND/OR 5 REQUESTED, BUT CLUSTERSERVER DOES NOT SEEM TO SUPPORT IT !!!");    
     }
   }
 }