Offsets are now handled properly for the lists corrsponding to different
authormasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Jul 2009 17:21:56 +0000 (17:21 +0000)
committermasera <masera@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 7 Jul 2009 17:21:56 +0000 (17:21 +0000)
event species.
Data are decoded with the new SDD raw data format.
In addition there is a new important feature (now for the online) that
allows the comparison of the latest calibration constants to the previous
set and the histograms for the long term monitoring of calibration
parameters.
AliITSQADataMakerRec also contains a new function to be used by the
forthcoming HLTITSQA module.

P.G. Cerello

ITS/AliITSQADataMakerRec.cxx
ITS/AliITSQADataMakerRec.h
ITS/AliITSQASDDDataMakerRec.cxx
ITS/AliITSQASDDDataMakerRec.h
ITS/AliITSQASPDDataMakerRec.cxx
ITS/AliITSQASPDDataMakerRec.h
ITS/AliITSQASSDDataMakerRec.cxx
ITS/AliITSQASSDDataMakerRec.h

index 3d2fb79..809f70b 100644 (file)
 #include "AliQAv1.h"
 #include "AliQAChecker.h"
 #include "AliITSQAChecker.h"
+#include "AliITSRecPoint.h"
 #include "AliRawReader.h"
 #include "AliESDEvent.h"
 #include "AliESDtrack.h"
 #include "AliESDVertex.h"
 #include "AliMultiplicity.h"
+#include "AliITSgeomTGeo.h"
 
 ClassImp(AliITSQADataMakerRec)
 
@@ -49,7 +51,6 @@ ClassImp(AliITSQADataMakerRec)
 AliITSQADataMakerRec::AliITSQADataMakerRec(Bool_t kMode, Short_t subDet, Short_t ldc) :
 AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kITS), "ITS Quality Assurance Data Maker"),
 fkOnline(kMode),
-fHLTMode(0),
 fSubDetector(subDet),
 fLDC(ldc),
 fSPDDataMaker(NULL),
@@ -69,7 +70,6 @@ fSSDDataMaker(NULL)
   if(fSubDetector == 0 || fSubDetector == 2) {
     AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SDD DataMakerRec\n");
        fSDDDataMaker = new AliITSQASDDDataMakerRec(this,fkOnline);
-       if(fkOnline){SetHLTMode(fSDDDataMaker->GetHLTMode()); }
   }
   if(fSubDetector == 0 || fSubDetector == 3) {
     AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Create SSD DataMakerRec\n");
@@ -89,7 +89,6 @@ AliITSQADataMakerRec::~AliITSQADataMakerRec(){
 AliITSQADataMakerRec::AliITSQADataMakerRec(const AliITSQADataMakerRec& qadm) :
 AliQADataMakerRec(),
 fkOnline(qadm.fkOnline),
-fHLTMode(qadm.fHLTMode),
 fSubDetector(qadm.fSubDetector),
 fLDC(qadm.fLDC),
 fSPDDataMaker(NULL),
@@ -162,18 +161,25 @@ void AliITSQADataMakerRec::EndOfDetectorCycle(const char * /*fgDataName*/)
 void AliITSQADataMakerRec::InitRaws()
 {  
 
-  // Initialization for RAW data 
+       if(fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()) return;
+       Int_t rv = 0;
+       //AliInfo(Form("Start InitRaws on specie %d\n",AliRecoParam::AConvert(fEventSpecie)));
+       //AliInfo(Form("fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries() %d\n",fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()));
        if(fSubDetector == 0 || fSubDetector == 1) {
          AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitRaws\n");
-         fSPDDataMaker->InitRaws();
+           rv = fSPDDataMaker->InitRaws();
        }
        if(fSubDetector == 0 || fSubDetector == 2) {
          AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitRaws\n");
-         fSDDDataMaker->InitRaws();
+               //AliInfo(Form("set offset to %d\n",fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()));
+      fSDDDataMaker->SetOffset(AliQAv1::kRAWS, fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie));
+           rv = fSDDDataMaker->InitRaws();
        }
        if(fSubDetector == 0 || fSubDetector == 3) {
          AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitRaws\n");
-         fSSDDataMaker->InitRaws();
+               //AliInfo(Form("set offset to %d\n",fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()));
+      fSSDDataMaker->SetOffset(AliQAv1::kRAWS, fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie));
+         rv = fSSDDataMaker->InitRaws();
        }
 }
 
@@ -183,19 +189,18 @@ void AliITSQADataMakerRec::MakeRaws(AliRawReader* rawReader)
   // Fill QA for RAW   
   //return ; 
 
+  //AliInfo(Form("fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries() %d\n",fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()));
   if(fSubDetector == 0 || fSubDetector == 1)  {
-    Int_t rv = fSPDDataMaker->MakeRaws(rawReader) ; 
-    if ( rv != 0 )
-      fSDDDataMaker->SetOffset(AliQAv1::kRAWS, fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
+    fSPDDataMaker->MakeRaws(rawReader) ; 
   }
+  //AliInfo(Form("fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries() %d\n",fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()));
   
   if(fSubDetector == 0 || fSubDetector == 2) {
-    Int_t rv = fSDDDataMaker->MakeRaws(rawReader) ; 
-    if ( rv != 0 )
-      fSSDDataMaker->SetOffset(AliQAv1::kRAWS, fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
+    fSDDDataMaker->MakeRaws(rawReader) ; 
   }
-
+  //AliInfo(Form("fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries() %d\n",fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()));
   if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeRaws(rawReader);
+  //AliInfo(Form("fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries() %d\n",fRawsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()));
 }
 
 //____________________________________________________________________________ 
@@ -242,18 +247,45 @@ void AliITSQADataMakerRec::InitRecPoints()
 {
 
   // Initialization for RECPOINTS
-  if(fSubDetector == 0 || fSubDetector == 1) {
-    AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitRecPoints\n");
-    fSPDDataMaker->InitRecPoints();
-  }
-  if(fSubDetector == 0 || fSubDetector == 2) {
-    AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitRecPoints\n");
-       fSDDDataMaker->InitRecPoints();
-  }
-  if(fSubDetector == 0 || fSubDetector == 3) {
-    AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitRecPoints\n");
-       fSSDDataMaker->InitRecPoints();
-  }
+
+  //AliInfo(Form("AliRecoParam::AConvert(fEventSpecie) %d\n",AliRecoParam::AConvert(fEventSpecie)));
+       //AliInfo(Form("fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries() %d\n",fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()));
+       if(fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()) return;
+       if(fSubDetector == 0 || fSubDetector == 1) {
+               AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SPD InitRecPoints\n");
+               fSPDDataMaker->InitRecPoints();
+       }
+       if(fSubDetector == 0 || fSubDetector == 2) {
+               AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SDD InitRecPoints\n");
+               //AliInfo(Form("set offset to %d\n",fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()));
+               fSDDDataMaker->SetOffset(AliQAv1::kRECPOINTS, fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie));
+               fSDDDataMaker->InitRecPoints();
+       }
+       if(fSubDetector == 0 || fSubDetector == 3) {
+               AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM:: SSD InitRecPoints\n");
+               //AliInfo(Form("set offset to %d\n",fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()));
+               fSSDDataMaker->SetOffset(AliQAv1::kRECPOINTS, fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries(),AliRecoParam::AConvert(fEventSpecie));
+               fSSDDataMaker->InitRecPoints();
+       }
+       //AliInfo(Form("fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries() %d\n",fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()));
+
+       Int_t offset = fRecPointsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries();
+       const Bool_t expert   = kTRUE ; 
+       const Bool_t image    = kTRUE ; 
+       Char_t name[50];
+       Char_t title[50];
+       TH2F**hPhiEta = new TH2F*[6];
+       for (Int_t iLay=0;iLay<6;iLay++) {
+               sprintf(name,"Phi_vs_Eta_ITS_Layer%d",iLay+1);
+               sprintf(title,"Phi vs Eta - ITS Layer %d",iLay+1);
+               hPhiEta[iLay]=new TH2F(name,title,30,-1.5,1.5,200,0.,2*TMath::Pi());
+               hPhiEta[iLay]->GetXaxis()->SetTitle("Pseudorapidity");
+               hPhiEta[iLay]->GetYaxis()->SetTitle("#varphi [rad]");
+               Add2RecPointsList((new TH2F(*hPhiEta[iLay])), iLay + offset, !expert, image);
+               //AliInfo(Form("Added histo phi vs eta at position %d\n", iLay + offset));
+               delete hPhiEta[iLay];
+       }
+       //AliInfo(Form("fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries() %d\n",fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries()));
 }
 
 //____________________________________________________________________________ 
@@ -262,20 +294,72 @@ void AliITSQADataMakerRec::MakeRecPoints(TTree * clustersTree)
  
   // Fill QA for recpoints
   if(fSubDetector == 0 || fSubDetector == 1) {
-    Int_t rv = fSPDDataMaker->MakeRecPoints(clustersTree) ; 
-    if ( rv != 0 )
-      fSDDDataMaker->SetOffset(AliQAv1::kRECPOINTS, fRecPointsQAList[AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
+    fSPDDataMaker->MakeRecPoints(clustersTree) ; 
   }
-  
+    
   if(fSubDetector == 0 || fSubDetector == 2) {
-    Int_t rv = fSDDDataMaker->MakeRecPoints(clustersTree) ; 
-    if ( rv != 0 )
-      fSSDDataMaker->SetOffset(AliQAv1::kRECPOINTS, fRecPointsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries());
+    fSDDDataMaker->MakeRecPoints(clustersTree) ; 
   }
   
   if(fSubDetector == 0 || fSubDetector == 3) fSSDDataMaker->MakeRecPoints(clustersTree);
+
+       // Check id histograms already created for this Event Specie
+       TBranch *branchRecP = clustersTree->GetBranch("ITSRecPoints");
+       if (!branchRecP) {
+               AliError("can't get the branch with the ITS clusters !");
+               return;
+       }
+
+       Int_t offset = fRecPointsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries();
+       Float_t cluGlo[3] = {0.,0.,0.};
+       Int_t lay, lad, det; 
+       static TClonesArray statRecpoints("AliITSRecPoint") ;
+       TClonesArray *recpoints = &statRecpoints;
+       branchRecP->SetAddress(&recpoints);
+       // Fill QA for recpoints
+       for(Int_t module=0; module<clustersTree->GetEntries();module++){
+               branchRecP->GetEvent(module);
+               AliITSgeomTGeo::GetModuleId(module, lay, lad, det);
+               for(Int_t j=0;j<recpoints->GetEntries();j++){
+                       AliITSRecPoint *rcp = (AliITSRecPoint*)recpoints->At(j);    
+                       // Check id histograms already created for this Event Specie
+                       rcp->GetGlobalXYZ(cluGlo);
+                       Double_t rad=TMath::Sqrt(cluGlo[0]*cluGlo[0]+cluGlo[1]*cluGlo[1]);
+                       Double_t phi= TMath::Pi() + TMath::ATan2(-cluGlo[1],-cluGlo[0]);
+                       Double_t theta = TMath::ACos(cluGlo[2]/rad);
+                       Double_t eta = 100.;
+                       if(rad != 0) eta = -TMath::Log(TMath::Tan(theta/2.));
+                       (GetRecPointsData( rcp->GetLayer() + offset - 6))->Fill(eta,phi);
+               }
+       }
+
+
+}
+
+//____________________________________________________________________________ 
+void AliITSQADataMakerRec::FillRecPoint(AliITSRecPoint rcp)
+{
+
+       // Fill QA for recpoints
+       Float_t cluGlo[3] = {0.,0.,0.};
+       Int_t offset = fRecPointsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries();
+  // Check id histograms already created for this Event Specie
+       rcp.GetGlobalXYZ(cluGlo);
+       Double_t rad=TMath::Sqrt(cluGlo[0]*cluGlo[0]+cluGlo[1]*cluGlo[1]);
+       Double_t phi= TMath::Pi() + TMath::ATan2(-cluGlo[1],-cluGlo[0]);
+       Double_t theta = TMath::ACos(cluGlo[2]/rad);
+       Double_t eta = 100.;
+       if(rad != 0) eta = -TMath::Log(TMath::Tan(theta/2.));
+       (GetRecPointsData( rcp.GetLayer() + offset - 6))->Fill(eta,phi);
 }
 
+//____________________________________________________________________________ 
+TH2F *AliITSQADataMakerRec::GetITSGlobalHisto(Int_t layer)
+{
+
+       Int_t offset = fRecPointsQAList [AliRecoParam::AConvert(fEventSpecie)]->GetEntries();
+       return ((TH2F *) GetRecPointsData( layer + offset - 6));//local distribution
+}
 
 //____________________________________________________________________________ 
 void AliITSQADataMakerRec::InitESDs()
@@ -435,8 +519,8 @@ void AliITSQADataMakerRec::MakeESDs(AliESDEvent *esd)
   // Make QA data from ESDs
 
   // Check id histograms already created for this Event Specie
-  if ( ! GetESDsData(0) )
-    InitESDs() ;
+//  if ( ! GetESDsData(0) )
+//    InitESDs() ;
   
   const Int_t nESDTracks = esd->GetNumberOfTracks();
   Int_t nITSrefit5 = 0; 
index e6634e5..dd58313 100644 (file)
 //  A. Dainese Jun 2008 
 
 #include "AliQADataMakerRec.h"
+#include "AliDetectorRecoParam.h"
+#include "AliReconstructor.h"
 
 class AliITSQASPDDataMakerRec;
 class AliITSQASDDDataMakerRec;
 class AliITSQASSDDataMakerRec;
+class AliITSRecPoint;
 class AliRawReader;
+class TH2F;
 
 class AliITSQADataMakerRec: public AliQADataMakerRec {
 
@@ -35,6 +39,7 @@ public:
   AliITSQADataMakerRec(Bool_t kMode = kFALSE, Short_t subDet = 0, Short_t ldc = 0); // kMode = kFALSE (offline), kTRUE (online); subDet = 0 (ALL), 1 (SPD), 2 (SDD), 3 (SSD)
   AliITSQADataMakerRec(const AliITSQADataMakerRec& qadm);
   AliITSQADataMakerRec& operator = (const AliITSQADataMakerRec& qac);
+  virtual Int_t GetEventSpecie() const { return AliReconstructor::GetRecoParam(0)->GetEventSpecie(); }
   virtual void StartOfDetectorCycle();
   virtual void EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray ** list);
   virtual void EndOfDetectorCycle(const char *fgDataName);
@@ -47,18 +52,17 @@ public:
   virtual void MakeDigits(TTree *digitsTree);
   virtual void MakeRecPoints(TTree *clustersTree);
   virtual void MakeESDs(AliESDEvent *esd);
+  virtual void FillRecPoint(AliITSRecPoint rcp);
 
-  void SetHLTMode(Bool_t khltmode=kFALSE){fHLTMode=khltmode;};
-  Bool_t GetHLTMode(){return fHLTMode;};
   virtual ~AliITSQADataMakerRec(); // dtor
  Short_t GetSubDet(){return fSubDetector;};
  Int_t GetDetTaskOffset(Int_t subdet,AliQAv1::TASKINDEX_t task);
+       TH2F *GetITSGlobalHisto(Int_t layer);
 
 
 private:
 
   Bool_t  fkOnline;                        //online (1) or offline (0) use
-  Bool_t  fHLTMode;                        // HLT MODE kTRUE mode C kFALSE mode A
   Short_t fSubDetector;                    // subDetector: 0 (ALL), 1 (SPD), 2 (SDD), 3 (SSD)
   Short_t fLDC;                                   // number of LDC: 0 (one LDC for the whole subdetector)
 
@@ -66,7 +70,7 @@ private:
   AliITSQASDDDataMakerRec *fSDDDataMaker;  // SDD Data Maker 
   AliITSQASSDDataMakerRec *fSSDDataMaker;  // SSD Data Maker 
 
-  ClassDef(AliITSQADataMakerRec,4)         // description 
+  ClassDef(AliITSQADataMakerRec,5)         // description 
 
 };
 
index 0ca00e6..bf2ffc2 100644 (file)
@@ -21,7 +21,7 @@
 //  contained in a DB
 //  -------------------------------------------------------------
 //  W. Ferrarese + P. Cerello Feb 2008
-//  M.Siciliano Aug 2008 QA RecPoints and HLT mode
+//  M.Siciliano Aug 2008 QA RecPoints 
 //  INFN Torino
 
 // --- ROOT system ---
@@ -32,6 +32,7 @@
 #include <TTree.h>
 #include <TGaxis.h>
 #include <TMath.h>
+#include <TF1.h>
 #include <TDirectory.h>
 #include <TSystem.h>
 // --- Standard library ---
@@ -49,7 +50,6 @@
 #include "AliITSdigit.h"
 #include "AliITSRecPoint.h"
 #include "AliITSgeomTGeo.h"
-#include "AliITSHLTforSDD.h"
 #include "AliCDBManager.h"
 #include "AliCDBStorage.h"
 #include "AliCDBEntry.h"
@@ -78,20 +78,21 @@ fGenDigitsOffset(0),
 fGenRecPointsOffset(0),
 fTimeBinSize(1),
 fDDLModuleMap(0),
-fHLTMode(0),
-fHLTSDD(0)
+fGoodAnodes(0),
+fBadAnodes(0),
+fGoodAnodesCurrent(0),
+fBadAnodesCurrent(0)
 {
   //ctor used to discriminate OnLine-Offline analysis
-  if(fLDC < 0 || fLDC > 4) {
+  if(fLDC < 0 || fLDC > 6) {
        AliError("Error: LDC number out of range; return\n");
   }
-  if(!fkOnline){AliInfo("Offline mode: HLT set from AliITSDetTypeRec for SDD\n");}
-  else
-    if(fkOnline){
-      AliInfo("Online mode: HLT set from environment for SDD\n");
-      SetHLTModeFromEnvironment();
-    }
-  //fDDLModuleMap=NULL;
+       fGenRawsOffset = new Int_t[AliRecoParam::kNSpecies];
+       fGenRecPointsOffset = new Int_t[AliRecoParam::kNSpecies];
+       for(Int_t i=0; i<AliRecoParam::kNSpecies; i++) {
+               fGenRawsOffset[i] = 0;
+               fGenRecPointsOffset[i] = 0;
+       }
 }
 
 //____________________________________________________________________________ 
@@ -108,9 +109,10 @@ fGenDigitsOffset(qadm.fGenDigitsOffset),
 fGenRecPointsOffset(qadm.fGenRecPointsOffset),
 fTimeBinSize(1),
 fDDLModuleMap(0),
-fHLTMode(qadm.fHLTMode),
-fHLTSDD( qadm.fHLTSDD)
-{
+fGoodAnodes(qadm.fGoodAnodes),
+fBadAnodes(qadm.fBadAnodes),
+fGoodAnodesCurrent(qadm.fGoodAnodesCurrent),
+fBadAnodesCurrent(qadm.fBadAnodesCurrent){
   //copy ctor 
   fAliITSQADataMakerRec->SetName((const char*)qadm.fAliITSQADataMakerRec->GetName()) ; 
   fAliITSQADataMakerRec->SetTitle((const char*)qadm.fAliITSQADataMakerRec->GetTitle());
@@ -142,7 +144,11 @@ void AliITSQASDDDataMakerRec::StartOfDetectorCycle()
 void AliITSQASDDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/, TObjArray* /*list*/)
 {
   // launch the QA checking
-  AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); 
+       if(fkOnline) {
+               AnalyseBNG(); // Analyse Baseline, Noise, Gain
+               AnalyseINJ(); // Analyse Injectors
+       }
+       AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); 
 }
 
 //____________________________________________________________________________ 
@@ -153,7 +159,6 @@ Int_t AliITSQASDDDataMakerRec::InitRaws()
   const Bool_t saveCorr = kTRUE ; 
   const Bool_t image    = kTRUE ; 
   Int_t rv = 0 ; 
-  //fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList[AliRecoParam::kDefault])->GetEntries();
   AliCDBEntry *ddlMapSDD = AliCDBManager::Instance()->Get("ITS/Calib/DDLMapSDD");
   Bool_t cacheStatus = AliCDBManager::Instance()->GetCacheFlag();
   if(!ddlMapSDD)
@@ -169,23 +174,7 @@ Int_t AliITSQASDDDataMakerRec::InitRaws()
     {
       delete ddlMapSDD;
     }
-  
-  if(fkOnline==kFALSE){
-    AliInfo("Offline mode: HLTforSDDobject used \n");
-    AliCDBEntry *hltforSDD = AliCDBManager::Instance()->Get("ITS/Calib/HLTforSDD");
-    if(!hltforSDD){
-      AliError("Calibration object retrieval failed! SDD will not be processed");    
-      fHLTSDD=NULL;
-      return rv;
-    }  
-    fHLTSDD = (AliITSHLTforSDD*)hltforSDD->GetObject();
-    if(!cacheStatus)hltforSDD->SetObject(NULL);
-    hltforSDD->SetOwner(kTRUE);
-    if(!cacheStatus)
-      {
-       delete hltforSDD;
-      }
-  }
+
   Int_t lay, lad, det;
   Int_t indexlast = 0;
   Int_t index1 = 0;
@@ -201,7 +190,7 @@ Int_t AliITSQASDDDataMakerRec::InitRaws()
   TH1D *h0 = new TH1D("SDDModPattern","HW Modules pattern",fgknSDDmodules,239.5,499.5); //0
   h0->GetXaxis()->SetTitle("Module Number");
   h0->GetYaxis()->SetTitle("Counts");
-   rv = fAliITSQADataMakerRec->Add2RawsList((new TH1D(*h0)),0+fGenRawsOffset, expert, !image, !saveCorr);
+   rv = fAliITSQADataMakerRec->Add2RawsList((new TH1D(*h0)),0+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
   delete h0;
   fSDDhRawsTask++;
   
@@ -209,14 +198,14 @@ Int_t AliITSQASDDDataMakerRec::InitRaws()
   TH2D *hphil3 = new TH2D("SDDphizL3","SDD #varphiz Layer3 ",6,0.5,6.5,14,0.5,14.5);
   hphil3->GetXaxis()->SetTitle("z[#Module L3 ]");
   hphil3->GetYaxis()->SetTitle("#varphi[#Ladder L3]");
-   rv = fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hphil3)),1+fGenRawsOffset, !expert, image, saveCorr); 
+   rv = fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hphil3)),1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, image, saveCorr); 
   delete hphil3;
   fSDDhRawsTask++;
   
   TH2D *hphil4 = new TH2D("SDDphizL4","SDD #varphiz Layer4 ",8,0.5,8.5,22,0.5,22.5); 
   hphil4->GetXaxis()->SetTitle("z[#Module L4]");
   hphil4->GetYaxis()->SetTitle("#varphi[#Ladder L4]");
-   rv = fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hphil4)),2+fGenRawsOffset, !expert, image, saveCorr); 
+   rv = fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hphil4)),2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, image, saveCorr); 
   delete hphil4;
   fSDDhRawsTask++;
   
@@ -228,7 +217,7 @@ Int_t AliITSQASDDDataMakerRec::InitRaws()
       TH2D *hddl = new TH2D("SDDDDLPattern","SDD DDL Pattern ",24,-0.5,23.5,24,-0.5,23.5); 
       hddl->GetXaxis()->SetTitle("Channel");
       hddl->GetYaxis()->SetTitle("#DDL");
-      rv = fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hddl)),3+fGenRawsOffset, expert, !image, !saveCorr);
+      rv = fAliITSQADataMakerRec->Add2RawsList((new TH2D(*hddl)),3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
       delete hddl;
       fSDDhRawsTask++;
       Int_t indexlast1 = 0;
@@ -248,7 +237,7 @@ Int_t AliITSQASDDDataMakerRec::InitRaws()
          TProfile2D *fModuleChargeMapFSE = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
          fModuleChargeMapFSE->GetXaxis()->SetTitle("Time Bin");
          fModuleChargeMapFSE->GetYaxis()->SetTitle("Anode");
-          rv = fAliITSQADataMakerRec->Add2RawsList((new TProfile2D(*fModuleChargeMapFSE)),indexlast1 + index1 + fGenRawsOffset, expert, !image, !saveCorr);
+          rv = fAliITSQADataMakerRec->Add2RawsList((new TProfile2D(*fModuleChargeMapFSE)),indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
          delete fModuleChargeMapFSE;
          
          fSDDhRawsTask++;
@@ -264,7 +253,7 @@ Int_t AliITSQASDDDataMakerRec::InitRaws()
          TProfile2D *fModuleChargeMap = new TProfile2D(hname[0],hname[1],256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
          fModuleChargeMap->GetXaxis()->SetTitle("Time Bin");
          fModuleChargeMap->GetYaxis()->SetTitle("Anode");
-          rv = fAliITSQADataMakerRec->Add2RawsList((new TProfile2D(*fModuleChargeMap)),indexlast1 + index1 + fGenRawsOffset, expert, !image, !saveCorr);
+          rv = fAliITSQADataMakerRec->Add2RawsList((new TProfile2D(*fModuleChargeMap)),indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
          delete fModuleChargeMap;
          
          fSDDhRawsTask++;
@@ -272,6 +261,7 @@ Int_t AliITSQASDDDataMakerRec::InitRaws()
        }
       }
       
+         
     }  // kONLINE
   
   AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Raws histograms booked\n",fSDDhRawsTask));
@@ -283,12 +273,8 @@ Int_t AliITSQASDDDataMakerRec::InitRaws()
 Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
 { 
   // Fill QA for RAW - SDD -
-
-  Int_t rv = 0 ; 
-
+       Int_t rv = 0;
   // Check id histograms already created for this Event Specie
-  if ( ! fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset) )
-    rv = InitRaws () ;
 
   if(!fDDLModuleMap){
     AliError("SDD DDL module map not available - skipping SDD QA");
@@ -296,38 +282,9 @@ Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
   }
   if(rawReader->GetType() != 7) return rv;  // skips non physical triggers
   AliDebug(AliQAv1::GetQADebugLevel(),"entering MakeRaws\n");                 
-  
-
-  
   rawReader->Reset();       
-  AliITSRawStream *stream;
-  
-  if(fkOnline==kTRUE)
-    {
-      if(GetHLTMode()==kTRUE)
-       {
-         //AliInfo("Online  mode: HLT C compressed mode used for SDD\n");
-         stream = new AliITSRawStreamSDDCompressed(rawReader); }
-      else{ 
-       //AliInfo("Online  mode: HLT A mode used for SDD\n");
-       stream = new AliITSRawStreamSDD(rawReader);}     
-    }
-  else 
-    {
-      if(fHLTSDD->IsHLTmodeC()==kTRUE){
-       //AliInfo("Offline  mode: HLT C compressed mode used for SDD\n");
-       stream = new AliITSRawStreamSDDCompressed(rawReader);
-      }else 
-       {
-         //AliInfo("Offline  mode: HLT A mode used for SDD\n");
-         stream = new AliITSRawStreamSDD(rawReader);
-       }
-    }
-  
-  //ckeck on HLT mode
-  //  AliITSRawStreamSDD s(rawReader); 
-  stream->SetDDLModuleMap(fDDLModuleMap);
+  AliITSRawStream *stream=AliITSRawStreamSDD::CreateRawStreamSDD(rawReader);
+   stream->SetDDLModuleMap(fDDLModuleMap);
   
   Int_t lay, lad, det; 
   
@@ -335,7 +292,7 @@ Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
   if(fkOnline) {
     for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
       for(Int_t iside=0;iside<fgknSide;iside++) {
-       if(fSDDhRawsTask > 4 + index) fAliITSQADataMakerRec->GetRawsData(4 + index +fGenRawsOffset)->Reset();   
+               if(fSDDhRawsTask > 4 + index) fAliITSQADataMakerRec->GetRawsData(4 + index +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();   
        // 4  because the 2D histos for single events start after the fourth position
        index++;
       }
@@ -378,13 +335,10 @@ Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
     }
     
     AliITSgeomTGeo::GetModuleId(isddmod, lay, lad, det);
-
-    
-    fAliITSQADataMakerRec->GetRawsData( 0 + fGenRawsOffset )->Fill(isddmod);   
-    
-    if(lay==3)    fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset)->Fill(det,lad); 
+    fAliITSQADataMakerRec->GetRawsData( 0 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()] )->Fill(isddmod);   
+    if(lay==3)    fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det,lad); 
     if(lay==4) { 
-      fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset)->Fill(det,lad);}  
+      fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det,lad);}  
     
     Short_t iside = stream->GetChannel();
     
@@ -393,7 +347,7 @@ Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
 
     if(fkOnline) {
 
-      fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset)->Fill(2*(stream->GetCarlosId())+iside,iddl);
+      fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(2*(stream->GetCarlosId())+iside,iddl);
 
       activeModule = moduleSDD;
       index1 = activeModule * 2 + iside;
@@ -402,10 +356,10 @@ Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
         AliDebug(AliQAv1::GetQADebugLevel(),Form("Wrong index number %d - patched to 0\n",index1));
        index1 = 0;
       }      
-      fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset)->Fill(2*(stream->GetCarlosId())+iside,iddl);
+      fAliITSQADataMakerRec->GetRawsData(3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(2*(stream->GetCarlosId())+iside,iddl);
       if(fSDDhRawsTask > 4 + index1) {                                  
-        ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(4 + index1 +fGenRawsOffset)))->Fill(coord2, coord1, signal);     
-        ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(4 + index1 + 260*2 +fGenRawsOffset)))->Fill(coord2, coord1, signal); 
+        ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(4 + index1 +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])))->Fill(coord2, coord1, signal);     
+        ((TProfile2D *)(fAliITSQADataMakerRec->GetRawsData(4 + index1 + 260*2 +fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])))->Fill(coord2, coord1, signal); 
       }
     }
     cnt++;
@@ -414,6 +368,13 @@ Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
   AliDebug(AliQAv1::GetQADebugLevel(),Form("Event completed, %d raw digits read",cnt)); 
   delete stream;
   stream = NULL; 
+
+//     if(fkOnline) {
+//             AnalyseBNG(); // Analyse Baseline, Noise, Gain
+//             AnalyseINJ(); // Analyse Injectors
+//     }
+
+
   return rv ; 
 }
 
@@ -471,8 +432,8 @@ Int_t AliITSQASDDDataMakerRec::MakeDigits(TTree * digits)
     return rv ;
   }
   // Check id histograms already created for this Event Specie
-  if ( ! fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset) )
-    rv = InitDigits() ;
+//  if ( ! fAliITSQADataMakerRec->GetDigitsData(fGenDigitsOffset) )
+//    rv = InitDigits() ;
   
   static TClonesArray statDigits("AliITSdigitSDD");
   TClonesArray *iITSdigits = &statDigits;
@@ -501,7 +462,7 @@ Int_t AliITSQASDDDataMakerRec::MakeDigits(TTree * digits)
 Int_t AliITSQASDDDataMakerRec::InitRecPoints()
 {
 
-
+       //AliInfo("Initialize SDD recpoints histos\n");
   // Initialization for RECPOINTS - SDD -
   const Bool_t expert   = kTRUE ; 
   const Bool_t image    = kTRUE ; 
@@ -520,18 +481,19 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
       nOnline4=14;
     }
 
-  
+  //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie()));
+  //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
   TH1F *h0 = new TH1F("SDDLay3TotCh","Layer 3 total charge",1000/nOnline,-0.5, 499.5); //position number 0
   h0->GetXaxis()->SetTitle("ADC value");
   h0->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h0)), 0 +fGenRecPointsOffset, !expert, image);
-  delete h0;
+  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h0)), 0 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
+  //delete h0;
   fSDDhRecPointsTask++;
  
   TH1F *h1 = new TH1F("SDDLay4TotCh","Layer 4 total charge",1000/nOnline,-0.5, 499.5);//position number 1
   h1->GetXaxis()->SetTitle("ADC value");
   h1->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h1)), 1 +fGenRecPointsOffset, !expert, image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h1)), 1 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
   delete h1;
   fSDDhRecPointsTask++;
 
@@ -539,62 +501,63 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
   TH2F *h2 = new TH2F("SDDGlobalCoordDistribYX","YX Global Coord Distrib",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 2
   h2->GetYaxis()->SetTitle("Y[cm]");
   h2->GetXaxis()->SetTitle("X[cm]");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h2)),2+fGenRecPointsOffset, expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h2)),2+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, !image);
   delete h2;
   fSDDhRecPointsTask++;
 
   TH2F *h3 = new TH2F("SDDGlobalCoordDistribRZ","RZ Global Coord Distrib",6400/nOnline3,-32,32,1400/nOnline4,12,26);//position number 3
   h3->GetYaxis()->SetTitle("R[cm]");
   h3->GetXaxis()->SetTitle("Z[cm]");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h3)),3+fGenRecPointsOffset, expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h3)),3+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, !image);
   delete h3;
   fSDDhRecPointsTask++;
   
   TH2F *h4 = new TH2F("SDDGlobalCoordDistribL3PHIZ","#varphi Z Global Coord Distrib L3",6400/nOnline3,-32,32,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 4
   h4->GetYaxis()->SetTitle("#phi[rad]");
   h4->GetXaxis()->SetTitle("Z[cm]");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h4)),4+fGenRecPointsOffset, !expert, image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h4)),4+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
   delete h4;
   fSDDhRecPointsTask++;
 
   TH2F *h5 = new TH2F("SDDGlobalCoordDistribL4PHIZ","#varphi Z Global Coord Distrib L4",6400/nOnline3,-32,32,360/nOnline,-TMath::Pi(),TMath::Pi());//position number 5
   h5->GetYaxis()->SetTitle("#phi[rad]");
   h5->GetXaxis()->SetTitle("Z[cm]");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h5)),5+fGenRecPointsOffset, !expert, image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h5)),5+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
   delete h5;
   fSDDhRecPointsTask++;
   
   TH1F *h6 = new TH1F("SDDModPatternRP","Modules pattern RP",fgknSDDmodules,239.5,499.5); //position number 6
   h6->GetXaxis()->SetTitle("Module number"); //spd offset = 240
   h6->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h6)),6 +fGenRecPointsOffset, expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h6)),6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
   delete h6;
   fSDDhRecPointsTask++;
   TH1F *h7 = new TH1F("SDDLadPatternL3RP","Ladder pattern L3 RP",14,0.5,14.5);  //position number 7
   h7->GetXaxis()->SetTitle("Ladder #, Layer 3");
   h7->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h7)),7 +fGenRecPointsOffset, expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h7)),7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
   delete h7;
   fSDDhRecPointsTask++;
   TH1F *h8 = new TH1F("SDDLadPatternL4RP","Ladder pattern L4 RP",22,0.5,22.5); //position number 8
   h8->GetXaxis()->SetTitle("Ladder #, Layer 4");
   h8->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h8)),8 +fGenRecPointsOffset, expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h8)),8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
   delete h8;
   fSDDhRecPointsTask++;
   TH2F *h9 = new TH2F("SDDLocalCoordDistrib","Local Coord Distrib",1000/nOnline,-4,4,1000/nOnline,-4,4);//position number 9
   h9->GetXaxis()->SetTitle("X local coord, drift, cm");
   h9->GetYaxis()->SetTitle("Z local coord, anode, cm");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h9)),9 +fGenRecPointsOffset, expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h9)),9 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
   delete h9;
   fSDDhRecPointsTask++;
 
+       //AliInfo("Create SDD recpoints histos\n");
 
     TH1F *h10 = new TH1F("SDDrdistrib_Layer3" ,"SDD r distribution Layer3" ,100,14.,18.);//position number 10 (L3)
     h10->GetXaxis()->SetTitle("r[cm]");
     h10->GetXaxis()->CenterTitle();
     h10->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h10)),10 +fGenRecPointsOffset, expert, !image);
+    rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h10)),10 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
     delete h10;
     fSDDhRecPointsTask++;
 
@@ -602,7 +565,7 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
     h11->GetXaxis()->SetTitle("r[cm]");
     h11->GetXaxis()->CenterTitle();
     h11->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h11)),11 +fGenRecPointsOffset, expert, !image);
+    rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h11)),11 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
     delete h11;
     fSDDhRecPointsTask++;
 
@@ -612,7 +575,7 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
     h12->GetXaxis()->SetTitle("#varphi[rad]");
     h12->GetXaxis()->CenterTitle();
     h12->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h12)),iLay+12+fGenRecPointsOffset, expert, !image);
+    rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH1F(*h12)),iLay+12+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
     delete h12;
     fSDDhRecPointsTask++;
   }
@@ -622,14 +585,14 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
       TH2F *h14 = new TH2F("SDDGlobalCoordDistribYXFSE","YX Global Coord Distrib FSE",5600/nOnline2,-28,28,5600/nOnline2,-28,28);//position number 14
       h14->GetYaxis()->SetTitle("Y[cm]");
       h14->GetXaxis()->SetTitle("X[cm]");
-      rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h14)),14+fGenRecPointsOffset, expert, !image);
+      rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h14)),14+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
       delete h14;
       fSDDhRecPointsTask++;
       
       TH2F *h15 = new TH2F("SDDGlobalCoordDistribRZFSE","RZ Global Coord Distrib FSE",Int_t(6400/nOnline3),-32,32,1400/nOnline4,12,26);//position number 15
       h15->GetYaxis()->SetTitle("R[cm]");
       h15->GetXaxis()->SetTitle("Z[cm]");
-      rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h15)),15+fGenRecPointsOffset, expert, !image);
+      rv = fAliITSQADataMakerRec->Add2RecPointsList((new TH2F(*h15)),15+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
       delete h15;
       fSDDhRecPointsTask++;
       
@@ -646,10 +609,13 @@ Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree)
  // Fill QA for RecPoints - SDD -
   Int_t rv = 0 ; 
 
+  //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie()));
+  //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
   // Check id histograms already created for this Event Specie
-  if ( ! fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset) )
-    rv = InitRecPoints() ;
+//  if ( ! fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]) )
+//    rv = InitRecPoints() ;
   Int_t lay, lad, det; 
+  //AliInfo("get the branch with the ITS clusters !\n");
   TBranch *branchRecP = clustersTree->GetBranch("ITSRecPoints");
   if (!branchRecP) {
     AliError("can't get the branch with the ITS clusters !");
@@ -665,78 +631,61 @@ Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree)
     {
       for(Int_t i=14;i<16;i++)
        {
-         fAliITSQADataMakerRec->GetRecPointsData(i+fGenRecPointsOffset)->Reset();
+         fAliITSQADataMakerRec->GetRecPointsData(i+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
        }
     }
-  for(Int_t module=0; module<clustersTree->GetEntries();module++){
-    branchRecP->GetEvent(module);
-    npoints += recpoints->GetEntries();
-    AliITSgeomTGeo::GetModuleId(module, lay, lad, det);
-    //printf("modnumb %d, lay %d, lad %d, det %d \n",module, lay, lad, det);
-    for(Int_t j=0;j<recpoints->GetEntries();j++){
-      AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j);    
-      fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset)->Fill(module);//modpatternrp
-      recp->GetGlobalXYZ(cluglo);
-      Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]); 
-      Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]);
-      fAliITSQADataMakerRec->GetRecPointsData(9 +fGenRecPointsOffset)->Fill(recp->GetDetLocalX(),recp->GetDetLocalZ());//local distribution
-      fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset)->Fill(cluglo[0],cluglo[1]);//global distribution YX
-      fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset)->Fill(cluglo[2],rad);//global distribution rz
-      if(fkOnline)
-       {
-         fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset)->Fill(cluglo[0],cluglo[1]);//global distribution YX FSE
-         fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset)->Fill(cluglo[2],rad);//global distribution rz FSE
+       for(Int_t module=0; module<clustersTree->GetEntries();module++){
+               //AliInfo(Form("Module %d\n",module));
+               branchRecP->GetEvent(module);
+               npoints += recpoints->GetEntries();
+               //AliInfo(Form("modnumb %d, npoints %d, total points %d\n",module, recpoints->GetEntries(),npoints));
+               AliITSgeomTGeo::GetModuleId(module, lay, lad, det);
+               //AliInfo(Form("modnumb %d, lay %d, lad %d, det %d \n",module, lay, lad, det));
+               Bool_t kSDD = kFALSE;
+               if(lay == 3 || lay == 4) kSDD = kTRUE;
+               if(!kSDD) continue;
+               //AliInfo(Form("modnumb %d, entries %d\n",module, recpoints->GetEntries()));
+               for(Int_t j=0;j<recpoints->GetEntries();j++){
+                       //AliInfo(Form("modnumb %d, entry %d \n",module, j));
+                       AliITSRecPoint *recp = (AliITSRecPoint*)recpoints->At(j);    
+                       fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(module);//modpatternrp
+                       recp->GetGlobalXYZ(cluglo);
+                       Float_t rad=TMath::Sqrt(cluglo[0]*cluglo[0]+cluglo[1]*cluglo[1]); 
+                       Float_t phi=TMath::ATan2(cluglo[1],cluglo[0]);
+                       fAliITSQADataMakerRec->GetRecPointsData(9 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetDetLocalX(),recp->GetDetLocalZ());//local distribution
+                       fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[0],cluglo[1]);//global distribution YX
+                       fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],rad);//global distribution rz
+                       if(fkOnline) {
+                               fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[0],cluglo[1]);//global distribution YX FSE
+                               fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],rad);//global distribution rz FSE
+                       }
+                       if(recp->GetLayer() == 2) {
+                               fAliITSQADataMakerRec->GetRecPointsData(0  +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetQ()) ;//total charge of layer 3
+                               fAliITSQADataMakerRec->GetRecPointsData(7  +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(lad);//lad pattern layer 3
+                               fAliITSQADataMakerRec->GetRecPointsData(10 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad);//r distribution layer 3
+                               fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(phi);// phi distribution layer 3
+                               fAliITSQADataMakerRec->GetRecPointsData(4  +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],phi);// phi distribution layer 3
+                       } else if(recp->GetLayer() == 3) {
+                               fAliITSQADataMakerRec->GetRecPointsData(1  +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(recp->GetQ()) ;//total charge layer 4
+                               fAliITSQADataMakerRec->GetRecPointsData(8  +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(lad);//ladpatternlayer4
+                               fAliITSQADataMakerRec->GetRecPointsData(11 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad);//r distribution
+                               fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(phi);//phi distribution
+                               fAliITSQADataMakerRec->GetRecPointsData(5  +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],phi);// phi distribution layer 4
+                       }
+               }
        }
-      if(recp->GetLayer() ==3) {
-       fAliITSQADataMakerRec->GetRecPointsData(0  +fGenRecPointsOffset)->Fill(recp->GetQ()) ;//total charge of layer 3
-       fAliITSQADataMakerRec->GetRecPointsData(7  +fGenRecPointsOffset)->Fill(lad);//lad pattern layer 3
-       fAliITSQADataMakerRec->GetRecPointsData(10 +fGenRecPointsOffset)->Fill(rad);//r distribution layer 3
-       fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset)->Fill(phi);// phi distribution layer 3
-       fAliITSQADataMakerRec->GetRecPointsData(4  +fGenRecPointsOffset)->Fill(cluglo[2],phi);// phi distribution layer 3
-      }
-      else if(recp->GetLayer() ==4) {
-       fAliITSQADataMakerRec->GetRecPointsData(1  +fGenRecPointsOffset)->Fill(recp->GetQ()) ;//total charge layer 4
-       fAliITSQADataMakerRec->GetRecPointsData(8  +fGenRecPointsOffset)->Fill(lad);//ladpatternlayer4
-       fAliITSQADataMakerRec->GetRecPointsData(11 +fGenRecPointsOffset)->Fill(rad);//r distribution
-       fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset)->Fill(phi);//phi distribution
-       fAliITSQADataMakerRec->GetRecPointsData(5  +fGenRecPointsOffset)->Fill(cluglo[2],phi);// phi distribution layer 4
-      }
-    }
-  }
-  statRecpoints.Clear();
-  return rv ; 
+       statRecpoints.Clear();
+       return rv ; 
 }
 
 //_______________________________________________________________
 
-void AliITSQASDDDataMakerRec::SetHLTModeFromEnvironment()
-{
-
-   Int_t  hltmode= ::atoi(gSystem->Getenv("HLT_MODE"));
-
-   if(hltmode==1)
-     {
-       AliInfo("Online mode: HLT mode A selected from environment for SDD\n");
-       SetHLTMode(kFALSE);
-     }
-   else
-     if(hltmode==2)
-       {
-       AliInfo("Online mode: HLT mode C compressed selected from environment for SDD\n");
-       SetHLTMode(kTRUE);
-       }
-}
-
-
-//_______________________________________________________________
-
 Int_t AliITSQASDDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task)
 {
   Int_t offset=0;
   if( task == AliQAv1::kRAWS )
     {
-      offset=fGenRawsOffset;  
+      offset=fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()];  
     }
   else if(task == AliQAv1::kDIGITSR )
     {
@@ -744,27 +693,23 @@ Int_t AliITSQASDDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task)
     }
   else if( task == AliQAv1::kRECPOINTS )
     {
-      offset=fGenRecPointsOffset;   
+      offset=fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()];   
     }
-    else AliInfo("No task has been selected. Offset set to zero.\n");
   return offset;
 }
 
 //_______________________________________________________________
 
-void AliITSQASDDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset) {
+void AliITSQASDDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie) {
   // Returns offset number according to the specified task
   if( task == AliQAv1::kRAWS ) {
-    fGenRawsOffset=offset;
+    fGenRawsOffset[specie]=offset;
   }
   else if( task == AliQAv1::kDIGITSR ) {
     fGenDigitsOffset=offset;
   }
   else if( task == AliQAv1::kRECPOINTS ) {
-    fGenRecPointsOffset=offset;
-  }
-  else {
-    AliInfo("No task has been selected. Offset set to zero.\n");
+    fGenRecPointsOffset[specie]=offset;
   }
 }
 
@@ -787,6 +732,442 @@ Int_t AliITSQASDDDataMakerRec::GetTaskHisto(AliQAv1::TASKINDEX_t task)
     {
       histotot=fSDDhRecPointsTask;   
     }
-  else AliInfo("No task has been selected. TaskHisto set to zero.\n");
+  else {
+    AliInfo("No task has been selected. TaskHisto set to zero.\n");
+  }
   return histotot;
 }
+
+//_______________________________________________________________
+
+void AliITSQASDDDataMakerRec::AnalyseBNG()
+{
+
+// get file time for Previous test
+       AliInfo("AnalyseBNG\n");
+       static Int_t bngtimePrevious[6]; 
+       FILE *fpinPrevious = fopen( "SDDgainHistos.time", "r" );
+       if(fpinPrevious) {
+               for(Int_t i=0; i<6; i++) fscanf(fpinPrevious,"%d",&bngtimePrevious[i]);
+               fclose (fpinPrevious);
+       } else 
+               for(Int_t i=0; i<6; i++) bngtimePrevious[i] = 0;
+       Int_t bngtimeCurrent[6] = { 0 }; 
+       gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDgainHistos1.root > SDDgainHistos.time");
+       gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDgainHistos2.root >> SDDgainHistos.time");
+       gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDgainHistos3.root >> SDDgainHistos.time");
+       gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDgainHistos4.root >> SDDgainHistos.time");
+       gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDgainHistos5.root >> SDDgainHistos.time");
+       gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDgainHistos6.root >> SDDgainHistos.time");
+       FILE *fpin = fopen( "SDDgainHistos.time", "r" );
+       for(Int_t i=0; i<6; i++) {
+               fscanf(fpin,"%d",&bngtimeCurrent[i]);
+//             AliInfo(Form("bngtimeCurrent[%d] %d, bngtimePrevious[%d] %d\n",i,bngtimeCurrent[i],i,bngtimePrevious[i]));
+       }
+       Bool_t kAnalyse = kTRUE;
+       for(Int_t i=0; i<6; i++) if(bngtimeCurrent[i] <= bngtimePrevious[i]) kAnalyse = kFALSE;
+       if(kAnalyse) {
+               // new bng file found
+               for(Int_t i=0; i<6; i++) bngtimePrevious[i] = bngtimeCurrent[i];
+               Bool_t kFilesExist = kTRUE;
+               char *hname = new char[50];
+               for(Int_t i=0; i<6; i++) {
+                       sprintf(hname,"SDDgainHistos%d.root",i+1);
+                       TFile gainFile(hname);
+                       if(gainFile.IsZombie()) kFilesExist = kFALSE;
+               }
+               if(kFilesExist) {
+                       AnodeStatus();
+                       AnalyseHistos(1); // Baseline
+                       AnalyseHistos(2); // Uncorrected Noise
+                       AnalyseHistos(3); // Common Mode Noise
+                       AnalyseHistos(4); // Corrected Noise
+                       AnalyseHistos(5); // Gain
+                       gSystem->Exec("cp SDDgainHistos1.root SDDgainHistosPrevious1.root");
+                       gSystem->Exec("cp SDDgainHistos2.root SDDgainHistosPrevious2.root");
+                       gSystem->Exec("cp SDDgainHistos3.root SDDgainHistosPrevious3.root");
+                       gSystem->Exec("cp SDDgainHistos4.root SDDgainHistosPrevious4.root");
+                       gSystem->Exec("cp SDDgainHistos5.root SDDgainHistosPrevious5.root");
+                       gSystem->Exec("cp SDDgainHistos6.root SDDgainHistosPrevious6.root");
+               } else {
+                       AliInfo("file(s) SDDgainHistos .root not found \n");
+               }
+       }
+       fclose (fpin);
+//     delete fpin;
+
+}
+
+//_______________________________________________________________
+
+void AliITSQASDDDataMakerRec::AnalyseINJ()
+{
+// get file time for last test
+
+       AliInfo("AnalyseINJ\n");
+       static Int_t injtimePrevious[6]; 
+       FILE *fpinPrevious = fopen( "SDDinjectHistos.time", "r" );
+       if(fpinPrevious) {
+               for(Int_t i=0; i<6; i++) fscanf(fpinPrevious,"%d",&injtimePrevious[i]);
+               fclose (fpinPrevious);
+       } else 
+               for(Int_t i=0; i<6; i++) injtimePrevious[i] = 0;
+       Int_t injtimeCurrent[6] = { 0 }; 
+       gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDinjectHistos1.root > SDDinjectHistos.time");
+       gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDinjectHistos2.root >> SDDinjectHistos.time");
+       gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDinjectHistos3.root >> SDDinjectHistos.time");
+       gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDinjectHistos4.root >> SDDinjectHistos.time");
+       gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDinjectHistos5.root >> SDDinjectHistos.time");
+       gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDinjectHistos6.root >> SDDinjectHistos.time");
+       FILE *fpin = fopen( "SDDinjectHistos.time", "r" );
+       for(Int_t i=0; i<6; i++) {
+               fscanf(fpin,"%d",&injtimeCurrent[i]);
+//             AliInfo(Form("injtimeCurrent[%d] %d, injtimePrevious[%d] %d\n",i,injtimeCurrent[i],i,injtimePrevious[i]));
+       }
+       Bool_t kAnalyse = kTRUE;
+       for(Int_t i=0; i<6; i++) if(injtimeCurrent[i] <= injtimePrevious[i]) kAnalyse = kFALSE;
+       if(kAnalyse) {
+               // new inj file found
+               for(Int_t i=0; i<6; i++) injtimePrevious[i] = injtimeCurrent[i];
+               Bool_t kFilesExist = kTRUE;
+               char *hname = new char[50];
+               for(Int_t i=0; i<6; i++) {
+                       sprintf(hname,"SDDinjectHistos%d.root",i+1);
+                       TFile gainFile(hname);
+                       if(gainFile.IsZombie()) kFilesExist = kFALSE;
+               }
+               if(kFilesExist) {
+                       AnalyseHistos(6); // Drift Speed
+                       gSystem->Exec("cp SDDinjectHistos1.root SDDinjectHistosPrevious1.root");
+                       gSystem->Exec("cp SDDinjectHistos2.root SDDinjectHistosPrevious2.root");
+                       gSystem->Exec("cp SDDinjectHistos3.root SDDinjectHistosPrevious3.root");
+                       gSystem->Exec("cp SDDinjectHistos4.root SDDinjectHistosPrevious4.root");
+                       gSystem->Exec("cp SDDinjectHistos5.root SDDinjectHistosPrevious5.root");
+                       gSystem->Exec("cp SDDinjectHistos6.root SDDinjectHistosPrevious6.root");
+               } else {
+                       AliInfo("file(s) SDDinjectHistos .root not found \n");
+               }
+       }
+       fclose (fpin);
+/*
+       static Int_t injtimeLast = 0; 
+       FILE *fpinlast = fopen( "SDDinjectHistos.time", "r" );
+       if(fpinlast) {
+               fscanf(fpinlast,"%d",&injtimeLast);
+               fclose (fpinlast);
+       } else 
+               injtimeLast = 0;
+       Int_t injtimeCurrent = 0; 
+       gSystem->Exec("perl -e '@d=localtime ((stat(shift))[9]); printf \"%02d%02d%02d%02d%02d\n\", $d[5]-100,$d[4]+1,$d[3],$d[2],$d[1]'  SDDinjectHistos.root > SDDinjectHistos.time");
+       FILE *fpin = fopen( "SDDinjectHistos.time", "r" );
+       fscanf(fpin,"%d",&injtimeCurrent);
+       if(injtimeCurrent > injtimeLast) {
+               // new gain file found
+               injtimeLast = injtimeCurrent;
+
+               TFile injectFile("SDDinjectHistos.root");
+               if(!injectFile.IsZombie()) {
+                       AnalyseHistos(6); // Drift Speed
+                       gSystem->Exec("cp SDDinjectHistos.root SDDinjectHistosLast.root");
+               } else {
+                       AliInfo("file SDDinjectHistos.root not found \n");
+               }
+
+       }
+       fclose (fpin);
+*/
+//     delete fpin;
+}
+
+//_______________________________________________________________
+
+void AliITSQASDDDataMakerRec::AnodeStatus()
+{
+       char *hnamePrevious = new char[50];
+       char *fnamePrevious = new char[50];
+    fGoodAnodes = 0;
+
+       for(Int_t k=0;k<6;k++) {
+               sprintf(fnamePrevious,"SDDgainHistosPrevious%d.root",k+1);
+               TFile gainFilePrevious(fnamePrevious);
+               if(gainFilePrevious.IsZombie()) continue;
+               for(Int_t ddl =0; ddl<fDDLModuleMap->GetNDDLs(); ddl++){
+                       for(Int_t crx =0; crx<fDDLModuleMap->GetNModPerDDL(); crx++){
+                               for(Int_t iside=0;iside<fgknSide;iside++){
+                                       Int_t moduleSDD = fDDLModuleMap->GetModuleNumber(ddl,crx);
+                       //AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
+                                       sprintf(hnamePrevious,"hgood%02dc%02ds%d",ddl,crx,iside);
+                               //AliInfo(Form("get histo %s\n",hnamePrevious));
+                                       TH1F *hgood = (TH1F *) gainFilePrevious.Get(hnamePrevious);
+                                       if(!hgood) continue;
+                                       for(Int_t i=0; i<hgood->GetNbinsX();i++) {
+                                               fAnodeMap[moduleSDD-fgkmodoffset][iside][i] = hgood->GetBinContent(i);
+                                               if(fAnodeMap[moduleSDD-fgkmodoffset][iside][i]) fGoodAnodes++;
+                                       }
+                                       delete hgood;
+                               }
+                       }
+               }
+               gainFilePrevious.Close();
+       }
+
+       fGoodAnodesCurrent = 0;
+       fBadAnodesCurrent = 0;
+       char *hname = new char[50];
+       Int_t nChangedStatus = 0;
+       Bool_t CurrentAnodeMap[fgknSDDmodules][fgknSide][fgknAnode];    
+       for(Int_t k=0;k<6;k++) {
+               sprintf(fnamePrevious,"SDDgainHistos%d.root",k+1);
+               TFile gainFile(fnamePrevious);
+               if(gainFile.IsZombie()) continue;
+               for(Int_t ddl =0; ddl<fDDLModuleMap->GetNDDLs(); ddl++){
+                       for(Int_t crx =0; crx<fDDLModuleMap->GetNModPerDDL(); crx++){
+                               for(Int_t iside=0;iside<fgknSide;iside++){
+                                       Int_t moduleSDD = fDDLModuleMap->GetModuleNumber(ddl,crx);
+                               //AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
+                                       sprintf(hname,"hgood%02dc%02ds%d",ddl,crx,iside);
+                               //AliInfo(Form("get histo %s\n",hname));
+                                       TH1F *hgood = (TH1F *) gainFile.Get(hname);
+                                       if(!hgood) continue;
+                                       for(Int_t i=0; i<hgood->GetNbinsX();i++) {
+                                               CurrentAnodeMap[moduleSDD-fgkmodoffset][iside][i] = hgood->GetBinContent(i);
+                                               if(CurrentAnodeMap[moduleSDD-fgkmodoffset][iside][i]) fGoodAnodesCurrent++;
+                                               else fBadAnodesCurrent++;
+                                               if(CurrentAnodeMap[moduleSDD-fgkmodoffset][iside][i] != fAnodeMap[moduleSDD-fgkmodoffset][iside][i]) {
+                                                       fAnodeMap[moduleSDD-fgkmodoffset][iside][i] = CurrentAnodeMap[moduleSDD-fgkmodoffset][iside][i];
+                                                       nChangedStatus++;
+                                                       AliWarning(Form("DDL %d, CRX %d, Side %d, Anode %d changed status to %d \n",ddl,crx,iside,i,fAnodeMap[moduleSDD-fgkmodoffset][iside][i]));
+                                               }
+                                       }
+                                       delete hgood;
+                               }
+                       }
+               }
+               gainFile.Close();
+       }
+       
+       AliWarning(Form("Number of good anodes changed from %d to %d, that is %f %%\n",fGoodAnodes,fGoodAnodesCurrent,((Float_t) TMath::Abs(fGoodAnodes-fGoodAnodesCurrent))/(fBadAnodesCurrent+fGoodAnodesCurrent)));
+       if(fGoodAnodesCurrent != fGoodAnodes) {
+               fGoodAnodes = fGoodAnodesCurrent;
+       }
+       AliWarning(Form("Number of bad anodes changed from %d to %d, that is %f %%\n",fBadAnodes,fBadAnodesCurrent,((Float_t) TMath::Abs(fBadAnodes-fBadAnodesCurrent))/(fBadAnodesCurrent+fGoodAnodesCurrent)));
+       if(fBadAnodesCurrent != fBadAnodes) {
+               fBadAnodes = fBadAnodesCurrent;
+       }
+//     delete hname;
+}
+
+//_______________________________________________________________
+
+void AliITSQASDDDataMakerRec::AnalyseHistos(Int_t type)
+{
+
+       if(type < 1 || type > 6) AliWarning(Form("Wrong type (%d), must be between 1 and 6\n",type));
+       
+       Double_t Current[fgknSDDmodules][fgknSide][fgknAnode];  
+       char *hnamePrevious = new char[50];
+       char *fnamePrevious = new char[50];
+
+       for(Int_t k=0; k<6; k++) {
+               if(type < 6) sprintf(fnamePrevious,"SDDgainHistosPrevious%d.root",k+1);
+               else sprintf(fnamePrevious,"SDDinjectHistosPrevious%d.root",k+1);
+               TFile *gainFilePrevious = new TFile(fnamePrevious);
+               if(gainFilePrevious->IsZombie()) continue;
+
+               for(Int_t ddl =0; ddl<fDDLModuleMap->GetNDDLs(); ddl++){
+                       for(Int_t crx =0; crx<fDDLModuleMap->GetNModPerDDL(); crx++){
+                               for(Int_t iside=0;iside<fgknSide;iside++){
+                                       Int_t moduleSDD = fDDLModuleMap->GetModuleNumber(ddl,crx);
+                       //AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
+                                       if(type == 1) sprintf(hnamePrevious,"hbase%02dc%02ds%d",ddl,crx,iside);
+                                       else if(type == 2) sprintf(hnamePrevious,"hnois%02dc%02ds%d",ddl,crx,iside);
+                                       else if(type == 3) sprintf(hnamePrevious,"hcmn%02dc%02ds%d",ddl,crx,iside);
+                                       else if(type == 4) sprintf(hnamePrevious,"hcorn%02dc%02ds%d",ddl,crx,iside);
+                                       else if(type == 5) sprintf(hnamePrevious,"hgain%02dc%02ds%d",ddl,crx,iside);
+                                       else if(type == 6) sprintf(hnamePrevious,"hdrsp%02dc%02ds%d",ddl,crx,iside);
+                               //AliInfo(Form("get histo %s\n",hnamePrevious));
+                                       TH1F *hhist = (TH1F *) gainFilePrevious->Get(hnamePrevious);
+                                       if(!hhist) continue;
+                                       for(Int_t i=0; i<hhist->GetNbinsX();i++) {
+                                               Current[moduleSDD-fgkmodoffset][iside][i] = hhist->GetBinContent(i);
+                                       }
+                                       delete hhist;
+                               }
+                       }
+               }
+               gainFilePrevious->Close();
+               delete gainFilePrevious;
+       }
+
+       Float_t xmin = 0.;
+       Float_t xmax = 0;
+       Int_t nbins = 1;
+       TH1F *hDist = 0;
+       TH1F *hDistDiff = 0;
+       if(type == 1) {
+               xmin = 0.;
+               xmax = 500.;
+               nbins = (Int_t)(xmax-xmin);
+               hDist = new TH1F("hBaseline","Baseline",nbins,xmin,xmax);
+               hDistDiff = new TH1F("hBaselineDiff","Baseline Difference",200,-100.,100.);
+       } else if(type == 2) {
+               xmin = 0.;
+               xmax = 10.;
+               nbins = (Int_t) (100.*(xmax-xmin));
+               hDist = new TH1F("hNoiseUnc","Noise (before correction)",nbins,xmin,xmax);
+               hDistDiff = new TH1F("hNoiseUncDiff","Noise (before correction) Difference",200,-10.,10.);
+       } else if(type == 3) {
+               xmin = 0.;
+               xmax = 10.;
+               nbins = (Int_t)( 100.*(xmax-xmin));
+               hDist = new TH1F("hNoiseCMN","Noise (common mode)",nbins,xmin,xmax);
+               hDistDiff = new TH1F("hNoiseCMNDiff","Noise (common mode) Difference",200,-10.,10.);
+       } else if(type == 4) {
+               xmin = 0.;
+               xmax = 10.;
+               nbins = (Int_t)(100.*(xmax-xmin));
+               hDist = new TH1F("hNoiseCor","Noise (after correction)",nbins,xmin,xmax);
+               hDistDiff = new TH1F("hNoiseCorDiff","Noise (after correction) Difference",200,-10.,10.);
+       } else if(type == 5) {
+               xmin = 0.;
+               xmax = 5.;
+               nbins = (Int_t)(100.*(xmax-xmin));
+               hDist = new TH1F("hGain","Gain",nbins,xmin,xmax);
+               hDistDiff = new TH1F("hGainDiff","Gain Difference",200,-10.,10.);
+       } else if(type == 6) {
+               xmin = 0.;
+               xmax = 10.;
+               nbins = (Int_t)(100.*(xmax-xmin));
+               hDist = new TH1F("hDriftSpeed","Drift Speed",nbins,xmin,xmax);
+               hDistDiff = new TH1F("hDriftSpeedDiff","Drift Speed Difference",200,-10.,10.);
+       }
+
+       Float_t binw = (xmax-xmin)/nbins;
+
+       for(Int_t k=0; k<6; k++) {
+               if(type < 6) sprintf(fnamePrevious,"SDDgainHistos%d.root",k+1);
+               else sprintf(fnamePrevious,"SDDinjectHistos%d.root",k+1);
+               TFile *gainFile = new TFile(fnamePrevious);
+               if(gainFile->IsZombie()) continue;
+
+               for(Int_t ddl =0; ddl<fDDLModuleMap->GetNDDLs(); ddl++){
+                       for(Int_t crx =0; crx<fDDLModuleMap->GetNModPerDDL(); crx++){
+                               for(Int_t iside=0;iside<fgknSide;iside++){
+                                       Int_t moduleSDD = fDDLModuleMap->GetModuleNumber(ddl,crx);
+                       //AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
+                                       if(type == 1) sprintf(hnamePrevious,"hbase%02dc%02ds%d",ddl,crx,iside);
+                                       else if(type == 2) sprintf(hnamePrevious,"hnois%02dc%02ds%d",ddl,crx,iside);
+                                       else if(type == 3) sprintf(hnamePrevious,"hcmn%02dc%02ds%d",ddl,crx,iside);
+                                       else if(type == 4) sprintf(hnamePrevious,"hcorn%02dc%02ds%d",ddl,crx,iside);
+                                       else if(type == 5) sprintf(hnamePrevious,"hgain%02dc%02ds%d",ddl,crx,iside);
+                                       else if(type == 6) sprintf(hnamePrevious,"hdrsp%02dc%02ds%d",ddl,crx,iside);
+                               //AliInfo(Form("get histo %s\n",hname));
+                                       TH1F *hhist = (TH1F *) gainFile->Get(hnamePrevious);
+                                       if(!hhist) continue;
+                                       for(Int_t i=0; i<hhist->GetNbinsX();i++) {
+                                               if(!fAnodeMap[moduleSDD-fgkmodoffset][iside][i]) continue;
+                                               hDist->Fill(hhist->GetBinContent(i));
+                                               hDistDiff->Fill(hhist->GetBinContent(i)-Current[moduleSDD-fgkmodoffset][iside][i]);
+                                       }
+                                       delete hhist;
+                               }
+                       }
+               }
+               gainFile->Close();
+               delete gainFile;
+
+       }
+       
+       TF1 ff("ff", "gaus", xmin+0.1, xmax-0.1);
+       hDist->Fit("ff","NWR");
+//     hDist->Fit("gaus","","",xmin+0.1, xmax-0.1);
+//     Float_t ChiSquared = (Float_t) ff.GetChisquare();
+//     Int_t NDF = ff.GetNumberFitPoints() - ff.GetNpar();
+       Float_t average = (Float_t) ff.GetParameter(1);
+       Float_t sigma = (Float_t) ff.GetParameter(2);
+//     Float_t mean = hDist->GetMean();
+//     Float_t rms = hDist->GetRMS();
+       Int_t badB = 0;
+       for(Int_t i=0; i<hDist->GetNbinsX();i++) {
+//             if(type < 6) 
+         if(TMath::Abs(i*binw-average) > 4.*sigma) badB += (Int_t)hDist->GetBinContent(i);
+//             else
+//                     if(TMath::Abs(i-mean) > 4*rms) badB += hDist->GetBinContent(i);
+       }
+       if(type == 1) {
+               AliInfo(Form("Number of anodes with baseline out of 4*sigma from average: %d, %f%%\n",badB,100.*((Float_t) badB)/hDist->GetEntries()));
+       } else if(type == 2) {
+               AliInfo(Form("Number of anodes with uncorrected noise out of 4*sigma from average: %d, %f%%\n",badB,100.*((Float_t) badB)/hDist->GetEntries()));
+       } else if(type == 3) {
+               AliInfo(Form("Number of anodes with common mode noise out of 4*sigma from average: %d, %f%%\n",badB,100.*((Float_t) badB)/hDist->GetEntries()));
+       } else if(type == 4) {
+               AliInfo(Form("Number of anodes with corrected noise out of 4*sigma from average: %d, %f%%\n",badB,100.*((Float_t) badB)/hDist->GetEntries()));
+       } else if(type == 5) {
+               AliInfo(Form("Number of anodes with gain out of 4*sigma from average: %d, %f%%\n",badB,100.*((Float_t) badB)/hDist->GetEntries()));
+       } else if(type == 6) {
+               Int_t badspeed = (Int_t)hDist->GetBinContent(1);
+               AliInfo(Form("Number of anodes with drift speed equal to 0: %d\n",badspeed));
+               AliInfo(Form("Number of anodes with drift speed out of 4*sigma from average: %d, %f%%\n",badB-badspeed,100.*((Float_t) (badB-badspeed))/(hDist->GetEntries()-badspeed)));
+       }
+       
+       TH1F *hDistHistoryCurrent = NULL;
+       TH1F *hDistHistoryPrevious = NULL;
+
+       TFile *gainHistoryFile;
+       if(type < 6) 
+               gainHistoryFile = new TFile("SDDgainHistory.root","UPDATE");
+       else
+               gainHistoryFile = new TFile("SDDinjectHistory.root","UPDATE");
+       hDist->Write();
+       hDistDiff->Write();
+       //AliInfo("SDDgainHistory.root file opened\n");
+       if(!gainHistoryFile->IsZombie()) {
+               if(type == 1) hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hBaselineHistory");
+               else if(type == 2) hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hNoiseUncHistory");
+               else if(type == 3) hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hNoiseCMNHistory");
+               else if(type == 4) hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hNoiseCorHistory");
+               else if(type == 5) hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hGainHistory");
+               else if(type == 6) hDistHistoryPrevious = (TH1F *) gainHistoryFile->Get("hDriftSpeedHistory");
+               //AliInfo(Form("hDistHistoryPrevious %x\n",hDistHistoryPrevious));
+       
+               if(!hDistHistoryPrevious) {
+                       if(type == 1) hDistHistoryCurrent = new TH1F("hBaselineHistory","Average Baseline History",1,0,1);
+                       else if(type == 2) hDistHistoryCurrent = new TH1F("hNoiseUncHistory","Average Uncorrected Noise History",1,0,1);
+                       else if(type == 3) hDistHistoryCurrent = new TH1F("hNoiseCMNHistory","Average Common Mode Noise History",1,0,1);
+                       else if(type == 4) hDistHistoryCurrent = new TH1F("hNoiseCorHistory","Average Corrected Noise History",1,0,1);
+                       else if(type == 5) hDistHistoryCurrent = new TH1F("hGainHistory","Average Gain History",1,0,1);
+                       else if(type == 6) hDistHistoryCurrent = new TH1F("hDriftSpeedHistory","Average Drift Speed History",1,0,1);
+                       //AliInfo(Form("hDistHistoryCurrent 1 %x\n",hDistHistoryCurrent));
+//                     if(type < 6) {
+                               hDistHistoryCurrent->SetBinContent(1,average);
+                               hDistHistoryCurrent->SetBinError(1,sigma);
+/*
+                       } else {
+                               hDistHistoryCurrent->SetBinContent(1,mean);
+                               hDistHistoryCurrent->SetBinError(1,rms);
+                       }
+*/
+               } else {
+                       if(type == 1) hDistHistoryCurrent = new TH1F("hBaselineHistory","Average Baseline History",hDistHistoryPrevious->GetNbinsX()+1,0,hDistHistoryPrevious->GetNbinsX()+1);
+                       else if(type == 2) hDistHistoryCurrent = new TH1F("hNoiseUncHistory","Average Uncorrected Noise History",hDistHistoryPrevious->GetNbinsX()+1,0,hDistHistoryPrevious->GetNbinsX()+1);
+                       else if(type == 3) hDistHistoryCurrent = new TH1F("hNoiseCMNHistory","Average Common Mode Noise History",hDistHistoryPrevious->GetNbinsX()+1,0,hDistHistoryPrevious->GetNbinsX()+1);
+                       else if(type == 4) hDistHistoryCurrent = new TH1F("hNoiseCorHistory","Average Corrected Noise History",hDistHistoryPrevious->GetNbinsX()+1,0,hDistHistoryPrevious->GetNbinsX()+1);
+                       else if(type == 5) hDistHistoryCurrent = new TH1F("hGainHistory","Average Gain History",hDistHistoryPrevious->GetNbinsX()+1,0,hDistHistoryPrevious->GetNbinsX()+1);
+                       else if(type == 6) hDistHistoryCurrent = new TH1F("hDriftSpeedHistory","Average Drift Speed History",hDistHistoryPrevious->GetNbinsX()+1,0,hDistHistoryPrevious->GetNbinsX()+1);
+                       //AliInfo(Form("hBaselineHistory 2 %x\n",hDistHistory));
+                       for(Int_t i=0;i<hDistHistoryPrevious->GetNbinsX();i++) {
+                               hDistHistoryCurrent->SetBinContent(i,hDistHistoryPrevious->GetBinContent(i));
+                               hDistHistoryCurrent->SetBinError(i,hDistHistoryPrevious->GetBinError(i));
+                       }
+                       hDistHistoryCurrent->SetBinContent(hDistHistoryPrevious->GetNbinsX(),average);
+                       hDistHistoryCurrent->SetBinError(hDistHistoryPrevious->GetNbinsX(),sigma);
+               }
+       }
+       hDistHistoryCurrent->Write();
+       gainHistoryFile->Close();
+       delete gainHistoryFile;
+//     delete hname;
+       delete hDist;
+       delete hDistDiff;
+}//_______________________________________________________________
+
index 8e6a1f6..24839ea 100644 (file)
@@ -10,7 +10,6 @@
 //
 //
 //  W. Ferrarese + P. Cerello Feb 2008
-//  M.Siciliano Aug 2008 QA RecPoints and HLT mode
 
 /* $Id$ */
 
@@ -19,7 +18,6 @@
 
 class TObjArray;
 class AliITSDDLModuleMapSDD;
-class AliITSHLTforSDD;
 class AliITSQASDDDataMakerRec: public TObject {
 
 public:
@@ -39,15 +37,15 @@ public:
 
   virtual ~AliITSQASDDDataMakerRec(); // dtor
   Int_t GetOffset(AliQAv1::TASKINDEX_t task);
-  void  SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset);
+  void  SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie = 0);
   Int_t GetTaskHisto(AliQAv1::TASKINDEX_t task);
 
-  void SetHLTMode(Bool_t khltmode=kFALSE){fHLTMode=khltmode;};
-  Bool_t GetHLTMode(){return fHLTMode;};
-  void SetHLTModeFromEnvironment();
-
 private:
 
+       void AnalyseBNG();                       // Analyse ROOT files with baselines, noise, gains
+       void AnalyseINJ();                                              // Analyse ROOT files with drift speed
+       void AnodeStatus();                                             // Check Anode Status changes (0 = bad, 1 = good)
+       void AnalyseHistos(Int_t type);                         // Analyse Histos type: 1 = Baseline, 2 = Noise (Uncorrected), 3 = Noise (Common Mode), 4 = Noise (Corrected), 5 = Gain, 6 = Drift Speed
   static const Int_t fgknSDDmodules = 260; // number of SDD modules
   static const Int_t fgkmodoffset = 240;   // number of SPD modules
   static const Int_t fgknAnode = 256;      // anode per half-module
@@ -62,15 +60,18 @@ private:
   Int_t   fSDDhRawsTask;                      // number of histo booked for each the Raws Task SDD
   Int_t   fSDDhDigitsTask;                    // number of histo booked for each the RecPoints Task SDD
   Int_t   fSDDhRecPointsTask;                 // number of histo booked for each the RecPoints Task SDD
-  Int_t   fGenRawsOffset;                     // QAchecking Raws offset       
+  Int_t   *fGenRawsOffset;                     // QAchecking Raws offset       
   Int_t   fGenDigitsOffset;                   // QAchecking RecPoints offset       
-  Int_t   fGenRecPointsOffset;                // QAchecking RecPoints offset       
+  Int_t   *fGenRecPointsOffset;                // QAchecking RecPoints offset       
   Int_t   fTimeBinSize;                              // time bin width in number of clocks
   AliITSDDLModuleMapSDD  *fDDLModuleMap;      // SDD Detector configuration for the decoding
-  Bool_t fHLTMode;                            // kTRUE mode C kFALSE mode A 
-                                              // Used in online mode only
-  AliITSHLTforSDD *fHLTSDD;                   // used for offline QA as the HLT mode flag
-  ClassDef(AliITSQASDDDataMakerRec,7)         // description 
+
+  Bool_t fAnodeMap[fgknSDDmodules][fgknSide][fgknAnode];  // Array of anode status 1 = ok, 0 = bad
+  Int_t   fGoodAnodes;
+  Int_t   fBadAnodes;
+  Int_t   fGoodAnodesCurrent;
+  Int_t   fBadAnodesCurrent;
+  ClassDef(AliITSQASDDDataMakerRec,8)         // description 
 
 };
 
index 080f18a..9893215 100644 (file)
@@ -59,6 +59,13 @@ fGenRecPointsOffset(0),
 fAdvLogger(aliITSRawStreamSPDErrorLog) 
 {
   //ctor used to discriminate OnLine-Offline analysis  
+  //AliInfo(Form("AliRecoParam::kNSpecies %d\n",AliRecoParam::kNSpecies));
+       fGenRawsOffset = new Int_t[AliRecoParam::kNSpecies];
+       fGenRecPointsOffset = new Int_t[AliRecoParam::kNSpecies];
+       for(Int_t i=0; i<AliRecoParam::kNSpecies;i++) {
+               fGenRawsOffset[i] = 0;
+               fGenRecPointsOffset[i] = 0;
+       }
 }
 
 //____________________________________________________________________________ 
@@ -129,7 +136,7 @@ Int_t AliITSQASPDDataMakerRec::InitRaws()
   TH1F *hlayer = new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.);
   hlayer->GetXaxis()->SetTitle("Layer number");
   hlayer->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RawsList(hlayer, 0+fGenRawsOffset, expert, !image, !saveCorr);
+  rv = fAliITSQADataMakerRec->Add2RawsList(hlayer, 0+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
   fSPDhRawsTask++;
 
   TH1F **hmod = new TH1F*[2];
@@ -141,7 +148,7 @@ Int_t AliITSQASPDDataMakerRec::InitRaws()
     hmod[iLay]=new TH1F(name,title,fgknSPDmodules,0,fgknSPDmodules);
     hmod[iLay]->GetXaxis()->SetTitle("Module number");
     hmod[iLay]->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RawsList(hmod[iLay], 1+iLay+fGenRawsOffset, !expert, image, !saveCorr);
+    rv = fAliITSQADataMakerRec->Add2RawsList(hmod[iLay], 1+iLay+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
     fSPDhRawsTask++;
   }
   for (Int_t iDDL=0; iDDL<20; iDDL++) {
@@ -150,14 +157,14 @@ Int_t AliITSQASPDDataMakerRec::InitRaws()
     hhitMap[iDDL]=new TH2F(name,title,320,0,10*32,1536,0,6*256);
     hhitMap[iDDL]->GetXaxis()->SetTitle("Column");
     hhitMap[iDDL]->GetYaxis()->SetTitle("Row");
-    rv = fAliITSQADataMakerRec->Add2RawsList(hhitMap[iDDL], 3+(2*iDDL)+fGenRawsOffset, expert, !image, !saveCorr);
+    rv = fAliITSQADataMakerRec->Add2RawsList(hhitMap[iDDL], 3+(2*iDDL)+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
     fSPDhRawsTask++;
     sprintf(name,"SPDErrors_SPD_DDL%d",iDDL+1);
     sprintf(title,"Error codes - SPD DDL %d",iDDL+1);
     herrors[iDDL] = new TH1F (name,title,fAdvLogger->GetNrErrorCodes(),0,fAdvLogger->GetNrErrorCodes());
     herrors[iDDL]->SetXTitle("Error Code");
     herrors[iDDL]->SetYTitle("Nr of errors");
-    rv = fAliITSQADataMakerRec->Add2RawsList(herrors[iDDL], 4+(2*iDDL)+fGenRawsOffset, expert, !image, !saveCorr);
+    rv = fAliITSQADataMakerRec->Add2RawsList(herrors[iDDL], 4+(2*iDDL)+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
     fSPDhRawsTask++;
   }
 
@@ -168,7 +175,7 @@ Int_t AliITSQASPDDataMakerRec::InitRaws()
     hMultSPDhits[iLay]=new TH1F(name,title,200,0.,200.);
     hMultSPDhits[iLay]->GetXaxis()->SetTitle("Hit multiplicity");
     hMultSPDhits[iLay]->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RawsList(hMultSPDhits[iLay], 43+iLay+fGenRawsOffset, expert, !image, !saveCorr);
+    rv = fAliITSQADataMakerRec->Add2RawsList(hMultSPDhits[iLay], 43+iLay+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
     fSPDhRawsTask++;
   }
 
@@ -176,7 +183,7 @@ Int_t AliITSQASPDDataMakerRec::InitRaws()
          = new TH2F("SPDHitMultCorrelation_SPD","Hit multiplicity correlation - SPD",200,0.,200.,200,0.,200.);
   hMultSPDhits2MultSPDhits1->GetXaxis()->SetTitle("Hit multiplicity (Layer 1)");
   hMultSPDhits2MultSPDhits1->GetYaxis()->SetTitle("Hit multiplicity (Layer 2)");
-  rv = fAliITSQADataMakerRec->Add2RawsList(hMultSPDhits2MultSPDhits1, 45+fGenRawsOffset, !expert, image, !saveCorr);
+  rv = fAliITSQADataMakerRec->Add2RawsList(hMultSPDhits2MultSPDhits1, 45+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr);
   fSPDhRawsTask++;
  
   AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SPD Raws histograms booked\n",fSPDhRawsTask));
@@ -214,28 +221,28 @@ Int_t AliITSQASPDDataMakerRec::MakeRaws(AliRawReader* rawReader)
       if (iHalfStave>=0 && iHalfStave<2) iLayer=0;
       else iLayer=1;
       
-      fAliITSQADataMakerRec->GetRawsData(0+fGenRawsOffset)->Fill(iLayer);
+      fAliITSQADataMakerRec->GetRawsData(0+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iLayer);
       if (iLayer==0) {
-        fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset)->Fill(module);
+        fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(module);
         nDigitsL1++;
       } else {
-        fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset)->Fill(module);
+        fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(module);
         nDigitsL2++;
       }
       
-      fAliITSQADataMakerRec->GetRawsData((2*iEq)+3+fGenRawsOffset)->Fill(colM+(module%2)*160,rowM+iHalfStave*256);
+      fAliITSQADataMakerRec->GetRawsData((2*iEq)+3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(colM+(module%2)*160,rowM+iHalfStave*256);
     }
 
   }
-  for (Int_t ieq=0; ieq<20; ieq++)
-    for (UInt_t ierr=0; ierr<fAdvLogger->GetNrErrorCodes(); ierr++)
-      fAliITSQADataMakerRec->GetRawsData((2*ieq)+4+fGenRawsOffset)->Fill(ierr,fAdvLogger->GetNrErrors(ierr,ieq));
+  for (Int_t ieq=0; ieq<20; ieq++) {
+    for (UInt_t ierr=0; ierr<fAdvLogger->GetNrErrorCodes(); ierr++) 
+      fAliITSQADataMakerRec->GetRawsData((2*ieq)+4+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(ierr,fAdvLogger->GetNrErrors(ierr,ieq));
+       }
 
   fAdvLogger->Reset();
-  fAliITSQADataMakerRec->GetRawsData(43+fGenRawsOffset)->Fill(nDigitsL1);
-  fAliITSQADataMakerRec->GetRawsData(44+fGenRawsOffset)->Fill(nDigitsL2);
-  fAliITSQADataMakerRec->GetRawsData(45+fGenRawsOffset)->Fill(nDigitsL1,nDigitsL2);
+  fAliITSQADataMakerRec->GetRawsData(43+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nDigitsL1);
+  fAliITSQADataMakerRec->GetRawsData(44+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nDigitsL2);
+  fAliITSQADataMakerRec->GetRawsData(45+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nDigitsL1,nDigitsL2);
   
   delete rawStreamSPD;  
   AliDebug(AliQAv1::GetQADebugLevel(),Form("Event completed, %d raw digits read",nDigitsL1+nDigitsL2));
@@ -360,11 +367,13 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
   const Bool_t expert   = kTRUE ; 
   const Bool_t image    = kTRUE ; 
   Int_t rv = 0 ; 
+  //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie()));
+  //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
 //  fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
   TH1F* hlayer= new TH1F("SPDLayPattern_SPD","Layer map - SPD",6,0.,6.);
   hlayer->GetXaxis()->SetTitle("Layer number");
   hlayer->GetYaxis()->SetTitle("Entries");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(hlayer, 0+fGenRecPointsOffset, expert, !image); 
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(hlayer, 0+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image); 
   fSPDhRecPointsTask++;
 
   TH1F** hmod = new TH1F*[2];
@@ -390,7 +399,7 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
     hmod[iLay]=new TH1F(name,title,fgknSPDmodules,0,fgknSPDmodules);
     hmod[iLay]->GetXaxis()->SetTitle("Module number");
     hmod[iLay]->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList(hmod[iLay], 1+(10*iLay)+fGenRecPointsOffset, expert, !image); 
+    rv = fAliITSQADataMakerRec->Add2RecPointsList(hmod[iLay], 1+(10*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image); 
     fSPDhRecPointsTask++;
 
     sprintf(name,"SPDxLoc_SPD%d",iLay+1);
@@ -398,7 +407,7 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
     hxl[iLay]=new TH1F(name,title,100,-4.,4.);
     hxl[iLay]->GetXaxis()->SetTitle("Local x [cm]");
     hxl[iLay]->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList(hxl[iLay], 2+(10*iLay)+fGenRecPointsOffset, expert, !image);
+    rv = fAliITSQADataMakerRec->Add2RecPointsList(hxl[iLay], 2+(10*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
     fSPDhRecPointsTask++;
 
     sprintf(name,"SPDzLoc_SPD%d",iLay+1);
@@ -406,7 +415,7 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
     hzl[iLay]=new TH1F(name,title,100,-4.,4.);
     hzl[iLay]->GetXaxis()->SetTitle("Local z [cm]");
     hzl[iLay]->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList(hzl[iLay], 3+(10*iLay)+fGenRecPointsOffset, expert, !image); 
+    rv = fAliITSQADataMakerRec->Add2RecPointsList(hzl[iLay], 3+(10*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image); 
     fSPDhRecPointsTask++;
 
     sprintf(name,"SPDxGlob_SPD%d",iLay+1);
@@ -414,7 +423,7 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
     hxg[iLay]=new TH1F(name,title,100,-xlim[iLay],xlim[iLay]);
     hxg[iLay]->GetXaxis()->SetTitle("Global x [cm]");
     hxg[iLay]->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList(hxg[iLay],4+(10*iLay)+fGenRecPointsOffset, expert, !image);  
+    rv = fAliITSQADataMakerRec->Add2RecPointsList(hxg[iLay],4+(10*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);  
     fSPDhRecPointsTask++;
 
     sprintf(name,"SPDyGlob_SPD%d",iLay+1);
@@ -422,7 +431,7 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
     hyg[iLay]=new TH1F(name,title,100,-xlim[iLay],xlim[iLay]);
     hyg[iLay]->GetXaxis()->SetTitle("Global y [cm]");
     hyg[iLay]->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList(hyg[iLay], 5+(10*iLay)+fGenRecPointsOffset, expert, !image); 
+    rv = fAliITSQADataMakerRec->Add2RecPointsList(hyg[iLay], 5+(10*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image); 
     fSPDhRecPointsTask++;
 
     sprintf(name,"SPDzGlob_SPD%d",iLay+1);
@@ -430,7 +439,7 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
     hzg[iLay]=new TH1F(name,title,150,-zlim[iLay],zlim[iLay]);
     hzg[iLay]->GetXaxis()->SetTitle("Global z [cm]");
     hzg[iLay]->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList(hzg[iLay], 6+(10*iLay)+fGenRecPointsOffset, expert, !image); 
+    rv = fAliITSQADataMakerRec->Add2RecPointsList(hzg[iLay], 6+(10*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image); 
     fSPDhRecPointsTask++;
 
     sprintf(name,"SPDr_SPD%d",iLay+1);
@@ -438,7 +447,7 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
     hr[iLay]=new TH1F(name,title,100,0.,10.);
     hr[iLay]->GetXaxis()->SetTitle("r [cm]");
     hr[iLay]->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList(hr[iLay], 7+(10*iLay)+fGenRecPointsOffset, expert, !image);  
+    rv = fAliITSQADataMakerRec->Add2RecPointsList(hr[iLay], 7+(10*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);  
     fSPDhRecPointsTask++;
 
     sprintf(name,"SPDphi_SPD%d",iLay+1);
@@ -446,7 +455,7 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
     hphi[iLay]=new TH1F(name,title,1000,0.,2*TMath::Pi());
     hphi[iLay]->GetXaxis()->SetTitle("#varphi [rad]");
     hphi[iLay]->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList(hphi[iLay], 8+(10*iLay)+fGenRecPointsOffset, expert, !image);
+    rv = fAliITSQADataMakerRec->Add2RecPointsList(hphi[iLay], 8+(10*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
     fSPDhRecPointsTask++;
     
     sprintf(name,"SPDSizeYvsZ_SPD%d",iLay+1);
@@ -454,7 +463,7 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
     hNyNz[iLay]=new TH2F(name,title,100,0.,100.,100,0.,100.);
     hNyNz[iLay]->GetXaxis()->SetTitle("z length");
     hNyNz[iLay]->GetYaxis()->SetTitle("y length");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList(hNyNz[iLay], 9+(10*iLay)+fGenRecPointsOffset, expert, !image); 
+    rv = fAliITSQADataMakerRec->Add2RecPointsList(hNyNz[iLay], 9+(10*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image); 
     fSPDhRecPointsTask++;
 
     sprintf(name,"SPDphi_z_SPD%d",iLay+1);
@@ -462,7 +471,7 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
     hPhiZ[iLay]=new TH2F(name,title,150,-zlim[iLay],zlim[iLay],200,0.,2*TMath::Pi());
     hPhiZ[iLay]->GetXaxis()->SetTitle("Global z [cm]");
     hPhiZ[iLay]->GetYaxis()->SetTitle("#varphi [rad]");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList(hPhiZ[iLay], 10+(10*iLay)+fGenRecPointsOffset, !expert, image);
+    rv = fAliITSQADataMakerRec->Add2RecPointsList(hPhiZ[iLay], 10+(10*iLay)+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
     fSPDhRecPointsTask++;
 
   }
@@ -470,13 +479,13 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
   TH2F *hrPhi=new TH2F("SPDr_phi_SPD","#varphi vs r - SPD",100,0.,10.,100,0.,2*TMath::Pi());
   hrPhi->GetXaxis()->SetTitle("r [cm]");
   hrPhi->GetYaxis()->SetTitle("#varphi [rad]");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(hrPhi, 21+fGenRecPointsOffset, expert, !image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(hrPhi, 21+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);
   fSPDhRecPointsTask++;
 
   TH2F *hxy=new TH2F("SPDx_y_SPD","Global y vs x - SPD",200,-10.,10.,200,-10.,10.);
   hxy->GetXaxis()->SetTitle("Global x [cm]");
   hxy->GetYaxis()->SetTitle("Global y [cm]");
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(hxy, 22+fGenRecPointsOffset, !expert, image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(hxy, 22+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
   fSPDhRecPointsTask++;
 
   for (Int_t iLay=0;iLay<2;iLay++) {
@@ -485,7 +494,7 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
     hMultSPDcl[iLay]=new TH1F(name,title,200,0.,200.);
     hMultSPDcl[iLay]->GetXaxis()->SetTitle("Cluster multiplicity");
     hMultSPDcl[iLay]->GetYaxis()->SetTitle("Entries");
-    rv = fAliITSQADataMakerRec->Add2RecPointsList(hMultSPDcl[iLay], 23+iLay+fGenRecPointsOffset, !expert, image);
+    rv = fAliITSQADataMakerRec->Add2RecPointsList(hMultSPDcl[iLay], 23+iLay+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
     fSPDhRecPointsTask++;
   } 
 
@@ -493,7 +502,7 @@ Int_t AliITSQASPDDataMakerRec::InitRecPoints()
         new TH2F("SPDMultCorrelation_SPD","Cluster multiplicity correlation - SPD",200,0.,200.,200,0.,200.);
   hMultSPDcl2MultSPDcl1->GetXaxis()->SetTitle("Clusters multiplicity (Layer 1)");
   hMultSPDcl2MultSPDcl1->GetYaxis()->SetTitle("Clusters multiplicity (Layer 2)"); 
-  rv = fAliITSQADataMakerRec->Add2RecPointsList(hMultSPDcl2MultSPDcl1, 25+fGenRecPointsOffset, !expert, image);
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(hMultSPDcl2MultSPDcl1, 25+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image);
   fSPDhRecPointsTask++;
 
   AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SPD Recs histograms booked\n",fSPDhRecPointsTask));
@@ -514,6 +523,8 @@ Int_t AliITSQASPDDataMakerRec::MakeRecPoints(TTree * clusterTree)
     return rv;
   }
   
+  //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie()));
+  //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
   itsClusterBranch->SetAddress(&ITSCluster);
   Int_t nItsMods = (Int_t)clusterTree->GetEntries();
   
@@ -530,44 +541,44 @@ Int_t AliITSQASPDDataMakerRec::MakeRecPoints(TTree * clusterTree)
       
       if (cluster->GetLayer()>1)        continue;
       Int_t lay=cluster->GetLayer();
-      fAliITSQADataMakerRec->GetRecPointsData(0 +fGenRecPointsOffset)->Fill(lay);
+      fAliITSQADataMakerRec->GetRecPointsData(0 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(lay);
       cluster->GetGlobalXYZ(cluGlo);
       Float_t rad=TMath::Sqrt(cluGlo[0]*cluGlo[0]+cluGlo[1]*cluGlo[1]);
         Float_t phi= TMath::Pi() + TMath::ATan2(-cluGlo[1],-cluGlo[0]);
         if (lay==0) {
-         fAliITSQADataMakerRec->GetRecPointsData(1 +fGenRecPointsOffset)->Fill(iIts);
-         fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalX());
-         fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalZ());
-         fAliITSQADataMakerRec->GetRecPointsData(4 +fGenRecPointsOffset)->Fill(cluGlo[0]);
-         fAliITSQADataMakerRec->GetRecPointsData(5 +fGenRecPointsOffset)->Fill(cluGlo[1]);
-         fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset)->Fill(cluGlo[2]);
-         fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset)->Fill(rad);
-         fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset)->Fill(phi);
-         fAliITSQADataMakerRec->GetRecPointsData(9 +fGenRecPointsOffset)->Fill(cluster->GetNz(),cluster->GetNy());
-         fAliITSQADataMakerRec->GetRecPointsData(10 +fGenRecPointsOffset)->Fill(cluGlo[2],phi);
+         fAliITSQADataMakerRec->GetRecPointsData(1 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iIts);
+         fAliITSQADataMakerRec->GetRecPointsData(2 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetDetLocalX());
+         fAliITSQADataMakerRec->GetRecPointsData(3 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetDetLocalZ());
+         fAliITSQADataMakerRec->GetRecPointsData(4 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[0]);
+         fAliITSQADataMakerRec->GetRecPointsData(5 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[1]);
+         fAliITSQADataMakerRec->GetRecPointsData(6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[2]);
+         fAliITSQADataMakerRec->GetRecPointsData(7 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad);
+         fAliITSQADataMakerRec->GetRecPointsData(8 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(phi);
+         fAliITSQADataMakerRec->GetRecPointsData(9 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetNz(),cluster->GetNy());
+         fAliITSQADataMakerRec->GetRecPointsData(10 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[2],phi);
        } else  {
-          fAliITSQADataMakerRec->GetRecPointsData(11 +fGenRecPointsOffset)->Fill(iIts);
-          fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalX());
-          fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset)->Fill(cluster->GetDetLocalZ());
-          fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset)->Fill(cluGlo[0]);
-          fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset)->Fill(cluGlo[1]);
-          fAliITSQADataMakerRec->GetRecPointsData(16 +fGenRecPointsOffset)->Fill(cluGlo[2]);
-          fAliITSQADataMakerRec->GetRecPointsData(17 +fGenRecPointsOffset)->Fill(rad);
-          fAliITSQADataMakerRec->GetRecPointsData(18 +fGenRecPointsOffset)->Fill(phi);
-          fAliITSQADataMakerRec->GetRecPointsData(19 +fGenRecPointsOffset)->Fill(cluster->GetNz(),cluster->GetNy());
-          fAliITSQADataMakerRec->GetRecPointsData(20 +fGenRecPointsOffset)->Fill(cluGlo[2],phi);
+          fAliITSQADataMakerRec->GetRecPointsData(11 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(iIts);
+          fAliITSQADataMakerRec->GetRecPointsData(12 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetDetLocalX());
+          fAliITSQADataMakerRec->GetRecPointsData(13 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetDetLocalZ());
+          fAliITSQADataMakerRec->GetRecPointsData(14 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[0]);
+          fAliITSQADataMakerRec->GetRecPointsData(15 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[1]);
+          fAliITSQADataMakerRec->GetRecPointsData(16 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[2]);
+          fAliITSQADataMakerRec->GetRecPointsData(17 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad);
+          fAliITSQADataMakerRec->GetRecPointsData(18 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(phi);
+          fAliITSQADataMakerRec->GetRecPointsData(19 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluster->GetNz(),cluster->GetNy());
+          fAliITSQADataMakerRec->GetRecPointsData(20 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[2],phi);
         }
-        fAliITSQADataMakerRec->GetRecPointsData(21 +fGenRecPointsOffset)->Fill(rad,phi);
-        fAliITSQADataMakerRec->GetRecPointsData(22 +fGenRecPointsOffset)->Fill(cluGlo[0],cluGlo[1]);
+        fAliITSQADataMakerRec->GetRecPointsData(21 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(rad,phi);
+        fAliITSQADataMakerRec->GetRecPointsData(22 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluGlo[0],cluGlo[1]);
        
        nClusters[lay]++; 
     } // end of cluster loop
   } // end of its "subdetector" loop
   
   for (Int_t iLay=0; iLay<2; iLay++)
-    fAliITSQADataMakerRec->GetRecPointsData(23+iLay +fGenRecPointsOffset)->Fill(nClusters[iLay]);
+    fAliITSQADataMakerRec->GetRecPointsData(23+iLay +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nClusters[iLay]);
   
-  fAliITSQADataMakerRec->GetRecPointsData(25 +fGenRecPointsOffset)->Fill(nClusters[0],nClusters[1]);
+  fAliITSQADataMakerRec->GetRecPointsData(25 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(nClusters[0],nClusters[1]);
   
   statITSCluster.Clear();
   return rv ;
@@ -581,39 +592,33 @@ Int_t AliITSQASPDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task) {
   // Returns offset number according to the specified task
   Int_t offset=0;
   if( task == AliQAv1::kRAWS ) {
-    offset=fGenRawsOffset;
+    offset=fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()];
   }
   else if( task == AliQAv1::kDIGITSR ) {
     offset=fGenDigitsOffset;
   }
   else if( task == AliQAv1::kRECPOINTS ) {
-    offset=fGenRecPointsOffset;
+    offset=fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()];
   }
   else if( task == AliQAv1::kDIGITS ) {
     offset=fGenDigitsOffset;
   }
-  else {
-    AliInfo("No task has been selected. Offset set to zero.\n");
-  }
 
   return offset;
 }
 
 //_______________________________________________________________
 
-void AliITSQASPDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset) {
+void AliITSQASPDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie) {
   // Returns offset number according to the specified task
   if( task == AliQAv1::kRAWS ) {
-   fGenRawsOffset=offset;
+    fGenRawsOffset[specie]=offset;
   }
   else if( task == AliQAv1::kDIGITSR ) {
     fGenDigitsOffset=offset;
   }
   else if( task == AliQAv1::kRECPOINTS ) {
-    fGenRecPointsOffset=offset;
-  }
-   else {
-    AliInfo("No task has been selected. Offset set to zero.\n");
+    fGenRecPointsOffset[specie]=offset;
   }
 }
 
index fc2ddf2..eab24e3 100644 (file)
@@ -39,7 +39,7 @@ public:
   virtual void  EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArray * list);
   virtual ~AliITSQASPDDataMakerRec();   // dtor
   Int_t GetOffset(AliQAv1::TASKINDEX_t task);
-  void  SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset);
+  void  SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie = 0);
   Int_t GetTaskHisto(AliQAv1::TASKINDEX_t task);
 
 private: 
@@ -54,12 +54,12 @@ private:
   Int_t   fSPDhRawsTask;                      // number of booked SPD histograms for the Raws Task
   Int_t   fSPDhDigitsTask;                    // number of booked SPD histograms for the RecPoints Task
   Int_t   fSPDhRecPointsTask;                 // number of booked SPD histograms for the RecPoints Task
-  Int_t   fGenRawsOffset;                     // QAchecking Raws offset
+  Int_t   *fGenRawsOffset;                     // QAchecking Raws offset
   Int_t   fGenDigitsOffset;                   // QAchecking Digits offset
-  Int_t   fGenRecPointsOffset;                // QAchecking RecPoints offset
+  Int_t   *fGenRecPointsOffset;                // QAchecking RecPoints offset
   AliITSRawStreamSPDErrorLog *fAdvLogger;  // pointer to special error logger object
 
-  ClassDef(AliITSQASPDDataMakerRec,4)      // description 
+  ClassDef(AliITSQASPDDataMakerRec,5)      // description 
 
 };
 
index b351cc1..92825fb 100644 (file)
@@ -68,6 +68,12 @@ fGenRecPointsOffset(0),
 fCDBManager(0) {
   // Default constructor   
   //initilize the raw signal vs strip number histograms
+       fGenRawsOffset = new Int_t[AliRecoParam::kNSpecies];
+       fGenRecPointsOffset = new Int_t[AliRecoParam::kNSpecies];
+       for(Int_t i=0; i<AliRecoParam::kNSpecies; i++) {
+               fGenRawsOffset[i] = 0;
+               fGenRecPointsOffset[i] = 0;
+       }
   if(fkOnline) {
     fCDBManager = AliCDBManager::Instance();
     //fCDBManager->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
@@ -146,6 +152,7 @@ AliITSQASSDDataMakerRec::~AliITSQASSDDataMakerRec() {
 //____________________________________________________________________________ 
 void AliITSQASSDDataMakerRec::StartOfDetectorCycle()
 {
+
   if (  fAliITSQADataMakerRec->GetRawsData(0) == NULL ) // Raws not defined
     return ; 
 
@@ -153,9 +160,9 @@ void AliITSQASSDDataMakerRec::StartOfDetectorCycle()
   AliDebug(AliQAv1::GetQADebugLevel(),"AliITSQADM::Start of SSD Cycle\n");    
 
   //Data size per DDL
-  ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+4)))->Reset();
+  ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+4)))->Reset();
   //Data size per LDC
-  ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+22)))->Reset();
+  ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+22)))->Reset();
 
   //online part
   if(fkOnline) {
@@ -172,12 +179,12 @@ void AliITSQASSDDataMakerRec::StartOfDetectorCycle()
       gHistPositionOccupancyPerLadder = (gLayer == 5) ? 2*(gLadder - 1) : 2*(gLadder - 1 + fgkSSDLADDERSLAYER5);
       
       //P-SIDE OCCUPANCY
-      fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder)->Reset();
+      fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder)->Reset();
       //N-SIDE OCCUPANCY
-      fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder+1)->Reset();
+      fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder+1)->Reset();
 
-      ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6))->Reset();
-      ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1))->Reset();
+      ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6))->Reset();
+      ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1))->Reset();
     }//module loop
   }//online flag
 }
@@ -188,21 +195,21 @@ void AliITSQASSDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/,
   // launch the QA checking
   // launch the QA checking
   AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); 
-  AliDebug(AliQAv1::GetQADebugLevel(), Form("Offset: %d\n",fGenRawsOffset));
+  AliDebug(AliQAv1::GetQADebugLevel(), Form("Offset: %d\n",fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
 
   if (fAliITSQADataMakerRec->GetRawsData(0) != NULL ) {
     //Data size per DDL
     for(Int_t i = 0; i < fgkNumOfDDLs; i++) {
-      Double_t gSizePerDDL = ((TH1D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+5+i))->GetMean();
+      Double_t gSizePerDDL = ((TH1D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+5+i))->GetMean();
       //cout<<"DDL: "<<i+2<<" - Size: "<<gSizePerDDL<<" - Mean: "<<
-      //(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+5+i))->GetMean()<<endl;
-      ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+4)))->SetBinContent(i+512,gSizePerDDL);
+      //(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+5+i))->GetMean()<<endl;
+      ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+4)))->SetBinContent(i+512,gSizePerDDL);
     }
     
     //Data size per LDC
     for(Int_t i = 0; i < fgkNumOfLDCs; i++) {
-      Double_t gSizePerLDC = ((TH1D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+23+i))->GetMean();
-      ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+22)))->SetBinContent(i+170,gSizePerLDC);
+      Double_t gSizePerLDC = ((TH1D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+23+i))->GetMean();
+      ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+22)))->SetBinContent(i+170,gSizePerLDC);
     }
   }//raw data end of cycle
 
@@ -219,10 +226,10 @@ void AliITSQASSDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/,
 
       gHistPositionOccupancyPerModule = (gLayer == 5) ? ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER5 + gModule - 1) : ((gLadder - 1)*fgkSSDMODULESPERLADDERLAYER6 + gModule + fgkSSDMODULESLAYER5 - 1);
       for(Int_t iBins = 1; iBins < fHistSSDRawSignalModule[iModule]->GetXaxis()->GetNbins(); iBins++)
-       fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule)->SetBinContent(iBins,fOccupancyMatrix[iModule][iBins-1]);
+       fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule)->SetBinContent(iBins,fOccupancyMatrix[iModule][iBins-1]);
       
       if(fSSDEventPerCycle != 0)
-       ((TH1F *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule)))->Scale(100./fSSDEventPerCycle);
+       ((TH1F *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule)))->Scale(100./fSSDEventPerCycle);
     }//module loop
 
     //occupancy per ladder
@@ -236,50 +243,50 @@ void AliITSQASSDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/,
       gHistPositionOccupancyPerLadder = (gLayer == 5) ? 2*(gLadder - 1) : 2*(gLadder - 1 + fgkSSDLADDERSLAYER5);
       
       //P-SIDE OCCUPANCY
-      occupancy = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),0,0,0);
-      occupancyThreshold = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),0,1,3);
-      occupancyAverage = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),0,2,0);
+      occupancy = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),0,0,0);
+      occupancyThreshold = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),0,1,3);
+      occupancyAverage = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),0,2,0);
 
-      fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder)->Fill(gModule,occupancy);
+      fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder)->Fill(gModule,occupancy);
       lLadderLocationY = 3*gLadder; // sideP=1 sideN=0 
       if(gLayer == 5) {
        //occupancy per module - no threshold
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6))->SetBinContent(gModule,lLadderLocationY,occupancy);
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6))->SetBinContent(gModule,lLadderLocationY,occupancy);
        //occupancy per module - threshold @ 3%
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+2))->SetBinContent(gModule,lLadderLocationY,occupancyThreshold);
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+2))->SetBinContent(gModule,lLadderLocationY,occupancyThreshold);
        //average occupancy per module
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+4))->SetBinContent(gModule,lLadderLocationY,occupancyAverage);
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+4))->SetBinContent(gModule,lLadderLocationY,occupancyAverage);
       }
       else if(gLayer == 6) {
        //occupancy per module - no threshold
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1))->SetBinContent(gModule,lLadderLocationY,occupancy);
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1))->SetBinContent(gModule,lLadderLocationY,occupancy);
        //occupancy per module - threshold @ 3%
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+3))->SetBinContent(gModule,lLadderLocationY,occupancyThreshold);
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+3))->SetBinContent(gModule,lLadderLocationY,occupancyThreshold);
        //average occupancy per module
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+5))->SetBinContent(gModule,lLadderLocationY,occupancyAverage);
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+5))->SetBinContent(gModule,lLadderLocationY,occupancyAverage);
       }
 
       //N-SIDE OCCUPANCY
-      occupancy = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),1,0,0);   
-      occupancyThreshold = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),1,1,3);   
-      occupancyAverage = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),1,2,0);   
+      occupancy = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),1,0,0);   
+      occupancyThreshold = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),1,1,3);   
+      occupancyAverage = GetOccupancyModule((TH1 *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+gHistPositionOccupancyPerModule),1,2,0);   
 
-      fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder+1)->Fill(gModule,occupancy);
+      fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+gHistPositionOccupancyPerLadder+1)->Fill(gModule,occupancy);
       if(gLayer == 5) {
        //occupancy per module - no threshold
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6))->SetBinContent(gModule,lLadderLocationY-1,occupancy);
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6))->SetBinContent(gModule,lLadderLocationY-1,occupancy);
        //occupancy per module - threshold @ 3%
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+2))->SetBinContent(gModule,lLadderLocationY-1,occupancyThreshold);
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+2))->SetBinContent(gModule,lLadderLocationY-1,occupancyThreshold);
        //average occupancy per module
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+4))->SetBinContent(gModule,lLadderLocationY-1,occupancyAverage);
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+4))->SetBinContent(gModule,lLadderLocationY-1,occupancyAverage);
       }
       else if(gLayer == 6) {
        //occupancy per module - no threshold
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1))->SetBinContent(gModule,lLadderLocationY-1,occupancy);
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+1))->SetBinContent(gModule,lLadderLocationY-1,occupancy);
        //occupancy per module - threshold @ 3%
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+3))->SetBinContent(gModule,lLadderLocationY-1,occupancyThreshold);
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+3))->SetBinContent(gModule,lLadderLocationY-1,occupancyThreshold);
        //average occupancy per module
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+5))->SetBinContent(gModule,lLadderLocationY-1,occupancyAverage);
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsCommonLevelOffset+fgkSSDMODULES+2*fgkSSDLADDERSLAYER5+2*fgkSSDLADDERSLAYER6+5))->SetBinContent(gModule,lLadderLocationY-1,occupancyAverage);
       }
     }//module loop
   }//online flag for SSD
@@ -296,7 +303,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
   const Bool_t saveCorr = kTRUE ; 
   const Bool_t image    = kTRUE ; 
   Int_t rv = 0 ; 
-//  fGenRawsOffset = (fAliITSQADataMakerRec->fRawsQAList[AliRecoParam::kDefault])->GetEntries();
+  fSSDRawsOffset = 0;
 
   if(fkOnline) {
     AliDebug(AliQAv1::GetQADebugLevel(), "Book Online Histograms for SSD\n");
@@ -304,38 +311,43 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
   else {
     AliDebug(AliQAv1::GetQADebugLevel(), "Book Offline Histograms for SSD\n ");
   }
-  AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of histograms (SPD+SDD): %d\n",fGenRawsOffset));
+  AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of histograms (SPD+SDD): %d\n",fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
   TString gTitle;
   TString gName;
   //book online-offline QA histos
   TH1D *fHistSSDEventType = new TH1D("fHistSSDEventType",
                                     "SSD Event Type;Event type;Events",
                                     31,-1,30);
-  rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDEventType, 
-                                     fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+  rv = fAliITSQADataMakerRec->Add2RawsList((new TH1D(*fHistSSDEventType)), 
+                                     fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
   fSSDRawsOffset += 1;
+  delete fHistSSDEventType;
   TH1D *fHistSSDDataSize = new TH1D("fHistSSDDataSize",
                                    "SSD Data Size;(SSD data size) [KB];Events",
                                    1000,0,500);
-  rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSize, 
-                                     fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+  rv = fAliITSQADataMakerRec->Add2RawsList((new TH1D(*fHistSSDEventType)), 
+                                     fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
+       delete fHistSSDDataSize;
   fSSDRawsOffset += 1;
   TH1D *fHistSSDDataSizePercentage = new TH1D("fHistSSDDataSizePercentage",
                                              "SSD Data Size Percentage;SSD data size [%];Events",
                                              1000,0,100);
-  rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePercentage, 
-                                     fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+  rv = fAliITSQADataMakerRec->Add2RawsList((new TH1D(*fHistSSDDataSizePercentage)), 
+                                     fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
+       delete fHistSSDDataSizePercentage;
   fSSDRawsOffset += 1;
   TH1D *fHistSSDDDLId = new TH1D("fHistSSDDDLId",
                                 "SSD DDL Id;DDL id;Events",20,510.5,530.5);
-  rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDDLId, 
-                                     fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+  rv = fAliITSQADataMakerRec->Add2RawsList((new TH1D(*fHistSSDDDLId)), 
+                                     fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
+       delete fHistSSDDDLId;
   fSSDRawsOffset += 1;
   TH1D *fHistSSDDataSizePerDDL = new TH1D("fHistSSDDataSizePerDDL",
                                          "SSD Data Size Per DDL;DDL id;<SSD data size> [KB]",
                                          20,510.5,530.5);
-  rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePerDDL, 
-                                     fGenRawsOffset+fSSDRawsOffset, !expert, image, !saveCorr);
+  rv = fAliITSQADataMakerRec->Add2RawsList((new TH1D(*fHistSSDDataSizePerDDL)), 
+                                     fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, !expert, image, !saveCorr);
+       delete fHistSSDDataSizePerDDL;
   fSSDRawsOffset += 1;
   TH1D *fHistSSDDataSizeDDL[fgkNumOfDDLs];
   for(Int_t i = 1; i < fgkNumOfDDLs+1; i++) {
@@ -344,20 +356,23 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
     fHistSSDDataSizeDDL[i-1] = new TH1D(gName.Data(),
                                         Form("%s;(SSD data size) [KB];Events", gTitle.Data()),
                                         1000,0,50);
-    rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizeDDL[i-1], 
-                                       fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+    rv = fAliITSQADataMakerRec->Add2RawsList((new TH1D(*fHistSSDDataSizeDDL[i-1])), 
+                                       fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1;
   }
   
+  for(Int_t i = 1; i < fgkNumOfDDLs+1; i++)    delete fHistSSDDataSizeDDL[i-1];
   TH1D *fHistSSDLDCId = new TH1D("fHistSSDLDCId","SSD LDC Id;LDC id;Events",10,169.5,179.5);
-  rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDLDCId, 
-                                          fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+  rv = fAliITSQADataMakerRec->Add2RawsList((new TH1D(*fHistSSDLDCId)), 
+                                          fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
+  delete fHistSSDLDCId;
   fSSDRawsOffset += 1;
   TH1D *fHistSSDDataSizePerLDC = new TH1D("fHistSSDDataSizePerLDC",
                                          "SSD Data Size Per LDC;LDC id;<SSD data size> [KB]",
                                          10,169.5,179.5);
-  rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePerLDC, 
-                                     fGenRawsOffset+fSSDRawsOffset, !expert, image, !saveCorr);
+  rv = fAliITSQADataMakerRec->Add2RawsList((new TH1D(*fHistSSDDataSizePerLDC)), 
+                                     fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, !expert, image, !saveCorr);
+  delete fHistSSDDataSizePerLDC;
   fSSDRawsOffset += 1;
   TH1D *fHistSSDDataSizeLDC[fgkNumOfLDCs];
   for(Int_t i = 1; i < fgkNumOfLDCs+1; i++) {
@@ -375,10 +390,11 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
     fHistSSDDataSizeLDC[i-1] = new TH1D(gName.Data(),
                                        Form("%s;SSD data size [KB];Events", gTitle.Data()),
                                        1000,0,100);
-    rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizeLDC[i-1], 
-                                       fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+    rv = fAliITSQADataMakerRec->Add2RawsList((new TH1D(*fHistSSDDataSizeLDC[i-1])), 
+                                       fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1;
   }
+         for(Int_t i = 1; i < fgkNumOfLDCs+1; i++) delete fHistSSDDataSizeLDC[i-1];
   fSSDRawsCommonLevelOffset = fSSDRawsOffset;
 
   if(fkOnline) {
@@ -408,7 +424,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
                                                 2*fgkNumberOfPSideStrips,0,2*fgkNumberOfPSideStrips);
       fHistSSDOccupancyModule[i-500]->GetXaxis()->SetTitleColor(1);
       rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyModule[i-500], 
-                                         fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+                                         fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
       fSSDRawsOffset += 1;
     }
 
@@ -440,7 +456,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
                                                              0.5,AliITSgeomTGeo::GetNDetectors(iLayer)+0.5);
         fHistSSDOccupancyLadder[occupancyCounter]->GetXaxis()->SetTitleColor(1);
         rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLadder[occupancyCounter], 
-                                            fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+                                            fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
         occupancyCounter += 1; fSSDRawsOffset += 1;
         //N-side occupancy plots
         gName = "fHistSSD_Occupancy_Layer"; 
@@ -465,7 +481,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
                                                              0.5,AliITSgeomTGeo::GetNDetectors(iLayer)+0.5);
         fHistSSDOccupancyLadder[occupancyCounter]->GetXaxis()->SetTitleColor(1);
         rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLadder[occupancyCounter], 
-                                            fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+                                            fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
         occupancyCounter += 1; fSSDRawsOffset += 1;
       }//ladder loop
     }//layer loop
@@ -485,7 +501,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
       fHistSSDOccupancyLayer5->GetXaxis()->SetBinLabel(iBin,fLabel);
     }
     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLayer5, 
-                                       fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+                                       fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1;
     TH2D *fHistSSDOccupancyLayer6 = new TH2D("fHistSSDOccupancyLayer6",
                                             "Occupancy per module (Layer 6) - No threshold;N_{modules};N_{Ladders}",
@@ -499,7 +515,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
       fHistSSDOccupancyLayer6->GetXaxis()->SetBinLabel(iBin,fLabel);
     }
     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLayer6, 
-                                        fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+                                        fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1;
 
     //occupancy per module - threshold @ 3%
@@ -515,7 +531,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
       fHistSSDOccupancyThresholdLayer5->GetXaxis()->SetBinLabel(iBin,fLabel);
     }
     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyThresholdLayer5, 
-                                        fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+                                        fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1;
     TH2D *fHistSSDOccupancyThresholdLayer6 = new TH2D("fHistSSDOccupancyThresholdLayer6",
                                                      "Occupancy per module (Layer 6) - Threshold 3%;N_{modules};N_{Ladders}",
@@ -529,7 +545,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
       fHistSSDOccupancyThresholdLayer6->GetXaxis()->SetBinLabel(iBin,fLabel);
     }
     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyThresholdLayer6, 
-                                       fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+                                       fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1;
 
     //Average occupancy per module
@@ -545,7 +561,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
       fHistSSDAverageOccupancyLayer5->GetXaxis()->SetBinLabel(iBin,fLabel);
     }
     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDAverageOccupancyLayer5, 
-                                        fGenRawsOffset+fSSDRawsOffset);
+                                        fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset);
     fSSDRawsOffset += 1;
     TH2D *fHistSSDAverageOccupancyLayer6 = new TH2D("fHistSSDAverageOccupancyLayer6",
                                                    "Average occupancy per module (Layer 6);N_{modules};N_{Ladders}",
@@ -559,7 +575,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
       fHistSSDAverageOccupancyLayer6->GetXaxis()->SetBinLabel(iBin,fLabel);
     }
     rv = fAliITSQADataMakerRec->Add2RawsList(fHistSSDAverageOccupancyLayer6, 
-                                        fGenRawsOffset+fSSDRawsOffset, !expert, image, !saveCorr);
+                                        fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, !expert, image, !saveCorr);
     fSSDRawsOffset += 1;
 
     //Output of the DA
@@ -577,7 +593,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
     fHistPSideBadChannelMapLayer5->GetZaxis()->SetTitleOffset(1.6);
     fHistPSideBadChannelMapLayer5->GetZaxis()->SetTitle("Bad channels (p-side)[%]");
     rv = fAliITSQADataMakerRec->Add2RawsList(fHistPSideBadChannelMapLayer5, 
-                                        fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+                                        fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
 
     TH2D *fHistNSideBadChannelMapLayer5 = new TH2D("fHistNSideBadChannelMapLayer5",
@@ -594,7 +610,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
     fHistNSideBadChannelMapLayer5->GetZaxis()->SetTitleOffset(1.6);
     fHistNSideBadChannelMapLayer5->GetZaxis()->SetTitle("Bad channels (n-side)[%]");
     rv = fAliITSQADataMakerRec->Add2RawsList(fHistNSideBadChannelMapLayer5, 
-                                        fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+                                        fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
     
     TH2D *fHistPSideBadChannelMapLayer6 = new TH2D("fHistPSideBadChannelMapLayer6",
@@ -611,7 +627,7 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
     fHistPSideBadChannelMapLayer6->GetZaxis()->SetTitleOffset(1.6);
     fHistPSideBadChannelMapLayer6->GetZaxis()->SetTitle("Bad channels (p-side)[%]");
     rv = fAliITSQADataMakerRec->Add2RawsList(fHistPSideBadChannelMapLayer6, 
-                                        fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+                                        fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
     
     TH2D *fHistNSideBadChannelMapLayer6 = new TH2D("fHistNSideBadChannelMapLayer6",
@@ -628,20 +644,20 @@ Int_t AliITSQASSDDataMakerRec::InitRaws() {
     fHistNSideBadChannelMapLayer6->GetZaxis()->SetTitleOffset(1.6);
     fHistNSideBadChannelMapLayer6->GetZaxis()->SetTitle("Bad channels (n-side)[%]");
     rv = fAliITSQADataMakerRec->Add2RawsList(fHistNSideBadChannelMapLayer6, 
-                                        fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
+                                        fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
   }//online flag
   
   fSSDhRawsTask = fSSDRawsOffset;
   AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SSD Raws histograms booked\n",fSSDhRawsTask));
-  AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenRawsOffset+fSSDhRawsTask));  
-  AliDebug(AliQAv1::GetQADebugLevel(),Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenRawsOffset+fSSDRawsOffset));
+  AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDhRawsTask));  
+  AliDebug(AliQAv1::GetQADebugLevel(),Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset));
   
   /*
    fSSDhTask = fSSDRawsOffset;
    AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SSD Raws histograms booked\n",fSSDhTask));
-   AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenRawsOffset+fSSDhTask));  
-   AliDebug(AliQAv1::GetQADebugLevel(),Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenRawsOffset+fSSDRawsOffset));
+   AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDhTask));  
+   AliDebug(AliQAv1::GetQADebugLevel(),Form("Number of histograms (SPD+SDD+SSD): %d\n",fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset));
    */
   return rv ; 
 }
@@ -660,6 +676,7 @@ Int_t AliITSQASSDDataMakerRec::MakeRaws(AliRawReader* rawReader) {
   Double_t sumSSDDataSize = 0.0;
   Double_t eventSize = -1.0;
 
+       //AliInfo(Form("fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
   if(fkOnline) {
     //reset the signal vs strip number histograms
     for(Int_t iModule = 0; iModule < fgkSSDMODULES; iModule++)
@@ -668,7 +685,8 @@ Int_t AliITSQASSDDataMakerRec::MakeRaws(AliRawReader* rawReader) {
 
   rawReader->Select("ITSSSD",-1,-1);  
   rawReader->Reset(); //rawReader->NextEvent();   
-  (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset))->Fill(rawReader->GetType());
+       //AliInfo(Form("fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
+   (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Fill(rawReader->GetType());
   if(rawReader->GetType() == 7) {
     fSSDEvent += 1;
     fSSDEventPerCycle += 1;
@@ -696,21 +714,21 @@ Int_t AliITSQASSDDataMakerRec::MakeRaws(AliRawReader* rawReader) {
     //AliDebug(AliQAv1::GetQADebugLevel(), Form("ModulePosition: %d - Layer: %d - Ladder: %d - Module: %d\n",gHistPosition,gLayer,gLadder,gModule));
     if(fkOnline)
       fHistSSDRawSignalModule[gHistPosition]->Fill(gStripNumber,gSSDStream.GetSignal());
-    //fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+gHistPosition+fSSDRawsCommonLevelOffset)->Fill(gStripNumber,gSSDStream.GetSignal());
+    //fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+gHistPosition+fSSDRawsCommonLevelOffset)->Fill(gStripNumber,gSSDStream.GetSignal());
   }//streamer loop   
   
   //event size calculation and filling info
   for(Int_t i = 0; i < fgkNumOfDDLs; i++) {
     sumSSDDataSize += gSizePerDDL[i];
     if(gSizePerDDL[i] > 0) {
-      (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+3))->Fill(i+512);
-      (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+5+i))->Fill(gSizePerDDL[i]/1e+03);
+      (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+3))->Fill(i+512);
+      (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+5+i))->Fill(gSizePerDDL[i]/1e+03);
     }
-    //(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+4))->Fill(i+512,gSizePerDDL[i]/1e+06);
+    //(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+4))->Fill(i+512,gSizePerDDL[i]/1e+06);
   }
-  for(Int_t i = 0; i < fgkNumOfLDCs; i++) {
+   for(Int_t i = 0; i < fgkNumOfLDCs; i++) {
     if(gSizePerLDC[i] > 0) {
-      (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+21))->Fill(i+170);
+      (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+21))->Fill(i+170);
       //LDC 170
       if(i == 0)
        gSizePerLDC[i] = gSizePerDDL[8] + gSizePerDDL[9];
@@ -736,16 +754,16 @@ Int_t AliITSQASSDDataMakerRec::MakeRaws(AliRawReader* rawReader) {
       if(i == 7)
        gSizePerLDC[i] = gSizePerDDL[6] + gSizePerDDL[7];
 
-      (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+23+i))->Fill(gSizePerLDC[i]/1e+03);
+      (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+23+i))->Fill(gSizePerLDC[i]/1e+03);
       //cout<<"Event: "<<fSSDEventPerCycle<<" - LDC: "<<i+6<<
       //" - Data size: "<<gSizePerLDC[i]<<endl;
     }
-    //(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+22))->Fill(i+6,gSizePerLDC[i]/1e+06);
+    //(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+22))->Fill(i+6,gSizePerLDC[i]/1e+06);
   }
-  if(sumSSDDataSize) 
-    (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+1))->Fill(sumSSDDataSize/1e+03);
+   if(sumSSDDataSize) 
+    (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+1))->Fill(sumSSDDataSize/1e+03);
   if(eventSize)
-    (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+2))->Fill(100.*sumSSDDataSize/eventSize);
+    (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+2))->Fill(100.*sumSSDDataSize/eventSize);
 
   //Occupancy calculation
   if(fkOnline) {
@@ -838,10 +856,10 @@ void AliITSQASSDDataMakerRec::MonitorOCDBObjects() {
   //Monitor in AMORE the output of the DA
   //Currently only the bad channel list is monitored
   //Todo: Noise - Pedestal
-  ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset))->Reset();
-  ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+1))->Reset();
-  ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+2))->Reset();
-  ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+3))->Reset();
+  ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset-fSSDRawsDAOffset))->Reset();
+  ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset-fSSDRawsDAOffset+1))->Reset();
+  ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset-fSSDRawsDAOffset+2))->Reset();
+  ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset-fSSDRawsDAOffset+3))->Reset();
 
   AliCDBEntry *entryBadChannelsSSD = fCDBManager->Get("ITS/Calib/BadChannelsSSD");
   if(!entryBadChannelsSSD) 
@@ -884,23 +902,23 @@ void AliITSQASSDDataMakerRec::MonitorOCDBObjects() {
     }//loop over strips
     if(layer == 5) {
       if(nPSideChannelsLayer5 > 0)
-       ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset))->Fill(module,499+ladder,
+       ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset-fSSDRawsDAOffset))->Fill(module,499+ladder,
                                                                            100.*nPSideChannelsLayer5/fgkNumberOfPSideStrips);
-      else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset))->Fill(module,499+ladder,0.0001);
+      else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset-fSSDRawsDAOffset))->Fill(module,499+ladder,0.0001);
       if(nNSideChannelsLayer5 > 0)
-       ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+1))->Fill(module,499+ladder,
+       ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset-fSSDRawsDAOffset+1))->Fill(module,499+ladder,
                                                                            100.*nNSideChannelsLayer5/fgkNumberOfPSideStrips);
-      else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+1))->Fill(module,499+ladder,0.0001);
+      else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset-fSSDRawsDAOffset+1))->Fill(module,499+ladder,0.0001);
     }//layer 5                                                                                                                      
     if(layer == 6) {
       if(nPSideChannelsLayer6 > 0)
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+2))->Fill(module,599+ladder,
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset-fSSDRawsDAOffset+2))->Fill(module,599+ladder,
                                                                            100.*nPSideChannelsLayer6/fgkNumberOfPSideStrips);
-      else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+2))->Fill(module,599+ladder,0.0001);
+      else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset-fSSDRawsDAOffset+2))->Fill(module,599+ladder,0.0001);
       if(nNSideChannelsLayer6 > 0)
-        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+3))->Fill(module,599+ladder,
+        ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset-fSSDRawsDAOffset+3))->Fill(module,599+ladder,
                                                                            100.*nNSideChannelsLayer6/fgkNumberOfPSideStrips);
-      else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+fSSDRawsOffset-fSSDRawsDAOffset+3))->Fill(module,599+ladder,0.0001);
+      else ((TH2D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]+fSSDRawsOffset-fSSDRawsDAOffset+3))->Fill(module,599+ladder,0.0001);
     }//layer 6                                                                                                                      
   }//module loop
 }
@@ -971,6 +989,8 @@ Int_t AliITSQASSDDataMakerRec::InitRecPoints()
   const Bool_t expert   = kTRUE ; 
   const Bool_t image    = kTRUE ; 
   Int_t rv = 0 ; 
+  //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie()));
+  //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
 //  fGenRecPointsOffset = (fAliITSQADataMakerRec->fRecPointsQAList[AliRecoParam::kDefault])->GetEntries();
   //AliDebug(AliQAv1::GetQADebugLevel(), Form("**-------*-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints offset %d \t %d \n",fGenOffset,fGenRecPointsOffset));
   Int_t nModuleOffset = 500;
@@ -982,7 +1002,7 @@ Int_t AliITSQASSDDataMakerRec::InitRecPoints()
                                          nModuleOffset - 0.5,
                                          nITSTotalModules-fgkSSDMODULESLAYER6+0.5);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDModuleIdLayer5, 
-                                          fGenRecPointsOffset + 0, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 0, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDModuleIdLayer6 = new TH1F("fHistSSDModuleIdLayer6",
                                          "Module Id - Layer 6;Module Id;Entries",
@@ -990,201 +1010,201 @@ Int_t AliITSQASSDDataMakerRec::InitRecPoints()
                                          nModuleOffset+fgkSSDMODULESLAYER5 - 0.5,
                                          nITSTotalModules + 0.5);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDModuleIdLayer6, 
-                                          fGenRecPointsOffset + 1, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 1, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDClusterPerEventLayer5 = new TH1F("fHistSSDClusterPerEventLayer5",
                                                 "N_{clusters} - Layer 5;N_{clusters};Entries;",
                                                 100,0.1,5000);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterPerEventLayer5,
-                                          fGenRecPointsOffset + 2, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 2, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDClusterPerEventLayer6 = new TH1F("fHistSSDClusterPerEventLayer6",
                                                 "N_{clusters} - Layer 6;N_{clusters};Entries;",
                                                 100,0.1,5000);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterPerEventLayer6,
-                                          fGenRecPointsOffset + 3, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 3, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDLocalXLayer5 = new TH1F("fHistSSDLocalXLayer5",
                                        "Local x coord.- Layer 5;x [cm];Entries;",
                                        100,-4.,4.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalXLayer5,
-                                          fGenRecPointsOffset + 4, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 4, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDLocalXLayer6 = new TH1F("fHistSSDLocalXLayer6",
                                        "Local x coord.- Layer 6;x [cm];Entries;",
                                        100,-4.,4.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalXLayer6, 
-                                          fGenRecPointsOffset + 5, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 5, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDLocalZLayer5 = new TH1F("fHistSSDLocalZLayer5",
                                        "Local z coord.- Layer 5;z [cm];Entries;",
                                        100,-4.,4.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalZLayer5, 
-                                          fGenRecPointsOffset + 6, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 6, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDLocalZLayer6 = new TH1F("fHistSSDLocalZLayer6",
                                        "Local z coord.- Layer 6;z [cm];Entries;",
                                        100,-4.,4.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalZLayer6, 
-                                          fGenRecPointsOffset + 7, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 7, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDGlobalXLayer5 = new TH1F("fHistSSDGlobalXLayer5",
                                         "Global x - Layer 5;x [cm];Entries;",
                                         100,-40.,40.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalXLayer5, 
-                                          fGenRecPointsOffset + 8, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 8, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDGlobalXLayer6 = new TH1F("fHistSSDGlobalXLayer6",
                                         "Global x - Layer 6;x [cm];Entries;",
                                         100,-45.,45.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalXLayer6, 
-                                          fGenRecPointsOffset + 9, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 9, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDGlobalYLayer5 = new TH1F("fHistSSDGlobalYLayer5",
                                         "Global y - Layer 5;y [cm];Entries;",
                                         100,-40.,40);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalYLayer5, 
-                                          fGenRecPointsOffset + 10, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 10, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDGlobalYLayer6 = new TH1F("fHistSSDGlobalYLayer6",
                                         "Global y - Layer 6;y [cm];Entries;",
                                         100,-45.,45.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalYLayer6, 
-                                          fGenRecPointsOffset + 11, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 11, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDGlobalZLayer5 = new TH1F("fHistSSDGlobalZLayer5",
                                         "Global z - Layer 5;z [cm];Entries;",
                                         100,-45.,45);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalZLayer5, 
-                                          fGenRecPointsOffset + 12, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 12, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDGlobalZLayer6 = new TH1F("fHistSSDGlobalZLayer6",
                                         "Global z - Layer 6;z [cm];Entries;",
                                         100,-55.,55.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalZLayer6, 
-                                          fGenRecPointsOffset + 13, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 13, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDPhiLayer5 = new TH1F("fHistSSDPhiLayer5",
                                     "#phi - Layer 5;#phi [rad];Entries;",
                                     100,-TMath::Pi(),TMath::Pi());
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDPhiLayer5, 
-                                          fGenRecPointsOffset + 14, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 14, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDPhiLayer6 = new TH1F("fHistSSDPhiLayer6",
                                     "#phi - Layer 6;#phi [rad];Entries;",
                                     100,-TMath::Pi(),TMath::Pi());
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDPhiLayer6, 
-                                          fGenRecPointsOffset + 15, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 15, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDThetaLayer5 = new TH1F("fHistSSDThetaLayer5",
                                       "#theta - Layer 5;#theta [rad];Entries;",
                                       100,-TMath::Pi(),TMath::Pi());
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDThetaLayer5, 
-                                          fGenRecPointsOffset + 16, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 16, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDThetaLayer6 = new TH1F("fHistSSDThetaLayer6",
                                       "#theta - Layer 6;#theta [rad];Entries;",
                                       100,-TMath::Pi(),TMath::Pi());
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDThetaLayer6, 
-                                          fGenRecPointsOffset + 17, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 17, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDRadiusLayer5 = new TH1F("fHistSSDRadiusLayer5",
                                        "r - Layer 5;r [cm];Entries;",
                                        100,35.,50.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDRadiusLayer5, 
-                                          fGenRecPointsOffset + 18, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 18, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDRadiusLayer6 = new TH1F("fHistSSDRadiusLayer6",
                                        "r - Layer 6;r [cm];Entries;",
                                        100,35.,50.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDRadiusLayer6, 
-                                          fGenRecPointsOffset + 19, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 19, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDClusterTypeLayer5 = new TH1F("fHistSSDClusterTypeLayer5",
                                             "CL type - Layer 5;Cluster type;Entries;",
                                             150,0,150);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterTypeLayer5, 
-                                          fGenRecPointsOffset + 20, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 20, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDClusterTypeLayer6 = new TH1F("fHistSSDClusterTypeLayer6",
                                             "CL type - Layer 6;Cluster type;Entries;",
                                             150,0,150);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterTypeLayer6, 
-                                          fGenRecPointsOffset + 21, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 21, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDChargeRatioLayer5 = new TH1F("fHistSSDChargeRatioLayer5",
                                             "Charge ratio - Layer 5;q_{ratio};Entries;",
                                             100,-2.0,2.0);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatioLayer5, 
-                                          fGenRecPointsOffset + 22, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 22, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDChargeRatioLayer6 = new TH1F("fHistSSDChargeRatioLayer6",
                                             "Charge ratio - Layer 6;q_{ratio};Entries;",
                                             100,-2.0,2.0);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatioLayer6, 
-                                          fGenRecPointsOffset + 23, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 23, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDChargekeVLayer5 = new TH1F("fHistSSDChargekeVLayer5",
                                           "Charge - Layer 5;q [keV];Entries;",
                                           100,0.,300.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargekeVLayer5, 
-                                          fGenRecPointsOffset + 24, !expert, image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 24, !expert, image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDChargekeVLayer6 = new TH1F("fHistSSDChargekeVLayer6",
                                           "Charge - Layer 6;q [keV];Entries;",
                                           100,0.,300.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargekeVLayer6, 
-                                          fGenRecPointsOffset + 25, !expert, image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 25, !expert, image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDChargePSideLayer5 = new TH1F("fHistSSDChargePSideLayer5",
                                             "Charge P- Layer 5;q_{P} [keV];Entries;",
                                             100,0.,300.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePSideLayer5,
-                                          fGenRecPointsOffset + 26, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 26, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDChargePSideLayer6 = new TH1F("fHistSSDChargePSideLayer6",
                                             "Charge P- Layer 6;q_{P} [keV];Entries;",
                                             100,0.,300.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePSideLayer6,
-                                          fGenRecPointsOffset + 27, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 27, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDChargeNSideLayer5 = new TH1F("fHistSSDChargeNSideLayer5",
                                             "Charge N- Layer 5;q_{N} [keV];Entries;",
                                             100,0.,300.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeNSideLayer5,
-                                          fGenRecPointsOffset + 28, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 28, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDChargeNSideLayer6 = new TH1F("fHistSSDChargeNSideLayer6",
                                             "Charge N- Layer 6;q_{N} [keV];Entries;",
                                             100,0.,300.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeNSideLayer6,
-                                          fGenRecPointsOffset + 29, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 29, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDChargeRatio2Layer5 = new TH1F("fHistSSDChargeRatio2Layer5",
                                              "Charge Ratio qN/qP - Layer 5;q_{N}/q_{P};Entries;",
                                              100,0,2);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatio2Layer5,
-                                          fGenRecPointsOffset + 30, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 30, expert, !image);
   fSSDhRecPointsTask += 1;
   TH1F *fHistSSDChargeRatio2Layer6 = new TH1F("fHistSSDChargeRatio2Layer6",
                                              "Charge Ratio qN/qP - Layer 6;q_{N}/q_{P};Entries;",
                                              100,0,2);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatio2Layer6,
-                                          fGenRecPointsOffset + 31, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 31, expert, !image);
   fSSDhRecPointsTask += 1;
   TH2F *fHistSSDChargePNSideLayer5 = new TH2F("fHistSSDChargePNSideLayer5",
                                              "Charge correlation - Layer 5;q_{P} [keV];q_{N} [keV]",
                                              100,0.,300.,
                                              100,0.,300.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePNSideLayer5,
-                                          fGenRecPointsOffset + 32, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 32, expert, !image);
   fSSDhRecPointsTask += 1;
   TH2F *fHistSSDChargePNSideLayer6 = new TH2F("fHistSSDChargePNSideLayer6",
                                              "Charge correlation - Layer 6;q_{P} [keV];q_{N} [keV]",
                                              100,0.,300.,
                                              100,0.,300.);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePNSideLayer6,
-                                          fGenRecPointsOffset + 33, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 33, expert, !image);
   fSSDhRecPointsTask += 1;
   TH2F *fHistSSDChargeMapLayer5 = new TH2F("fHistSSDChargeMapLayer5",
                                           "Charge map;N_{modules};N_{Ladders}",
@@ -1193,7 +1213,7 @@ Int_t AliITSQASSDDataMakerRec::InitRecPoints()
                                           3*fgkSSDLADDERSLAYER5,
                                           -0.5,fgkSSDLADDERSLAYER5+0.5);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeMapLayer5, 
-                                          fGenRecPointsOffset + 34, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 34, expert, !image);
   fSSDhRecPointsTask += 1;
   TH2F *fHistSSDChargeMapLayer6 = new TH2F("fHistSSDChargeMapLayer6",
                                           "Charge map;N_{modules};N_{Ladders}",
@@ -1202,7 +1222,7 @@ Int_t AliITSQASSDDataMakerRec::InitRecPoints()
                                           3*fgkSSDLADDERSLAYER6,
                                           -0.5,fgkSSDLADDERSLAYER6+0.5);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeMapLayer6, 
-                                          fGenRecPointsOffset + 35, expert, !image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 35, expert, !image);
   fSSDhRecPointsTask += 1;
   TH2F *fHistSSDClusterMapLayer5 = new TH2F("fHistSSDClusterMapLayer5",
                                            "Layer 5;N_{module};N_{ladder}",
@@ -1218,7 +1238,7 @@ Int_t AliITSQASSDDataMakerRec::InitRecPoints()
   fHistSSDClusterMapLayer5->GetZaxis()->SetTitleOffset(1.4);
   fHistSSDClusterMapLayer5->GetZaxis()->SetTitle("N_{clusters}");
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterMapLayer5,
-                                          fGenRecPointsOffset + 36, !expert, image);
+                                          fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 36, !expert, image);
   fSSDhRecPointsTask += 1;
   TH2F *fHistSSDClusterMapLayer6 = new TH2F("fHistSSDClusterMapLayer6",
                                            "Layer 6;N_{module};N_{ladder}",
@@ -1234,7 +1254,7 @@ Int_t AliITSQASSDDataMakerRec::InitRecPoints()
   fHistSSDClusterMapLayer6->GetZaxis()->SetTitleOffset(1.4);
   fHistSSDClusterMapLayer6->GetZaxis()->SetTitle("N_{clusters}");
   rv = fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterMapLayer6,
-                                           fGenRecPointsOffset + 37, !expert, image);
+                                           fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 37, !expert, image);
   fSSDhRecPointsTask += 1;
   //printf ("%d SSD Recs histograms booked\n",fSSDhRecPointsTask);
   AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SSD Recs histograms booked\n",fSSDhRecPointsTask));
@@ -1255,6 +1275,8 @@ Int_t AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree)
     return rv;
   }
  
+  //AliInfo(Form("fAliITSQADataMakerRec->GetEventSpecie() %d\n",fAliITSQADataMakerRec->GetEventSpecie()));
+  //AliInfo(Form("fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] %d\n",fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]));
   static TClonesArray statRecpoints("AliITSRecPoint");
   TClonesArray *recpoints = &statRecpoints;
   branchRecP->SetAddress(&recpoints);
@@ -1284,58 +1306,58 @@ Int_t AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree)
       Double_t chargeNSide = clusterCharge*(1. - chargeRatio);
       if(layer == 4) {
        //printf("-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints Filling 4 called \n");
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 20)->Fill(recp->GetType());
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 20)->Fill(recp->GetType());
 
        if(recp->GetType() != 1) continue;
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 0)->Fill(module);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 4)->Fill(recp->GetDetLocalX());
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 6)->Fill(recp->GetDetLocalZ());
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 8)->Fill(cluglo[0]);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 10)->Fill(cluglo[1]);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 12)->Fill(cluglo[2]);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 14)->Fill(phi);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 16)->Fill(theta);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 18)->Fill(radius);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 22)->Fill(recp->GetChargeRatio());
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 24)->Fill(recp->GetQ());
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 26)->Fill(chargePSide);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 28)->Fill(chargeNSide);
-       if(chargePSide != 0.) fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 30)->Fill(chargeNSide/chargePSide);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 32)->Fill(chargePSide,chargeNSide);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 34)->SetBinContent(gModule,lLadderLocationY,recp->GetQ());
-       ((TH2F *)fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 36))->Fill(gModule,499+gLadder,1);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 0)->Fill(module);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 4)->Fill(recp->GetDetLocalX());
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 6)->Fill(recp->GetDetLocalZ());
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 8)->Fill(cluglo[0]);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 10)->Fill(cluglo[1]);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 12)->Fill(cluglo[2]);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 14)->Fill(phi);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 16)->Fill(theta);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 18)->Fill(radius);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 22)->Fill(recp->GetChargeRatio());
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 24)->Fill(recp->GetQ());
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 26)->Fill(chargePSide);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 28)->Fill(chargeNSide);
+       if(chargePSide != 0.) fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 30)->Fill(chargeNSide/chargePSide);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 32)->Fill(chargePSide,chargeNSide);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 34)->SetBinContent(gModule,lLadderLocationY,recp->GetQ());
+       ((TH2F *)fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 36))->Fill(gModule,499+gLadder,1);
        nClustersLayer5 += 1;
       }//layer 5 histograms
       if(layer == 5) {
        //printf("-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints Filling 5 called \n");
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 21)->Fill(recp->GetType());
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 21)->Fill(recp->GetType());
 
        if(recp->GetType() != 1) continue;
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 1)->Fill(module);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 5)->Fill(recp->GetDetLocalX());
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 7)->Fill(recp->GetDetLocalZ());
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 9)->Fill(cluglo[0]);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 11)->Fill(cluglo[1]);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 13)->Fill(cluglo[2]);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 15)->Fill(phi);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 17)->Fill(theta);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 19)->Fill(radius);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 23)->Fill(recp->GetChargeRatio());
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 25)->Fill(recp->GetQ());
-        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 27)->Fill(chargePSide);
-        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 29)->Fill(chargeNSide);
-        if(chargePSide != 0.) fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 31)->Fill(chargeNSide/chargePSide);
-        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 33)->Fill(chargePSide,chargeNSide);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 35)->SetBinContent(gModule,lLadderLocationY,recp->GetQ());
-       ((TH2F *)fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 37))->Fill(gModule,599+gLadder,1);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 1)->Fill(module);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 5)->Fill(recp->GetDetLocalX());
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 7)->Fill(recp->GetDetLocalZ());
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 9)->Fill(cluglo[0]);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 11)->Fill(cluglo[1]);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 13)->Fill(cluglo[2]);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 15)->Fill(phi);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 17)->Fill(theta);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 19)->Fill(radius);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 23)->Fill(recp->GetChargeRatio());
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 25)->Fill(recp->GetQ());
+        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 27)->Fill(chargePSide);
+        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 29)->Fill(chargeNSide);
+        if(chargePSide != 0.) fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 31)->Fill(chargeNSide/chargePSide);
+        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 33)->Fill(chargePSide,chargeNSide);
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 35)->SetBinContent(gModule,lLadderLocationY,recp->GetQ());
+       ((TH2F *)fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 37))->Fill(gModule,599+gLadder,1);
        nClustersLayer6 += 1;
       }//layer 6 histograms
     }//rec. points loop
   }//module loop
   
   //printf("-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints Filling called \n");
-  fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 2)->Fill(nClustersLayer5);
-  fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 3)->Fill(nClustersLayer6);
+  fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 2)->Fill(nClustersLayer5);
+  fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()] + 3)->Fill(nClustersLayer6);
 
   statRecpoints.Clear();
   return rv ; 
@@ -1346,16 +1368,13 @@ Int_t AliITSQASSDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task) {
   // Returns offset number according to the specified task 
   Int_t offset=0;
   if( task == AliQAv1::kRAWS ) {
-    offset=fGenRawsOffset;  
+    offset=fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()];  
   }
   else if( task == AliQAv1::kDIGITSR ) {
     offset=fGenDigitsOffset;   
   }
   else if( task == AliQAv1::kRECPOINTS ) {
-    offset=fGenRecPointsOffset;   
-  }
-  else {
-    AliWarning("No task has been selected. Offset set to zero.\n");
+    offset=fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()];   
   }
 
   return offset;
@@ -1363,19 +1382,16 @@ Int_t AliITSQASSDDataMakerRec::GetOffset(AliQAv1::TASKINDEX_t task) {
 
 //_______________________________________________________________
 
-void AliITSQASSDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset) {
+void AliITSQASSDDataMakerRec::SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie) {
   // Returns offset number according to the specified task
   if( task == AliQAv1::kRAWS ) {
-    fGenRawsOffset=offset;
+    fGenRawsOffset[specie]=offset;
   }
   else if( task == AliQAv1::kDIGITSR ) {
     fGenDigitsOffset=offset;
   }
   else if( task == AliQAv1::kRECPOINTS ) {
-    fGenRecPointsOffset=offset;
-  }
-  else {
-    AliInfo("No task has been selected. Offset set to zero.\n");
+    fGenRecPointsOffset[specie]=offset;
   }
 }
 
index c00d74a..e4d6210 100644 (file)
@@ -42,7 +42,7 @@ public:
   virtual ~AliITSQASSDDataMakerRec(); // dtor
 
   Int_t GetOffset(AliQAv1::TASKINDEX_t task);
-  void  SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset);
+  void  SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie = 0);
   Int_t GetTaskHisto(AliQAv1::TASKINDEX_t task);
 
  private:
@@ -76,15 +76,15 @@ public:
   Int_t   fSSDhRawsTask;                        //number of histo booked for the raws SSD task 
   Int_t   fSSDhDigitsTask;                      //number of histo booked for the recpoints SSD task
   Int_t   fSSDhRecPointsTask;                   //number of histo booked for the recpoints SSD task
-  Int_t   fGenRawsOffset;                       //qachecking raws       offset
+  Int_t   *fGenRawsOffset;                       //qachecking raws       offset
   Int_t   fGenDigitsOffset;                     //qachecking recpoints  offset
-  Int_t   fGenRecPointsOffset;                  //qachecking recpoints  offset
+  Int_t   *fGenRecPointsOffset;                  //qachecking recpoints  offset
   TH1D   *fHistSSDRawSignalModule[fgkSSDMODULES]; //raw signal vs strip number - SSD                   
   Int_t   fOccupancyMatrix[fgkSSDMODULES][2*fgkNumberOfPSideStrips]; //occupancy values per strip
 
   AliCDBManager *fCDBManager; //CDB manager
 
-  ClassDef(AliITSQASSDDataMakerRec,5)           // description 
+  ClassDef(AliITSQASSDDataMakerRec,6)           // description 
 };
 
 #endif