]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
TPC DQM update to have 2d occupancy plot and to disable calib plots from
authorjthaeder <jthaeder@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 28 Mar 2012 20:56:35 +0000 (20:56 +0000)
committerjthaeder <jthaeder@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 28 Mar 2012 20:56:35 +0000 (20:56 +0000)
logbook by making them expert plots. Changes have been tested locally and
on DQM test machine.
(Peter C.)

TPC/AliTPCQADataMakerRec.cxx
TPC/AliTPCQADataMakerRec.h
TPC/AliTPCRawStreamV3.h
TPC/AliTPCdataQA.cxx
TPC/AliTPCdataQA.h

index cb5de15f324d0cbb5cd8f424b4fee442d9d6f711..80b2741609483d8b4d756a42f9b7bc9edfb95fce 100644 (file)
@@ -79,6 +79,9 @@
 #include <TBox.h>
 #include <TLine.h>
 #include <TAxis.h>
+#include <TH1.h> 
+#include <TProfile.h> 
+#include <TProfile2D.h> 
 
 // --- Standard library ---
 
@@ -92,6 +95,7 @@
 #include "AliTPCClustersRow.h"
 #include "AliTPCclusterMI.h"
 #include "AliSimDigits.h"
+#include <AliDetectorRecoParam.h>
 
 
 ClassImp(AliTPCQADataMakerRec)
@@ -215,8 +219,11 @@ void AliTPCQADataMakerRec::InitRaws()
   histRawsOccupancyVsSector->SetMarkerStyle(20);
   histRawsOccupancyVsSector->SetOption("P");
   histRawsOccupancyVsSector->SetStats(kFALSE);
-  Add2RawsList(histRawsOccupancyVsSector, kRawsOccupancyVsSector, !expert, image, !saveCorr);
-  
+  if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib )
+    Add2RawsList(histRawsOccupancyVsSector, kRawsOccupancyVsSector, expert, image, !saveCorr);
+  else
+    Add2RawsList(histRawsOccupancyVsSector, kRawsOccupancyVsSector, !expert, image, !saveCorr);
+    
   TProfile * histRawsQVsSector = 
     new TProfile("hRawsQVsSector", "<Q> vs sector; Sector; <Q>",
             72, 0, 72);
@@ -228,7 +235,21 @@ void AliTPCQADataMakerRec::InitRaws()
   histRawsQmaxVsSector->SetMarkerStyle(20);
   histRawsQmaxVsSector->SetOption("P");
   histRawsQmaxVsSector->SetStats(kFALSE);
-  Add2RawsList(histRawsQmaxVsSector, kRawsQmaxVsSector, !expert, image, !saveCorr);
+  if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib )
+    Add2RawsList(histRawsQmaxVsSector, kRawsQmaxVsSector, expert, image, !saveCorr);
+  else
+    Add2RawsList(histRawsQmaxVsSector, kRawsQmaxVsSector, !expert, image, !saveCorr);
+
+  TProfile2D * histRawsOccupancy2dVsSector = 
+    new TProfile2D("hRawsOccupancy2dVsSector", "Occupancy vs sector; Sector; Patch",
+                  72, 0, 36, 6, 0, 6);
+  histRawsOccupancy2dVsSector->SetOption("COLZ");
+  histRawsOccupancy2dVsSector->SetStats(kFALSE);
+  if ( GetRecoParam()->GetEventSpecie() == AliRecoParam::kCalib )
+    Add2RawsList(histRawsOccupancy2dVsSector, kRawsOccupancy2dVsSector, expert, image, !saveCorr);
+  else
+    Add2RawsList(histRawsOccupancy2dVsSector, kRawsOccupancy2dVsSector, !expert, image, !saveCorr);
+    
   //
   ClonePerTrigClass(AliQAv1::kRAWS); // this should be the last line
 }
@@ -358,6 +379,11 @@ void AliTPCQADataMakerRec::MakeRaws(AliRawReader* rawReader)
        TProfile* hRawsOccupancyVsSector = dynamic_cast<TProfile*>(arrRW->At(ih));
        if (hRawsOccupancyVsSector) hRawsOccupancyVsSector->Add(fTPCdataQA->GetHistOccVsSector());
       }
+      arrRW = GetMatchingRawsData(kRawsOccupancy2dVsSector);
+      for (int ih=arrRW->GetEntriesFast();ih--;) {
+       TProfile2D* hRawsOccupancy2dVsSector = dynamic_cast<TProfile2D*>(arrRW->At(ih));
+       if (hRawsOccupancy2dVsSector) hRawsOccupancy2dVsSector->Add(fTPCdataQA->GetHistOcc2dVsSector());
+      }
       arrRW = GetMatchingRawsData(kRawsQVsSector);
       for (int ih=arrRW->GetEntriesFast();ih--;) {
        TProfile* hRawsQVsSector = dynamic_cast<TProfile*>(arrRW->At(ih));
index ba9548b74a24956d394bd23214e70d115a5f0c05..56a5f7129ebbc609e4af8b5a527ea2106f384a3c 100644 (file)
@@ -15,8 +15,6 @@
 
 
 // --- ROOT system ---
-#include <TH1.h> 
-#include <TProfile.h> 
 
 // --- Standard library ---
 
@@ -30,7 +28,7 @@
 class AliTPCQADataMakerRec: public AliQADataMakerRec {
 
 public:
-  enum HRawsType_t         {kRawsOccupancyVsSector=0, kRawsQVsSector, kRawsQmaxVsSector} ; 
+  enum HRawsType_t         {kRawsOccupancyVsSector=0, kRawsQVsSector, kRawsQmaxVsSector, kRawsOccupancy2dVsSector} ; 
   enum HDigitType_t        {kDigitsADC=0} ; 
   enum HRECPOINTsType_t    {kClusters=0, kRatio, kPt} ; 
   enum HESDsType_t         {kQmaxShort=0, kQmaxMedium, kQmaxLong, kQShort, kQMedium, kQLong, kRow} ; 
index 815dc3770a6dcebb63b1b0d8237587d61e215ec1..c9ebdcd10c099f5666e4487cd4c3619447a28ab3 100644 (file)
@@ -32,6 +32,7 @@ class AliTPCRawStreamV3: public AliAltroRawStreamV3 {
     inline Int_t GetPad()        const { return fPad; }        // Provide index of current pad
     inline Int_t GetPrevPad()    const { return fPrevPad; }    // Provide index of previous pad
     inline Bool_t  IsNewPad()    const {return (fPad != fPrevPad) || IsNewRow();};
+    inline Int_t GetPatchIndex() const { return fPatchIndex; }        // Provide index of current patch
 
 
   protected :
index 68ab0201268daa3b29ceefa6b5cf776df12097b6..f10ccbf5157c0d3e7ef8b7bb72cf36c6ec6d736a 100644 (file)
 #include "AliTPCdataQA.h"
 #include "AliLog.h"
 
+
 ClassImp(AliTPCdataQA)
 
 AliTPCdataQA::AliTPCdataQA() : /*FOLD00*/  
@@ -163,10 +164,13 @@ AliTPCdataQA::AliTPCdataQA() : /*FOLD00*/
   fTimeBinsMax(0),
   fIsDQM(kFALSE),
   fHistOccVsSector(0x0),
+  fHistOcc2dVsSector(0x0),
   fHistQVsSector(0x0),
   fHistQmaxVsSector(0x0),
   fOccVec(0x0),
-  fOccMaxVec(0x0)
+  fOccMaxVec(0x0),
+  fOccVecFine(0x0),
+  fOccMaxVecFine(0x0)
 {
   //
   // default constructor
@@ -213,10 +217,13 @@ AliTPCdataQA::AliTPCdataQA(const AliTPCdataQA &ped) : /*FOLD00*/
   fTimeBinsMax(0),
   fIsDQM(ped.GetIsDQM()),
   fHistOccVsSector(0x0),
+  fHistOcc2dVsSector(0x0),
   fHistQVsSector(0x0),
   fHistQmaxVsSector(0x0),
   fOccVec(0x0),
-  fOccMaxVec(0x0)
+  fOccMaxVec(0x0),
+  fOccVecFine(0x0),
+  fOccMaxVecFine(0x0)
 {
   //
   // copy constructor
@@ -307,10 +314,13 @@ AliTPCdataQA::AliTPCdataQA(const TMap *config) : /*FOLD00*/
   fTimeBinsMax(0),
   fIsDQM(kFALSE),
   fHistOccVsSector(0x0),
+  fHistOcc2dVsSector(0x0),
   fHistQVsSector(0x0),
   fHistQmaxVsSector(0x0),
   fOccVec(0x0),
-  fOccMaxVec(0x0)
+  fOccMaxVec(0x0),
+  fOccVecFine(0x0),
+  fOccMaxVecFine(0x0)
 {
   //
   // default constructor
@@ -366,10 +376,13 @@ AliTPCdataQA::~AliTPCdataQA() /*FOLD00*/
 
   // DQM
   delete fHistOccVsSector;
+  delete fHistOcc2dVsSector;
   delete fHistQVsSector;
   delete fHistQmaxVsSector;
   delete fOccVec;
   delete fOccMaxVec;
+  delete fOccVecFine;
+  delete fOccMaxVecFine;
   
   for (Int_t iRow = 0; iRow < fRowsMax; iRow++) {
     delete [] fAllBins[iRow];
@@ -500,6 +513,8 @@ Bool_t AliTPCdataQA::ProcessEvent(AliTPCRawStreamV3 *const rawStreamV3)
       Int_t iSector = rawStreamV3->GetSector(); //  current sector
       Int_t iRow    = rawStreamV3->GetRow();    //  current row
       Int_t iPad    = rawStreamV3->GetPad();    //  current pad
+      Int_t iPatch  = rawStreamV3->GetPatchIndex(); //  current patch
+      Int_t iBranch = rawStreamV3->GetBranch();    //  current branch
       if (iRow<0 || iPad<0) continue;
       // Call local maxima finder if the data is in a new sector
       if(iSector != lastSector) {
@@ -520,7 +535,7 @@ Bool_t AliTPCdataQA::ProcessEvent(AliTPCRawStreamV3 *const rawStreamV3)
         
         for (Int_t iTimeBin = 0; iTimeBin<bunchlength; iTimeBin++){
           Float_t signal=(Float_t)sig[iTimeBin];
-          nSignals += Update(iSector,iRow,iPad,startTbin--,signal);
+          nSignals += Update(iSector,iRow,iPad,startTbin--,signal, iPatch, iBranch);
           withInput = kTRUE;
         }
       }
@@ -539,7 +554,7 @@ Bool_t AliTPCdataQA::ProcessEvent(AliRawReader *const rawReader)
   //
   //  Event processing loop - AliRawReader
   //
-  AliTPCRawStreamV3 rawStreamV3(rawReader, (AliAltroMapping**)fMapping);
+  AliTPCRawStreamV3 rawStreamV3(rawReader,(AliAltroMapping**)fMapping);
   Bool_t res=ProcessEvent(&rawStreamV3);
   if(res) {
     fEventCounter++; // only increment event counter if there is TPC data
@@ -661,7 +676,9 @@ Int_t AliTPCdataQA::Update(const Int_t iSector, /*FOLD00*/
                           const Int_t iRow,
                           const Int_t iPad,
                           const Int_t iTimeBin,
-                          Float_t signal)
+                          Float_t signal,
+                          const Int_t iPatch,
+                          const Int_t iBranch)
 {
   //
   // Signal filling method
@@ -706,6 +723,9 @@ Int_t AliTPCdataQA::Update(const Int_t iSector, /*FOLD00*/
       fHistOccVsSector  = new TProfile("hOccVsSector", "Occupancy vs sector; Sector; Occupancy", 72, 0, 72);
       fHistOccVsSector->SetDirectory(0);
 
+      fHistOcc2dVsSector  = new TProfile2D("hOcc2dVsSector", "Occupancy vs sector and patch; Sector; Patch", 72, 0, 36, 6, 0, 6);
+      fHistOcc2dVsSector->SetDirectory(0);
+
       fHistQVsSector  = new TProfile("hQVsSector", "Q vs sector; Sector; Q [ADC ch]", 72, 0, 72);
       fHistQVsSector->SetDirectory(0);
 
@@ -717,13 +737,40 @@ Int_t AliTPCdataQA::Update(const Int_t iSector, /*FOLD00*/
        fOccVec->GetArray()[i] = 0;
 
       fOccMaxVec = new TArrayD(72);
-      Double_t nTimeBins = fLastTimeBin - fFirstTimeBin +1;
+      const Double_t nTimeBins = fLastTimeBin - fFirstTimeBin +1;
       for(Int_t i = 0; i < 72; i++)
        
        if(i<36) // IROCs (5504 pads)
          fOccMaxVec->GetArray()[i] = nTimeBins*5504;
        else     // OROCs (9984 pads)
          fOccMaxVec->GetArray()[i] = nTimeBins*9984;
+
+      // 12 branches for each full sector
+      const Int_t nBranches = 36*12;
+      fOccVecFine = new TArrayD(nBranches);
+      for(Int_t i = 0; i < nBranches; i++)
+       fOccVecFine->GetArray()[i] = 0;
+
+      // Pads per patch same for all sectors
+      Int_t nPads0[6] = {1152, 1536, 1152, 1280, 1280, 1280};
+      Int_t nPads1[6] = {1152, 1664, 1152, 1280, 1280, 1280};
+
+      fOccMaxVecFine = new TArrayD(nBranches);
+      for(Int_t i = 0; i < nBranches; i++) {
+       
+       const Int_t fullSector = Int_t(i/12);
+       Int_t branch = i - fullSector*12;
+       R__ASSERT(branch>=0 && branch<12);
+       
+       const Int_t patch = Int_t(branch/2);
+       branch -= patch*2;
+       
+       R__ASSERT(branch>=0 && branch<2);
+       if(branch == 0)
+         fOccMaxVecFine->GetArray()[i] = nTimeBins*nPads0[patch];
+       else     // OROCs (9984 pads)
+         fOccMaxVecFine->GetArray()[i] = nTimeBins*nPads1[patch];
+      }
     }
   }
   // Make the arrays for expanding the data
@@ -768,6 +815,9 @@ Int_t AliTPCdataQA::Update(const Int_t iSector, /*FOLD00*/
   if(fIsDQM) {
 
     fOccVec->GetArray()[iSector] += 1.0;
+    // To change before committing
+    if(iPatch>=0 && iBranch>=0 && iPatch<=5 && iBranch <= 1)
+      fOccVecFine->GetArray()[(iSector%36)*12+iPatch*2+iBranch] += 1.0;
   } else {
     // In fNoThreshold we fill all data to estimate the ZS volume
     Float_t count = fNoThreshold->GetCalROC(iSector)->GetValue(iRow, iPad);
@@ -1190,6 +1240,21 @@ void AliTPCdataQA::FillOccupancyProfile()
     fOccVec->GetArray()[i] /= fOccMaxVec->GetArray()[i];
     fHistOccVsSector->Fill(i, fOccVec->GetArray()[i]);
   }
+
+  const Int_t nBranches = 36*12;
+  for(Int_t i = 0; i < nBranches; i++) {
+
+    fOccVecFine->GetArray()[i] /= fOccMaxVecFine->GetArray()[i];
+
+    const Int_t fullSector = Int_t(i/12);
+
+    Int_t branch = i - fullSector*12;
+    const Int_t patch = Int_t(branch/2);
+
+    branch -= patch*2;
+
+    fHistOcc2dVsSector->Fill(fullSector+0.5*branch+0.1, patch+0.5, fOccVecFine->GetArray()[i]);
+  }
 }
 
 //____________________________________________________________________________________________
@@ -1204,8 +1269,13 @@ void AliTPCdataQA::ResetProfiles()
     fHistQmaxVsSector->Reset();
   if(fHistOccVsSector)
     fHistOccVsSector->Reset();
+  if(fHistOcc2dVsSector)
+    fHistOcc2dVsSector->Reset();
 
   if(fOccVec)
     for(Int_t i = 0; i < 72; i++)
       fOccVec->GetArray()[i] = 0.0;
+  if(fOccVecFine)
+    for(Int_t i = 0; i < 36*12; i++)
+      fOccVecFine->GetArray()[i] = 0.0;
 }
index 94d02392796c5d6da5313eb8c55d3cbd69cf6a5e..7b35a245050a5ed8960b537cb0965142b8c27408 100644 (file)
@@ -6,7 +6,8 @@
 
 
 #include <TH1F.h>
-class TProfile;
+#include <TProfile.h>
+#include <TProfile2D.h>
 #include "AliRecoParam.h"
 
 #include <TArray.h>
@@ -74,6 +75,7 @@ public:
 
   // DQM output
   TProfile* GetHistOccVsSector()  const { return fHistOccVsSector; }
+  TProfile2D* GetHistOcc2dVsSector() const { return fHistOcc2dVsSector; }
   TProfile* GetHistQVsSector()    const { return fHistQVsSector; }
   TProfile* GetHistQmaxVsSector() const { return fHistQmaxVsSector; }
 
@@ -106,7 +108,8 @@ public:
 
 private:
   Int_t Update(const Int_t iSector, const Int_t iRow, const Int_t iPad,
-              const Int_t iTimeBin, Float_t signal);
+              const Int_t iTimeBin, Float_t signal,
+              const Int_t iPatch=-1, const Int_t iBranch=-1);
   void  FindLocalMaxima(const Int_t iSector);
 
   void MakeArrays();                // Create arrays for random data acces
@@ -168,10 +171,13 @@ private:
   // DQM variables
   Bool_t fIsDQM;                   //!  Is DQM -> Simple output (no 2D!)
   TProfile* fHistOccVsSector;      //!  Occ vs sector (for DQM only)
+  TProfile2D* fHistOcc2dVsSector;  //!  Occ vs sector 2D (for DQM only)
   TProfile* fHistQVsSector;        //!  Q vs sector (for DQM only)
   TProfile* fHistQmaxVsSector;     //!  QMax vs sector (for DQM only)
   TArrayD* fOccVec;                //!  Occupancy help counter for DQM
   TArrayD* fOccMaxVec;             //!  Occupancy help normlization for DQM
+  TArrayD* fOccVecFine;            //!  "2D" occupancy help counter for DQM
+  TArrayD* fOccMaxVecFine;         //!  "2D" occupancy help normlization for DQM
   
 
   ClassDef(AliTPCdataQA, 5)  // Implementation of the TPC Raw QA