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.4 2000/07/03 11:54:57 morsch
18 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
19 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
21 Revision 1.3 2000/06/27 10:13:01 morsch
22 Obsolete global variables removed from file.
24 Revision 1.2 2000/06/15 07:58:48 morsch
25 Code from MUON-dev joined
27 Revision 1.1.2.6 2000/06/09 21:57:40 morsch
28 Most coding rule violations corrected.
30 Revision 1.1.2.5 2000/05/05 11:33:56 morsch
33 Revision 1.1.2.4 2000/05/05 10:12:09 morsch
37 ///////////////////////////////////////////////////////////////////////////////
39 // This class contains the points for the ALICE event display //
43 <img src="gif/AliMUONPointsClass.gif">
48 ///////////////////////////////////////////////////////////////////////////////
50 #include "AliMUONPoints.h"
51 #include "AliMUONDisplay.h"
54 #include "AliMUONChamber.h"
55 #include "AliMUONResponse.h"
56 #include "AliMUONHit.h"
57 #include "AliMUONPadHit.h"
58 #include "AliMUONDigit.h"
59 #include "AliMUONRawCluster.h"
64 #include <TPolyMarker3D.h>
67 #include <TVirtualPad.h>
68 #include <TPolyLine3D.h>
69 #include <TPaveText.h>
74 ClassImp(AliMUONPoints)
76 //_____________________________________________________________________________
77 AliMUONPoints::AliMUONPoints()
80 // Default constructor
85 fMarker[0] = fMarker[1] = fMarker[2]=0;
89 //_____________________________________________________________________________
90 AliMUONPoints::AliMUONPoints(Int_t npoints)
94 // Standard constructor
99 fMarker[0] = fMarker[1] = fMarker[2]=0;
103 AliMUONPoints::AliMUONPoints(const AliMUONPoints& points)
108 //_____________________________________________________________________________
109 AliMUONPoints::~AliMUONPoints()
112 // Default destructor
117 for (Int_t i=0;i<3;i++){
118 if (fMarker[i]) delete fMarker[i];
123 //_____________________________________________________________________________
124 void AliMUONPoints::DumpHit()
127 // Dump hit corresponding to this point
129 AliMUONHit *hit = GetHit();
130 if (hit) hit->Dump();
133 //_____________________________________________________________________________
134 void AliMUONPoints::DumpDigit()
137 // Dump digit corresponding to this point
139 AliMUONDigit *digit = GetDigit();
140 if (digit) digit->Dump();
143 //_____________________________________________________________________________
144 void AliMUONPoints::InspectHit()
147 // Inspect hit corresponding to this point
150 if (fHitIndex < 0 ) return;
151 TVirtualPad *padsav = gPad;
152 AliMUONHit *hit = GetHit();
153 if (hit) hit->Inspect();
154 TVirtualPad *padinspect = (TVirtualPad*)(gROOT->GetListOfCanvases())->FindObject("inspect");
156 Float_t xmin = gPad->GetX1();
157 Float_t xmax = gPad->GetX2();
158 Float_t ymin = gPad->GetY1();
159 Float_t ymax = gPad->GetY2();
160 Float_t dy = ymax-ymin;
162 TPaveText *pad = new TPaveText(xmin, ymin+0.1*dy, xmax, ymin+0.15*dy);
163 pad->SetBit(kCanDelete);
164 pad->SetFillColor(42);
167 sprintf(ptitle," %s , fTrack: %d fTrackIndex: %d ",GetName(),fIndex,fTrackIndex);
168 pad->AddText(ptitle);
170 padinspect->Update();
171 if (padsav) padsav->cd();
175 //_____________________________________________________________________________
176 void AliMUONPoints::InspectDigit()
179 // Inspect digit corresponding to this point
181 if (fDigitIndex < 0) return;
182 TVirtualPad *padsav = gPad;
183 AliMUONDigit *digit = GetDigit();
184 if (digit) digit->Inspect();
185 TVirtualPad *padinspect = (TVirtualPad*)(gROOT->GetListOfCanvases())->FindObject("inspect");
187 Float_t xmin = gPad->GetX1();
188 Float_t xmax = gPad->GetX2();
189 Float_t ymin = gPad->GetY1();
190 Float_t ymax = gPad->GetY2();
191 Float_t dy = ymax-ymin;
193 TPaveText *pad = new TPaveText(xmin, ymin+0.1*dy, xmax, ymin+0.25*dy);
194 pad->SetBit(kCanDelete);
195 pad->SetFillColor(42);
197 char ptitle[11][100];
198 // sprintf(ptitle[11],"Tracks making this digit");
199 // pad->AddText(ptitle[11]);
200 for (int i=0;i<10;i++) {
201 if (digit->fTracks[i] == 0) continue;
202 sprintf(ptitle[i],"fTrackIndex: %d Charge: %d",digit->fTracks[i],digit->fTcharges[i]);
203 pad->AddText(ptitle[i]);
206 padinspect->Update();
207 if (padsav) padsav->cd();
211 //_____________________________________________________________________________
212 Int_t AliMUONPoints::GetTrackIndex()
215 // Dump digit corresponding to this point
220 if (fDigitIndex != 0) {
221 Int_t ncol=this->fMatrix->GetNcols();
222 for (int i=0;i<ncol;i++) {
223 printf(" track charge %f %f \n",(*(this->fMatrix))(0,i),(*(this->fMatrix))(1,i));
230 //_____________________________________________________________________________
231 AliMUONHit *AliMUONPoints::GetHit() const
234 // Returns pointer to hit index in AliRun::fParticles
236 AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
237 gAlice->TreeH()->GetEvent(fTrackIndex);
238 TClonesArray *muonHits = pMUON->Hits();
239 Int_t nhits = muonHits->GetEntriesFast();
240 if (fHitIndex < 0 || fHitIndex >= nhits) return 0;
241 return (AliMUONHit*)muonHits->UncheckedAt(fHitIndex);
244 //_____________________________________________________________________________
245 AliMUONDigit *AliMUONPoints::GetDigit() const
248 // Returns pointer to digit index in AliRun::fParticles
251 AliMUONDisplay *display=(AliMUONDisplay*)gAlice->Display();
252 Int_t chamber=display->GetChamber();
253 Int_t cathode=display->GetCathode();
255 AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
256 TClonesArray *muonDigits = pMUON->DigitsAddress(chamber-1);
257 Int_t nent=(Int_t)gAlice->TreeD()->GetEntries();
258 gAlice->TreeD()->GetEvent(nent-2+cathode-1);
259 //gAlice->TreeD()->GetEvent(cathode);
260 Int_t ndigits = muonDigits->GetEntriesFast();
261 if (fDigitIndex < 0 || fDigitIndex >= ndigits) return 0;
262 return (AliMUONDigit*)muonDigits->UncheckedAt(fDigitIndex);
264 //_____________________________________________________________________________
266 AliMUONPoints& AliMUONPoints::operator= (const AliMUONPoints& rhs)