]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Allow selection of concrete digitStore class, and change the default one from V1...
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Jul 2007 16:36:14 +0000 (16:36 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Jul 2007 16:36:14 +0000 (16:36 +0000)
(more compact on disk) (Laurent)

MUON/AliMUON.cxx
MUON/AliMUON.h
MUON/AliMUONSDigitizerV2.cxx
MUON/Config.C

index e7b6cdae40377c9def57f6d9e160c5496091635e..927113d0334832769534f34d5c2d21a3c0a221a4 100644 (file)
@@ -118,7 +118,8 @@ AliMUON::AliMUON()
     fDigitizerWithNoise(1),
     fRawWriter(0x0),
     fDigitMaker(0x0),
-    fHitStore(0x0)
+    fHitStore(0x0),
+  fDigitStoreConcreteClassName()
 {
 /// Default Constructor
     
@@ -150,7 +151,8 @@ AliMUON::AliMUON(const char *name, const char* title)
     fDigitizerWithNoise(1),
     fRawWriter(0x0),
     fDigitMaker(new AliMUONDigitMaker),
-    fHitStore(0x0)
+    fHitStore(0x0),
+  fDigitStoreConcreteClassName("AliMUONDigitStoreV2S")
 {
 /// Standard constructor  
   
index 34f30fded5af3ceadc900d318820d6d38d2519d7..3201a24bb68c0f263cfcdb25bddf7bd7403d0f3d 100644 (file)
@@ -19,6 +19,7 @@
 #include "AliMUONTrigger.h"
 
 #include <TVectorfwd.h>
+#include <TString.h>
 
 class TFile;
 class TTree;
@@ -125,11 +126,15 @@ class AliMUON : public  AliDetector
                   /// Return reference to Chamber \a id
     virtual AliMUONChamber& Chamber(Int_t id)
       {return *((AliMUONChamber *) (*fChambers)[id]);}
-                  /// Return reference to New Circuit \a id 
 
     virtual void MakeBranch(Option_t* opt=" ");
     virtual void ResetHits();
     
+                 /// Set digit store class name           
+    void SetDigitStoreClassName(const char* classname) { fDigitStoreConcreteClassName = classname; }
+                 /// Return digit store class name           
+    const TString DigitStoreClassName() const { return fDigitStoreConcreteClassName; }
+    
   protected:
     /// Not implemented
     AliMUON(const AliMUON& rMUON);
@@ -172,7 +177,9 @@ class AliMUON : public  AliDetector
 
     AliMUONVHitStore* fHitStore; //!< container of hits
     
-    ClassDef(AliMUON,15)  // MUON Detector base class
+    TString fDigitStoreConcreteClassName; ///< to be able to select what the sdigitizer uses
+    
+    ClassDef(AliMUON,16)  // MUON Detector base class
 };
 #endif
 
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.
index 74481ef31793534d51c5555490c8bf955eb43496..4439a1aec9ee3bae8e8c2041cf99f835c593f65a 100644 (file)
@@ -2,7 +2,7 @@
 // Remember to define the directory and option
 // gAlice->SetConfigFunction("Config('$HOME','box');");
 
-void Config(char directory[100]="", char option[6]="param")
+void Config(char directory[100]="", char option[6]="param", const char* digitstore="AliMUONDigitStoreV1")
 {
   //=====================================================================
   // Config file for MUON test
@@ -174,6 +174,11 @@ void Config(char directory[100]="", char option[6]="param")
   // activate trigger chamber efficiency by cells (0=default, 1=trigger efficiency according to AliMUONTriggerEfficiencyCells
   //  MUON->SetTriggerEffCells(0);
 
+  // Use SetDigitStoreClassName() to change the digitStore implementation used by (s)digitizer
+  MUON->SetDigitStoreClassName(digitstore);
+  
+  cout << "MUON DigitStore is " << MUON->DigitStoreClassName().Data() << endl;
+  
   // To get same as above w/o noise-only digits for the tracker do  :
   //MUON->SetDigitizerWithNoise(kFALSE);
 
@@ -193,7 +198,3 @@ void Config(char directory[100]="", char option[6]="param")
   //  MUON->AddGeometryBuilder(new AliMUONSlatGeometryBuilder(MUON));
   //  MUON->AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(MUON));
 }
-
-Float_t EtaToTheta(Float_t arg){
-  return (180./TMath::Pi())*2.*atan(exp(-arg));
-}