Added in SDD DAs additional output files to be used for monitoring and jtag configuration
authorprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Jun 2009 20:24:35 +0000 (20:24 +0000)
committerprino <prino@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 23 Jun 2009 20:24:35 +0000 (20:24 +0000)
ITS/AliITSOnlineSDDInjectors.cxx
ITS/AliITSOnlineSDDInjectors.h
ITS/AnalyzeSDDInjectorsAllMod.C
ITS/ITSSDDBASda.cxx
ITS/ITSSDDINJda.cxx

index 1d723ae..4e8bae9 100644 (file)
@@ -12,7 +12,9 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
+#include <TFile.h>
 #include "AliITSOnlineSDDInjectors.h"
+#include "AliLog.h"
 #include <TH2F.h>
 #include <TGraphErrors.h>
 #include <TMath.h>
@@ -103,12 +105,7 @@ void AliITSOnlineSDDInjectors::Reset(){
 //______________________________________________________________________
 void AliITSOnlineSDDInjectors::AnalyzeEvent(TH2F* his){
   //
-  Reset();
-  fHisto=his;
-  FindGoodInjectors();
-  FindCentroids();
-  CalcTimeBinZero();
-  for(Int_t j=0;j<kInjPads;j++) CalcDriftSpeed(j);
+  AddEvent(his);
   FitDriftSpeedVsAnode();
 }
 //______________________________________________________________________
@@ -530,3 +527,29 @@ void AliITSOnlineSDDInjectors::WriteToASCII(Int_t evNumb, UInt_t timeStamp, Int_
   fprintf(outf,"\n");
   fclose(outf);  
 }
+//______________________________________________________________________
+Bool_t AliITSOnlineSDDInjectors::WriteToROOT(TFile *fil) const {
+  //
+  if(fil==0){ 
+    AliWarning("Invalid pointer to ROOT file");
+    return kFALSE;    
+  }  
+  Char_t hisnam[20];
+  fil->cd();
+  sprintf(hisnam,"hdrsp%02dc%02ds%d",fDDL,fCarlos,fSide);
+  TH1F hdsp(hisnam,"",kInjPads,-0.5,kInjPads-0.5);
+  if(fNEvents==0){
+    AliWarning("Zero analyzed events");
+    return kFALSE;    
+  }  
+    
+  for(Int_t i=0;i<kInjPads;i++){ 
+    hdsp.SetBinContent(i+1,GetMeanDriftSpeed(i));    
+    Double_t rms=GetRMSDriftSpeed(i);
+    Double_t err=0.;
+    if(rms>0.) err=rms/TMath::Sqrt(fNEvents);
+    hdsp.SetBinError(i+1,err);
+  }
+  hdsp.Write();
+  return kTRUE;    
+}
index 8682404..2ff66f1 100644 (file)
@@ -91,6 +91,7 @@ class AliITSOnlineSDDInjectors : public AliITSOnlineSDD {
   void PrintInjectorStatus();
   void PrintCentroids();
   void WriteToASCII(Int_t evNumb, UInt_t timeStamp, Int_t optAppend=0);
+  Bool_t WriteToROOT(TFile *fil) const;
 
   void Reset();
   void AnalyzeEvent(TH2F* his);
index 4c27d2c..ef87116 100644 (file)
@@ -204,6 +204,17 @@ void AnalyzeSDDInjectorsAllMod(Char_t *datafil,
   hpad7l->Scale(nfac);
   hpad7r->Scale(nfac);
 
+  TFile *outfil1=new TFile("DriftSpeedVsAnode.root","recreate");
+  for(Int_t iddl=0; iddl<kTotDDL;iddl++){
+    for(Int_t imod=0; imod<kModPerDDL;imod++){
+      for(Int_t isid=0;isid<kSides;isid++){
+       Int_t index=kSides*(kModPerDDL*iddl+imod)+isid;
+       anal[index]->WriteToROOT(outfil1);
+      }
+    }
+  }
+  outfil1->Close();
+
   Int_t ipt0=0, ipt1=0;
   Float_t Edrift=(1800-45)/291/0.012;  
   TFile *outfil=new TFile("DriftSpeedHistos.root","recreate");
index 9837847..f632509 100644 (file)
@@ -85,6 +85,7 @@ int main(int argc, char **argv) {
   Bool_t readfeeconf=kFALSE;
   Int_t dataformat=1;
   gSystem->Exec("rm -f SDDbase_*.data");
+  gSystem->Exec("rm -f  SDDbase_step2_LDC.tar");
   if(gSystem->Getenv("DAQ_DETDB_LOCAL")!=NULL){
     const char* dir=gSystem->Getenv("DAQ_DETDB_LOCAL");    
     TString filnam=Form("%s/fee.conf",dir); 
@@ -102,6 +103,7 @@ int main(int argc, char **argv) {
   AliITSOnlineSDDBase **base=new AliITSOnlineSDDBase*[kTotDDL*kModPerDDL*kSides];
   AliITSOnlineSDDCMN **corr=new AliITSOnlineSDDCMN*[kTotDDL*kModPerDDL*kSides];
   TH2F **histo=new TH2F*[kTotDDL*kModPerDDL*kSides];
+  Bool_t isFilled[kTotDDL*kModPerDDL*kSides];
 
   Char_t hisnam[20];
   for(Int_t iddl=0; iddl<kTotDDL;iddl++){
@@ -113,6 +115,7 @@ int main(int argc, char **argv) {
        else base[index]->SetLastGoodTB(254);
        sprintf(hisnam,"h%02dc%02ds%d",iddl,imod,isid);
        histo[index]=new TH2F(hisnam,"",256,-0.5,255.5,256,-0.5,255.5);
+       isFilled[index]=0;
       }
     }
   }
@@ -133,6 +136,7 @@ int main(int argc, char **argv) {
            corr[index]=new AliITSOnlineSDDCMN(iddl,imod,isid);
            if(adcSamplFreq==20) corr[index]->SetLastGoodTB(126);
            else corr[index]->SetLastGoodTB(254);
+           isFilled[index]=0;
          }
        }
       }
@@ -228,6 +232,7 @@ int main(int argc, char **argv) {
            if(iDDL>=0 && iDDL<kTotDDL){ 
              Int_t index=kSides*(kModPerDDL*iDDL+iCarlos)+s->GetChannel(); 
              histo[index]->Fill(s->GetCoord2(),s->GetCoord1(),s->GetSignal());
+             isFilled[index]=1;
            }
          }
          delete s;
@@ -270,6 +275,7 @@ int main(int argc, char **argv) {
 
 
 
+  Char_t filnam[100],command[150];
   TFile *fh=new TFile("SDDbaseHistos.root","RECREATE");
   for(Int_t iddl=0; iddl<kTotDDL;iddl++){
     for(Int_t imod=0; imod<kModPerDDL;imod++){
@@ -277,7 +283,12 @@ int main(int argc, char **argv) {
        Int_t index=kSides*(kModPerDDL*iddl+imod)+isid;
        corr[index]->ValidateAnodes();
        corr[index]->WriteToASCII();
-       corr[index]->WriteToROOT(fh);
+       if(isFilled[index]){
+         corr[index]->WriteToROOT(fh);
+         sprintf(filnam,"SDDbase_step2_ddl%02dc%02d_sid%d.data",iddl,imod,isid);
+         sprintf(command,"tar -rf SDDbase_step2_LDC.tar %s",filnam);
+         gSystem->Exec(command);
+       }
       }
     }
   }
index 7e100dc..329f2b6 100644 (file)
@@ -236,16 +236,19 @@ int main(int argc, char **argv) {
       if(ievInj>=maxNEvents) break;
     }
   }
+
   /* write report */
   printf("Run #%s, received %d injector events\n",getenv("DATE_RUN_NUMBER"),ievInj);
 
   gSystem->Exec("rm -f  SDDinj_LDC.tar");
   Char_t filnam[100],command[120];
+  TFile *fh=new TFile("SDDinjectHistos.root","RECREATE");
   for(Int_t iddl=0; iddl<kTotDDL;iddl++){
     for(Int_t imod=0; imod<kModPerDDL;imod++){
       for(Int_t isid=0;isid<kSides;isid++){
        Int_t index=kSides*(kModPerDDL*iddl+imod)+isid;
        if(nWrittenEv[index]>0){
+         injan[index]->WriteToROOT(fh);
          sprintf(filnam,"SDDinj_ddl%02dc%02d_sid%d.data",iddl,imod,isid);
          sprintf(command,"tar -rf SDDinj_LDC.tar %s",filnam);
          gSystem->Exec(command);
@@ -253,7 +256,7 @@ int main(int argc, char **argv) {
       }  
     }
   }
-
+  fh->Close();
 
   /* report progress */
   daqDA_progressReport(90);