PartCorr split in 2 Base and Dep; coding violations corrected; PHOS geometry can...
[u/mrichter/AliRoot.git] / PWG4 / PartCorrBase / AliAODPWG4ParticleCorrelation.cxx
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"
28 #include "AliAODJet.h"
29
30 ClassImp(AliAODPWG4ParticleCorrelation)
31
32
33 //______________________________________________________________________________
34 AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation() :
35     AliAODPWG4Particle(), fIsolated(kFALSE),
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 //______________________________________________________________________________
45 AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(Double_t px, Double_t py, Double_t pz, Double_t e):
46     AliAODPWG4Particle(), fIsolated(kFALSE),
47     fRefTracks(new TRefArray()), fRefClusters(new TRefArray()),
48     fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()),
49     fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()),
50     fLeadingDetector(""),  fLeading(), fCorrJet(),
51     fCorrBkg(), fRefJet(0)
52 {
53   // constructor
54     SetMomentum(new TLorentzVector(px, py, pz, e));
55 }
56
57 //______________________________________________________________________________
58 AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(TLorentzVector & p):
59     AliAODPWG4Particle(p), fIsolated(kFALSE),
60     fRefTracks(new TRefArray()), fRefClusters(new TRefArray()),
61     fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()),
62     fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()),  
63     fLeadingDetector(""),  fLeading(), fCorrJet(), fCorrBkg(),fRefJet(0)
64 {
65   // constructor
66 }
67
68 //______________________________________________________________________________
69 AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(AliAODPWG4Particle & p):
70     AliAODPWG4Particle(p), fIsolated(kFALSE),
71     fRefTracks(new TRefArray()), fRefClusters(new TRefArray()),
72     fRefIsolationConeTracks(new TRefArray()), fRefIsolationConeClusters(new TRefArray()),
73     fRefBackgroundTracks(new TRefArray()), fRefBackgroundClusters(new TRefArray()),  
74     fLeadingDetector(""),  fLeading(), fCorrJet(), fCorrBkg(),fRefJet(0)
75 {
76   // constructor
77
78 }
79
80 //______________________________________________________________________________
81 AliAODPWG4ParticleCorrelation::~AliAODPWG4ParticleCorrelation() 
82 {
83   // destructor
84     delete fRefTracks;
85     delete fRefClusters;
86     delete fRefIsolationConeTracks;
87     delete fRefIsolationConeClusters;
88     delete fRefBackgroundTracks;
89     delete fRefBackgroundClusters;
90
91 }
92
93 //______________________________________________________________________________
94 AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(const AliAODPWG4ParticleCorrelation& part) :
95     AliAODPWG4Particle(part), fIsolated(part.fIsolated),
96     fRefTracks(), fRefClusters(),
97     fRefIsolationConeTracks(), fRefIsolationConeClusters(),
98     fRefBackgroundTracks(), fRefBackgroundClusters(),   
99     fLeadingDetector(part.fLeadingDetector), fLeading(part.fLeading),  
100     fCorrJet(part.fCorrJet), fCorrBkg(part.fCorrBkg), fRefJet(part.fRefJet)
101 {
102   // Copy constructor
103   fRefTracks                = new TRefArray(*part.fRefTracks);
104   fRefClusters              = new TRefArray(*part.fRefClusters);
105   fRefIsolationConeTracks   = new TRefArray(*part.fRefIsolationConeTracks);
106   fRefIsolationConeClusters = new TRefArray(*part.fRefIsolationConeClusters);
107   fRefBackgroundTracks      = new TRefArray(*part.fRefBackgroundTracks);
108   fRefBackgroundClusters    = new TRefArray(*part.fRefBackgroundClusters);
109 }
110
111 //______________________________________________________________________________
112 AliAODPWG4ParticleCorrelation& AliAODPWG4ParticleCorrelation::operator=(const AliAODPWG4ParticleCorrelation& part)
113 {
114   // Assignment operator
115   if(this!=&part) {
116   
117         fIsolated = part.fIsolated;
118         fRefJet   = part.fRefJet ;
119         fLeadingDetector =part.fLeadingDetector;
120         fLeading  = part.fLeading;
121         fCorrJet  = part.fCorrJet ;
122         fCorrBkg  = part.fCorrBkg;
123
124         if( fRefTracks )               delete fRefTracks ;
125         if( fRefClusters)              delete fRefClusters ;
126         if( fRefIsolationConeTracks )  delete fRefIsolationConeTracks ;
127         if( fRefIsolationConeClusters) delete fRefIsolationConeClusters ;
128         if( fRefBackgroundTracks )     delete fRefBackgroundTracks ;
129         if( fRefBackgroundClusters )   delete fRefBackgroundClusters ;
130
131         fRefTracks                = new TRefArray(*part.fRefTracks);
132         fRefClusters              = new TRefArray(*part.fRefClusters);
133         fRefIsolationConeTracks   = new TRefArray(*part.fRefIsolationConeTracks);
134         fRefIsolationConeClusters = new TRefArray(*part.fRefIsolationConeClusters);
135         fRefBackgroundTracks      = new TRefArray(*part.fRefBackgroundTracks);
136         fRefBackgroundClusters    = new TRefArray(*part.fRefBackgroundClusters);  
137   
138   }
139   
140   return *this;
141 }
142
143 //______________________________________________________________________________
144 void AliAODPWG4ParticleCorrelation::Print(Option_t* /*option*/) const 
145 {
146   // Print information of all data members
147   AliAODPWG4Particle::Print("");
148   if(fIsolated) printf("Isolated! \n");
149   printf("Leading Detector : %s\n",fLeadingDetector.Data());
150   // if(fRefJet) fRefJet.Print();
151
152 }