1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //---------------------------------------------------------------------
19 // Jet finder base class
20 // manages the search for jets
21 // Authors: jgcn@mda.cinvestav.mx
22 // andreas.morsch@cern.ch
23 // magali.estienne@subatech.in2p3.fr
24 // alexandre.shabetai@cern.ch
25 //---------------------------------------------------------------------
29 #include "AliJetFinder.h"
30 #include "AliUA1JetHeaderV1.h"
31 #include "AliAODJetEventBackground.h"
32 #include "AliAODJet.h"
33 #include "AliAODEvent.h"
35 ClassImp(AliJetFinder)
37 ///////////////////////////////////////////////////////////////////////
39 AliJetFinder::AliJetFinder():
50 //-----------------------------------------------------------------------
51 AliJetFinder::~AliJetFinder()
56 //-----------------------------------------------------------------------
57 void AliJetFinder::WriteHeader()
60 TFile* f = new TFile("jets_local.root", "recreate");
66 //-----------------------------------------------------------------------
67 void AliJetFinder::WriteHeaderToFile()
69 // write reader header
70 AliJetHeader *rh = GetJetHeader();
75 //-----------------------------------------------------------------------
76 Bool_t AliJetFinder::ProcessEvent()
88 //-----------------------------------------------------------------------
89 void AliJetFinder::AddJet(AliAODJet p)
91 // Add new jet to the list
92 if (fAODjets) { new ((*fAODjets)[fNAODjets++]) AliAODJet(p);}
93 else { Warning("AliJetFinder::AddJet(AliAODJet p)","fAODjets is null!");}
97 //-----------------------------------------------------------------------
98 void AliJetFinder::ConnectAOD(const AliAODEvent* aod)
100 // Connect to the AOD
101 fAODjets = aod->GetJets();
102 fAODEvBkg = (AliAODJetEventBackground*)(aod->FindListObject(AliAODJetEventBackground::StdBranchName()));
106 //-----------------------------------------------------------------------
107 void AliJetFinder::ConnectAODNonStd(AliAODEvent* aod,const char *bname)
109 // Connect non standard AOD jet and jet background branches
110 fAODjets = dynamic_cast<TClonesArray*>(aod->FindListObject(bname));
111 fAODEvBkg = (AliAODJetEventBackground*)(aod->FindListObject(Form("%s_%s",AliAODJetEventBackground::StdBranchName(),bname)));
112 // how is this is reset? Cleared? -> by the UserExec!!