updates from Salvatore
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 29 Aug 2012 20:18:52 +0000 (20:18 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 29 Aug 2012 20:18:52 +0000 (20:18 +0000)
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskSAQA.cxx
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskSAQA.h

index c90a58d..2018163 100644 (file)
@@ -36,11 +36,16 @@ AliAnalysisTaskSAQA::AliAnalysisTaskSAQA() :
   fRepropagateTracks(kFALSE),
   fTrgClusName("ClustersL1GAMMAFEE"),
   fTrgClusters(0),
+  fNclusters(0),
+  fNtracks(0),
+  fNjets(0),
   fHistCentrality(0),
   fHistZVertex(0),
   fHistTracksCent(0),
   fHistClusCent(0),
+  fHistJetsCent(0),
   fHistClusTracks(0),
+  fHistJetsParts(0),
   fHistCellsCent(0),
   fHistCellsTracks(0),
   fHistMaxL1FastORCent(0),
@@ -93,11 +98,16 @@ AliAnalysisTaskSAQA::AliAnalysisTaskSAQA(const char *name) :
   fRepropagateTracks(kFALSE),
   fTrgClusName("ClustersL1GAMMAFEE"),
   fTrgClusters(0),
+  fNclusters(0),
+  fNtracks(0),
+  fNjets(0),
   fHistCentrality(0),
   fHistZVertex(0),
   fHistTracksCent(0),
   fHistClusCent(0),
+  fHistJetsCent(0),
   fHistClusTracks(0),
+  fHistJetsParts(0),
   fHistCellsCent(0),
   fHistCellsTracks(0),
   fHistMaxL1FastORCent(0),
@@ -172,6 +182,16 @@ void AliAnalysisTaskSAQA::UserCreateOutputObjects()
   fHistTracksCent->GetYaxis()->SetTitle("No. of tracks");
   fOutput->Add(fHistTracksCent);
 
+  fHistJetsCent = new TH2F("fHistJetsCent","Jets vs. centrality", 100, 0, 100, 60, 0, 60);
+  fHistJetsCent->GetXaxis()->SetTitle("Centrality (%)");
+  fHistJetsCent->GetYaxis()->SetTitle("No. of jets");
+  fOutput->Add(fHistJetsCent);
+
+  fHistJetsParts = new TH2F("fHistJetsParts","Jets vs. centrality", fNbins, 0, 6000, 60, 0, 60);
+  fHistJetsParts->GetXaxis()->SetTitle("No. of particles");
+  fHistJetsParts->GetYaxis()->SetTitle("No. of jets");
+  fOutput->Add(fHistJetsParts);
+
   if (fAnaType == kEMCAL || fAnaType == kEMCALOnly) {
     fHistClusCent = new TH2F("fHistClusCent","Clusters vs. centrality", 100, 0, 100, fNbins, 0, 2000);
     fHistClusCent->GetXaxis()->SetTitle("Centrality (%)");
@@ -406,6 +426,10 @@ Bool_t AliAnalysisTaskSAQA::RetrieveEventObjects()
   if (!AliAnalysisTaskEmcalJet::RetrieveEventObjects())
     return kFALSE;
 
+  fNclusters = 0;
+  fNtracks = 0;
+  fNjets = 0;
+
   if (!fTrgClusName.IsNull() && fDoTrigger && !fTrgClusters) {
     fTrgClusters =  dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTrgClusName));
     if (!fTrgClusters) {
@@ -425,30 +449,28 @@ Bool_t AliAnalysisTaskSAQA::RetrieveEventObjects()
   return kTRUE;
 }
 
+
 //________________________________________________________________________
 Bool_t AliAnalysisTaskSAQA::FillHistograms()
 {
   // Fill histograms.
 
   fHistCentrality->Fill(fCent);
-  if (fTracks)
-    fHistTracksCent->Fill(fCent, fTracks->GetEntriesFast());
-  if (fCaloClusters)
-    fHistClusCent->Fill(fCent, fCaloClusters->GetEntriesFast());
-
   fHistZVertex->Fill(fVertex[2]);
 
   Float_t trackSum = DoTrackLoop();
 
   DoJetLoop();
 
-  if (fAnaType == kEMCAL || fAnaType == kEMCALOnly) {
+  fHistTracksCent->Fill(fCent, fNtracks);
 
-    if (fTracks && fCaloClusters)
-      fHistClusTracks->Fill(fTracks->GetEntriesFast(), fCaloClusters->GetEntriesFast());
+  if (fAnaType == kEMCAL || fAnaType == kEMCALOnly) {
 
     Float_t clusSum = DoClusterLoop();
 
+    fHistClusCent->Fill(fCent, fNclusters);
+    fHistClusTracks->Fill(fNtracks, fNclusters);
+
     Float_t cellSum = 0, cellCutSum = 0;
     
     Int_t ncells = DoCellLoop(cellSum, cellCutSum);
@@ -479,6 +501,9 @@ Bool_t AliAnalysisTaskSAQA::FillHistograms()
     }
   }
 
+  fHistJetsCent->Fill(fCent, fNjets);
+  fHistJetsParts->Fill(fNtracks + fNclusters, fNjets);
+
   return kTRUE;
 }
 
@@ -538,6 +563,8 @@ Float_t AliAnalysisTaskSAQA::DoClusterLoop()
     fHistNCellsEnergy->Fill(cluster->E(), cluster->GetNCells());
 
     fHistClusTimeEnergy->Fill(cluster->E(), cluster->GetTOF());
+
+    fNclusters++;
   }
 
   return sum;
@@ -571,6 +598,8 @@ Float_t AliAnalysisTaskSAQA::DoTrackLoop()
     
     if (vtrack && !AcceptTrack(vtrack, kTRUE)) 
       continue;
+
+    fNtracks++;
     
     fHistTracksPt->Fill(track->Pt());
 
@@ -701,6 +730,8 @@ void AliAnalysisTaskSAQA::DoJetLoop()
     fHistJetsPtNonBias[fCentBin]->Fill(jet->Pt());
     fHistJetsPtAreaNonBias[fCentBin]->Fill(jet->Pt(), jet->Area());
 
+    fNjets++;
+
     if (jet->MaxTrackPt() > fPtBiasJetTrack)
       fHistJetsPtTrack[fCentBin]->Fill(jet->Pt());
     
index 75deb13..2afdfaa 100644 (file)
@@ -42,13 +42,18 @@ class AliAnalysisTaskSAQA : public AliAnalysisTaskEmcalJet {
   Bool_t                      fRepropagateTracks;        // Repropagate tracks to the EMCal surface
   TString                     fTrgClusName;              // Name of trg clus name
   TClonesArray               *fTrgClusters;              //!Trg Clusters
-
+  Int_t                       fNclusters;                //!Number of accepted clusters in the event
+  Int_t                       fNtracks;                  //!Number of accepted tracks in the event
+  Int_t                       fNjets;                    //!Number of accepted jets in the event
   // General histograms
   TH1F                       *fHistCentrality;           //!Event centrality distribution
   TH1F                       *fHistZVertex;              //!Z vertex position
   TH2F                       *fHistTracksCent;           //!Number of tracks vs. centrality
   TH2F                       *fHistClusCent;             //!Number of clusters vs. centrality
+  TH2F                       *fHistJetsCent;             //!Number of jets vs. centrality
   TH2F                       *fHistClusTracks;           //!Number of clusters vs. number of tracks
+  TH2F                       *fHistJetsParts;            //!Number of jets vs. number of particles (tracks+clusters)
   TH2F                       *fHistCellsCent;            //!Number of cells vs. centrality
   TH2F                       *fHistCellsTracks;          //!Number of cells vs. number of tracks
   // EMCAL trigger
@@ -92,6 +97,6 @@ class AliAnalysisTaskSAQA : public AliAnalysisTaskEmcalJet {
   AliAnalysisTaskSAQA(const AliAnalysisTaskSAQA&);            // not implemented
   AliAnalysisTaskSAQA &operator=(const AliAnalysisTaskSAQA&); // not implemented
 
-  ClassDef(AliAnalysisTaskSAQA, 12) // Quality task for Emcal analysis
+  ClassDef(AliAnalysisTaskSAQA, 13) // Quality task for Emcal analysis
 };
 #endif