]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding 4 new QA histos:
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Nov 2009 09:41:28 +0000 (09:41 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 27 Nov 2009 09:41:28 +0000 (09:41 +0000)
- Implementation of the re-reconstruction in 3/4 coincidence of the Global decision from the Local inputs (test of the whole electronic chain) -> 1 histo of the percentage of Global output error
- Implementation of the re-reconstruction in 4/4 -> 3 histos related to the ratio 44/34
(Aurelien)

MUON/AliMUONQAIndices.h
MUON/AliMUONTriggerQADataMakerRec.cxx
MUON/AliMUONTriggerQADataMakerRec.h

index 4a614cb0d0bcb11ab31ab2bd3ea4138d337c2312..1a6a97d2c61b2e2d111a63889058eb484d7f4ebe 100644 (file)
@@ -44,9 +44,10 @@ namespace AliMUONQAIndices
     kTriggerErrorLocal2RegionalLPtMSB  = 60, ///< Local to Regional: Number of LPt MSB error vs Local Board Id
     kTriggerErrorLocal2RegionalHPtLSB  = 61, ///< Local to Regional: Number of HPt LSB error vs Local Board Id
     kTriggerErrorLocal2RegionalHPtMSB  = 62, ///< Local to Regional: Number of HPt MSB error vs Local Board Id
-    kTriggerErrorOutGlobalFromInGlobal = 63, ///< Global board: Number of error vs output bit 
-    kTriggerErrorSummary      = 64,  ///< Number of errors for each trigger decision level (Local, Reg->Local, Reg, Reg->Glob, Global)
-    kTriggerErrorSummaryNorm  = 65,  ///< Percentage of errors for each trigger decision level
+    kTriggerErrorOutGlobalFromInGlobal = 63, ///< Global board: Number of error vs output bit    with a re-reconstruction from Global inputs
+    kTriggerErrorOutGlobalFromInLocal = 64, ///< Global board: Number of error vs output bit  with a re-reconstruction from Local inputs
+    kTriggerErrorSummary      = 65,  ///< Number of errors for each trigger decision level (Local, Reg->Local, Reg, Reg->Glob, Global)
+    kTriggerErrorSummaryNorm  = 66,  ///< Percentage of errors for each trigger decision level
     kTriggerErrorLocalYCopy     = 67, ///< Local board: Number of Y Copy Error vs Local Board Id
     kTriggerErrorLocalYCopyTest = 68, ///< Local Board: Number of Y copy error tests (for normalization)
     kTriggerErrorLocalYCopyNorm = 69, ///< Local Board: Number of Y Copy Error vs Local Board Id Normalized to the number of tests
@@ -56,7 +57,10 @@ namespace AliMUONQAIndices
     kTriggerReadOutErrorsNorm = 81,  ///< Percentage of read-out errors
     kTriggerGlobalOutput      = 90,  ///< Number of Global outputs and Global algo errors
     kTriggerGlobalOutputNorm  = 91,  ///< Percentage of Global outputs and Global algo errors
-    kTriggerRawNAnalyzedEvents= 100  ///< Number of analyzed events per event specie
+    kTriggerRawNAnalyzedEvents= 100,  ///< Number of analyzed events per event specie
+    kTriggerLocalRatio4434       = 101,  ///< Ratio 44/34 vs Local Board Id
+    kTriggerRatio4434AllEvents       = 102,  ///< Ratio 44/34 since the beginning of the run vs Event Number
+    kTriggerRatio4434SinceLastUpdate       = 103  ///< Ratio 44/34 for the last kUpdateRatio4434 events vs Event Number
     
   };
   
index 54df752ccf0981365711f06beb726bff46f7fbf9..90072043e8f8faca65d3de1ec03a053c52c84084 100644 (file)
@@ -34,6 +34,7 @@ ClassImp(AliMUONTriggerQADataMakerRec)
 #include "AliMpConstants.h"
 #include "AliMUONTriggerDisplay.h"
 #include "TH2.h"
+#include "TH1F.h"
 #include "TString.h"
 #include "AliRecoParam.h"
 #include "AliMUONDigitStoreV2R.h"
@@ -64,6 +65,8 @@ ClassImp(AliMUONTriggerQADataMakerRec)
 //____________________________________________________________________________ 
 AliMUONTriggerQADataMakerRec::AliMUONTriggerQADataMakerRec(AliQADataMakerRec* master) : 
 AliMUONVQADataMakerRec(master),
+fNumberOf34Dec(0x0),
+fNumberOf44Dec(0x0),
 fDigitMaker(new AliMUONDigitMaker(kFALSE)),
 fCalibrationData(new AliMUONCalibrationData(AliCDBManager::Instance()->GetRun())),
 fTriggerProcessor(new AliMUONTriggerElectronics(fCalibrationData)),
@@ -81,6 +84,8 @@ AliMUONTriggerQADataMakerRec::~AliMUONTriggerQADataMakerRec()
   delete fDigitStore;
   delete fTriggerProcessor;
   delete fCalibrationData;
+  delete fNumberOf34Dec;
+  delete fNumberOf44Dec;
 }
 
 //____________________________________________________________________________ 
@@ -140,6 +145,16 @@ void AliMUONTriggerQADataMakerRec::EndOfDetectorCycleRaws(Int_t /*specie*/, TObj
       
   TH1* hSummary = GetRawsData(AliMUONQAIndices::kTriggerErrorSummary);
   hSummary->SetBinContent(AliMUONQAIndices::kAlgoLocalYCopy+1,mean/192.); //put the mean of the % of YCopy error in the kTriggerError's corresponding bin
+
+  ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerLocalRatio4434))->Divide(fNumberOf44Dec,fNumberOf34Dec);
+
+  //reset bins temporary used to store informations
+  ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->SetBinContent(1,0); 
+  ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->SetBinContent(2,0);
+
+  ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerLocalRatio4434))->SetMaximum(1.1);
+  ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->SetMaximum(1.1);
+  ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434SinceLastUpdate))->SetMaximum(1.1);
 }
 
 //____________________________________________________________________________ 
@@ -265,6 +280,20 @@ void AliMUONTriggerQADataMakerRec::InitRaws()
   histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data());
   Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorLocalTrigY, expert, !image, !saveCorr);
 
+  histo1D = new TH1F("Ratio4434Local", "Ratio4434Local",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5);
+  histo1D->GetXaxis()->SetTitle(boardName.Data());
+  histo1D->GetYaxis()->SetTitle("ratio 44/34");
+  Add2RawsList(histo1D, AliMUONQAIndices::kTriggerLocalRatio4434, expert, !image, !saveCorr);                                               
+  histo1D = new TH1F("Ratio4434AllEvents", "Ratio4434AllEvents",1,0,1);
+  histo1D->GetXaxis()->SetTitle("Event number");
+  histo1D->GetYaxis()->SetTitle("ratio 44/34");
+  histo1D->SetLineColor(4);                           
+  Add2RawsList(histo1D, AliMUONQAIndices::kTriggerRatio4434AllEvents, expert, !image, !saveCorr);                                               
+  histo1D = new TH1F("Ratio4434SinceLastUpdate", "Ratio4434SinceLastUpdate",1,0,1);
+  histo1D->GetXaxis()->SetTitle("Event number");
+  histo1D->GetYaxis()->SetTitle("ratio 44/34");                           
+  Add2RawsList(histo1D, AliMUONQAIndices::kTriggerRatio4434SinceLastUpdate, expert, !image, !saveCorr);
+
   histo1D = new TH1F("ErrorLocal2RegionalLPtLSB", "ErrorLocal2RegionalLPtLSB",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5);
   histo1D->GetXaxis()->SetTitle(boardName.Data());
   histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data());
@@ -292,6 +321,13 @@ void AliMUONTriggerQADataMakerRec::InitRaws()
   }
   Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorOutGlobalFromInGlobal, expert, !image, !saveCorr);
 
+  histo1D = new TH1F("ErrorOutGlobalFromInLocal", "ErrorOutGlobalFromInLocal",6,-0.5,6-0.5);
+  histo1D->GetYaxis()->SetTitle(errorAxisTitle.Data());
+  for (int ibin=0;ibin<6;ibin++){
+    histo1D->GetXaxis()->SetBinLabel(ibin+1,globalXaxisName[ibin]);
+  }
+  Add2RawsList(histo1D, AliMUONQAIndices::kTriggerErrorOutGlobalFromInLocal, expert, !image, !saveCorr);
+
   TH1F* histoAlgoErr = new TH1F("hTriggerAlgoNumOfErrors", "Trigger Algorithm total errors",AliMUONQAIndices::kNtrigAlgoErrorBins,-0.5,(Float_t)AliMUONQAIndices::kNtrigAlgoErrorBins-0.5);
   histoAlgoErr->GetYaxis()->SetTitle("Number of events with errors");
   for (int ibin=0;ibin<AliMUONQAIndices::kNtrigAlgoErrorBins;ibin++){
@@ -367,6 +403,9 @@ void AliMUONTriggerQADataMakerRec::InitRaws()
   histo1D->GetXaxis()->SetBinLabel(1, AliRecoParam::GetEventSpecieName(esindex));
   histo1D->GetYaxis()->SetTitle("Number of analyzed events");
   Add2RawsList(histo1D, AliMUONQAIndices::kTriggerRawNAnalyzedEvents, expert, !image, !saveCorr);
+
+  fNumberOf34Dec = new TH1F("hNumberOf34Dec", "hNumberOf34Dec",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5);
+  fNumberOf44Dec = new TH1F("hNumberOf44Dec", "hNumberOf44Dec",nbLocalBoard,0.5,(Float_t)nbLocalBoard+0.5);
 }
 
 //__________________________________________________________________
@@ -650,15 +689,23 @@ void AliMUONTriggerQADataMakerRec::MakeRaws(AliRawReader* rawReader)
 
   fTriggerProcessor->Digits2Trigger(digitStore,recoTriggerStore);
 
+  AliMUONGlobalTrigger* recoGlobalTriggerFromLocal;
+  recoGlobalTriggerFromLocal = recoTriggerStore.Global();
+
   //Reconstruct Global decision from Global inputs
   UChar_t recoResp = RawTriggerInGlobal2OutGlobal(globalInput);
-  AliMUONGlobalTrigger recoGlobalTrigger;
-  recoGlobalTrigger.SetFromGlobalResponse(recoResp);
+  AliMUONGlobalTrigger recoGlobalTriggerFromGlobal;
+  recoGlobalTriggerFromGlobal.SetFromGlobalResponse(recoResp);
 
   // Compare data and reconstructed decisions and fill histos
   RawTriggerMatchOutLocal(inputTriggerStore, recoTriggerStore);
+  //Fill ratio 44/34 histos
+  FillRatio4434Histos();
   //RawTriggerMatchOutLocalInRegional(); // Not tested, hardware read-out doesn't work
-  RawTriggerMatchOutGlobalFromInGlobal(inputGlobalTrigger, recoGlobalTrigger);
+  RawTriggerMatchOutGlobal(inputGlobalTrigger, recoGlobalTriggerFromGlobal, 'G');
+  // Global, reconstruction from Local inputs: compare data and reconstructed decisions and fill histos
+  RawTriggerMatchOutGlobal(inputGlobalTrigger, *recoGlobalTriggerFromLocal, 'L');
+  // Global, reconstruction from Global inputs: compare data and reconstructed decisions and fill histos
 }
 
 //__________________________________________________________________
@@ -1085,11 +1132,16 @@ void AliMUONTriggerQADataMakerRec::RawTriggerMatchOutLocal(AliMUONVTriggerStore&
   Bool_t errorInLUT = kFALSE;
 
   next.Reset();
+  Bool_t respBendPlane, respNonBendPlane;
   while ( ( recoLocalTrigger = static_cast<AliMUONLocalTrigger*>(next()) ) )
   {  
     loCircuit = recoLocalTrigger->LoCircuit();
     Int_t iboard = loCircuit - 1;
   
+    // Fill ratio 44/34 histos
+    if (recoLocalTrigger->GetLoDecision()!=0) fNumberOf34Dec->Fill(loCircuit);
+    if (fTriggerProcessor->ModifiedLocalResponse(loCircuit, respBendPlane, respNonBendPlane, kTRUE)) fNumberOf44Dec->Fill(loCircuit);
+    
     inputLocalTrigger = inputTriggerStore.FindLocal(loCircuit);
 
     if ( recoLocalTrigger->LoStripX() != inputLocalTrigger->LoStripX() ) {
@@ -1180,17 +1232,34 @@ void AliMUONTriggerQADataMakerRec::RawTriggerMatchOutLocalInRegional()
 
 
 //____________________________________________________________________________ 
-void AliMUONTriggerQADataMakerRec::RawTriggerMatchOutGlobalFromInGlobal(AliMUONGlobalTrigger& inputGlobalTrigger, 
-                                                                       AliMUONGlobalTrigger& recoGlobalTrigger)
+void AliMUONTriggerQADataMakerRec::RawTriggerMatchOutGlobal(AliMUONGlobalTrigger& inputGlobalTrigger, 
+                                                                       AliMUONGlobalTrigger& recoGlobalTrigger, 
+                                                                       Char_t histo)
 {
   //
-  /// Match data and reconstructed Global Trigger decision for a reconstruction from Global inputs
+  /// Match data and reconstructed Global Trigger decision for a reconstruction from Global inputs.
+  /// histo='G': fill FromGlobalInput histo='F': fill from Local input;
   //
 
   if ( recoGlobalTrigger.GetGlobalResponse() == inputGlobalTrigger.GetGlobalResponse() )
     return;
+  Int_t histoToFill;
+  Int_t binToFill;
+  
+  if (histo=='G'){
+      histoToFill=AliMUONQAIndices::kTriggerErrorOutGlobalFromInGlobal;
+      binToFill=AliMUONQAIndices::kAlgoGlobalFromGlobal;
+  }else{
+      if (histo=='L'){
+         histoToFill=AliMUONQAIndices::kTriggerErrorOutGlobalFromInLocal;
+         binToFill=AliMUONQAIndices::kAlgoGlobalFromLocal;
+      }else{
+         AliWarning(Form("Global histos not filled, 3rd argument must be 'G' or 'F'"));
+         return;
+      } 
+  }
 
-  ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorSummary))->Fill(AliMUONQAIndices::kAlgoGlobalFromGlobal);
+  ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorSummary))->Fill(binToFill);
 
   Bool_t inputResp[6] = {inputGlobalTrigger.PairUnlikeHpt(), inputGlobalTrigger.PairUnlikeLpt(),
                         inputGlobalTrigger.PairLikeHpt(), inputGlobalTrigger.PairLikeLpt(),
@@ -1202,6 +1271,49 @@ void AliMUONTriggerQADataMakerRec::RawTriggerMatchOutGlobalFromInGlobal(AliMUONG
 
   for (int bit=0;bit<6;bit++){
     if ( recoResp[bit] != inputResp[bit] )
-      ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerErrorOutGlobalFromInGlobal))->Fill(bit);
+      ((TH1F*)GetRawsData(histoToFill))->Fill(bit);
+  }
+}
+
+//____________________________________________________________________________ 
+void AliMUONTriggerQADataMakerRec::FillRatio4434Histos()
+{
+  /// Fill ratio 44/34 histos
+
+  Int_t numEvent = Int_t(((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRawNAnalyzedEvents))->GetBinContent(1));
+
+  if (numEvent % fgkUpdateRatio4434 == 0){
+      Float_t totalNumberOf44 = fNumberOf44Dec->GetSumOfWeights();
+      Float_t totalNumberOf34 = fNumberOf34Dec->GetSumOfWeights();
+      Float_t ratio4434;
+      Float_t errorRatio4434;
+
+      ratio4434 = totalNumberOf44/totalNumberOf34;
+      errorRatio4434 = sqrt(totalNumberOf44*(1-ratio4434))/totalNumberOf34;
+  
+      ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->SetBinContent(numEvent,ratio4434);
+      ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->SetBinError(numEvent,errorRatio4434);
+
+
+      Float_t NumberOf44Update = totalNumberOf44 - ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->GetBinContent(2);
+      Float_t NumberOf34Update = totalNumberOf34 - ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->GetBinContent(1);
+      Float_t ratio4434Update;
+      Float_t errorRatio4434Update;
+
+      ratio4434Update = NumberOf44Update/NumberOf34Update;
+      errorRatio4434Update = sqrt(NumberOf44Update*(1-ratio4434Update))/NumberOf34Update;
+
+      ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434SinceLastUpdate))->SetBinContent(numEvent,ratio4434Update);
+      ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434SinceLastUpdate))->SetBinError(numEvent,errorRatio4434Update);
+
+      ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->SetBinContent(1,totalNumberOf34);
+      ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->SetBinContent(2,totalNumberOf44);
+   
   }
+  
+  Int_t newNBins = ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->GetNbinsX()+1;
+  
+  ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434AllEvents))->SetBins(newNBins,0,newNBins);
+  ((TH1F*)GetRawsData(AliMUONQAIndices::kTriggerRatio4434SinceLastUpdate))->SetBins(newNBins,0,newNBins);
 }
+
index 4824c538d380b22b3b3fde41b50e75cce39eadf5..25d9ad776bedafd1730ef095f02f8c805b37381a 100644 (file)
@@ -23,6 +23,7 @@ class TMap;
 class AliMpDCSNamer;
 class AliMUONVTriggerStore;
 class AliMUONGlobalTrigger;
+class TH1F;
 
 class AliMUONTriggerQADataMakerRec: public AliMUONVQADataMakerRec {
 
@@ -55,14 +56,16 @@ private:
   AliMUONTriggerQADataMakerRec& operator=(const AliMUONTriggerQADataMakerRec& qadm);
 
   void DisplayTriggerInfo();
+  void FillRatio4434Histos();
   Bool_t FillTriggerDCSHistos();
   TObjArray* GetDCSValues(Int_t iMeas, Int_t detElemId,
                          TMap* triggerDcsMap, AliMpDCSNamer& triggerDcsNamer);
   UChar_t RawTriggerInGlobal2OutGlobal(UInt_t globalInput[4]);
   void RawTriggerMatchOutLocal(AliMUONVTriggerStore& inputTriggerStore, AliMUONVTriggerStore& recoTriggerStore);
   //void RawTriggerMatchOutLocalInRegional();
-  void RawTriggerMatchOutGlobalFromInGlobal(AliMUONGlobalTrigger& inputLocalTrigger,
-                                           AliMUONGlobalTrigger& recoGlobalTrigger);
+  void RawTriggerMatchOutGlobal(AliMUONGlobalTrigger& inputLocalTrigger,
+                               AliMUONGlobalTrigger& recoGlobalTrigger,
+                               Char_t histo); 
 
   //Int_t fTriggerOutputRegionalData[16]; ///< Data Regional Trigger decision for each Regional Board (1R:0, 2R:1, ... , 1L:8, ...) -> 4 bits LPt, 4 bits HPt
   //Int_t fTriggerInputRegionalRecLPt[2][16][16]; ///< Reconstructed Regional Input LPt for each Regional Board ([bit][reg][loc]) (reg -> 1R:0, 2R:1, ... , 1L:8, ...)
@@ -73,6 +76,10 @@ private:
   //Int_t fTriggerInputGlobalDataHPt[16][4]; ///< Data Global inputs HPt (1R:0, 2R:1, ... , 1L:8, ...)
   //Int_t fTriggerOutputGlobalRecFromLocalInput[6]; //< Reconstructed Global outputs from Local inputs
   //Int_t fTriggerOutputGlobalRecFromLocalOutput[6]; //< Reconstructed Global outputs from Local outputs
+
+  static const Int_t fgkUpdateRatio4434=50; ///< Event interval between 2 update of the Ratio4434 histos
+  TH1F *fNumberOf34Dec; //!< Number of Decision in coincidence 3/4 vs Local Board (for the calculation of the Ratio4434)
+  TH1F *fNumberOf44Dec; //!< Number of Decision in coincidence 4/4 vs Local Board (for the calculation of the Ratio4434)
   
   AliMUONDigitMaker* fDigitMaker; //!< pointer to digit maker
   AliMUONCalibrationData* fCalibrationData; //!< Used to load Local, Regional and Global masks