Adapt to the New steering class ro run QA stand alone
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Oct 2007 17:42:18 +0000 (17:42 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Oct 2007 17:42:18 +0000 (17:42 +0000)
PHOS/AliPHOSQADataMaker.cxx
PHOS/AliPHOSQADataMaker.h

index 6d58127..522bf37 100644 (file)
@@ -224,7 +224,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 +233,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)
 {
@@ -247,6 +276,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)
 // {
 //   // makes data from RecParticles
@@ -351,6 +396,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)
 // {
 //   // makes data from TrackSegments
index 6292546..1e9ed37 100644 (file)
@@ -43,11 +43,14 @@ private:
   virtual void   InitSDigits() ; 
   virtual void   MakeESDs(AliESDEvent * esd) ;
   virtual void   MakeHits(TClonesArray * hits) ;
+  virtual void   MakeHits(TTree * hitTree) ;
   virtual void   MakeDigits(TClonesArray * digits) ; 
+  virtual void   MakeDigits(TTree * digitTree) ; 
   // virtual void   MakeRecParticles(TTree * recpar) ; 
-  virtual void   MakeRecPoints(TTree * recpo) ; 
+  virtual void   MakeRecPoints(TTree * recpoTree) ; 
   virtual void   MakeRaws(AliRawReader* rawReader) ; 
   virtual void   MakeSDigits(TClonesArray * sigits) ; 
+  virtual void   MakeSDigits(TTree * sigitTree) ; 
   //virtual void   MakeTrackSegments(TTree *ts ) ; 
   virtual void   StartOfDetectorCycle() ;