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 **************************************************************************/
18 Revision 1.7 2000/10/02 21:28:12 fca
19 Removal of useless dependecies via forward declarations
21 Revision 1.6 2000/01/19 17:17:06 fca
22 Introducing a list of lists of hits -- more hits allowed for detector now
24 Revision 1.5 1999/09/29 09:24:27 fca
25 Introduction of the Copyright and cvs Log
29 ///////////////////////////////////////////////////////////////////////////////
32 // Photon Multiplicity Detector //
33 // This class contains the basic functions for the Photon Multiplicity //
34 // Detector. Functions specific to one particular geometry are //
35 // contained in the derived classes //
39 <img src="picts/AliPMDClass.gif">
42 <font size=+2 color=red>
43 <p>The responsible person for this module is
44 <a href="mailto:sub@vecdec.veccal.ernet.in">Subhasis Chattopadhyay</a>.
50 ///////////////////////////////////////////////////////////////////////////////
54 #include <TGeometry.h>
63 //_____________________________________________________________________________
67 // Default constructor
72 //_____________________________________________________________________________
73 AliPMD::AliPMD(const char *name, const char *title)
74 : AliDetector(name,title)
77 // Default constructor
81 // Allocate the array of hits
82 fHits = new TClonesArray("AliPMDhit", 405);
83 gAlice->AddHitList(fHits);
105 //_____________________________________________________________________________
106 void AliPMD::AddHit(Int_t track, Int_t *vol, Float_t *hits)
111 TClonesArray &lhits = *fHits;
112 AliPMDhit *newcell, *curcell;
113 // printf("PMD++ Adding energy %f, prim %d, vol %d %d %d %d\n",
114 // hits[3],gAlice->GetPrimary(track-1),vol[0],vol[1],vol[2],vol[3]);
115 newcell = new AliPMDhit(fIshunt, track, vol, hits);
117 for (i=0; i<fNhits; i++) {
119 // See if this cell has already been hit
120 curcell=(AliPMDhit*) lhits[i];
121 if (*curcell==*newcell) {
122 // printf("Cell with same numbers found\n") ; curcell->Print();
123 *curcell = *curcell+*newcell;
124 // printf("Cell after addition\n") ; curcell->Print();
129 new(lhits[fNhits++]) AliPMDhit(newcell);
133 //_____________________________________________________________________________
134 void AliPMD::BuildGeometry()
137 // Build simple ROOT TNode geometry for event display
141 const int kColorPMD = kRed;
144 Top=gAlice->GetGeometry()->GetNode("alice");
147 new TBRIK("S_PMD","PMD box","void",300,300,5);
149 Node = new TNode("PMD","PMD","S_PMD",0,0,-600,"");
150 Node->SetLineColor(kColorPMD);
154 //_____________________________________________________________________________
155 Int_t AliPMD::DistancetoPrimitive(Int_t , Int_t )
158 // Distance from mouse to detector on the screen
164 //_____________________________________________________________________________
165 void AliPMD::SetPAR(Float_t p1, Float_t p2, Float_t p3,Float_t p4)
168 // Set PMD parameters
176 //_____________________________________________________________________________
177 void AliPMD::SetIN(Float_t p1, Float_t p2, Float_t p3,Float_t p4,Float_t p5)
180 // Set PMD parameters
189 //_____________________________________________________________________________
190 void AliPMD::SetGEO(Float_t p1, Float_t p2, Float_t p3)
193 // Set geometry parameters
200 //_____________________________________________________________________________
201 void AliPMD::SetPadSize(Float_t p1, Float_t p2, Float_t p3,Float_t p4)
212 //_____________________________________________________________________________
213 void AliPMD::StepManager()
216 // Called at every step in PMD
220 ///////////////////////////////////////////////////////////////////////////////
222 // Photon Multiplicity Detector Version 1 //
226 <img src="picts/AliPMDv1Class.gif">
230 ///////////////////////////////////////////////////////////////////////////////
234 //_____________________________________________________________________________
235 AliPMDhit::AliPMDhit(Int_t shunt,Int_t track, Int_t *vol, Float_t *hits):
242 for (i=0;i<5;i++) fVolume[i] = vol[i];