From 5ee595acebef04a5d40c44416078979f9dbad4cc Mon Sep 17 00:00:00 2001 From: ivana Date: Mon, 2 Jul 2007 16:36:14 +0000 Subject: [PATCH] Allow selection of concrete digitStore class, and change the default one from V1 to V2S (more compact on disk) (Laurent) --- MUON/AliMUON.cxx | 6 ++++-- MUON/AliMUON.h | 11 +++++++++-- MUON/AliMUONSDigitizerV2.cxx | 13 +++++++++++-- MUON/Config.C | 11 ++++++----- 4 files changed, 30 insertions(+), 11 deletions(-) diff --git a/MUON/AliMUON.cxx b/MUON/AliMUON.cxx index e7b6cdae403..927113d0334 100644 --- a/MUON/AliMUON.cxx +++ b/MUON/AliMUON.cxx @@ -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 diff --git a/MUON/AliMUON.h b/MUON/AliMUON.h index 34f30fded5a..3201a24bb68 100644 --- a/MUON/AliMUON.h +++ b/MUON/AliMUON.h @@ -19,6 +19,7 @@ #include "AliMUONTrigger.h" #include +#include 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 diff --git a/MUON/AliMUONSDigitizerV2.cxx b/MUON/AliMUONSDigitizerV2.cxx index aaa70baf707..c99990100b3 100644 --- a/MUON/AliMUONSDigitizerV2.cxx +++ b/MUON/AliMUONSDigitizerV2.cxx @@ -23,12 +23,12 @@ #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. diff --git a/MUON/Config.C b/MUON/Config.C index 74481ef3179..4439a1aec9e 100644 --- a/MUON/Config.C +++ b/MUON/Config.C @@ -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)); -} -- 2.43.0