]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - JETAN/AliJetFinder.cxx
Monalisa configuration added: host and table name
[u/mrichter/AliRoot.git] / JETAN / AliJetFinder.cxx
index 67d76bec640512ea3ef851d1e3baae34c6c08a19..02416cc4b6c0e9303d56dcf9f4410967a76893db 100644 (file)
 
 #include <Riostream.h>
 #include <TFile.h>
+#include <TClonesArray.h>
+
 #include "AliJetFinder.h"
 #include "AliJet.h"
+#include "AliAODJet.h"
 #include "AliJetReader.h"
 #include "AliJetReaderHeader.h"
 #include "AliJetControlPlots.h"
 #include "AliLeading.h"
+#include "AliAODEvent.h"
 
 ClassImp(AliJetFinder)
 
@@ -41,6 +45,8 @@ AliJetFinder::AliJetFinder():
     fLeading(0),
     fReader(0x0),
     fHeader(0x0),
+    fAODjets(0x0),
+    fNAODjets(0),
     fPlots(0x0),
     fOut(0x0)
     
@@ -49,6 +55,7 @@ AliJetFinder::AliJetFinder():
   fJets    = new AliJet();
   fGenJets = new AliJet();
   fLeading = new AliLeading();
+  fAODjets = 0;
 }
 
 ////////////////////////////////////////////////////////////////////////
@@ -156,7 +163,6 @@ void AliJetFinder::Run()
       }
       if (fOut) {
          fOut->cd();
-         fTreeJ->Fill();
       }
       
       if (fPlots) fPlots->FillHistos(fJets);
@@ -213,8 +219,6 @@ Bool_t AliJetFinder::ProcessEvent(Long64_t entry)
     fLeading->FindLeading(fReader);
     // Jets
     FindJets();
-    // Fill the tree
-    fTreeJ->Fill();
 
     if (fPlots) fPlots->FillHistos(fJets);
     fLeading->Reset();
@@ -233,7 +237,6 @@ void AliJetFinder::FinishRun()
     
     if (fOut) {
         fOut->cd();
-        fTreeJ->Write();
         if (fPlots) {
             fPlots->Write();
         }
@@ -241,3 +244,14 @@ void AliJetFinder::FinishRun()
     }
 }
 
+void AliJetFinder::AddJet(AliAODJet p)
+{
+// Add new jet to the list
+  new ((*fAODjets)[fNAODjets++]) AliAODJet(p);
+}
+
+void AliJetFinder::ConnectAOD(AliAODEvent* aod)
+{
+// Connect to the AOD
+    fAODjets = aod->GetJets();
+}