RAW QA only for calibration events
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 3 Jul 2009 21:14:04 +0000 (21:14 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 3 Jul 2009 21:14:04 +0000 (21:14 +0000)
T0/AliT0QAChecker.cxx
T0/AliT0QAChecker.h
T0/AliT0QADataMakerRec.cxx
T0/AliT0QADataMakerRec.h

index 5fbfc2f..71fcade 100644 (file)
@@ -46,6 +46,8 @@
 #include "AliLog.h"
 #include "AliQAv1.h"
 #include "AliQAChecker.h"
+#include "AliCDBEntry.h"
+#include "AliQAManager.h"
 #include "AliT0QAChecker.h"
 
 ClassImp(AliT0QAChecker)
@@ -66,9 +68,17 @@ Double_t * AliT0QAChecker::Check(AliQAv1::ALITASK_t index,TObjArray ** list)
 
   // Super-basic check on the QA histograms on the input list:
   // look whether they are empty!
-
+  
   Double_t * test = new Double_t[AliRecoParam::kNSpecies] ; 
-  for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) 
+  /*
+  char * detOCDBDir = Form("T0/%s/%s", AliQAv1::GetRefOCDBDirName(), AliQAv1::GetRefDataDirName()) ; 
+  AliCDBEntry *QARefRec = AliQAManager::QAManager()->Get(detOCDBDir);
+  //  QARefRec->Dump();
+  if( !QARefRec){
+    AliInfo("QA reference data NOT retrieved for Reconstruction check. No T0 reference distribution");
+  }
+  */
+   for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) 
     test[specie]    = 10.0 ; 
 
   Double_t nent[250];
@@ -95,17 +105,7 @@ Double_t * AliT0QAChecker::Check(AliQAv1::ALITASK_t index,TObjArray ** list)
     for (Int_t ir=0; ir<list[specie]->GetEntries(); ir++) {
       //raw
       if(index==0 ){
-        /*
-         if(ir < 205) {
-         hdata = (TH1*) list[specie]->UncheckedAt(ir);
-         if(hdata) {
-         cname = hdata->GetName();
-         hname[ir] = cname;
-         AliDebug(AliQAv1::GetQADebugLevel(),Form("count %i %s \n",ir, hname[ir].Data())) ;
-         fhRaw[ir] = hdata;
-         }
-         }*/
-        if(ir > 204) {
+        if(ir > 204 ) {
           //     else{
           h = (TH2*) list[specie]->UncheckedAt(ir);
           AliDebug(AliQAv1::GetQADebugLevel(), Form(" index %i ir %i \n", index,ir));
@@ -116,21 +116,20 @@ Double_t * AliT0QAChecker::Check(AliQAv1::ALITASK_t index,TObjArray ** list)
             fhRawEff[ir] = h;
           }
         }
-      }
-     
+     }
+      
       //rec
       if(index==2){
         h = (TH2*) list[specie]->UncheckedAt(ir);
         if(h) {
           cname = h->GetName();
           hname[ir] = cname;
-          AliDebug(AliQAv1::GetQADebugLevel(), Form("count %i %s \n",ir, hname[ir].Data())) ;
-          fhRecDiff[ir] = h;
+         //          AliDebug(AliQAv1::GetQADebugLevel(), Form("count %i %s \n",ir, hname[ir].Data())) ;
+           fhRecDiff[ir] = h;
         }
       }
       //esd
       if(index==3){
-       // cout<<" ir "<<ir<<endl;
         hdata = (TH1*) list[specie]->UncheckedAt(ir);
         if(hdata){
           fhESD[ir] = hdata;
@@ -138,36 +137,11 @@ Double_t * AliT0QAChecker::Check(AliQAv1::ALITASK_t index,TObjArray ** list)
         }
       }
     }
-      if (index == 0) {
-        //raw data
-       
-        for (Int_t icase=205; icase<207; icase++) {
-          for (Int_t idet=0; idet<24; idet++) {
-            Double_t mean = fhRawEff[icase]->ProjectionY(Form("%s_py_%i_%i",
-                                                              fhRawEff[icase]->GetName(), idet,icase),
-                                                              idet,idet+1)->GetMean();
-            Double_t rms= fhRawEff[icase]->ProjectionY(Form("%s_py%i_%i", 
-                                                            fhRawEff[icase]->GetName(), idet,icase),
-                                                            idet,idet+1)->GetRMS();
-            AliDebug(AliQAv1::GetQADebugLevel(), Form("name %s icase %i idet %i mean %f, rms %f\n",
-                    fhRawEff[icase]->GetName(), icase, idet, mean,rms));
-            if (mean<1.2 && mean> 0.8 ) {
-              test[specie] = 1;
-              AliDebug(AliQAv1::GetQADebugLevel(), Form("All channels works meane efficieny %f with rms %f test %f",  mean, rms, test[specie])) ; 
-            }
-            if (mean<=0.8 && mean>= 0.5 ){
-              test[specie] = 0.5;
-              AliDebug(AliQAv1::GetQADebugLevel(), Form("%s problem in channel %i  efficieny %f test %f",
-                              fhRawEff[icase]->GetName(), idet,  mean, test[specie])) ; 
-            }
-            if (mean<0.5 ) { 
-              test[specie] = 0.25;
-              AliDebug(AliQAv1::GetQADebugLevel(), Form("%s big problem in channel %i  efficieny %f test %f",
-                              fhRawEff[icase]->GetName(), idet,  mean, test[specie])) ; 
-            }
-          }
-        }
-      }
+    //raw data
+    if (index == 0) test[specie] = CheckRaw(list[specie]/*,(TObjArray *)QARefRec->GetObject()*/);
+
+
+      
       if(index == 2){
         //rec points
         for (Int_t icase=0; icase<2; icase++) {
@@ -214,6 +188,97 @@ Double_t * AliT0QAChecker::Check(AliQAv1::ALITASK_t index,TObjArray ** list)
     } //  if (list->GetEntries() != 0
     AliDebug(AliQAv1::GetQADebugLevel(), Form("Test Result = %f", test[specie])) ;
   } 
+  
   return test ;
 }
 
+//--------------------------------------------------------------------------
+Double_t AliT0QAChecker::CheckRaw(TObjArray *listrec /*, TObjArray *listref*/) const
+{
+  
+  TH2 *fhRawEff;
+  // TH2 *fhRawRef;
+  // TIter next(listref) ;
+  // Int_t counter=0;
+  // Float_t refmean[50]; 
+  // Float_t refrms[50]; 
+  Float_t checkr = 0;
+  /*
+  //  Int_t nref = listref->GetEntries(); 
+  // Int_t nrec = listrec->GetEntries(); 
+  
+  cout<<" entries in ref "<<nref<<" in rec "<<nrec<<endl;
+  //  for (Int_t iref=0; iref<nref; iref++){
+  while  (fhRawRef = dynamic_cast<TH2 *>(next()))  {
+  //  fhRawRef->Dump();
+    // fhRawRef =(TH2*) listref->At(iref); 
+    cout<<counter<<" hist "<<fhRawRef<<endl;
+    fhRawRef->Print();
+    fhRawRef->Dump();
+    refmean[counter] = fhRawRef->GetMean(2);
+    cout<<counter<<" mean "<<refmean[counter]<<endl;
+    refrms[counter] = fhRawRef->GetRMS(2);
+    cout<<counter<<" rms "<<refrms[counter]<<endl;
+    counter++;
+     cout<<" !!!!! reference "<<counter<<" "<<refmean[counter]<<" "<<refrms[counter]<<endl;
+  }
+  */
+  for (Int_t icase=205; icase<207; icase++) {
+    fhRawEff = (TH2*) listrec->At(icase);
+    for (Int_t idet=0; idet<24; idet++) {
+      Double_t mean = fhRawEff->
+       ProjectionY(Form("%s_py_%i_%i",                                                              fhRawEff->GetName(), idet,icase),
+                   idet,idet+1)->GetMean();
+      Double_t rms= fhRawEff->
+       ProjectionY(Form("%s_py%i_%i", 
+                        fhRawEff->GetName(), idet,icase),
+                   idet,idet+1)->GetRMS();
+       AliDebug(AliQAv1::GetQADebugLevel(), 
+               Form("name %s icase %i idet %i mean %f, rms %f\n",
+                    fhRawEff->GetName(), icase, idet, mean,rms));
+      if (mean<1.2 && mean> 0.8 ) {
+       checkr = 1;
+       AliDebug(AliQAv1::GetQADebugLevel(), Form("All channels works meane efficieny %f with rms %f test %f",  mean, rms, checkr)) ; 
+      }
+      if (mean<=0.8 && mean>= 0.5 ){
+       checkr = 0.5;
+       AliDebug(AliQAv1::GetQADebugLevel(), 
+                Form("%s problem in channel %i  efficieny %f test %f",
+                     fhRawEff->GetName(), idet,  mean,checkr )) ; 
+      }
+      if (mean<0.5 ) { 
+       checkr = 0.25;
+       AliDebug(AliQAv1::GetQADebugLevel(),
+                Form("%s big problem in channel %i  efficieny %f test %f",
+                     fhRawEff->GetName(), idet,  mean,checkr )) ; 
+     }
+    }
+  }
+  for (Int_t icase=208; icase<210; icase++) {
+   fhRawEff = (TH2*) listrec->At(icase);
+   
+   for (Int_t idet=0; idet<24; idet++) {
+     Double_t mean = fhRawEff->
+       ProjectionY(Form("%s_py_%i_%i",                                                              fhRawEff ->GetName(), idet,icase),
+                  idet,idet+1)->GetMean();
+     Double_t rms= fhRawEff ->
+       ProjectionY(Form("%s_py%i_%i", 
+                       fhRawEff ->GetName(), idet,icase),
+                  idet,idet+1)->GetRMS();
+     
+    
+     
+     AliDebug(AliQAv1::GetQADebugLevel(), 
+             Form("name %s icase %i idet %i mean %f, rms %f\n",
+                  fhRawEff->GetName(), icase, idet, mean,rms));
+     
+   
+
+
+   }
+
+  }
+  return checkr;
+}
+
index df75ed7..da05407 100644 (file)
@@ -29,6 +29,7 @@ public:
   AliT0QAChecker(const AliT0QAChecker& qac) : AliQACheckerBase(qac.GetName(), qac.GetTitle()) {;} // cpy ctor   
  // dtor
  virtual ~AliT0QAChecker() {;}
+ Double_t CheckRaw(TObjArray *listrec /*, TObjArray *listref*/) const ;
 private:
   virtual Double_t * Check(AliQAv1::ALITASK_t) ; 
   virtual Double_t * Check(AliQAv1::ALITASK_t, TObjArray ** list) ;
index 19bda4c..d518f0a 100644 (file)
@@ -58,7 +58,8 @@ AliQADataMakerRec(AliQAv1::GetDetName(AliQAv1::kT0),
     {
       feffC[i]=0;
       feffA[i]=0;
-    }
+      feffqtc[i]=0;
+   }
 }
 
 //____________________________________________________________________________ 
@@ -137,26 +138,26 @@ void AliT0QADataMakerRec::InitRaws()
       ampname += i;
       qtcname += i;
       ledname += i;
-      fhRawCFD[i] = new TH1F(timename.Data(), Form("%s;Time [ns];Counts", timename.Data()),500,-250,250);
-      Add2RawsList( fhRawCFD[i],i+1, !expert, image, !saveCorr);
-      fhRawLED[i] = new TH1F(ledname.Data(),  Form("%s;Time [ns];Counts", ledname.Data()),2000,-1000,1000);
-      Add2RawsList( fhRawLED[i],i+24+1, !expert, image, !saveCorr);
-      fhRawLEDamp[i] = new TH1F(ampname.Data(),  Form("%s;Amplitude [ADC counts];Counts", ampname.Data()),100,300,600);
-      Add2RawsList( fhRawLEDamp[i],i+48+1, !expert, image, !saveCorr);
-      fhRawQTC[i] = new TH1F(qtcname.Data(),  Form("%s;Charge [??];Counts", qtcname.Data()),1500,1000,7000);
-      Add2RawsList( fhRawQTC[i],i+72+1, !expert, image, !saveCorr);
+      fhRawCFD[i] = new TH1F(timename.Data(), Form("%s;CFD [#channels];Counts", timename.Data()),10000,0,10000);
+      Add2RawsList( fhRawCFD[i],i+1, expert, !image, !saveCorr);
+      fhRawLED[i] = new TH1F(ledname.Data(),  Form("%s;LED[#channels];Counts", ledname.Data()),10000,0,10000);
+      Add2RawsList( fhRawLED[i],i+24+1, expert, !image, !saveCorr);
+      fhRawLEDamp[i] = new TH1F(ampname.Data(),  Form("%s;LED-CFD [#channels];Counts", ampname.Data()),10000,0,10000);
+      Add2RawsList( fhRawLEDamp[i],i+48+1, expert, !image, !saveCorr);
+      fhRawQTC[i] = new TH1F(qtcname.Data(),  Form("%s;QTC[#channels];Counts", qtcname.Data()),700,0,7000);
+      Add2RawsList( fhRawQTC[i],i+72+1, expert, image, !saveCorr);
      }
   TH1F* fhRawTrigger = new TH1F("hRawTrigger"," phys triggers;Trigger #;Counts",5,0,5);
   Add2RawsList(fhRawTrigger ,97, !expert, image, !saveCorr);
   
-  TH1F* fhRawMean = new TH1F("hRawMean","online mean signal;;??", 100,2400,2500);
-  Add2RawsList( fhRawMean,98, !expert, image, !saveCorr);
-  TH1F* fhRawVertex = new TH1F("hRawVertex","online vertex signal;??;??", 100,0,600);
-  Add2RawsList( fhRawVertex,99, !expert, image, !saveCorr);
-  TH1F* fhRawORA = new TH1F("hRawORA","online OR A;??;??", 100,2500,2800);
-  Add2RawsList( fhRawORA,100, !expert, image, !saveCorr);
-  TH1F* fhRawORC = new TH1F("hRawORC","online OR C;??;??", 100,2000,2300);
-  Add2RawsList( fhRawORC,101, !expert, image, !saveCorr);
+  TH1F* fhRawMean = new TH1F("hRawMean","online mean signal, physics event;", 1000,10000,10000);
+  Add2RawsList( fhRawMean,98, expert, !image, !saveCorr);
+  TH1F* fhRawVertex = new TH1F("hRawVertex","online vertex signal; counts", 100,0,600);
+  Add2RawsList( fhRawVertex,99, expert, !image, !saveCorr);
+  TH1F* fhRawORA = new TH1F("hRawORA","online OR A; counts", 10000,0,10000);
+  Add2RawsList( fhRawORA,100, expert, !image, !saveCorr);
+  TH1F* fhRawORC = new TH1F("hRawORC","online OR C;counts", 10000,0,10000);
+  Add2RawsList( fhRawORC,101, expert, !image, !saveCorr);
   
   for (Int_t i=0; i<24; i++)
     {
@@ -169,56 +170,57 @@ void AliT0QADataMakerRec::InitRaws()
       ledCalname += i;
       ampCalname += i;
       qtcCalname += i;
-      fhRawCFDcal[i] = new TH1F(timeCalname.Data(),  Form("%s;Time [ns];Counts", timeCalname.Data()),2000,-1000,1000);
+      fhRawCFDcal[i] = new TH1F(timeCalname.Data(),  Form("%s;Time [ns];Counts", timeCalname.Data()),10000,0,10000);
       Add2RawsList( fhRawCFDcal[i],101+i+1, !expert, image, !saveCorr);
-      fhRawLEDcal[i] = new TH1F(ledCalname.Data(),  Form("%s;Time [ns];Counts", ledCalname.Data()),2000,-1000,1000);
+      fhRawLEDcal[i] = new TH1F(ledCalname.Data(),  Form("%s;Time [ns];Counts", ledCalname.Data()),10000,0,10000);
       Add2RawsList( fhRawLEDcal[i],101+i+24+1, !expert, image, !saveCorr);
-      fhRawLEDampcal[i] = new TH1F(ampCalname.Data(), Form("%s;Amplitude [ADC counts];Counts", ampCalname.Data()),300,300,600);
+      fhRawLEDampcal[i] = new TH1F(ampCalname.Data(), Form("%s;Amplitude [ADC counts];Counts", ampCalname.Data()),1000,0,1000);
       Add2RawsList( fhRawLEDampcal[i],101+i+48+1, !expert, image, !saveCorr);
       fhRawQTCcal[i] = new TH1F(qtcCalname.Data(), Form("%s;Charge [??];Counts",qtcCalname.Data()),1000,0,7000);
       Add2RawsList( fhRawQTCcal[i],101+i+72+1, !expert, image, !saveCorr);
     }
 
   TH1F* fhRawTriggerCal = new TH1F("hRawTriggerCal"," laser triggers",6,0,6);
-  Add2RawsList(fhRawTriggerCal ,197 , !expert, !image, saveCorr);
+  Add2RawsList(fhRawTriggerCal ,197 , !expert, image, saveCorr);
 
-  TH1F* fhRawMeanCal = new TH1F("hRawMeanCal","online mean signal, calibration event;??;??",
+  TH1F* fhRawMeanCal = new TH1F("hRawMeanCal","online mean signal, calibration event",
                                10000,0,10000);
   Add2RawsList( fhRawMeanCal,198);
-  TH1F* fhRawVertexCal = new TH1F("hRawVertexCal","online vertex signal, calibration even ",
+  TH1F* fhRawVertexCal = new TH1F("hRawVertexCal","online vertex signal, calibration event ",
                                  10000,0,10000);
-  Add2RawsList( fhRawVertexCal,199, !expert, image, !saveCorr);
-  TH1F* fhRawORAcal = new TH1F("hRawORAcal","online OR A;??;??", 10000,0,10000);
-  Add2RawsList( fhRawORAcal,200, !expert, image, !saveCorr );
-  TH1F* fhRawORCcal = new TH1F("hRawORCcal","online OR C;??;??", 10000,0,10000);
-  Add2RawsList( fhRawORCcal,201, !expert, image, !saveCorr);
+  Add2RawsList( fhRawVertexCal,199, expert, !image, !saveCorr);
+  TH1F* fhRawORAcal = new TH1F("hRawORAcal","laser OR A; counts", 10000,0,10000);
+  Add2RawsList( fhRawORAcal,200, expert, !image, !saveCorr );
+  TH1F* fhRawORCcal = new TH1F("hRawORCcal","laserOR C;counts ", 10000,0,10000);
+  Add2RawsList( fhRawORCcal,201, expert, !image, !saveCorr);
   TH1F* fhMultcal = new TH1F("hMultcal","full mulltiplicity;Multiplicity;Entries", 10000,0,10000);
-  Add2RawsList( fhMultcal,202, !expert, image, !saveCorr );
+  Add2RawsList( fhMultcal,202, expert, !image, !saveCorr );
   TH1F* fhMultScal = new TH1F("hMultScal","full multiplicity with semi-central trigger;Multiplicity;Entries",
                              10000,0,10000);
-  Add2RawsList( fhMultScal,203, !expert, image, !saveCorr);
+  Add2RawsList( fhMultScal,203, expert, !image, !saveCorr);
   TH1F* fhMultCcal = new TH1F("hMultCcal","full multiplicity with central trigger;Multiplicity;Entries", 
                              1000,0,10000);
-  Add2RawsList( fhMultCcal,204, !expert, image, !saveCorr);
+  Add2RawsList( fhMultCcal,204, expert, !image, !saveCorr);
 
-  //  TH2F* fhEffCFD = new TH2F("hEffCFD"," CFD time",24, 0 ,24, 
-  //                 100,-500,500);
-  TH2F* fhEffCFD = new TH2F("hEffCFD"," CFD time;Time [ns];Counts",24, 0 ,24, 50, 0,5); 
+   TH2F* fhEffCFD = new TH2F("hEffCFD","#PMT; #CFD counts/nEvents",24, 0 ,24, 50, 0,5); 
   fhEffCFD->SetOption("COLZ");
   Add2RawsList( fhEffCFD,205, !expert, !image, saveCorr);
-  TH2F* fhEffLED = new TH2F("hEffLED","LED time;Time [ns];Counts",24, 0 ,24, 
+  TH2F* fhEffLED = new TH2F("hEffLED","#PMT; #LED counts/nEvent",24, 0 ,24, 
                            100, 0, 5); 
-  //100,-500,500);
   fhEffLED->SetOption("COLZ");
   Add2RawsList( fhEffLED,206, !expert, !image, saveCorr);
-  TH2F* fhEffQTC = new TH2F("hEffQTC","QTC amplitude%s;Amplitude [ADC counts];Counts",24, 0 ,24,   100,0,7000);
+  TH2F* fhEffQTC = new TH2F("hEffQTC","#PMT; QTC efficiency%s;",24, 0 ,24,   100,0,5);
   fhEffQTC->SetOption("COLZ");
   Add2RawsList( fhEffQTC,207, !expert, !image, saveCorr);
-  //eyes guide line
-  //  TH2F* fhLineQTC = new TH2F("hLineQTC","QTC amplitude boeder",24, 0 ,24, 
-  //                         100,0,7000);
-//  Add2RawsList( fhLineQTC,208, !expert, !image, saveCorr);
-  const Char_t *triggers[6] = {"mean", "vertex","ORA","ORC","central","semi-central"};
+
+  TH2F* fhCFDcal = new TH2F("hCFDcal","#PMT; CFD {#channnels}",25, 0 ,25, 1000,0,5000);
+  fhCFDcal->SetOption("COLZ");
+  Add2RawsList( fhCFDcal,208, !expert, image, !saveCorr);
+  TH2F* fhLEDcal = new TH2F("hLEDcal","#PMT; LED [#channnels]",25, 0 ,25, 1000,0,5000);
+  fhLEDcal->SetOption("COLZ");
+  Add2RawsList( fhLEDcal,209, !expert, image, !saveCorr);
+
+ const Char_t *triggers[6] = {"mean", "vertex","ORA","ORC","central","semi-central"};
   for (Int_t itr=0; itr<6; itr++) {
     GetRawsData(197)->Fill(triggers[itr], fNumTriggersCal[itr]);
     GetRawsData(197)->SetBinContent(itr+1, fNumTriggersCal[itr]);
@@ -237,10 +239,10 @@ void AliT0QADataMakerRec::InitDigits()
   Add2DigitsList( fhDigCFD,0, !expert, image);
   TH2F *fhDigLEDamp = new TH2F("fhDigLEDamp", " LED-CFD digits; #PMT; LED-CFD amplitude ",25,-0.5,24.5,100,100,1000);
   fhDigLEDamp->SetOption("COLZ");
-  Add2DigitsList( fhDigLEDamp,1, !expert, image);
+  Add2DigitsList( fhDigLEDamp,1, !expert, !image);
   TH2F * fhDigQTC = new TH2F("fhDigQTC", " QTC digits; #PMT; QTC amplitude",25,-0.5,24.5,100,100,10000);
   fhDigQTC->SetOption("COLZ");
-  Add2DigitsList( fhDigQTC,2, !expert, image);}
+  Add2DigitsList( fhDigQTC,2, !expert, !image);}
 
 //____________________________________________________________________________ 
 
@@ -287,10 +289,10 @@ void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
        rawReader->Reset() ; 
   //fills QA histos for RAW
   Int_t shift=0;
-  Float_t effic ;
+  Float_t effic=0 ;
 
   AliT0RawReader *start = new AliT0RawReader(rawReader);
-  //  start->Next();
+
   if (! start->Next())
     AliDebug(AliQAv1::GetQADebugLevel(),Form(" no raw data found!!"));
   else
@@ -298,7 +300,6 @@ void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
       fnEvent++;
 
       UInt_t type =rawReader->GetType();
-      //     cout<<" !!!!! new event type = "<<type<<endl;
       Int_t allData[110][5];
       for (Int_t i0=0; i0<105; i0++)
        {
@@ -309,78 +310,96 @@ void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
          allData[i][iHit]= start->GetData(i,iHit);
       
       if (allData[0][0]>0)    GetRawsData(0) -> Fill( allData[0][0]);
-      //  allData[0][0] = allData[0][0] - 7000; 
-      if (type == 8) shift=101;
+      Int_t refpoint = allData[0][0];
+      // allData[0][0] = allData[0][0] - 7000; 
+      if (type == 8) {shift=101; refpoint=allData[0][0] - 5000;}
       if (type == 7) shift=0;
       
       for (Int_t ik = 0; ik<12; ik++){
-       for (Int_t iHt=0; iHt<5; iHt++){
+       for (Int_t iHt=0; iHt<1; iHt++){
          //cfd
-         if(allData[ik+1][iHt]>0)
+         if(allData[ik+1][iHt]>0) {
            GetRawsData(shift+ik+1) -> 
-             Fill(allData[ik+1][iHt]-allData[1][0]);
-         //led
-         if(allData[ik+13][iHt] > 0 && allData[13][iHt]>0) 
+             Fill(allData[ik+1][iHt]-refpoint);
+           if(type == 8  ) {
+             feffC[ik]++;
+             GetRawsData(208)->Fill(ik+1, allData[ik+1][iHt]-refpoint);
+           } 
+         }       //led
+         if(allData[ik+13][iHt] > 0) { 
            GetRawsData(shift+ik+24+1)->
-             Fill(allData[ik+13][iHt]-allData[13][iHt]);
+             Fill(allData[ik+13][iHt]-refpoint);
+           if(type == 8  ) {
+             feffA[ik]++;
+             GetRawsData(209)->Fill(ik+1, allData[ik+13][iHt]-refpoint);
+           }
+         }
          //led -cfd
 
          if(allData[ik+13][iHt] > 0 && allData[ik+1][iHt] >0 )
            GetRawsData(shift+ik+48+1)->
              Fill(allData[ik+13][iHt]-allData[ik+1][iHt]);
          //qtc
-         if(allData[2*ik+25][iHt] > 0 && allData[2*ik+26][iHt] > 0)
+         if(allData[2*ik+25][iHt] > 0 || allData[2*ik+26][iHt] > 0) {
            GetRawsData(shift+ik+72+1)->
-             Fill(allData[2*ik+25][iHt]-allData[2*ik+26][iHt]);
-         
-         
-         if(type == 8 && allData[ik+1][iHt]>0 ) feffC[ik]++; 
-         if(type == 8 && allData[ik+13][iHt]>0 ) feffA[ik]++; 
-         // GetRawsData(206)->Fill(ik,allData[ik+13][iHt]-allData[13][0]);
-         if(type == 8 && (allData[2*ik+25][iHt]>0 && allData[2*ik+26][iHt]>0) ) 
-           GetRawsData(207)->Fill(ik,allData[2*ik+25][iHt]-allData[2*ik+26][iHt]);
+             Fill(allData[2*ik+26][iHt]-allData[2*ik+25][iHt]);
+           if(type == 8  ) feffqtc[ik]++;
+         }
        }
+       effic=0;
        effic = Float_t(feffC[ik])/Float_t(fnEvent);
-       GetRawsData(205)->Fill(ik,effic );
+       GetRawsData(205)->Fill(ik+1,effic );
+       effic=0;
        effic = Float_t(feffA[ik])/Float_t(fnEvent);
-       GetRawsData(206)->Fill(ik,effic );
-       //      printf("CFD  efficiency for PMT %i = %f \n", ik, effic); 
+       GetRawsData(206)->Fill(ik+1,effic );
+       effic=0;
+       effic = Float_t(feffqtc[ik])/Float_t(fnEvent);
+       GetRawsData(207)->Fill(ik+1, effic);
       }
       for (Int_t ik = 12; ik<24; ik++) {
-       for (Int_t iHt=0; iHt<5; iHt++) {
-         if(allData[ik+45][iHt]>0) 
+       for (Int_t iHt=0; iHt<1; iHt++) {
+         if(allData[ik+45][iHt]>0) {
            //cfd
            GetRawsData(shift+ik+1)->
-             Fill(allData[ik+45][iHt]-allData[57][0]);
-           //qtc         
-         if(allData[2*ik+57][iHt]>0 && allData[2*ik+58][iHt]>0)
-           GetRawsData(shift+ik+72+1)->
-             Fill(allData[2*ik+57][iHt]-allData[2*ik+58][iHt]);
+             Fill(allData[ik+45][iHt]-refpoint);
+           if(type == 8  ) {
+             feffC[ik]++;
+             GetRawsData(208)->Fill(ik+1, allData[ik+45][iHt]-refpoint);
+           } 
+         }
          //led
-         if(allData[ik+57][iHt] > 0 )
+         if(allData[ik+57][iHt] > 0 ) {
            GetRawsData(shift+ik+24+1)->
-             Fill(allData[ik+57][iHt]-allData[69][iHt]);
-           //led-cfd
+             Fill(allData[ik+57][iHt]-refpoint);
+           if(type == 8  ) {
+             feffA[ik]++;
+             GetRawsData(209)->Fill(ik+1, allData[ik+57][iHt]-refpoint);
+           }
+         }
+           //qtc         
+         if(allData[2*ik+57][iHt]>0 || allData[2*ik+58][iHt]>0)
+           {
+             GetRawsData(shift+ik+72+1)->
+               Fill(allData[2*ik+58][iHt]-allData[2*ik+57][iHt]);
+             if(type == 8  )  feffqtc[ik]++;
+           } 
+         //led-cfd
          if(allData[ik+57][iHt] > 0 &&allData[ik+45][iHt]>0)
            GetRawsData(shift+ik+48+1)->
              Fill(allData[ik+57][iHt]-allData[ik+45][iHt]);
-         
-         if(type == 8 && allData[ik+45][iHt]>0 )  feffC[ik]++; 
-
-         if(type == 8 && allData[ik+57][iHt]>0 )  feffA[ik]++; 
-         // GetRawsData(206)->Fill(ik,allData[ik+57][iHt]-allData[69][0]);
-         if(type == 8 && (allData[2*ik+57][iHt]>0 && allData[2*ik+58][iHt]>0) )
-           GetRawsData(207)->Fill(ik,allData[2*ik+57][iHt]-allData[2*ik+58][iHt]);               
        }
        effic = Float_t(feffC[ik])/Float_t(fnEvent);
        GetRawsData(205)->Fill(ik,effic );
        effic = Float_t(feffA[ik])/Float_t(fnEvent);
        GetRawsData(206)->Fill(ik,effic );
-       //   printf("CFD  efficiency for PMT %i = %f \n", ik, effic);       }
+       effic=0;
+       effic = Float_t(feffqtc[ik])/Float_t(fnEvent);
+       GetRawsData(207)->Fill(ik+1, effic);
       }
        
       Int_t trChannel[6] = {49,50,51,52,55,56};  
-      if(type == 7)
+       
+     if(type == 7)
        {
          for (Int_t iHt=0; iHt<6; iHt++) {
            for (Int_t itr=0; itr<6; itr++) {
@@ -388,8 +407,9 @@ void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
            }
          }
        }
-      if(type == 8)
-       {
+      
+        if(type == 8)
+       {
          for (Int_t iHt=0; iHt<5; iHt++) {
            for (Int_t itr=0; itr<6; itr++) {
              if(allData[trChannel[itr]][iHt]>0)
@@ -404,7 +424,7 @@ void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
              GetRawsData(204)->Fill(allData[53][iHt]-allData[54][iHt]);
          }
        } 
-
+       
            delete start;
       }
     }
@@ -462,7 +482,7 @@ void AliT0QADataMakerRec::MakeRecPoints(TTree * clustersTree)
 
   AliT0RecPoint* frecpoints= new AliT0RecPoint ();
   if (!frecpoints) {
-    AliError("Reconstruct Fill ESD >> no recpoints found");
+    AliError(":MakeRecPoints >> no recpoints found");
     return;
   }
   TBranch *brRec =clustersTree ->GetBranch("T0");
index 5cb0180..edd762e 100644 (file)
@@ -49,9 +49,10 @@ private:
   Int_t fnEvent; 
   Int_t feffC[24]; 
   Int_t feffA[24]; 
+  Int_t feffqtc[24]; 
 
 
-  ClassDef(AliT0QADataMakerRec,3)  // description 
+  ClassDef(AliT0QADataMakerRec,4)  // description 
 
 };