Protection against missing timestamps
[u/mrichter/AliRoot.git] / ITS / macrosSDD / PlotDriftSpeedSDDVsTime.C
index 6c8a912..4d26f8e 100644 (file)
@@ -29,7 +29,7 @@
 
 void FillErrors(Float_t errSpeed[260]);
 
-void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600, 
+void PlotDriftSpeedSDDVsTime(Int_t year=2014, Int_t firstRun=172600, 
                             Int_t lastRun=999999999,
                             Int_t anode=128){
   TGrid::Connect("alien:",0,0,"t");
@@ -50,55 +50,79 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
 
   TGraph* gGoodInjVsRun=new TGraph(0);
   gGoodInjVsRun->SetName("gGoodInjVsRun");
+  TGraph* gRescaledSpeedVsRun=new TGraph(0);
+  gRescaledSpeedVsRun->SetName("gRescaledSpeedVsRun");
   TGraph* gAverSpeedVsRun=new TGraph(0);
   gAverSpeedVsRun->SetName("gAverSpeedVsRun");
   TGraph* gGoodInjVsTime=new TGraph(0);
   gGoodInjVsTime->SetName("gGoodInjVsTime");
+  TGraph* gRescaledSpeedVsTime=new TGraph(0);
+  gRescaledSpeedVsTime->SetName("gRescaledSpeedVsTime");
   TGraph* gAverSpeedVsTime=new TGraph(0);
   gAverSpeedVsTime->SetName("gAverSpeedVsIime");
 
   TGraph* gGoodInjVsRunL3=new TGraph(0);
   gGoodInjVsRunL3->SetName("gGoodInjVsRunL3");
+  TGraph* gRescaledSpeedVsRunL3=new TGraph(0);
+  gRescaledSpeedVsRunL3->SetName("gRescaledSpeedVsRunL3");
   TGraph* gAverSpeedVsRunL3=new TGraph(0);
   gAverSpeedVsRunL3->SetName("gAverSpeedVsRunL3");
   TGraph* gGoodInjVsTimeL3=new TGraph(0);
   gGoodInjVsTimeL3->SetName("gGoodInjVsTimeL3");
+  TGraph* gRescaledSpeedVsTimeL3=new TGraph(0);
+  gRescaledSpeedVsTimeL3->SetName("gRescaledSpeedVsTimeL3");
   TGraph* gAverSpeedVsTimeL3=new TGraph(0);
   gAverSpeedVsTimeL3->SetName("gAverSpeedVsIimeL3");
 
   TGraph* gGoodInjVsRunL4=new TGraph(0);
   gGoodInjVsRunL4->SetName("gGoodInjVsRunL4");
+  TGraph* gRescaledSpeedVsRunL4=new TGraph(0);
+  gRescaledSpeedVsRunL4->SetName("gRescaledSpeedVsRunL4");
   TGraph* gAverSpeedVsRunL4=new TGraph(0);
   gAverSpeedVsRunL4->SetName("gAverSpeedVsRunL4");
   TGraph* gGoodInjVsTimeL4=new TGraph(0);
   gGoodInjVsTimeL4->SetName("gGoodInjVsTimeL4");
+  TGraph* gRescaledSpeedVsTimeL4=new TGraph(0);
+  gRescaledSpeedVsTimeL4->SetName("gRescaledSpeedVsTimeL4");
   TGraph* gAverSpeedVsTimeL4=new TGraph(0);
   gAverSpeedVsTimeL4->SetName("gAverSpeedVsIimeL4");
 
   TGraph* gFracGoodInjVsRun=new TGraph(0);
   gFracGoodInjVsRun->SetName("gFracGoodInjVsRun");
+  TGraph* gFracRescaledSpeedVsRun=new TGraph(0);
+  gFracRescaledSpeedVsRun->SetName("gFracRescaledSpeedVsRun");
   TGraph* gFracAverSpeedVsRun=new TGraph(0);
   gFracAverSpeedVsRun->SetName("gFracAverSpeedVsRun");
   TGraph* gFracGoodInjVsTime=new TGraph(0);
   gFracGoodInjVsTime->SetName("gFracGoodInjVsTime");
+  TGraph* gFracRescaledSpeedVsTime=new TGraph(0);
+  gFracRescaledSpeedVsTime->SetName("gFracRescaledSpeedVsTime");
   TGraph* gFracAverSpeedVsTime=new TGraph(0);
   gFracAverSpeedVsTime->SetName("gAverSpeedVsIime");
 
   TGraph* gFracGoodInjVsRunL3=new TGraph(0);
   gFracGoodInjVsRunL3->SetName("gFracGoodInjVsRunL3");
+  TGraph* gFracRescaledSpeedVsRunL3=new TGraph(0);
+  gFracRescaledSpeedVsRunL3->SetName("gFracRescaledSpeedVsRunL3");
   TGraph* gFracAverSpeedVsRunL3=new TGraph(0);
   gFracAverSpeedVsRunL3->SetName("gFracAverSpeedVsRunL3");
   TGraph* gFracGoodInjVsTimeL3=new TGraph(0);
   gFracGoodInjVsTimeL3->SetName("gFracGoodInjVsTimeL3");
+  TGraph* gFracRescaledSpeedVsTimeL3=new TGraph(0);
+  gFracRescaledSpeedVsTimeL3->SetName("gFracRescaledSpeedVsTimeL3");
   TGraph* gFracAverSpeedVsTimeL3=new TGraph(0);
   gFracAverSpeedVsTimeL3->SetName("gFracAverSpeedVsIimeL3");
 
   TGraph* gFracGoodInjVsRunL4=new TGraph(0);
   gFracGoodInjVsRunL4->SetName("gFracGoodInjVsRunL4");
+  TGraph* gFracRescaledSpeedVsRunL4=new TGraph(0);
+  gFracRescaledSpeedVsRunL4->SetName("gFracRescaledSpeedVsRunL4");
   TGraph* gFracAverSpeedVsRunL4=new TGraph(0);
   gFracAverSpeedVsRunL4->SetName("gFracAverSpeedVsRunL4");
   TGraph* gFracGoodInjVsTimeL4=new TGraph(0);
   gFracGoodInjVsTimeL4->SetName("gFracGoodInjVsTimeL4");
+  TGraph* gFracRescaledSpeedVsTimeL4=new TGraph(0);
+  gFracRescaledSpeedVsTimeL4->SetName("gFracRescaledSpeedVsTimeL4");
   TGraph* gFracAverSpeedVsTimeL4=new TGraph(0);
   gFracAverSpeedVsTimeL4->SetName("gFracAverSpeedVsIimeL4");
   
@@ -125,7 +149,10 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
   UInt_t timeZero;
   if(year==2009) timeZero=1247762992;
   else if(year==2010) timeZero=1262300400;
-  else timeZero=1293836400; // 1/1/2011 at 0:00 CEST
+  else if(year==2011) timeZero=1293836400; // 1/1/2011 at 0:00 CEST
+  else if(year==2012) timeZero=1325372400;
+  else if(year==2013) timeZero=1356994800;
+  else timeZero=1388530800;
 
   while(!feof(listruns)){
     fscanf(listruns,"%s\n",filnam);
@@ -147,12 +174,15 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
     TObjArray *drspSDD = (TObjArray *)ent->GetObject();
     
     Int_t iGoodInj=0;
+    Int_t iRescaledSpeed=0;
     Int_t iAverSpeed=0;
    
     Int_t iGoodInjL3=0;
+    Int_t iRescaledSpeedL3=0;
     Int_t iAverSpeedL3=0;
    
     Int_t iGoodInjL4=0;
+    Int_t iRescaledSpeedL4=0;
     Int_t iAverSpeedL4=0;
 
     Int_t totalgoodinj=520;
@@ -163,6 +193,10 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
     Float_t fracGoodInjL3=0.;
     Float_t fracGoodInjL4=0.;
 
+    Float_t fracRescaledSpeed=0.;
+    Float_t fracRescaledSpeedL3=0.;
+    Float_t fracRescaledSpeedL4=0.;
+
     Float_t fracAverSpeed=0.;
     Float_t fracAverSpeedL3=0.;
     Float_t fracAverSpeedL4=0.;
@@ -178,7 +212,7 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
     for(Int_t iHyb=0; iHyb<520;iHyb++){
       if(!goodTime){
        vdriftarr=(AliITSDriftSpeedArraySDD*)drspSDD->At(iHyb);
-       Int_t statusInj=vdriftarr->GetInjectorStatus();
+       UInt_t statusInj=vdriftarr->GetInjectorStatus();
        if(statusInj>0){
          timest=vdriftarr->GetTimestamp(0);
          if(timest>0 && timest>timeZero){
@@ -197,19 +231,19 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
       vdriftarr1=(AliITSDriftSpeedArraySDD*)drspSDD->At(i1);
 
 
-      Int_t statusInj0=vdriftarr0->GetInjectorStatus();
-      Int_t statusInj1=vdriftarr1->GetInjectorStatus();
+      UInt_t statusInj0=vdriftarr0->GetInjectorStatus();
+      UInt_t statusInj1=vdriftarr1->GetInjectorStatus();
       Int_t npt=gstatusinjvsrun[i0]->GetN();
-      gstatusinjvsrun[i0]->SetPoint(npt,(Float_t)nrun,statusInj0);
-      gstatusinjvsrun[i1]->SetPoint(npt,(Float_t)nrun,statusInj1);
+      gstatusinjvsrun[i0]->SetPoint(npt,(Float_t)nrun,(Float_t)statusInj0);
+      gstatusinjvsrun[i1]->SetPoint(npt,(Float_t)nrun,(Float_t)statusInj1);
       gstatusinjvsrun[i0]->SetPointError(npt,0,0);
       gstatusinjvsrun[i1]->SetPointError(npt,0,0);
       if(goodTime){
-       Int_t npt=gstatusinjvstime[i0]->GetN();
-       gstatusinjvstime[i0]->SetPoint(npt,timeday,statusInj0);
-       gstatusinjvstime[i1]->SetPoint(npt,timeday,statusInj1);
-       gstatusinjvstime[i0]->SetPointError(npt,0,0);
-       gstatusinjvstime[i1]->SetPointError(npt,0,0);
+       Int_t npt2=gstatusinjvstime[i0]->GetN();
+       gstatusinjvstime[i0]->SetPoint(npt2,timeday,(Float_t)statusInj0);
+       gstatusinjvstime[i1]->SetPoint(npt2,timeday,(Float_t)statusInj1);
+       gstatusinjvstime[i0]->SetPointError(npt2,0,0);
+       gstatusinjvstime[i1]->SetPointError(npt2,0,0);
       }
 
       Float_t vdrift0=vdriftarr0->GetDriftSpeed(0,iAn);
@@ -218,36 +252,43 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
       Float_t temper=293.15*TMath::Power((mob/1350.),-1/2.4); 
       if(iMod==497-240) printf("Run %s   Time %d Day %f Speed=%f Temp=%f\n",filnam,timest,timeday,vdrift0,temper);
 
-      if(statusInj0>0){
+      if(statusInj0>1){
        iGoodInj++;
        if(iMod<84)iGoodInjL3++;
        else iGoodInjL4++;
-       Int_t npt=gvdrvsrun[i0]->GetN();
+       npt=gvdrvsrun[i0]->GetN();
        gvdrvsrun[i0]->SetPoint(npt,(Float_t)nrun,vdrift0);
        gvdrvsrun[i0]->SetPointError(npt,0,errSpeed[iMod]);
        if(goodTime){
-         npt=gvdrvstime[i0]->GetN();
-         gvdrvstime[i0]->SetPoint(npt,timeday,vdrift0);
-         gvdrvstime[i0]->SetPointError(npt,0,errSpeed[iMod]);
+         Int_t npt2=gvdrvstime[i0]->GetN();
+         gvdrvstime[i0]->SetPoint(npt2,timeday,vdrift0);
+         gvdrvstime[i0]->SetPointError(npt2,0,errSpeed[iMod]);
        }
-      }
-      else{ 
+      }else if(statusInj0==1){
+       iRescaledSpeed++;
+       if(iMod<84)iRescaledSpeedL3++;
+       else iRescaledSpeedL4++;
+      }else{ 
        iAverSpeed++;
        if(iMod<84)iAverSpeedL3++;
        else iAverSpeedL4++;
       }
-      if(statusInj1>0){ 
+      if(statusInj1>1){ 
        iGoodInj++;
        if(iMod<84)iGoodInjL3++;
        else iGoodInjL4++;
-       Int_t npt=gvdrvsrun[i1]->GetN();
+       npt=gvdrvsrun[i1]->GetN();
        gvdrvsrun[i1]->SetPoint(npt,(Float_t)nrun,vdrift1);
        gvdrvsrun[i1]->SetPointError(npt,0,errSpeed[iMod]);
        if(goodTime){
-         npt=gvdrvstime[i1]->GetN();
-         gvdrvstime[i1]->SetPoint(npt,timeday,vdrift1);
-         gvdrvstime[i1]->SetPointError(npt,0,errSpeed[iMod]);
+         Int_t npt2=gvdrvstime[i1]->GetN();
+         gvdrvstime[i1]->SetPoint(npt2,timeday,vdrift1);
+         gvdrvstime[i1]->SetPointError(npt2,0,errSpeed[iMod]);
        }
+      }else if(statusInj1==1){
+       iRescaledSpeed++;
+       if(iMod<84)iRescaledSpeedL3++;
+       else iRescaledSpeedL4++;
       }else{
        iAverSpeed++;
        if(iMod<84)iAverSpeedL3++;
@@ -256,58 +297,78 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
     }
 
     Int_t npt=gGoodInjVsRun->GetN();
+
     fracGoodInj=(Float_t)iGoodInj/(Float_t)totalgoodinj;
     fracGoodInjL3=(Float_t)iGoodInjL3/(Float_t)totalgoodinjL3;
     fracGoodInjL4=(Float_t)iGoodInjL4/(Float_t)totalgoodinjL4;
 
+    fracRescaledSpeed   = (Float_t)iRescaledSpeed/(Float_t)totalgoodinj;
+    fracRescaledSpeedL3 = (Float_t)iRescaledSpeedL3/(Float_t)totalgoodinjL3;
+    fracRescaledSpeedL4 = (Float_t)iRescaledSpeedL3/(Float_t)totalgoodinjL4;
+
     fracAverSpeed   = (Float_t)iAverSpeed/(Float_t)totalgoodinj;
     fracAverSpeedL3 = (Float_t)iAverSpeedL3/(Float_t)totalgoodinjL3;
     fracAverSpeedL4 = (Float_t)iAverSpeedL4/(Float_t)totalgoodinjL4;
 
     gGoodInjVsRun->SetPoint(npt,(Float_t)nrun,iGoodInj);
+    gRescaledSpeedVsRun->SetPoint(npt,(Float_t)nrun,iRescaledSpeed);
     gAverSpeedVsRun->SetPoint(npt,(Float_t)nrun,iAverSpeed);
        
     gGoodInjVsRunL3->SetPoint(npt,(Float_t)nrun,iGoodInjL3);
+    gRescaledSpeedVsRunL3->SetPoint(npt,(Float_t)nrun,iRescaledSpeedL3);
     gAverSpeedVsRunL3->SetPoint(npt,(Float_t)nrun,iAverSpeedL3);
 
     gGoodInjVsRunL4->SetPoint(npt,(Float_t)nrun,iGoodInjL4);
+    gRescaledSpeedVsRunL4->SetPoint(npt,(Float_t)nrun,iRescaledSpeedL4);
     gAverSpeedVsRunL4->SetPoint(npt,(Float_t)nrun,iAverSpeedL4);
 
 
     gFracGoodInjVsRun->SetPoint(npt,(Float_t)nrun,(Double_t)fracGoodInj);
+    gFracRescaledSpeedVsRun->SetPoint(npt,(Float_t)nrun,(Double_t)fracRescaledSpeed);
     gFracAverSpeedVsRun->SetPoint(npt,(Float_t)nrun,(Double_t)fracAverSpeed);
        
     gFracGoodInjVsRunL3->SetPoint(npt,(Float_t)nrun,(Double_t)fracGoodInjL3);
+    gFracRescaledSpeedVsRunL3->SetPoint(npt,(Float_t)nrun,(Double_t)fracRescaledSpeedL3);
     gFracAverSpeedVsRunL3->SetPoint(npt,(Float_t)nrun,(Double_t)fracAverSpeedL3);
 
     gFracGoodInjVsRunL4->SetPoint(npt,(Float_t)nrun,(Double_t)fracGoodInjL4);
+    gFracRescaledSpeedVsRunL4->SetPoint(npt,(Float_t)nrun,(Double_t)fracRescaledSpeedL4);
     gFracAverSpeedVsRunL4->SetPoint(npt,(Float_t)nrun,(Double_t)fracAverSpeedL4);
 
     npt=gGoodInjVsTime->GetN();
-
-    gGoodInjVsTime->SetPoint(npt,timeday,iGoodInj);
-    gAverSpeedVsTime->SetPoint(npt,timeday,iAverSpeed);
-
-    gGoodInjVsTimeL3->SetPoint(npt,timeday,iGoodInjL3);
-    gAverSpeedVsTimeL3->SetPoint(npt,timeday,iAverSpeedL3);
-
-    gGoodInjVsTimeL4->SetPoint(npt,timeday,iGoodInjL4);
-    gAverSpeedVsTimeL4->SetPoint(npt,timeday,iAverSpeedL4);
-
-
-    gFracGoodInjVsTime->SetPoint(npt,timeday,(Double_t)fracGoodInj);
-    gFracAverSpeedVsTime->SetPoint(npt,timeday,(Double_t)fracAverSpeed);
-
-    gFracGoodInjVsTimeL3->SetPoint(npt,timeday,(Double_t)fracGoodInjL3);
-    gFracAverSpeedVsTimeL3->SetPoint(npt,timeday,(Double_t)fracAverSpeedL3);
-
-    gFracGoodInjVsTimeL4->SetPoint(npt,timeday,(Double_t)fracGoodInjL4);
-    gFracAverSpeedVsTimeL4->SetPoint(npt,timeday,(Double_t)fracAverSpeedL4);
+    if(goodTime){
+      gGoodInjVsTime->SetPoint(npt,timeday,iGoodInj);
+      gRescaledSpeedVsTime->SetPoint(npt,timeday,iRescaledSpeed);
+      gAverSpeedVsTime->SetPoint(npt,timeday,iAverSpeed);
+
+      gGoodInjVsTimeL3->SetPoint(npt,timeday,iGoodInjL3);
+      gRescaledSpeedVsTimeL3->SetPoint(npt,timeday,iRescaledSpeedL3);
+      gAverSpeedVsTimeL3->SetPoint(npt,timeday,iAverSpeedL3);
+
+      gGoodInjVsTimeL4->SetPoint(npt,timeday,iGoodInjL4);
+      gRescaledSpeedVsTimeL4->SetPoint(npt,timeday,iRescaledSpeedL4);
+      gAverSpeedVsTimeL4->SetPoint(npt,timeday,iAverSpeedL4);
+
+
+      gFracGoodInjVsTime->SetPoint(npt,timeday,(Double_t)fracGoodInj);
+      gFracRescaledSpeedVsTime->SetPoint(npt,timeday,(Double_t)fracRescaledSpeed);
+      gFracAverSpeedVsTime->SetPoint(npt,timeday,(Double_t)fracAverSpeed);
+      
+      gFracGoodInjVsTimeL3->SetPoint(npt,timeday,(Double_t)fracGoodInjL3);
+      gFracRescaledSpeedVsTimeL3->SetPoint(npt,timeday,(Double_t)fracRescaledSpeedL3);
+      gFracAverSpeedVsTimeL3->SetPoint(npt,timeday,(Double_t)fracAverSpeedL3);
+      
+      gFracGoodInjVsTimeL4->SetPoint(npt,timeday,(Double_t)fracGoodInjL4);
+      gFracRescaledSpeedVsTimeL4->SetPoint(npt,timeday,(Double_t)fracRescaledSpeedL4);
+      gFracAverSpeedVsTimeL4->SetPoint(npt,timeday,(Double_t)fracAverSpeedL4);
+    }
 
     printf("Number of half-modules with drift speed from injectors = %d\n",iGoodInj);
     printf("Number of half-modules with average drift speed        = %d\n",iAverSpeed);
-    printf("Number of half-modules with drift speed from injectors L3 = %d\n",iGoodInjL3);
-    printf("Number of half-modules with drift speed from injectors L4 = %d\n",iGoodInjL4);
+    printf("Number of half-modules with drift speed from injectors L3     = %d\n",iGoodInjL3);
+    printf("Number of half-modules with drift speed from golden module L3 = %d\n",iRescaledSpeedL3);
+    printf("Number of half-modules with drift speed from injectors L4     = %d\n",iGoodInjL4);
+    printf("Number of half-modules with drift speed from golden module L4 = %d\n",iRescaledSpeedL4);
 
     f->Close();
   }
@@ -322,17 +383,33 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
     gstatusinjvsrun[iHyb]->Write();
   }
   gGoodInjVsRun->Write();
+  gGoodInjVsRunL3->Write();
+  gGoodInjVsRunL4->Write();
   gGoodInjVsTime->Write();
+  gGoodInjVsTimeL3->Write();
+  gGoodInjVsTimeL4->Write();
   gAverSpeedVsRun->Write();
+  gAverSpeedVsRunL3->Write();
+  gAverSpeedVsRunL4->Write();
   gAverSpeedVsTime->Write();
+  gAverSpeedVsTimeL3->Write();
+  gAverSpeedVsTimeL4->Write();
+  gRescaledSpeedVsRun->Write();
+  gRescaledSpeedVsRunL3->Write();
+  gRescaledSpeedVsRunL4->Write();
+  gRescaledSpeedVsTime->Write();
+  gRescaledSpeedVsTimeL3->Write();
+  gRescaledSpeedVsTimeL4->Write();
   ofil->Close();
 
-  Int_t mod1=244-240;
-  Int_t mod2=277-240;
+  //  Int_t mod1=244-240;
+  Int_t mod1 = 275-240;
+  Int_t mod2=318-240;
   //  Int_t mod2=259-240;
 //   Int_t mod2=274-240;
-  Int_t mod3=327-240;
-   Int_t mod4=453-240;
+  Int_t mod3=413-240;
+  //  Int_t mod4=453-240;
+  Int_t mod4=480-240;
    //  Int_t mod4=497-240;
   Int_t lay1,lad1,det1;
   Int_t lay2,lad2,det2;
@@ -363,10 +440,8 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
   Char_t title[100];
   if(year==2009){
     sprintf(title,"Time (days since July 16th 2009)");
-  }else if (year==2010){
-    sprintf(title,"Time (days since January 1st 2010)");
   }else{
-    sprintf(title,"Time (days since January 1st 2011)");
+    sprintf(title,Form("Time (days since January 1st %d)",year));
   }
   gvdrvstime[2*mod1]->GetXaxis()->SetTitle(title);
   gvdrvstime[2*mod1]->GetYaxis()->SetTitle("Drift speed (#mum/ns)");
@@ -386,6 +461,28 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
   lent->SetTextColor(4);
   leg->Draw();
 
+  TCanvas* c0b=new TCanvas("c0b","StatusInj vs. time");
+  c0->SetGridx();
+  c0->SetGridy();
+  gstatusinjvstime[2*mod1]->SetMarkerStyle(20);
+  gstatusinjvstime[2*mod2]->SetMarkerStyle(22);
+  gstatusinjvstime[2*mod2]->SetMarkerColor(2);
+  gstatusinjvstime[2*mod2]->SetLineColor(2);
+  gstatusinjvstime[2*mod3]->SetMarkerStyle(29);
+  gstatusinjvstime[2*mod3]->SetMarkerColor(3);
+  gstatusinjvstime[2*mod3]->SetLineColor(3);
+  gstatusinjvstime[2*mod4]->SetMarkerStyle(27);
+  gstatusinjvstime[2*mod4]->SetMarkerColor(4);
+  gstatusinjvstime[2*mod4]->SetLineColor(4);
+  gstatusinjvstime[2*mod1]->Draw("AP");
+  gvdrvstime[2*mod1]->GetXaxis()->SetTitle(title);
+  gvdrvstime[2*mod1]->GetYaxis()->SetTitle("Injector Status");
+  gvdrvstime[2*mod2]->Draw("PSAME");
+  gvdrvstime[2*mod3]->Draw("PSAME");
+  gvdrvstime[2*mod4]->Draw("PSAME");
+  leg->Draw();
+
+
   TCanvas* c1=new TCanvas("c1","Vdrift vs. run");
   c1->SetGridx();
   c1->SetGridy();
@@ -441,9 +538,9 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
   TLine* lin=new TLine(0,0,0,23);  
   gStyle->SetPalette(1);
 
-  TCanvas *c0b=new TCanvas("c0b","Percent difference Last Run - Previous Run",900,600);
-  c0b->Divide(2,1);
-  c0b->cd(1);
+  TCanvas *c0c=new TCanvas("c0c","Percent difference Last Run - Previous Run",900,600);
+  c0c->Divide(2,1);
+  c0c->cd(1);
   hlay3->DrawCopy("colz");
   for(Int_t i=0;i<6;i++){
     lin->SetY1(-0.5);
@@ -459,7 +556,7 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
     lin->SetY2(i+0.5);
     lin->DrawClone();
   }
-  c0b->cd(2);
+  c0c->cd(2);
   hlay4->DrawCopy("colz");
   for(Int_t i=0;i<8;i++){
     lin->SetY1(-0.5);
@@ -480,7 +577,7 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
   c4->SetGridx();
   c4->SetGridy();
   gGoodInjVsRun->SetMarkerStyle(20);
-  gGoodInjVsRun->SetMinimum(50.);
+  gGoodInjVsRun->SetMinimum(0.);
   gGoodInjVsRun->SetMaximum(370.);
   gGoodInjVsRunL3->SetMarkerStyle(22);
   gGoodInjVsRunL3->SetMarkerColor(2);
@@ -527,11 +624,30 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
   gFracGoodInjVsRun->GetYaxis()->SetTitleOffset(1.5);
   leg2->Draw();
   
+  TCanvas* c4ter=new TCanvas("c4ter","RescaledMod vs. run");
+  c4ter->SetGridx();
+  c4ter->SetGridy();
+  gRescaledSpeedVsRun->SetMarkerStyle(20);
+  gRescaledSpeedVsRun->SetMinimum(0.);
+  gRescaledSpeedVsRun->SetMaximum(120.);
+  gRescaledSpeedVsRunL3->SetMarkerStyle(22);
+  gRescaledSpeedVsRunL3->SetMarkerColor(2);
+  gRescaledSpeedVsRunL3->SetLineColor(2);
+  gRescaledSpeedVsRunL4->SetMarkerStyle(23);
+  gRescaledSpeedVsRunL4->SetMarkerColor(4);
+  gRescaledSpeedVsRunL4->SetLineColor(4);
+  gRescaledSpeedVsRun->Draw("AP");
+  gRescaledSpeedVsRunL3->Draw("PSAME");
+  gRescaledSpeedVsRunL4->Draw("PSAME");
+  gRescaledSpeedVsRun->GetXaxis()->SetTitle("Run number");
+  gRescaledSpeedVsRun->GetYaxis()->SetTitle("Half-modules with drift speed from golden module");
+  leg2->Draw();
+
   TCanvas* c5=new TCanvas("c5","GoodMod vs. time");
   c5->SetGridx();
   c5->SetGridy();
   gGoodInjVsTime->SetMarkerStyle(20);
-  gGoodInjVsTime->SetMinimum(50.);
+  gGoodInjVsTime->SetMinimum(0.);
   gGoodInjVsTime->SetMaximum(370.);
   gGoodInjVsTimeL3->SetMarkerStyle(22);
   gGoodInjVsTimeL3->SetMarkerColor(2);
@@ -567,6 +683,26 @@ void PlotDriftSpeedSDDVsTime(Int_t year=2011, Int_t firstRun=142600,
   gFracGoodInjVsTime->GetYaxis()->SetTitle("Fraction of Half-modules with drift speed from injectors");
   leg2->Draw();
 
+  TCanvas* c5ter=new TCanvas("c5ter","RescaledMod vs. time");
+  c5ter->SetGridx();
+  c5ter->SetGridy();
+  gRescaledSpeedVsTime->SetMarkerStyle(20);
+  gRescaledSpeedVsTime->SetMinimum(0.);
+  gRescaledSpeedVsTime->SetMaximum(120.);
+  gRescaledSpeedVsTimeL3->SetMarkerStyle(22);
+  gRescaledSpeedVsTimeL3->SetMarkerColor(2);
+  gRescaledSpeedVsTimeL3->SetLineColor(2);
+  gRescaledSpeedVsTimeL4->SetMarkerStyle(23);
+  gRescaledSpeedVsTimeL4->SetMarkerColor(4);
+  gRescaledSpeedVsTimeL4->SetLineColor(4);
+  gRescaledSpeedVsTime->Draw("AP");
+  gRescaledSpeedVsTimeL3->Draw("PSAME");
+  gRescaledSpeedVsTimeL4->Draw("PSAME");
+  gRescaledSpeedVsTime->GetXaxis()->SetTitle(title);
+  gRescaledSpeedVsTime->GetYaxis()->SetTitleSize(0.03);
+  gRescaledSpeedVsTime->GetYaxis()->SetTitleOffset(1.5);
+  gRescaledSpeedVsTime->GetYaxis()->SetTitle("Half-modules with drift speed from golden module");
+  leg2->Draw();
 }
 
 void FillErrors(Float_t errSpeed[260]){