]> git.uio.no Git - u/mrichter/AliRoot.git/blob - JETAN/AliJetReader.cxx
preparation for recalculation of rho
[u/mrichter/AliRoot.git] / JETAN / AliJetReader.cxx
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  **************************************************************************/
15  
16 //------------------------------------------------------------------------
17 // Jet reader base class
18 // manages the reading of input for jet algorithms
19 // Authors: jgcn@mda.cinvestav.mx
20 //          magali.estienne@IReS.in2p3.fr
21 //------------------------------------------------------------------------
22
23 // root
24 #include <TClonesArray.h>
25 #include <TRefArray.h>
26 #include "TTask.h"
27 //AliRoot
28 #include "AliJetReader.h"
29 #include "AliJetReaderHeader.h"
30 #include "AliESDEvent.h"
31 #include "AliHeader.h"
32 #include "AliJetESDFillUnitArrayTracks.h" 
33 #include "AliJetESDFillUnitArrayEMCalDigits.h"
34 #include "AliJetUnitArray.h"
35 #include "AliJetHadronCorrectionv1.h"
36
37 ClassImp(AliJetReader)
38
39 ////////////////////////////////////////////////////////////////////////
40
41 AliJetReader::AliJetReader():
42   // Constructor
43   fChain(0), 
44   fTree(0), 
45   fMomentumArray(new TClonesArray("TLorentzVector",4000)),
46   fArrayMC(0),
47   fFillUnitArray(new TTask("fillUnitArray","Fill unit array jet finder")),
48   fESD(0),
49   fReaderHeader(0),
50   fAliHeader(0),
51   fSignalFlag(0),
52   fCutFlag(0),
53   fUnitArray(new TClonesArray("AliJetUnitArray",60000)),
54   fArrayInitialised(0),
55   fFillUAFromTracks(new AliJetESDFillUnitArrayTracks()), 
56   fFillUAFromEMCalDigits(new AliJetESDFillUnitArrayEMCalDigits()),
57   fNumCandidate(0),
58   fNumCandidateCut(0),
59   fHadronCorrector(0),
60   fHCorrection(0),
61   fECorrection(0),
62   fEFlag(kFALSE)
63 {
64   // Default constructor
65   fSignalFlag = TArrayI();
66   fCutFlag    = TArrayI();
67 }
68
69 ////////////////////////////////////////////////////////////////////////
70
71 AliJetReader::~AliJetReader()
72 {
73   // Destructor
74   if (fMomentumArray) {
75       fMomentumArray->Delete();
76       delete fMomentumArray;
77   }
78   
79   if (fUnitArray) {
80       fUnitArray->Delete();
81       delete fUnitArray;
82   }
83   
84   if (fFillUnitArray) {
85     delete fFillUnitArray;
86   }
87   if (fArrayMC) {
88       fArrayMC->Delete();
89       delete fArrayMC;
90   }
91   
92 }
93
94
95 ////////////////////////////////////////////////////////////////////////
96
97 void AliJetReader::ClearArray()
98 {
99   if (fMomentumArray)  fMomentumArray->Clear();
100   if (fFillUnitArray)  fFillUnitArray->Clear();
101 }