From: cvetan Date: Wed, 24 Sep 2008 13:14:44 +0000 (+0000) Subject: changes needed for the new RCU mapping files in EMCal (Gustavo). Cross-checked by... X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=cee89af9f4f9cad77b009fe26677e6f74773a976;hp=a79964674f876fef4751d592a2dd67783fe42857;p=u%2Fmrichter%2FAliRoot.git changes needed for the new RCU mapping files in EMCal (Gustavo). Cross-checked by Yuri. --- diff --git a/RAW/AliCaloRawStream.cxx b/RAW/AliCaloRawStream.cxx index aeca3facf7d..692d45c7738 100644 --- a/RAW/AliCaloRawStream.cxx +++ b/RAW/AliCaloRawStream.cxx @@ -54,33 +54,47 @@ AliCaloRawStream::AliCaloRawStream(AliRawReader* rawReader, TString calo, AliAlt fCaloFlag(0), fFilter(0), fNRCU(0), + fNSides(0), + fCalo(calo), fExternalMapping(kFALSE) { -// create an object to read PHOS/EMCAL raw digits - + // create an object to read PHOS/EMCAL raw digits SelectRawData(calo); // PHOS and EMCAL have differen number of RCU per module + //For PHOS fNRCU = 4; - if(calo == "EMCAL") fNRCU = 2; + fNSides = 1; + //For EMCAL + TString sides[]={"A","C"}; + if(fCalo == "EMCAL") { + fNRCU = 2; + fNSides = 2; + } if (mapping == NULL) { TString path = gSystem->Getenv("ALICE_ROOT"); - path += "/"+calo+"/mapping/RCU"; + path += "/"+fCalo+"/mapping/RCU"; TString path2; - for(Int_t i = 0; i < fNRCU; i++) { - path2 = path; - path2 += i; - path2 += ".data"; - fMapping[i] = new AliCaloAltroMapping(path2.Data()); + for(Int_t j = 0; j < fNSides; j++){ + for(Int_t i = 0; i < fNRCU; i++) { + path2 = path; + path2 += i; + if(fCalo == "EMCAL") path2 += sides[j]; + path2 += ".data"; + //printf("AliCaloRawStream::RCU: %s\n",path2.Data()); + fMapping[i] = new AliCaloAltroMapping(path2.Data()); + } } } else { fExternalMapping = kTRUE; - for(Int_t i = 0; i < fNRCU; i++) + //printf("AliCaloRawStream::External mapping N: RCU %d, sides %d \n", fNRCU,fNSides); + for(Int_t i = 0; i < fNRCU*fNSides; i++) fMapping[i] = mapping[i]; + } - + SetNoAltroMapping(kFALSE); } @@ -96,6 +110,8 @@ AliCaloRawStream::AliCaloRawStream(const AliCaloRawStream& stream) : fCaloFlag(0), fFilter(0), fNRCU(0), + fNSides(0), + fCalo(""), fExternalMapping(kFALSE) { Fatal("AliCaloRawStream", "copy constructor not implemented"); @@ -115,7 +131,7 @@ AliCaloRawStream::~AliCaloRawStream() // destructor if (!fExternalMapping) - for(Int_t i = 0; i < fNRCU; i++) + for(Int_t i = 0; i < fNRCU*fNSides; i++) delete fMapping[i]; } @@ -126,6 +142,7 @@ void AliCaloRawStream::Reset() AliAltroRawStream::Reset(); fModule = fPrevModule = fRow = fPrevRow = fColumn = fPrevColumn = -1; fFilter = fCaloFlag = 0; + fCalo=""; } //_____________________________________________________________________________ @@ -164,6 +181,10 @@ void AliCaloRawStream::ApplyAltroMapping() Int_t rcuIndex = ddlNumber % fNRCU; + if(fCalo=="EMCAL"){ // EMCAL may need to increase RCU index for the maps + if (fModule%2 == 1) { rcuIndex += 2; } // other='C' side maps + } + Short_t hwAddress = GetHWAddress(); fRow = fMapping[rcuIndex]->GetPadRow(hwAddress); fColumn = fMapping[rcuIndex]->GetPad(hwAddress); diff --git a/RAW/AliCaloRawStream.h b/RAW/AliCaloRawStream.h index c398bdf2954..884426b9421 100644 --- a/RAW/AliCaloRawStream.h +++ b/RAW/AliCaloRawStream.h @@ -14,6 +14,7 @@ /////////////////////////////////////////////////////////////////////////////// // --- ROOT system --- +#include "TString.h" // --- AliRoot header files --- #include "AliAltroRawStream.h" @@ -39,7 +40,8 @@ public : Bool_t IsNewRow() const {return (GetRow() != GetPrevRow()) || IsNewModule();} Bool_t IsNewColumn() const {return (GetColumn() != GetPrevColumn()) || IsNewRow();} Int_t GetNRCU() const {return fNRCU;} - + Int_t GetNSides() const {return fNSides;} + TString GetCalorimeter() const {return fCalo;} enum EAliCaloFlag { kLowGain=0, kHighGain=1, kTRUData=2, kLEDMonData=3 }; Bool_t IsLowGain() const {return (fCaloFlag == kLowGain);} Bool_t IsHighGain() const {return (fCaloFlag == kHighGain);} @@ -68,10 +70,12 @@ protected: Int_t fCaloFlag; // low (0) or (1) high gain; see enum EAliCaloFlag above Int_t fFilter; // default 0 = let everything through Int_t fNRCU; // number of RCU per (super)module + Int_t fNSides; // Division of EMCal in "A" "C" sides + TString fCalo; // Calorimeter name Bool_t fExternalMapping; // use external mapping or create a default one AliAltroMapping *fMapping[4]; // pointers to ALTRO mapping - ClassDef(AliCaloRawStream, 0) // class for reading PHOS/EMCAL raw digits + ClassDef(AliCaloRawStream, 1) // class for reading PHOS/EMCAL raw digits };