]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONSegFactory.cxx
First version of a jet analysis deriving from AliAnalysisTask.
[u/mrichter/AliRoot.git] / MUON / AliMUONSegFactory.cxx
index b2a2dddfc40fac215265460a69b112c2cf6ba128..633bc22d8921957a6487440e3206246e4fc9db10 100644 (file)
 #include "AliMUONGeometrySegmentation.h"
 #include "AliMUONSt12QuadrantSegmentation.h"
 #include "AliMUONSt345SlatSegmentation.h"
-#include "AliMUONSt345SlatSegmentationV2.h"
 #include "AliMUONTriggerSegmentation.h"
-#include "AliMUONTriggerSegmentationV2.h"
 
 #include "AliMpDEManager.h"
 #include "AliMpDEIterator.h"
+#include "AliMpSegmentation.h"
 
 #include "AliLog.h"
 
@@ -54,7 +53,6 @@ ClassImp(AliMUONSegFactory)
 //______________________________________________________________________________
 AliMUONSegFactory::AliMUONSegFactory(const AliMUONGeometryTransformer* geometry)
     : TObject(),
-      fMpSegFactory(),
       fDESegmentations(),
       fSegmentation(0),
       fkTransformer(geometry)
@@ -67,7 +65,6 @@ AliMUONSegFactory::AliMUONSegFactory(const AliMUONGeometryTransformer* geometry)
 AliMUONSegFactory::AliMUONSegFactory(const TString& volPathsFileName,
                                      const TString& transformsFileName)
     : TObject(),
-      fMpSegFactory(),
       fDESegmentations(),
       fSegmentation(0),
       fkTransformer(0)
@@ -83,7 +80,6 @@ AliMUONSegFactory::AliMUONSegFactory(const TString& volPathsFileName,
 //______________________________________________________________________________
   AliMUONSegFactory::AliMUONSegFactory()
     : TObject(),      
-      fMpSegFactory(),
       fDESegmentations(),
       fSegmentation(0),
       fkTransformer(0)
@@ -138,21 +134,6 @@ AliMUONSegmentation* AliMUONSegFactory::Segmentation()
 // public methods
 //
 
-//______________________________________________________________________________
-AliMpVSegmentation* 
-AliMUONSegFactory::CreateMpSegmentation(Int_t detElemId, Int_t cath)
-{
-/// Create mapping segmentation for given detElemId and cath
-/// using mapping manager
-
-  AliMpVSegmentation* mpSegmentation 
-    = fMpSegFactory.CreateMpSegmentation(detElemId, cath);
-
-  Segmentation()->AddMpSegmentation(mpSegmentation);
-  
-  return mpSegmentation;
-} 
-    
 //______________________________________________________________________________
 AliMUONVGeometryDESegmentation*  
 AliMUONSegFactory::CreateDESegmentation(Int_t detElemId, Int_t cath)
@@ -191,17 +172,21 @@ AliMUONSegFactory::CreateDESegmentation(Int_t detElemId, Int_t cath)
   // Get DE segmentation for this DE type, create it if it does not exist 
   // 
   AliMUONVGeometryDESegmentation* deSegmentation = 0;
-  TString deName = AliMpDEManager::GetDEName(detElemId, cath);
+  TString deName = AliMpDEManager::GetDESegName(detElemId, cath);
   TObject* objSegmentation = fDESegmentations.Get(deName);
   if ( objSegmentation ) 
     deSegmentation = (AliMUONVGeometryDESegmentation*)objSegmentation;  
     
   if ( !deSegmentation ) {
 
+    
+
     // Get/Create mapping segmentation via mapping manager
+    const AliMpVSegmentation* kmpSegmentation 
+      = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId, cath);
     AliMpVSegmentation* mpSegmentation 
-      = CreateMpSegmentation(detElemId, cath);
+      = const_cast<AliMpVSegmentation*>(kmpSegmentation);
+
     AliMpStationType stationType = AliMpDEManager::GetStationType(detElemId);
     AliMpPlaneType planeType = AliMpDEManager::GetPlaneType(detElemId, cath);
     
@@ -219,7 +204,7 @@ AliMUONSegFactory::CreateDESegmentation(Int_t detElemId, Int_t cath)
         break;
         
       case kStation345:                  
-        deSegmentation = new AliMUONSt345SlatSegmentationV2(
+        deSegmentation = new AliMUONSt345SlatSegmentation(
                                 mpSegmentation, detElemId, planeType); 
         //cout << "   new AliMUONSt345SlatSegmentationV2 "                       
        //     << StationTypeName(stationType) << "  "  
@@ -228,9 +213,9 @@ AliMUONSegFactory::CreateDESegmentation(Int_t detElemId, Int_t cath)
         break;
     
       case kStationTrigger:              
-        deSegmentation = new AliMUONTriggerSegmentationV2(
+        deSegmentation = new AliMUONTriggerSegmentation(
                                 mpSegmentation, detElemId, planeType); 
-        //cout << "   new AliMUONTriggerSegmentationV2 "                         
+        //cout << "   new AliMUONTriggerSegmentation "                   
        //     << StationTypeName(stationType) << "  "  
        //     << PlaneTypeName(planeType) << "  "                        
        //     << deName << endl;                                 
@@ -268,28 +253,10 @@ AliMUONSegFactory::CreateModuleSegmentations(Int_t chamberId, Int_t cath)
     
 //______________________________________________________________________________
 AliMUONSegmentation*  
-AliMUONSegFactory::CreateSegmentation(const TString& option)
+AliMUONSegFactory::CreateSegmentation()
 {
 /// Create segmentations on all levels and return their container.
 
-  // Check options
-  if ( option != "default"   && 
-       option != "FactoryV2" && 
-       option != "FactoryV3" &&
-       option != "FactoryV4" &&
-       option != "new") {
-
-    AliErrorStream() << "Option " << option << " not defined." << endl;
-    return 0;
-  }         
-  if ( option == "FactoryV2" || option == "FactoryV3" ) { 
-
-    AliErrorStream() 
-      << "Option " << option << " not supported anymore." << endl;
-    return 0;
-  }         
-
   for (Int_t chamberId = 0; chamberId<AliMUONConstants::NCh(); chamberId++)
     for (Int_t cath = 0; cath < 2; cath++) {
       if ( IsGeometryDefined(chamberId) )