]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliAODPWG4ParticleCorrelation.cxx
Bug fix in buffer expansion size calculation, report 79334
[u/mrichter/AliRoot.git] / STEER / 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    fLeadingDetector(""), fLeading(), fCorrJet(),  fCorrBkg(), fRefJet(0),
37    fListOfObjArrays(new TList)
38 {
39   // constructor
40   fListOfObjArrays->SetOwner(kTRUE);
41 }
42
43 //______________________________________________________________________________
44 AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(Double_t px, Double_t py, Double_t pz, Double_t e):
45   AliAODPWG4Particle(), fIsolated(kFALSE),
46   fLeadingDetector(""),  fLeading(), fCorrJet(),
47   fCorrBkg(), fRefJet(0),  fListOfObjArrays(new TList)
48 {
49   // constructor
50   SetMomentum(new TLorentzVector(px, py, pz, e));
51   fListOfObjArrays->SetOwner(kTRUE);
52
53 }
54
55 //______________________________________________________________________________
56 AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(TLorentzVector & p):
57   AliAODPWG4Particle(p), fIsolated(kFALSE),
58   fLeadingDetector(""),  fLeading(), fCorrJet(), fCorrBkg(), fRefJet(0),  fListOfObjArrays(new TList)
59 {
60   // constructor
61   fListOfObjArrays->SetOwner(kTRUE);
62
63 }
64
65 //______________________________________________________________________________
66 AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(AliAODPWG4Particle & p):
67   AliAODPWG4Particle(p), fIsolated(kFALSE),
68   fLeadingDetector(""),  fLeading(), fCorrJet(), fCorrBkg(),fRefJet(0),   fListOfObjArrays(new TList)
69 {
70   // constructor
71   fListOfObjArrays->SetOwner(kTRUE);
72
73 }
74
75 //______________________________________________________________________________
76 AliAODPWG4ParticleCorrelation::~AliAODPWG4ParticleCorrelation() 
77 {
78   // destructor
79   if(fListOfObjArrays){
80     fListOfObjArrays->Clear();
81     delete   fListOfObjArrays ;
82   }
83 }
84
85 //______________________________________________________________________________
86 void AliAODPWG4ParticleCorrelation::Clear(const Option_t* /*opt*/) 
87 {
88   // Clear
89   
90   AliAODPWG4Particle::Clear(""); //delete fMomentum
91   
92   if(fListOfObjArrays){
93     fListOfObjArrays->Clear();
94     delete   fListOfObjArrays ;
95   }
96 }
97
98
99 //______________________________________________________________________________
100 AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(const AliAODPWG4ParticleCorrelation& part) :
101   AliAODPWG4Particle(part), fIsolated(part.fIsolated),
102   fLeadingDetector(part.fLeadingDetector), fLeading(part.fLeading),  
103   fCorrJet(part.fCorrJet), fCorrBkg(part.fCorrBkg), fRefJet(part.fRefJet),   
104   fListOfObjArrays(new TList)
105 {
106   // Copy constructor
107
108 }
109
110 //______________________________________________________________________________
111 //AliAODPWG4ParticleCorrelation& AliAODPWG4ParticleCorrelation::operator=(const AliAODPWG4ParticleCorrelation& part)
112 //{
113 //  // Assignment operator
114 //  if(this!=&part) {
115 //  
116 //    fIsolated = part.fIsolated;
117 //    fRefJet   = part.fRefJet ;
118 //    fLeadingDetector =part.fLeadingDetector;
119 //    fLeading  = part.fLeading;
120 //    fCorrJet  = part.fCorrJet ;
121 //    fCorrBkg  = part.fCorrBkg; 
122 //    fListOfObjArrays = fListOfObjArrays;
123 //
124 //  }
125 //  
126 //  return *this;
127 //}
128
129 //______________________________________________________________________________
130 void AliAODPWG4ParticleCorrelation::Print(Option_t* /*option*/) const 
131 {
132   // Print information of all data members
133   AliAODPWG4Particle::Print("");
134
135   if(fIsolated) printf("Isolated! \n");
136
137   if(GetJet()) GetJet()->Print("");
138
139   printf("Leading Detector : %s\n",fLeadingDetector.Data());
140   printf("Leading Particle 4-vector:\n");
141   printf("     E  = %13.3f",   fLeading.E() );
142   printf("     Px = %13.3f",   fLeading.Px());
143   printf("     Py = %13.3f",   fLeading.Py());
144   printf("     Pz = %13.3f\n", fLeading.Pz());
145
146   if( fListOfObjArrays)   fListOfObjArrays->Print("");
147 }