]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSQADataMaker.cxx
- ESDfilter moved from PWG0base to ANALYSISalice
[u/mrichter/AliRoot.git] / PHOS / AliPHOSQADataMaker.cxx
index 6d58127f8a5ede58a6bb4721caa10d0329051be9..2b554a98a34a367ff8e8a814541d370a028928b0 100644 (file)
@@ -44,6 +44,8 @@
 #include "AliPHOSRecParticle.h" 
 #include "AliPHOSTrackSegment.h" 
 #include "AliPHOSRawDecoder.h"
+#include "AliPHOSReconstructor.h"
+#include "AliPHOSRecoParam.h"
 
 ClassImp(AliPHOSQADataMaker)
            
@@ -73,7 +75,7 @@ AliPHOSQADataMaker& AliPHOSQADataMaker::operator = (const AliPHOSQADataMaker& qa
 }
  
 //____________________________________________________________________________ 
-void AliPHOSQADataMaker::EndOfDetectorCycle(AliQA::TASKINDEX task, TList * list)
+void AliPHOSQADataMaker::EndOfDetectorCycle(AliQA::TASKINDEX task, TObjArray * list)
 {
   //Detector specific actions at end of cycle
   // do the QA checking
@@ -84,6 +86,7 @@ void AliPHOSQADataMaker::EndOfDetectorCycle(AliQA::TASKINDEX task, TList * list)
 void AliPHOSQADataMaker::InitESDs()
 {
   //create ESDs histograms in ESDs subdir
+       
   TH1F * h0 = new TH1F("hPhosESDs",    "ESDs energy distribution in PHOS",       100, 0., 100.) ;  
   h0->Sumw2() ; 
   Add2ESDsList(h0, 0) ;
@@ -113,7 +116,7 @@ void AliPHOSQADataMaker::InitDigits()
   Add2DigitsList(h0, 0) ;
   TH1I * h1 = new TH1I("hPhosDigitsMul", "Digits multiplicity distribution in PHOS", 500, 0, 1000) ; 
   h1->Sumw2() ;
-  Add2DigitsList(h1, 0) ;
+  Add2DigitsList(h1, 1) ;
 }
 
 //____________________________________________________________________________ 
@@ -210,13 +213,14 @@ void AliPHOSQADataMaker::InitSDigits()
 void AliPHOSQADataMaker::MakeESDs(AliESDEvent * esd)
 {
   // make QA data from ESDs
-  
-  Int_t maxClu = esd->GetNumberOfPHOSClusters() ; 
-  Int_t index = 0, count = 0 ; 
-  for ( index = 0 ; index < maxClu; index++ ) {
-    AliESDCaloCluster * clu = esd->GetCaloCluster(index) ;
-    GetESDsData(0)->Fill(clu->E()) ;
-    count++ ; 
+
+  Int_t count = 0 ; 
+  for ( Int_t index = 0; index < esd->GetNumberOfCaloClusters() ; index++ ) {
+       AliESDCaloCluster * clu = esd->GetCaloCluster(index) ;
+       if ( clu->IsPHOS() ) {
+               GetESDsData(0)->Fill(clu->E()) ;
+               count++ ;
+       } 
   }
   GetESDsData(1)->Fill(count) ;
 }
@@ -224,7 +228,7 @@ void AliPHOSQADataMaker::MakeESDs(AliESDEvent * esd)
 //____________________________________________________________________________
 void AliPHOSQADataMaker::MakeHits(TClonesArray * hits)
 {
-  //make QA data from Hits
+       //make QA data from Hits
 
     GetHitsData(1)->Fill(hits->GetEntriesFast()) ; 
     TIter next(hits) ; 
@@ -233,6 +237,35 @@ void AliPHOSQADataMaker::MakeHits(TClonesArray * hits)
       GetHitsData(0)->Fill( hit->GetEnergy()) ;
     }
 }
+
+//____________________________________________________________________________
+void AliPHOSQADataMaker::MakeHits(TTree * hitTree)
+{
+       // make QA data from Hit Tree
+       
+       TClonesArray * hits = new TClonesArray("AliPHOSHit", 1000);
+
+       TBranch * branch = hitTree->GetBranch("PHOS") ;
+       if ( ! branch ) {
+               AliWarning("PHOS branch in Hit Tree not found") ; 
+       } else {
+               TClonesArray * tmp =  new TClonesArray("AliPHOSHit", 1000) ;
+               branch->SetAddress(&tmp) ;
+               Int_t index = 0 ;  
+               for (Int_t ientry = 0 ; ientry < branch->GetEntries() ; ientry++) {
+                       branch->GetEntry(ientry) ; 
+                       for (Int_t ihit = 0 ; ihit < tmp->GetEntries() ; ihit++) {
+                               AliPHOSHit * hit = dynamic_cast<AliPHOSHit *> (tmp->At(ihit)) ; 
+                               new((*hits)[index]) AliPHOSHit(*hit) ; 
+                               index++ ;
+                       } 
+               }       
+               tmp->Delete() ; 
+               delete tmp ; 
+               MakeHits(hits) ; 
+       }
+}
+
 //____________________________________________________________________________
 void AliPHOSQADataMaker::MakeDigits(TClonesArray * digits)
 {
@@ -246,6 +279,22 @@ void AliPHOSQADataMaker::MakeDigits(TClonesArray * digits)
     }  
 }
 
+//____________________________________________________________________________
+void AliPHOSQADataMaker::MakeDigits(TTree * digitTree)
+{
+       // makes data from Digit Tree
+       TClonesArray * digits = new TClonesArray("AliPHOSDigit", 1000) ; 
+
+       TBranch * branch = digitTree->GetBranch("PHOS") ;
+       if ( ! branch ) {
+               AliWarning("PHOS branch in Digit Tree not found") ; 
+       } else {
+               branch->SetAddress(&digits) ;
+               branch->GetEntry(0) ; 
+               MakeDigits(digits) ; 
+       }
+}
+
 //____________________________________________________________________________
 // void AliPHOSQADataMaker::MakeRecParticles(TTree * recpar)
 // {
@@ -266,9 +315,8 @@ void AliPHOSQADataMaker::MakeRaws(AliRawReader* rawReader)
   const Int_t modMax = 5 ; 
   rawReader->Reset() ; 
   AliPHOSRawDecoder decoder(rawReader);
-  decoder.SetOldRCUFormat(kTRUE);
-  decoder.SubtractPedestals(kTRUE);
-
+  decoder.SetOldRCUFormat  (AliPHOSReconstructor::GetRecoParamEmc()->IsOldRCUFormat());
+  decoder.SubtractPedestals(AliPHOSReconstructor::GetRecoParamEmc()->SubtractPedestals());
   Int_t count = 0 ; 
   while (decoder.NextDigit()) {
    Int_t module  = decoder.GetModule() ;
@@ -350,6 +398,22 @@ void AliPHOSQADataMaker::MakeSDigits(TClonesArray * sdigits)
     } 
 }
 
+//____________________________________________________________________________
+void AliPHOSQADataMaker::MakeSDigits(TTree * sdigitTree)
+{
+       // makes data from SDigit Tree
+       TClonesArray * sdigits = new TClonesArray("AliPHOSDigit", 1000) ; 
+
+       TBranch * branch = sdigitTree->GetBranch("PHOS") ;
+       if ( ! branch ) {
+               AliWarning("PHOS branch in SDigit Tree not found") ; 
+       } else {
+               branch->SetAddress(&sdigits) ;
+               branch->GetEntry(0) ;
+               MakeSDigits(sdigits) ; 
+       }
+}
+
 //____________________________________________________________________________
 // void AliPHOSQADataMaker::MakeTrackSegments(TTree * ts)
 // {