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.5 2000/10/02 21:28:09 fca
18 Removal of useless dependecies via forward declarations
20 Revision 1.4 2000/07/03 11:54:57 morsch
21 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
22 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
24 Revision 1.3 2000/06/27 10:13:01 morsch
25 Obsolete global variables removed from file.
27 Revision 1.2 2000/06/15 07:58:48 morsch
28 Code from MUON-dev joined
30 Revision 1.1.2.6 2000/06/09 21:57:40 morsch
31 Most coding rule violations corrected.
33 Revision 1.1.2.5 2000/05/05 11:33:56 morsch
36 Revision 1.1.2.4 2000/05/05 10:12:09 morsch
40 ///////////////////////////////////////////////////////////////////////////////
42 // This class contains the points for the ALICE event display //
46 <img src="gif/AliMUONPointsClass.gif">
51 ///////////////////////////////////////////////////////////////////////////////
53 #include "AliMUONPoints.h"
54 #include "AliMUONDisplay.h"
57 #include "AliMUONChamber.h"
58 #include "AliMUONResponse.h"
59 #include "AliMUONHit.h"
60 #include "AliMUONPadHit.h"
61 #include "AliMUONDigit.h"
62 #include "AliMUONRawCluster.h"
67 #include <TPolyMarker3D.h>
70 #include <TVirtualPad.h>
71 #include <TPolyLine3D.h>
72 #include <TPaveText.h>
75 #include <TMarker3DBox.h>
77 ClassImp(AliMUONPoints)
79 //_____________________________________________________________________________
80 AliMUONPoints::AliMUONPoints()
83 // Default constructor
88 fMarker[0] = fMarker[1] = fMarker[2]=0;
92 //_____________________________________________________________________________
93 AliMUONPoints::AliMUONPoints(Int_t npoints)
97 // Standard constructor
102 fMarker[0] = fMarker[1] = fMarker[2]=0;
106 AliMUONPoints::AliMUONPoints(const AliMUONPoints& points)
111 //_____________________________________________________________________________
112 AliMUONPoints::~AliMUONPoints()
115 // Default destructor
120 for (Int_t i=0;i<3;i++){
121 if (fMarker[i]) delete fMarker[i];
126 //_____________________________________________________________________________
127 void AliMUONPoints::DumpHit()
130 // Dump hit corresponding to this point
132 AliMUONHit *hit = GetHit();
133 if (hit) hit->Dump();
136 //_____________________________________________________________________________
137 void AliMUONPoints::DumpDigit()
140 // Dump digit corresponding to this point
142 AliMUONDigit *digit = GetDigit();
143 if (digit) digit->Dump();
146 //_____________________________________________________________________________
147 void AliMUONPoints::InspectHit()
150 // Inspect hit corresponding to this point
153 if (fHitIndex < 0 ) return;
154 TVirtualPad *padsav = gPad;
155 AliMUONHit *hit = GetHit();
156 if (hit) hit->Inspect();
157 TVirtualPad *padinspect = (TVirtualPad*)(gROOT->GetListOfCanvases())->FindObject("inspect");
159 Float_t xmin = gPad->GetX1();
160 Float_t xmax = gPad->GetX2();
161 Float_t ymin = gPad->GetY1();
162 Float_t ymax = gPad->GetY2();
163 Float_t dy = ymax-ymin;
165 TPaveText *pad = new TPaveText(xmin, ymin+0.1*dy, xmax, ymin+0.15*dy);
166 pad->SetBit(kCanDelete);
167 pad->SetFillColor(42);
170 sprintf(ptitle," %s , fTrack: %d fTrackIndex: %d ",GetName(),fIndex,fTrackIndex);
171 pad->AddText(ptitle);
173 padinspect->Update();
174 if (padsav) padsav->cd();
178 //_____________________________________________________________________________
179 void AliMUONPoints::InspectDigit()
182 // Inspect digit corresponding to this point
184 if (fDigitIndex < 0) return;
185 TVirtualPad *padsav = gPad;
186 AliMUONDigit *digit = GetDigit();
187 if (digit) digit->Inspect();
188 TVirtualPad *padinspect = (TVirtualPad*)(gROOT->GetListOfCanvases())->FindObject("inspect");
190 Float_t xmin = gPad->GetX1();
191 Float_t xmax = gPad->GetX2();
192 Float_t ymin = gPad->GetY1();
193 Float_t ymax = gPad->GetY2();
194 Float_t dy = ymax-ymin;
196 TPaveText *pad = new TPaveText(xmin, ymin+0.1*dy, xmax, ymin+0.25*dy);
197 pad->SetBit(kCanDelete);
198 pad->SetFillColor(42);
200 char ptitle[11][100];
201 // sprintf(ptitle[11],"Tracks making this digit");
202 // pad->AddText(ptitle[11]);
203 for (int i=0;i<10;i++) {
204 if (digit->fTracks[i] == 0) continue;
205 sprintf(ptitle[i],"fTrackIndex: %d Charge: %d",digit->fTracks[i],digit->fTcharges[i]);
206 pad->AddText(ptitle[i]);
209 padinspect->Update();
210 if (padsav) padsav->cd();
214 //_____________________________________________________________________________
215 Int_t AliMUONPoints::GetTrackIndex()
218 // Dump digit corresponding to this point
223 if (fDigitIndex != 0) {
224 Int_t ncol=this->fMatrix->GetNcols();
225 for (int i=0;i<ncol;i++) {
226 printf(" track charge %f %f \n",(*(this->fMatrix))(0,i),(*(this->fMatrix))(1,i));
233 //_____________________________________________________________________________
234 AliMUONHit *AliMUONPoints::GetHit() const
237 // Returns pointer to hit index in AliRun::fParticles
239 AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
240 gAlice->TreeH()->GetEvent(fTrackIndex);
241 TClonesArray *muonHits = pMUON->Hits();
242 Int_t nhits = muonHits->GetEntriesFast();
243 if (fHitIndex < 0 || fHitIndex >= nhits) return 0;
244 return (AliMUONHit*)muonHits->UncheckedAt(fHitIndex);
247 //_____________________________________________________________________________
248 AliMUONDigit *AliMUONPoints::GetDigit() const
251 // Returns pointer to digit index in AliRun::fParticles
254 AliMUONDisplay *display=(AliMUONDisplay*)gAlice->Display();
255 Int_t chamber=display->GetChamber();
256 Int_t cathode=display->GetCathode();
258 AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
259 TClonesArray *muonDigits = pMUON->DigitsAddress(chamber-1);
260 Int_t nent=(Int_t)gAlice->TreeD()->GetEntries();
261 gAlice->TreeD()->GetEvent(nent-2+cathode-1);
262 //gAlice->TreeD()->GetEvent(cathode);
263 Int_t ndigits = muonDigits->GetEntriesFast();
264 if (fDigitIndex < 0 || fDigitIndex >= ndigits) return 0;
265 return (AliMUONDigit*)muonDigits->UncheckedAt(fDigitIndex);
267 //_____________________________________________________________________________
269 AliMUONPoints& AliMUONPoints::operator= (const AliMUONPoints& rhs)