1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
17 Revision 1.6 2000/10/03 13:51:57 egangler
18 Removal of useless dependencies via forward declarations
20 Revision 1.5 2000/10/02 21:28:09 fca
21 Removal of useless dependecies via forward declarations
23 Revision 1.4 2000/07/03 11:54:57 morsch
24 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
25 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
27 Revision 1.3 2000/06/27 10:13:01 morsch
28 Obsolete global variables removed from file.
30 Revision 1.2 2000/06/15 07:58:48 morsch
31 Code from MUON-dev joined
33 Revision 1.1.2.6 2000/06/09 21:57:40 morsch
34 Most coding rule violations corrected.
36 Revision 1.1.2.5 2000/05/05 11:33:56 morsch
39 Revision 1.1.2.4 2000/05/05 10:12:09 morsch
43 ///////////////////////////////////////////////////////////////////////////////
45 // This class contains the points for the ALICE event display //
49 <img src="gif/AliMUONPointsClass.gif">
54 ///////////////////////////////////////////////////////////////////////////////
56 #include "AliMUONPoints.h"
57 #include "AliMUONDisplay.h"
60 #include "AliMUONChamber.h"
61 #include "AliMUONResponse.h"
62 #include "AliMUONHit.h"
63 #include "AliMUONPadHit.h"
64 #include "AliMUONDigit.h"
65 #include "AliMUONRawCluster.h"
70 #include <TPolyMarker3D.h>
73 #include <TVirtualPad.h>
74 #include <TPolyLine3D.h>
75 #include <TPaveText.h>
78 #include <TMarker3DBox.h>
80 ClassImp(AliMUONPoints)
82 //_____________________________________________________________________________
83 AliMUONPoints::AliMUONPoints()
86 // Default constructor
91 fMarker[0] = fMarker[1] = fMarker[2]=0;
95 //_____________________________________________________________________________
96 AliMUONPoints::AliMUONPoints(Int_t npoints)
100 // Standard constructor
105 fMarker[0] = fMarker[1] = fMarker[2]=0;
109 AliMUONPoints::AliMUONPoints(const AliMUONPoints& points)
114 //_____________________________________________________________________________
115 AliMUONPoints::~AliMUONPoints()
118 // Default destructor
123 for (Int_t i=0;i<3;i++){
124 if (fMarker[i]) delete fMarker[i];
129 //_____________________________________________________________________________
130 void AliMUONPoints::DumpHit()
133 // Dump hit corresponding to this point
135 AliMUONHit *hit = GetHit();
136 if (hit) hit->Dump();
139 //_____________________________________________________________________________
140 void AliMUONPoints::DumpDigit()
143 // Dump digit corresponding to this point
145 AliMUONDigit *digit = GetDigit();
146 if (digit) digit->Dump();
149 //_____________________________________________________________________________
150 void AliMUONPoints::InspectHit()
153 // Inspect hit corresponding to this point
156 if (fHitIndex < 0 ) return;
157 TVirtualPad *padsav = gPad;
158 AliMUONHit *hit = GetHit();
159 if (hit) hit->Inspect();
160 TVirtualPad *padinspect = (TVirtualPad*)(gROOT->GetListOfCanvases())->FindObject("inspect");
162 Float_t xmin = gPad->GetX1();
163 Float_t xmax = gPad->GetX2();
164 Float_t ymin = gPad->GetY1();
165 Float_t ymax = gPad->GetY2();
166 Float_t dy = ymax-ymin;
168 TPaveText *pad = new TPaveText(xmin, ymin+0.1*dy, xmax, ymin+0.15*dy);
169 pad->SetBit(kCanDelete);
170 pad->SetFillColor(42);
173 sprintf(ptitle," %s , fTrack: %d fTrackIndex: %d ",GetName(),fIndex,fTrackIndex);
174 pad->AddText(ptitle);
176 padinspect->Update();
177 if (padsav) padsav->cd();
181 //_____________________________________________________________________________
182 void AliMUONPoints::InspectDigit()
185 // Inspect digit corresponding to this point
187 if (fDigitIndex < 0) return;
188 TVirtualPad *padsav = gPad;
189 AliMUONDigit *digit = GetDigit();
190 if (digit) digit->Inspect();
191 TVirtualPad *padinspect = (TVirtualPad*)(gROOT->GetListOfCanvases())->FindObject("inspect");
193 Float_t xmin = gPad->GetX1();
194 Float_t xmax = gPad->GetX2();
195 Float_t ymin = gPad->GetY1();
196 Float_t ymax = gPad->GetY2();
197 Float_t dy = ymax-ymin;
199 TPaveText *pad = new TPaveText(xmin, ymin+0.1*dy, xmax, ymin+0.25*dy);
200 pad->SetBit(kCanDelete);
201 pad->SetFillColor(42);
203 char ptitle[11][100];
204 // sprintf(ptitle[11],"Tracks making this digit");
205 // pad->AddText(ptitle[11]);
206 for (int i=0;i<10;i++) {
207 if (digit->Track(i) == 0) continue;
208 sprintf(ptitle[i],"fTrackIndex: %d Charge: %d",
209 digit->Track(i), digit->TrackCharge(i));
210 pad->AddText(ptitle[i]);
213 padinspect->Update();
214 if (padsav) padsav->cd();
218 //_____________________________________________________________________________
219 Int_t AliMUONPoints::GetTrackIndex()
222 // Dump digit corresponding to this point
227 if (fDigitIndex != 0) {
228 Int_t ncol=this->fMatrix->GetNcols();
229 for (int i=0;i<ncol;i++) {
230 printf(" track charge %f %f \n",(*(this->fMatrix))(0,i),(*(this->fMatrix))(1,i));
237 //_____________________________________________________________________________
238 AliMUONHit *AliMUONPoints::GetHit() const
241 // Returns pointer to hit index in AliRun::fParticles
243 AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
244 gAlice->TreeH()->GetEvent(fTrackIndex);
245 TClonesArray *muonHits = pMUON->Hits();
246 Int_t nhits = muonHits->GetEntriesFast();
247 if (fHitIndex < 0 || fHitIndex >= nhits) return 0;
248 return (AliMUONHit*)muonHits->UncheckedAt(fHitIndex);
251 //_____________________________________________________________________________
252 AliMUONDigit *AliMUONPoints::GetDigit() const
255 // Returns pointer to digit index in AliRun::fParticles
258 AliMUONDisplay *display=(AliMUONDisplay*)gAlice->Display();
259 Int_t chamber=display->GetChamber();
260 Int_t cathode=display->GetCathode();
262 AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
263 TClonesArray *muonDigits = pMUON->DigitsAddress(chamber-1);
264 Int_t nent=(Int_t)gAlice->TreeD()->GetEntries();
265 gAlice->TreeD()->GetEvent(nent-2+cathode-1);
266 //gAlice->TreeD()->GetEvent(cathode);
267 Int_t ndigits = muonDigits->GetEntriesFast();
268 if (fDigitIndex < 0 || fDigitIndex >= ndigits) return 0;
269 return (AliMUONDigit*)muonDigits->UncheckedAt(fDigitIndex);
271 //_____________________________________________________________________________
273 AliMUONPoints& AliMUONPoints::operator= (const AliMUONPoints& rhs)