Line data Source code
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$ */
17 :
18 : //-------------------------------------------------------------------------
19 : // AOD class for di-jets
20 : // The present version is for test purposes only
21 : // Author: Andreas Morsch, CERN
22 : //-------------------------------------------------------------------------
23 :
24 : #include <TLorentzVector.h>
25 : #include <TProcessID.h>
26 : #include "AliAODDiJet.h"
27 : #include "AliAODJet.h"
28 :
29 170 : ClassImp(AliAODDiJet)
30 :
31 :
32 : //______________________________________________________________________________
33 : AliAODDiJet::AliAODDiJet() :
34 0 : AliAODJet(),
35 0 : fJetR(0),
36 0 : fJet1(0),
37 0 : fJet2(0)
38 0 : {
39 : // constructor
40 0 : }
41 :
42 : AliAODDiJet::AliAODDiJet(Double_t px, Double_t py, Double_t pz, Double_t e):
43 0 : AliAODJet(px, py, pz, e),
44 0 : fJetR(0),
45 0 : fJet1(0),
46 0 : fJet2(0)
47 0 : {
48 : // another constructor
49 0 : }
50 :
51 : AliAODDiJet::AliAODDiJet(TLorentzVector & p):
52 0 : AliAODJet(p),
53 0 : fJetR(0),
54 0 : fJet1(0),
55 0 : fJet2(0)
56 0 : {
57 : // constructor
58 0 : }
59 :
60 :
61 : //______________________________________________________________________________
62 : AliAODDiJet::~AliAODDiJet()
63 0 : {
64 : // destructor
65 0 : if (fJetR) fJetR->Delete();
66 0 : }
67 :
68 : void AliAODDiJet::SetJetRefs(AliAODJet* jet1, AliAODJet* jet2)
69 : {
70 : // Set references to the two jets
71 0 : if (fJetR) fJetR->Delete();
72 0 : fJetR = new TRefArray(TProcessID::GetProcessWithUID( jet1 ));
73 0 : fJetR->Add(jet1);
74 0 : fJetR->Add(jet2);
75 0 : fJet1 = jet1;
76 0 : fJet2 = jet2;
77 0 : }
78 :
79 :
80 : //______________________________________________________________________________
81 : Float_t AliAODDiJet::DeltaPhi()
82 : {
83 : // phi distance between the two jets
84 : // the result is in the interval [0,pi]
85 :
86 0 : Float_t phi1 = Jet(0)->Phi();
87 0 : Float_t phi2 = Jet(1)->Phi();
88 0 : Float_t dphi = TMath::Abs(phi1 - phi2);
89 0 : dphi = (dphi > TMath::Pi()) ? (2*TMath::Pi()-dphi) : dphi;
90 0 : return dphi;
91 : }
92 :
93 :
94 : //______________________________________________________________________________
95 : Float_t AliAODDiJet::PhiImbalance()
96 : {
97 : // phi imbalance wrt back-to-back
98 : // the result is in the interval [-pi,pi]
99 :
100 0 : Float_t phi1 = Jet(0)->Phi();
101 0 : Float_t phi2 = Jet(1)->Phi();
102 0 : Float_t dphi = phi1 - phi2;
103 0 : dphi = dphi - TMath::Sign((Float_t)TMath::Pi(),dphi);
104 0 : return dphi;
105 : }
|