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.1.2.6 2000/06/09 21:57:40 morsch
18 Most coding rule violations corrected.
20 Revision 1.1.2.5 2000/05/05 11:33:56 morsch
23 Revision 1.1.2.4 2000/05/05 10:12:09 morsch
27 ///////////////////////////////////////////////////////////////////////////////
29 // This class contains the points for the ALICE event display //
33 <img src="gif/AliMUONPointsClass.gif">
38 ///////////////////////////////////////////////////////////////////////////////
40 #include "AliMUONPoints.h"
41 #include "AliMUONDisplay.h"
44 #include "AliMUONChamber.h"
45 #include "AliMUONSegmentation.h"
46 #include "AliMUONResponse.h"
47 #include "AliMUONHit.h"
48 #include "AliMUONPadHit.h"
49 #include "AliMUONDigit.h"
50 #include "AliMUONRawCluster.h"
53 #include <TPolyMarker3D.h>
56 #include <TVirtualPad.h>
57 #include <TPolyLine3D.h>
58 #include <TPaveText.h>
62 const Int_t kMaxNipx=400, kMaxNipy=800;
64 ClassImp(AliMUONPoints)
66 //_____________________________________________________________________________
67 AliMUONPoints::AliMUONPoints()
70 // Default constructor
75 fMarker[0] = fMarker[1] = fMarker[2]=0;
79 //_____________________________________________________________________________
80 AliMUONPoints::AliMUONPoints(Int_t npoints)
84 // Standard constructor
89 fMarker[0] = fMarker[1] = fMarker[2]=0;
93 AliMUONPoints::AliMUONPoints(const AliMUONPoints& points)
98 //_____________________________________________________________________________
99 AliMUONPoints::~AliMUONPoints()
102 // Default destructor
107 for (Int_t i=0;i<3;i++){
108 if (fMarker[i]) delete fMarker[i];
113 //_____________________________________________________________________________
114 void AliMUONPoints::DumpHit()
117 // Dump hit corresponding to this point
119 AliMUONHit *hit = GetHit();
120 if (hit) hit->Dump();
123 //_____________________________________________________________________________
124 void AliMUONPoints::DumpDigit()
127 // Dump digit corresponding to this point
129 AliMUONDigit *digit = GetDigit();
130 if (digit) digit->Dump();
133 //_____________________________________________________________________________
134 void AliMUONPoints::InspectHit()
137 // Inspect hit corresponding to this point
140 if (fHitIndex < 0 ) return;
141 TVirtualPad *padsav = gPad;
142 AliMUONHit *hit = GetHit();
143 if (hit) hit->Inspect();
144 TVirtualPad *padinspect = (TVirtualPad*)(gROOT->GetListOfCanvases())->FindObject("inspect");
146 Float_t xmin = gPad->GetX1();
147 Float_t xmax = gPad->GetX2();
148 Float_t ymin = gPad->GetY1();
149 Float_t ymax = gPad->GetY2();
150 Float_t dy = ymax-ymin;
152 TPaveText *pad = new TPaveText(xmin, ymin+0.1*dy, xmax, ymin+0.15*dy);
153 pad->SetBit(kCanDelete);
154 pad->SetFillColor(42);
157 sprintf(ptitle," %s , fTrack: %d fTrackIndex: %d ",GetName(),fIndex,fTrackIndex);
158 pad->AddText(ptitle);
160 padinspect->Update();
161 if (padsav) padsav->cd();
165 //_____________________________________________________________________________
166 void AliMUONPoints::InspectDigit()
169 // Inspect digit corresponding to this point
171 if (fDigitIndex < 0) return;
172 TVirtualPad *padsav = gPad;
173 AliMUONDigit *digit = GetDigit();
174 if (digit) digit->Inspect();
175 TVirtualPad *padinspect = (TVirtualPad*)(gROOT->GetListOfCanvases())->FindObject("inspect");
177 Float_t xmin = gPad->GetX1();
178 Float_t xmax = gPad->GetX2();
179 Float_t ymin = gPad->GetY1();
180 Float_t ymax = gPad->GetY2();
181 Float_t dy = ymax-ymin;
183 TPaveText *pad = new TPaveText(xmin, ymin+0.1*dy, xmax, ymin+0.25*dy);
184 pad->SetBit(kCanDelete);
185 pad->SetFillColor(42);
187 char ptitle[11][100];
188 // sprintf(ptitle[11],"Tracks making this digit");
189 // pad->AddText(ptitle[11]);
190 for (int i=0;i<10;i++) {
191 if (digit->fTracks[i] == 0) continue;
192 sprintf(ptitle[i],"fTrackIndex: %d Charge: %d",digit->fTracks[i],digit->fTcharges[i]);
193 pad->AddText(ptitle[i]);
196 padinspect->Update();
197 if (padsav) padsav->cd();
201 //_____________________________________________________________________________
202 Int_t AliMUONPoints::GetTrackIndex()
205 // Dump digit corresponding to this point
210 if (fDigitIndex != 0) {
211 Int_t ncol=this->fMatrix->GetNcols();
212 for (int i=0;i<ncol;i++) {
213 printf(" track charge %f %f \n",(*(this->fMatrix))(0,i),(*(this->fMatrix))(1,i));
220 //_____________________________________________________________________________
221 AliMUONHit *AliMUONPoints::GetHit() const
224 // Returns pointer to hit index in AliRun::fParticles
226 AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
227 gAlice->TreeH()->GetEvent(fTrackIndex);
228 TClonesArray *muonHits = pMUON->Hits();
229 Int_t nhits = muonHits->GetEntriesFast();
230 if (fHitIndex < 0 || fHitIndex >= nhits) return 0;
231 return (AliMUONHit*)muonHits->UncheckedAt(fHitIndex);
234 //_____________________________________________________________________________
235 AliMUONDigit *AliMUONPoints::GetDigit() const
238 // Returns pointer to digit index in AliRun::fParticles
241 AliMUONDisplay *display=(AliMUONDisplay*)gAlice->Display();
242 Int_t chamber=display->GetChamber();
243 Int_t cathode=display->GetCathode();
245 AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON");
246 TClonesArray *muonDigits = pMUON->DigitsAddress(chamber-1);
247 Int_t nent=(Int_t)gAlice->TreeD()->GetEntries();
248 gAlice->TreeD()->GetEvent(nent-2+cathode-1);
249 //gAlice->TreeD()->GetEvent(cathode);
250 Int_t ndigits = muonDigits->GetEntriesFast();
251 if (fDigitIndex < 0 || fDigitIndex >= ndigits) return 0;
252 return (AliMUONDigit*)muonDigits->UncheckedAt(fDigitIndex);
254 //_____________________________________________________________________________
256 AliMUONPoints& AliMUONPoints::operator= (const AliMUONPoints& rhs)