Restoring backward compatibility of the SSD calibration objects + output of the SSD...
authorprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Aug 2008 03:32:40 +0000 (03:32 +0000)
committerprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 Aug 2008 03:32:40 +0000 (03:32 +0000)
31 files changed:
ITS/AliITSBadChannelsSSD.cxx
ITS/AliITSBadChannelsSSD.h
ITS/AliITSBadChannelsSSDv2.cxx [new file with mode: 0644]
ITS/AliITSBadChannelsSSDv2.h [new file with mode: 0644]
ITS/AliITSCalibrationSSD.h
ITS/AliITSDetTypeRec.cxx
ITS/AliITSDetTypeRec.h
ITS/AliITSDetTypeSim.cxx
ITS/AliITSDetTypeSim.h
ITS/AliITSGainSSD.cxx
ITS/AliITSGainSSD.h
ITS/AliITSGainSSDv2.cxx [new file with mode: 0644]
ITS/AliITSGainSSDv2.h [new file with mode: 0644]
ITS/AliITSHandleDaSSD.cxx
ITS/AliITSHandleDaSSD.h
ITS/AliITSNoiseSSD.cxx
ITS/AliITSNoiseSSD.h
ITS/AliITSNoiseSSDv2.cxx [new file with mode: 0644]
ITS/AliITSNoiseSSDv2.h [new file with mode: 0644]
ITS/AliITSPedestalSSD.cxx
ITS/AliITSPedestalSSD.h
ITS/AliITSPedestalSSDv2.cxx [new file with mode: 0644]
ITS/AliITSPedestalSSDv2.h [new file with mode: 0644]
ITS/AliITSPreprocessorSSD.cxx
ITS/AliITSQASSDDataMakerRec.cxx
ITS/AliITSQASSDDataMakerRec.h
ITS/Calib/BadChannelsSSD/Run0_999999999_v0_s0.root
ITS/Calib/GainSSD/Run0_999999999_v0_s0.root
ITS/Calib/NoiseSSD/Run0_999999999_v0_s0.root
ITS/ITSbaseLinkDef.h
ITS/libITSbase.pkg

index eba5cb7..b92ceb2 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
+ *                                                                         *
  * Author: The ALICE Off-line Project.                                    *
  * Contributors are mentioned in the code where appropriate.              *
  *                                                                        *
 
 
 #include "AliITSBadChannelsSSD.h"
-#include <cstring>
-
-//////////////////////////////////////////////////////
-// Author: Enrico Fragiacomo
-// Date: 23/08/2007
-// Modified: 08/07/2008
-//                                                  //
-//////////////////////////////////////////////////////
-
-//const Int_t AliITSBadChannelsSSD::fgkDefaultNModulesSSD = 1698;
-//const Int_t AliITSBadChannelsSSD::fgkDefaultNStripsSSD = 768;
 
 ClassImp(AliITSBadChannelsSSD)
-  
-//______________________________________________________________________
-  AliITSBadChannelsSSD::AliITSBadChannelsSSD()
-    // Default Constructor 
-{ 
-    for(Int_t i=0; i<2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD; i++) 
-      fBadChannels[i]=0;    
-  }
 
 //______________________________________________________________________
-AliITSBadChannelsSSD::AliITSBadChannelsSSD(const AliITSBadChannelsSSD &source): 
-  TObject(source)  
-{
-    // copy Constructor
-  memcpy(fBadChannels,source.fBadChannels,
-        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(Char_t));
+AliITSBadChannelsSSD::AliITSBadChannelsSSD():
+fMod(0),
+fBadNChannelsList(0),
+fBadPChannelsList(0){
+    // Default Constructor
+
 }
 
 //______________________________________________________________________
 AliITSBadChannelsSSD::~AliITSBadChannelsSSD(){
     // destructor
-}
 
-//______________________________________________________________________
-AliITSBadChannelsSSD& AliITSBadChannelsSSD::operator=(const AliITSBadChannelsSSD &source) {
- // ass. op.
-    if (this == &source)return *this;
-    memcpy(fBadChannels,source.fBadChannels,
-        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(Char_t));
-    
-    return *this;
 }
+
index a3f7258..0a43226 100644 (file)
@@ -1,49 +1,44 @@
 #ifndef ALIITSBADCHANNELSSSD_H
 #define ALIITSBADCHANNELSSSD_H
  
+#include "TObjArray.h"
+#include "TArrayI.h"
+
 //////////////////////////////////////////////
-// Author: Enrico Fragiacomo
-// Date: 23/08/2007
-// Modified: 08/07/2008
+// Response class for SSD                   //
 //                                          //
 //////////////////////////////////////////////
-#include "TObject.h"
-
 class AliITSBadChannelsSSD : public TObject {
 
  public:
-
     AliITSBadChannelsSSD();
     virtual ~AliITSBadChannelsSSD();
-    AliITSBadChannelsSSD(const AliITSBadChannelsSSD &source); // copy constructor
-    AliITSBadChannelsSSD& operator=(const AliITSBadChannelsSSD &source); // ass. op.
 
-    void AddBadChannelP(Int_t module, Int_t strip, Char_t value) { 
-      fBadChannels[module*2*fgkDefaultNStripsSSD+strip] = value;
-    }       
-    Char_t GetBadChannelP(Int_t module, Int_t strip) {
-      return fBadChannels[module*2*fgkDefaultNStripsSSD+strip]; 
-    }
+    void SetNBadPChannelsList(Int_t n) { fBadPChannelsList.Set(n); }
+    void AddBadPChannel(Int_t c, Int_t n) { fBadPChannelsList.AddAt(n,c);}
+    TArrayI GetBadPChannelsList() const {return fBadPChannelsList; }
+    Int_t GetBadPChannel(Int_t n) {return fBadPChannelsList.At(n); }
+    void SetNBadNChannelsList(Int_t n) { fBadNChannelsList.Set(n); }
+    void AddBadNChannel(Int_t c, Int_t n) { fBadNChannelsList.AddAt(n,c);}
+    TArrayI GetBadNChannelsList() const {return fBadNChannelsList; }
+    Int_t GetBadNChannel(Int_t n) {return fBadNChannelsList.At(n); }
+    //
 
-    void AddBadChannelN(Int_t module, Int_t strip, Char_t value) { 
-      fBadChannels[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip] = value;
-    }       
-    Char_t GetBadChannelN(Int_t module, Int_t strip) {
-      return fBadChannels[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip]; 
-    }
+    void SetMod(UShort_t mod) {fMod = mod;}
+    UShort_t GetMod() { return fMod;}
 
  protected:
 
-    static const Int_t fgkDefaultNModulesSSD = 1698;
-    static const Int_t fgkDefaultNStripsSSD = 768;
-    //static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules
-   //   static const Int_t fgkDefaultNStripsSSD; // Total numbers of SSD modules
-   Char_t fBadChannels[2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD];
-    //   Char_t *fBadChannels; 
-
+    UShort_t fMod;       // module number (from 0 to 1535). Needed by the preprocessor to 
+    //   extract the information from the Detector Algorithm
+    
+    TArrayI  fBadNChannelsList;  // list of P side dead channels
+    TArrayI  fBadPChannelsList;  // list of N side dead channels
+    
  private:
-   
-   ClassDef(AliITSBadChannelsSSD,2) // BadChannels  class for SSD
-     };
+    AliITSBadChannelsSSD(const AliITSBadChannelsSSD &source); // copy constructor
+    AliITSBadChannelsSSD& operator=(const AliITSBadChannelsSSD &source); // ass. op.
 
+    ClassDef(AliITSBadChannelsSSD,1) //Response class for SSD
+};
 #endif
diff --git a/ITS/AliITSBadChannelsSSDv2.cxx b/ITS/AliITSBadChannelsSSDv2.cxx
new file mode 100644 (file)
index 0000000..941d192
--- /dev/null
@@ -0,0 +1,62 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+#include "AliITSBadChannelsSSDv2.h"
+#include <cstring>
+
+//////////////////////////////////////////////////////
+// Author: Enrico Fragiacomo
+// Date: 23/08/2007
+// Modified: 08/07/2008
+//                                                  //
+//////////////////////////////////////////////////////
+
+//const Int_t AliITSBadChannelsSSD::fgkDefaultNModulesSSD = 1698;
+//const Int_t AliITSBadChannelsSSD::fgkDefaultNStripsSSD = 768;
+
+ClassImp(AliITSBadChannelsSSDv2)
+  
+//______________________________________________________________________
+  AliITSBadChannelsSSDv2::AliITSBadChannelsSSDv2()
+    // Default Constructor 
+{ 
+    for(Int_t i=0; i<2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD; i++) 
+      fBadChannels[i]=0;    
+  }
+
+//______________________________________________________________________
+AliITSBadChannelsSSDv2::AliITSBadChannelsSSDv2(const AliITSBadChannelsSSDv2 &source): 
+  TObject(source)  
+{
+    // copy Constructor
+  memcpy(fBadChannels,source.fBadChannels,
+        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(Char_t));
+}
+
+//______________________________________________________________________
+AliITSBadChannelsSSDv2::~AliITSBadChannelsSSDv2(){
+    // destructor
+}
+
+//______________________________________________________________________
+AliITSBadChannelsSSDv2& AliITSBadChannelsSSDv2::operator=(const AliITSBadChannelsSSDv2 &source) {
+ // ass. op.
+    if (this == &source)return *this;
+    memcpy(fBadChannels,source.fBadChannels,
+        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(Char_t));
+    
+    return *this;
+}
diff --git a/ITS/AliITSBadChannelsSSDv2.h b/ITS/AliITSBadChannelsSSDv2.h
new file mode 100644 (file)
index 0000000..ce0e5a0
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef ALIITSBADCHANNELSSSDV2_H
+#define ALIITSBADCHANNELSSSDV2_H
+//////////////////////////////////////////////
+// Author: Enrico Fragiacomo
+// Date: 23/08/2007
+// Modified: 08/07/2008
+//                                          //
+//////////////////////////////////////////////
+#include "TObject.h"
+
+class AliITSBadChannelsSSDv2 : public TObject {
+
+ public:
+
+    AliITSBadChannelsSSDv2();
+    virtual ~AliITSBadChannelsSSDv2();
+    AliITSBadChannelsSSDv2(const AliITSBadChannelsSSDv2 &source); // copy constructor
+    AliITSBadChannelsSSDv2& operator=(const AliITSBadChannelsSSDv2 &source); // ass. op.
+
+    void AddBadChannelP(Int_t module, Int_t strip, Char_t value) { 
+      fBadChannels[module*2*fgkDefaultNStripsSSD+strip] = value;
+    }       
+    Char_t GetBadChannelP(Int_t module, Int_t strip) {
+      return fBadChannels[module*2*fgkDefaultNStripsSSD+strip]; 
+    }
+
+    void AddBadChannelN(Int_t module, Int_t strip, Char_t value) { 
+      fBadChannels[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip] = value;
+    }       
+    Char_t GetBadChannelN(Int_t module, Int_t strip) {
+      return fBadChannels[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip]; 
+    }
+
+ protected:
+
+    static const Int_t fgkDefaultNModulesSSD = 1698;
+    static const Int_t fgkDefaultNStripsSSD = 768;
+    //static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules
+   //   static const Int_t fgkDefaultNStripsSSD; // Total numbers of SSD modules
+   Char_t fBadChannels[2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD];
+    //   Char_t *fBadChannels; 
+
+ private:
+   
+   ClassDef(AliITSBadChannelsSSDv2,1) // BadChannels  class for SSD
+     };
+
+#endif
index a7387db..403ec7f 100644 (file)
@@ -3,10 +3,10 @@
 /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */ 
 #include "AliITSCalibration.h"
-#include "AliITSNoiseSSD.h"
-#include "AliITSPedestalSSD.h"
-#include "AliITSGainSSD.h"
-#include "AliITSBadChannelsSSD.h"
+#include "AliITSNoiseSSDv2.h"
+#include "AliITSPedestalSSDv2.h"
+#include "AliITSGainSSDv2.h"
+#include "AliITSBadChannelsSSDv2.h"
 #include "AliITSresponseSSD.h"
 #include "TArrayF.h"
 #include "TArrayI.h"
@@ -31,17 +31,17 @@ class AliITSCalibrationSSD : public AliITSCalibration {
 
     Float_t GetNoiseP(Int_t n) {return fNoise->GetNoiseP(fModule,n); }
     Float_t GetNoiseN(Int_t n) {return fNoise->GetNoiseN(fModule,n); }
-    void SetNoise( AliITSNoiseSSD* noise) {fNoise=noise;}
+    void SetNoise( AliITSNoiseSSDv2* noise) {fNoise=noise;}
 
     Float_t GetPedestalP(Int_t n) {return fPedestal->GetPedestalP(fModule,n); }
     Float_t GetPedestalN(Int_t n) {return fPedestal->GetPedestalN(fModule,n); }
-    void SetPedestal( AliITSPedestalSSD* pedestal) {fPedestal=pedestal;}
+    void SetPedestal( AliITSPedestalSSDv2* pedestal) {fPedestal=pedestal;}
 
     Float_t GetGainP(Int_t n) {return fGain->GetGainP(fModule,n); }
     Float_t GetGainN(Int_t n) {return fGain->GetGainN(fModule,n); }
     void SetGainP(Int_t n, Float_t value) {fGain->AddGainP(fModule,n,value);}
     void SetGainN(Int_t n, Float_t value) {fGain->AddGainN(fModule,n,value);}
-    void SetGain( AliITSGainSSD* gain) {fGain=gain;}
+    void SetGain( AliITSGainSSDv2* gain) {fGain=gain;}
 
     void   SetBad() {
       fIsBad = kTRUE;
@@ -58,7 +58,7 @@ class AliITSCalibrationSSD : public AliITSCalibration {
     Int_t ChipsPerModule() const{return fgkChipsPerModule;} // # chips/module
     Int_t ChannelsPerChip() const{ return fgkChannelsPerChip;}// #channels/chip
 
-    void SetBadChannels( AliITSBadChannelsSSD* badchannels) {
+    void SetBadChannels( AliITSBadChannelsSSDv2* badchannels) {
       fBadChannels=badchannels;}
     Char_t GetBadPChannel(Int_t n) {
       return fBadChannels->GetBadChannelP(fModule,n); }
@@ -127,10 +127,10 @@ protected:
     Int_t   fNPar;            // Number of detector param 
     Double_t *fDetPar;         //[fNPar] Array of parameters
 
-    AliITSNoiseSSD *fNoise;
-    AliITSPedestalSSD *fPedestal;
-    AliITSGainSSD *fGain;
-    AliITSBadChannelsSSD *fBadChannels;
+    AliITSNoiseSSDv2 *fNoise;
+    AliITSPedestalSSDv2 *fPedestal;
+    AliITSGainSSDv2 *fGain;
+    AliITSBadChannelsSSDv2 *fBadChannels;
 
     Bool_t   fIsBad;                         // module is dead or alive ?
     Bool_t   fIsChipBad[fgkChipsPerModule];  // chip is dead or alive ?
@@ -139,6 +139,6 @@ protected:
     AliITSCalibrationSSD(const AliITSCalibrationSSD &source); // copy constructor
     AliITSCalibrationSSD& operator=(const AliITSCalibrationSSD &source); // ass. op.
 
-    ClassDef(AliITSCalibrationSSD,3) //Response class for SSD
+    ClassDef(AliITSCalibrationSSD,4) //Response class for SSD
       };
 #endif
index 898e943..d2c6128 100644 (file)
 #include "AliITSDriftSpeedArraySDD.h"
 #include "AliITSDriftSpeedSDD.h"
 #include "AliITSCalibrationSSD.h"
+#include "AliITSNoiseSSDv2.h"
+#include "AliITSGainSSDv2.h"
+#include "AliITSBadChannelsSSDv2.h"
 #include "AliITSNoiseSSD.h"
 #include "AliITSGainSSD.h"
 #include "AliITSBadChannelsSSD.h"
-#include "AliITSPedestalSSD.h"
 #include "AliITSsegmentationSPD.h"
 #include "AliITSsegmentationSDD.h"
 #include "AliITSsegmentationSSD.h"
@@ -450,7 +452,6 @@ Bool_t AliITSDetTypeRec::GetCalibration() {
  
  //  AliCDBEntry *entrySSD = AliCDBManager::Instance()->Get("ITS/Calib/CalibSSD");
   AliCDBEntry *entryNoiseSSD = AliCDBManager::Instance()->Get("ITS/Calib/NoiseSSD");
-  AliCDBEntry *entryPedestalSSD = AliCDBManager::Instance()->Get("ITS/Calib/PedestalSSD");
   AliCDBEntry *entryGainSSD = AliCDBManager::Instance()->Get("ITS/Calib/GainSSD");
   AliCDBEntry *entryBadChannelsSSD = AliCDBManager::Instance()->Get("ITS/Calib/BadChannelsSSD");
   AliCDBEntry *entry2SPD = AliCDBManager::Instance()->Get("ITS/Calib/RespSPD");
@@ -462,7 +463,7 @@ Bool_t AliITSDetTypeRec::GetCalibration() {
   AliCDBEntry *mapTSDD = AliCDBManager::Instance()->Get("ITS/Calib/MapsTimeSDD");
 
   if(!entrySPD || !deadSPD || !entrySDD || !entryNoiseSSD || !entryGainSSD || 
-     !entryPedestalSSD || !entryBadChannelsSSD || 
+     !entryBadChannelsSSD || 
      !entry2SPD || !entry2SDD || !entry2SSD || !drSpSDD || !ddlMapSDD || !mapASDD || !mapTSDD ){
     AliFatal("Calibration object retrieval failed! ");
     return kFALSE;
@@ -504,21 +505,40 @@ Bool_t AliITSDetTypeRec::GetCalibration() {
   if(!cacheStatus)mapTSDD->SetObject(NULL);
   mapTSDD->SetOwner(kTRUE);
 
-  AliITSNoiseSSD *noiseSSD = (AliITSNoiseSSD *)entryNoiseSSD->GetObject();
+  TObject *emptyssd = 0; TString ssdobjectname = 0;
+  AliITSNoiseSSDv2 *noiseSSD = new AliITSNoiseSSDv2();  
+  emptyssd = (TObject *)entryNoiseSSD->GetObject();
+  ssdobjectname = emptyssd->GetName();
+  if(ssdobjectname=="TObjArray") {
+    TObjArray *noiseSSDOld = (TObjArray *)entryNoiseSSD->GetObject();
+    ReadOldSSDNoise(noiseSSDOld, noiseSSD);
+  }
+  else if(ssdobjectname=="AliITSNoiseSSDv2")
+    noiseSSD = (AliITSNoiseSSDv2 *)entryNoiseSSD->GetObject();
   if(!cacheStatus)entryNoiseSSD->SetObject(NULL);
   entryNoiseSSD->SetOwner(kTRUE);
 
-  AliITSPedestalSSD *pedestalSSD = 
-    (AliITSPedestalSSD*)entryPedestalSSD->GetObject();
-  if(!cacheStatus)entryPedestalSSD->SetObject(NULL);
-  entryPedestalSSD->SetOwner(kTRUE);
-
-  AliITSGainSSD *gainSSD = (AliITSGainSSD *)entryGainSSD->GetObject();
+  AliITSGainSSDv2 *gainSSD = new AliITSGainSSDv2();
+  emptyssd = (TObject *)entryGainSSD->GetObject();
+  ssdobjectname = emptyssd->GetName();
+  if(ssdobjectname=="Gain") {
+    TObjArray *gainSSDOld = (TObjArray *)entryGainSSD->GetObject();
+    ReadOldSSDGain(gainSSDOld, gainSSD);
+  }
+  else if(ssdobjectname=="AliITSGainSSDv2")
+    gainSSD = (AliITSGainSSDv2 *)entryGainSSD->GetObject();
   if(!cacheStatus)entryGainSSD->SetObject(NULL);
   entryGainSSD->SetOwner(kTRUE);
 
-  AliITSBadChannelsSSD *badchannelsSSD = 
-    (AliITSBadChannelsSSD*)entryBadChannelsSSD->GetObject();
+  AliITSBadChannelsSSDv2 *badChannelsSSD = new AliITSBadChannelsSSDv2();
+  emptyssd = (TObject *)entryBadChannelsSSD->GetObject();
+  ssdobjectname = emptyssd->GetName();
+  if(ssdobjectname=="TObjArray") {
+    TObjArray *badChannelsSSDOld = (TObjArray *)entryBadChannelsSSD->GetObject();
+    ReadOldSSDBadChannels(badChannelsSSDOld, badChannelsSSD);
+  }
+  else if(ssdobjectname=="AliITSBadChannelsSSDv2")
+    badChannelsSSD = (AliITSBadChannelsSSDv2*)entryBadChannelsSSD->GetObject();
   if(!cacheStatus)entryBadChannelsSSD->SetObject(NULL);
   entryBadChannelsSSD->SetOwner(kTRUE);
 
@@ -532,7 +552,6 @@ Bool_t AliITSDetTypeRec::GetCalibration() {
     delete deadSPD;
     delete entrySDD;
     delete entryNoiseSSD;
-    delete entryPedestalSSD;
     delete entryGainSSD;
     delete entryBadChannelsSSD;
     delete entry2SPD;
@@ -545,7 +564,7 @@ Bool_t AliITSDetTypeRec::GetCalibration() {
   }
 
   if ((!pSPD)||(!pSDD)||(!pSSD) || (!calSPD) || (!caldeadSPD) ||(!calSDD) || (!drSp) || (!ddlsdd)
-      || (!mapAn) || (!mapT) || (!noiseSSD)|| (!gainSSD)|| (!badchannelsSSD)) {
+      || (!mapAn) || (!mapT) || (!noiseSSD)|| (!gainSSD)|| (!badChannelsSSD)) {
     AliWarning("Can not get calibration from calibration database !");
     return kFALSE;
   }
@@ -592,9 +611,8 @@ Bool_t AliITSDetTypeRec::GetCalibration() {
 
   fSSDCalibration->SetResponse((AliITSresponse*)pSSD);
   fSSDCalibration->SetNoise(noiseSSD);
-  fSSDCalibration->SetPedestal(pedestalSSD);
   fSSDCalibration->SetGain(gainSSD);
-  fSSDCalibration->SetBadChannels(badchannelsSSD);
+  fSSDCalibration->SetBadChannels(badChannelsSSD);
   //fSSDCalibration->FillBadChipMap();
 
 
@@ -972,4 +990,76 @@ void AliITSDetTypeRec::DigitsToRecPoints(AliRawReader* rawReader,TTree *treeR,Op
   
 }
 
+//______________________________________________________________________
+void AliITSDetTypeRec::ReadOldSSDNoise(TObjArray *array, 
+                                      AliITSNoiseSSDv2 *noiseSSD) {
+  //Reads the old SSD calibration object and converts it to the new format
+  const Int_t fgkSSDSTRIPSPERMODULE = 1536;
+  const Int_t fgkSSDPSIDESTRIPSPERMODULE = 768;
+
+  Int_t fNMod = array->GetEntries();
+  cout<<"Converting old calibration object for noise..."<<endl;
+
+  //NOISE
+  Double_t noise = 0.0;
+  for (Int_t iModule = 0; iModule < fNMod; iModule++) {
+    AliITSNoiseSSD *noiseModule = (AliITSNoiseSSD*) (array->At(iModule));
+    for(Int_t iStrip = 0; iStrip < fgkSSDSTRIPSPERMODULE; iStrip++) {
+      noise = (iStrip < fgkSSDPSIDESTRIPSPERMODULE) ? noiseModule->GetNoiseP(iStrip) : noiseModule->GetNoiseN(1535 - iStrip);
+      if(iStrip < fgkSSDPSIDESTRIPSPERMODULE)
+       noiseSSD->AddNoiseP(iModule,iStrip,noise);
+      if(iStrip >= fgkSSDPSIDESTRIPSPERMODULE)
+       noiseSSD->AddNoiseN(iModule,1535 - iStrip,noise);
+    }//loop over strips
+  }//loop over modules      
+}
+
+//______________________________________________________________________
+void AliITSDetTypeRec::ReadOldSSDBadChannels(TObjArray *array, 
+                                            AliITSBadChannelsSSDv2 *badChannelsSSD) {
+  //Reads the old SSD calibration object and converts it to the new format
+  Int_t fNMod = array->GetEntries();
+  cout<<"Converting old calibration object for bad channels..."<<endl;
+  for (Int_t iModule = 0; iModule < fNMod; iModule++) {
+    //for (Int_t iModule = 0; iModule < 1; iModule++) {
+    AliITSBadChannelsSSD *bad = (AliITSBadChannelsSSD*) (array->At(iModule));
+    TArrayI arrayPSide = bad->GetBadPChannelsList();
+    for(Int_t iPCounter = 0; iPCounter < arrayPSide.GetSize(); iPCounter++) 
+      badChannelsSSD->AddBadChannelP(iModule,
+                                    iPCounter,
+                                    (Char_t)arrayPSide.At(iPCounter));
+        
+    TArrayI arrayNSide = bad->GetBadNChannelsList();
+    for(Int_t iNCounter = 0; iNCounter < arrayNSide.GetSize(); iNCounter++) 
+      badChannelsSSD->AddBadChannelN(iModule,
+                                    iNCounter,
+                                    (Char_t)arrayNSide.At(iNCounter));
+    
+  }//loop over modules      
+}
+
+//______________________________________________________________________
+void AliITSDetTypeRec::ReadOldSSDGain(TObjArray *array, 
+                                     AliITSGainSSDv2 *gainSSD) {
+  //Reads the old SSD calibration object and converts it to the new format
+
+  Int_t fNMod = array->GetEntries();
+  cout<<"Converting old calibration object for gain..."<<endl;
+
+  //GAIN
+  for (Int_t iModule = 0; iModule < fNMod; iModule++) {
+    AliITSGainSSD *gainModule = (AliITSGainSSD*) (array->At(iModule));
+    TArrayF arrayPSide = gainModule->GetGainP();
+    for(Int_t iPCounter = 0; iPCounter < arrayPSide.GetSize(); iPCounter++)
+      gainSSD->AddGainP(iModule,
+                       iPCounter,
+                       arrayPSide.At(iPCounter));
+    TArrayF arrayNSide = gainModule->GetGainN();
+    for(Int_t iNCounter = 0; iNCounter < arrayNSide.GetSize(); iNCounter++)
+      gainSSD->AddGainN(iModule,
+                       iNCounter,
+                       arrayNSide.At(iNCounter));
+  }//loop over modules 
+}
+
 
index b158856..593fc61 100644 (file)
@@ -31,7 +31,9 @@ class AliITSClusterFinder;
 class AliITSRawCluster;
 class AliITSRecPoint;
 class AliRawReader;
-
+class AliITSGainSSDv2;
+class AliITSBadChannelsSSDv2;
+class AliITSNoiseSSDv2;
 
 class AliITSDetTypeRec : public TObject {
   public:
@@ -101,6 +103,14 @@ class AliITSDetTypeRec : public TObject {
     AliITSDetTypeRec(const AliITSDetTypeRec& rec);
     AliITSDetTypeRec& operator=(const AliITSDetTypeRec &source);
  
+    //conversion of the old SSD calibration objects tothe new ones
+    void ReadOldSSDNoise(TObjArray *array, 
+                        AliITSNoiseSSDv2 *noiseSSD);
+    void ReadOldSSDBadChannels(TObjArray *array, 
+                              AliITSBadChannelsSSDv2 *badChannelsSSD);
+    void ReadOldSSDGain(TObjArray *array, 
+                       AliITSGainSSDv2 *gainSSD);
+
     //    virtual void SetLoader(AliITSLoader* loader) {fLoader=loader;}
     static const Int_t fgkNdettypes;          // number of det. types
     static const Int_t fgkDefaultNModulesSPD; // Total numbers of SPD modules by default
index 75186f8..38bb621 100644 (file)
@@ -47,6 +47,9 @@
 #include "AliITSDriftSpeedArraySDD.h"
 #include "AliITSDriftSpeedSDD.h"
 #include "AliITSCalibrationSSD.h"
+#include "AliITSNoiseSSDv2.h"
+#include "AliITSGainSSDv2.h"
+#include "AliITSBadChannelsSSDv2.h"
 #include "AliITSNoiseSSD.h"
 #include "AliITSGainSSD.h"
 #include "AliITSBadChannelsSSD.h"
@@ -487,19 +490,56 @@ Bool_t AliITSDetTypeSim::GetCalibration() {
   entrySSD->SetOwner(kTRUE);
   */
 
-  AliITSNoiseSSD *noiseSSD = (AliITSNoiseSSD *)entryNoiseSSD->GetObject();
+  TObject *emptyssd = 0; TString ssdobjectname = 0;
+  AliITSNoiseSSDv2 *noiseSSD = new AliITSNoiseSSDv2();  
+  emptyssd = (TObject *)entryNoiseSSD->GetObject();
+  ssdobjectname = emptyssd->GetName();
+  if(ssdobjectname=="TObjArray") {
+    TObjArray *noiseSSDOld = (TObjArray *)entryNoiseSSD->GetObject();
+    ReadOldSSDNoise(noiseSSDOld, noiseSSD);
+  }
+  else if(ssdobjectname=="AliITSNoiseSSDv2")
+    noiseSSD = (AliITSNoiseSSDv2 *)entryNoiseSSD->GetObject();
   if(!isCacheActive)entryNoiseSSD->SetObject(NULL);
   entryNoiseSSD->SetOwner(kTRUE);
 
-  AliITSGainSSD *gainSSD = (AliITSGainSSD *)entryGainSSD->GetObject();
+  AliITSGainSSDv2 *gainSSD = new AliITSGainSSDv2();
+  emptyssd = (TObject *)entryGainSSD->GetObject();
+  ssdobjectname = emptyssd->GetName();
+  if(ssdobjectname=="Gain") {
+    TObjArray *gainSSDOld = (TObjArray *)entryGainSSD->GetObject();
+    ReadOldSSDGain(gainSSDOld, gainSSD);
+  }
+  else if(ssdobjectname=="AliITSGainSSDv2")
+    gainSSD = (AliITSGainSSDv2 *)entryGainSSD->GetObject();
   if(!isCacheActive)entryGainSSD->SetObject(NULL);
   entryGainSSD->SetOwner(kTRUE);
 
-  AliITSBadChannelsSSD *badchannelsSSD = 
-    (AliITSBadChannelsSSD *)entryBadChannelsSSD->GetObject();
+  AliITSBadChannelsSSDv2 *badChannelsSSD = new AliITSBadChannelsSSDv2();
+  emptyssd = (TObject *)entryBadChannelsSSD->GetObject();
+  ssdobjectname = emptyssd->GetName();
+  if(ssdobjectname=="TObjArray") {
+    TObjArray *badChannelsSSDOld = (TObjArray *)entryBadChannelsSSD->GetObject();
+    ReadOldSSDBadChannels(badChannelsSSDOld, badChannelsSSD);
+  }
+  else if(ssdobjectname=="AliITSBadChannelsSSDv2")
+    badChannelsSSD = (AliITSBadChannelsSSDv2*)entryBadChannelsSSD->GetObject();
   if(!isCacheActive)entryBadChannelsSSD->SetObject(NULL);
   entryBadChannelsSSD->SetOwner(kTRUE);
 
+  /*AliITSNoiseSSDv2 *noiseSSD = (AliITSNoiseSSDv2 *)entryNoiseSSD->GetObject();
+  if(!isCacheActive)entryNoiseSSD->SetObject(NULL);
+  entryNoiseSSD->SetOwner(kTRUE);
+
+  AliITSGainSSDv2 *gainSSD = (AliITSGainSSDv2 *)entryGainSSD->GetObject();
+  if(!isCacheActive)entryGainSSD->SetObject(NULL);
+  entryGainSSD->SetOwner(kTRUE);
+
+  AliITSBadChannelsSSDv2 *badchannelsSSD = 
+    (AliITSBadChannelsSSDv2 *)entryBadChannelsSSD->GetObject();
+  if(!isCacheActive)entryBadChannelsSSD->SetObject(NULL);
+  entryBadChannelsSSD->SetOwner(kTRUE);*/
+
   AliITSresponseSSD *pSSD = (AliITSresponseSSD*)entry2SSD->GetObject();
   if(!isCacheActive)entry2SSD->SetObject(NULL);
   entry2SSD->SetOwner(kTRUE);
@@ -522,7 +562,7 @@ Bool_t AliITSDetTypeSim::GetCalibration() {
   AliCDBManager::Instance()->SetCacheFlag(origCacheStatus);
 
   if ((!pSPD)||(!pSSD) || (!calSPD) || (!calSDD) || (!drSp) || (!ddlsdd)
-      || (!mapAn) || (!mapT) || (!noiseSSD)|| (!gainSSD)|| (!badchannelsSSD)) {
+      || (!mapAn) || (!mapT) || (!noiseSSD)|| (!gainSSD)|| (!badChannelsSSD)) {
     AliWarning("Can not get calibration from calibration database !");
     return kFALSE;
   }
@@ -578,7 +618,7 @@ Bool_t AliITSDetTypeSim::GetCalibration() {
   fSSDCalibration->SetResponse((AliITSresponse*)pSSD);
   fSSDCalibration->SetNoise(noiseSSD);
   fSSDCalibration->SetGain(gainSSD);
-  fSSDCalibration->SetBadChannels(badchannelsSSD);
+  fSSDCalibration->SetBadChannels(badChannelsSSD);
   //fSSDCalibration->FillBadChipMap();
 
 
@@ -873,4 +913,75 @@ void AliITSDetTypeSim::StoreCalibration(Int_t firstRun, Int_t lastRun,
   AliCDBManager::Instance()->Put(&respSSD, idRespSSD, &md);
 }
 
+//______________________________________________________________________
+void AliITSDetTypeSim::ReadOldSSDNoise(TObjArray *array, 
+                                      AliITSNoiseSSDv2 *noiseSSD) {
+  //Reads the old SSD calibration object and converts it to the new format
+  const Int_t fgkSSDSTRIPSPERMODULE = 1536;
+  const Int_t fgkSSDPSIDESTRIPSPERMODULE = 768;
+
+  Int_t fNMod = array->GetEntries();
+  cout<<"Converting old calibration object for noise..."<<endl;
+
+  //NOISE
+  Double_t noise = 0.0;
+  for (Int_t iModule = 0; iModule < fNMod; iModule++) {
+    AliITSNoiseSSD *noiseModule = (AliITSNoiseSSD*) (array->At(iModule));
+    for(Int_t iStrip = 0; iStrip < fgkSSDSTRIPSPERMODULE; iStrip++) {
+      noise = (iStrip < fgkSSDPSIDESTRIPSPERMODULE) ? noiseModule->GetNoiseP(iStrip) : noiseModule->GetNoiseN(1535 - iStrip);
+      if(iStrip < fgkSSDPSIDESTRIPSPERMODULE)
+       noiseSSD->AddNoiseP(iModule,iStrip,noise);
+      if(iStrip >= fgkSSDPSIDESTRIPSPERMODULE)
+       noiseSSD->AddNoiseN(iModule,1535 - iStrip,noise);
+    }//loop over strips
+  }//loop over modules      
+}
+
+//______________________________________________________________________
+void AliITSDetTypeSim::ReadOldSSDBadChannels(TObjArray *array, 
+                                            AliITSBadChannelsSSDv2 *badChannelsSSD) {
+  //Reads the old SSD calibration object and converts it to the new format
+  Int_t fNMod = array->GetEntries();
+  cout<<"Converting old calibration object for bad channels..."<<endl;
+  for (Int_t iModule = 0; iModule < fNMod; iModule++) {
+    //for (Int_t iModule = 0; iModule < 1; iModule++) {
+    AliITSBadChannelsSSD *bad = (AliITSBadChannelsSSD*) (array->At(iModule));
+    TArrayI arrayPSide = bad->GetBadPChannelsList();
+    for(Int_t iPCounter = 0; iPCounter < arrayPSide.GetSize(); iPCounter++) 
+      badChannelsSSD->AddBadChannelP(iModule,
+                                    iPCounter,
+                                    (Char_t)arrayPSide.At(iPCounter));
+        
+    TArrayI arrayNSide = bad->GetBadNChannelsList();
+    for(Int_t iNCounter = 0; iNCounter < arrayNSide.GetSize(); iNCounter++) 
+      badChannelsSSD->AddBadChannelN(iModule,
+                                    iNCounter,
+                                    (Char_t)arrayNSide.At(iNCounter));
+    
+  }//loop over modules      
+}
+
+//______________________________________________________________________
+void AliITSDetTypeSim::ReadOldSSDGain(TObjArray *array, 
+                                     AliITSGainSSDv2 *gainSSD) {
+  //Reads the old SSD calibration object and converts it to the new format
+
+  Int_t fNMod = array->GetEntries();
+  cout<<"Converting old calibration object for gain..."<<endl;
+
+  //GAIN
+  for (Int_t iModule = 0; iModule < fNMod; iModule++) {
+    AliITSGainSSD *gainModule = (AliITSGainSSD*) (array->At(iModule));
+    TArrayF arrayPSide = gainModule->GetGainP();
+    for(Int_t iPCounter = 0; iPCounter < arrayPSide.GetSize(); iPCounter++)
+      gainSSD->AddGainP(iModule,
+                       iPCounter,
+                       arrayPSide.At(iPCounter));
+    TArrayF arrayNSide = gainModule->GetGainN();
+    for(Int_t iNCounter = 0; iNCounter < arrayNSide.GetSize(); iNCounter++)
+      gainSSD->AddGainN(iModule,
+                       iNCounter,
+                       arrayNSide.At(iNCounter));
+  }//loop over modules 
+}
 
index 446e947..d9285f9 100644 (file)
@@ -30,6 +30,9 @@ class AliITSsimulation;
 class AliITSsegmentation;
 class AliITSresponse;
 class AliITSCalibrationSSD;
+class AliITSGainSSDv2;
+class AliITSBadChannelsSSDv2;
+class AliITSNoiseSSDv2;
 
 class AliITSDetTypeSim : public TObject {
  public:
@@ -106,6 +109,15 @@ class AliITSDetTypeSim : public TObject {
     
  private:
     void SetDefaultSegmentation(Int_t idet);  // creates def segm.
+
+    //conversion of the old SSD calibration objects tothe new ones
+    void ReadOldSSDNoise(TObjArray *array, 
+                        AliITSNoiseSSDv2 *noiseSSD);
+    void ReadOldSSDBadChannels(TObjArray *array, 
+                              AliITSBadChannelsSSDv2 *badChannelsSSD);
+    void ReadOldSSDGain(TObjArray *array, 
+                       AliITSGainSSDv2 *gainSSD);
+
     static const Int_t fgkNdettypes;          // number of different det. types
     static const Int_t fgkDefaultNModulesSPD; // Total numbers of SPD modules by default
     static const Int_t fgkDefaultNModulesSDD; // Total numbers of SDD modules by default
index d7dbddb..aa850ad 100644 (file)
 
 
 #include "AliITSGainSSD.h"
-#include <cstring>
 
 //////////////////////////////////////////////////////
 // Author: Enrico Fragiacomo
 // Date: 23/08/2007
-// Modified: 08/07/2008
 //                                                  //
 //////////////////////////////////////////////////////
 
-//const Int_t AliITSGainSSD::fgkDefaultNModulesSSD = 1698;
-//const Int_t AliITSGainSSD::fgkDefaultNStripsSSD = 768;
-
 ClassImp(AliITSGainSSD)
-  
-//______________________________________________________________________
-  AliITSGainSSD::AliITSGainSSD() 
-{
-    // Default Constructor  
-    for(Int_t i=0; i<2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD; i++) 
-      fGain[i]=0;    
-}
 
 //______________________________________________________________________
-AliITSGainSSD::AliITSGainSSD(const AliITSGainSSD &source): 
-  TObject(source)
-{
-    // copy Constructor
-  memcpy(fGain,source.fGain,
-        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(UShort_t));
+AliITSGainSSD::AliITSGainSSD():
+fMod(0),
+fGainP(0),
+fGainN(0) {
+    // Default Constructor
 }
 
 //______________________________________________________________________
@@ -52,13 +38,3 @@ AliITSGainSSD::~AliITSGainSSD(){
 
 }
 
-//______________________________________________________________________
-AliITSGainSSD& AliITSGainSSD::operator=(const AliITSGainSSD &source) {
- // ass. op.
-    if (this == &source)return *this;
-
-    memcpy(fGain,source.fGain,
-        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(UShort_t));
-    
-    return *this;
-}
index ce685aa..9291347 100644 (file)
@@ -1,51 +1,45 @@
 #ifndef ALIITSGAINSSD_H
 #define ALIITSGAINSSD_H
  
+#include "TObjArray.h"
+#include "TArrayF.h"
+
 //////////////////////////////////////////////
 // Author: Enrico Fragiacomo
 // Date: 23/08/2007
-// Modified: 08/07/2008
 //                                          //
 //////////////////////////////////////////////
-#include "TObject.h"
-
 class AliITSGainSSD : public TObject {
 
  public:
 
     AliITSGainSSD();
     virtual ~AliITSGainSSD();
+
+    void SetNGainP(Int_t n) { fGainP.Set(n); }
+    void AddGainP(Int_t c, Float_t n) { fGainP.AddAt(n,c);}       
+    TArrayF GetGainP() const {return fGainP; }
+    Float_t GetGainP(Int_t n) {return fGainP.At(n); }
+    void SetNGainN(Int_t n) { fGainN.Set(n); }
+    void AddGainN(Int_t c, Float_t n) { fGainN.AddAt(n,c);}
+    TArrayF GetGainN() const {return fGainN; }
+    Float_t GetGainN(Int_t n) {return fGainN.At(n); }
+
+    void SetMod(UShort_t mod) {fMod = mod;}
+    UShort_t GetMod() { return fMod;}
+
+protected:
+
+  UShort_t fMod;       // module number (from 0 to 1535). Needed by the preprocessor to 
+                       //   extract the information from the Detector Algorithm
+  
+  TArrayF fGainP;           // Gain for P side channels
+  TArrayF fGainN;           // Gain for N side channels
+  
+ private:
     AliITSGainSSD(const AliITSGainSSD &source); // copy constructor
     AliITSGainSSD& operator=(const AliITSGainSSD &source); // ass. op.
 
-    void AddGainP(Int_t module, Int_t strip, Float_t value) { 
-      fGain[module*2*fgkDefaultNStripsSSD+strip] = (UShort_t) (1000.*value);
-    }       
-    Float_t GetGainP(Int_t module, Int_t strip) {
-      return ((Float_t) ( (Float_t) fGain[module*2*fgkDefaultNStripsSSD+strip] ) /1000.); 
-    }
-
-    void AddGainN(Int_t module, Int_t strip, Float_t value) { 
-      fGain[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip] = 
-       (UShort_t) (1000.*value);
-    }       
-    Float_t GetGainN(Int_t module, Int_t strip) {
-      return ( (Float_t) ((Float_t) fGain[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip])/1000.); 
-    }
-
- protected:
-
-    static const Int_t fgkDefaultNModulesSSD = 1698;
-    static const Int_t fgkDefaultNStripsSSD = 768;
-
-    //static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules
-    //static const Int_t fgkDefaultNStripsSSD; // Total numbers of SSD modules
-
-    UShort_t fGain[2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD]; 
-    //   UShort_t *fGain; 
-
- private:
-    
-    ClassDef(AliITSGainSSD,2) // Gain  class for SSD
-      };
+    ClassDef(AliITSGainSSD,1) //Response class for SSD
+};
 #endif
diff --git a/ITS/AliITSGainSSDv2.cxx b/ITS/AliITSGainSSDv2.cxx
new file mode 100644 (file)
index 0000000..b24614e
--- /dev/null
@@ -0,0 +1,64 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                         *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+#include "AliITSGainSSDv2.h"
+#include <cstring>
+
+//////////////////////////////////////////////////////
+// Author: Enrico Fragiacomo
+// Date: 23/08/2007
+// Modified: 08/07/2008
+//                                                  //
+//////////////////////////////////////////////////////
+
+//const Int_t AliITSGainSSD::fgkDefaultNModulesSSD = 1698;
+//const Int_t AliITSGainSSD::fgkDefaultNStripsSSD = 768;
+
+ClassImp(AliITSGainSSDv2)
+  
+//______________________________________________________________________
+  AliITSGainSSDv2::AliITSGainSSDv2() 
+{
+    // Default Constructor  
+    for(Int_t i=0; i<2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD; i++) 
+      fGain[i]=0;    
+}
+
+//______________________________________________________________________
+AliITSGainSSDv2::AliITSGainSSDv2(const AliITSGainSSDv2 &source): 
+  TObject(source)
+{
+    // copy Constructor
+  memcpy(fGain,source.fGain,
+        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(UShort_t));
+}
+
+//______________________________________________________________________
+AliITSGainSSDv2::~AliITSGainSSDv2(){
+    // destructor
+
+}
+
+//______________________________________________________________________
+AliITSGainSSDv2& AliITSGainSSDv2::operator=(const AliITSGainSSDv2 &source) {
+ // ass. op.
+    if (this == &source)return *this;
+
+    memcpy(fGain,source.fGain,
+        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(UShort_t));
+    
+    return *this;
+}
diff --git a/ITS/AliITSGainSSDv2.h b/ITS/AliITSGainSSDv2.h
new file mode 100644 (file)
index 0000000..5711c4c
--- /dev/null
@@ -0,0 +1,51 @@
+#ifndef ALIITSGAINSSDV2_H
+#define ALIITSGAINSSDV2_H
+//////////////////////////////////////////////
+// Author: Enrico Fragiacomo
+// Date: 23/08/2007
+// Modified: 08/07/2008
+//                                          //
+//////////////////////////////////////////////
+#include "TObject.h"
+
+class AliITSGainSSDv2 : public TObject {
+
+ public:
+
+    AliITSGainSSDv2();
+    virtual ~AliITSGainSSDv2();
+    AliITSGainSSDv2(const AliITSGainSSDv2 &source); // copy constructor
+    AliITSGainSSDv2& operator=(const AliITSGainSSDv2 &source); // ass. op.
+
+    void AddGainP(Int_t module, Int_t strip, Float_t value) { 
+      fGain[module*2*fgkDefaultNStripsSSD+strip] = (UShort_t) (1000.*value);
+    }       
+    Float_t GetGainP(Int_t module, Int_t strip) {
+      return ((Float_t) ( (Float_t) fGain[module*2*fgkDefaultNStripsSSD+strip] ) /1000.); 
+    }
+
+    void AddGainN(Int_t module, Int_t strip, Float_t value) { 
+      fGain[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip] = 
+       (UShort_t) (1000.*value);
+    }       
+    Float_t GetGainN(Int_t module, Int_t strip) {
+      return ( (Float_t) ((Float_t) fGain[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip])/1000.); 
+    }
+
+ protected:
+
+    static const Int_t fgkDefaultNModulesSSD = 1698;
+    static const Int_t fgkDefaultNStripsSSD = 768;
+
+    //static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules
+    //static const Int_t fgkDefaultNStripsSSD; // Total numbers of SSD modules
+
+    UShort_t fGain[2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD]; 
+    //   UShort_t *fGain; 
+
+ private:
+    
+    ClassDef(AliITSGainSSDv2,1) // Gain  class for SSD
+      };
+#endif
index 07bc44c..2158800 100644 (file)
@@ -34,9 +34,9 @@
 #include "TFile.h"
 #include "TString.h"
 #include "AliLog.h"
-#include "AliITSNoiseSSD.h"
-#include "AliITSPedestalSSD.h"
-#include "AliITSBadChannelsSSD.h"
+#include "AliITSNoiseSSDv2.h"
+#include "AliITSPedestalSSDv2.h"
+#include "AliITSBadChannelsSSDv2.h"
 #include "AliITSRawStreamSSD.h"
 #include "AliRawReaderDate.h"
 #include "AliITSRawStreamSSD.h"
@@ -461,7 +461,7 @@ Bool_t AliITSHandleDaSSD::ReadStaticBadChannelsMap(const Char_t *filename)
     AliWarning(Form("Error reading file %s with Static Bad Channels Map!", filename));
     return kFALSE;
   }
-  bcfile->GetObject("AliITSBadChannelsSSD;1", fBadChannelsList);
+  bcfile->GetObject("AliITSBadChannelsSSDv2;1", fBadChannelsList);
   if (!fBadChannelsList) {
     AliWarning("Error fBadChannelsList == NULL!");
     bcfile->Close();
@@ -902,16 +902,16 @@ Short_t AliITSHandleDaSSD::RetrieveModuleId(const UChar_t ddlID, const UChar_t a
 
 
 //______________________________________________________________________________
-AliITSNoiseSSD* AliITSHandleDaSSD::GetCalibrationOCDBNoise() const
+AliITSNoiseSSDv2* AliITSHandleDaSSD::GetCalibrationOCDBNoise() const
 {
 // Fill in the array for OCDB 
-  AliITSNoiseSSD         *ldcn = NULL;
+  AliITSNoiseSSDv2         *ldcn = NULL;
   AliITSModuleDaSSD      *module = NULL;
   AliITSChannelDaSSD     *strip = NULL; 
   if (!fModules) return NULL;
-  ldcn = new AliITSNoiseSSD;
+  ldcn = new AliITSNoiseSSDv2;
   if (!ldcn) {
-    AliError("Error allocation mamory for AliITSBadChannelsSSD object, return NULL!");
+    AliError("Error allocation mamory for AliITSBadChannelsSSDv2 object, return NULL!");
     return NULL;
   }
   for (Int_t i = 0; i < fNumberOfModules; i++) {
@@ -931,16 +931,16 @@ AliITSNoiseSSD* AliITSHandleDaSSD::GetCalibrationOCDBNoise() const
 
 
 //______________________________________________________________________________
-AliITSBadChannelsSSD* AliITSHandleDaSSD::GetCalibrationBadChannels() const
+AliITSBadChannelsSSDv2* AliITSHandleDaSSD::GetCalibrationBadChannels() const
 {
 // Fill in the TObjArray with the list of bad channels 
-  AliITSBadChannelsSSD   *ldcbc = NULL;
+  AliITSBadChannelsSSDv2   *ldcbc = NULL;
   AliITSModuleDaSSD      *module = NULL;
   AliITSChannelDaSSD     *strip = NULL; 
   if (!fModules) return NULL;
-  ldcbc = new AliITSBadChannelsSSD;
+  ldcbc = new AliITSBadChannelsSSDv2;
   if (!ldcbc) {
-    AliError("Error allocation mamory for AliITSBadChannelsSSD object, return NULL!");
+    AliError("Error allocation mamory for AliITSBadChannelsSSDv2 object, return NULL!");
     return NULL;
   }
   for (Int_t i = 0; i < fNumberOfModules; i++) {
@@ -965,17 +965,17 @@ AliITSBadChannelsSSD* AliITSHandleDaSSD::GetCalibrationBadChannels() const
 Bool_t AliITSHandleDaSSD::SaveCalibrationSSDLDC(Char_t*& dafname)
 {
 // Save Calibration data locally
-  AliITSBadChannelsSSD   *ldcbc = NULL;
-  AliITSPedestalSSD      *ldcp = NULL;
-  AliITSNoiseSSD         *ldcn = NULL;
+  AliITSBadChannelsSSDv2   *ldcbc = NULL;
+  AliITSPedestalSSDv2      *ldcp = NULL;
+  AliITSNoiseSSDv2         *ldcn = NULL;
   AliITSModuleDaSSD      *module = NULL;
   AliITSChannelDaSSD     *strip = NULL; 
   Char_t         *tmpfname;
   TString         dadatafilename("");
   if (!fModules) return kFALSE;
-  ldcn = new AliITSNoiseSSD;
-  ldcp = new AliITSPedestalSSD;
-  ldcbc = new AliITSBadChannelsSSD;
+  ldcn = new AliITSNoiseSSDv2;
+  ldcp = new AliITSPedestalSSDv2;
+  ldcbc = new AliITSBadChannelsSSDv2;
   if ((!ldcn) || (!ldcp) || (!ldcp)) {
     AliError("Error allocation mamory for calibration objects, return kFALSE!");
     return kFALSE;
@@ -1030,7 +1030,7 @@ Bool_t AliITSHandleDaSSD::SaveCalibrationSSDLDC(Char_t*& dafname)
 
 
 //______________________________________________________________________________
-Int_t AliITSHandleDaSSD::MergeBadChannels(AliITSBadChannelsSSD*&  bcl) const
+Int_t AliITSHandleDaSSD::MergeBadChannels(AliITSBadChannelsSSDv2*&  bcl) const
 {
 // Merges the statick bad channels list with bad channels got upon calibration
   AliITSModuleDaSSD     *module = 0;
index 49aac46..3786757 100644 (file)
@@ -10,6 +10,8 @@
 #include "TObject.h"
 #include "TArrayS.h"
 #include "AliITSModuleDaSSD.h"
+#include "AliITSBadChannelsSSDv2.h"
+#include "AliITSNoiseSSDv2.h"
 
 ///////////////////////////////////////////////////////////////////////////////
 ///
@@ -64,10 +66,10 @@ class AliITSHandleDaSSD : public TObject {
                                {if ((fModules) && (index < fNumberOfModules)) return fModules[index]; else return NULL;}
     Int_t GetModuleIndex (const UChar_t ddlID, const UChar_t ad, const UChar_t adc) const;
     AliITSChannelDaSSD*    GetStrip (const UChar_t ddlID, const UChar_t ad, const UChar_t adc, const UShort_t stripID) const;
-    AliITSNoiseSSD*        GetCalibrationOCDBNoise()  const;
-    AliITSBadChannelsSSD*  GetCalibrationBadChannels() const;
+    AliITSNoiseSSDv2*        GetCalibrationOCDBNoise()  const;
+    AliITSBadChannelsSSDv2*  GetCalibrationBadChannels() const;
     Bool_t      SaveCalibrationSSDLDC(Char_t*& dafname);
-    Int_t       MergeBadChannels(AliITSBadChannelsSSD*& bcl) const;    
+    Int_t       MergeBadChannels(AliITSBadChannelsSSDv2*& bcl) const;    
     
     void    SetModIndProcessed(Int_t mi) {fModIndProcessed = mi;}
     void    SetModIndRead (Int_t mr)  {fModIndRead = mr;}
@@ -137,7 +139,7 @@ class AliITSHandleDaSSD : public TObject {
     TArrayS               fEqIndex;               //! index array of equipmnts (DDLs).
     Long_t                fNumberOfEvents;        // Number of physics or calibration events in raw data file fRawDataFileName
 
-    AliITSBadChannelsSSD *fBadChannelsList;       //! List of bad channels: static or created on base of calculated noise and pedestal
+    AliITSBadChannelsSSDv2 *fBadChannelsList;       //! List of bad channels: static or created on base of calculated noise and pedestal
     Int_t                *fDDLModuleMap;          //! DDL map  
     TArrayS               fALaddersOff;           //! Lisst of ladders of side A that are off and should be suppressed
     TArrayS               fCLaddersOff;           //! Lisst of ladders of side C that are off and should be suppressed
@@ -158,7 +160,7 @@ class AliITSHandleDaSSD : public TObject {
                                                                      (signal <= AliITSChannelDaSSD::GetUnderflowConst())); }
     string   ConvBase(const unsigned long value, const long base) const;
 
-    ClassDef(AliITSHandleDaSSD, 6)
+    ClassDef(AliITSHandleDaSSD, 7)
 
 };
 
index 3d77352..896c4ff 100644 (file)
 
 
 #include "AliITSNoiseSSD.h"
-#include <cstring>
 
 //////////////////////////////////////////////////////
 // Author: Enrico Fragiacomo
 // Date: 23/08/2007
-// Modified: 08/07/2008
 //                                                  //
 //////////////////////////////////////////////////////
 
-//const Int_t AliITSNoiseSSD::fgkDefaultNModulesSSD = 1698;
-//const Int_t AliITSNoiseSSD::fgkDefaultNStripsSSD = 768;
-
 ClassImp(AliITSNoiseSSD)
-  
+
 //______________________________________________________________________
-  AliITSNoiseSSD::AliITSNoiseSSD() {
-  // Default Constructor
-  for(Int_t i=0; i<2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD; i++) 
-    fNois[i]=0;    
+AliITSNoiseSSD::AliITSNoiseSSD():
+fMod(0),
+fNoisP(0),
+fNoisN(0) {
+    // Default Constructor
 }
 
 //______________________________________________________________________
-AliITSNoiseSSD::AliITSNoiseSSD(const AliITSNoiseSSD &source): 
-  TObject(source)  
-{
+AliITSNoiseSSD::AliITSNoiseSSD(const AliITSNoiseSSD &source): TObject(source),
+fMod(source.fMod),
+fNoisP(source.fNoisP),
+fNoisN(source.fNoisN) {
     // copy Constructor
-  memcpy(fNois,source.fNois,
-        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(Float_t));
 }
-
 //______________________________________________________________________
 AliITSNoiseSSD::~AliITSNoiseSSD(){
     // destructor
@@ -56,9 +50,8 @@ AliITSNoiseSSD& AliITSNoiseSSD::operator=(const AliITSNoiseSSD &source) {
  // ass. op.
     if (this == &source)
       return *this;
-
-    memcpy(fNois,source.fNois,
-        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(Float_t));
-    
+    fMod = source.fMod;
+    fNoisP =  source.fMod;
+    fNoisN =  source.fMod;
     return *this;
 }
index a6b1c64..e389cf1 100644 (file)
@@ -1,14 +1,14 @@
 #ifndef ALIITSNOISESSD_H
 #define ALIITSNOISESSD_H
  
+#include "TObjArray.h"
+#include "TArrayF.h"
+
 //////////////////////////////////////////////
 // Author: Enrico Fragiacomo
 // Date: 23/08/2007
-// Modified: 08/07/2008
 //                                          //
 //////////////////////////////////////////////
-#include "TObject.h"
-
 class AliITSNoiseSSD : public TObject {
 
  public:
@@ -18,33 +18,28 @@ class AliITSNoiseSSD : public TObject {
     AliITSNoiseSSD(const AliITSNoiseSSD &source); // copy constructor
     AliITSNoiseSSD& operator=(const AliITSNoiseSSD &source); // ass. op.
 
-    void AddNoiseP(Int_t module, Int_t strip, Float_t value) { 
-      fNois[module*2*fgkDefaultNStripsSSD+strip] = value;
-    }       
-    Float_t GetNoiseP(Int_t module, Int_t strip) {
-      return fNois[module*2*fgkDefaultNStripsSSD+strip]; 
-    }
-
-    void AddNoiseN(Int_t module, Int_t strip, Float_t value) { 
-      fNois[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip] = value;
-    }       
-    Float_t GetNoiseN(Int_t module, Int_t strip) {
-      return fNois[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip]; 
-    }
-
- protected:
-
-    static const Int_t fgkDefaultNModulesSSD = 1698;
-    static const Int_t fgkDefaultNStripsSSD = 768;
-
-    //   static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules
-    //static const Int_t fgkDefaultNStripsSSD; // Total numbers of SSD modules
-
-     Float_t fNois[2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD]; 
-     //Float_t *fNois;
-
+    void SetNNoiseP(Int_t n) { fNoisP.Set(n); }
+    void AddNoiseP(Int_t c, Float_t n) { fNoisP.AddAt(n,c);}       
+    TArrayF GetNoiseP() const {return fNoisP; }
+    Float_t GetNoiseP(Int_t n) {return fNoisP.At(n); }
+    void SetNNoiseN(Int_t n) { fNoisN.Set(n); }
+    void AddNoiseN(Int_t c, Float_t n) { fNoisN.AddAt(n,c);}
+    TArrayF GetNoiseN() const {return fNoisN; }
+    Float_t GetNoiseN(Int_t n) {return fNoisN.At(n); }
+
+    void SetMod(UShort_t mod) {fMod = mod;}
+    UShort_t GetMod() { return fMod;}
+
+protected:
+
+  UShort_t fMod;       // module number (from 0 to 1535). Needed by the preprocessor to 
+                       //   extract the information from the Detector Algorithm
+  
+  TArrayF fNoisP;           // Noise for P side channels
+  TArrayF fNoisN;           // Noise for N side channels
+  
  private:
-    
-    ClassDef(AliITSNoiseSSD,2) // Noise  class for SSD
-      };
+
+    ClassDef(AliITSNoiseSSD,1) // Noise  class for SSD
+};
 #endif
diff --git a/ITS/AliITSNoiseSSDv2.cxx b/ITS/AliITSNoiseSSDv2.cxx
new file mode 100644 (file)
index 0000000..b5d92ba
--- /dev/null
@@ -0,0 +1,64 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                         *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+#include "AliITSNoiseSSDv2.h"
+#include <cstring>
+
+//////////////////////////////////////////////////////
+// Author: Enrico Fragiacomo
+// Date: 23/08/2007
+// Modified: 08/07/2008
+//                                                  //
+//////////////////////////////////////////////////////
+
+//const Int_t AliITSNoiseSSD::fgkDefaultNModulesSSD = 1698;
+//const Int_t AliITSNoiseSSD::fgkDefaultNStripsSSD = 768;
+
+ClassImp(AliITSNoiseSSDv2)
+  
+//______________________________________________________________________
+  AliITSNoiseSSDv2::AliITSNoiseSSDv2() {
+  // Default Constructor
+  for(Int_t i=0; i<2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD; i++) 
+    fNois[i]=0;    
+}
+
+//______________________________________________________________________
+AliITSNoiseSSDv2::AliITSNoiseSSDv2(const AliITSNoiseSSDv2 &source): 
+  TObject(source)  
+{
+    // copy Constructor
+  memcpy(fNois,source.fNois,
+        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(Float_t));
+}
+
+//______________________________________________________________________
+AliITSNoiseSSDv2::~AliITSNoiseSSDv2(){
+    // destructor
+
+}
+
+//______________________________________________________________________
+AliITSNoiseSSDv2& AliITSNoiseSSDv2::operator=(const AliITSNoiseSSDv2 &source) {
+ // ass. op.
+    if (this == &source)
+      return *this;
+
+    memcpy(fNois,source.fNois,
+        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(Float_t));
+    
+    return *this;
+}
diff --git a/ITS/AliITSNoiseSSDv2.h b/ITS/AliITSNoiseSSDv2.h
new file mode 100644 (file)
index 0000000..3ddd232
--- /dev/null
@@ -0,0 +1,50 @@
+#ifndef ALIITSNOISESSDV2_H
+#define ALIITSNOISESSDV2_H
+//////////////////////////////////////////////
+// Author: Enrico Fragiacomo
+// Date: 23/08/2007
+// Modified: 08/07/2008
+//                                          //
+//////////////////////////////////////////////
+#include "TObject.h"
+
+class AliITSNoiseSSDv2 : public TObject {
+
+ public:
+
+    AliITSNoiseSSDv2();
+    virtual ~AliITSNoiseSSDv2();
+    AliITSNoiseSSDv2(const AliITSNoiseSSDv2 &source); // copy constructor
+    AliITSNoiseSSDv2& operator=(const AliITSNoiseSSDv2 &source); // ass. op.
+
+    void AddNoiseP(Int_t module, Int_t strip, Float_t value) { 
+      fNois[module*2*fgkDefaultNStripsSSD+strip] = value;
+    }       
+    Float_t GetNoiseP(Int_t module, Int_t strip) {
+      return fNois[module*2*fgkDefaultNStripsSSD+strip]; 
+    }
+
+    void AddNoiseN(Int_t module, Int_t strip, Float_t value) { 
+      fNois[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip] = value;
+    }       
+    Float_t GetNoiseN(Int_t module, Int_t strip) {
+      return fNois[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip]; 
+    }
+
+ protected:
+
+    static const Int_t fgkDefaultNModulesSSD = 1698;
+    static const Int_t fgkDefaultNStripsSSD = 768;
+
+    //   static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules
+    //static const Int_t fgkDefaultNStripsSSD; // Total numbers of SSD modules
+
+     Float_t fNois[2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD]; 
+     //Float_t *fNois;
+
+ private:
+    
+    ClassDef(AliITSNoiseSSDv2,1) // Noise  class for SSD
+      };
+#endif
index 81ddd1c..1ba1ed6 100644 (file)
@@ -1,5 +1,5 @@
 /**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * Copyright(c) 2007-9, ALICE Experiment at CERN, All rights reserved. *
  *                                                                         *
  * Author: The ALICE Off-line Project.                                    *
  * Contributors are mentioned in the code where appropriate.              *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
+/* $Id$ */
 
 #include "AliITSPedestalSSD.h"
-#include <cstring>
 
 //////////////////////////////////////////////////////
 // Author: Enrico Fragiacomo
-// Date: 23/08/2007
-// Modified: 08/07/2008
+// Date: 12/12/2007
 //                                                  //
 //////////////////////////////////////////////////////
 
-//const Int_t AliITSPedestalSSD::fgkDefaultNModulesSSD = 1698;
-//const Int_t AliITSPedestalSSD::fgkDefaultNStripsSSD = 768;
-
 ClassImp(AliITSPedestalSSD)
-  
+
 //______________________________________________________________________
-  AliITSPedestalSSD::AliITSPedestalSSD()
+AliITSPedestalSSD::AliITSPedestalSSD():
+fMod(0),
+fPedP(0),
+fPedN(0) {
     // Default Constructor
-      //: fPedestal(new Float_t[2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD]) 
-{ 
-    for(Int_t i=0; i<2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD; i++) 
-      fPedestal[i]=0;    
-  }
+}
 
 //______________________________________________________________________
-AliITSPedestalSSD::AliITSPedestalSSD(const AliITSPedestalSSD &source): 
-  TObject(source)  
-                                   //,  fPedestal(new Float_t[2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD])
-{
+AliITSPedestalSSD::AliITSPedestalSSD(const AliITSPedestalSSD &source): TObject(source),
+fMod(source.fMod),
+fPedP(source.fPedP),
+fPedN(source.fPedN) {
     // copy Constructor
-  memcpy(fPedestal,source.fPedestal,
-        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(Float_t));
 }
-
 //______________________________________________________________________
 AliITSPedestalSSD::~AliITSPedestalSSD(){
     // destructor
@@ -57,10 +49,10 @@ AliITSPedestalSSD::~AliITSPedestalSSD(){
 //______________________________________________________________________
 AliITSPedestalSSD& AliITSPedestalSSD::operator=(const AliITSPedestalSSD &source) {
  // ass. op.
-    if (this == &source)return *this;
-
-    memcpy(fPedestal,source.fPedestal,
-        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(Float_t));
-    
+    if (this == &source)
+      return *this;
+    fMod = source.fMod;
+    fPedP =  source.fMod;
+    fPedN =  source.fMod;
     return *this;
 }
index 9c50e39..7afc2e7 100644 (file)
@@ -1,13 +1,16 @@
 #ifndef ALIITSPEDESTALSSD_H
 #define ALIITSPEDESTALSSD_H
  
+#include "TObjArray.h"
+#include "TArrayF.h"
+
 //////////////////////////////////////////////
 // Author: Enrico Fragiacomo
-// Date: 23/08/2007
-// Modified: 08/07/2008
+// Date: 12/12/2007
 //                                          //
 //////////////////////////////////////////////
-#include "TObject.h"
+
+/* $Id$ */
 
 class AliITSPedestalSSD : public TObject {
 
@@ -18,32 +21,28 @@ class AliITSPedestalSSD : public TObject {
     AliITSPedestalSSD(const AliITSPedestalSSD &source); // copy constructor
     AliITSPedestalSSD& operator=(const AliITSPedestalSSD &source); // ass. op.
 
-    void AddPedestalP(Int_t module, Int_t strip, Float_t value) { 
-      fPedestal[module*2*fgkDefaultNStripsSSD+strip] = value;
-    }       
-    Float_t GetPedestalP(Int_t module, Int_t strip) {
-      return fPedestal[module*2*fgkDefaultNStripsSSD+strip]; 
-    }
-
-    void AddPedestalN(Int_t module, Int_t strip, Float_t value) { 
-      fPedestal[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip] = value;
-    }       
-    Float_t GetPedestalN(Int_t module, Int_t strip) {
-      return fPedestal[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip]; 
-    }
-
- protected:
-
-    static const Int_t fgkDefaultNModulesSSD = 1698;
-    static const Int_t fgkDefaultNStripsSSD = 768;
-
-    //   static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules
-    //static const Int_t fgkDefaultNStripsSSD; // Total numbers of SSD modules
-
-Float_t fPedestal[2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD]; 
-
+    void SetNPedestalP(Int_t n) { fPedP.Set(n); }
+    void AddPedestalP(Int_t c, Float_t n) { fPedP.AddAt(n,c);}       
+    TArrayF GetPedestalP() const {return fPedP; }
+    Float_t GetPedestalP(Int_t n) {return fPedP.At(n); }
+    void SetNPedestalN(Int_t n) { fPedN.Set(n); }
+    void AddPedestalN(Int_t c, Float_t n) { fPedN.AddAt(n,c);}
+    TArrayF GetPedestalN() const {return fPedN; }
+    Float_t GetPedestalN(Int_t n) {return fPedN.At(n); }
+
+    void SetMod(UShort_t mod) {fMod = mod;}
+    UShort_t GetMod() { return fMod;}
+
+protected:
+
+  UShort_t fMod;       // module number (from 0 to 1535). Needed by the preprocessor to 
+                       //   extract the information from the Detector Algorithm
+  
+  TArrayF fPedP;           // Pedestal for P side channels
+  TArrayF fPedN;           // Pedestal for N side channels
+  
  private:
-    
-    ClassDef(AliITSPedestalSSD,2) // Pedestal  class for SSD
-      };
+
+    ClassDef(AliITSPedestalSSD,1) // Pedestal  class for SSD
+};
 #endif
diff --git a/ITS/AliITSPedestalSSDv2.cxx b/ITS/AliITSPedestalSSDv2.cxx
new file mode 100644 (file)
index 0000000..1961fc8
--- /dev/null
@@ -0,0 +1,66 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                         *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+
+#include "AliITSPedestalSSDv2.h"
+#include <cstring>
+
+//////////////////////////////////////////////////////
+// Author: Enrico Fragiacomo
+// Date: 23/08/2007
+// Modified: 08/07/2008
+//                                                  //
+//////////////////////////////////////////////////////
+
+//const Int_t AliITSPedestalSSD::fgkDefaultNModulesSSD = 1698;
+//const Int_t AliITSPedestalSSD::fgkDefaultNStripsSSD = 768;
+
+ClassImp(AliITSPedestalSSDv2)
+  
+//______________________________________________________________________
+  AliITSPedestalSSDv2::AliITSPedestalSSDv2()
+    // Default Constructor
+      //: fPedestal(new Float_t[2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD]) 
+{ 
+    for(Int_t i=0; i<2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD; i++) 
+      fPedestal[i]=0;    
+  }
+
+//______________________________________________________________________
+AliITSPedestalSSDv2::AliITSPedestalSSDv2(const AliITSPedestalSSDv2 &source): 
+  TObject(source)  
+                                   //,  fPedestal(new Float_t[2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD])
+{
+    // copy Constructor
+  memcpy(fPedestal,source.fPedestal,
+        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(Float_t));
+}
+
+//______________________________________________________________________
+AliITSPedestalSSDv2::~AliITSPedestalSSDv2(){
+    // destructor
+
+}
+
+//______________________________________________________________________
+AliITSPedestalSSDv2& AliITSPedestalSSDv2::operator=(const AliITSPedestalSSDv2 &source) {
+ // ass. op.
+    if (this == &source)return *this;
+
+    memcpy(fPedestal,source.fPedestal,
+        2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD*sizeof(Float_t));
+    
+    return *this;
+}
diff --git a/ITS/AliITSPedestalSSDv2.h b/ITS/AliITSPedestalSSDv2.h
new file mode 100644 (file)
index 0000000..7fcf0fe
--- /dev/null
@@ -0,0 +1,49 @@
+#ifndef ALIITSPEDESTALSSDV2_H
+#define ALIITSPEDESTALSSDV2_H
+//////////////////////////////////////////////
+// Author: Enrico Fragiacomo
+// Date: 23/08/2007
+// Modified: 08/07/2008
+//                                          //
+//////////////////////////////////////////////
+#include "TObject.h"
+
+class AliITSPedestalSSDv2 : public TObject {
+
+ public:
+
+    AliITSPedestalSSDv2();
+    virtual ~AliITSPedestalSSDv2();
+    AliITSPedestalSSDv2(const AliITSPedestalSSDv2 &source); // copy constructor
+    AliITSPedestalSSDv2& operator=(const AliITSPedestalSSDv2 &source); // ass. op.
+
+    void AddPedestalP(Int_t module, Int_t strip, Float_t value) { 
+      fPedestal[module*2*fgkDefaultNStripsSSD+strip] = value;
+    }       
+    Float_t GetPedestalP(Int_t module, Int_t strip) {
+      return fPedestal[module*2*fgkDefaultNStripsSSD+strip]; 
+    }
+
+    void AddPedestalN(Int_t module, Int_t strip, Float_t value) { 
+      fPedestal[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip] = value;
+    }       
+    Float_t GetPedestalN(Int_t module, Int_t strip) {
+      return fPedestal[module*2*fgkDefaultNStripsSSD+fgkDefaultNStripsSSD+strip]; 
+    }
+
+ protected:
+
+    static const Int_t fgkDefaultNModulesSSD = 1698;
+    static const Int_t fgkDefaultNStripsSSD = 768;
+
+    //   static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules
+    //static const Int_t fgkDefaultNStripsSSD; // Total numbers of SSD modules
+
+Float_t fPedestal[2*fgkDefaultNModulesSSD*fgkDefaultNStripsSSD]; 
+
+ private:
+    
+    ClassDef(AliITSPedestalSSDv2,1) // Pedestal  class for SSD
+      };
+#endif
index fd579f2..57e5c43 100644 (file)
@@ -8,9 +8,9 @@
 #include <TObjString.h>
 
 #include "AliITSRawStreamSSD.h"
-#include "AliITSNoiseSSD.h"
-#include "AliITSPedestalSSD.h"
-#include "AliITSBadChannelsSSD.h"
+#include "AliITSNoiseSSDv2.h"
+#include "AliITSPedestalSSDv2.h"
+#include "AliITSBadChannelsSSDv2.h"
 #include <Riostream.h>
 
 
@@ -65,9 +65,9 @@ UInt_t AliITSPreprocessorSSD::Process(TMap* /*dcsAliasMap*/)
   
   //---------------------------------------
   // initialize the calibration objects
-  AliITSNoiseSSD *calib = new AliITSNoiseSSD();
-  AliITSBadChannelsSSD *badch = new AliITSBadChannelsSSD();
-  AliITSPedestalSSD *pedel = new AliITSPedestalSSD();
+  AliITSNoiseSSDv2 *calib = new AliITSNoiseSSDv2();
+  AliITSBadChannelsSSDv2 *badch = new AliITSBadChannelsSSDv2();
+  AliITSPedestalSSDv2 *pedel = new AliITSPedestalSSDv2();
   
   TString runType = GetRunType();
   if(runType == "ELECTRONICS_CALIBRATION_RUN") {
@@ -102,22 +102,22 @@ UInt_t AliITSPreprocessorSSD::Process(TMap* /*dcsAliasMap*/)
                return 2;
            }
            
-           AliITSNoiseSSD *cal; 
-           f->GetObject("AliITSNoiseSSD;1", cal); 
+           AliITSNoiseSSDv2 *cal; 
+           f->GetObject("AliITSNoiseSSDv2;1", cal); 
            if(!cal) {
                Log("File does not contain expected data for the noise!");
                delete list;
                return 3;
            }       
-           AliITSPedestalSSD *ped;
-           f->GetObject("AliITSPedestalSSD;1", ped); 
+           AliITSPedestalSSDv2 *ped;
+           f->GetObject("AliITSPedestalSSDv2;1", ped); 
            if(!ped) {
                Log("File does not contain expected data for the pedestals!");
                delete list;
                return 5;
            }       
-           AliITSBadChannelsSSD *bad;
-           f->GetObject("AliITSBadChannelsSSD;1", bad); 
+           AliITSBadChannelsSSDv2 *bad;
+           f->GetObject("AliITSBadChannelsSSDv2;1", bad); 
            if(!bad) {
                Log("File does not contain expected data for bad channels  !");
                delete list;
index 75f573e..ba909a9 100644 (file)
@@ -42,6 +42,7 @@
 #include "AliITSgeomTGeo.h"
 #include "AliRawEventHeaderBase.h"
 #include "AliITSRecPoint.h"
+#include "AliITSBadChannelsSSDv2.h"
 
 #include "AliCDBManager.h"
 #include "AliCDBEntry.h"
@@ -55,21 +56,23 @@ fSSDEvent(0),
 fSSDEventPerCycle(0),
 fkOnline(kMode),
 fLDC(ldc),
-fSSDRawsOffset(0),
+fSSDRawsOffset(0), fSSDRawsDAOffset(0),
 fSSDRawsCommonLevelOffset(0),
 fSSDhTask(0),
-fGenOffset(0) {
+fGenOffset(0),
+fCDBManager(0) {
   // Default constructor   
   //initilize the raw signal vs strip number histograms
   if(fkOnline) {
-    AliCDBManager * man = AliCDBManager::Instance();
-    man->SetDefaultStorage("local://$ALICE_ROOT");
+    fCDBManager = AliCDBManager::Instance();
+    //fCDBManager->SetDefaultStorage("local://$ALICE_ROOT");
+    fCDBManager->SetDefaultStorage(gSystem->Getenv("AMORE_CDB_URI"));
     Int_t runNumber = atoi(gSystem->Getenv("DATE_RUN_NUMBER"));
     if(!runNumber) 
       AliInfo("DATE_RUN_NUMBER not defined!!!\n");
     
-    man->SetRun(runNumber);
-    AliCDBEntry *geomGRP = man->Get("GRP/Geometry/Data");
+    fCDBManager->SetRun(runNumber);
+    AliCDBEntry *geomGRP = fCDBManager->Get("GRP/Geometry/Data");
     if(!geomGRP) AliInfo("GRP geometry not found!!!\n");
     
     Int_t gLayer = 0,gLadder = 0, gModule = 0;
@@ -92,6 +95,7 @@ fGenOffset(0) {
   else {
     for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++) 
       fHistSSDRawSignalModule[iModule]=NULL;
+    fCDBManager = NULL;
   }
 }
 
@@ -103,10 +107,11 @@ fSSDEvent(qadm.fSSDEvent),
 fSSDEventPerCycle(qadm.fSSDEventPerCycle),
 fkOnline(qadm.fkOnline),
 fLDC(qadm.fLDC),
-fSSDRawsOffset(qadm.fSSDRawsOffset),
+fSSDRawsOffset(qadm.fSSDRawsOffset), fSSDRawsDAOffset(qadm.fSSDRawsDAOffset),
 fSSDRawsCommonLevelOffset(qadm.fSSDRawsCommonLevelOffset),
 fSSDhTask(qadm.fSSDhTask),
-fGenOffset(qadm.fGenOffset) {
+fGenOffset(qadm.fGenOffset),
+fCDBManager(qadm.fCDBManager) {
   //copy ctor 
   fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ; 
   fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
@@ -126,6 +131,7 @@ AliITSQASSDDataMakerRec::~AliITSQASSDDataMakerRec() {
   // destructor
   for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++)
     if(fHistSSDRawSignalModule[iModule]) delete fHistSSDRawSignalModule[iModule];
+  if(fCDBManager) delete fCDBManager;
 }
 
 //____________________________________________________________________________ 
@@ -143,6 +149,9 @@ void AliITSQASSDDataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjAr
   
   //online part
   if(fkOnline) {
+    //Output of the DA
+    MonitorOCDBObjects();
+
     Int_t gHistPositionOccupancyPerModule = 0;
     Int_t gLayer = 0, gLadder = 0, gModule = 0;
     //occupancy per module
@@ -167,7 +176,7 @@ void AliITSQASSDDataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjAr
       gHistPositionOccupancyPerModule = (gLayer == 5) ? ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER5 + gModule - 1) : ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER6 + gModule + fgkSSDMODULESLAYER5 - 1);
       gHistPositionOccupancyPerLadder = (gLayer == 5) ? 2*(gLadder - 1) : 2*(gLadder - 1 + fgkSSDLADDERSLAYER5);
       
-      //P-SIDE OCCUPANCY                                                                                            
+      //P-SIDE OCCUPANCY                                                                     
       occupancy = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerModule),0);
       fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+fgkSSDMODULES+gHistPositionOccupancyPerLadder)->Fill(gModule,occupancy);
       lLadderLocationY = 3*gLadder; // sideP=1 sideN=0 
@@ -176,7 +185,7 @@ void AliITSQASSDDataMakerRec::EndOfDetectorCycle(AliQA::TASKINDEX_t task, TObjAr
       else if(gLayer == 6)
         ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1))->SetBinContent(gModule,lLadderLocationY,occupancy);
 
-      //N-SIDE OCCUPANCY                                                                                            
+      //N-SIDE OCCUPANCY                                                                           
       occupancy = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerModule),1);   
       fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+fgkSSDMODULES+gHistPositionOccupancyPerLadder+1)->Fill(gModule,occupancy);
       if(gLayer == 5)                                                               
@@ -359,6 +368,71 @@ void AliITSQASSDDataMakerRec::InitRaws() {
     }
     fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLayer6, fGenOffset+fSSDRawsOffset);
     fSSDRawsOffset += 1;
+
+    //Output of the DA
+    TH2D *fHistPSideBadChannelMapLayer5 = new TH2D("fHistPSideBadChannelMapLayer5",
+                                                  "Layer 5;N_{module};N_{ladder}",
+                                                  22,1,23,
+                                                  34,500,534);
+    fHistPSideBadChannelMapLayer5->GetXaxis()->SetTitleColor(1);
+    fHistPSideBadChannelMapLayer5->SetStats(kFALSE);
+    fHistPSideBadChannelMapLayer5->GetYaxis()->SetTitleOffset(1.8);
+    fHistPSideBadChannelMapLayer5->GetXaxis()->SetNdivisions(22);
+    fHistPSideBadChannelMapLayer5->GetYaxis()->SetNdivisions(34);
+    fHistPSideBadChannelMapLayer5->GetXaxis()->SetLabelSize(0.03);
+    fHistPSideBadChannelMapLayer5->GetYaxis()->SetLabelSize(0.03);
+    fHistPSideBadChannelMapLayer5->GetZaxis()->SetTitleOffset(1.6);
+    fHistPSideBadChannelMapLayer5->GetZaxis()->SetTitle("Bad channels (p-side)[%]");
+    fAliITSQADataMakerRec->Add2RawsList(fHistPSideBadChannelMapLayer5, fGenOffset+fSSDRawsOffset);
+    fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
+
+    TH2D *fHistNSideBadChannelMapLayer5 = new TH2D("fHistNSideBadChannelMapLayer5",
+                                                  "Layer 5;N_{module};N_{ladder}",
+                                                  22,1,23,
+                                                  34,500,534);
+    fHistNSideBadChannelMapLayer5->GetXaxis()->SetTitleColor(1);
+    fHistNSideBadChannelMapLayer5->SetStats(kFALSE);
+    fHistNSideBadChannelMapLayer5->GetYaxis()->SetTitleOffset(1.8);
+    fHistNSideBadChannelMapLayer5->GetXaxis()->SetNdivisions(22);
+    fHistNSideBadChannelMapLayer5->GetYaxis()->SetNdivisions(34);
+    fHistNSideBadChannelMapLayer5->GetXaxis()->SetLabelSize(0.03);
+    fHistNSideBadChannelMapLayer5->GetYaxis()->SetLabelSize(0.03);
+    fHistNSideBadChannelMapLayer5->GetZaxis()->SetTitleOffset(1.6);
+    fHistNSideBadChannelMapLayer5->GetZaxis()->SetTitle("Bad channels (n-side)[%]");
+    fAliITSQADataMakerRec->Add2RawsList(fHistNSideBadChannelMapLayer5, fGenOffset+fSSDRawsOffset);
+    fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
+
+    TH2D *fHistPSideBadChannelMapLayer6 = new TH2D("fHistPSideBadChannelMapLayer6",
+                                                  "Layer 6;N_{module};N_{ladder}",
+                                                  25,1,26,
+                                                  38,600,638);
+    fHistPSideBadChannelMapLayer6->GetXaxis()->SetTitleColor(1);
+    fHistPSideBadChannelMapLayer6->SetStats(kFALSE);
+    fHistPSideBadChannelMapLayer6->GetYaxis()->SetTitleOffset(1.8);
+    fHistPSideBadChannelMapLayer6->GetXaxis()->SetNdivisions(25);
+    fHistPSideBadChannelMapLayer6->GetYaxis()->SetNdivisions(38);
+    fHistPSideBadChannelMapLayer6->GetXaxis()->SetLabelSize(0.03);
+    fHistPSideBadChannelMapLayer6->GetYaxis()->SetLabelSize(0.03);
+    fHistPSideBadChannelMapLayer6->GetZaxis()->SetTitleOffset(1.6);
+    fHistPSideBadChannelMapLayer6->GetZaxis()->SetTitle("Bad channels (p-side)[%]");
+    fAliITSQADataMakerRec->Add2RawsList(fHistPSideBadChannelMapLayer6, fGenOffset+fSSDRawsOffset);
+    fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
+
+    TH2D *fHistNSideBadChannelMapLayer6 = new TH2D("fHistNSideBadChannelMapLayer6",
+                                                  "Layer 6;N_{module};N_{ladder}",
+                                                  25,1,26,
+                                                  38,600,638);
+    fHistNSideBadChannelMapLayer6->GetXaxis()->SetTitleColor(1);
+    fHistNSideBadChannelMapLayer6->SetStats(kFALSE);
+    fHistNSideBadChannelMapLayer6->GetYaxis()->SetTitleOffset(1.8);
+    fHistNSideBadChannelMapLayer6->GetXaxis()->SetNdivisions(25);
+    fHistNSideBadChannelMapLayer6->GetYaxis()->SetNdivisions(38);
+    fHistNSideBadChannelMapLayer6->GetXaxis()->SetLabelSize(0.03);
+    fHistNSideBadChannelMapLayer6->GetYaxis()->SetLabelSize(0.03);
+    fHistNSideBadChannelMapLayer6->GetZaxis()->SetTitleOffset(1.6);
+    fHistNSideBadChannelMapLayer6->GetZaxis()->SetTitle("Bad channels (n-side)[%]");
+    fAliITSQADataMakerRec->Add2RawsList(fHistNSideBadChannelMapLayer6, fGenOffset+fSSDRawsOffset);
+    fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
   }//online flag
   fSSDhTask = fSSDRawsOffset;
   AliDebug(1,Form("%d SSD Raws histograms booked\n",fSSDhTask));
@@ -441,7 +515,7 @@ void AliITSQASSDDataMakerRec::MakeRaws(AliRawReader* rawReader) {
 }
 
 //____________________________________________________________________________ //
-Double_t AliITSQASSDDataMakerRec::GetOccupancyStrip(TH1 *lHisto, Int_t *occupancyMatrix) { 
+void AliITSQASSDDataMakerRec::GetOccupancyStrip(TH1 *lHisto, Int_t *occupancyMatrix) { 
   //Increments the entries in the occupancy matrix based 
   //on whether the signal for each strip is larger than the cutoff
   //Currently the cutoff is at 0 which means that if ZS
@@ -474,6 +548,73 @@ Double_t AliITSQASSDDataMakerRec::GetOccupancyModule(TH1 *lHisto, Int_t stripsid
   return lOccupancy;
 }
 
+//____________________________________________________________________________
+void AliITSQASSDDataMakerRec::MonitorOCDBObjects() { 
+  //Monitor in AMORE the output of the DA
+  //Currently only the bad channel list is monitored
+  //Todo: Noise - Pedestal
+  AliCDBEntry *entryBadChannelsSSD = fCDBManager->Get("ITS/Calib/BadChannelsSSD");
+  if(!entryBadChannelsSSD) 
+    AliError("OCDB entry for the bad channel list is not valid!"); 
+  AliITSBadChannelsSSDv2 *badchannelsSSD = (AliITSBadChannelsSSDv2 *)entryBadChannelsSSD->GetObject();
+  if(!badchannelsSSD)
+    AliError("Bad channel list object is not a valid AliITSBadChannelsSSD object!");
+
+  //_____________________________________________________________________________//                       
+  Int_t nBadPSideChannels = 0, nBadNSideChannels = 0;
+  Int_t layer = 0, ladder = 0, module = 0;
+  Int_t nPSideChannelsLayer5 = 0, nNSideChannelsLayer5 = 0;
+  Int_t nPSideChannelsLayer6 = 0, nNSideChannelsLayer6 = 0;
+  //_____________________________________________________________________________//                      
+
+  for(Int_t i = 0; i < fgkSSDMODULES; i++) {
+    AliITSgeomTGeo::GetModuleId(i+500,layer,ladder,module);
+    nBadPSideChannels = 0, nBadNSideChannels = 0;
+    nPSideChannelsLayer5 = 0, nNSideChannelsLayer5 = 0;
+    nPSideChannelsLayer6 = 0, nNSideChannelsLayer6 = 0;
+
+    Int_t badChannel = 0;
+    for(Int_t j = 0; j < fgkNumberOfPSideStrips; j++) {
+      badChannel = (Int_t)(badchannelsSSD->GetBadChannelP(i,j));
+      if(badChannel != 0) {
+        if(layer == 5)
+          nPSideChannelsLayer5 += 1;
+        if(layer == 6)
+          nPSideChannelsLayer6 += 1;
+        nBadPSideChannels += 1;
+      }//badchannel flag != 0
+      badChannel = (Int_t)(badchannelsSSD->GetBadChannelN(i,j));
+      if(badChannel != 0) {
+        if(layer == 5)
+          nNSideChannelsLayer5 += 1;
+        if(layer == 6)
+          nNSideChannelsLayer6 += 1;
+        nBadNSideChannels += 1;
+      }//badchannel flag != 0
+    }//loop over strips
+    if(layer == 5) {
+      if(nPSideChannelsLayer5 > 0)
+       ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsOffset-fSSDRawsDAOffset))->Fill(module,499+ladder,
+                                                                           100.*nPSideChannelsLayer5/fgkNumberOfPSideStrips);
+      else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsOffset-fSSDRawsDAOffset))->Fill(module,499+ladder,0.0001);
+      if(nNSideChannelsLayer5 > 0)
+       ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsOffset-fSSDRawsDAOffset+1))->Fill(module,499+ladder,
+                                                                           100.*nNSideChannelsLayer5/fgkNumberOfPSideStrips);
+      else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsOffset-fSSDRawsDAOffset+1))->Fill(module,499+ladder,0.0001);
+    }//layer 5                                                                                                                      
+    if(layer == 6) {
+      if(nPSideChannelsLayer6 > 0)
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsOffset-fSSDRawsDAOffset+2))->Fill(module,599+ladder,
+                                                                           100.*nPSideChannelsLayer6/fgkNumberOfPSideStrips);
+      else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsOffset-fSSDRawsDAOffset+2))->Fill(module,599+ladder,0.0001);
+      if(nNSideChannelsLayer6 > 0)
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsOffset-fSSDRawsDAOffset+3))->Fill(module,599+ladder,
+                                                                           100.*nNSideChannelsLayer6/fgkNumberOfPSideStrips);
+      else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenOffset+fSSDRawsOffset-fSSDRawsDAOffset+3))->Fill(module,599+ladder,0.0001);
+    }//layer 6                                                                                                                      
+  }//module loop
+}
+
 //____________________________________________________________________________ 
 void AliITSQASSDDataMakerRec::InitRecPoints()
 {
index 45ba8bc..532a8f8 100644 (file)
 
 class TObjArray;
 class TH1D;
+
 class AliRawReader;
 class AliITSQADataMakerRec;
+class AliCDBManager;
 
 class AliITSQASSDDataMakerRec: public TObject {
 
@@ -40,9 +42,10 @@ public:
 
  private:
 
-  Double_t GetOccupancyStrip(TH1 *lHisto, Int_t *occupancyMatrix); 
+  void GetOccupancyStrip(TH1 *lHisto, Int_t *occupancyMatrix); 
   Double_t GetOccupancyModule(TH1 *lHisto, Int_t stripside); 
-  
+  void MonitorOCDBObjects();
+
   static const Int_t fgkNumOfLDCs = 3;      //number of SSD LDCs
   static const Int_t fgkNumOfDDLs = 16;      //number of SSD DDLs
   static const Int_t fgkSSDMODULES = 1698;      //total number of SSD modules
@@ -60,14 +63,16 @@ public:
   Bool_t  fkOnline;                             //online (1) or offline (0) use
   Int_t   fLDC;                                 //LDC number (0 for offline, 1 to 4 for online) 
   Int_t   fSSDRawsOffset;                       //SSD raw data plot offset
+  Int_t   fSSDRawsDAOffset;                     //SSD DA plot offset
   Int_t   fSSDRawsCommonLevelOffset;            //Raw data QA - top level offset - histos used both online and offline 
   Int_t   fSSDhTask;                            //number of histo booked for each SSD task
   Int_t   fGenOffset;                           //qachecking offset
   TH1D   *fHistSSDRawSignalModule[fgkSSDMODULES]; //raw signal vs strip number - SSD                   
   Int_t   fOccupancyMatrix[fgkSSDMODULES][2*fgkNumberOfPSideStrips]; //occupancy values per strip
 
-  ClassDef(AliITSQASSDDataMakerRec,3)           // description 
+  AliCDBManager *fCDBManager; //CDB manager
 
+  ClassDef(AliITSQASSDDataMakerRec,4)           // description 
 };
 
 #endif
index 05c3f11..baa442d 100644 (file)
Binary files a/ITS/Calib/BadChannelsSSD/Run0_999999999_v0_s0.root and b/ITS/Calib/BadChannelsSSD/Run0_999999999_v0_s0.root differ
index 42f0443..17f7c99 100644 (file)
Binary files a/ITS/Calib/GainSSD/Run0_999999999_v0_s0.root and b/ITS/Calib/GainSSD/Run0_999999999_v0_s0.root differ
index faad8bc..44a3b17 100644 (file)
Binary files a/ITS/Calib/NoiseSSD/Run0_999999999_v0_s0.root and b/ITS/Calib/NoiseSSD/Run0_999999999_v0_s0.root differ
index 0e5fb9c..f462d10 100644 (file)
 #pragma link C++ class  AliITSDriftSpeedArraySDD+;
 #pragma link C++ class  AliITSDDLModuleMapSDD+;
 #pragma link C++ class  AliITSBadChannelsSSD+;
+#pragma link C++ class  AliITSBadChannelsSSDv2+;
 #pragma link C++ class  AliITSGainSSD+;
+#pragma link C++ class  AliITSGainSSDv2+;
 #pragma link C++ class  AliITSNoiseSSD+;
+#pragma link C++ class  AliITSNoiseSSDv2+;
 #pragma link C++ class  AliITSHandleDaSSD+;
 #pragma link C++ class  AliITSModuleDaSSD+;
 #pragma link C++ class  AliITSChannelDaSSD+;
@@ -96,6 +99,7 @@
 #pragma link C++ class AliITSIntMap+;
 #pragma link C++ class AliITSIntMapNode+;
 #pragma link C++ class AliITSPedestalSSD+;
+#pragma link C++ class AliITSPedestalSSDv2+;
 #pragma link C++ class AliITSSurveyToAlignSSD+;
 
 #endif
index dd1e137..222d202 100644 (file)
@@ -38,8 +38,11 @@ SRCS =       AliITSgeom.cxx \
                AliITSDDLModuleMapSDD.cxx \
                AliITSDriftSpeedArraySDD.cxx \
                AliITSBadChannelsSSD.cxx \
+               AliITSBadChannelsSSDv2.cxx \
                AliITSGainSSD.cxx \
+               AliITSGainSSDv2.cxx \
                AliITSNoiseSSD.cxx \
+               AliITSNoiseSSDv2.cxx \
                AliITSChannelDaSSD.cxx \
                 AliITSModuleDaSSD.cxx \
                 AliITSHandleDaSSD.cxx \
@@ -64,6 +67,7 @@ SRCS =        AliITSgeom.cxx \
                 AliITSIntMap.cxx \
                AliITSIntMapNode.cxx \
                AliITSPedestalSSD.cxx \
+               AliITSPedestalSSDv2.cxx \
                AliITSSurveyToAlignSSD.cxx
 
 HDRS:=  $(SRCS:.cxx=.h)