#include <TInterpreter.h>
#include <TChain.h>
#include <TFile.h>
-#include <TH1.h>
+#include <TList.h>
#include "AliAnalysisTaskJets.h"
#include "AliAnalysisManager.h"
#include "AliJetFinder.h"
+#include "AliJetHistos.h"
#include "AliESDEvent.h"
#include "AliAODEvent.h"
#include "AliAODHandler.h"
fESD(0x0),
fAOD(0x0),
fTreeA(0x0),
- fHisto(0x0)
+ fHistos(0x0),
+ fListOfHistos(0x0)
{
// Default constructor
}
fESD(0x0),
fAOD(0x0),
fTreeA(0x0),
- fHisto(0x0)
+ fHistos(0x0),
+ fListOfHistos(0x0)
{
// Default constructor
DefineInput (0, TChain::Class());
DefineOutput(0, TTree::Class());
- DefineOutput(1, TH1F::Class());
+ DefineOutput(1, TList::Class());
}
void AliAnalysisTaskJets::CreateOutputObjects()
fTreeA = handler->GetTree();
fJetFinder->ConnectAOD(fAOD);
//
-// Histogram
+// Histograms
OpenFile(1);
- fHisto = new TH1F("fHisto", "Jet Et", 100, 0., 100.);
-
+ fListOfHistos = new TList();
+ fHistos = new AliJetHistos();
+ fHistos->AddHistosToList(fListOfHistos);
}
void AliAnalysisTaskJets::Init()
Long64_t ientry = fChain->GetReadEntry();
if (fDebug > 1) printf("Analysing event # %5d\n", (Int_t) ientry);
fJetFinder->ProcessEvent(ientry);
+
+ // Fill control histos
+ fHistos->FillHistos(fAOD->GetJets());
+
+ // Post the data
PostData(0, fTreeA);
- PostData(1, fHisto);
+ PostData(1, fListOfHistos);
}
void AliAnalysisTaskJets::Terminate(Option_t */*option*/)
class AliESDEvent;
class TChain;
class AliAODEvent;
+class AliJetHistos;
+
class AliAnalysisTaskJets : public AliAnalysisTask
{
virtual void SetDebugLevel(Int_t level) {fDebug = level;}
private:
- Int_t fDebug; // Debug flag
- AliJetFinder* fJetFinder; // Pointer to the jet finder
- TChain* fChain; //! chained files
- AliESDEvent* fESD; //! ESD
- AliAODEvent* fAOD; //! AOD
- TTree* fTreeA; // tree of reconstructed jets
- TH1F* fHisto; // Histogram
- ClassDef(AliAnalysisTaskJets, 1); // Analysis task for standard jet analysis
+ Int_t fDebug; // Debug flag
+ AliJetFinder* fJetFinder; // Pointer to the jet finder
+ TChain* fChain; //! chained files
+ AliESDEvent* fESD; //! ESD
+ AliAODEvent* fAOD; //! AOD
+ TTree* fTreeA; // tree of reconstructed jets
+ AliJetHistos* fHistos; // Histogram manager class
+ TList* fListOfHistos; // Output list of histograms
+
+ ClassDef(AliAnalysisTaskJets, 2); // Analysis task for standard jet analysis
};
#endif
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/* $Id$ */
+
+#include <TList.h>
+#include <TClonesArray.h>
+#include <TH1I.h>
+#include <TH1F.h>
+#include <TMath.h>
+
+#include "AliAODJet.h"
+#include "AliJetHistos.h"
+
+ClassImp(AliJetHistos)
+
+AliJetHistos::AliJetHistos():
+ fNJetsH(0x0),
+ fPtH(0x0),
+ fEtaH(0x0),
+ fEneH(0x0),
+ fPhiH(0x0)
+{
+ // Default constructor
+
+ fNJetsH = new TH1I("NJetsH","Number of Jets",12,0,11);
+ SetProperties(fNJetsH,"Number of jets","Entries");
+
+ fPtH = new TH1F("PtH","Pt of Jets",50,0.,200.);
+ SetProperties(fPtH,"P_{#perp} [GeV]","Entries");
+
+ fEtaH = new TH1F("EtaH","Pseudorapidity of Jets",30,-1.5,1.5);
+ SetProperties(fEtaH,"#eta","Entries");
+
+ fEneH = new TH1F("EneH","Energy of Jets",50,0.,200.);
+ SetProperties(fEneH,"Energy [GeV]","Entries");
+
+ fPhiH = new TH1F("PhiH","Azimuthal angle of Jets",
+ 60,0.,2.0*TMath::Pi());
+ SetProperties(fPhiH,"#phi","Entries");
+}
+
+AliJetHistos::~AliJetHistos()
+{
+ delete fNJetsH;
+ delete fPtH;
+ delete fEtaH;
+ delete fEneH;
+ delete fPhiH;
+}
+
+void AliJetHistos::SetProperties(TH1* h,const char* x, const char* y) const
+{
+// Sets the histogram style properties
+ h->SetMarkerStyle(20);
+ h->SetMarkerSize(.5);
+ h->SetMarkerColor(2);
+ h->SetXTitle(x);
+ h->SetYTitle(y);
+ h->Sumw2();
+}
+
+void AliJetHistos::AddHistosToList(TList *list)
+{
+ list->Add(fNJetsH);
+ list->Add(fPtH);
+ list->Add(fEtaH);
+ list->Add(fEneH);
+ list->Add(fPhiH);
+}
+
+
+void AliJetHistos::FillHistos(TClonesArray *jets)
+{
+ Int_t nj = jets->GetEntries();
+ fNJetsH->Fill(nj,1);
+
+ if (nj == 0 ) return;
+
+ AliAODJet *j;
+ for (Int_t i=0;i<nj;i++) {
+ j = (AliAODJet *) jets->At(i);
+ fPtH->Fill(j->Pt(),1);
+ fEtaH->Fill(j->Eta(),1);
+ fEneH->Fill(j->E(),1);
+ fPhiH->Fill(j->Phi(),1);
+ }
+
+}
--- /dev/null
+#ifndef ALIJETHISTOS_H
+#define ALIJETHISTOS_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+class Tlist;
+class TClonesArray;
+class TH1I;
+class TH1F;
+
+class AliJetHistos : public TObject {
+ public:
+ AliJetHistos();
+ ~AliJetHistos();
+
+ void AddHistosToList(TList *list);
+ void FillHistos(TClonesArray *jets);
+
+ protected:
+ void SetProperties(TH1* h,const char* x, const char* y) const;
+ private:
+
+ TH1I *fNJetsH; // distribution of number of jets
+ TH1F *fPtH; // pt spectra
+ TH1F *fEtaH; // eta distribution
+ TH1F *fEneH; // energy distribution
+ TH1F *fPhiH; // phi distribution
+
+
+ ClassDef(AliJetHistos,1)
+};
+
+#endif
+
#pragma link C++ class AliJetKineReaderHeader;
#pragma link C++ class AliJetMCReader;
#pragma link C++ class AliJetMCReaderHeader;
+#pragma link C++ class AliJetHistos+;
#endif
AliJetKineReader.cxx \
AliJetKineReaderHeader.cxx \
AliJetMCReader.cxx \
- AliJetMCReaderHeader.cxx
+ AliJetMCReaderHeader.cxx \
+ AliJetHistos.cxx
HDRS:= $(SRCS:.cxx=.h)