]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
changes needed for the new RCU mapping files in EMCal (Gustavo). Cross-checked by...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Sep 2008 13:14:44 +0000 (13:14 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Sep 2008 13:14:44 +0000 (13:14 +0000)
RAW/AliCaloRawStream.cxx
RAW/AliCaloRawStream.h

index aeca3facf7dc04855d73aa3a3072cdf737b6f610..692d45c77383db1e68b742ecc9e7e36d966a1a48 100644 (file)
@@ -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);
index c398bdf2954318bce54525b946590a5113ba0271..884426b94219a613a75281aa2322d5fe8b825bf6 100644 (file)
@@ -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
 
 };