]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONSDigitizerV2.cxx
Allow selection of concrete digitStore class, and change the default one from V1...
[u/mrichter/AliRoot.git] / MUON / AliMUONSDigitizerV2.cxx
index aaa70baf707c31acad35f68939015fb51281afae..c99990100b3e945ffba5867af25ef33f7a42f381 100644 (file)
 #include "AliMUON.h"
 #include "AliMUONChamber.h"
 #include "AliMUONVDigit.h"
-#include "AliMUONDigitStoreV1.h"
 #include "AliMUONHit.h"
 #include "AliMpDEManager.h"
 #include "AliLoader.h"
 #include "AliRun.h"
 #include "AliRunLoader.h"
+#include "AliMUONVDigitStore.h"
 #include "AliMUONVHitStore.h"
 
 ///
@@ -90,8 +90,17 @@ AliMUONSDigitizerV2::Exec(Option_t*)
     
   Int_t nofEvents(runLoader->GetNumberOfEvents());
   
-  AliMUONVDigitStore* sDigitStore = new AliMUONDigitStoreV1;
+  TString classname = muon->DigitStoreClassName();
   
+  AliMUONVDigitStore* sDigitStore = AliMUONVDigitStore::Create(classname.Data());
+  
+  if (!sDigitStore)
+  {
+    AliFatal(Form("Could not create digitstore of class %s",classname.Data()));
+  }
+  
+  AliInfo(Form("Will use digitStore of type %s",sDigitStore->ClassName()));
+          
   for ( Int_t iEvent = 0; iEvent < nofEvents; ++iEvent ) 
   {    
     // Loop over events.