#include "Riostream.h"
#include "TGeoManager.h"
#include "TGeoVolume.h"
+#include <TClass.h>
#include "AliITSRawStreamSSD.h"
#include "AliRawReader.h"
#include "AliLog.h"
ClassImp(AliITSRawStreamSSD)
-
+
+Bool_t AliITSRawStreamSSD::fgkDDLModuleMapInit = kFALSE;
Int_t AliITSRawStreamSSD::fgkDDLModuleMap[kDDLsNumber][kModulesPerDDL] = {
{0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
fRawReader->Select("ITSSSD");
}
+Int_t AliITSRawStreamSSD::GetModuleNumber(UInt_t iDDL, UInt_t iModule)
+{
+ if (!fgkDDLModuleMapInit) {
+ if (!InitDDLModuleMap()) return -1;
+ }
+ return fgkDDLModuleMap[iDDL][iModule];
+}
+
+Bool_t AliITSRawStreamSSD::InitDDLModuleMap()
+{
+ // Initialize the DDL
+ // module map
+ if(!gGeoManager){
+ AliErrorClass("Geometry is not initialized\n");
+ return kFALSE;
+ }
+ TGeoVolume *v = NULL;
+ v = gGeoManager->GetVolume("ITSssdSensitivL5");
+ if(!v) {
+ // new geometry AliITSvPPRasymmFMD
+ AliInfoClass(Form("Enabling the SSD DDL mapping for the AliITSvPPRasymmFMD"));
+ SetvPPRasymmFMDDDLMapping();
+ }
+ else {
+ // new geometry AliITSv11Hybrid
+ AliInfoClass(Form("Enabling the SSD DDL mapping for the AliITSv11Hybrid"));
+ Setv11HybridDDLMapping();
+ }
+ fgkDDLModuleMapInit = kTRUE;
+ return kTRUE;
+}
+
void AliITSRawStreamSSD::Setv11HybridDDLMapping() {
//DDL mapping v11Hybrid
Int_t kDDLModuleMap[kDDLsNumber][kModulesPerDDL] = {
Int_t GetAD() const {return fad;}
Int_t GetADC() const {return fadc;}
- void Setv11HybridDDLMapping();
- void SetvPPRasymmFMDDDLMapping();
+ static Bool_t InitDDLModuleMap(); // Initialize DLL module map
+ static void Setv11HybridDDLMapping();
+ static void SetvPPRasymmFMDDDLMapping();
enum {kDDLsNumber = 16}; // number of DDLs in SSD
enum {kModulesPerDDL = 108}; // number of modules in each DDL
- static Int_t GetModuleNumber(UInt_t iDDL, UInt_t iModule)
- {return fgkDDLModuleMap[iDDL][iModule];}
+ static Int_t GetModuleNumber(UInt_t iDDL, UInt_t iModule);
enum ESSDRawStreamError {
kWrongModuleIdErr = 1
Bool_t flag;
protected :
+ static Bool_t fgkDDLModuleMapInit; // Module map is initialized or not
static Int_t fgkDDLModuleMap[kDDLsNumber][kModulesPerDDL]; // mapping DDL/module -> module number
UInt_t fData; // data read for file