New features in SDD QA (Melinda)
authorprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 31 May 2011 21:34:20 +0000 (21:34 +0000)
committerprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 31 May 2011 21:34:20 +0000 (21:34 +0000)
ITS/AliITSCalibration.h
ITS/AliITSCalibrationSDD.h
ITS/AliITSQASDDChecker.cxx
ITS/AliITSQASDDDataMakerRec.cxx
ITS/AliITSQASDDDataMakerRec.h
ITS/macrosSDD/ITSQArecoparam.C
ITS/macrosSDD/PlotQASDD.C

index 58b1203..92a4ad5 100644 (file)
@@ -36,6 +36,7 @@ class AliITSCalibration : public TObject {
     // Return 1 if the module/chip is dead, 0 if it is ok
     virtual Bool_t IsBad() const {AliError("This method must be implemented in a derived class"); return kFALSE;}
     virtual Bool_t IsChipBad(Int_t) const {AliError("This method must be implemented in a derived class"); return kFALSE;}
+    virtual Bool_t IsWingBad(Int_t) const {AliError("This method must be implemented in a derived class"); return kFALSE;}
     //
     // Configuration methods
     //
index 971c45b..3154762 100644 (file)
@@ -97,6 +97,13 @@ class AliITSCalibrationSDD : public AliITSCalibration {
     virtual Bool_t IsChipBad(Int_t nChip) const { 
       return fIsChipBad[nChip]; 
     }
+    virtual Bool_t IsWingBad(Int_t nwing) const 
+    {
+      if(nwing<0 || nwing>1) return kFALSE;
+      if(IsChipBad(nwing*4) && IsChipBad(nwing*4+1) && IsChipBad(nwing*4+2) && IsChipBad(nwing*4+3)) return kTRUE; 
+      return kFALSE;
+    }
+
     Int_t Wings()const{return fgkWings;}//Total number of SDD wings
     Int_t Chips() const{return fgkChips;} // Number of chips/module
     Int_t Channels() const{ return fgkChannels;}//Number of channels/chip
index 06092d7..4c0bcea 100644 (file)
@@ -122,6 +122,9 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
   AliInfo("Calib SDD Created\n ");
 
   TIter next(list);
+  TString results1;
+  TString results2;
+  Int_t color=1;
 
   switch(index) {
     case AliQAv1::kRAW:{
@@ -129,28 +132,107 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
 //       if(fRawModulePattern) { delete fRawModulePattern; fRawModulePattern = 0; }
 //       if(fRawL3Pattern) { delete fRawL3Pattern; fRawL3Pattern = 0; }
 //       if(fRawL4Pattern) { delete fRawL4Pattern; fRawL4Pattern = 0; }
-      if (list->GetEntries() == 0){SDDQACheckerValue += fHighSDDValue[AliQAv1::kFATAL];        break;}
+      if (list->GetEntries() == 0){AliError("Raw List for SDD is empty \n");SDDQACheckerValue += fHighSDDValue[AliQAv1::kFATAL];       break;}
       TH1 *hmodule=NULL;
       TH2 *hlayer[2]; 
       hdata=NULL;
-      Int_t emptymodules[2], filledmodules[2],emptyladders[2],filledladders[2];
-      for(Int_t i=0;i<2;i++){emptymodules[i]=0; filledmodules[i]=0; emptyladders[i]=0; filledladders[i]=0; }
-      for(Int_t i=0;i<2;i++)hlayer[i]=NULL;   
+      for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
+
+      //check counters
+      Int_t emptymodules[2], filledmodules[2],emptyladders[2],filledladders[2],emptydriftregion[2], filleddriftregion[2], excludedmoduleperlayer[2], excludeddrperlayer[2], activemoduleperlayer[2],activedrperlayer[2],exactivemoduleperlayer[2],exactivedrperlayer[2];
+      Int_t excluded=0;            //excluded modules  
+      Int_t excludeddriftregion=0; //excluded single drift region
+      Int_t active=0;              //active modules  
+      Int_t activedriftregion=0;   //active single drift region
+      Int_t exactive=0;            //excluded modules but taking data
+      Int_t exactivedriftregion=0; //excluded single drift region but taking data   
+      Int_t empty=0;
+      Int_t filled=0;
+      Int_t emptydr=0;
+      Int_t filleddr=0;
+      //Int_t emptyactivemodule=0;
+      Int_t emptyactivemoduleperlayer[2];
+      //Int_t emptydractivemodule=0;
+      Int_t emptyactivedrperlayer[2];
+      Int_t emptysum=0;
+      Int_t emptydiff=0;
+      Int_t emptydrsum=0;
+      Int_t emptydrdiff=0;
+
+    for(Int_t i=0;i<2;i++)
+      {
+       emptymodules[i]=0; 
+       filledmodules[i]=0; 
+       emptyladders[i]=0; 
+       filledladders[i]=0; 
+       emptydriftregion[i]=0;
+       filleddriftregion[i]=0; 
+       excludedmoduleperlayer[i]=0;
+       excludeddrperlayer[i]=0;
+       activemoduleperlayer[i]=0;
+       activedrperlayer[i]=0;
+       exactivemoduleperlayer[i]=0;
+       exactivedrperlayer[i]=0;
+       emptyactivemoduleperlayer[i]=0;
+       emptyactivedrperlayer[i]=0;
+      }  
+
+    Int_t neventsraw=0;
+
+    //take the number of events
+
+      while( (hdata = dynamic_cast<TH1* >(next())) ){
+       if (hdata){
+         TString hname=hdata->GetName();
+
+         if(hname.Contains("SDDRawDataCheck"))
+           { 
+             neventsraw=(Int_t)hdata->GetBinContent(1); 
+             //break;
+           }
+         else continue;
+       }//end if hdata
+      }//end while
+
+      next.Begin();
       while( (hdata = dynamic_cast<TH1* >(next())) ){
        if (hdata){TString hname=hdata->GetName();
          if(hname.Contains("SDDchargeMap"))continue;
+         if(hname.Contains("SDDDDLPattern"))continue;
+         if(hname.Contains("SDDEventSize"))continue;
+         if(hname.Contains("_RelativeOccupancy"))continue;
          if(hname.Contains("SDDModPattern")){
            if(hname.Contains("NORM")) continue;
            hmodule=(TH1*)hdata->Clone();
            entries= hdata->GetEntries();
            if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in  %s \n",hname.Data()));SDDQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
-           else{int modmax=hdata->GetNbinsX();
-             Int_t empty=0;
-             Int_t filled=0;
+           else{
+             int modmax=hdata->GetNbinsX();
              Double_t content=0;
-             for(Int_t i=1;i<=modmax;i++){content=hdata->GetBinContent(i);if(AliITSQADataMakerRec::AreEqual(content,0.)) empty++; else filled++; }//end for
-             AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));}//end else pattern entries !=0
-         }             
+             Int_t llay=0;
+             for(Int_t i=1;i<=modmax;i++)
+               {
+                 if(i<85)llay=0;
+                 else llay=1;
+                 content=hdata->GetBinContent(i);
+                 if(AliITSQADataMakerRec::AreEqual(content,0.))
+                   {
+                   empty++;
+                   emptymodules[llay]++;
+                   } 
+                 else 
+                   {
+                     filled++;
+                     filledmodules[llay]++;
+                   }
+               }//end for
+             //output of the check at the level of the modules. Drift region in the following checks
+
+             AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
+             AliInfo(Form(" %s : Layer 3 empty modules %i \t filled modules %i",hname.Data(), emptymodules[0], filledmodules[0]));
+             AliInfo(Form(" %s : Layer 4 empty modules %i \t filled modules %i",hname.Data(), emptymodules[1], filledmodules[1]));
+           }//end else pattern entries !=0
+         } //modpattern (1d histogram)                 
          if(hname.Contains("_RelativeOccupancy")) {
            //fRawModulePattern = (TH1F *) hdata;
            Float_t threshold = hdata->GetMean() + 4*hdata->GetRMS();
@@ -164,10 +246,9 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
            if(hname.Contains("L4")) AliInfo(Form("SDD check number 2, L4: Raw fractionAboveThreshold: %f",fractionAboveThreshold));
            if(fractionAboveThreshold > fThresholdForRelativeOccupancy) {SDDQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
              if(hname.Contains("L3")) AliInfo(Form("SDD check number 1: Set Warning (L3 Raw)"));
-             if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: Set Warning (L4 Raw)")); } }
+             if(hname.Contains("L4")) AliInfo(Form("SDD check number 2: Set Warning (L4 Raw)")); } }//relativeoccupancy
+
          if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){if(hname.Contains("NORM"))continue;
-           //if(hname.Contains("L3")) {fRawL3Pattern = (TH2F *) hdata;}
-           //if(hname.Contains("L4")) {fRawL4Pattern = (TH2F *) hdata;}
            Int_t layer=0;
            if(hname.Contains("3"))layer=0;
            else  if(hname.Contains("4"))layer=1;
@@ -182,7 +263,7 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
              if(htemp){
                hlayer[layer1]=(TH2*)htemp->Clone();
                hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
-               hlayer[layer1]->RebinX(2);
+               //hlayer[layer1]->RebinX(2);
                int modmay=hlayer[layer1]->GetNbinsY();
                TH1D* hproj= hlayer[layer1]->ProjectionY();
                Double_t ladcontent=0;
@@ -190,7 +271,7 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
                  ladcontent=hproj->GetBinContent(i);
                  if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
                  else filledladders[layer1]++;}//end for
-               AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer], filledladders[layer]));//end else layer 3
+               AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
                delete hproj;
                hproj=NULL;
              }//end if htemp
@@ -198,12 +279,16 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
          }//end check on phiz        
        }//end if hdata 
       }//end while
-      if(AliITSQADataMakerRec::AreEqual(entries,0.)&&AliITSQADataMakerRec::AreEqual(entries2[0],0.)&&AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
+      for(Int_t ii=0;ii<2;ii++)
+       {
+         filledmodules[ii]=0;
+         emptymodules[ii]=0;
+       }
+      filled=0;
+      empty=0;
+      if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
       //else{
       if(hmodule || (hlayer[0] && hlayer[1])){
-       Int_t excluded=0;
-       Int_t active=0;
-       Int_t exactive=0;//excluded but taking data
        for(Int_t imod=0;imod<fgknSDDmodules;imod++){
          Int_t lay=0;
          Int_t lad=0;
@@ -215,44 +300,229 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
          AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
          if (cal->IsBad()){
            excluded++;
+           excludedmoduleperlayer[lay-3]++;
            Double_t content=0.;
            Double_t contentlayer[2];
            for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
-           if(hmodule)content=hmodule->GetBinContent(imod+1);//if expert bit is active the histogram has been created 
-           if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
-           if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE || AliITSQADataMakerRec::AreEqual(contentlayer[lay-3],0.)==kFALSE) {
+           if(hmodule)content=hmodule->GetBinContent(imod+1);//if expert bit is active the histogram will be stored in the QA file otherwise the histogram will not be written on the logbook
+           //      if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
+           if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE) {
              filledmodules[lay-3]++;
-             AliWarning(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition, took data \n ",module,lay,lad,det));
+             filled++;
+             AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition, took data \n ",module,lay,lad,det));
              exactive++;
-           } else if(AliITSQADataMakerRec::AreEqual(content,0.) && AliITSQADataMakerRec::AreEqual(contentlayer[lay-3],0.)) 
-             emptymodules[lay-3]++;
+             exactivemoduleperlayer[lay-3]++;
+           } else if(AliITSQADataMakerRec::AreEqual(content,0.)) 
+             {
+               emptymodules[lay-3]++; //it has to be empty
+               empty++;
+             }
          } else {
+           Int_t totside=0;
+           Int_t totactiveside=0;
+           //Int_t totbadside=0;
            Double_t contentgood=0.;
-           active++;
-           if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(det,lad);
-           if(AliITSQADataMakerRec::AreEqual(contentgood,0.)) 
+
+           for(Int_t i=0;i<2;i++){
+             if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(2*det+i-1,lad);
+             if(cal->IsWingBad(i))
+               { 
+                 excludeddriftregion++; 
+                 excludeddrperlayer[lay-3]++; 
+                 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kFALSE){
+                   AliError(Form("The side %d of the module %d (layer %i, ladder %i det %i ) excluded from the acquisition, took data \n ",i,module,lay,lad,det));
+                   exactivedriftregion++; 
+                   exactivedrperlayer[lay-3]++;
+                   filleddr++;
+                   filleddriftregion[lay-3]++;
+                 }
+               }//end wingbad
+             else{
+               if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
+                 {
+                   AliWarning(Form("The side %d of the module %d (layer %i, ladder %i det %i ) is in acquisition, but it didn't take data\n ",i,module, lay, lad, det));
+                 }
+               else 
+                 {
+                   totside++;
+                 }
+               totactiveside++;
+             }
+           }//end for
+           if(totside==0){
+           AliWarning(Form("The  module %d (layer %i, ladder %i det %i ) is in acquisition, but it didn't take data\n ",module, lay, lad, det));
              emptymodules[lay-3]++;
-           else 
-             filledmodules[lay-3]++;
+             empty++;
+
+           }
+             else 
+               if(totside==2){
+               filledmodules[lay-3]++;
+               filled++;
+               }
+               else
+                 if(totside==1)
+                   {
+                     //                      emptydr++;
+                     //emptydriftregion[lay-3]++; //it has to be empty
+                     emptydriftregion[lay-3]++; 
+                     emptydr++;
+                     filleddr++;
+                     filleddriftregion[lay-3]++;
+                   }
+           if(totactiveside==1)
+             {
+               activedriftregion++;
+               activedrperlayer[lay-3]++;
+             }else if(totactiveside==2)
+             {
+               active++;
+               activemoduleperlayer[lay-3]++;
+             }
+
          }
        }//end for
-       for(Int_t i=0;i<2;i++){AliInfo(Form("Layer %i \tempty modules %i \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));}//end else layers
-       if(exactive==0){
-         AliInfo(Form("All the active modules (%i) are in acquisition. The number of excluded modules are %i \n",active,excluded));
+       AliInfo(Form("In total %d modules and %d single drift regions took data.\n ",filled, filleddr));
+       AliInfo(Form("In total %d modules and %d single drift regions were empty\n",empty, emptydr));
+       for(Int_t i=0;i<2;i++)
+         {
+           AliInfo(Form("Layer %i   \tempty modules %i             \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));
+           AliInfo(Form("Layer %i   \tempty single drift regions %i \t filled single drift regions %i\n",i+3,emptydriftregion[i], filleddriftregion[i]));
+         }//end else layers
+       emptysum=emptymodules[0]+emptymodules[1];
+       emptydiff=emptysum-excluded;
+       emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
+       emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
+
+       emptydrsum=emptydriftregion[0]+emptydriftregion[1];
+       emptydrdiff=emptydrsum-excludeddriftregion;
+       emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
+       emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
+
+
+       if(emptysum>excluded||emptydrsum>excludeddriftregion){ 
+         AliWarning(Form(" %i good module(s) and %i good single drift regions didn't take data! Check the calibration\n",emptydiff,emptydrdiff));
+         AliWarning(Form(" Layer 3: %i good module(s) and %i good single drift regions didn't take data! Check the calibration\n",emptyactivemoduleperlayer[0] ,emptyactivedrperlayer[0] ));
+         AliWarning(Form(" Layer 4: %i good module(s) and %i good single drift regions didn't take data! Check the calibration\n",emptyactivemoduleperlayer[1] ,emptyactivedrperlayer[1] ));
+         
+         
+         results1.Form("%i good module(s) and %i good drift regions didn't take data!",emptydiff,emptydrdiff);
+         if(neventsraw<500)
+           {
+             results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsraw);
+             color=5;
+             SDDQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
+           }
+         else
+           {
+             results2.Form(" Events %d .Follow the TWiki instruction and call the Expert ",neventsraw);
+             color=2;
+             SDDQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
+           }
+       }
+
+       if(exactive==0 && emptydiff==0 && exactivedriftregion==0 && emptydrdiff==0){
+         AliInfo(Form("All the active modules (%i) and single drift regions (%i) are in acquisition. The number of excluded modules are %i and the excluded single drift regions are %i\n",active,activedriftregion,excluded,excludeddriftregion));
+         results1.Form("OK.");
+         results2.Form(" All active modules and drift regions in acquisition");
+         color=3;
          SDDQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
        }
-       if(exactive!=0){
-         AliWarning(Form("%i modules excluded from the acquisition took data. Active modules%i \n ",exactive,active));
-         SDDQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
+       if(exactive!=0||exactivedriftregion!=0){
+         AliError(Form("%i modules and %i single  drift regions excluded from the acquisition took data. Active modules%i single drift region %i \n ",exactive,exactivedriftregion,active,activedriftregion));
+         AliError(Form("Layer 3: %i modules and %i single  drift regions excluded from the acquisition took data. Active modules%i single drift region %i \n ",exactivemoduleperlayer[0],exactivedrperlayer[0],activemoduleperlayer[0],activedrperlayer[0]));
+         AliError(Form("Layer 3: %i modules and %i single  drift regions excluded from the acquisition took data. Active modules%i single drift region %i \n ",exactivemoduleperlayer[1],exactivedrperlayer[1],activemoduleperlayer[1],activedrperlayer[1]));
+         results1.Form("%i modules and %i drift region excluded from the acquisition took data",exactive,exactivedriftregion);
+         results2.Form("Follow the TWiki instructions and Call the SDD expert ");
+         color=2;      
+         SDDQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
        }
-       if(excluded==exactive){
-         AliWarning(Form("All the modules excluded from the acquisition (%d) took data!  Active modules %i\n",excluded,active));
-         SDDQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
+       if(excluded==exactive||excludeddriftregion==exactivedriftregion){
+         AliError(Form("All the modules (%d) or single drift regions (%d) excluded from the acquisition  took data!\n  Active modules %i \t Active drfift regions %i\n",excluded,excludeddriftregion,active,activedriftregion));
+         results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition took data!",excluded,excludeddriftregion );
+         results2.Form("Follow the TWiki instructions and Call the SDD expert ");
+         color=6;
+         SDDQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
        }
-       if(active==0){
-         AliWarning(Form("No modules took data: excluded %i \t exactive %i \n", excluded, exactive)); 
+       if(active==0||activedriftregion==0){
+         AliError(Form("No modules or single drift regions took data: excluded %i \t excluded active %i \n\t\t excluded single drift regions %i \t excluded active drift regions %i \n", excluded, exactive, excludeddriftregion, exactivedriftregion)); 
+         results1.Form("No modules or drift region took data: excluded modules %i  excluded drift regions %i ", excluded, excludeddriftregion );
+         results2.Form("Follow the TWiki instructions and Call the SDD expert ");
+         color=6;
          SDDQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
        }
+
+       TPaveText *pave[2];
+       next.Begin();
+
+       while( (hdata=dynamic_cast<TH1* >(next())) )
+         {
+           if (hdata){
+             TString hname=hdata->GetName();
+             if(hname.Contains("SDDphizL3") || hname.Contains("SDDphizL4")){
+               if(hname.Contains("NORM"))continue;
+               //AliInfo("========================================Found histo 11\n");
+               Int_t lay=0;
+               if(hname.Contains("3"))lay=0;
+               else if(hname.Contains("4"))lay=1;
+               pave[lay]=new TPaveText(0.3,0.88,0.9,0.99,"NDC");
+               pave[lay]->AddText(results1.Data());
+               pave[lay]->AddText(results2.Data());
+               pave[lay]->SetFillColor(color);
+               pave[lay]->SetBorderSize(1);
+               pave[lay]->SetLineWidth(1);
+               hdata->GetListOfFunctions()->Add(pave[lay]);
+             }
+             else
+               if(hname.Contains("SDDRawDataCheck"))
+                 {
+                   
+                   //AliInfo("========================================Found histo\n");
+                   ((TH1F*)hdata)->SetBinContent(5,active);
+                   ((TH1F*)hdata)->SetBinContent(6,filled);
+                   ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
+                   ((TH1F*)hdata)->SetBinContent(8,filleddr);
+                   ((TH1F*)hdata)->SetBinContent(9,excluded);
+                   ((TH1F*)hdata)->SetBinContent(10,empty);
+                   ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
+                   ((TH1F*)hdata)->SetBinContent(12,emptydr);
+                   ((TH1F*)hdata)->SetBinContent(13,exactive);
+                   ((TH1F*)hdata)->SetBinContent(14,emptydiff);
+                   ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
+                   ((TH1F*)hdata)->SetBinContent(16,emptydr);
+                   
+                   //layer 3
+                   ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
+                   ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
+                   ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
+                   ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
+                   ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(29,activedrperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
+                   
+                   //layer 4
+                   ((TH1F*)hdata)->SetBinContent(33,activemoduleperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(34,filledmodules[1]);
+                   ((TH1F*)hdata)->SetBinContent(35,activedrperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(36,filleddriftregion[1]);
+                   ((TH1F*)hdata)->SetBinContent(37,excludedmoduleperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(38,emptymodules[1]);
+                   ((TH1F*)hdata)->SetBinContent(39,excludeddrperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(40,emptydriftregion[1]);
+                   ((TH1F*)hdata)->SetBinContent(41,exactivemoduleperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(42,emptyactivemoduleperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(43,activedrperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(44,emptyactivedrperlayer[1]);
+                   //break; 
+                 }
+           }//if hdata
+           
+         }//end while 
        
       }//end else 
       delete hmodule;
@@ -260,9 +530,9 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
       for(Int_t i=0;i<2;i++) {
        delete hlayer[i];
        hlayer[i]=NULL;
-      }
+      }//end for
 
-    }
+    }//end raw
       
       break;
       
@@ -281,9 +551,71 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
        if (list->GetEntries() == 0){ //check if the list is empty
          //printf("SDDQACheckerValue = %f \t value %f\n",SDDQACheckerValue,fHighSDDValue[AliQAv1::kFATAL]);
          SDDQACheckerValue=fHighSDDValue[AliQAv1::kFATAL]; 
-         break;                        
+         //break;                      
        }//end if getentries
       
+
+      TH1 *hmodule=NULL;
+      TH2 *hlayer[2]; 
+      hdata=NULL;
+      for(Int_t i=0;i<2;i++)hlayer[i]=NULL;
+
+      //check counters
+      Int_t emptymodules[2], filledmodules[2],emptyladders[2],filledladders[2],emptydriftregion[2], filleddriftregion[2], excludedmoduleperlayer[2], excludeddrperlayer[2], activemoduleperlayer[2],activedrperlayer[2],exactivemoduleperlayer[2],exactivedrperlayer[2];
+      Int_t excluded=0;            //excluded modules  
+      Int_t excludeddriftregion=0; //excluded single drift region
+      Int_t active=0;              //active modules  
+      Int_t activedriftregion=0;   //active single drift region
+      Int_t exactive=0;            //excluded modules but taking data
+      Int_t exactivedriftregion=0; //excluded single drift region but taking data   
+      Int_t empty=0;
+      Int_t filled=0;
+      Int_t emptydr=0;
+      Int_t filleddr=0;
+      //Int_t emptyactivemodule=0;
+      Int_t emptyactivemoduleperlayer[2];
+      //Int_t emptydractivemodule=0;
+      Int_t emptyactivedrperlayer[2];
+      Int_t emptysum=0;
+      Int_t emptydiff=0;
+      Int_t emptydrsum=0;
+      Int_t emptydrdiff=0;
+
+    for(Int_t i=0;i<2;i++)
+      {
+       emptymodules[i]=0; 
+       filledmodules[i]=0; 
+       emptyladders[i]=0; 
+       filledladders[i]=0; 
+       emptydriftregion[i]=0;
+       filleddriftregion[i]=0; 
+       excludedmoduleperlayer[i]=0;
+       excludeddrperlayer[i]=0;
+       activemoduleperlayer[i]=0;
+       activedrperlayer[i]=0;
+       exactivemoduleperlayer[i]=0;
+       exactivedrperlayer[i]=0;
+       emptyactivemoduleperlayer[i]=0;
+       emptyactivedrperlayer[i]=0;
+      }  
+
+    Int_t neventsrecpoints=0;
+
+      while( (hdata = dynamic_cast<TH1* >(next())) ){
+       if (hdata){
+         TString hname=hdata->GetName();
+
+         if(hname.Contains("SDDRecPointCheck"))
+           { 
+             neventsrecpoints=(Int_t)hdata->GetBinContent(1); 
+             //break;
+           }
+         else{continue;}
+       }//end if hdata
+      }//end while
+
+      next.Begin();
+
        while((hdata=dynamic_cast<TH1* >(next()))){
          if (hdata){
            TString hname=hdata->GetName();
@@ -328,12 +660,330 @@ Double_t AliITSQASDDChecker::Check(AliQAv1::ALITASK_t index, const TObjArray * l
            if(hname.Contains("dedx")) {
              if(hname.Contains("L3")) AliInfo(Form("SDD check number 7: L3 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
              if(hname.Contains("L4")) AliInfo(Form("SDD check number 8: L4 average charge: %f, rms: ,%f",hdata->GetMean(),hdata->GetRMS()));
+           }//end if dedx
+         if(hname.Contains("SDDModPatternRP")){
+           if(hname.Contains("NORM")) continue;
+           hmodule=(TH1*)hdata->Clone();
+           entries= hdata->GetEntries();
+           if(AliITSQADataMakerRec::AreEqual(entries,0.)){AliWarning(Form("===================>>>>>> No entries in  %s \n",hname.Data()));SDDQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//endif entries
+           else{
+             int modmax=hdata->GetNbinsX();
+             Double_t content=0;
+             Int_t llay=0;
+             for(Int_t i=1;i<=modmax;i++)
+               {
+                 if(i<85)llay=0;
+                 else llay=1;
+                 content=hdata->GetBinContent(i);
+                 if(AliITSQADataMakerRec::AreEqual(content,0.))
+                   {
+                   empty++;
+                   emptymodules[llay]++;
+                   } 
+                 else 
+                   {
+                     filled++;
+                     filledmodules[llay]++;
+                   }
+               }//end for
+             //output of the check at the level of the modules. Drift region in the following checks
+
+             AliInfo(Form(" %s : empty modules %i \t filled modules %i",hname.Data(), empty, filled));
+             AliInfo(Form(" %s : Layer 3 empty modules %i \t filled modules %i",hname.Data(), emptymodules[0], filledmodules[0]));
+             AliInfo(Form(" %s : Layer 4 empty modules %i \t filled modules %i",hname.Data(), emptymodules[1], filledmodules[1]));
+           }//end else pattern entries !=0
+         } //modpattern (1d histogram)                 
+
+         if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){if(hname.Contains("NORM"))continue;
+           Int_t layer=0;
+           if(hname.Contains("3"))layer=0;
+           else  if(hname.Contains("4"))layer=1;
+           entries2[layer]=hdata->GetEntries();
+           if(entries2[layer]==0){AliWarning(Form("===================>>>>>> No entries in  %s \n",hname.Data()));
+             SDDQACheckerValue += fStepBitSDD[AliQAv1::kFATAL];}//end if getentries
+           else{
+             Int_t layer1=0;
+             if(hname.Contains("3"))layer1=0;
+             else  if(hname.Contains("4"))layer1=1;
+             TH2* htemp=dynamic_cast<TH2*>(hdata);
+             if(htemp){
+               hlayer[layer1]=(TH2*)htemp->Clone();
+               hlayer[layer1]->SetName(Form("%s_copy",hname.Data()));
+               //hlayer[layer1]->RebinX(2);
+               int modmay=hlayer[layer1]->GetNbinsY();
+               TH1D* hproj= hlayer[layer1]->ProjectionY();
+               Double_t ladcontent=0;
+               for(Int_t i=1;i<=modmay;i++) {//loop on the ladders
+                 ladcontent=hproj->GetBinContent(i);
+                 if(AliITSQADataMakerRec::AreEqual(ladcontent,0.)) emptyladders[layer1]++;
+                 else filledladders[layer1]++;}//end for
+               AliInfo(Form(" %s : empty ladders %i \t filled ladders %i\n",hname.Data(), emptyladders[layer1], filledladders[layer1]));//end else layer 3
+               delete hproj;
+               hproj=NULL;
+             }//end if htemp
+           }//end else entries !=0
+         }//end check on phiz
+         }//end if hdata
+       }//end while                            
+      for(Int_t ii=0;ii<2;ii++)
+       {
+         filledmodules[ii]=0;
+         emptymodules[ii]=0;
+       }
+      filled=0;
+      empty=0;
+      if(AliITSQADataMakerRec::AreEqual(entries,0.)&& AliITSQADataMakerRec::AreEqual(entries2[0],0.)&& AliITSQADataMakerRec::AreEqual(entries2[1],0.)) break;
+      //else{
+      if(hmodule || (hlayer[0] && hlayer[1])){
+       for(Int_t imod=0;imod<fgknSDDmodules;imod++){
+         Int_t lay=0;
+         Int_t lad=0;
+         Int_t det=0;
+         Int_t module=0;
+         module=imod+fgkmodoffset;
+         AliITSCalibrationSDD * cal=(AliITSCalibrationSDD*)fCalibration->At(imod);
+         if(cal==0) { continue;}
+         AliITSgeomTGeo::GetModuleId(module,lay,lad,det);
+         if (cal->IsBad()){
+           excluded++;
+           excludedmoduleperlayer[lay-3]++;
+           Double_t content=0.;
+           Double_t contentlayer[2];
+           for(Int_t i=0;i<2;i++)contentlayer[i]=0.;
+           if(hmodule)content=hmodule->GetBinContent(imod+1);//if expert bit is active the histogram will be stored in the QA file otherwise the histogram will not be written on the logbook
+           //      if(hlayer[lay-3]) contentlayer[lay-3]=hlayer[lay-3]->GetBinContent(det,lad);
+           if(AliITSQADataMakerRec::AreEqual(content,0.)== kFALSE) {
+             filledmodules[lay-3]++;
+             filled++;
+             AliError(Form("The module %d (layer %i, ladder %i det %i ) excluded from the acquisition,has recpoints \n ",module,lay,lad,det));
+             exactive++;
+             exactivemoduleperlayer[lay-3]++;
+           } else if(AliITSQADataMakerRec::AreEqual(content,0.)) 
+             {
+               emptymodules[lay-3]++; //it has to be empty
+               empty++;
+             }
+         } else {
+           Int_t totside=0;
+           Int_t totactiveside=0;
+           //Int_t totbadside=0;
+           Double_t contentgood=0.;
+
+           for(Int_t i=0;i<2;i++){
+             if(hlayer[lay-3]) contentgood=hlayer[lay-3]->GetBinContent(2*det+i-1,lad);
+             if(cal->IsWingBad(i))
+               { 
+                 excludeddriftregion++; 
+                 excludeddrperlayer[lay-3]++; 
+                 if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kFALSE){
+                   AliError(Form("The side %d of the module %d (layer %i, ladder %i det %i ) excluded from the acquisition, has recpoints \n ",i,module,lay,lad,det));
+                   exactivedriftregion++; 
+                   exactivedrperlayer[lay-3]++;
+                   filleddr++;
+                   filleddriftregion[lay-3]++;
+                 }
+               }//end wingbad
+             else{
+               if(AliITSQADataMakerRec::AreEqual(contentgood,0.)==kTRUE)
+                 {
+                   AliWarning(Form("The side %d of the module %d (layer %i, ladder %i det %i ) is in acquisition, but no recpoints are present\n ",i,module, lay, lad, det));
+                 }
+               else 
+                 {
+                   totside++;
+                 }
+               totactiveside++;
+             }
+           }//end for
+           if(totside==0){
+           AliWarning(Form("The  module %d (layer %i, ladder %i det %i ) is in acquisition, but no recpoints are present \n ",module, lay, lad, det));
+             emptymodules[lay-3]++;
+             empty++;
+
            }
+             else 
+               if(totside==2){
+               filledmodules[lay-3]++;
+               filled++;
+               }
+               else
+                 if(totside==1)
+                   {
+                     //                      emptydr++;
+                     //emptydriftregion[lay-3]++; //it has to be empty
+                     emptydriftregion[lay-3]++; 
+                     emptydr++;
+                     filleddr++;
+                     filleddriftregion[lay-3]++;
+                   }
+           if(totactiveside==1)
+             {
+               activedriftregion++;
+               activedrperlayer[lay-3]++;
+             }else if(totactiveside==2)
+             {
+               active++;
+               activemoduleperlayer[lay-3]++;
+             }
+
          }
-       }                               
+       }//end for
+       AliInfo(Form("In total %d modules and %d single drift regions have recpoints.\n ",filled, filleddr));
+       AliInfo(Form("In total %d modules and %d single drift regions are empty\n",empty, emptydr));
+       for(Int_t i=0;i<2;i++)
+         {
+           AliInfo(Form("Layer %i   \tempty modules %i             \t filled modules %i\n", i+3,emptymodules[i], filledmodules[i]));
+           AliInfo(Form("Layer %i   \tempty single drift regions %i \t filled single drift regions %i\n",i+3,emptydriftregion[i], filleddriftregion[i]));
+         }//end else layers
+       emptysum=emptymodules[0]+emptymodules[1];
+       emptydiff=emptysum-excluded;
+       emptyactivemoduleperlayer[0]=emptymodules[0]- excludedmoduleperlayer[0];
+       emptyactivemoduleperlayer[1]=emptymodules[1]- excludedmoduleperlayer[1];
+
+       emptydrsum=emptydriftregion[0]+emptydriftregion[1];
+       emptydrdiff=emptydrsum-excludeddriftregion;
+       emptyactivedrperlayer[0]=emptydriftregion[0]- excludeddrperlayer[0];
+       emptyactivedrperlayer[1]=emptydriftregion[1]- excludeddrperlayer[1];
+
+
+       if(emptysum>excluded||emptydrsum>excludeddriftregion){ 
+         AliWarning(Form(" %i good module(s) and %i good single drift regions have not recpoints! Check the calibration\n",emptydiff,emptydrdiff));
+         AliWarning(Form(" Layer 3: %i good module(s) and %i good single drift regions have not recpoints! Check the calibration\n",emptyactivemoduleperlayer[0] ,emptyactivedrperlayer[0] ));
+         AliWarning(Form(" Layer 4: %i good module(s) and %i good single drift regions have not recpoints! Check the calibration\n",emptyactivemoduleperlayer[1] ,emptyactivedrperlayer[1] ));
+         
+         //SDDQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
+         
+         results1.Form("%i good module(s) and %i good drift region(s) have not recpoints!",emptydiff,emptydrdiff);
+         if(neventsrecpoints<500)
+           {
+             results2.Form(" Events %d .Too few events.DO NOT CALL the Expert ",neventsrecpoints);
+             color=5;
+             SDDQACheckerValue=fHighSDDValue[AliQAv1::kWARNING];
+           }
+         else
+           {
+             results2.Form(" Events %d .Follow the TWiki instruction and call the Expert ",neventsrecpoints);
+             color=2;
+             SDDQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
+           }
+       }
+       
       
-       SDDQACheckerValue=1.;
-      }
+
+       if(exactive==0 && emptydiff==0 && exactivedriftregion==0 && emptydrdiff==0){
+         AliInfo(Form("All the active modules (%i) and single drift regions (%i) are in acquisition. The number of excluded modules are %i and the excluded single drift regions are %i\n",active,activedriftregion,excluded,excludeddriftregion));
+         results1.Form("OK.");
+         results2.Form(" All active modules have recpoints");
+         color=3;
+         SDDQACheckerValue=fHighSDDValue[AliQAv1::kINFO];
+       }
+       if(exactive!=0||exactivedriftregion!=0){
+         AliError(Form("%i modules and %i single  drift regions excluded from the acquisition have recpoints. Active modules %i single drift region %i \n ",exactive,exactivedriftregion,active,activedriftregion));
+         AliError(Form("Layer 3: %i modules and %i single  drift regions excluded from the acquisition have recpoints. Active modules %i single drift region %i \n ",exactivemoduleperlayer[0],exactivedrperlayer[0],activemoduleperlayer[0],activedrperlayer[0]));
+         AliError(Form("Layer 3: %i modules and %i single  drift regions excluded from the acquisition have recpoints. Active modules %i single drift region %i \n ",exactivemoduleperlayer[1],exactivedrperlayer[1],activemoduleperlayer[1],activedrperlayer[1]));
+         results1.Form("%i modules and %i drift region excluded from the acquisition have recpoints",exactive,exactivedriftregion);
+         results2.Form("Follow the TWiki instructions and Call the SDD expert ");
+         color=2;      
+         SDDQACheckerValue=fHighSDDValue[AliQAv1::kERROR];
+       }
+       if(excluded==exactive||excludeddriftregion==exactivedriftregion){
+         AliError(Form("All the modules (%d) or single drift regions (%d) excluded from the acquisition have recpoints!\n  Active modules %i \t Active drfift regions %i\n",excluded,excludeddriftregion,active,activedriftregion));
+         results1.Form("All the modules (%d) or drift regions (%d) excluded from the acquisition have recpoints!",excluded,excludeddriftregion );
+         results2.Form("Follow the TWiki instructions and Call the SDD expert ");
+         color=6;
+         SDDQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
+       }
+       if(active==0||activedriftregion==0){
+         AliError(Form("No modules or single drift regions have recpoints: excluded %i \t excluded active %i \n\t\t excluded single drift regions %i \t excluded active drift regions %i \n", excluded, exactive, excludeddriftregion, exactivedriftregion)); 
+         results1.Form("No modules or drift region have recpoints: excluded modules %i  excluded drift regions %i ", excluded, excludeddriftregion );
+         results2.Form("Follow the TWiki instructions and Call the SDD expert ");
+         color=6;
+         SDDQACheckerValue=fHighSDDValue[AliQAv1::kFATAL];
+       }
+
+       TPaveText *pave[2];
+       next.Begin();
+
+       while( (hdata=dynamic_cast<TH1* >(next())) )
+         {
+           if (hdata){
+             TString hname=hdata->GetName();
+             if(hname.Contains("SDDModPatternL3RP") || hname.Contains("SDDModPatternL4RP")){
+               if(hname.Contains("NORM"))continue;
+               //AliInfo("========================================Found histo 11\n");
+               Int_t lay=0;
+               if(hname.Contains("3"))lay=0;
+               else if(hname.Contains("4"))lay=1;
+               pave[lay]=new TPaveText(0.3,0.88,0.9,0.99,"NDC");
+               pave[lay]->AddText(results1.Data());
+               pave[lay]->AddText(results2.Data());
+               pave[lay]->SetFillColor(color);
+               pave[lay]->SetBorderSize(1);
+               pave[lay]->SetLineWidth(1);
+               hdata->GetListOfFunctions()->Add(pave[lay]);
+             }
+             else
+               if(hname.Contains("SDDRecPointCheck"))
+                 {
+                   
+                   //AliInfo("========================================Found histo\n");
+                   ((TH1F*)hdata)->SetBinContent(5,active);
+                   ((TH1F*)hdata)->SetBinContent(6,filled);
+                   ((TH1F*)hdata)->SetBinContent(7,activedriftregion);
+                   ((TH1F*)hdata)->SetBinContent(8,filleddr);
+                   ((TH1F*)hdata)->SetBinContent(9,excluded);
+                   ((TH1F*)hdata)->SetBinContent(10,empty);
+                   ((TH1F*)hdata)->SetBinContent(11,excludeddriftregion);
+                   ((TH1F*)hdata)->SetBinContent(12,emptydr);
+                   ((TH1F*)hdata)->SetBinContent(13,exactive);
+                   ((TH1F*)hdata)->SetBinContent(14,emptydiff);
+                   ((TH1F*)hdata)->SetBinContent(15,exactivedriftregion);
+                   ((TH1F*)hdata)->SetBinContent(16,emptydr);
+                   
+                   //layer 3
+                   ((TH1F*)hdata)->SetBinContent(19,activemoduleperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(20,filledmodules[0]);
+                   ((TH1F*)hdata)->SetBinContent(21,activedrperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(22,filleddriftregion[0]);
+                   ((TH1F*)hdata)->SetBinContent(23,excludedmoduleperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(24,emptymodules[0]);
+                   ((TH1F*)hdata)->SetBinContent(25,excludeddrperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(26,emptydriftregion[0]);
+                   ((TH1F*)hdata)->SetBinContent(27,exactivemoduleperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(28,emptyactivemoduleperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(29,activedrperlayer[0]);
+                   ((TH1F*)hdata)->SetBinContent(30,emptyactivedrperlayer[0]);
+                   
+                   //layer 4
+                   ((TH1F*)hdata)->SetBinContent(35,activemoduleperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(36,filledmodules[1]);
+                   ((TH1F*)hdata)->SetBinContent(37,activedrperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(38,filleddriftregion[1]);
+                   ((TH1F*)hdata)->SetBinContent(39,excludedmoduleperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(40,emptymodules[1]);
+                   ((TH1F*)hdata)->SetBinContent(41,excludeddrperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(42,emptydriftregion[1]);
+                   ((TH1F*)hdata)->SetBinContent(43,exactivemoduleperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(44,emptyactivemoduleperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(45,activedrperlayer[1]);
+                   ((TH1F*)hdata)->SetBinContent(46,emptyactivedrperlayer[1]);
+                   
+                 }
+           }//if hadata
+           
+         }//end while 
+       
+      }//end else 
+      delete hmodule;
+      hmodule=NULL;
+      for(Int_t i=0;i<2;i++) {
+       delete hlayer[i];
+       hlayer[i]=NULL;
+      }//end for      
+
+
+      //SDDQACheckerValue=1.;
+      }//end recpoint list uid = 20
       else if(uidrec==40)
        {
          //digitsr
@@ -576,7 +1226,7 @@ Bool_t AliITSQASDDChecker::MakeSDDRawsImage(TObjArray ** list, AliQAv1::TASKINDE
        fImage[esIndex]->Print(Form("%s%s%d.%s", AliQAv1::GetImageFileName(), AliQAv1::GetModeName(mode), AliQAChecker::Instance()->GetRunNumber(), AliQAv1::GetImageFileFormat()), "ps") ; 
        fImage[esIndex]->Clear() ; 
        Int_t nx =2; //TMath::Nint(TMath::Sqrt(nImages));
-       Int_t ny =1; // nx  ; 
+       Int_t ny =2; // nx  ; 
        //if (nx < TMath::Sqrt(nImages))
        //ny++ ;  
        fImage[esIndex]->Divide(nx, ny) ; 
index e69d902..8725a2b 100644 (file)
@@ -154,7 +154,11 @@ void AliITSQASDDDataMakerRec::StartOfDetectorCycle()
   //Start of a QA cycle
 
   AliDebug(AliQAv1::GetQADebugLevel(),Form("Start of SDD Cycle with event specie %s for task %s\n",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie()),AliQAv1::GetTaskName(fAliITSQADataMakerRec->GetTaskIndexSelected()).Data()));
-  if(!fCalibration) {CreateTheCalibration();}
+  if(!fCalibration) 
+    {
+      //fAliITSQADataMakerRec->GetRawsData(9+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
+      CreateTheCalibration();
+  }
 
   if(fAliITSQADataMakerRec->GetEventSpecie()==0) return;//not the kDefault EventSpecie
     //Detector specific actions at start of cycle
@@ -163,7 +167,7 @@ void AliITSQASDDDataMakerRec::StartOfDetectorCycle()
       if(fAliITSQADataMakerRec->ListExists(AliQAv1::kRAWS)==kFALSE)return;
 
        AliDebug(AliQAv1::GetQADebugLevel(),Form("Reset of Raw Data normalized histograms with eventspecie %s ",AliRecoParam::GetEventSpecieName(fAliITSQADataMakerRec->GetEventSpecie())));
-
+       fAliITSQADataMakerRec->GetRawsData(10+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();  
        fAliITSQADataMakerRec->GetRawsData(3+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
        fAliITSQADataMakerRec->GetRawsData(4+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
        fAliITSQADataMakerRec->GetRawsData(5+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
@@ -177,6 +181,8 @@ void AliITSQASDDDataMakerRec::StartOfDetectorCycle()
        fAliITSQADataMakerRec->GetRecPointsData(9+  fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
        fAliITSQADataMakerRec->GetRecPointsData(10+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
        fAliITSQADataMakerRec->GetRecPointsData(11+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
+       fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
+
       }
 }
 
@@ -185,9 +191,39 @@ void AliITSQASDDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObj
 {
   //end of a QA cycle
        AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); 
+
+       Double_t entriescalibration1= 0.;
+       Double_t entriescalibrationL3=0.;
+       Double_t entriescalibrationL4=0.;
+
+       if(fHistoCalibration){
+         entriescalibration1= ((TH1D*)(fHistoCalibration->At(0)))->GetEntries();
+         entriescalibrationL3=((TH2D*)(fHistoCalibration->At(1)))->GetEntries();
+         entriescalibrationL4=((TH2D*)(fHistoCalibration->At(2)))->GetEntries();
+       }
        if(task==AliQAv1::kRAWS){
          //      printf("fNevent %d \n",fNEvent);
+
+         ((TH1F*)fAliITSQADataMakerRec->GetRawsData(10+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(1,fNEvent);
+
          if(fNEvent!=0){
+
+           Double_t entriesmodpattern=((TH1D*)fAliITSQADataMakerRec->GetRawsData(0 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetEntries();
+           Double_t entriesL3=((TH2D*)fAliITSQADataMakerRec->GetRawsData(1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetEntries();
+           Double_t entriesL4=((TH2D*)fAliITSQADataMakerRec->GetRawsData(2 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetEntries();
+
+           Double_t normentriesmodpattern=0.; 
+           Double_t normentriesL3= 0.;       
+           Double_t normentriesL4= 0.;     
+           
+           if(entriescalibration1!=0.)normentriesmodpattern=entriesmodpattern/(entriescalibration1*fNEvent);
+           if(entriesL3!=0.)   normentriesL3= entriesL3/(entriescalibrationL3*fNEvent);
+           if(entriesL4!=0.)   normentriesL4= entriesL4/(entriescalibrationL4*fNEvent);
+           
+           ((TH1F*)fAliITSQADataMakerRec->GetRawsData(10+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(2,normentriesmodpattern);
+           ((TH1F*)fAliITSQADataMakerRec->GetRawsData(10+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(3,normentriesL3);
+           ((TH1F*)fAliITSQADataMakerRec->GetRawsData(10+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(4,normentriesL4);
+           
            ((TH1D*)fAliITSQADataMakerRec->GetRawsData(3 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH1D*)fAliITSQADataMakerRec->GetRawsData(0 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH1D*) (fHistoCalibration->At(0))),1.,(Double_t)fNEvent);
          
            ((TH2D*)fAliITSQADataMakerRec->GetRawsData(4 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRawsData(1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(1))),1.,(Double_t)fNEvent);
@@ -212,12 +248,91 @@ void AliITSQASDDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObj
                                ((TH1D*)fAliITSQADataMakerRec->GetRawsData(7 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Fill(((TH1D*)fAliITSQADataMakerRec->GetRawsData(5 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetBinContent(i,j));
                        }
                }
-                       
+               
+
+               for(Int_t inumb=8;inumb<10;inumb++)
+                 {
+                   for(Int_t ii=1; ii<fAliITSQADataMakerRec->GetRawsData(inumb + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetNbinsX()+1;ii++)
+                     {
+                       for(Int_t jj=1; jj<fAliITSQADataMakerRec->GetRawsData(inumb+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetNbinsY()+1;jj++)
+                         {
+                           
+                           if(((TH1D*)(fHistoCalibration->At(inumb-7)))->GetBinContent(ii,jj) != 0. )
+                             {
+                               fAliITSQADataMakerRec->GetRawsData(inumb+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->SetBinContent(ii,jj,1);
+                             }
+                           else if(((TH1D*)(fHistoCalibration->At(inumb-7)))->GetBinContent(ii,jj) == 0. )
+                             {
+                               fAliITSQADataMakerRec->GetRawsData(inumb+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->SetBinContent(ii,jj,0);
+                             } 
+                           //printf("%d \t %d \t %d \t %02f \n",inumb,ii,jj,fAliITSQADataMakerRec->GetRawsData(inumb+ fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->GetBinContent(ii,jj));
+                         }//end x axis
+                     }//end y axis
+                 }//end for inumb
+               
+               
+               
        }//end raws
        
        if(task==AliQAv1::kRECPOINTS){
+
+
+         Double_t chargeL3=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(0+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMean();
+         Double_t errchargeL3=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(0+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMeanError();
+
+         Double_t chargeL4=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(1+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMean();
+         Double_t errchargeL4=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(1+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMeanError();
+
+
+         Double_t radiusL3=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(13+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMean();
+         Double_t errradiusL3=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(13+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMeanError();
+
+         Double_t radiusL4=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(14+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMean();
+         Double_t errradiusL4=((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(14+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetMeanError();
+
+
+
          //      printf("fNeventRP %d \n",fNEventRP);
+         ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(1,fNEventRP);
+
+         ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(31,chargeL3);
+         ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinError(31,errchargeL3);
+
+         ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(47,chargeL4);
+         ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinError(47,errchargeL4);
+
+         ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(32,radiusL3);
+         ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinError(32,errradiusL3);
+
+         ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(48,radiusL4);
+         ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinError(48,errradiusL4);
+
+
+         Double_t entriesmodpattern=((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(6 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetEntries();
+         Double_t entriesL3=((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(7 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetEntries();
+         Double_t entriesL4=((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(8 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->GetEntries();
+         
+         //printf("entries modpatternrp = %02f \t L3= %02f \t L4 =%02f \n",entriesmodpattern,entriesL3,entriesL4 );
+
          if(fNEventRP!=0){
+
+
+
+           Double_t normentriesmodpattern=0.; 
+           Double_t normentriesL3= 0.;       
+           Double_t normentriesL4= 0.;     
+           
+           if(entriescalibration1!=0.)normentriesmodpattern=entriesmodpattern/(entriescalibration1*fNEventRP);
+           if(entriesL3!=0.)   normentriesL3= entriesL3/(entriescalibrationL3*fNEventRP);
+           if(entriesL4!=0.)   normentriesL4= entriesL4/(entriescalibrationL4*fNEventRP);
+
+           ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(2,normentriesmodpattern);
+           ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(3,normentriesL3);
+           ((TH1F*)fAliITSQADataMakerRec->GetRecPointsData(27+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->SetBinContent(4,normentriesL4);       
+
+           // printf("NORM entries modpatternrp = %02f \t L3= %02f \t L4 =%02f \n",normentriesmodpattern,normentriesL3,normentriesL4 );
+
+
            ((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(9 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH1D*)fAliITSQADataMakerRec->GetRecPointsData(6 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH1D*) (fHistoCalibration->At(0))),1.,(Double_t)fNEventRP);
            
                  ((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(10+ fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]))->Divide((TH2D*)fAliITSQADataMakerRec->GetRecPointsData(7 + fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()]),((TH2D*)(fHistoCalibration->At(1))),1.,(Double_t)fNEventRP);
@@ -303,6 +418,10 @@ 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");
+  h0->SetOption("bar1");
+  h0->SetBarOffset(0.01);
+  h0->SetBarWidth(0.95);
+  h0->SetFillColor(45);
   rv = fAliITSQADataMakerRec->Add2RawsList(h0,0+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
   fSDDhRawsTask++;
   
@@ -310,19 +429,26 @@ Int_t AliITSQASDDDataMakerRec::InitRaws()
   TH2D *hphil3 = new TH2D("SDDphizL3","SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5);//1
   hphil3->GetXaxis()->SetTitle("z[Module Number L3 ]");
   hphil3->GetYaxis()->SetTitle("#varphi[ Ladder Number L3]");
-  rv = fAliITSQADataMakerRec->Add2RawsList(hphil3,1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); 
+  hphil3->SetStats(0);
+  rv = fAliITSQADataMakerRec->Add2RawsList(hphil3,1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr); 
   fSDDhRawsTask++;
   
   TH2D *hphil4 = new TH2D("SDDphizL4","SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5); //2
   hphil4->GetXaxis()->SetTitle("z[Module Number L4]");
   hphil4->GetYaxis()->SetTitle("#varphi[Ladder Number L4]");
-   rv = fAliITSQADataMakerRec->Add2RawsList(hphil4,2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); 
+  hphil4->SetStats(0);
+   rv = fAliITSQADataMakerRec->Add2RawsList(hphil4,2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr); 
   fSDDhRawsTask++;
   
   //normalized histograms
   TH1D *h0norm = new TH1D("SDDModPatternNORM","NORM HW Modules pattern",fgknSDDmodules,239.5,499.5); //3
   h0norm->GetXaxis()->SetTitle("Module Number");
   h0norm->GetYaxis()->SetTitle("Counts");
+  h0norm->SetOption("bar1");
+  h0norm->SetBarOffset(0.01);
+  h0norm->SetBarWidth(0.95);
+  h0norm->SetFillColor(46);
+  //h0norm->SetStats(0);
   rv = fAliITSQADataMakerRec->Add2RawsList(h0norm,3+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
   fSDDhRawsTask++;
   
@@ -330,78 +456,176 @@ Int_t AliITSQASDDDataMakerRec::InitRaws()
   TH2D *hphil3norm = new TH2D("SDDphizL3NORM","NORM SDD #varphiz Layer3 ",12,0.5,6.5,14,0.5,14.5);//4
   hphil3norm->GetXaxis()->SetTitle("z[Module Number L3 ]");
   hphil3norm->GetYaxis()->SetTitle("#varphi[ Ladder Number L3]");
-  rv = fAliITSQADataMakerRec->Add2RawsList(hphil3norm,4+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr); 
+  hphil3norm->SetStats(0);
+  rv = fAliITSQADataMakerRec->Add2RawsList(hphil3norm,4+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); 
   fSDDhRawsTask++;
   
   TH2D *hphil4norm = new TH2D("SDDphizL4NORM","NORM SDD #varphiz Layer4 ",16,0.5,8.5,22,0.5,22.5); //5
   hphil4norm->GetXaxis()->SetTitle("z[Module Number L4]");
   hphil4norm->GetYaxis()->SetTitle("#varphi[Ladder Number L4]");
-   rv = fAliITSQADataMakerRec->Add2RawsList(hphil4norm,5+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr); 
+  hphil4norm->SetStats(0);
+  rv = fAliITSQADataMakerRec->Add2RawsList(hphil4norm,5+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); 
   fSDDhRawsTask++;
 
        
-       Float_t hMax = 0.2;
-       
-       TH1F *oL3 = new TH1F("SDDL3_RelativeOccupancy","Layer 3 Relative Occupancy",200,0.,hMax);
-       rv = fAliITSQADataMakerRec->Add2RawsList(oL3,6+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); //6  
-       fSDDhRawsTask++;
-       
-       TH1F *oL4 = new TH1F("SDDL4_RelativeOccupancy","Layer 4 Relative Occupancy",200,0.,hMax);
-       rv = fAliITSQADataMakerRec->Add2RawsList(oL4,7+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); //7   
-       fSDDhRawsTask++;
-       
-       fOnlineOffsetRaws = fSDDhRawsTask;
-       if(fkOnline){
-      //DDL Pattern 
-      TH2D *hddl = new TH2D("SDDDDLPattern","SDD DDL Pattern ",24,-0.5,11.5,24,-0.5,23.5); //8
-      hddl->GetXaxis()->SetTitle("Channel");
-      hddl->GetYaxis()->SetTitle("DDL Number");
-      rv = fAliITSQADataMakerRec->Add2RawsList(hddl,fOnlineOffsetRaws+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
-      fSDDhRawsTask++;
-      Int_t indexlast1 = 0;
+  Float_t hMax = 0.2;
   
-      fTimeBinSize = 4;
-      indexlast = 0;
-      index1 = 0;
-      indexlast1 = fSDDhRawsTask;
-      for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
-                 for(Int_t iside=0;iside<fgknSide;iside++){
-                         AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
-                         TProfile2D *fModuleChargeMapFSE = new TProfile2D(Form("SDDchargeMapFSE_L%d_%d_%d_%d",lay,lad,det,iside),Form("SDDChargeMapForSingleEvent_L%d_%d_%d_%d",lay,lad,det,iside)  ,256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
-                         fModuleChargeMapFSE->GetXaxis()->SetTitle("Time Bin");
-                         fModuleChargeMapFSE->GetYaxis()->SetTitle("Anode");
-                         rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMapFSE,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);         
-                         fSDDhRawsTask++;
-                         index1++;      
-                 }
+  TH1F *oL3 = new TH1F("SDDL3_RelativeOccupancy","Layer 3 Relative Occupancy",200,0.,hMax);
+  rv = fAliITSQADataMakerRec->Add2RawsList(oL3,6+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); //6  
+  fSDDhRawsTask++;
+  
+  TH1F *oL4 = new TH1F("SDDL4_RelativeOccupancy","Layer 4 Relative Occupancy",200,0.,hMax);
+  rv = fAliITSQADataMakerRec->Add2RawsList(oL4,7+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); //7   
+  fSDDhRawsTask++;
+  
+  //zPhi distribution using ladder and modules numbers
+  TH2D *hcalibl3 = new TH2D("SDDphizCalibL3","SDDCalibL3 ",12,0.5,6.5,14,0.5,14.5);//8
+  hcalibl3->GetXaxis()->SetTitle("z[Module Number L3]");
+  hcalibl3->GetYaxis()->SetTitle("#varphi[ Ladder Number L3]");
+  hcalibl3->SetStats(0);
+  hcalibl3->SetMaximum(2);
+  rv = fAliITSQADataMakerRec->Add2RawsList(hcalibl3,8+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr); 
+  fSDDhRawsTask++;
+  
+  TH2D *hcalibl4 = new TH2D("SDDphizCalibL4","SDDCalibL4 ",16,0.5,8.5,22,0.5,22.5); //9
+  hcalibl4->GetXaxis()->SetTitle("z[Module Number L4]");
+  hcalibl4->GetYaxis()->SetTitle("#varphi[Ladder Number L4]");
+  hcalibl4->SetStats(0);
+  hcalibl4->SetMaximum(2);
+  rv = fAliITSQADataMakerRec->Add2RawsList(hcalibl4,9+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], !expert, image, !saveCorr); 
+  fSDDhRawsTask++;
+
+  TH1F *hsummarydata = new TH1F("SDDRawDataCheck","SDDRawDataCheck",46,-0.5,45.5);//10 summary of raw data checks
+  hsummarydata->GetXaxis()->SetLabelSize(0.02);
+  hsummarydata->GetXaxis()->SetTickLength(0.01);
+  hsummarydata->GetXaxis()->SetNdivisions(110);
+  hsummarydata->GetXaxis()->SetTicks("-");
+  hsummarydata->GetYaxis()->SetLabelSize(0.02);
+  hsummarydata->GetYaxis()->SetTitleSize(0.02);
+  hsummarydata->GetYaxis()->SetTitleOffset(1.5);
+  hsummarydata->GetYaxis()->SetTitle("#events(norm) or #modules (m) or #drift regions (dr)");
+  hsummarydata->SetStats(0);
+  hsummarydata->SetMaximum(272);
+  hsummarydata->SetMinimum(0.);
+
+  hsummarydata->SetOption("textbar1");
+  hsummarydata->SetBarOffset(0.01);
+  hsummarydata->SetBarWidth(0.95);
+  hsummarydata->SetFillColor(8);
+
+  //information about the events
+  hsummarydata->GetXaxis()->SetBinLabel(1,"Events");
+  hsummarydata->GetXaxis()->SetBinLabel(2,"Ent_NORM");
+  hsummarydata->GetXaxis()->SetBinLabel(3,"Ent_NORML3");
+  hsummarydata->GetXaxis()->SetBinLabel(4,"Ent_NORML4");
+  //all
+
+  hsummarydata->GetXaxis()->SetBinLabel(5,"m_act");
+  hsummarydata->GetXaxis()->SetBinLabel(6,"m_fil");
+  hsummarydata->GetXaxis()->SetBinLabel(7,"dr_act");
+  hsummarydata->GetXaxis()->SetBinLabel(8,"dr_fil");
+  hsummarydata->GetXaxis()->SetBinLabel(9,"m_exc");
+  hsummarydata->GetXaxis()->SetBinLabel(10,"m_emp");
+  hsummarydata->GetXaxis()->SetBinLabel(11,"dr_exc");
+  hsummarydata->GetXaxis()->SetBinLabel(12,"dr_emp");
+  hsummarydata->GetXaxis()->SetBinLabel(13,"m_exc-act");
+  hsummarydata->GetXaxis()->SetBinLabel(14,"m_act-emp");
+  hsummarydata->GetXaxis()->SetBinLabel(15,"dr_exc-act");
+  hsummarydata->GetXaxis()->SetBinLabel(16,"dr_act-emp");
+  hsummarydata->GetXaxis()->SetBinLabel(17,"m_overth");
+  hsummarydata->GetXaxis()->SetBinLabel(18,"dr_overth");
+
+  //l3
+
+  hsummarydata->GetXaxis()->SetBinLabel(19,"m_actl3");
+  hsummarydata->GetXaxis()->SetBinLabel(20,"m_fill3");
+  hsummarydata->GetXaxis()->SetBinLabel(21,"dr_actl3");
+  hsummarydata->GetXaxis()->SetBinLabel(22,"dr_fill3");
+  hsummarydata->GetXaxis()->SetBinLabel(23,"m_excl3");
+  hsummarydata->GetXaxis()->SetBinLabel(24,"m_empl3");
+  hsummarydata->GetXaxis()->SetBinLabel(25,"dr_excl3");
+  hsummarydata->GetXaxis()->SetBinLabel(26,"dr_empl3");
+  hsummarydata->GetXaxis()->SetBinLabel(27,"m_exc-actl3");
+  hsummarydata->GetXaxis()->SetBinLabel(28,"m_act-empl3");
+  hsummarydata->GetXaxis()->SetBinLabel(29,"dr_exc-actl3");
+  hsummarydata->GetXaxis()->SetBinLabel(30,"dr_act-empl3");
+  hsummarydata->GetXaxis()->SetBinLabel(31,"m_overthl3");
+  hsummarydata->GetXaxis()->SetBinLabel(32,"dr_overthl3");
+
+  //l4
+
+  hsummarydata->GetXaxis()->SetBinLabel(33,"m_actl4");
+  hsummarydata->GetXaxis()->SetBinLabel(34,"m_fill4");
+  hsummarydata->GetXaxis()->SetBinLabel(35,"dr_actl4");
+  hsummarydata->GetXaxis()->SetBinLabel(36,"dr_fill4");
+  hsummarydata->GetXaxis()->SetBinLabel(37,"m_excl4");
+  hsummarydata->GetXaxis()->SetBinLabel(38,"m_empl4");
+  hsummarydata->GetXaxis()->SetBinLabel(39,"dr_excl4");
+  hsummarydata->GetXaxis()->SetBinLabel(40,"dr_empl4");
+  hsummarydata->GetXaxis()->SetBinLabel(41,"m_exc-actl4");
+  hsummarydata->GetXaxis()->SetBinLabel(42,"m_act-empl4");
+  hsummarydata->GetXaxis()->SetBinLabel(43,"dr_exc-actl4");
+  hsummarydata->GetXaxis()->SetBinLabel(44,"dr_act-empl4");
+  hsummarydata->GetXaxis()->SetBinLabel(45,"m_overthl4");
+  hsummarydata->GetXaxis()->SetBinLabel(46,"dr_overthl4");
+  hsummarydata->GetXaxis()->LabelsOption("v");
+
+  rv = fAliITSQADataMakerRec->Add2RawsList(hsummarydata,10+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); 
+  fSDDhRawsTask++;
+  fOnlineOffsetRaws = fSDDhRawsTask;
+
+  //online part
+  if(fkOnline){
+      //DDL Pattern 
+    TH2D *hddl = new TH2D("SDDDDLPattern","SDD DDL Pattern ",24,-0.5,11.5,24,-0.5,23.5); //11
+    hddl->GetXaxis()->SetTitle("Channel");
+    hddl->GetYaxis()->SetTitle("DDL Number");
+    rv = fAliITSQADataMakerRec->Add2RawsList(hddl,fOnlineOffsetRaws+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);
+    fSDDhRawsTask++;
+    Int_t indexlast1 = 0;
+    
+    fTimeBinSize = 4;
+    indexlast = 0;
+    index1 = 0;
+    indexlast1 = fSDDhRawsTask;
+    for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
+      for(Int_t iside=0;iside<fgknSide;iside++){
+       AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
+       TProfile2D *fModuleChargeMapFSE = new TProfile2D(Form("SDDchargeMapFSE_L%d_%d_%d_%d",lay,lad,det,iside),Form("SDDChargeMapForSingleEvent_L%d_%d_%d_%d",lay,lad,det,iside)  ,256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
+       fModuleChargeMapFSE->GetXaxis()->SetTitle("Time Bin");
+       fModuleChargeMapFSE->GetYaxis()->SetTitle("Anode");
+       rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMapFSE,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr);   
+       fSDDhRawsTask++;
+       index1++;        
       }
+    }
       
-      for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
-                 for(Int_t iside=0;iside<fgknSide;iside++){
-                         AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
-                         TProfile2D *fModuleChargeMap = new TProfile2D(Form("SDDchargeMap_L%d_%d_%d_%d",lay,lad,det,iside),Form("SDDChargeMap_L%d_%d_%d_%d",lay,lad,det,iside),256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
-                         fModuleChargeMap->GetXaxis()->SetTitle("Time Bin");
-                         fModuleChargeMap->GetYaxis()->SetTitle("Anode Number");
-                         rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMap,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); 
-                         fSDDhRawsTask++;
-                         index1++;      
-                 }
+    for(Int_t moduleSDD =0; moduleSDD<fgknSDDmodules; moduleSDD++){
+      for(Int_t iside=0;iside<fgknSide;iside++){
+       AliITSgeomTGeo::GetModuleId(moduleSDD+fgkmodoffset, lay, lad, det);
+       TProfile2D *fModuleChargeMap = new TProfile2D(Form("SDDchargeMap_L%d_%d_%d_%d",lay,lad,det,iside),Form("SDDChargeMap_L%d_%d_%d_%d",lay,lad,det,iside),256/fTimeBinSize,-0.5,255.5,256,-0.5,255.5);
+       fModuleChargeMap->GetXaxis()->SetTitle("Time Bin");
+       fModuleChargeMap->GetYaxis()->SetTitle("Anode Number");
+       rv = fAliITSQADataMakerRec->Add2RawsList(fModuleChargeMap,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); 
+       fSDDhRawsTask++;
+       index1++;        
       }
-      
-      //Event Size 
-      TH1F *hsize = new TH1F("SDDEventSize","SDD Event Size ",500,-0.5,199.5); 
-      hsize->SetBit(TH1::kCanRebin);
-      hsize->GetXaxis()->SetTitle("Event Size [kB]");
-      hsize->GetYaxis()->SetTitle("Entries");
-      rv = fAliITSQADataMakerRec->Add2RawsList(hsize,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); 
-      fSDDhRawsTask++;
-         
-    }  // kONLINE
-       
-       cout << fSDDhRawsTask << " SDD Raws histograms booked" << endl;
-       
-       AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Raws histograms booked\n",fSDDhRawsTask));
-       return rv ; 
+    }
+    
+    //Event Size 
+    TH1F *hsize = new TH1F("SDDEventSize","SDD Event Size ",500,-0.5,199.5); 
+    hsize->SetBit(TH1::kCanRebin);
+    hsize->GetXaxis()->SetTitle("Event Size [kB]");
+    hsize->GetYaxis()->SetTitle("Entries");
+    rv = fAliITSQADataMakerRec->Add2RawsList(hsize,indexlast1 + index1 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image, !saveCorr); 
+    fSDDhRawsTask++;
+    
+  }  // kONLINE
+  
+  cout << fSDDhRawsTask << " SDD Raws histograms booked" << endl;
+  
+  AliDebug(AliQAv1::GetQADebugLevel(),Form("%d SDD Raws histograms booked\n",fSDDhRawsTask));
+  return rv ; 
 }
 
 
@@ -489,8 +713,8 @@ Int_t AliITSQASDDDataMakerRec::MakeRaws(AliRawReader* rawReader)
 
     //printf(" \n%i %i %i %i \n ",lay, lad, det,iside );
     fAliITSQADataMakerRec->GetRawsData( 0 + fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()] )->Fill(isddmod);   
-    if(lay==3) fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.25,lad); 
-    if(lay==4) fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.25,lad);
+    if(lay==3) fAliITSQADataMakerRec->GetRawsData(1+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.25,lad); //phiz l3 not norm
+    if(lay==4) fAliITSQADataMakerRec->GetRawsData(2+fGenRawsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(det+0.5*iside-0.25,lad); //phiz l4 not norm
  
     if(fkOnline) {
 
@@ -667,6 +891,10 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
   TH1D *h6 = new TH1D("SDDModPatternRP","Modules pattern RP",fgknSDDmodules,239.5,499.5); //position number 6
   h6->GetXaxis()->SetTitle("Module number"); //spd offset = 240
   h6->GetYaxis()->SetTitle("Entries");
+  h6->SetOption("bar1");
+  h6->SetBarOffset(0.01);
+  h6->SetBarWidth(0.95);
+  h6->SetFillColor(39);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(h6,6 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
   fSDDhRecPointsTask++;
 
@@ -689,6 +917,10 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
   TH1D *h9 = new TH1D("SDDModPatternRPNORM","Modules pattern RP NORM",fgknSDDmodules,239.5,499.5); //position number 9
   h9->GetXaxis()->SetTitle("Module number"); //spd offset = 240
   h9->GetYaxis()->SetTitle("Entries");
+  h9->SetOption("bar1");
+  h9->SetBarOffset(0.01);
+  h9->SetBarWidth(0.95);
+  h9->SetFillColor(49);
   rv = fAliITSQADataMakerRec->Add2RecPointsList(h9,9 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
   fSDDhRecPointsTask++;
 
@@ -790,6 +1022,93 @@ Int_t AliITSQASDDDataMakerRec::InitRecPoints()
        rv = fAliITSQADataMakerRec->Add2RecPointsList(dedxL4,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image); // 26
        fSDDhRecPointsTask++;
        
+
+  TH1F *hsummarydatarp = new TH1F("SDDRecPointCheck","SDDRecPointCheck",50,-0.5,49.5);//27 summary of recpoint checks
+  hsummarydatarp->GetXaxis()->SetLabelSize(0.02);
+  hsummarydatarp->GetXaxis()->SetTickLength(0.01);
+  hsummarydatarp->GetXaxis()->SetNdivisions(110);
+  hsummarydatarp->GetXaxis()->SetTicks("-");
+  hsummarydatarp->GetYaxis()->SetLabelSize(0.02);
+  hsummarydatarp->GetYaxis()->SetTitleSize(0.02);
+  hsummarydatarp->GetYaxis()->SetTitleOffset(1.5);
+  hsummarydatarp->GetYaxis()->SetTitle("#events(norm) or #modules (m) or #drift regions (dr)");
+  hsummarydatarp->SetStats(0);
+  hsummarydatarp->SetMaximum(272);
+
+  hsummarydatarp->SetOption("text bar1 hist");
+  hsummarydatarp->SetBarOffset(0.05);
+  hsummarydatarp->SetBarWidth(0.95);
+  hsummarydatarp->SetFillColor(32);
+  hsummarydatarp->SetMinimum(0.);
+
+  //information about the events
+  hsummarydatarp->GetXaxis()->SetBinLabel(1,"Events");
+  hsummarydatarp->GetXaxis()->SetBinLabel(2,"Ent_NORM");
+  hsummarydatarp->GetXaxis()->SetBinLabel(3,"Ent_NORML3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(4,"Ent_NORML4");
+  //all
+
+  hsummarydatarp->GetXaxis()->SetBinLabel(5, "m_act");
+  hsummarydatarp->GetXaxis()->SetBinLabel(6, "m_fil");
+  hsummarydatarp->GetXaxis()->SetBinLabel(7, "dr_act");
+  hsummarydatarp->GetXaxis()->SetBinLabel(8, "dr_fil");
+  hsummarydatarp->GetXaxis()->SetBinLabel(9, "m_exc");
+  hsummarydatarp->GetXaxis()->SetBinLabel(10,"m_emp");
+  hsummarydatarp->GetXaxis()->SetBinLabel(11,"dr_exc");
+  hsummarydatarp->GetXaxis()->SetBinLabel(12,"dr_emp");
+  hsummarydatarp->GetXaxis()->SetBinLabel(13,"m_exc-act");
+  hsummarydatarp->GetXaxis()->SetBinLabel(14,"m_act-emp");
+  hsummarydatarp->GetXaxis()->SetBinLabel(15,"dr_exc-act");
+  hsummarydatarp->GetXaxis()->SetBinLabel(16,"dr_act-emp");
+  hsummarydatarp->GetXaxis()->SetBinLabel(17,"m_overth");
+  hsummarydatarp->GetXaxis()->SetBinLabel(18,"dr_overth");
+
+  //l3
+
+  hsummarydatarp->GetXaxis()->SetBinLabel(19,"m_actl3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(20,"m_fill3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(21,"dr_actl3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(22,"dr_fill3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(23,"m_excl3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(24,"m_empl3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(25,"dr_excl3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(26,"dr_empl3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(27,"m_exc-actl3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(28,"m_act-empl3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(29,"dr_exc-actl3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(30,"dr_act-empl3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(31,"meanch_l3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(32,"meanrad_l3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(33,"m_overthl3");
+  hsummarydatarp->GetXaxis()->SetBinLabel(34,"dr_overthl3");
+
+  //l4
+
+  hsummarydatarp->GetXaxis()->SetBinLabel(35,"m_actl4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(36,"m_fill4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(37,"dr_actl4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(38,"dr_fill4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(39,"m_excl4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(40,"m_empl4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(41,"dr_excl4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(42,"dr_empl4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(43,"m_exc-actl4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(44,"m_act-empl4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(45,"dr_exc-actl4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(46,"dr_act-empl4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(47,"meanch_l4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(48,"meanrad_l4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(49,"m_overthl4");
+  hsummarydatarp->GetXaxis()->SetBinLabel(50,"dr_overthl4");
+
+  hsummarydatarp->GetXaxis()->LabelsOption("v");
+
+  rv = fAliITSQADataMakerRec->Add2RecPointsList(hsummarydatarp,fSDDhRecPointsTask+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()], expert, !image);// expert NO image
+
+
+
+  fSDDhRecPointsTask++;
+
        fOnlineOffsetRecPoints = fSDDhRecPointsTask;
        if(fkOnline){
       TH2F *h19 = new TH2F("SDDGlobalCoordDistribYXFSE","YX Global Coord Distrib FSE",112,-28,28,112,-28,28);//position number 27
@@ -831,7 +1150,7 @@ Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree)
   Int_t npoints = 0;      
   Float_t cluglo[3]={0.,0.,0.}; 
   if(fkOnline){
-      for(Int_t i=27;i<29;i++){
+      for(Int_t i=28;i<30;i++){
          fAliITSQADataMakerRec->GetRecPointsData(i+fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Reset();
        }
     }
@@ -860,8 +1179,8 @@ Int_t AliITSQASDDDataMakerRec::MakeRecPoints(TTree * clustersTree)
                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(27 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[0],cluglo[1]);//global distribution YX FSE
-                       fAliITSQADataMakerRec->GetRecPointsData(28 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],rad);//global distribution rz FSE
+                       fAliITSQADataMakerRec->GetRecPointsData(28 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[0],cluglo[1]);//global distribution YX FSE
+                       fAliITSQADataMakerRec->GetRecPointsData(29 +fGenRecPointsOffset[fAliITSQADataMakerRec->GetEventSpecie()])->Fill(cluglo[2],rad);//global distribution rz FSE
                }
                Int_t iside=recp->GetDriftSide();
                 lay=recp->GetLayer();
@@ -1033,11 +1352,12 @@ void AliITSQASDDDataMakerRec::CreateTheCalibration()
              fillmodhisto3side1-=badmodhisto3side1;
              ((TH1D*)(fHistoCalibration->At(0)))->SetBinContent(imod+1,fillmodhisto1);
              ((TH2D*)(fHistoCalibration->At(2)))->SetBinContent(index,lad,fillmodhisto3side0);
-             ((TH2D*)(fHistoCalibration->At(2)))->SetBinContent(index+1,lad,fillmodhisto2side1);
+             ((TH2D*)(fHistoCalibration->At(2)))->SetBinContent(index+1,lad,fillmodhisto3side1);
            }//end layer 4
          }//end else bad module
        }//end module for
     }
+
 }
 
 //____________________________________________________________________
@@ -1080,3 +1400,15 @@ void AliITSQASDDDataMakerRec::ResetDetector(AliQAv1::TASKINDEX_t task)
   
 }
 
+//____________________________________________________________________
+
+Int_t AliITSQASDDDataMakerRec::GetNumberOfEvents(AliQAv1::TASKINDEX_t task)
+{
+  //return the number of the processed events for a given task fod SDD only
+
+  if(task==AliQAv1::kRAWS){return fNEvent;}
+  else if(task==AliQAv1::kRECPOINTS){return fNEventRP;}
+  else{ AliWarning("The selected TASKINDEX is not valid!! return 0\n"); return 0;}
+
+
+}
index 48eaee7..083e5b5 100644 (file)
@@ -43,6 +43,7 @@ public:
   Int_t GetOffset(AliQAv1::TASKINDEX_t task,Int_t specie=0)const;
   void  SetOffset(AliQAv1::TASKINDEX_t task, Int_t offset, Int_t specie = 0);
   Int_t GetTaskHisto(AliQAv1::TASKINDEX_t task);
+  Int_t GetNumberOfEvents(AliQAv1::TASKINDEX_t task);
   virtual void ResetDetector(AliQAv1::TASKINDEX_t task);
   AliITSDDLModuleMapSDD* GetDDLSDDModuleMap()const{return fDDLModuleMap; };
 
index 06d3a9d..23e86e5 100644 (file)
@@ -66,13 +66,15 @@ void ITSQArecoparam(char *iFile,Int_t idet=2,Int_t FirstEvt=0, Int_t MaxEvts=100
   AliCDBManager* man = AliCDBManager::Instance();
   if (!man->IsDefaultStorageSet()) {
     printf("Setting a local default storage and run number \n");
-    if(namefile.Contains("alien")){
-      man->SetDefaultStorage("raw://");
-    }
-    else{man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");}
+    //  if(namefile.Contains("alien")){
+      man->SetDefaultStorage("alien://folder=/alice/data/2011/OCDB");
+      //}
+      //else{man->SetDefaultStorage("local://$ALICE_ROOT/OCDB");}
     man->SetRun(runNumber);
     AliQAv1::SetQARefStorage("local://$ALICE_ROOT/QARef") ;
   }
+  AliCDBManager::Instance()->GetAll(Form("ITS/Calib/*"));
+  
 
   AliCDBEntry* entry = AliCDBManager::Instance()->Get("GRP/GRP/Data");
 
@@ -364,3 +366,46 @@ pluginHandler = pluginManager->FindHandler("AliReconstructor", "ITS");
 
 }
 
+void ITSQArecoparam(Int_t runNb,Int_t year,Char_t period[10],Int_t idet=2,Int_t FirstEvt=0, Int_t MaxEvts=1000000)
+{
+  //TString namefile(iFile);
+  //if(namefile.Contains("alien"))
+  //{
+      TGrid::Connect("alien://");
+      if(!gGrid) {
+        printf("gGrid not found! exit macro\n");
+        return;
+      }
+      //}
+
+  gSystem->AddIncludePath("-I. -I$ALICE_ROOT/include");
+
+  char path2[200];
+
+  sprintf(path2,"/alice/data/");
+  printf("path %s\n",path2);
+  char rawfilename[200];
+  sprintf(rawfilename,"%04i/%s/%09i/raw/%02i%09i*.*.root",year,period,runNb,year-2000,runNb);
+
+
+  Int_t number=0;
+
+  TGridResult *gr = gGrid->Query(path2,rawfilename);
+  if (gr->GetEntries() < 1) {
+    printf("In this run there are not raws files: Exit macro\n");
+    return;
+  }
+  if(gr->GetEntries() > 10) number=8;
+  else number=3;
+
+
+  const char *filename = gr->GetKey(number,"turl");
+    printf("-> FILE %s \n",filename);
+    //TString namefile(filename);
+    char *filetouse;//=NULL;
+    sprintf(filetouse,"%s",filename);
+    ITSQArecoparam(filetouse,idet,FirstEvt,MaxEvts);
+
+
+
+}
index 0403d36..f60a0c0 100644 (file)
 #include <TCanvas.h>
 #include <TLegend.h>
 #include <TMath.h>
+#include <TString.h>
 #include "AliRecoParam.h"
 #endif
 
-enum rawexpert_t{pattern,patternnorm,layer3norm,layer4norm,layer3occ,layer4occ,rawtot};
-enum nonrawexpert_t{layer3,layer4,nonrawtot};
+enum rawexpert_t{pattern,patternnorm,layer3norm,layer4norm,layer3occ,layer4occ,rawcheck,rawtot};
+enum nonrawexpert_t{layer3,layer4,calibl3,calibl4,nonrawtot};
 
-enum rpexpert_t{rlocaldistro,rlayer3norm,rlayer4norm,rmodpattern,rmodpatternnorm,rphilayer3,rphilayer4,rrlayer3,rrlayer4,occlayer3,occlayer4,recraw2dlayer3,recraw2dlayer4,recrawlayer3,recrawlayer4,dedxlayer3,dedxlayer4,rtot};
-enum rnonexpert_t{rphizlayer3,rphizlayer4,rglobalrz,rglobalxy,rchargelayer3,rchargelayer4,rtimelayer3,rtimelayer4,rlayer3,rlayer4,nrtot};
+enum rpexpert_t{rlocaldistro,rlayer3norm,rlayer4norm,rmodpattern,rmodpatternnorm,rphilayer3,rphilayer4,rrlayer3,rrlayer4,occlayer3,occlayer4,recraw2dlayer3,recraw2dlayer4,recrawlayer3,recrawlayer4,dedxlayer3,dedxlayer4,rlayer3,rlayer4,recpointcheck,rtot};
+enum rnonexpert_t{rphizlayer3,rphizlayer4,rglobalrz,rglobalxy,rchargelayer3,rchargelayer4,rtimelayer3,rtimelayer4,nrtot};
 
-enum canvsname_t{canvname0,canvname1,canvname2,canvname3,canvname4,canvname5,canvname6,canvname7,canvname8,canvname9,canvname10,canvname11,canvname12,canvname13,canvname14,canvname15,canvname16,canvname17,canvname18,canvname19,canvname20,canvname21,canvname22,canvname23};//
+enum canvsname_t{canvname0,canvname1,canvname2,canvname3,canvname4,canvname5,canvname6,canvname7,canvname8,canvname9,canvname10,canvname11,canvname12,canvname13,canvname14,canvname15,canvname16,canvname17,canvname18,canvname19,canvname20,canvname21,canvname22,canvname23,canvasname24,canvasname25,canvasname26};//27
 
 
 
-void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char_t eventspecie[25]="LowMultiplicity",Bool_t kDoEps=kFALSE)
+void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Bool_t kDoEps=kFALSE,Char_t eventspecie[25]="LowMultiplicity")
 {
-  const TString Rawsexpertname[]={"SDDModPattern","SDDModPatternNORM","SDDphizL3","SDDphizL4","SDDL3_RelativeOccupancy","SDDL4_RelativeOccupancy"};//6
-  const TString Rawsnonexpertname[]={"SDDphizL3NORM","SDDphizL4NORM"};//2
+  const TString Rawsexpertname[]={"SDDModPattern",//0     1
+                                 "SDDModPatternNORM",//1  //1
+                                 "SDDphizL3NORM",    //2  //0
+                                 "SDDphizL4NORM",    //3  //0
+                                 "SDDL3_RelativeOccupancy", //4     4  5
+                                 "SDDL4_RelativeOccupancy",//5      4  5
+                                 "SDDRawDataCheck"//6              6
+                                  };//tot 7
+  const TString Rawsnonexpertname[]={"SDDphizL3",//0   2         
+                                    "SDDphizL4",//1    2
+                                    "SDDphizCalibL3",//2  //   3
+                                    "SDDphizCalibL4"//3     3
+                                     };//tot 4
 
-  const TString RecPointsexpertname[]={"SDDLocalCoordDistrib","SDDModPatternL3RP","SDDModPatternL4RP","SDDModPatternRP","SDDModPatternRPNORM","SDDphidistrib_Layer3","SDDphidistrib_Layer4","SDDrdistrib_Layer3","SDDrdistrib_Layer4","SDDL3_RelativeOccupancy","SDDL4_RelativeOccupancy","SDDL3_Rec2Raw_2D","SDDL4_Rec2Raw_2D","SDDL3_Rec2Raw","SDDL4_Rec2Raw","SDDL3_dedx","SDDL4_dedx"};//17
-  const TString RecPointsnonexpertname[]={"SDDGlobalCoordDistribL3PHIZ","SDDGlobalCoordDistribL4PHIZ","SDDGlobalCoordDistribRZ","SDDGlobalCoordDistribYX","SDDLay3TotCh","SDDLay4TotCh","SDDdrifttime_Layer3","SDDdrifttime_Layer4","SDDModPatternL3RPNORM","SDDModPatternL4RPNORM"};//10
+  const TString RecPointsexpertname[]={"SDDLocalCoordDistrib",//0    //11
+                                      "SDDModPatternL3RP",//1       //12
+                                      "SDDModPatternL4RP",//2       //12
+                                      "SDDModPatternL3RPNORM",//3   //13
+                                      "SDDModPatternL4RPNORM",//4   //13
+                                      "SDDModPatternRP",//5         //14
+                                      "SDDModPatternRPNORM",//6     //14
+                                      "SDDphidistrib_Layer3",//7    //15
+                                      "SDDphidistrib_Layer4",//8    //15
+                                      "SDDrdistrib_Layer3",//9      //16
+                                      "SDDrdistrib_Layer4",//10     //16
+                                      "SDDL3_RelativeOccupancy",//11 //19  20
+                                      "SDDL4_RelativeOccupancy",//12 //19  20
+                                      "SDDL3_Rec2Raw_2D",       //13 //21
+                                      "SDDL4_Rec2Raw_2D",       //14 //21
+                                      "SDDL3_Rec2Raw",          //15 //22  23 
+                                      "SDDL4_Rec2Raw",          //16 //22  23 
+                                      "SDDL3_dedx",             //17 //24  25
+                                      "SDDL4_dedx",             //18   24  25
+                                      "SDDRecPointCheck"//19           26
+                                       };//tot 20
 
-  const TString canvassavedname[]={"RawLayers","Rawpatterns","RawLayersNORM","RawLayersRelOcc","RawLayersRelOccBoth","RecPointsphiz","RecPointsGlobalDistributions","RecPointsCharge","RecPointsDriftTime","RecPointsLocalDistribution","RecPointsLayers","RecPointsLayersNORM","RecPointsLayersPatterns","RecPointsPhiDistribution","RecPointsRDistribution","RecPointsChargeBothLayers","RecPointsDriftTimeBothLayers","RecPointsRelLayersOcc","RecPointsLayersRelOccBoth","RecPointsLayersRecRaw2D","RecPointsLayersRecRaw","RecPointsLayersRecRaw","RecPointsLayersRecRawBoth","RecPointsLayersdedx","RecPointsLayersdedxBoth"};//15
+  const TString RecPointsnonexpertname[]={"SDDGlobalCoordDistribL3PHIZ",//0      7
+                                         "SDDGlobalCoordDistribL4PHIZ",//1      7
+                                         "SDDGlobalCoordDistribRZ",//2          8
+                                         "SDDGlobalCoordDistribYX",//3          8
+                                         "SDDLay3TotCh",           //4          9    17
+                                         "SDDLay4TotCh",           //5          9    17
+                                         "SDDdrifttime_Layer3",    //6          10   18
+                                         "SDDdrifttime_Layer4"//7               10   18
+                                         };//tot 8
+
+  const TString canvassavedname[]={"RawLayersNORM",                 //0
+                                  "Rawpatterns",                   //1
+                                  "RawLayers",                     //2
+                                  "CalibConfiguration",            //3
+                                  "RawLayersRelOcc",               //4
+                                  "RawLayersRelOccBoth",           //5
+                                  "CheckRawdata",                  //6
+                                  "RecPointsphiz",                 //7
+                                  "RecPointsGlobalDistributions",  //8
+                                  "RecPointsCharge",               //9
+                                  "RecPointsDriftTime",            //10
+                                  "RecPointsLocalDistribution",    //11
+                                  "RecPointsLayers",               //12
+                                  "RecPointsLayersNORM",           //13
+                                  "RecPointsLayersPatterns",       //14
+                                  "RecPointsPhiDistribution",      //15
+                                  "RecPointsRDistribution",        //16
+                                  "RecPointsChargeBothLayers",     //17
+                                  "RecPointsDriftTimeBothLayers",  //18
+                                  "RecPointsRelLayersOcc",         //19
+                                  "RecPointsLayersRelOccBoth",     //20
+                                  "RecPointsLayersRecRaw2D",       //21
+                                  "RecPointsLayersRecRaw",         //22
+                                  "RecPointsLayersRecRawBoth",     //23
+                                  "RecPointsLayersdedx",           //24
+                                  "RecPointsLayersdedxBoth",       //25
+                                  "CheckRecPoints"                 //26
+                                 };//tot 27
 
   Char_t trendfile[25]="FileQAtrend.root";
 
+  TString psfilestart=Form("SDDQAPlot.ps[");
+  TString psfile     =Form("SDDQAPlot.ps");
+  TString psfileend  =Form("SDDQAPlot.ps]");
+
 
+  gStyle->SetTitleFont(62,"");
+  gStyle->SetTitleFontSize(0.025);
   gStyle->SetPalette(1);
   //  gStyle->SetOptStat("ne");
   if(gSystem->Exec(Form("ls %s >/dev/null 2>&1", fileName))!=0)
@@ -74,8 +148,8 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
   TH1F *historaw2=NULL;
   TH2F *histodraw=NULL;
   
-  TH1F *histo2save[9];
-  for(Int_t i=0;i<9;i++){histo2save[i]=NULL;}
+  //  TH1F *histo2save[9];
+  //for(Int_t i=0;i<9;i++){histo2save[i]=NULL;}
   
   TF1 *f1 = new TF1("f1","1",-100000,100000); // this is the function defined to multiply histograms
   Char_t layer[10];
@@ -84,7 +158,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
   float fmaxmargin;
   
   Int_t cannum=0;
-  Int_t histo2savenumber[9]={4,5,6,7,7,8,3,5,1};
+  //Int_t histo2savenumber[9]={4,5,6,7,7,8,3,5,1};
   TCanvas *canvas1 = new TCanvas("canvas1","SDD QA Plot",1000,600);
   //   TLegend *legend=new TLegend(0.83,0.8,0.97,0.7);
   TLegend *legend=new TLegend(0.81,0.895,0.95,0.995);
@@ -104,7 +178,9 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
   float fCNinv=1./fChnknmbr;
   //   printf("\n====================>%f\n\n", fCNinv);
   
+
   if(!mergedfile.IsOpen()){return;}else{printf("file is open\n");}
+
   for(Int_t ispecie=0;ispecie<AliRecoParam::kNSpecies;ispecie++){
     //__________________________________________________________________
     //raw data
@@ -112,12 +188,13 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
     printf("%s",filepath);
     TString especie(filepath);
     if(!especie.Contains(eventspecie)){printf("...Found and Skipped\n");continue;}
-    canvas1->Print("SDDQAPlot.ps[");
+    canvas1->Print(psfilestart.Data());
     directory=(TDirectory*)mergedfile.Get(filepath);
     if(!directory){printf("...Not Found\n ");}//faccio l'istogramma
     else{
+      
       printf("...Found: The histograms of this EventSpecie will be displayed\n");
-      printf("1\n");
+      printf("0\n");
       canvas1->Clear();
       canvas1->Divide(2,1);
       
@@ -128,8 +205,18 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
        sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[iraws].Data());
        printf("histo name %s ",Rawsexpertname[iraws].Data());
        historaw=(TH2D*)mergedfile.Get(histoname);
-       if(historaw){printf("...Found\n");historaw->DrawCopy("colz");}
-       else{updatecanvas[iraws-2]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+       if(historaw){printf("...Found\n");        historaw->Multiply(f1,fCNinv);  historaw->DrawCopy("colz");}
+       else
+         {
+           sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[iraws].Data());
+           printf("...Not found\nSecond try for histo name %s ",Rawsexpertname[iraws].Data());
+           historaw=(TH2D*)mergedfile.Get(histoname);
+           if(historaw){printf("...Found\n");    historaw->Multiply(f1,fCNinv);historaw->DrawCopy("colz");} 
+           else
+             {
+               updatecanvas[iraws-2]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");
+             }
+         }
        historaw=NULL;
       }//end for       
       
@@ -140,21 +227,19 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps");
+         canvas1->Print(psfile.Data());
        }
       //else{delete canvas1; canvas1=NULL;}
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(1,2);
-      printf("2 \n");
+      printf("1\n");
       cannum++;
       for(Int_t inraws=0;inraws<2;inraws++){//non expert raws
        canvas1->cd(inraws+1);
        sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[inraws].Data());
        printf("histo name %s ",Rawsexpertname[inraws].Data());
-       historaw2=(TH1F*)mergedfile.Get(histoname);
-       
-       
+       historaw2=(TH1F*)mergedfile.Get(histoname);     
        //        -----------------This is the part were I divide between the number of chunks to normalize the histogram----------------
        
        
@@ -168,7 +253,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
              }
            historaw2->DrawCopy();
          }
-       else{updatecanvas[inraws]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+       else {updatecanvas[inraws]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
        historaw2=NULL;
       }//end for
       if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
@@ -178,12 +263,12 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
       //else{delete canvas2; canvas2=NULL;}
       
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
-      printf("3\n");
+      printf("2\n");
       cannum++;
       canvas1->Clear();
       canvas1->Divide(2,1);
@@ -195,11 +280,26 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
        historaw=(TH2D*)mergedfile.Get(histoname);
        if(historaw){
          printf("...Found\n");
-         historaw->Multiply(f1,fCNinv);
+         //      historaw->SetTitleSize(0.02);
+
          historaw->DrawCopy("colz");
        }
        else
-         {updatecanvas[iraws]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");} 
+         {
+           sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsnonexpertname[iraws].Data());
+           printf("...Not Found.\n Second Try for histo name %s",Rawsnonexpertname[iraws].Data());
+           historaw=(TH2D*)mergedfile.Get(histoname);
+           if(historaw){
+             printf("...Found\n");
+             //              historaw->SetTitleSize(0.02);
+             historaw->Multiply(f1,fCNinv);
+             historaw->DrawCopy("colz");
+           }
+           else
+             {
+               updatecanvas[iraws]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");
+             }
+         } 
        historaw=NULL;
       }//end for
       if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
@@ -209,17 +309,50 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
       //else{delete canvas3; canvas3=NULL;}
       
+      for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
+      printf("3\n");
+      cannum++;
+      canvas1->Clear();
+      canvas1->Divide(2,1);
+      for(Int_t iraws=2;iraws<4;iraws++){//non expert raws
+       canvas1->cd(iraws-1);
+       
+       sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsnonexpertname[iraws].Data());
+       printf("histo name %s",Rawsnonexpertname[iraws].Data());
+       historaw=(TH2D*)mergedfile.Get(histoname);
+       if(historaw){
+         printf("...Found\n");
+         //      historaw->SetTitleSize(0.02);
+         //      historaw->Multiply(f1,fCNinv);
+         historaw->DrawCopy("colz");
+       }
+       else
+         {
+           updatecanvas[iraws]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");
+         } 
+       historaw=NULL;
+      }//end for
+      if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
+       {
+         canvas1->Update();
+         if(kDoEps){
+           sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
+           canvas1->SaveAs(namecanvas);
+         }
+         canvas1->Print(psfile.Data()); 
+       }
+
       //--------------------- new plots
       printf("================= 4\n");
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       cannum++;
       canvas1->Clear();
       canvas1->Divide(2,1);
-      for(Int_t iraws=4;iraws<rawtot;iraws++){//non expert raws
+      for(Int_t iraws=4;iraws<rawtot-1;iraws++){//non expert raws
        canvas1->cd(iraws-3);
        sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[iraws].Data());
        printf("histo name %s",Rawsexpertname[iraws].Data());
@@ -242,7 +375,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
       //else{delete canvas3; canvas3=NULL;}
       
@@ -250,9 +383,9 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       legend->Clear();
-      printf("14\n");
+      printf("5\n");
       cannum++;
-      for (Int_t i=4;i<rawtot;i++){
+      for (Int_t i=4;i<rawtot-1;i++){
        sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[i].Data());
        historaw2=(TH1F*)mergedfile.Get(histoname);
        if(historaw2){
@@ -268,7 +401,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
        historaw2=NULL;
       }
       fmaxmargin=1.1*fmaxold;
-      for(Int_t irrpp=4;irrpp<rawtot;irrpp++){//non expert raws
+      for(Int_t irrpp=4;irrpp<rawtot-1;irrpp++){//non expert raws
        
        sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[irrpp].Data());
        printf("histo name %s",Rawsexpertname[irrpp].Data());
@@ -297,11 +430,37 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
-      
+      //---------------------------- summary plot ------------------------//
+      printf("6\n");
+      canvas1->Clear();
+      for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
+      sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[rawtot-1].Data());
+      printf("histo name %s",Rawsexpertname[rawtot-1].Data());
+      cannum++;
+      historaw2=(TH1F*)mergedfile.Get(histoname);
+       if(historaw2)
+         {
+           printf("...Found\n");
+           historaw2->SetStats(0);
+           historaw2->DrawCopy();
+           canvas1->Update();
+         }
+       else{updatecanvas[0]=kFALSE;updatecanvas[1]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+       historaw2=NULL;
+       if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
+         {
+           canvas1->Update();
+           if(kDoEps){
+             sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
+             canvas1->SaveAs(namecanvas);
+           }
+           canvas1->Print(psfile.Data()); 
+         }
+
     }//end if directory
-    
+       
     
     
     //_______________________________________________________________________________
@@ -310,10 +469,11 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
     printf("%s\n",filepath);
     directory2=(TDirectory*)mergedfile.Get(filepath);
     if(directory2){
+      
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(2,1);
-      printf("4\n");
+      printf("7\n");
       cannum++;
       for(Int_t irp=0;irp<2;irp++){//non expert rec point
        canvas1->cd(irp+1);
@@ -331,7 +491,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
       //       else{delete canvas4; canvas4=NULL;}
       
@@ -339,7 +499,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(2,1);
-      printf("5\n");
+      printf("8\n");
       cannum++;
       for(Int_t irrp=2;irrp<4;irrp++){//non expert raws
        canvas1->cd(irrp-1);
@@ -357,7 +517,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
       //else{delete canvas5; canvas5=NULL;}
       
@@ -365,7 +525,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(1,2);
-      printf("6\n");
+      printf("9\n");
       cannum++;
       for(Int_t irrpp=4;irrpp<6;irrpp++){//non expert raws
        canvas1->cd(irrpp-3);
@@ -384,14 +544,14 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
       //else{delete canvas6; canvas6=NULL;}
       
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(1,2);
-      printf("7\n");
+      printf("10\n");
       cannum++;
       for(Int_t irrpp=6;irrpp<8;irrpp++){//non expert raws
        canvas1->cd(irrpp-5);
@@ -409,13 +569,13 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
       //else{delete canvas7; canvas7=NULL;}
 
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
-      printf("8\n");
+      printf("11\n");
       cannum++;
       //canvas1->Divide(2,1);
       sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[rlocaldistro].Data());
@@ -430,14 +590,14 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
          sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
          canvas1->SaveAs(namecanvas);
        }
-       canvas1->Print("SDDQAPlot.ps"); 
+       canvas1->Print(psfile.Data()); 
       }
       //else{delete canvas8; canvas8=NULL;}
        
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(2,1);
-      printf("9\n");
+      printf("12\n");
       cannum++;
       for(Int_t i=1;i<3;i++)
        {
@@ -457,26 +617,27 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
+      
       //else{delete canvas9; canvas9=NULL;}
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(2,1);
-      printf("10\n");
+      printf("13\n");
       cannum++;
-      for(Int_t i=8;i<10;i++)
+      for(Int_t i=3;i<5;i++)
        {
-         canvas1->cd(i-7);
+         canvas1->cd(i-2);
 
-         sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[i].Data());
+         sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
          histodraw=(TH2F*)mergedfile.Get(histoname);
-         printf("histo name %s",RecPointsnonexpertname[i].Data());
+         printf("histo name %s",RecPointsexpertname[i].Data());
 
          if(histodraw){
            printf("...Found\n");histodraw->Multiply(f1,fCNinv);
            histodraw->DrawCopy("colz");
-         }else{updatecanvas[i-8]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+         }else{updatecanvas[i-3]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
          histodraw=NULL;
        }
       if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
@@ -486,18 +647,19 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
-      //else{delete canvas10; canvas10=NULL;}
 
+      
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(1,2);
-      printf("11\n");
+
+      printf("14\n");
       cannum++;
-      for(Int_t i=3;i<5;i++)
+      for(Int_t i=5;i<7;i++)
        {
-         canvas1->cd(i-2);
+         canvas1->cd(i-4);
 
          sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
          printf("histo name %s",RecPointsexpertname[i].Data());
@@ -509,7 +671,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
              if (i==4){historaw2->Multiply(f1,fCNinv);}
              historaw2->DrawCopy();
            }
-         else{updatecanvas[i-3]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+         else{updatecanvas[i-5]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
          historaw2=NULL;
        }
       if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
@@ -519,24 +681,24 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
-      //else{delete canvas11; canvas11=NULL;}
+
 
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(2,1);
-      printf("12\n");
+      printf("15\n");
       cannum++;
-      for(Int_t i=5;i<7;i++)
+      for(Int_t i=7;i<9;i++)
        {
-         canvas1->cd(i-4);
+         canvas1->cd(i-6);
 
          sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
          printf("histo name %s",RecPointsexpertname[i].Data());
          historaw2=(TH1F*)mergedfile.Get(histoname);
 
-         if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-5]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+         if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-7]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
          historaw2=NULL;
        }
       if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
@@ -546,23 +708,22 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
-      //else{delete canvas12; canvas12=NULL;}
-
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(2,1);
-      printf("13\n");
+      printf("16\n");
       cannum++;
-      for(Int_t i=7;i<9;i++)
+      for(Int_t i=9;i<11;i++)
        {
-         canvas1->cd(i-6);
+         canvas1->cd(i-8);
          sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
          printf("histo name %s",RecPointsexpertname[i].Data());
          historaw2=(TH1F*)mergedfile.Get(histoname);
 
-         if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-7]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+         if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-9]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
          historaw2=NULL;
        }
       if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
@@ -572,7 +733,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
          
 
@@ -580,7 +741,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       legend->Clear();
-      printf("14\n");
+      printf("17\n");
       cannum++;
       for (Int_t i=4;i<6;i++){
        sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[i].Data());
@@ -628,13 +789,13 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
          
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       legend->Clear();
-      printf("15\n");
+      printf("18\n");
       cannum++;
       for (Int_t i=6;i<8;i++){
        sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[i].Data());
@@ -679,7 +840,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
 
       //------------------------------------------- new plot
@@ -687,16 +848,16 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(2,1);
-      printf("13\n");
+      printf("19\n");
       cannum++;
-      for(Int_t i=9;i<11;i++)
+      for(Int_t i=11;i<13;i++)
        {
-         canvas1->cd(i-8);
+         canvas1->cd(i-10);
          sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
          printf("histo name %s",RecPointsexpertname[i].Data());
          historaw2=(TH1F*)mergedfile.Get(histoname);
 
-         if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-9]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+         if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-11]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
          historaw2=NULL;
        }
       if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
@@ -706,16 +867,16 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
          
       //------------------------------------
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       legend->Clear();
-      printf("14\n");
+      printf("20\n");
       cannum++;
-      for (Int_t i=9;i<11;i++){
+      for (Int_t i=11;i<13;i++){
        sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
        historaw2=(TH1F*)mergedfile.Get(histoname);
        if(historaw2){
@@ -731,11 +892,11 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
        historaw2=NULL;
       }
       fmaxmargin=1.1*fmaxold;
-      for(Int_t irrpp=9;irrpp<11;irrpp++){//non expert raws
+      for(Int_t irrpp=11;irrpp<13;irrpp++){//non expert raws
          
        sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[irrpp].Data());
        printf("histo name %s",RecPointsexpertname[irrpp].Data());
-       sprintf(layer, "layer %d",irrpp-6);
+       sprintf(layer, "layer %d",irrpp-8);
        historaw2=(TH1F*)mergedfile.Get(histoname);
        gStyle->SetOptStat(0);
          
@@ -744,13 +905,13 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            printf("...Found\n");
            historaw2->GetYaxis()->SetRangeUser(0,fmaxmargin);
            historaw2->SetTitle("RecPoint Relative Occupancy");
-           if (irrpp==9) {historaw2->SetStats(0);historaw2->SetLineColor(2);historaw2->DrawCopy();}
-           if (irrpp!=9) {historaw2->SetStats(0);historaw2->SetLineColor(4);historaw2->DrawCopy("same");}
+           if (irrpp==11) {historaw2->SetStats(0);historaw2->SetLineColor(2);historaw2->DrawCopy();}
+           if (irrpp!=11) {historaw2->SetStats(0);historaw2->SetLineColor(4);historaw2->DrawCopy("same");}
            legend->AddEntry(historaw2,layer,"l");
            legend->Draw();
            canvas1->Update();
          }
-       else{updatecanvas[irrpp-9]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+       else{updatecanvas[irrpp-11]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
        historaw2=NULL;
       }//end for
       if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
@@ -760,24 +921,24 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
 
 
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(2,1);
-      printf("13\n");
+      printf("21\n");
       cannum++;
-      for(Int_t i=11;i<13;i++)
+      for(Int_t i=13;i<15;i++)
        {
-         canvas1->cd(i-10);
+         canvas1->cd(i-12);
          sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
          printf("histo name %s",RecPointsexpertname[i].Data());
          historaw=(TH2D*)mergedfile.Get(histoname);
 
-         if(historaw){printf("...Found\n");historaw->DrawCopy("colz");}else{updatecanvas[i-11]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
-         historaw2=NULL;
+         if(historaw){printf("...Found\n");  historaw->DrawCopy("colz");}else{updatecanvas[i-13]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+         historaw=NULL;
        }
       if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
        {
@@ -786,7 +947,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
          
 
@@ -795,16 +956,16 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(2,1);
-      printf("13\n");
+      printf("22\n");
       cannum++;
-      for(Int_t i=13;i<15;i++)
+      for(Int_t i=15;i<17;i++)
        {
-         canvas1->cd(i-12);
+         canvas1->cd(i-14);
          sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
          printf("histo name %s",RecPointsexpertname[i].Data());
          historaw2=(TH1F*)mergedfile.Get(histoname);
 
-         if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-13]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+         if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-15]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
          historaw2=NULL;
        }
       if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
@@ -814,23 +975,23 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
       //--------------------------------------------
 
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       legend->Clear();
-      printf("14\n");
+      printf("23\n");
       cannum++;
-      for (Int_t i=13;i<15;i++){
+      for (Int_t i=15;i<17;i++){
        sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
        historaw2=(TH1F*)mergedfile.Get(histoname);
        if(historaw2){
          fmax=historaw2->GetMaximum();
-         if (i==13){
+         if (i==15){
            fmaxold=fmax;}
-         if (i!=13){
+         if (i!=15){
            if(fmaxold<fmax){
              fmaxold=fmax;
            }
@@ -839,11 +1000,11 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
        historaw2=NULL;
       }
       fmaxmargin=1.1*fmaxold;
-      for(Int_t irrpp=13;irrpp<15;irrpp++){//non expert raws
+      for(Int_t irrpp=15;irrpp<17;irrpp++){//non expert raws
     
        sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[irrpp].Data());
        printf("histo name %s",RecPointsexpertname[irrpp].Data());
-       sprintf(layer, "layer %d",irrpp-10);
+       sprintf(layer, "layer %d",irrpp-12);
        historaw2=(TH1F*)mergedfile.Get(histoname);
        gStyle->SetOptStat(0);
          
@@ -852,13 +1013,13 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            printf("...Found\n");
            historaw2->GetYaxis()->SetRangeUser(0,fmaxmargin);
            historaw2->SetTitle("Rec2Raw Ratio");
-           if (irrpp==13) {historaw2->SetStats(0);historaw2->SetLineColor(2);historaw2->DrawCopy();}
-           if (irrpp!=13) {historaw2->SetStats(0);historaw2->SetLineColor(4);historaw2->DrawCopy("same");}
+           if (irrpp==15) {historaw2->SetStats(0);historaw2->SetLineColor(2);historaw2->DrawCopy();}
+           if (irrpp!=15) {historaw2->SetStats(0);historaw2->SetLineColor(4);historaw2->DrawCopy("same");}
            legend->AddEntry(historaw2,layer,"l");
            legend->Draw();
            canvas1->Update();
          }
-       else{updatecanvas[irrpp-13]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+       else{updatecanvas[irrpp-15]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
        historaw2=NULL;
       }//end for
       if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
@@ -868,7 +1029,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
 
          
@@ -877,16 +1038,16 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       canvas1->Divide(2,1);
-      printf("13\n");
+      printf("24\n");
       cannum++;
-      for(Int_t i=15;i<17;i++)
+      for(Int_t i=17;i<19;i++)
        {
-         canvas1->cd(i-14);
+         canvas1->cd(i-16);
          sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
          printf("histo name %s",RecPointsexpertname[i].Data());
          historaw2=(TH1F*)mergedfile.Get(histoname);
                
-         if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-15]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+         if(historaw2){printf("...Found\n");historaw2->DrawCopy();}else{updatecanvas[i-17]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
          historaw2=NULL;
        }
       if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
@@ -896,7 +1057,7 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
        }
          
 
@@ -905,27 +1066,27 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
       for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
       canvas1->Clear();
       legend->Clear();
-      printf("14\n");
+      printf("25\n");
       cannum++;
-      for (Int_t i=15;i<17;i++){
+      for (Int_t i=17;i<19;i++){
        sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[i].Data());
        historaw2=(TH1F*)mergedfile.Get(histoname);
        if(historaw2){
          fmax=historaw2->GetMaximum();
-         if (i==15){
+         if (i==17){
            fmaxold=fmax;}
-         if (i!=15){
+         if (i!=17){
            if(fmaxold<fmax){fmaxold=fmax;}
          }
        }
        historaw2=NULL;
       }
       fmaxmargin=1.1*fmaxold;
-      for(Int_t irrpp=15;irrpp<17;irrpp++){//non expert raws
+      for(Int_t irrpp=17;irrpp<19;irrpp++){//non expert raws
     
        sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[irrpp].Data());
        printf("histo name %s",RecPointsexpertname[irrpp].Data());
-       sprintf(layer, "layer %d",irrpp-12);
+       sprintf(layer, "layer %d",irrpp-14);
        historaw2=(TH1F*)mergedfile.Get(histoname);
        gStyle->SetOptStat(0);
          
@@ -934,8 +1095,8 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            printf("...Found\n");
            historaw2->GetYaxis()->SetRangeUser(0,fmaxmargin);
            historaw2->SetTitle("RecPoint dEdx");
-           if (irrpp==15) {historaw2->SetStats(0);historaw2->SetLineColor(2);historaw2->DrawCopy();}
-           if (irrpp!=15) {historaw2->SetStats(0);historaw2->SetLineColor(4);historaw2->DrawCopy("same");}
+           if (irrpp==17) {historaw2->SetStats(0);historaw2->SetLineColor(2);historaw2->DrawCopy();}
+           if (irrpp!=17) {historaw2->SetStats(0);historaw2->SetLineColor(4);historaw2->DrawCopy("same");}
            legend->AddEntry(historaw2,layer,"l");
            legend->Draw();
            canvas1->Update();
@@ -950,26 +1111,121 @@ void PlotQASDD(Char_t fileName[100]="File.QA.111333.2010.LHC09b.pass2.root",Char
            sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
            canvas1->SaveAs(namecanvas);
          }
-         canvas1->Print("SDDQAPlot.ps"); 
+         canvas1->Print(psfile.Data()); 
+
+      //------------------------summary plot ---------------//
+
+      for(Int_t i=0;i<2;i++){updatecanvas[i]=kTRUE;}
+      canvas1->Clear();
+
+      printf("26\n");
+      cannum++;
+
+
+         sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[rtot-1].Data());
+         printf("histo name %s",RecPointsexpertname[rtot-1].Data());
+         historaw2=(TH1F*)mergedfile.Get(histoname);
+
+         if(historaw2)
+           {
+             printf("...Found\n");
+       
+             historaw2->DrawCopy();
+           }
+         else{updatecanvas[0]=kFALSE;updatecanvas[1]=kFALSE;printf("...Not Found: the histogram or this QA has been done before the histograms was added to QA\n");}
+         historaw2=NULL;
+
+      if(updatecanvas[0]==kTRUE||updatecanvas[1]==kTRUE)
+       {
+         canvas1->Update();
+         if(kDoEps){
+           sprintf(namecanvas,"%s.eps",canvassavedname[cannum].Data());
+           canvas1->SaveAs(namecanvas);
+         }
+         canvas1->Print(psfile.Data()); 
        }
-      canvas1->Print("SDDQAPlot.ps]"); 
+    
 
 
-      for(Int_t isave=0;isave<9;isave++){
-       if(isave<4)sprintf(histoname,"%s/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[histo2savenumber[isave]].Data());
-       if(isave>4&&isave<7)sprintf(histoname,"%s/Expert/%s_%s",filepath,AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[histo2savenumber[isave]].Data());
-       if(isave>7)sprintf(histoname,"ITS/Raws/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[histo2savenumber[isave]].Data());
-       printf("file2save name:\t %s\n",histoname);
-       histo2save[isave]=(TH1F*)mergedfile.Get(histoname);
-      }
+
+       }
+      canvas1->Print(psfileend.Data()); 
 
       TFile file2savefortrend(trendfile,"recreate");
       file2savefortrend.cd();
-      for(Int_t iss=0;iss<9;iss++){printf("Saved %d\n",iss); histo2save[iss]->Write();}
+      
+      for(Int_t isave=0;isave<nonrawtot;isave++)
+       {
+         sprintf(histoname,"ITS/Raws/%s/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),Rawsnonexpertname[isave].Data());
+         historaw=(TH2D*)mergedfile.Get(histoname);
+         historaw->Write();
+         printf("Saved  %s\n",histoname);
+         historaw=NULL;
+       }
+      
+      for(Int_t isave1=0;isave1<rawtot;isave1++)
+       {
+         sprintf(histoname,"ITS/Raws/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),Rawsexpertname[isave1].Data());
+         if(isave1==2||isave1==3)
+           {
+             historaw=(TH2D*)mergedfile.Get(histoname);
+             historaw->Write();
+             historaw=NULL;
+           }
+         else
+           {
+             historaw2=(TH1F*)mergedfile.Get(histoname);
+             historaw2->Write();
+             historaw2=NULL;
+           }
+         printf("Saved %s\n",histoname);
+       }
+      
+      for(Int_t isave2=0;isave2<nrtot;isave2++)
+       {
+         sprintf(histoname,"ITS/RecPoints/%s/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsnonexpertname[isave2].Data());
+         if(isave2<4||isave2==17||isave2==18)
+           {
+             historaw=(TH2D*)mergedfile.Get(histoname);
+             historaw->Write();
+             historaw=NULL;
+           }
+         else
+           {
+             historaw2=(TH1F*)mergedfile.Get(histoname);
+             historaw2->Write();
+             historaw2=NULL;
+           }
+         printf("Saved %s\n",histoname);
+       }
+      for(Int_t isave3=0;isave3<rtot;isave3++)
+       {
+         sprintf(histoname,"ITS/RecPoints/%s/Expert/%s_%s",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[isave3].Data());
+         //printf(histoname,"ITS/RecPoints/%s/Expert/%s_%s \n",AliRecoParam::GetEventSpecieName(ispecie),AliRecoParam::GetEventSpecieName(ispecie),RecPointsexpertname[isave3].Data());
+         if(isave3<3||isave3==11||isave3==12||isave3==17||isave3==18)
+           {
+             histodraw=(TH2F*)mergedfile.Get(histoname);
+             histodraw->Write();
+             histodraw=NULL;
+           }
+         else
+           {
+             historaw2=(TH1F*)mergedfile.Get(histoname);
+             historaw2->Write();
+             historaw2=NULL;
+           }
+         printf("Saved %s\n",histoname);
+       }
+      
+      //for(Int_t iss=0;iss<9;iss++){printf("Saved %d\n",iss); histo2save[iss]->Write();}
       file2savefortrend.Close();
        
       //else{delete canvas13; canvas13=NULL;}  
       //directory2=NULL;
+
+
+
+
     }//end directory