]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/PartCorr/AliAODParticleCorrelation.cxx
bugs corrected
[u/mrichter/AliRoot.git] / PWG4 / PartCorr / AliAODParticleCorrelation.cxx
CommitLineData
f3050824 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: AliAODParticleCorrelation.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 "AliAODParticleCorrelation.h"
28
29ClassImp(AliAODParticleCorrelation)
30
31
32//______________________________________________________________________________
33AliAODParticleCorrelation::AliAODParticleCorrelation() :
34 AliVParticle(),
35 fMomentum(0),fPdg(-1), fTag(-1),fLabel(-1),fDetector(""),fR(0),
36 fRefTracks(new TRefArray()), fRefClusters(new TRefArray()),
37 fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()),
38 fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()),
39 fLeadingDetector(""), fLeading(), fCorrJet(), fCorrBkg(), fRefJet(0)
40{
41 // constructor
42}
43
44//______________________________________________________________________________
45AliAODParticleCorrelation::AliAODParticleCorrelation(Double_t px, Double_t py, Double_t pz, Double_t e):
46 AliVParticle(),
47 fMomentum(0),fPdg(-1), fTag(-1),fLabel(-1),fDetector(""),fR(0),
48 fRefTracks(new TRefArray()), fRefClusters(new TRefArray()),
49 fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()),
50 fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()),
51 fLeadingDetector(""), fLeading(), fCorrJet(),
52 fCorrBkg(), fRefJet(0)
53{
54 // constructor
55 fMomentum = new TLorentzVector(px, py, pz, e);
56}
57
58//______________________________________________________________________________
59AliAODParticleCorrelation::AliAODParticleCorrelation(TLorentzVector & p):
60 AliVParticle(),
61 fMomentum(0),fPdg(-1), fTag(-1),fLabel(-1),fDetector(""),fR(0),
62 fRefTracks(new TRefArray()), fRefClusters(new TRefArray()),
63 fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()),
64 fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()),
65 fLeadingDetector(""), fLeading(), fCorrJet(), fCorrBkg(),fRefJet(0)
66{
67 // constructor
68 fMomentum = new TLorentzVector(p);
69}
70
71
72//______________________________________________________________________________
73AliAODParticleCorrelation::~AliAODParticleCorrelation()
74{
75 // destructor
76 delete fMomentum;
77 delete fRefTracks;
78 delete fRefClusters;
79 delete fRefIsolationConeTracks;
80 delete fRefIsolationConeClusters;
81 delete fRefBackgroundTracks;
82 delete fRefBackgroundClusters;
83
84}
85
86//______________________________________________________________________________
87AliAODParticleCorrelation::AliAODParticleCorrelation(const AliAODParticleCorrelation& part) :
88 AliVParticle(part),
89 fMomentum(0) ,fPdg(part.fPdg), fTag(part.fTag),fLabel(part.fLabel),
90 fDetector(part.fDetector),
91 fR(part.fR),
92 fRefTracks(), fRefClusters(),
93 fRefIsolationConeTracks(), fRefIsolationConeClusters(),
94 fRefBackgroundTracks(), fRefBackgroundClusters(),
95 fLeadingDetector(part.fLeadingDetector), fLeading(part.fLeading),
96 fCorrJet(part.fCorrJet), fCorrBkg(part.fCorrBkg), fRefJet(part.fRefJet)
97{
98 // Copy constructor
99 fMomentum = new TLorentzVector(*part.fMomentum);
100 fRefTracks = new TRefArray(*part.fRefTracks);
101 fRefClusters = new TRefArray(*part.fRefClusters);
102 fRefIsolationConeTracks = new TRefArray(*part.fRefIsolationConeTracks);
103 fRefIsolationConeClusters = new TRefArray(*part.fRefIsolationConeClusters);
104 fRefBackgroundTracks = new TRefArray(*part.fRefBackgroundTracks);
105 fRefBackgroundClusters = new TRefArray(*part.fRefBackgroundClusters);
106}
107
108//______________________________________________________________________________
109AliAODParticleCorrelation& AliAODParticleCorrelation::operator=(const AliAODParticleCorrelation& part)
110{
111 // Assignment operator
112 if(this!=&part) {
113 }
114
115 fPdg = part.fPdg;
116 fTag = part.fTag;
117 fLabel = part.fLabel;
118 fR = part.fR;
119 fRefJet = part.fRefJet ;
120 fDetector =part.fDetector;
121 fLeadingDetector =part.fLeadingDetector;
122 fLeading = part.fLeading;
123 fCorrJet = part.fCorrJet ;
124 fCorrBkg = part.fCorrBkg;
125
126 if (fMomentum ) delete fMomentum;
127 if( fRefTracks ) delete fRefTracks ;
128 if( fRefClusters) delete fRefClusters ;
129 if( fRefIsolationConeTracks ) delete fRefIsolationConeTracks ;
130 if( fRefIsolationConeClusters) delete fRefIsolationConeClusters ;
131 if( fRefBackgroundTracks ) delete fRefBackgroundTracks ;
132 if( fRefBackgroundClusters ) delete fRefBackgroundClusters ;
133
134 fMomentum = new TLorentzVector(*part.fMomentum);
135 fRefTracks = new TRefArray(*part.fRefTracks);
136 fRefClusters = new TRefArray(*part.fRefClusters);
137 fRefIsolationConeTracks = new TRefArray(*part.fRefIsolationConeTracks);
138 fRefIsolationConeClusters = new TRefArray(*part.fRefIsolationConeClusters);
139 fRefBackgroundTracks = new TRefArray(*part.fRefBackgroundTracks);
140 fRefBackgroundClusters = new TRefArray(*part.fRefBackgroundClusters);
141
142 return *this;
143}
144
145void AliAODParticleCorrelation::Print(Option_t* /*option*/) const
146{
147 // Print information of all data members
148 printf("Particle 4-vector:\n");
149 printf(" E = %13.3f\n", E() );
150 printf(" Px = %13.3f\n", Px());
151 printf(" Py = %13.3f\n", Py());
152 printf(" Pz = %13.3f\n", Pz());
153 printf("pdg : %d\n",fPdg);
154 printf("tag : %d\n",fTag);
155 printf("R : %2.2f\n",fR);
156 printf("Trigger Detector : %s\n",fDetector.Data());
157 printf("Leading Detector : %s\n",fLeadingDetector.Data());
158 // if(fRefJet) fRefJet.Print();
159
160}