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 **************************************************************************/
19 //_________________________________________________________________________
20 // Output object for jetfinder
22 //*-- Author: Renan Cabrera (LBL)
23 // Mark Horner (LBL/UCT)
28 #include <TParticle.h>
31 //.....................
32 #include "AliEMCALJet.h"
33 #include "AliEMCALParton.h"
34 #include "AliEMCALJetFinderOutput.h"
35 #include "AliEMCALJetFinderInput.h"
37 ClassImp(AliEMCALJetFinderOutput)
39 //________________________________________________________________________
40 AliEMCALJetFinderOutput::AliEMCALJetFinderOutput(){
41 // Default constructor
52 if (fDebug>0) Info("AliEMCALJetFinderOutput","Beginning Constructor");
54 } //________________________________________________________________________
55 void AliEMCALJetFinderOutput::InitArrays()
57 // Initialise arrays - legacy from TClones days
58 if (fDebug>1) Info("AliEMCALJetFinderOutput","Beginning InitArrays");
62 //_______________________________________________________________________
63 AliEMCALJetFinderOutput::~AliEMCALJetFinderOutput()
66 if (fDebug>0) Info("~AliEMCALJetFinderOutput","Beginning Destructor");
69 //_______________________________________________________________________
70 void AliEMCALJetFinderOutput::Reset(AliEMCALJetFinderResetType_t resettype)
74 if (fDebug>1) Info("Reset","Beginning Reset");
75 if (!fInitialised) InitArrays();
76 if ( resettype == kResetAll ||
77 resettype == kResetJets||
78 resettype == kResetData ){
81 if ( resettype == kResetAll ||
82 resettype == kResetPartons||
83 resettype == kResetData ){
86 if ( resettype == kResetAll ||
87 resettype == kResetParticles||
88 resettype == kResetData ){
92 //________________________________________________________________________
93 void AliEMCALJetFinderOutput::AddJet(AliEMCALJet* jet)
95 // Add a jet to the array
97 if (fDebug>1) Info("AddJet","Beginning AddJet");
98 if (!fInitialised) InitArrays();
101 if (fNJets < fNMaxJets){
102 new( &fJetsArray[fNJets]) AliEMCALJet( *jet );
106 Error("AddJet","Cannot AddJet - maximum exceeded");
112 //_______________________________________________________________________
113 void AliEMCALJetFinderOutput::AddParton(AliEMCALParton* parton)
115 //Add a parton to the array
117 if (fDebug>1) Info("AddParton","Beginning AddParton");
118 if (!fInitialised) InitArrays();
120 if (fNPartons < fNMaxPartons){
121 new( &fPartonsArray[fNPartons] ) AliEMCALParton( *parton );
125 Error("AddParton","Cannot AddParton - maximum exceeded");
130 //_______________________________________________________________________
131 void AliEMCALJetFinderOutput::AddParticle(TParticle* particle)
133 //Add a particle tot he array
135 if (fDebug>1) Info("AddParticle","Beginning AddParticle");
136 if (!fInitialised) InitArrays();
138 if (fNParticles < fNMaxParticles){
139 new( &fParticlesArray[fNParticles] ) TParticle( *particle );
143 Error("AddParticle","Cannot AddParticle - maximum exceeded");
147 //______________________________________________________________________
148 AliEMCALJet* AliEMCALJetFinderOutput::GetJet(Int_t jetID)
151 if (fDebug>1) Info("GetJet","Beginning GetJet");
153 if (jetID >= fNJets) return 0;
154 return &(fJetsArray[jetID]);
158 //______________________________________________________________________
159 AliEMCALParton* AliEMCALJetFinderOutput::GetParton(Int_t partonID)
162 if (fDebug>1) Info("GetParton","Beginning GetParton");
164 if (partonID >= fNPartons) return 0;
165 return &(fPartonsArray[partonID]);
168 //______________________________________________________________________
169 TParticle* AliEMCALJetFinderOutput::GetParticle(Int_t particleID)
173 if (fDebug>1) Info("GetParticle","Beginning GetParticle");
175 if (particleID >= fNParticles) return 0;
176 return &(fParticlesArray[particleID]);