]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New histos for raws and setters for calib object
authormbroz <Michal.Broz@cern.ch>
Fri, 26 Sep 2014 13:42:19 +0000 (15:42 +0200)
committermbroz <Michal.Broz@cern.ch>
Fri, 26 Sep 2014 13:42:19 +0000 (15:42 +0200)
AD/AliADCalibData.cxx
AD/AliADCalibData.h
AD/AliADQADataMakerRec.cxx
AD/AliADQADataMakerRec.h

index 65e64daac25de053f5541a317bb3200222eddf2b..87d744fd0d10729c1a714ec6debee484bcc5225f 100644 (file)
@@ -41,7 +41,7 @@ AliADCalibData::AliADCalibData():
     for(int t=0; t<16; t++) {
         fMeanHV[t]      = 100.0;
         fWidthHV[t]     = 0.0; 
-       fTimeOffset[t]  = 5.0;
+       fTimeOffset[t]  = 0.0;
         fTimeGain[t]    = 1.0;
        fDeadChannel[t]= kFALSE;
        fDiscriThr[t]  = 2.5;
@@ -293,3 +293,356 @@ Float_t AliADCalibData::GetCalibDiscriThr(Int_t channel, Bool_t scaled)
 
   return calThr;
 }
+
+//_____________________________________________________________________________
+void AliADCalibData::SetParameter(TString name, Int_t val){
+       // Set given parameter
+       
+       Int_t iBoard = -1;
+       Int_t iChannel = -1;
+
+       TSeqCollection* nameSplit = name.Tokenize("/");
+       TObjString * boardName = (TObjString *)nameSplit->At(2);
+       sscanf(boardName->String().Data(),"CIU%d",&iBoard);
+
+       TString paramName = ((TObjString *)nameSplit->At(3))->String();
+       Char_t channel[2] ; channel[1] = '\0';
+       channel[0] = paramName[paramName.Sizeof()-2];
+       sscanf(channel,"%d",&iChannel);
+               
+       if(name.Contains("TimeResolution")) SetTimeResolution((UShort_t) val,iBoard);
+       else if(name.Contains("WidthResolution")) SetWidthResolution((UShort_t) val,iBoard);
+       else if(name.Contains("MatchWindow")) SetMatchWindow((UInt_t) val,iBoard);
+       else if(name.Contains("SearchWindow")) SetSearchWindow((UInt_t) val,iBoard);
+       else if(name.Contains("TriggerCountOffset")) SetTriggerCountOffset((UInt_t) val,iBoard);
+       else if(name.Contains("RollOver")) SetRollOver((UInt_t) val,iBoard);
+       else if(name.Contains("DelayHit")) SetTimeOffset(0.01*(Float_t)val,iBoard,(iChannel-1));
+       else if(name.Contains("DiscriThr")) SetDiscriThr(((Float_t)val-2040.)/112.,iBoard,(iChannel-1));
+       else AliError(Form("No Setter found for FEE parameter : %s",name.Data()));
+       //
+       delete nameSplit;
+}
+
+//________________________________________________________________
+void AliADCalibData::SetPedestal(const Float_t* Pedestal)
+{
+  if(Pedestal) for(int t=0; t<32; t++) fPedestal[t] = Pedestal[t];
+  else for(int t=0; t<32; t++) fPedestal[t] = 0.0;
+}
+
+//________________________________________________________________
+void AliADCalibData::SetSigma(const Float_t* Sigma)
+{
+  if(Sigma) for(int t=0; t<32; t++) fSigma[t] = Sigma[t];
+  else for(int t=0; t<32; t++) fSigma[t] = 0.0;
+}
+
+//________________________________________________________________
+void AliADCalibData::SetADCmean(const Float_t* ADCmean) 
+{
+  if(ADCmean) for(int t=0; t<32; t++) fADCmean[t] = ADCmean[t];
+  else for(int t=0; t<32; t++) fADCmean[t] = 0.0;
+}
+
+//________________________________________________________________
+void AliADCalibData::SetADCsigma(const Float_t* ADCsigma) 
+{
+  if(ADCsigma) for(int t=0; t<32; t++) fADCsigma[t] = ADCsigma[t];
+  else for(int t=0; t<32; t++) fADCsigma[t] = 0.0;
+}
+
+//________________________________________________________________
+void AliADCalibData::SetMeanHV(const Float_t* MeanHV) 
+{
+  if(MeanHV) for(int t=0; t<16; t++) fMeanHV[t] = MeanHV[t];
+  else for(int t=0; t<16; t++) fMeanHV[t] = 0.0;
+}
+
+//________________________________________________________________
+void AliADCalibData::SetWidthHV(const Float_t* WidthHV) 
+{
+  if(WidthHV) for(int t=0; t<16; t++) fWidthHV[t] = WidthHV[t];
+  else for(int t=0; t<16; t++) fWidthHV[t] = 0.0;
+}
+
+//________________________________________________________________
+void AliADCalibData::SetDeadMap(const Bool_t* deadMap) 
+{
+  if(deadMap) for(int t=0; t<16; t++) fDeadChannel[t] = deadMap[t];
+  else for(int t=0; t<16; t++) fDeadChannel[t] = kFALSE;
+}
+
+//________________________________________________________________
+void AliADCalibData::SetTimeOffset(Float_t val, Int_t board, Int_t channel)
+{
+  Int_t ch = AliADCalibData::GetOfflineChannelNumber(board,channel);
+  if(ch >= 0){
+    fTimeOffset[ch]=val;
+    AliInfo(Form("Time offset for channel %d set to %f",ch,fTimeOffset[ch]));
+  }
+  else
+    AliError("Board/Channel numbers are not valid");
+}
+
+//________________________________________________________________
+void AliADCalibData::SetTimeOffset(const Float_t* TimeOffset) 
+{
+  if(TimeOffset) for(int t=0; t<16; t++) fTimeOffset[t] = TimeOffset[t];
+  else for(int t=0; t<16; t++) fTimeOffset[t] = 5.0;
+}
+//________________________________________________________________
+void AliADCalibData::SetTimeGain(const Float_t* TimeGain) 
+{
+  if(TimeGain) for(int t=0; t<16; t++) fTimeGain[t] = TimeGain[t];
+  else for(int t=0; t<16; t++) fTimeGain[t] = 0.0;
+}
+//________________________________________________________________
+void AliADCalibData::SetTimeResolution(UShort_t *resols){
+       // Set Time Resolution of the TDC
+       if(resols)  for(int t=0; t<kNCIUBoards; t++) SetTimeResolution(resols[t],t);
+       else AliError("Time Resolution not defined.");
+       
+}
+//________________________________________________________________
+void AliADCalibData::SetTimeResolution(UShort_t resol, Int_t board)
+{
+       // Set Time Resolution of the TDC
+       if((board>=0) && (board<kNCIUBoards)) {
+               switch(resol){
+                       case 0:
+                               fTimeResolution[board] = 25./256.;
+                               break;
+                       case 1:
+                               fTimeResolution[board] = 25./128.;
+                               break;
+                       case 2:
+                               fTimeResolution[board] = 25./64.;
+                               break;
+                       case 3:
+                               fTimeResolution[board] = 25./32.;
+                               break;
+                       case 4:
+                               fTimeResolution[board] = 25./16.;
+                               break;
+                       case 5:
+                               fTimeResolution[board] = 25./8.;
+                               break;
+                       case 6:
+                               fTimeResolution[board] = 6.25;
+                               break;
+                       case 7:
+                               fTimeResolution[board] = 12.5;
+                               break;
+               }
+               AliInfo(Form("Time Resolution of board %d set to %f",board,fTimeResolution[board]));
+       } else AliError(Form("Board %d is not valid",board));
+}
+//________________________________________________________________
+void AliADCalibData::SetWidthResolution(UShort_t *resols){
+       // Set Time Width Resolution of the TDC
+       if(resols)  for(int t=0; t<kNCIUBoards; t++) SetWidthResolution(resols[t],t);
+       else AliError("Width Resolution not defined.");
+       
+}
+//________________________________________________________________
+void AliADCalibData::SetWidthResolution(UShort_t resol, Int_t board)
+{
+       // Set Time Width Resolution of the TDC
+       if((board>=0) && (board<kNCIUBoards)){
+               switch(resol){
+                       case 0:
+                               fWidthResolution[board] = 25./256.;
+                               break;
+                       case 1:
+                               fWidthResolution[board] = 25./128.;
+                               break;
+                       case 2:
+                               fWidthResolution[board] = 25./64.;
+                               break;
+                       case 3:
+                               fWidthResolution[board] = 25./32.;
+                               break;
+                       case 4:
+                               fWidthResolution[board] = 25./16.;
+                               break;
+                       case 5:
+                               fWidthResolution[board] = 25./8.;
+                               break;
+                       case 6:
+                               fWidthResolution[board] = 6.25;
+                               break;
+                       case 7:
+                               fWidthResolution[board] = 12.5;
+                               break;
+                       case 8:
+                               fWidthResolution[board] = 25.;
+                               break;
+                       case 9:
+                               fWidthResolution[board] = 50.;
+                               break;
+                       case 10:
+                               fWidthResolution[board] = 100.;
+                               break;
+                       case 11:
+                               fWidthResolution[board] = 200.;
+                               break;
+                       case 12:
+                               fWidthResolution[board] = 400.;
+                               break;
+                       case 13:
+                               fWidthResolution[board] = 800.;
+                               break;
+                               
+               }
+               AliInfo(Form("Width Resolution of board %d set to %f",board,fWidthResolution[board]));
+       }else AliError(Form("Board %d is not valid",board));
+}
+
+//________________________________________________________________
+void AliADCalibData::SetMatchWindow(UInt_t *windows)
+{
+  // Set Match window of the HPTDC
+  // The units are 25ns
+  if(windows)  for(Int_t b=0; b<kNCIUBoards; b++) SetMatchWindow(windows[b],b);
+  else AliError("Match windows not defined.");
+}
+
+//________________________________________________________________
+void AliADCalibData::SetMatchWindow(UInt_t window, Int_t board)
+{
+  // Set Match window of the HPTDC
+  // The units are 25ns
+  if((board>=0) && (board<kNCIUBoards)){
+    fMatchWindow[board] = window;
+    AliInfo(Form("Match window of board %d set to %d",board,fMatchWindow[board]));
+  }
+  else
+    AliError(Form("Board %d is not valid",board));
+}
+
+//________________________________________________________________
+void AliADCalibData::SetSearchWindow(UInt_t *windows)
+{
+  // Set Search window of the HPTDC
+  // The units are 25ns
+  if(windows)  for(Int_t b=0; b<kNCIUBoards; b++) SetSearchWindow(windows[b],b);
+  else AliError("Search windows not defined.");
+}
+
+//________________________________________________________________
+void  AliADCalibData::SetSearchWindow(UInt_t window, Int_t board)
+{
+  // Set Search window of the HPTDC
+  // The units are 25ns
+  if((board>=0) && (board<kNCIUBoards)){
+    fSearchWindow[board] = window;
+    AliInfo(Form("Search window of board %d set to %d",board,fSearchWindow[board]));
+  }
+  else
+    AliError(Form("Board %d is not valid",board));
+}
+
+//________________________________________________________________
+void AliADCalibData::SetTriggerCountOffset(UInt_t *offsets)
+{
+  // Set trigger-count offset of the HPTDC
+  // The units are 25ns
+  if(offsets)  for(Int_t b=0; b<kNCIUBoards; b++) SetTriggerCountOffset(offsets[b],b);
+  else AliError("Trigger count offsets not defined.");
+}
+
+//________________________________________________________________
+void AliADCalibData::SetTriggerCountOffset(UInt_t offset, Int_t board)
+{
+  // Set trigger-count offsets of the HPTDC
+  // The units are 25ns
+  if((board>=0) && (board<kNCIUBoards)){
+    fTriggerCountOffset[board] = offset;
+    AliInfo(Form("Trigger-count offset of board %d set to %d",board,fTriggerCountOffset[board]));
+  }
+  else
+    AliError(Form("Board %d is not valid",board));
+}
+
+//________________________________________________________________
+void AliADCalibData::SetRollOver(UInt_t *offsets)
+{
+  // Set Roll-over of the HPTDC
+  // The units are 25ns
+  if(offsets)  for(Int_t b=0; b<kNCIUBoards; b++) SetRollOver(offsets[b],b);
+  else AliError("Roll-over offsets not defined.");
+}
+
+//________________________________________________________________
+void AliADCalibData::SetRollOver(UInt_t offset, Int_t board)
+{
+  // Set Roll-over of the HPTDC
+  // The units are 25ns
+  if((board>=0) && (board<kNCIUBoards)){
+    fRollOver[board] = offset;
+    AliInfo(Form("Roll-over offset of board %d set to %d",board,fRollOver[board]));
+  }
+  else
+    AliError(Form("Board %d is not valid",board));
+}
+
+//________________________________________________________________
+void AliADCalibData::SetDiscriThr(Float_t thr, Int_t board, Int_t channel)
+{
+  // Set the TDC discriminator
+  // threshold values expressed in units of ADC
+  Int_t ch = AliADCalibData::GetOfflineChannelNumber(board,channel);
+  if(ch >= 0){
+    if (thr > 0) {
+      fDiscriThr[ch]=thr;
+      AliInfo(Form("Discriminator threshold for channel %d set to %f",ch,fDiscriThr[ch]));
+    }
+    else {
+      AliWarning(Form("Ignore wrong threshold value (%f) for channel %d !",thr,ch));
+    }
+  }
+  else
+    AliError("Board/Channel numbers are not valid");
+}
+
+//________________________________________________________________
+void AliADCalibData::SetDiscriThr(const Float_t* thresholds) 
+{
+  // Set the TDC discriminator
+  // threshold values expressed in units of ADC
+  if(thresholds) for(int t=0; t<16; t++) fDiscriThr[t] = thresholds[t];
+  else for(int t=0; t<16; t++) fDiscriThr[t] = 2.5;
+}
+
+//________________________________________________________________
+Int_t AliADCalibData::GetOfflineChannelNumber(Int_t board, Int_t channel)
+{
+  // Get the offline channel number from
+  // the FEE board and channel indexes
+
+  if (board < 0 || board >= 2) {
+    AliErrorClass(Form("Wrong FEE board number: %d",board));
+    return -1;
+  }
+  if (channel < 0 || channel >= 8) {
+    AliErrorClass(Form("Wrong FEE channel number: %d",channel));
+    return -1;
+  }
+
+  Int_t offCh = (board+1)*channel;
+
+  return offCh;
+}
+//________________________________________________________________
+Int_t AliADCalibData::GetFEEChannelNumber(Int_t channel)
+{
+  // Get FEE channel number
+  // from offline channel index
+  if (channel >= 0 && channel < 16) return ((channel % 8));
+
+  AliErrorClass(Form("Wrong channel index: %d",channel));
+  return -1;
+}
+
+
+
index e0aab0d3a18a7d32a13cb209dc79ad0808256f3f..6089ab471cc48641fd7dafbe8de36b6c68db5a1e 100644 (file)
@@ -55,15 +55,54 @@ class AliADCalibData: public TNamed {
 
   Float_t  GetDiscriThr(Int_t channel) const {return fDiscriThr[channel];}
   Float_t* GetDiscriThr()   const {return (Float_t*)fDiscriThr;}
+  Float_t  GetCalibDiscriThr(Int_t channel, Bool_t scaled);
 
   static Int_t GetBoardNumber(Int_t channel);
+  static Int_t GetFEEChannelNumber(Int_t channel);
+  static Int_t GetOfflineChannelNumber(Int_t board, Int_t channel);
   
   Float_t  GetLightYields(Int_t channel);
 
   Float_t *GetPMGainsA() const { return fPMGainsA; }
   Float_t *GetPMGainsB() const { return fPMGainsB; }
 
-  Float_t  GetCalibDiscriThr(Int_t channel, Bool_t scaled);
+  void     SetPedestal(Float_t val, Int_t channel) {fPedestal[channel]=val;}
+  void     SetPedestal(const Float_t* Pedestal);
+  void     SetSigma(Float_t val, Int_t channel) {fSigma[channel]=val;}
+  void     SetSigma(const Float_t* Sigma);
+  void            SetADCmean(Float_t val, Int_t channel) {fADCmean[channel]=val;}
+  void            SetADCmean(const Float_t* ADCmean);  
+  void            SetADCsigma(Float_t val, Int_t channel) {fADCsigma[channel]=val;}
+  void            SetADCsigma(const Float_t* ADCsigma);
+  void     SetMeanHV(Float_t val, Int_t channel) {fMeanHV[channel]=val;}
+  void     SetMeanHV(const Float_t* MeanHV);  
+  void     SetWidthHV(Float_t val, Int_t channel) {fWidthHV[channel]=val;}
+  void     SetWidthHV(const Float_t* WidthHV); 
+  void     SetDeadChannel(Bool_t val, Int_t channel) {fDeadChannel[channel]=val;}
+  void     SetDeadMap(const Bool_t* deadMap);  
+   
+  void     SetTimeOffset(Float_t val, Int_t board, Int_t channel);
+  void     SetTimeOffset(const Float_t* TimeOffset);
+  void     SetTimeGain(Float_t val, Int_t channel) {fTimeGain[channel]=val;}
+  void     SetTimeGain(const Float_t* TimeGain);
+  
+  void            SetParameter(TString name, Int_t val);
+  void     SetTimeResolution(UShort_t *resols);
+  void     SetTimeResolution(UShort_t resol, Int_t board);
+  void     SetWidthResolution(UShort_t *resols);
+  void     SetWidthResolution(UShort_t resol, Int_t board);
+
+  void     SetMatchWindow(UInt_t *windows);
+  void     SetMatchWindow(UInt_t window, Int_t board);
+  void     SetSearchWindow(UInt_t *windows);
+  void     SetSearchWindow(UInt_t window, Int_t board);
+  void     SetTriggerCountOffset(UInt_t *offsets);
+  void     SetTriggerCountOffset(UInt_t offset, Int_t board);
+  void     SetRollOver(UInt_t *offsets);
+  void     SetRollOver(UInt_t offset, Int_t board);
+
+  void     SetDiscriThr(Float_t thr, Int_t board, Int_t channel);
+  void     SetDiscriThr(const Float_t* thresholds);
 
 
  protected:
index eb534f3a190596d49ec9a39c7c3300b16dc65e2a..6b302e64100bea1ee9713ac4129f3310a9afede4 100644 (file)
@@ -145,7 +145,7 @@ void AliADQADataMakerRec::StartOfDetectorCycle()
   if (!entry1) AliFatal("CTP time-alignment is not found in OCDB !");
   AliCTPTimeParams *ctpTimeAlign = (AliCTPTimeParams*)entry1->GetObject();
   l1Delay += ((Float_t)ctpTimeAlign->GetDelayL1L0()*25.0);
-
+  /*/
   AliCDBEntry *entry2 = AliCDBManager::Instance()->Get("AD/Calib/TimeDelays");
   if (!entry2) AliFatal("AD time delays are not found in OCDB !");
   TH1F *delays = (TH1F*)entry2->GetObject();
@@ -153,7 +153,7 @@ void AliADQADataMakerRec::StartOfDetectorCycle()
   AliCDBEntry *entry3 = AliCDBManager::Instance()->Get("AD/Calib/TimeSlewing");
   if (!entry3) AliFatal("AD time slewing function is not found in OCDB !");
   fTimeSlewing = (TF1*)entry3->GetObject();
-
+  /*/
 
   for(Int_t i = 0 ; i < 16; ++i) {
     //Int_t board = AliADCalibData::GetBoardNumber(i);
@@ -162,8 +162,9 @@ void AliADQADataMakerRec::StartOfDetectorCycle()
                      //        (Float_t)fCalibData->GetRollOver(board))*25.0 +
                      //     fCalibData->GetTimeOffset(i) -
                      //     l1Delay+
-                     delays->GetBinContent(i+1)//+
+                     //delays->GetBinContent(i+1)//+
                      //      kV0Offset
+                     0
                      );
     //               AliInfo(Form(" fTimeOffset[%d] = %f  kV0offset %f",i,fTimeOffset[i],kV0Offset));
   }
@@ -256,7 +257,10 @@ void AliADQADataMakerRec::InitRaws()
   const Float_t kChannelMax    =   16;
   const Int_t kNPedestalBins =  200;
   const Float_t kPedestalMin   =    0;
-  const Float_t kPedestalMax   =  200;
+  const Float_t kPedestalMax   =  200; 
+  const Int_t kNPairBins  =   8;
+  const Float_t kPairMin    =    0;
+  const Float_t kPairMax    =   8;
 
   TH2I * h2i;
   TH2F * h2d;
@@ -266,9 +270,9 @@ void AliADQADataMakerRec::InitRaws()
   int iHisto =0;
 
   // Creation of Cell Multiplicity Histograms
-  h1i = new TH1I("H1I_Multiplicity_ADA", "Cell Multiplicity in ADA;# of Cells;Entries", 35, 0, 35) ;  
+  h1i = new TH1I("H1I_Multiplicity_ADA", "Number of fired cells in ADA;# of Cells;Entries", 10, 0, 10) ;  
   Add2RawsList(h1i,kMultiADA, !expert, image, saveCorr);   iHisto++;
-  h1i = new TH1I("H1I_Multiplicity_ADC", "Cell Multiplicity in ADC;# of Cells;Entries", 35, 0, 35) ;  
+  h1i = new TH1I("H1I_Multiplicity_ADC", "Number of fired cells in ADC;# of Cells;Entries", 10, 0, 10) ;  
   Add2RawsList(h1i,kMultiADC, !expert, image, saveCorr);   iHisto++;
  
   // Creation of Total Charge Histograms
@@ -318,7 +322,16 @@ void AliADQADataMakerRec::InitRaws()
   h2d = new TH2F("H2D_TimeADA_ADC", "Mean Time in ADC versus ADA;Time ADA [ns];Time ADC [ns]", kNTdcTimeBins/8, kTdcTimeMin,kTdcTimeMax,kNTdcTimeBins/8, kTdcTimeMin,kTdcTimeMax) ;  
   Add2RawsList(h2d,kTimeADAADC, !expert, image, saveCorr);   iHisto++;
   
+  //Creation of pair coincidence histograms
+  h1i = new TH1I("H1I_MultiCoincidence_ADA", "Number of coincidences in ADA;# of Cells;Entries", 5, 0, 5) ;  
+  Add2RawsList(h1i,kNCoincADA, !expert, image, saveCorr);   iHisto++;
+  h1i = new TH1I("H1I_MultiCoincidence_ADC", "Number of coincidences in ADC;# of Cells;Entries", 5, 0, 5) ;  
+  Add2RawsList(h1i,kNCoincADC, !expert, image, saveCorr);   iHisto++;
+  
+  h2d = new TH2F("H2D_Pair_Diff_Time","Diff Pair Time;Time [ns];Counts",kNPairBins, kPairMin, kPairMax,kNTdcTimeBins, -50., 50.);
+  Add2RawsList(h2d,kPairDiffTime, !expert, image, saveCorr); iHisto++;
 
+  
   AliDebug(AliQAv1::GetQADebugLevel(), Form("%d Histograms has been added to the Raws List",iHisto));
   //
   ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
@@ -348,6 +361,10 @@ void AliADQADataMakerRec::MakeRaws(AliRawReader* rawReader)
   Double_t chargeADA=0., chargeADC=0.;
 
   Double_t diffTime=-100000.;
+  
+  Int_t           pmulADA = 0;
+  Int_t           pmulADC = 0;
+  Double_t pDiffTime =-100000.;
 
   
   switch (eventType){
@@ -357,12 +374,13 @@ void AliADQADataMakerRec::MakeRaws(AliRawReader* rawReader)
 
     Int_t  iFlag=0;
     Int_t  pedestal;
-    Int_t  integrator;
+    Int_t  integrator[16];
     Bool_t flagBB[16];  
     Bool_t flagBG[16];  
     Float_t charge;
     Int_t  offlineCh;
     Float_t adc[16], time[16], width[16], timeCorr[16]; 
+    Int_t  iPair=0;
 
     for(Int_t iChannel=0; iChannel<16; iChannel++) { // BEGIN : Loop over channels
                   
@@ -377,9 +395,9 @@ void AliADQADataMakerRec::MakeRaws(AliRawReader* rawReader)
       if(iFlag == 0){ //No Flag found
        for(Int_t j=15; j<21; j++){
          pedestal= (Int_t) rawStream->GetPedestal(iChannel, j);
-         integrator = rawStream->GetIntegratorFlag(iChannel, j);
+         integrator[offlineCh] = rawStream->GetIntegratorFlag(iChannel, j);
 
-         FillRawsData((integrator == 0 ? kPedestalInt0 : kPedestalInt1),offlineCh,pedestal);
+         FillRawsData((integrator[offlineCh] == 0 ? kPedestalInt0 : kPedestalInt1),offlineCh,pedestal);
        }
       }
 
@@ -394,7 +412,7 @@ void AliADQADataMakerRec::MakeRaws(AliRawReader* rawReader)
       Float_t adcPedSub[21];
       for(Int_t iClock=0; iClock<21; iClock++){
        Bool_t iIntegrator = rawStream->GetIntegratorFlag(iChannel,iClock);
-       Int_t k = offlineCh+64*iIntegrator;
+       Int_t k = offlineCh+16*iIntegrator;
 
        //printf(Form("clock = %d adc = %f ped %f\n",iClock,rawStream->GetPedestal(iChannel,iClock),fPedestal[k]));
 
@@ -428,7 +446,7 @@ void AliADQADataMakerRec::MakeRaws(AliRawReader* rawReader)
       Int_t iClock  = imax;
       charge = rawStream->GetPedestal(iChannel,iClock); // Charge at the maximum 
 
-      integrator    = rawStream->GetIntegratorFlag(iChannel,iClock);
+      integrator[offlineCh]    = rawStream->GetIntegratorFlag(iChannel,iClock);
       flagBB[offlineCh]         = rawStream->GetBBFlag(iChannel, iClock);
       flagBG[offlineCh]         = rawStream->GetBGFlag(iChannel,iClock );
       Int_t board = AliADCalibData::GetBoardNumber(offlineCh);
@@ -437,9 +455,9 @@ void AliADQADataMakerRec::MakeRaws(AliRawReader* rawReader)
 
       if (time[offlineCh] >= 1e-6) FillRawsData(kChargeEoI,offlineCh,adc[offlineCh]);
 
-      FillRawsData((integrator == 0 ? kChargeEoIInt0 : kChargeEoIInt1),offlineCh,charge);
+      FillRawsData((integrator[offlineCh] == 0 ? kChargeEoIInt0 : kChargeEoIInt1),offlineCh,charge);
 
-      Float_t sigma = fCalibData->GetSigma(offlineCh+16*integrator);
+      Float_t sigma = fCalibData->GetSigma(offlineCh+16*integrator[offlineCh]);
                  
       if((adc[offlineCh] > 2.*sigma) && !(time[offlineCh] <1.e-6)){ 
        if(offlineCh<8) {
@@ -460,12 +478,13 @@ void AliADQADataMakerRec::MakeRaws(AliRawReader* rawReader)
       const Float_t p2 = 3.00; // sleewing related term in the time resolution
       if(timeCorr[offlineCh]>-1024 + 1.e-6){
        Float_t nphe = adc[offlineCh]*kChargePerADC/(fCalibData->GetGain(offlineCh)*TMath::Qe());
-       Float_t timeErr = 0;
+       Float_t timeErr = 1;
+       /*/
        if (nphe>1.e-6) timeErr = TMath::Sqrt(kIntTimeRes*kIntTimeRes+
                                              p1*p1/nphe+
                                              p2*p2*(fTimeSlewing->GetParameter(0)*fTimeSlewing->GetParameter(1))*(fTimeSlewing->GetParameter(0)*fTimeSlewing->GetParameter(1))*
                                              TMath::Power(adc[offlineCh]/fCalibData->GetCalibDiscriThr(offlineCh,kTRUE),2.*(fTimeSlewing->GetParameter(1)-1.))/
-                                             (fCalibData->GetCalibDiscriThr(offlineCh,kTRUE)*fCalibData->GetCalibDiscriThr(offlineCh,kTRUE)));
+                                             (fCalibData->GetCalibDiscriThr(offlineCh,kTRUE)*fCalibData->GetCalibDiscriThr(offlineCh,kTRUE)));/*/
 
        if (timeErr>1.e-6) {
          if (offlineCh<8) {
@@ -483,7 +502,33 @@ void AliADQADataMakerRec::MakeRaws(AliRawReader* rawReader)
       FillRawsData(kWidth,offlineCh,width[offlineCh]);
 
     }// END of Loop over channels
-
+    
+    for(Int_t iChannel=0; iChannel<4; iChannel++) {//Loop over pairs ADC
+       offlineCh = rawStream->GetOfflineChannel(iChannel);
+       Float_t sigma = fCalibData->GetSigma(offlineCh+16*integrator[offlineCh]);
+       Float_t sigma4 = fCalibData->GetSigma(offlineCh+4+16*integrator[offlineCh]);            
+       if( ((adc[offlineCh] > 2.*sigma) && !(time[offlineCh] <1.e-6)) && ((adc[offlineCh+4] > 2.*sigma4) && !(time[offlineCh+4] <1.e-6)) ){ 
+               pmulADC++;
+               if(timeCorr[offlineCh]<-1024.+1.e-6 || timeCorr[offlineCh+4]<-1024.+1.e-6) pDiffTime = -1024.;
+               else pDiffTime = timeCorr[offlineCh+4] - timeCorr[offlineCh]; 
+               FillRawsData(kPairDiffTime,iPair,pDiffTime);
+               iPair++;
+               }
+       }
+    for(Int_t iChannel=8; iChannel<12; iChannel++) {//Loop over pairs ADA
+       offlineCh = rawStream->GetOfflineChannel(iChannel);
+       Float_t sigma = fCalibData->GetSigma(offlineCh+16*integrator[offlineCh]);
+       Float_t sigma4 = fCalibData->GetSigma(offlineCh+4+16*integrator[offlineCh]);
+       if( ((adc[offlineCh] > 2.*sigma) && !(time[offlineCh] <1.e-6)) && ((adc[offlineCh+4] > 2.*sigma4) && !(time[offlineCh+4] <1.e-6)) ) pmulADA++;
+       if(timeCorr[offlineCh]<-1024.+1.e-6 || timeCorr[offlineCh+4]<-1024.+1.e-6) pDiffTime = -1024.;
+               else pDiffTime = timeCorr[offlineCh+4] - timeCorr[offlineCh]; 
+               FillRawsData(kPairDiffTime,iPair,pDiffTime);
+               iPair++;
+       }
+    FillRawsData(kNCoincADA,pmulADA);
+    FillRawsData(kNCoincADC,pmulADC);
+       
+       
     if(weightADA>1.e-6) timeADA /= weightADA; 
     else timeADA = -1024.;
     if(weightADC>1.e-6) timeADC /= weightADC;
@@ -553,12 +598,12 @@ Float_t AliADQADataMakerRec::CorrectLeadingTime(Int_t i, Float_t time, Float_t a
   //AliInfo(Form("time-offset %f", time));
 
   // In case of pathological signals
-  if (adc < 1e-6) return time;
+  //if (adc < 1e-6) return time;
 
   // Slewing correction
-  Float_t thr = fCalibData->GetCalibDiscriThr(i,kTRUE);
+  //Float_t thr = fCalibData->GetCalibDiscriThr(i,kTRUE);
   //AliInfo(Form("adc %f thr %f dtime %f ", adc,thr,fTimeSlewing->Eval(adc/thr)));
-  time -= fTimeSlewing->Eval(adc/thr);
+  //time -= fTimeSlewing->Eval(adc/thr);
 
   return time;
 }
index 6a4bce800bc6142995989dc7a1b67814277fb1ec..11f3524e713905ccab89d2fdfa67481d7b32432f 100644 (file)
@@ -31,7 +31,8 @@ public:
                   kChargeEoI,kChargeEoIInt0,kChargeEoIInt1,
                   kWidth,kHPTDCTime,
                   kMultiADA,kMultiADC,kChargeADA,kChargeADC,kChargeAD, 
-                  kADATime,kADCTime,kDiffTime,kTimeADAADC};
+                  kADATime,kADCTime,kDiffTime,kTimeADAADC,
+                  kNCoincADA,kNCoincADC,kPairDiffTime};
        
 public:
   AliADQADataMakerRec() ;            // constructor
@@ -55,13 +56,13 @@ private:
   virtual void   StartOfDetectorCycle() ; 
   Float_t CorrectLeadingTime(Int_t i, Float_t time, Float_t adc) const;
   
-  Int_t   fEven[64];                  // even charge integrators
-  Int_t   fOdd[64];                   // odd charge intergators
-  Float_t fADCmean[128];              // mean adc per integrator
+  Int_t   fEven[16];                  // even charge integrators
+  Int_t   fOdd[16];                   // odd charge intergators
+  Float_t fADCmean[32];              // mean adc per integrator
   size_t fTrendingUpdateTime;         // trending histos update time
   UInt_t fCycleStartTime;             // timestamp of QA start-of-cycle
   UInt_t fCycleStopTime;              // timestamp of QA end-of-cycle
-  Float_t            fTimeOffset[64]; //! HPTDC time offsets channel by channel
+  Float_t            fTimeOffset[16]; //! HPTDC time offsets channel by channel
   TF1*               fTimeSlewing;    //! Function for time slewing correction
 
   ClassDef(AliADQADataMakerRec,4)  // description