1 /**************************************************************************
2 * Copyright(c) 1998-2008, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 //*****************************************************
17 // Class AliEventplane
18 // author: Alberica Toia, Johanna Gramling
19 //*****************************************************
20 /// A container for the event plane stored in AOD in ESD
22 #include "AliEventplane.h"
24 #include "AliVTrack.h"
25 #include "TObjArray.h"
28 ClassImp(AliEventplane)
30 AliEventplane::AliEventplane() : TNamed("Eventplane", "Eventplane"),
40 fQContributionX = new TArrayF(0);
41 fQContributionY = new TArrayF(0);
44 AliEventplane::AliEventplane(const AliEventplane& ep) :
55 ((AliEventplane &) ep).CopyEP(*this);
58 AliEventplane& AliEventplane::operator=(const AliEventplane& ep)
60 /// Assignment operator
62 ((AliEventplane &) ep).CopyEP(*this);
67 void AliEventplane::CopyEP(AliEventplane& ep) const
70 AliEventplane& target = (AliEventplane &) ep;
72 target.fQContributionX = fQContributionX;
74 target.fQContributionY = fQContributionY;
76 target.fEventplaneQ = fEventplaneQ;
78 target.fQVector = dynamic_cast<TVector2*> (fQVector->Clone());
80 target.fQsub1 = dynamic_cast<TVector2*> (fQsub1->Clone());
82 target.fQsub2 = dynamic_cast<TVector2*> (fQsub2->Clone());
84 target.fQsubRes = fQsubRes;
87 AliEventplane::~AliEventplane()
91 delete fQContributionX;
95 delete fQContributionY;
112 TVector2* AliEventplane::GetQVector()
117 Double_t AliEventplane::GetEventplane(const char *x)
120 if(method.CompareTo("Q")==0) return fEventplaneQ;
124 TVector2* AliEventplane::GetQsub1()
129 TVector2* AliEventplane::GetQsub2()
134 Double_t AliEventplane::GetQsubRes()
139 Bool_t AliEventplane::IsEventInEventplaneClass(Double_t a, Double_t b, const char *x)
142 if ((method.CompareTo("Q")==0) && (fEventplaneQ >=a && fEventplaneQ < b)) return kTRUE;
146 Double_t AliEventplane::GetQContributionX(AliVTrack* track)
148 return fQContributionX->GetAt(track->GetID());
151 Double_t AliEventplane::GetQContributionY(AliVTrack* track)
153 return fQContributionY->GetAt(track->GetID());
156 void AliEventplane::Reset()
158 delete fQVector; fQVector=0;
159 fQContributionX->Reset();
160 fQContributionY->Reset();
162 delete fQsub1; fQsub1=0;
163 delete fQsub2; fQsub2=0;