]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ESDCheck/AliEMCALQATask.cxx
Corrected wrong selection of eta decays
[u/mrichter/AliRoot.git] / ESDCheck / AliEMCALQATask.cxx
index bd37807ed79b453afc226f24ff40ef519a0a660c..0657786aa8d2adc79906ffb7f3d13d9c92ec9061 100644 (file)
 
 //_________________________________________________________________________
 // An analysis task to check the EMCAL photon data in simulated data
+// An analysis task to check the EMCAL photon data in simulated data
+// An analysis task to check the EMCAL photon data in simulated data
+// An analysis task to check the EMCAL photon data in simulated data
+// An analysis task to check the EMCAL photon data in simulated data
 //
 //*-- Yves Schutz 
 //////////////////////////////////////////////////////////////////////////////
 #include <TChain.h>
 #include <TFile.h> 
 #include <TH1.h>
-#include <TH1F.h>
-#include <TH1I.h>
-#include <TLegend.h> 
 #include <TNtuple.h>
 #include <TROOT.h>
 #include <TVector3.h> 
+#include <TString.h> 
 
 #include "AliEMCALQATask.h" 
 #include "AliESD.h" 
@@ -41,6 +43,7 @@ AliEMCALQATask::AliEMCALQATask(const char *name) :
   AliAnalysisTask(name,""),  
   fChain(0),
   fESD(0), 
+  fOutputContainer(0), 
   fhEMCALPos(0),
   fhEMCAL(0),
   fhEMCALEnergy(0),
@@ -57,6 +60,34 @@ AliEMCALQATask::AliEMCALQATask(const char *name) :
   DefineOutput(0,  TObjArray::Class()) ; 
 }
 
+//____________________________________________________________________________
+AliEMCALQATask::AliEMCALQATask(const AliEMCALQATask& ta) :
+  AliAnalysisTask(ta.GetName(),""),  
+  fChain(ta.fChain),
+  fESD(ta.fESD), 
+  fOutputContainer(ta.fOutputContainer), 
+  fhEMCALPos(ta.fhEMCALPos),
+  fhEMCAL(ta.fhEMCAL),
+  fhEMCALEnergy(ta.fhEMCALEnergy),
+  fhEMCALDigits(ta.fhEMCALDigits),
+  fhEMCALRecParticles(ta.fhEMCALRecParticles),
+  fhEMCALPhotons(ta.fhEMCALPhotons),
+  fhEMCALInvariantMass(ta.fhEMCALInvariantMass),
+  fhEMCALDigitsEvent(ta.fhEMCALDigitsEvent)
+{ 
+  // cpy ctor
+}
+
+//_____________________________________________________________________________
+AliEMCALQATask& AliEMCALQATask::operator = (const AliEMCALQATask& ap)
+{
+// assignment operator
+
+  this->~AliEMCALQATask();
+  new(this) AliEMCALQATask(ap);
+  return *this;
+}
+
 //______________________________________________________________________________
 AliEMCALQATask::~AliEMCALQATask()
 {
@@ -102,6 +133,9 @@ void AliEMCALQATask::ConnectInputData(const Option_t*)
 void AliEMCALQATask::CreateOutputObjects()  
 {
 // create histograms  
+
+  OpenFile(0) ; 
+
   fhEMCALPos           = new TNtuple("EMCALPos"        , "Position in EMCAL" , "x:y:z");
   fhEMCAL              = new TNtuple("EMCAL"           , "EMCAL" , "event:digits:clusters:photons");
   fhEMCALEnergy        = new TH1D("EMCALEnergy"        , "EMCALEnergy"       , 1000, 0., 10. ) ;
@@ -143,10 +177,10 @@ void AliEMCALQATask::Exec(Option_t *)
   
   //************************  EMCAL *************************************
   Int_t       firstEmcalCluster       = fESD->GetFirstEMCALCluster() ;
-  const Int_t mumberOfEmcalClusters   = fESD->GetNumberOfEMCALClusters() ;
+  const Int_t kNumberOfEmcalClusters   = fESD->GetNumberOfEMCALClusters() ;
 
-  TVector3 ** emcalVector        = new TVector3*[mumberOfEmcalClusters] ;
-  Float_t   * emcalPhotonsEnergy = new Float_t[mumberOfEmcalClusters] ;
+  TVector3 ** emcalVector        = new TVector3*[kNumberOfEmcalClusters] ;
+  Float_t   * emcalPhotonsEnergy = new Float_t[kNumberOfEmcalClusters] ;
   Int_t      emcalCluster ; 
   Int_t      numberOfEmcalClustersv1 = 0 ; 
   Int_t      numberOfPhotonsInEmcal  = 0 ;
@@ -154,21 +188,21 @@ void AliEMCALQATask::Exec(Option_t *)
 
 
   // loop over all the EMCAL Cluster
-  for(emcalCluster = firstEmcalCluster ; emcalCluster < firstEmcalCluster + mumberOfEmcalClusters ; emcalCluster++) {
+  for(emcalCluster = firstEmcalCluster ; emcalCluster < firstEmcalCluster + kNumberOfEmcalClusters ; emcalCluster++) {
     AliESDCaloCluster * caloCluster = fESD->GetCaloCluster(emcalCluster) ;
     if (caloCluster) {
       Float_t pos[3] ;
-      if(caloCluster->GetClusterType() == AliESDCaloCluster::kClusterv1) {  
-       caloCluster->GetGlobalPosition(pos) ;
+      if(caloCluster->GetClusterType() == AliESDCaloCluster::kEMCALClusterv1) {  
+       caloCluster->GetPosition(pos) ;
        fhEMCALPos->Fill(pos[0],pos[1],pos[2]) ;
-       fhEMCALEnergy->Fill(caloCluster->GetClusterEnergy()) ;
+       fhEMCALEnergy->Fill(caloCluster->E()) ;
        fhEMCALDigits->Fill(entry, caloCluster->GetNumberOfDigits()) ;
        numberOfEmcalClustersv1++ ;
        numberOfDigitsInEmcal += caloCluster->GetNumberOfDigits() ;    
        // Float_t * pid = clus->GetPid() ;
        // if(pid[AliPID::kPhoton]>0.9){
        emcalVector[numberOfPhotonsInEmcal] = new TVector3(pos[0],pos[1],pos[2]) ;
-       emcalPhotonsEnergy[numberOfPhotonsInEmcal] = caloCluster->GetClusterEnergy() ;
+       emcalPhotonsEnergy[numberOfPhotonsInEmcal] = caloCluster->E() ;
        numberOfPhotonsInEmcal++ ; 
       }
     }
@@ -272,11 +306,11 @@ void AliEMCALQATask::Terminate(Option_t *)
  
   AliInfo(Form("!!! All the eps files are in %s.tar.gz !!!", GetName())) ;
 
-  char * report ; 
+  TString report ; 
   if(problem)
     report="Problems found, please check!!!";  
   else 
     report="OK";
 
-  AliInfo(Form("*** %s Summary Report: %s \n",GetName(), report)) ; 
+  AliInfo(Form("*** %s Summary Report: %s \n",GetName(), report.Data())) ; 
 }