]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveBase/AliEveJetPlane.cxx
755b12fbf6fc6a2605b6c357112f0f855b817e77
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveJetPlane.cxx
1 // $Id$
2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4 /**************************************************************************
5  * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6  * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
10 #include "AliEveJetPlane.h"
11
12 #include <TEveTrans.h>
13
14 #include <TBuffer3D.h>
15 #include <TBuffer3DTypes.h>
16 #include <TVirtualPad.h>
17 #include <TVirtualViewer3D.h>
18
19 //______________________________________________________________________________
20 //
21 // Show jets and tracks in eta-phi plane.
22 //
23 // 
24
25 ClassImp(AliEveJetPlane)
26
27 Bool_t AliEveJetPlane::fgOneMomentumXYZ      = kFALSE;
28 Bool_t AliEveJetPlane::fgOneMomentumPhiTheta = kFALSE;
29 Bool_t AliEveJetPlane::fgOneEta              = kFALSE;
30 Bool_t AliEveJetPlane::fgOneE                = kFALSE;
31 Bool_t AliEveJetPlane::fgOneChgMass          = kFALSE;
32
33
34 AliEveJetPlane::AliEveJetPlane(Int_t iev) :
35   TEveElementList(Form("AliEveJetPlane %i",iev), Form("%i",iev)),
36
37   fMinEta (-1.5 ),
38   fMaxEta ( 1.5 ),
39   fMinPhi (-TMath::Pi() ),
40   fMaxPhi ( TMath::Pi() ),
41
42   fNEtaDiv(30),
43   fNPhiDiv(30),
44
45   fEtaScale(350/1.5),
46   fPhiScale(350/TMath::Pi()),
47   fEnergyScale(100.0),
48
49   fEnergyColorScale (0.),
50
51   fGridColor(5),
52
53   fJets(),
54   fTracks(),
55
56   fRnrJets (kTRUE),
57   fRnrTracks (kTRUE),
58
59   fOneSelection (kTRUE),
60   fTwoSelection (kFALSE),
61
62   fJet1(0), fJet2(0), fTrack1(0), fTrack2(0),
63
64   fSelectionFlag (1)
65 {
66   SetMainColorPtr(&fGridColor);
67   InitMainTrans();
68 }
69
70 /******************************************************************************/
71
72 void AliEveJetPlane::AddJet(AliAODJet jet)
73 {
74   // Add a jet for display.
75
76   fJets.push_back(jet);
77 }
78
79 /******************************************************************************/
80
81 void AliEveJetPlane::AddTrack(AliAODTrack track)
82 {
83   // Add a track for display.
84
85   fTracks.push_back(track);
86 }
87
88
89 /******************************************************************************/
90
91 void AliEveJetPlane::ComputeBBox()
92 {
93   // Calculate bounding-box.
94
95   BBoxInit();
96   BBoxCheckPoint(-350, -350, -20);
97   BBoxCheckPoint( 350,  350,  20);
98 }
99
100 void AliEveJetPlane::Paint(Option_t* /*option*/)
101 {
102   // Paint the object.
103
104   TBuffer3D buff(TBuffer3DTypes::kGeneric);
105
106   // Section kCore
107   buff.fID           = this;
108   buff.fColor        = fGridColor;
109   buff.fTransparency = 0;
110   if (HasMainTrans()) RefMainTrans().SetBuffer3D(buff);
111   buff.SetSectionsValid(TBuffer3D::kCore);
112
113   Int_t reqSections = gPad->GetViewer3D()->AddObject(buff);
114   if (reqSections == TBuffer3D::kNone) {
115     // printf("AliEveJetPlane::Paint viewer was happy with Core buff3d.\n");
116     return;
117   }
118 }