fDebug(0),
fJetFinder(0x0),
fChain(0x0),
- fESD(0x0)
+ fESD(0x0),
+ fTreeJ(0x0)
{
// Default constructor
}
fDebug(0),
fJetFinder(0x0),
fChain(0x0),
- fESD(0x0)
+ fESD(0x0),
+ fTreeJ(0x0)
{
// Default constructor
DefineInput (0, TChain::Class());
-// DefineOutput(0, TTree::Class());
+ DefineOutput(0, TTree::Class());
+}
+
+void AliAnalysisTaskJets::CreateOutputObjects()
+{
+// Create the output container
+ fTreeJ = fJetFinder->MakeTreeJ("TreeJ");
}
void AliAnalysisTaskJets::Init()
{
// Initialization
if (fDebug > 1) printf("AnalysisTaskJets::Init() \n");
+
// Call configuration file
gROOT->LoadMacro("ConfigJetAnalysis.C");
fJetFinder = (AliJetFinder*) gInterpreter->ProcessLine("ConfigJetAnalysis()");
// Connect the input data
//
if (fDebug > 1) printf("AnalysisTaskJets::ConnectInputData() \n");
+
fChain = (TChain*)GetInputData(0);
fJetFinder->ConnectTree(fChain);
fJetFinder->WriteHeaders();
// Execute analysis for current event
//
Long64_t ientry = fChain->GetReadEntry();
- if (fDebug > 1) printf("Analysing event # %5d \n", (Int_t) ientry);
-
+ if (fDebug > 1) printf("Analysing event # %5d \n", (Int_t) ientry);
fJetFinder->ProcessEvent(ientry);
+ PostData(0, fTreeJ);
}
void AliAnalysisTaskJets::Terminate(Option_t */*option*/)
// Terminate analysis
//
if (fDebug > 1) printf("AnalysisJets: Terminate() \n");
+
if (fJetFinder) fJetFinder->FinishRun();
}
virtual ~AliAnalysisTaskJets() {;}
// Implementation of interface methods
virtual void ConnectInputData(Option_t *option = "");
+ virtual void CreateOutputObjects();
virtual void Init();
virtual void Exec(Option_t *option);
virtual void Terminate(Option_t *option);
AliJetFinder* fJetFinder; // Pointer to the jet finder
TChain* fChain; //! chained files
AliESD* fESD; //! ESD
+ TTree* fTreeJ; // tree of reconstructed jets
ClassDef(AliAnalysisTaskJets, 1); // Analysis task for standard jet analysis
};
void InitParameters();
protected:
AliJetDummyGeo *fGeom; //! EMCAL Geometry
- TChain *fChain; //!chain for reconstructed tracks
- AliESD *fESD; //!pointer to esd
+ TChain *fChain; //! chain for reconstructed tracks
+ AliESD *fESD; //! pointer to esd
AliJetHadronCorrectionv1 *fHadCorr; //! Pointer to Hadron Correction Object
AliJetGrid *fTpcGrid; //! Pointer to grid object
AliJetGrid *fEmcalGrid; //! Pointer to grid object
ClassImp(AliJetFinder)
AliJetFinder::AliJetFinder():
- fJetT(0),
+ fTreeJ(0),
fPlotMode(kFALSE),
fJets(0),
fGenJets(0),
void AliJetFinder::SetOutputFile(const char *name)
{
- // opens output file
- fOut = new TFile(name,"recreate");
+ // opens output file
+ // fOut = new TFile(name,"recreate");
}
////////////////////////////////////////////////////////////////////////
}
////////////////////////////////////////////////////////////////////////
-
-void AliJetFinder::WriteJetsToFile(Int_t i)
+TTree* AliJetFinder::MakeTreeJ(char* name)
{
- // Writes the jets to file
- fOut->cd();
- char hname[30];
- sprintf(hname,"TreeJ%d",i);
- fJetT = new TTree(hname,"AliJet");
- fJetT->Branch("FoundJet",&fJets,1000);
- fJetT->Branch("GenJet",&fGenJets,1000);
- fJetT->Branch("LeadingPart",&fLeading,1000);
- fJetT->Fill();
- fJetT->Write(hname);
- delete fJetT;
+ // Create the tree for reconstructed jets
+ fOut = new TFile("jets.root","recreate");
+ fOut->cd();
+ fTreeJ = new TTree(name, "AliJet");
+ fTreeJ->Branch("FoundJet", &fJets, 1000);
+ fTreeJ->Branch("GenJet", &fGenJets,1000);
+ fTreeJ->Branch("LeadingPart",&fLeading,1000);
+ return fTreeJ;
}
////////////////////////////////////////////////////////////////////////
if(debug > 1) printf("In FindJets() routine: find jets with fUnitArray !!!\n");
FindJets();
}
- if (fOut) WriteJetsToFile(i);
+ if (fOut) {
+ fOut->cd();
+ fTreeJ->Fill();
+ }
+
if (fPlots) fPlots->FillHistos(fJets);
fLeading->Reset();
fGenJets->ClearJets();
//
// Process one event
//
- printf("<<<<< Processing Event %5d >>>>> \n", (Int_t) entry);
+ Int_t debug = fReader->GetReaderHeader()->GetDebug();
+ if (debug > 0) printf("<<<<< Processing Event %5d >>>>> \n", (Int_t) entry);
Bool_t ok = fReader->FillMomentumArray(entry);
if (!ok) return kFALSE;
fLeading->FindLeading(fReader);
FindJets();
- if (fOut) WriteJetsToFile(entry);
+ if (fOut) {
+ fOut->cd();
+ fTreeJ->Fill();
+ }
+
if (fPlots) fPlots->FillHistos(fJets);
fLeading->Reset();
fGenJets->ClearJets();
void AliJetFinder::FinishRun()
{
// Finish a run
- if (fPlots) {
- fPlots->Normalize();
- fPlots->PlotHistos();
- if (fOut) {
- fOut->cd();
- fPlots->Write();
- fOut->Close();
- }
- } else {
- if (fOut) fOut->Close();
- }
+ if (fPlots) {
+ fPlots->Normalize();
+ fPlots->PlotHistos();
+ }
+
+ if (fOut) {
+ fOut->cd();
+ fTreeJ->Write();
+ if (fPlots) {
+ fPlots->Write();
+ }
+ fOut->Close();
+ }
}
virtual void SetOutputFile(const char *name="jets.root");
virtual void SetJetReader(AliJetReader* r) {fReader=r;}
virtual void SetJetHeader(AliJetHeader* h) {fHeader=h;}
-
// others
virtual void PrintJets();
virtual void Run();
- virtual void WriteJetsToFile(Int_t i);
virtual void WriteRHeaderToFile();
// the following have to be implemented for each specific finder
virtual void Init() {}
virtual Bool_t ProcessEvent(Long64_t entry);
virtual void FinishRun();
virtual void ConnectTree(TTree* tree);
+ virtual TTree* MakeTreeJ(char* name);
virtual void WriteHeaders();
-
+ virtual void WriteJetsToFile() {;}
+ virtual void TestJet() {;}
protected:
AliJetFinder(const AliJetFinder& rJetFinder);
AliJetFinder& operator = (const AliJetFinder& rhsf);
- TTree* fJetT; //! pointer to jet tree
- Bool_t fPlotMode; //! do you want control plots?
+ TTree* fTreeJ; //! pointer to jet tree
+ Bool_t fPlotMode; //! do you want control plots?
AliJet* fJets; //! pointer to jet class
AliJet* fGenJets; //! pointer to generated jets
AliLeading* fLeading; //! pointer to leading particle data
ClassImp(AliJetHadronCorrection)
+AliJetHadronCorrection::AliJetHadronCorrection() {}
+
AliJetHadronCorrection::AliJetHadronCorrection(const char *name,const char *title)
:TNamed(name,title) { }
protected:
AliUA1JetFinderV1(const AliUA1JetFinderV1& rJetF1);
AliUA1JetFinderV1& operator = (const AliUA1JetFinderV1& rhsf);
- TH2F * fLego; // Lego Histo
-
+ TH2F * fLego; //Lego Histo
ClassDef(AliUA1JetFinderV1,1)
};