Coverity 16571
[u/mrichter/AliRoot.git] / STEER / AliAODPWG4ParticleCorrelation.cxx
CommitLineData
1c5acb87 1/**************************************************************************
2 * Copyright(c) 1998-2007, 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/* $Id: AliAODPWG4ParticleCorrelation.h $ */
17
18//-------------------------------------------------------------------------
19// AOD class for photon and other particles storage and
20// correlation studies
21// Author: Yves Schutz, CERN, Gustavo Conesa, INFN
22//-------------------------------------------------------------------------
23
24//-- ROOT system --
25
26//-- Analysis system
27#include "AliAODPWG4ParticleCorrelation.h"
5e6a3170 28#include "AliAODJet.h"
1c5acb87 29
30ClassImp(AliAODPWG4ParticleCorrelation)
31
32
33//______________________________________________________________________________
477d6cee 34 AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation() :
35 AliAODPWG4Particle(), fIsolated(kFALSE),
f284616d 36 fLeadingParticle(kTRUE),
a3aebfff 37 fLeadingDetector(""), fLeading(), fCorrJet(), fCorrBkg(), fRefJet(0),
591cc579 38 fListOfObjArrays(new TList)
1c5acb87 39{
40 // constructor
0da5958d 41 fListOfObjArrays->SetOwner(kTRUE);
1c5acb87 42}
43
44//______________________________________________________________________________
45AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(Double_t px, Double_t py, Double_t pz, Double_t e):
477d6cee 46 AliAODPWG4Particle(), fIsolated(kFALSE),
f284616d 47 fLeadingParticle(kTRUE),
477d6cee 48 fLeadingDetector(""), fLeading(), fCorrJet(),
591cc579 49 fCorrBkg(), fRefJet(0), fListOfObjArrays(new TList)
1c5acb87 50{
51 // constructor
477d6cee 52 SetMomentum(new TLorentzVector(px, py, pz, e));
0da5958d 53 fListOfObjArrays->SetOwner(kTRUE);
54
1c5acb87 55}
56
57//______________________________________________________________________________
58AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(TLorentzVector & p):
477d6cee 59 AliAODPWG4Particle(p), fIsolated(kFALSE),
f284616d 60 fLeadingParticle(kTRUE),
591cc579 61 fLeadingDetector(""), fLeading(), fCorrJet(), fCorrBkg(), fRefJet(0), fListOfObjArrays(new TList)
1c5acb87 62{
63 // constructor
0da5958d 64 fListOfObjArrays->SetOwner(kTRUE);
65
1c5acb87 66}
67
68//______________________________________________________________________________
69AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(AliAODPWG4Particle & p):
477d6cee 70 AliAODPWG4Particle(p), fIsolated(kFALSE),
f284616d 71 fLeadingParticle(kTRUE),
591cc579 72 fLeadingDetector(""), fLeading(), fCorrJet(), fCorrBkg(),fRefJet(0), fListOfObjArrays(new TList)
1c5acb87 73{
74 // constructor
0da5958d 75 fListOfObjArrays->SetOwner(kTRUE);
76
1c5acb87 77}
78
79//______________________________________________________________________________
80AliAODPWG4ParticleCorrelation::~AliAODPWG4ParticleCorrelation()
81{
82 // destructor
591cc579 83 if(fListOfObjArrays){
84 fListOfObjArrays->Clear();
85 delete fListOfObjArrays ;
a3aebfff 86 }
1c5acb87 87}
88
89//______________________________________________________________________________
4695da48 90void AliAODPWG4ParticleCorrelation::Clear(const Option_t* /*opt*/)
91{
92 // Clear
032002d9 93
94 AliAODPWG4Particle::Clear(""); //delete fMomentum
95
4695da48 96 if(fListOfObjArrays){
97 fListOfObjArrays->Clear();
98 delete fListOfObjArrays ;
99 }
100}
101
102
103//______________________________________________________________________________
1c5acb87 104AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(const AliAODPWG4ParticleCorrelation& part) :
477d6cee 105 AliAODPWG4Particle(part), fIsolated(part.fIsolated),
f284616d 106 fLeadingParticle(part.fLeadingParticle),
477d6cee 107 fLeadingDetector(part.fLeadingDetector), fLeading(part.fLeading),
a3aebfff 108 fCorrJet(part.fCorrJet), fCorrBkg(part.fCorrBkg), fRefJet(part.fRefJet),
4695da48 109 fListOfObjArrays(new TList)
1c5acb87 110{
111 // Copy constructor
a3aebfff 112
1c5acb87 113}
114
115//______________________________________________________________________________
82679d84 116//AliAODPWG4ParticleCorrelation& AliAODPWG4ParticleCorrelation::operator=(const AliAODPWG4ParticleCorrelation& part)
117//{
118// // Assignment operator
119// if(this!=&part) {
120//
121// fIsolated = part.fIsolated;
122// fRefJet = part.fRefJet ;
123// fLeadingDetector =part.fLeadingDetector;
124// fLeading = part.fLeading;
125// fCorrJet = part.fCorrJet ;
126// fCorrBkg = part.fCorrBkg;
127// fListOfObjArrays = fListOfObjArrays;
128//
129// }
130//
131// return *this;
132//}
1c5acb87 133
134//______________________________________________________________________________
135void AliAODPWG4ParticleCorrelation::Print(Option_t* /*option*/) const
136{
137 // Print information of all data members
138 AliAODPWG4Particle::Print("");
a3aebfff 139
1c5acb87 140 if(fIsolated) printf("Isolated! \n");
a3aebfff 141
142 if(GetJet()) GetJet()->Print("");
143
1c5acb87 144 printf("Leading Detector : %s\n",fLeadingDetector.Data());
a3aebfff 145 printf("Leading Particle 4-vector:\n");
146 printf(" E = %13.3f", fLeading.E() );
147 printf(" Px = %13.3f", fLeading.Px());
148 printf(" Py = %13.3f", fLeading.Py());
149 printf(" Pz = %13.3f\n", fLeading.Pz());
1c5acb87 150
591cc579 151 if( fListOfObjArrays) fListOfObjArrays->Print("");
1c5acb87 152}