2 #include "THistManager.h"
3 #include <TLorentzVector.h>
7 #include "AliEMCALGeometry.h"
9 #include "AliVCaloCells.h"
10 #include "AliVCluster.h"
22 AliAnalysisTaskSE(name),
26 DefineOutput(1, TList::Class());
33 fHistos =
new THistManager(
"LEDCheck");
35 fHistos->CreateTH1(
"fNumberOfFiringCells",
"Number of non-zero cells per event", 10000, 0., 10000.);
36 fHistos->CreateTH1(
"fNumberOfFiringClusters",
" Number of clusters per event", 1000, 0., 1000.);
37 fHistos->CreateTH2(
"fNumberOfFiringCellsSM",
"Number of non-zero cells per event and supermodule", 20, -0.5, 19.5, 10000, 0., 10000.);
38 fHistos->CreateTH2(
"fNumberOfFiringClustersSM",
" Number of clusters per event", 20, -0.5, 19.5, 1000, 0., 1000.);
39 PostData(1,
fHistos->GetListOfHistograms());
44 fGeometry = AliEMCALGeometry::GetInstance();
49 TString triggers(InputEvent()->GetFiredTriggerClasses());
50 if(!(triggers.Contains(
"INT7-B") || triggers.Contains(
"EMC7-B") || triggers.Contains(
"DMC7-B")))
return;
52 const int kNsupermodule = 20;
53 Int_t ncell = 0, nclusters = 0;
54 Int_t ncellsupermodule[kNsupermodule], nclustersupermodule[kNsupermodule];
55 memset(ncellsupermodule, 0,
sizeof(Int_t) * kNsupermodule);
56 memset(nclustersupermodule, 0,
sizeof(Int_t) * kNsupermodule);
57 AliVCaloCells *emcalcells = InputEvent()->GetEMCALCells();
58 for(
int icell = 0; icell < emcalcells->GetNumberOfCells(); icell++){
59 if(emcalcells->GetCellAmplitude(icell) > 0){
61 Int_t supermoduleID = 0;
64 TVector3 globalvec(globalpos[0], globalpos[1], globalpos[2]);
65 Double_t phi = globalvec.Phi();
66 if(phi < 0) phi += 2 * TMath::Pi();
67 fGeometry->SuperModuleNumberFromEtaPhi(globalvec.Eta(), phi, supermoduleID);
68 if(supermoduleID > -1)
69 ncellsupermodule[supermoduleID]++;
73 fHistos->FillTH1(
"fNumberOfFiringCells", ncell);
74 AliVCluster *clust = NULL;
75 for(Int_t icluster = 0; icluster < InputEvent()->GetNumberOfCaloClusters(); icluster++){
76 clust = InputEvent()->GetCaloCluster(icluster);
79 TLorentzVector position;
81 InputEvent()->GetPrimaryVertexSPD()->GetXYZ(vertex);
82 clust->GetMomentum(position, vertex);
83 Int_t supermoduleID(-1);
84 Double_t phi = position.Phi();
85 if(phi < 0) phi += 2 * TMath::Pi();
86 fGeometry->SuperModuleNumberFromEtaPhi(position.Eta(), phi, supermoduleID);
87 if(supermoduleID > -1)
88 nclustersupermodule[supermoduleID]++;
92 fHistos->FillTH1(
"fNumberOfFiringClusters", nclusters);
94 for(
int ism = 0; ism < 20; ism++){
95 if(ncellsupermodule[ism])
fHistos->FillTH2(
"fNumberOfFiringCellsSM", ism, ncellsupermodule[ism]);
96 if(nclustersupermodule[ism])
fHistos->FillTH2(
"fNumberOfFiringClustersSM", ism, nclustersupermodule[ism]);
98 PostData(1,
fHistos->GetListOfHistograms());
virtual ~AliAnalysisTaskLEDCheck()
ClassImp(AliAnalysisTaskLEDCheck) AliAnalysisTaskLEDCheck
virtual void UserCreateOutputObjects()
AliEMCALGeometry * fGeometry
AliAnalysisTaskLEDCheck()
virtual void UserExec(Option_t *)
Int_t GetRunNumber(TString)