//_________________________________________________________________________
// 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"
AliAnalysisTask(name,""),
fChain(0),
fESD(0),
+ fOutputContainer(0),
fhEMCALPos(0),
fhEMCAL(0),
fhEMCALEnergy(0),
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()
{
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. ) ;
//************************ 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 ;
// 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++ ;
}
}
fhEMCALPhotons = (TH1I*)fOutputContainer->At(5);
fhEMCALInvariantMass = (TH1D*)fOutputContainer->At(6);
fhEMCALDigitsEvent = (TH1I*)fOutputContainer->At(7);
- printf("EMCALEnergy Mean : %5.3f , RMS : %5.3f \n", fhEMCALEnergy->GetMean(), fhEMCALEnergy->GetRMS() ) ;
- printf("EMCALDigits Mean : %5.3f , RMS : %5.3f \n", fhEMCALDigits->GetMean(), fhEMCALDigits->GetRMS() ) ;
- printf("EMCALRecParticles Mean : %5.3f , RMS : %5.3f \n", fhEMCALRecParticles->GetMean(), fhEMCALRecParticles->GetRMS() ) ;
- printf("EMCALPhotons Mean : %5.3f , RMS : %5.3f \n", fhEMCALPhotons->GetMean(), fhEMCALPhotons->GetRMS() ) ;
- printf("EMCALInvariantMass Mean : %5.3f , RMS : %5.3f \n", fhEMCALInvariantMass->GetMean(), fhEMCALInvariantMass->GetRMS() ) ;
- printf("EMCALDigitsEvent Mean : %5.3f , RMS : %5.3f \n", fhEMCALDigitsEvent->GetMean(), fhEMCALDigitsEvent->GetRMS() ) ;
+
+ Bool_t problem = kFALSE ;
+ AliInfo(Form(" *** %s Report:", GetName())) ;
+ printf(" EMCALEnergy Mean : %5.3f , RMS : %5.3f \n", fhEMCALEnergy->GetMean(), fhEMCALEnergy->GetRMS() ) ;
+ printf(" EMCALDigits Mean : %5.3f , RMS : %5.3f \n", fhEMCALDigits->GetMean(), fhEMCALDigits->GetRMS() ) ;
+ printf(" EMCALRecParticles Mean : %5.3f , RMS : %5.3f \n", fhEMCALRecParticles->GetMean(), fhEMCALRecParticles->GetRMS() ) ;
+ printf(" EMCALPhotons Mean : %5.3f , RMS : %5.3f \n", fhEMCALPhotons->GetMean(), fhEMCALPhotons->GetRMS() ) ;
+ printf(" EMCALInvariantMass Mean : %5.3f , RMS : %5.3f \n", fhEMCALInvariantMass->GetMean(), fhEMCALInvariantMass->GetRMS() ) ;
+ printf(" EMCALDigitsEvent Mean : %5.3f , RMS : %5.3f \n", fhEMCALDigitsEvent->GetMean(), fhEMCALDigitsEvent->GetRMS() ) ;
TCanvas * cEMCAL = new TCanvas("EMCAL", "EMCAL ESD Test", 400, 10, 600, 700);
cEMCAL->Divide(3, 2) ;
cEMCAL->cd(1) ;
- gPad->SetLogy();
+ if ( fhEMCALEnergy->GetMaximum() > 0. )
+ gPad->SetLogy();
fhEMCALEnergy->SetAxisRange(0, 25.);
fhEMCALEnergy->SetXTitle("Energy (GeV)");
fhEMCALEnergy->Draw();
cEMCAL->cd(2) ;
- gPad->SetLogy();
+ if ( fhEMCALDigits->GetMaximum() > 0. )
+ gPad->SetLogy();
fhEMCALDigits->SetAxisRange(0, 25.);
fhEMCALDigits->SetXTitle("DigitsPerCluster");
fhEMCALDigits->Draw();
cEMCAL->cd(3) ;
- gPad->SetLogy();
+ if ( fhEMCALRecParticles->GetMaximum() > 0. )
+ gPad->SetLogy();
fhEMCALRecParticles->SetAxisRange(0, 25.);
fhEMCALRecParticles->SetXTitle("RecParticles");
fhEMCALRecParticles->Draw();
cEMCAL->cd(4) ;
- gPad->SetLogy();
+ if ( fhEMCALPhotons->GetMaximum() > 0. )
+ gPad->SetLogy();
fhEMCALPhotons->SetAxisRange(0, 25.);
fhEMCALPhotons->SetXTitle("Photons");
fhEMCALPhotons->Draw();
fhEMCALInvariantMass->Draw();
cEMCAL->cd(6) ;
- gPad->SetLogy();
+ if ( fhEMCALDigitsEvent->GetMaximum() > 0. )
+ gPad->SetLogy();
fhEMCALDigitsEvent->SetAxisRange(0, 40.);
fhEMCALDigitsEvent->SetXTitle("DigitsPerEvent");
fhEMCALDigitsEvent->Draw();
cEMCAL->Print("EMCAL.eps");
char line[1024] ;
- sprintf(line, ".!tar -zcvf %s.tar.gz *.eps", GetName()) ;
+ sprintf(line, ".!tar -zcf %s.tar.gz *.eps", GetName()) ;
gROOT->ProcessLine(line);
sprintf(line, ".!rm -fR *.eps");
gROOT->ProcessLine(line);
- AliInfo(Form("!!! All the eps files are in %s.tar.gz !!! \n", GetName())) ;
+ AliInfo(Form("!!! All the eps files are in %s.tar.gz !!!", GetName())) ;
+
+ TString report ;
+ if(problem)
+ report="Problems found, please check!!!";
+ else
+ report="OK";
+
+ AliInfo(Form("*** %s Summary Report: %s \n",GetName(), report.Data())) ;
}