]> git.uio.no Git - u/mrichter/AliRoot.git/blame - JETAN/AliJetFinder.cxx
o small fix
[u/mrichter/AliRoot.git] / JETAN / AliJetFinder.cxx
CommitLineData
99e5fe42 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
83a444b1 15
52ff852a 16/* $Id$ */
17
99e5fe42 18//---------------------------------------------------------------------
19// Jet finder base class
20// manages the search for jets
7d0f353c 21// Authors: jgcn@mda.cinvestav.mx
22// andreas.morsch@cern.ch
8838ab7a 23// magali.estienne@subatech.in2p3.fr
139cbd96 24// alexandre.shabetai@cern.ch
99e5fe42 25//---------------------------------------------------------------------
26
99e5fe42 27#include <TFile.h>
1d27ecd2 28
99e5fe42 29#include "AliJetFinder.h"
139cbd96 30#include "AliUA1JetHeaderV1.h"
31#include "AliAODJetEventBackground.h"
1d27ecd2 32#include "AliAODJet.h"
1d27ecd2 33#include "AliAODEvent.h"
be6e5811 34
99e5fe42 35ClassImp(AliJetFinder)
36
139cbd96 37///////////////////////////////////////////////////////////////////////
38
1b7d5d7e 39AliJetFinder::AliJetFinder():
139cbd96 40 fHeader(0x0),
41 fAODjets(0x0),
42 fNAODjets(0),
43 fAODEvBkg(0),
44 fDebug(0),
45 fCalTrkEvent(0x0)
99e5fe42 46{
99e5fe42 47 // Constructor
99e5fe42 48}
49
139cbd96 50//-----------------------------------------------------------------------
99e5fe42 51AliJetFinder::~AliJetFinder()
52{
8838ab7a 53 // Destructor
99e5fe42 54}
55
139cbd96 56//-----------------------------------------------------------------------
57void AliJetFinder::WriteHeader()
99e5fe42 58{
139cbd96 59 // Write the Headers
60 TFile* f = new TFile("jets_local.root", "recreate");
61 WriteHeaderToFile();
62 f->Close();
7d0f353c 63
7d0f353c 64}
65
139cbd96 66//-----------------------------------------------------------------------
67void AliJetFinder::WriteHeaderToFile()
7d0f353c 68{
139cbd96 69 // write reader header
70 AliJetHeader *rh = GetJetHeader();
71 rh->Write();
7d0f353c 72
7d0f353c 73}
74
139cbd96 75//-----------------------------------------------------------------------
76Bool_t AliJetFinder::ProcessEvent()
8838ab7a 77{
8838ab7a 78 // Process one event
8838ab7a 79
139cbd96 80 // Find jets
8838ab7a 81 FindJets();
8838ab7a 82
8838ab7a 83 Reset();
8838ab7a 84 return kTRUE;
8838ab7a 85
139cbd96 86}
7d0f353c 87
139cbd96 88//-----------------------------------------------------------------------
1d27ecd2 89void AliJetFinder::AddJet(AliAODJet p)
90{
139cbd96 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!");}
94
1d27ecd2 95}
96
139cbd96 97//-----------------------------------------------------------------------
1240edf5 98void AliJetFinder::ConnectAOD(const AliAODEvent* aod)
1d27ecd2 99{
139cbd96 100 // Connect to the AOD
101 fAODjets = aod->GetJets();
102 fAODEvBkg = (AliAODJetEventBackground*)(aod->FindListObject(AliAODJetEventBackground::StdBranchName()));
103
1d27ecd2 104}
4aa71b6f 105
139cbd96 106//-----------------------------------------------------------------------
4aa71b6f 107void AliJetFinder::ConnectAODNonStd(AliAODEvent* aod,const char *bname)
108{
139cbd96 109 // Connect non standard AOD jet and jet background branches
4aa71b6f 110 fAODjets = dynamic_cast<TClonesArray*>(aod->FindListObject(bname));
bcec7a80 111 fAODEvBkg = (AliAODJetEventBackground*)(aod->FindListObject(Form("%s_%s",AliAODJetEventBackground::StdBranchName(),bname)));
112 // how is this is reset? Cleared? -> by the UserExec!!
139cbd96 113
4aa71b6f 114}
8838ab7a 115