]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/Correlations/JCORRAN/AliJPiZero.cxx
Fixing compilation issues after merging
[u/mrichter/AliRoot.git] / PWGCF / Correlations / JCORRAN / AliJPiZero.cxx
CommitLineData
9dc4f671 1/**************************************************************************
2 * Copyright(c) 1998-2014, 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// Comment describing what this class does needed!
17
18// $Id: AliJPiZero.cxx,v 1.3 2008/05/08 13:44:45 djkim Exp $
19
20////////////////////////////////////////////////////
21/*!
22 \file AliJPiZero.cxx
23 \brief
24 \author J. Rak, D.J.Kim, R.Diaz (University of Jyvaskyla)
25 \email: djkim@jyu.fi
26 \version $Revision: 1.3 $
27 \date $Date: 2008/05/08 13:44:45 $
28*/
29////////////////////////////////////////////////////
30#include <iostream>
31#include <fstream>
32#include <stdlib.h>
33#include <stdio.h>
34#include <TVector3.h>
35#include <TLorentzVector.h>
36
37#include "AliJBaseTrack.h"
38#include "AliJPhoton.h"
39
40#include "AliJPiZero.h"
41
42
43
44AliJPiZero::AliJPiZero():
45 AliJBaseTrack(),
46 fAsymm(-999),
47 fMassBin(-999),
48 fIsGood(kFALSE),
49 fConvPlaneDelta(-999),
50 fPtBin(-1)
51{
52 //constructor
53 fPhoton[0] = 0;
54 fPhoton[1] = 0;
55}
56//______________________________________________________________________________
57AliJPiZero::AliJPiZero(const AliJPiZero& a):
58 AliJBaseTrack(a),
59 fAsymm(a.fAsymm),
60 fMassBin(a.fMassBin),
61 fIsGood(a.fIsGood),
62 fConvPlaneDelta(a.fConvPlaneDelta),
63 fPtBin(a.fPtBin)
64{
65 //copy constructor
66 fPhoton[0] = a.fPhoton[0];
67 fPhoton[1] = a.fPhoton[1];
68}
69
70AliJPiZero& AliJPiZero::operator=(const AliJPiZero& pizero){
71 //copy constructor
72 AliJBaseTrack::operator=(pizero);
73 fAsymm = pizero.fAsymm;
74 fMassBin = pizero.fMassBin;
75 fIsGood = pizero.fIsGood;
76 fPhoton[0] = pizero.fPhoton[0];
77 fPhoton[1] = pizero.fPhoton[1];
78 fConvPlaneDelta = pizero.fConvPlaneDelta;
79 fPtBin = pizero.fPtBin;
80
81 return *this;
82}
83
84
85//______________________________________________________________________________
86
87bool AliJPiZero::SetMass(AliJPhoton *g1, AliJPhoton *g2){
88 //set pi0 four-momentum, assddymetry, inv. mass, pT, phi, theta, energy
89
90 fAsymm = TMath::Abs((g1->E()-g2->E())/(g1->E()+g2->E()));
91 *(TLorentzVector*)this = *(TLorentzVector*)g1 + *(TLorentzVector*)g2;
92
93 fPhoton[0] = g1;
94 fPhoton[1] = g2;
95
96// Double_t pimass;
97// pimass = TMath::Sqrt( 2. * g1->E() * g2->E() *
98// ( 1. - TMath::Cos( g1->Angle( g2->Vect() ))));
99
100 return true;
101}
102
103double AliJPiZero::DeltaConversion(){
104 // check pair plane vector delta from expected conversion pair plain
105
106 TVector3 pplain, phot1, phot2, pplaint, cplain, zplain, convplane;
107
108 // pair vector in the pair plane
109 pplain = Vect();
110// cout << "-------------------" << endl;
111// pplain.Print();
112
113 // perpendicular to the plane
114 phot1 = fPhoton[0]->Vect();
115 phot2 = fPhoton[1]->Vect();
116 pplaint = phot1.Cross( phot2 );
117// pplaint.Print();
118
119 // get the pair plane vector
120 cplain = pplain.Cross( pplaint ).Unit();
121// cplain.Print();
122
123 // z plane vector
124 zplain.SetXYZ( 0, 0, 1 );
125// zplain.Print();
126
127 // expected conversion plane vector
128 convplane = pplain.Cross( zplain ).Unit();
129// convplane.Print();
130
131 // get the plane vector cosine similarity
132 // both vectors must be unit for this to work
133 fConvPlaneDelta = TMath::Abs( TMath::ACos( cplain.Dot( convplane )));
134// cout << fConvPlaneDelta << endl;
135
136 // the result comes out in 0,pi range. Depending on how the z plane vector
137 // was chosen (2 options). Merge the results into 0,1/2pi range
138 if( fConvPlaneDelta > TMath::Pi() / 2. )
139 fConvPlaneDelta = TMath::Pi() - fConvPlaneDelta;
140
141 return fConvPlaneDelta;
142}
143
144
145
146//______________________________________________________________________________
147
148// double AliJPiZero::operator- (const AliJPiZero &pi0){
149//
150// //========================================
151// // retruns the closest distance between
152// // photon hits bolonging to two pi0
153// //========================================
154//
155// TLorentzVector v;
156// double d = 1e3;
157// v = fPhoton1 - pi0.fPhoton1;
158// if(v.M() < d) d = v.M();
159// v = fPhoton2 - pi0.fPhoton2;
160// if(v.M() < d) d = v.M();
161// v = fPhoton1 - pi0.fPhoton2;
162// if(v.M() < d) d = v.M();
163// v = fPhoton2 - pi0.fPhoton2;
164// if(v.M() < d) d = v.M();
165// return d;
166// }
167//
168// //______________________________________________________________________________
169// AliJPiZero& AliJPiZero::operator= (const AliJPiZero& piz){
170// //operator=
171// if(this != &piz){
172// AliJBaseTrack::operator=(piz);
173// fPhoton1 = piz.fPhoton1;
174// fPhoton2 = piz.fPhoton2;
175// PhotSum = fPhoton1 + fPhoton2;
176// fAsymm = piz.fAsymm;
177// fMassBin = piz.fMassBin;
178// }
179//
180// return *this;
181// }
182
183
184
185ClassImp(AliJPiZero)