]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONv1.cxx
whoops
[u/mrichter/AliRoot.git] / MUON / AliMUONv1.cxx
index 819425914490954251a64dca93249fcacc4547e2..6ad827c500f75a09ceefd5752d1a832e4552a6eb 100644 (file)
 
 /* $Id$ */
 
-// --------------------
+//-----------------------------------------------------------------------------
 // Class AliMUONv1
 // --------------------
 // AliDetector class for MUON subsystem which implements
 // functions for simulation 
+//-----------------------------------------------------------------------------
 
 #include "AliMUONv1.h"
 #include "AliMUONConstants.h"
-#include "AliMUONSegFactory.h"
 #include "AliMUONResponseFactory.h"
-#include "AliMUONSegmentation.h"
 #include "AliMUONHit.h"
 #include "AliMUONGeometryBuilder.h"    
 #include "AliMUONGeometry.h"   
@@ -34,6 +33,7 @@
 #include "AliMUONStringIntMap.h"       
 #include "AliMUONGeometryDetElement.h" 
 
+#include "AliMpCDB.h"
 #include "AliMpDEManager.h"
 
 #include "AliConst.h" 
@@ -52,6 +52,8 @@
 
 #include <string>
 
+#include "AliMUONVHitStore.h"
+
 /// \cond CLASSIMP
 ClassImp(AliMUONv1)
 /// \endcond
@@ -75,10 +77,8 @@ AliMUONv1::AliMUONv1()
 } 
 
 //___________________________________________
-AliMUONv1::AliMUONv1(const char *name, const char *title,
-                     const char* sDigitizerClassName,
-                     const char* digitizerClassName)
-: AliMUON(name,title,sDigitizerClassName,digitizerClassName), 
+AliMUONv1::AliMUONv1(const char *name, const char* title)
+: AliMUON(name, title), 
     fAngleEffect(kTRUE),
     fStepMaxInActiveGas(0.6),
     fStepSum(0x0),
@@ -93,6 +93,11 @@ AliMUONv1::AliMUONv1(const char *name, const char *title,
 
     AliDebug(1,Form("ctor this=%p",this));     
        
+    // Load mapping
+    if ( ! AliMpCDB::LoadMpSegmentation() ) {
+      AliFatal("Could not access mapping from OCDB !");
+    }
+       
     // By default include all stations
 
     fStepSum   = new Float_t [AliMUONConstants::NCh()];
@@ -172,28 +177,14 @@ void AliMUONv1::Init()
   AliDebug(1,"Finished Init for version 1 - CPC chamber type");   
  
 
-  std::string ftype(GetTitle());
-
   // Build segmentation
   // using geometry parametrisation
   //
-  AliMUONSegFactory segFactory(GetGeometryTransformer());
-  fSegmentation = segFactory.CreateSegmentation(ftype);
-
-  if (!fSegmentation) {
-    AliFatal(Form("Wrong factory type : %s",ftype.c_str()));
-  }        
-
   // Build response
   //
-  AliMUONResponseFactory respFactory("default");
+  AliMUONResponseFactory respFactory("default", fIsTailEffect);
   respFactory.Build(this);
   
-
-  // Initialize segmentation
-  //
-  fSegmentation->Init();
-  
 }
 
 //__________________________________________________________________
@@ -299,7 +290,7 @@ void AliMUONv1::StepManager()
   // Filling TrackRefs file for MUON. Our Track references are the active volume of the chambers
   if ( (gMC->IsTrackEntering() || gMC->IsTrackExiting() ) ) {
     AliTrackReference* trackReference    
-      = AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
+      = AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kMUON);
     trackReference->SetUserId(detElemId);
   }  
   
@@ -418,8 +409,7 @@ void AliMUONv1::StepManager()
     }
     }
     
-    // One hit per chamber
-    GetMUONData()->AddHit(fIshunt, 
+    AliMUONHit hit(fIshunt, 
                          gAlice->GetMCApp()->GetCurrentTrackNumber(), 
                          detElemId, ipart,
                          fTrackPosition.X(), 
@@ -435,9 +425,7 @@ void AliMUONv1::StepManager()
                          fTrackPosition.Y(),
                          fTrackPosition.Z());
 
-    //       AliDebug(1,Form("Exit: Particle exiting from chamber %d",iChamber));
-    //       AliDebug(1,Form("Exit: StepSum %f eloss geant %g ",fStepSum[idvol],fDestepSum[idvol]));
-    //       AliDebug(1,Form("Exit: Track Position %f %f %f",fTrackPosition.X(),fTrackPosition.Y(),fTrackPosition.Z()) ;
+    fHitStore->Add(hit);
 
     fStepSum[idvol]  =0; // Reset for the next event
     fDestepSum[idvol]=0; // Reset for the next event