reference distribution for kRAW kCalib case
authoralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Aug 2009 12:00:31 +0000 (12:00 +0000)
committeralla <alla@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 31 Aug 2009 12:00:31 +0000 (12:00 +0000)
T0/AliT0QAChecker.cxx
T0/AliT0QAChecker.h
T0/AliT0QADataMakerRec.cxx

index 795fda9b285985d45f6d0c7b48e8287938880061..e7ab24d5c0542a91e387df179276d40546a819d2 100644 (file)
 ClassImp(AliT0QAChecker)
 
 //__________________________________________________________________
-Double_t * AliT0QAChecker::Check(AliQAv1::ALITASK_t index,TObjArray ** list)
+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] ; 
-  /*
+  
   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 ; 
 
@@ -79,7 +80,9 @@ Double_t * AliT0QAChecker::Check(AliQAv1::ALITASK_t index,TObjArray ** list)
   memset(w,1,500*sizeof(Double_t));
   TH2 *fhRecDiff[3];  
   TH1 *fhRawEff[500];
+  TH2 *fhRawTime[500];
   TH1 *fhESD[2];
+  TH2 *fhHits[10];
   
   for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
     //  TString dataType = AliQAv1::GetAliTaskName(index);
@@ -87,39 +90,50 @@ Double_t * AliT0QAChecker::Check(AliQAv1::ALITASK_t index,TObjArray ** list)
       test[specie] = 1. ; // nothing to check
     }
     else {
-    TIter next(list[specie]) ;
-    TH1 * hdata ;
-    TH2 * h ;
-    //  AliDebug(AliQAv1::GetQADebugLevel(), Form(" data type %i %s nentries %i\n",
-    //    index,dataType.Data(),list->GetEntries()));
-    for (Int_t ir=0; ir<list[specie]->GetEntries(); ir++) {
-      //raw
-      if(index==0 ){
+      TH1 * hdata ;
+      TH2 * h ;
+      for (Int_t ir=0; ir<list[specie]->GetEntries(); ir++) {
+      
+       //hits
+
+       if(index == AliQAv1::kSIM && AliQAv1::GetTaskName(AliQAv1::kHITS)){
+         h =  (TH2*) list[specie]->UncheckedAt(ir);
+         cname = h->GetName();
+         hname[ir] = cname;
+         fhHits[ir] = h;
+       }
+
+       //raw
+      if(index == AliQAv1::kRAW ){
         if(ir > 204 && ir<208 ) {
-          //     else{
           hdata = (TH1*) list[specie]->UncheckedAt(ir);
-          AliDebug(AliQAv1::GetQADebugLevel(), Form(" index %i ir %i \n", index,ir));
           if(hdata) {
             cname = hdata->GetName();
             hname[ir] = cname;
-            AliDebug(AliQAv1::GetQADebugLevel(),Form("count %i %s \n",ir, hname[ir].Data())) ;
             fhRawEff[ir] = hdata;
           }
         }
-     }
-      
+       if((ir>207 && ir<210)  && specie == 4) {
+         h =  (TH2*) list[specie]->UncheckedAt(ir);
+         if(h) {
+           cname = h->GetName();
+           hname[ir] = cname;
+           fhRawTime[ir] = h;
+          AliDebug(AliQAv1::GetQADebugLevel(), Form("count %i %s ",ir, hname[ir].Data()) );
+         }
+       }
+      }
       //rec
-      if(index==2){
+      if(index == AliQAv1::kREC){
         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;
         }
       }
       //esd
-      if(index==3){
+      if(index ==  AliQAv1::kESD){
         hdata = (TH1*) list[specie]->UncheckedAt(ir);
         if(hdata){
           fhESD[ir] = hdata;
@@ -127,12 +141,16 @@ Double_t * AliT0QAChecker::Check(AliQAv1::ALITASK_t index,TObjArray ** list)
         }
       }
     }
-    //raw data
-    if (index == 0) test[specie] = CheckRaw(list[specie]/*,(TObjArray *)QARefRec->GetObject()*/);
 
 
+
+    //raw data
+
+      if (index == AliQAv1::kRAW && specie == 4){
+       test[specie] = CheckRaw(list[specie],dynamic_cast<TObjArray*>(dynamic_cast<TList *>(QARefRec->GetObject())->First()));
+      }
       
-      if(index == 2){
+      if(index == AliQAv1::kREC){
         //rec points
         for (Int_t icase=0; icase<2; icase++) {
           for (Int_t idet=0; idet<24; idet++) {
@@ -156,7 +174,7 @@ Double_t * AliT0QAChecker::Check(AliQAv1::ALITASK_t index,TObjArray ** list)
           }
         }       
       }
-      if (index == 3) {
+      if (index == AliQAv1::kESD) {
         //ESD
         for (Int_t icase=0; icase<2; icase++) {
           Double_t rmsVertex = fhESD[icase]->GetRMS();
@@ -183,86 +201,76 @@ Double_t * AliT0QAChecker::Check(AliQAv1::ALITASK_t index,TObjArray ** list)
 }
 
 //--------------------------------------------------------------------------
-Double_t AliT0QAChecker::CheckRaw(TObjArray *listrec /*, TObjArray *listref*/) const
+Double_t AliT0QAChecker::CheckRaw(TObjArray *listrec , TObjArray *listref) const
 {
   
   TH1 *fhRawEff;
-  // TH2 *fhRawRef;
-  // TIter next(listref) ;
-  // Int_t counter=0;
-  // Float_t refmean[50]; 
-  // Float_t refrms[50]; 
+  TH1 *fhRawRef;
+  TH2 *fhRawRec2d;
+  TH2 *fhTime;
+
+  TIter next(listref) ;
+  Int_t counter=0;
+  Float_t refmean[50][25]; 
+  Float_t refrms[50][25]; 
   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;
+  Int_t nref = listref->GetEntries(); 
+  Int_t nrec = listrec->GetEntries(); 
+  
+  for (Int_t iii=4; iii<6; iii++){
+    fhRawRec2d =(TH2*) listref->At(iii); 
+    for (Int_t idet=1; idet<25; idet++) {
+      
+      refmean[iii-4][idet] = fhRawRec2d->      
+       ProjectionY(Form("%s_py_%i_%i",                                                              fhRawRec2d ->GetName(), idet,iii-4),
+                   idet,idet+1)->GetMean();
+      
+      refrms[iii-4][idet] = fhRawRec2d->
+       ProjectionY(Form("%s_py%i_%i", 
+                        fhRawRec2d ->GetName(), idet,iii-4),
+                   idet,idet+1)->GetRMS();
+      
+      }
   }
-  */
+
   
-  for (Int_t icase=205; icase<208; icase++) {
-    fhRawEff = (TH1*) listrec->At(icase);
-    for (Int_t idet=0; idet<24; idet++) {
-      Double_t mean = fhRawEff->GetBinContent(idet);
-      AliDebug(AliQAv1::GetQADebugLevel(), 
-              Form("name %s icase %i idet %i mean %f \n",
-                   fhRawEff->GetName(), icase, idet, mean));
-       
-      if (mean<1.2 && mean> 0.8 ) {
+  TString nameDev[2] = {"CDF", "LED"};
+  for (Int_t icase=208; icase<210; icase++) {
+    fhTime = (TH2*) listrec->At(icase);
+    for (Int_t idet=1; idet<25; idet++) {
+      Double_t binmean = fhTime->
+       ProjectionY(Form("%s_py_%i_%i",                                                              fhTime ->GetName(), idet,icase),
+                   idet,idet+1)->GetMean();
+      Double_t rms= fhTime ->
+       ProjectionY(Form("%s_py%i_%i", 
+                        fhTime ->GetName(), idet,icase),
+                   idet,idet+1)->GetRMS();
+      Double_t diffmean = binmean-refmean[icase-208][idet];
+      
+      if (TMath::Abs(diffmean) < 2 ) {
        checkr = 1;
-       AliDebug(AliQAv1::GetQADebugLevel(), Form("All channels works meane efficieny %f with  test %f",  mean, 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;
+       //      printf(" Laser calibration signal sits on its place %f for PMT %s %i : check = %f\n",  diffmean, nameDev[icase-208].Data() ,idet, checkr);
        AliDebug(AliQAv1::GetQADebugLevel(),
-                Form("%s big problem in channel %i  efficieny %f test %f",
-                     fhRawEff->GetName(), idet,  mean,checkr )) ; 
+                Form(" Laser calibration signal sits on its place %f for PMT %s %i : check = %f\n",  diffmean, nameDev[icase-208].Data(),idet, checkr)) ; 
+     }
+     if (TMath::Abs(diffmean) <= 5 && TMath::Abs(diffmean) >= 2 ){
+       checkr = 0.5;
+       // printf(" Laser calibration signal shifted by  %f ps for PMT %s %i : check = %f\n",  diffmean*24.4, nameDev[icase-208].Data(),idet, checkr);
+       AliDebug(AliQAv1::GetQADebugLevel(),
+               Form(" Laser calibration signal shifted by  %f ps (%f channels) for PMT %s %i : check = %f\n",  diffmean*24.4 ,diffmean , nameDev[icase-208],idet, checkr)) ; 
+      }
+     if (TMath::Abs(diffmean) > 5) { 
+       checkr = 0.25;
+       //   printf(" Big problems :laser calibration signal shifted by  %f ps (%f channels) for PMT %s %i : check = %f\n",  diffmean*24.4, diffmean, nameDev[icase-208].Data(),idet, checkr);
+       AliDebug(AliQAv1::GetQADebugLevel(),
+               Form(" Big problems :laser calibration signal shifted by  %f ps (%f channels) for PMT %s %i : check = %i\n",  diffmean*24.4, diffmean, nameDev[icase-208].Data(),idet, 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 93f98d8bd9a401c971b77e7ed1b634c2358981c0..ebffe6948ab49f7b0b343dab5d467781e0a37d02 100644 (file)
@@ -29,7 +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 ;
+ Double_t CheckRaw(TObjArray *listrec , TObjArray *listref) const ;
 private:
   virtual Double_t * Check(AliQAv1::ALITASK_t, TObjArray ** list) ;
   
index ce0d0ea25a978d02e1dd9bebac8484bca846c4e6..045a32e240d066e94c30e5834e8f35350f7044b9 100644 (file)
@@ -94,10 +94,11 @@ void AliT0QADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArra
   //Detector specific actions at end of cycle
   // do the QA checking
   AliQAChecker::Instance()->Run(AliQAv1::kT0, task, list) ;
+  
   for (Int_t specie = 0 ; specie < AliRecoParam::kNSpecies ; specie++) {
     if (! IsValidEventSpecie(specie, list)) 
       continue ;
-   SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ; 
+    SetEventSpecie(AliRecoParam::ConvertIndex(specie)) ; 
     if ( task == AliQAv1::kRAWS ) {
       GetRawsData(0)->SetLabelSize(0.02);
       const Char_t *triggers[6] = {"mean", "vertex","ORA","ORC","central","semi-central"};
@@ -111,7 +112,6 @@ void AliT0QADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArra
         GetRawsData(197)->SetBinContent(itr+1, fTrEffCal[itr]);
         GetRawsData(97)->Fill(triggers[itr], fTrEffPhys[itr]);
         GetRawsData(97)->SetBinContent(itr+1, fTrEffPhys[itr]);
-
       } 
       Float_t effic=0;
       for(Int_t ik=0; ik<24; ik++)
@@ -126,11 +126,13 @@ void AliT0QADataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t task, TObjArra
          if ( fnEventCal>0) effic = Float_t(feffqtc[ik])/Float_t(fnEventCal);
          GetRawsData(207)->SetBinContent(ik+1, effic);
        }
-
+      
+      
     }
+    
   }
-}
 
+}
 //____________________________________________________________________________
 void AliT0QADataMakerRec::StartOfDetectorCycle()
 {
@@ -146,13 +148,16 @@ void AliT0QADataMakerRec::InitRaws()
   const Bool_t expert   = kTRUE ; 
   const Bool_t saveCorr = kTRUE ; 
   const Bool_t image    = kTRUE ; 
+
+  Int_t refPointParam = GetRecoParam()->GetRefPoint();
+  Int_t refAmp = GetRecoParam()->GetRefAmp();
   
   TString timename, ampname, qtcname, ledname;
   TString timeCalname, ampCalname, ledCalname, qtcCalname;
   TString qt1name, qt0name, qt1Calname, qt0Calname;
 
-  TH1F* fhRefPoint = new TH1F("hRefPoint","Ref Point", 10,1252170, 1252180);
-  Add2RawsList( fhRefPoint,0, expert, image, !saveCorr);
+  TH1F* fhRefPoint = new TH1F("hRefPoint","Ref Point", 20000,1230000, 1250000);
+  Add2RawsList( fhRefPoint,0, expert, !image, !saveCorr);
    
   TH1F *fhRawCFD[24]; TH1F * fhRawLEDamp[24];
   TH1F *fhRawQTC[24]; TH1F * fhRawLED[24];
@@ -162,6 +167,12 @@ void AliT0QADataMakerRec::InitRaws()
   TH1F *fhRawQTCcal[24];  TH1F * fhRawLEDcal[24];
   TH1F *fhRawQT0cal[24]; TH1F *fhRawQT1cal[24];
   TH1F *fhRawQT1[24]; TH1F *fhRawQT0[24];
+  Double_t lowPhys = 0;
+  Double_t highPhys = 10000;
+  Double_t lowCalib = 0;
+  Double_t highCalib = 10000;
+  Int_t numChPhys=Int_t(highPhys-lowPhys);
+ Int_t numChCalib=Int_t(highCalib-lowCalib);
   
   for (Int_t i=0; i<24; i++)
     {
@@ -177,24 +188,21 @@ void AliT0QADataMakerRec::InitRaws()
       qt0name += i+1;
       qt1name += i+1;
       ledname += i+1;
-      //      fhRawCFD[i] = new TH1F(timename.Data(), Form("%s;CFD [#channels];Counts", timename.Data()),10000,0,10000);
-      fhRawCFD[i] = new TH1F(timename.Data(), Form("%s;CFD [#channels];Counts", timename.Data()),10000,80000,100000);
-      Add2RawsList( fhRawCFD[i],i+1, expert, !image, !saveCorr);
-      fhRawLED[i] = new TH1F(ledname.Data(),  Form("%s;LED[#channels];Counts", ledname.Data()),10000,80000,100000);
+      fhRawCFD[i] = new TH1F(timename.Data(), Form("%s;CFD [#channels];Counts", timename.Data()),numChPhys,lowPhys,highPhys);
+       Add2RawsList( fhRawCFD[i],i+1, expert, !image, !saveCorr);
+      fhRawLED[i] = new TH1F(ledname.Data(),  Form("%s;LED[#channels];Counts", ledname.Data()),numChPhys,lowPhys,highPhys);
       Add2RawsList( fhRawLED[i],i+24+1, expert, !image, !saveCorr);
       fhRawLEDamp[i] = new TH1F(ampname.Data(),  Form("%s;LED-CFD [#channels];Counts", ampname.Data()),1000,0,1000);
       Add2RawsList( fhRawLEDamp[i],i+48+1, expert, !image, !saveCorr);
       fhRawQTC[i] = new TH1F(qtcname.Data(),  Form("%s;QTC[#channels];Counts", qtcname.Data()),10000,0,10000);
       Add2RawsList( fhRawQTC[i],i+72+1, expert, !image, !saveCorr);
-      //      fhRawQT1[i] = new TH1F(qt1name.Data(),  Form("%s;QT1[#channels];Counts", qtcname.Data()),10000,80000,100000);
-      fhRawQT1[i] = new TH1F(qt1name.Data(),  Form("%s;QT1[#channels];Counts", qtcname.Data()),10000,80000,100000);
+      fhRawQT1[i] = new TH1F(qt1name.Data(),  Form("%s;QT1[#channels];Counts", qtcname.Data()),numChPhys,lowPhys,highPhys);
       Add2RawsList( fhRawQT1[i],270+i, expert, !image, !saveCorr);
-      fhRawQT0[i] = new TH1F(qt1name.Data(),  Form("%s;QT0[#channels];Counts", qtcname.Data()),10000,80000,100000);
-      // fhRawQT0[i] = new TH1F(qt1name.Data(),  Form("%s;QT0[#channels];Counts", qtcname.Data()),10000,0,10000);
+      fhRawQT0[i] = new TH1F(qt1name.Data(),  Form("%s;QT0[#channels];Counts", qtcname.Data()),numChPhys,lowPhys,highPhys);
       Add2RawsList( fhRawQT0[i],270+24+i, expert, !image, !saveCorr);
      }
   TH1F* fhRawTrigger = new TH1F("hRawTrigger"," phys triggers;Trigger #;Counts",5,0,5);
-  Add2RawsList(fhRawTrigger ,97, !expert, !image, !saveCorr);
+  Add2RawsList(fhRawTrigger ,97, expert, !image, !saveCorr);
   
   TH1F* fhRawMean = new TH1F("hRawMean","online mean signal, physics event;", 10000,80000,100000);
   Add2RawsList( fhRawMean,98, expert, !image, !saveCorr);
@@ -221,19 +229,19 @@ void AliT0QADataMakerRec::InitRaws()
       qt0Calname += i+1;
       qt1Calname += i+1;
       //     fhRawCFDcal[i] = new TH1F(timeCalname.Data(),  Form("%s;Time ;Counts", timeCalname.Data()),10000,0,10000);
-      fhRawCFDcal[i] = new TH1F(timeCalname.Data(),  Form("%s;Time ;Counts", timeCalname.Data()),10000,60000,80000);
+      fhRawCFDcal[i] = new TH1F(timeCalname.Data(),  Form("%s;Time ;Counts", timeCalname.Data()),numChCalib,lowCalib,highCalib);
       Add2RawsList( fhRawCFDcal[i],101+i+1, expert, !image, !saveCorr);
       //      fhRawLEDcal[i] = new TH1F(ledCalname.Data(),  Form("%s;Time ;Counts", ledCalname.Data()),10000,0,10000);
-     fhRawLEDcal[i] = new TH1F(ledCalname.Data(),  Form("%s;Time ;Counts", ledCalname.Data()),10000,60000,80000);
+     fhRawLEDcal[i] = new TH1F(ledCalname.Data(),  Form("%s;Time ;Counts", ledCalname.Data()),numChCalib,lowCalib,highCalib);
       Add2RawsList( fhRawLEDcal[i],101+i+24+1, expert, !image, !saveCorr);
       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()),10000,0,10000);
       Add2RawsList( fhRawQTCcal[i],101+i+72+1, expert, !image, !saveCorr);
-      fhRawQT0cal[i] = new TH1F(qt0Calname.Data(), Form("%s;Charge ;Counts",qt0Calname.Data()),10000,60000,80000);
+      fhRawQT0cal[i] = new TH1F(qt0Calname.Data(), Form("%s;Charge ;Counts",qt0Calname.Data()),numChCalib,lowCalib,highCalib);
       //fhRawQT0cal[i] = new TH1F(qt0Calname.Data(), Form("%s;Charge ;Counts",qt0Calname.Data()),10000,0,10000);
       Add2RawsList( fhRawQT0cal[i],371+i, expert, !image, !saveCorr);
-      fhRawQT1cal[i] = new TH1F(qt1Calname.Data(), Form("%s;Charge ;Counts",qt1Calname.Data()),10000,60000,80000);
+      fhRawQT1cal[i] = new TH1F(qt1Calname.Data(), Form("%s;Charge ;Counts",qt1Calname.Data()),numChCalib,lowCalib,highCalib);
       //fhRawQT1cal[i] = new TH1F(qt1Calname.Data(), Form("%s;Charge ;Counts",qt1Calname.Data()),10000,0,10000);
       Add2RawsList( fhRawQT1cal[i],i+371+24, expert, !image, !saveCorr);
     }
@@ -256,29 +264,28 @@ void AliT0QADataMakerRec::InitRaws()
   }
 
   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",
-                               10000,60000,80000);
+  TH1F* fhRawMeanCal = new TH1F("hRawMeanCal","online mean signal, calibration event",numChCalib,lowCalib,highCalib);
   Add2RawsList( fhRawMeanCal,198, expert, !image, !saveCorr);
-  TH1F* fhRawVertexCal = new TH1F("hRawVertexCal","online vertex signal, calibration event ",  10000,60000,80000);
+  TH1F* fhRawVertexCal = new TH1F("hRawVertexCal","online vertex signal, calibration event ", numChCalib,lowCalib,highCalib );
   // TH1F* fhRawVertexCal = new TH1F("hRawVertexCal","online vertex signal, calibration event ",  10000,0,10000);
   Add2RawsList( fhRawVertexCal,199, expert, !image, !saveCorr);
-  TH1F* fhRawORAcal = new TH1F("hRawORAcal","laser OR A; counts", 10000,60000,80000);
+  TH1F* fhRawORAcal = new TH1F("hRawORAcal","laser OR A; counts", numChCalib,lowCalib,highCalib);
   // 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,60000,80000);
+  TH1F* fhRawORCcal = new TH1F("hRawORCcal","laserOR C;counts ", numChCalib,lowCalib,highCalib);
   // TH1F* fhRawORCcal = new TH1F("hRawORCcal","laserOR C;counts ", 10000,0,10000);
   Add2RawsList( fhRawORCcal,201, expert, !image, !saveCorr);
 
   //multiplicity trigger
-  TH1F* fhMultcal = new TH1F("hMultcal","full mulltiplicity;Multiplicity;Entries", 10000,60000,80000);
+  TH1F* fhMultcal = new TH1F("hMultcal","full mulltiplicity;Multiplicity;Entries", numChCalib,lowCalib,highCalib);
   Add2RawsList( fhMultcal,202, expert, !image, !saveCorr );
-  TH1F* fhMultScal = new TH1F("hMultScal","full multiplicity with semi-central trigger;Multiplicity;Entries",
-                             10000,60000,80000);
+  TH1F* fhMultScal = new TH1F("hMultSemical","full multiplicity with semi-central trigger;Multiplicity;Entries",
+                             numChCalib,lowCalib,highCalib);
   Add2RawsList( fhMultScal,203, expert, !image, !saveCorr);
-  TH1F* fhMultCcal = new TH1F("hMultCcal","full multiplicity with central trigger;Multiplicity;Entries", 
-                             10000,60000,80000);
+  TH1F* fhMultCcal = new TH1F("hMultCentrcal","full multiplicity with central trigger;Multiplicity;Entries", 
+                             numChCalib,lowCalib,highCalib);
   Add2RawsList( fhMultCcal,204, expert, !image, !saveCorr);
 
 
@@ -289,14 +296,12 @@ void AliT0QADataMakerRec::InitRaws()
   TH1F* fhEffQTC = new TH1F("hEffQTC","#PMT; QTC efficiency%s;",24, 0 ,24);
   Add2RawsList( fhEffQTC,207, !expert, image, !saveCorr);
 
-  TH2F* fhCFDcal = new TH2F("hCFDcal","CFD laser; #PMT; CFD {#channnels}",25, 0 ,25, 5000,60000,80000);
-  //TH2F* fhCFDcal = new TH2F("hCFDcal","CFD laser; #PMT; CFD {#channnels}",25, 0 ,25, 2000,0,10000);
+  TH2F* fhCFDcal = new TH2F("hCFDcal","CFD laser; #PMT; CFD {#channnels}",25, 0 ,25, numChCalib/2,lowCalib,highCalib);
   fhCFDcal->SetOption("COLZ");
-  Add2RawsList( fhCFDcal,208, expert, image, !saveCorr);
-  TH2F* fhLEDcal = new TH2F("hLEDcal","LED laser; #PMT; LED [#channnels]",25, 0 ,25, 5000,60000,80000);
-  // TH2F* fhLEDcal = new TH2F("hLEDcal","LED laser; #PMT; LED [#channnels]",25, 0 ,25, 2000,0,10000);
+  Add2RawsList( fhCFDcal,208, !expert, image, !saveCorr);
+  TH2F* fhLEDcal = new TH2F("hLEDcal","LED laser; #PMT; LED [#channnels]",25, 0 ,25, numChCalib/2,lowCalib,highCalib);
   fhLEDcal->SetOption("COLZ");
-  Add2RawsList( fhLEDcal,209, expert, image, !saveCorr);
+  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++) {
@@ -398,11 +403,13 @@ void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
            refpoint = allData[0][0] - 5000;
     
       for (Int_t ik = 0; ik<12; ik++){
+       //      for (Int_t iHt=0; iHt<1; iHt++){
        for (Int_t iHt=0; iHt<5; iHt++){
          //cfd
          if(allData[ik+1][iHt]>0) {
            GetRawsData(shift+ik+1) -> Fill(allData[ik+1][iHt]-refpoint);
            GetRawsData(shift+ik+220) -> Fill(allData[ik+1][iHt]-allData[1][0]);
+           //      cout<<"C  cfd "<<ik<<" "<<iHt<<" "<<allData[ik+1][iHt]<<" -RF "<<refpoint<<"  "<<allData[ik+1][iHt]-refpoint<<endl;
            if(type == 8  ) {
              feffC[ik]++;
              GetRawsData(208)->Fill(ik+1, allData[ik+1][iHt]-refpoint);
@@ -411,6 +418,7 @@ void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
          //led
          if(allData[ik+13][iHt] > 0) { 
            GetRawsData(shift+ik+24+1)->  Fill(allData[ik+13][iHt]-refpoint);
+           //      cout<<"C  led "<<ik<<" "<<iHt<<" "<<allData[ik+1][iHt]<<" -RF "<<refpoint<<"  "<<allData[ik+13][iHt]-refpoint<<endl;
            if(type == 8  ) {
              feffA[ik]++;
              GetRawsData(209)->Fill(ik+1, allData[ik+13][iHt]-refpoint);
@@ -421,24 +429,28 @@ void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
          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) {
            GetRawsData(shift+ik+72+1)->
-             Fill(allData[2*ik+26][iHt]-allData[2*ik+25][iHt]);
-           GetRawsData(shift+ik+270)->Fill(allData[2*ik+26][iHt]);
-           GetRawsData(shift+ik+24+270)->Fill(allData[2*ik+25][iHt]);
+             Fill(allData[2*ik+25][iHt]-allData[2*ik+26][iHt]);
+           GetRawsData(shift+ik+270)->Fill(allData[2*ik+26][iHt] - refpoint);
+           GetRawsData(shift+ik+24+270)->Fill(allData[2*ik+25][iHt] - refpoint);
 
            if(type == 8  ) feffqtc[ik]++;
          }
        }
       }
       for (Int_t ik = 12; ik<24; ik++) {
+       //      for (Int_t iHt=0; iHt<1; iHt++) {
        for (Int_t iHt=0; iHt<5; iHt++) {
          if(allData[ik+45][iHt]>0) {
            //cfd
            GetRawsData(shift+ik+1)->
              Fill(allData[ik+45][iHt]-refpoint);
            GetRawsData(shift+ik+220) -> Fill(allData[ik+45][iHt]-allData[57][0]);
+
+           //      cout<<"A  cfd "<<ik<<" "<<iHt<<" "<<allData[ik+1][iHt]<<" -RF "<<refpoint<<"  "<<allData[ik+1][iHt]-refpoint<<endl;
            if(type == 8  ) {
              feffC[ik]++;
              GetRawsData(208)->Fill(ik+1, allData[ik+45][iHt]-refpoint);
@@ -447,6 +459,7 @@ void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
          //led
          if(allData[ik+57][iHt] > 0 ) {
            GetRawsData(shift+ik+24+1)->Fill(allData[ik+57][iHt]-refpoint);
+           //   cout<<"C  led "<<ik<<" "<<iHt<<" "<<allData[ik+1][iHt]<<" -RF "<<refpoint<<"  "<<allData[ik+13][iHt]-refpoint<<endl;
            if(type == 8  ) {
              feffA[ik]++;
              GetRawsData(209)->Fill(ik+1, allData[ik+57][iHt]-refpoint);
@@ -455,10 +468,9 @@ void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
            //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]);
-             
-             GetRawsData(shift+ik+270)->Fill(allData[2*ik+26][iHt]);
-             GetRawsData(shift+ik+24+270)->Fill(allData[2*ik+25][iHt]);
+             GetRawsData(shift+ik+72+1)-> Fill(allData[2*ik+57][iHt]-allData[2*ik+58][iHt]);
+             GetRawsData(shift+ik+270)->Fill(allData[2*ik+58][iHt]-refpoint);
+             GetRawsData(shift+ik+24+270)->Fill(allData[2*ik+57][iHt]-refpoint);
              if(type == 8  )  feffqtc[ik]++;
            } 
          //led-cfd
@@ -476,7 +488,7 @@ void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
            for (Int_t itr=0; itr<6; itr++) {
              if(allData[trChannel[itr]][iHt]>0) {
                fNumTriggers[itr]++;
-               GetRawsData(98+itr)->Fill(allData[trChannel[itr]][iHt]);
+               GetRawsData(98+itr)->Fill(allData[trChannel[itr]][iHt]-refpoint);
              }
            }
          }
@@ -489,7 +501,7 @@ void AliT0QADataMakerRec::MakeRaws( AliRawReader* rawReader)
                if(allData[trChannel[itr]][iHt]>0)
                  {
                    
-                   GetRawsData(198+itr)->Fill(allData[trChannel[itr]][iHt]);
+                   GetRawsData(198+itr)->Fill(allData[trChannel[itr]][iHt]-refpoint);
                    fNumTriggersCal[itr]++;
                  }
              }