Update master to aliroot
[u/mrichter/AliRoot.git] / STEER / AOD / 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//-------------------------------------------------------------------------
bfa9c596 19// AOD objects class in use in the CaloTrackCorrelations
20// analysis pacackge ($ALICE_ROOT/PWGGA/CaloTrackCorrelations)
21// Includes correlation objects
22//
23// Author: Gustavo Conesa Balbastre - CNRS-LPSC-Grenoble
1c5acb87 24//-------------------------------------------------------------------------
25
26//-- ROOT system --
27
28//-- Analysis system
29#include "AliAODPWG4ParticleCorrelation.h"
5e6a3170 30#include "AliAODJet.h"
1c5acb87 31
32ClassImp(AliAODPWG4ParticleCorrelation)
33
34
35//______________________________________________________________________________
477d6cee 36 AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation() :
bfa9c596 37 AliAODPWG4Particle(),
667496a9 38 fLeadingDetector(-1), fLeading(), fCorrJet(), fCorrBkg(), fRefJet(0),
f0f2f871 39 fListOfObjArrays(0)
1c5acb87 40{
41 // constructor
42}
43
44//______________________________________________________________________________
45AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(Double_t px, Double_t py, Double_t pz, Double_t e):
bfa9c596 46 AliAODPWG4Particle(),
667496a9 47 fLeadingDetector(-1), fLeading(), fCorrJet(),
591cc579 48 fCorrBkg(), fRefJet(0), fListOfObjArrays(new TList)
1c5acb87 49{
50 // constructor
477d6cee 51 SetMomentum(new TLorentzVector(px, py, pz, e));
0da5958d 52 fListOfObjArrays->SetOwner(kTRUE);
53
1c5acb87 54}
55
56//______________________________________________________________________________
57AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(TLorentzVector & p):
bfa9c596 58 AliAODPWG4Particle(p),
667496a9 59 fLeadingDetector(-1), fLeading(), fCorrJet(), fCorrBkg(), fRefJet(0), fListOfObjArrays(new TList)
1c5acb87 60{
61 // constructor
0da5958d 62 fListOfObjArrays->SetOwner(kTRUE);
63
1c5acb87 64}
65
66//______________________________________________________________________________
67AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(AliAODPWG4Particle & p):
bfa9c596 68 AliAODPWG4Particle(p),
667496a9 69 fLeadingDetector(-1), fLeading(), fCorrJet(), fCorrBkg(),fRefJet(0), fListOfObjArrays(new TList)
1c5acb87 70{
71 // constructor
0da5958d 72 fListOfObjArrays->SetOwner(kTRUE);
73
1c5acb87 74}
75
76//______________________________________________________________________________
77AliAODPWG4ParticleCorrelation::~AliAODPWG4ParticleCorrelation()
78{
79 // destructor
591cc579 80 if(fListOfObjArrays){
81 fListOfObjArrays->Clear();
82 delete fListOfObjArrays ;
a3aebfff 83 }
1c5acb87 84}
85
86//______________________________________________________________________________
4695da48 87void AliAODPWG4ParticleCorrelation::Clear(const Option_t* /*opt*/)
88{
89 // Clear
032002d9 90
91 AliAODPWG4Particle::Clear(""); //delete fMomentum
92
4695da48 93 if(fListOfObjArrays){
94 fListOfObjArrays->Clear();
95 delete fListOfObjArrays ;
96 }
97}
98
99
100//______________________________________________________________________________
1c5acb87 101AliAODPWG4ParticleCorrelation::AliAODPWG4ParticleCorrelation(const AliAODPWG4ParticleCorrelation& part) :
bfa9c596 102 AliAODPWG4Particle(part), fLeadingDetector(part.fLeadingDetector), fLeading(part.fLeading),
a3aebfff 103 fCorrJet(part.fCorrJet), fCorrBkg(part.fCorrBkg), fRefJet(part.fRefJet),
4695da48 104 fListOfObjArrays(new TList)
1c5acb87 105{
106 // Copy constructor
a3aebfff 107
1c5acb87 108}
109
110//______________________________________________________________________________
82679d84 111//AliAODPWG4ParticleCorrelation& AliAODPWG4ParticleCorrelation::operator=(const AliAODPWG4ParticleCorrelation& part)
112//{
113// // Assignment operator
114// if(this!=&part) {
bfa9c596 115//
82679d84 116// fRefJet = part.fRefJet ;
82679d84 117// fLeading = part.fLeading;
118// fCorrJet = part.fCorrJet ;
119// fCorrBkg = part.fCorrBkg;
120// fListOfObjArrays = fListOfObjArrays;
121//
122// }
123//
124// return *this;
125//}
1c5acb87 126
127//______________________________________________________________________________
128void AliAODPWG4ParticleCorrelation::Print(Option_t* /*option*/) const
129{
130 // Print information of all data members
131 AliAODPWG4Particle::Print("");
a3aebfff 132
a3aebfff 133 if(GetJet()) GetJet()->Print("");
134
667496a9 135 printf("Leading Detector : %d\n",fLeadingDetector);
a3aebfff 136 printf("Leading Particle 4-vector:\n");
137 printf(" E = %13.3f", fLeading.E() );
138 printf(" Px = %13.3f", fLeading.Px());
139 printf(" Py = %13.3f", fLeading.Py());
140 printf(" Pz = %13.3f\n", fLeading.Pz());
1c5acb87 141
591cc579 142 if( fListOfObjArrays) fListOfObjArrays->Print("");
1c5acb87 143}