]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONChamber.cxx
Chamber half-planes of stations 3-5 at different z-positions.
[u/mrichter/AliRoot.git] / MUON / AliMUONChamber.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
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  **************************************************************************/
15 /*
16 $Log$
17 Revision 1.5  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.
20
21 Revision 1.4  2000/06/29 12:34:09  morsch
22 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
23 it usable with any other geometry class. The link to the object to which it belongs is
24 established via an index. This assumes that there exists a global geometry manager
25 from which the pointer to the parent object can be obtained (in our case gAlice).
26
27 Revision 1.3  2000/06/28 15:16:35  morsch
28 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
29 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
30 framework. The changes should have no side effects (mostly dummy arguments).
31 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
32 of chambers with overlapping modules (MakePadHits, Disintegration).
33
34 Revision 1.2  2000/06/15 07:58:48  morsch
35 Code from MUON-dev joined
36
37 Revision 1.1.2.5  2000/06/09 21:27:01  morsch
38 Most coding rule violations corrected.
39
40 Revision 1.1.2.4  2000/05/05 11:34:12  morsch
41 Log inside comments.
42
43 Revision 1.1.2.3  2000/05/05 10:09:52  morsch
44 Log messages included
45 */
46
47 #include "AliMUONChamber.h"
48
49 #include "TMath.h"
50 ClassImp(AliMUONChamber)        
51
52     AliMUONChamber::AliMUONChamber()
53 {
54 // Default constructor
55     fSegmentation = new TObjArray(2);
56     (*fSegmentation)[0] = 0;
57     (*fSegmentation)[1] = 0;    
58     fResponse=0;
59     fnsec=1;
60     fReconstruction=0;
61     fId=0;
62 }
63
64     AliMUONChamber::AliMUONChamber(Int_t id) 
65 {
66 // Construtor with chamber id 
67     fSegmentation = new TObjArray(2);
68     (*fSegmentation)[0] = 0;
69     (*fSegmentation)[1] = 0;    
70     fResponse=0;
71     fnsec=1;
72     fReconstruction=0;
73     fId=id;
74 }
75
76 AliMUONChamber::~AliMUONChamber() 
77 {
78 // Destructor
79     if (fSegmentation) delete fSegmentation;
80 }
81
82 AliMUONChamber::AliMUONChamber(const AliMUONChamber& rChamber)
83 {
84 // Dummy copy constructor
85     ;
86 }
87
88
89 void AliMUONChamber::Init()
90 {
91 // Initalisation ..
92 //
93 // ... for chamber segmentation
94     if ((*fSegmentation)[0]) 
95     ((AliSegmentation *) (*fSegmentation)[0])->Init(fId);
96
97     if (fnsec==2) {
98         if ((*fSegmentation)[1])
99         ((AliSegmentation *) (*fSegmentation)[1])->Init(fId);
100     }
101 }
102
103 Int_t   AliMUONChamber::SigGenCond(Float_t x, Float_t y, Float_t z)
104 {
105 // Ask segmentation if signal should be generated 
106     if (fnsec==1) {
107         return ((AliSegmentation*) (*fSegmentation)[0])
108             ->SigGenCond(x, y, z) ;
109     } else {
110         return (((AliSegmentation*) (*fSegmentation)[0])
111                 ->SigGenCond(x, y, z)) ||
112             (((AliSegmentation*) (*fSegmentation)[1])
113              ->SigGenCond(x, y, z)) ;
114     }
115 }
116
117
118 void    AliMUONChamber::SigGenInit(Float_t x, Float_t y, Float_t z)
119 {
120 //
121 // Initialisation of segmentation for hit
122 //  
123     if (fnsec==1) {
124         ((AliSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
125     } else {
126         ((AliSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
127         ((AliSegmentation*) (*fSegmentation)[1])->SigGenInit(x, y, z) ;
128     }
129 }
130
131 void AliMUONChamber::DisIntegration(Float_t eloss, Float_t tof, 
132                                     Float_t xhit, Float_t yhit, Float_t zhit,
133                                     Int_t& nnew,Float_t newclust[6][500]) 
134 {
135 //    
136 //  Generates pad hits (simulated cluster) 
137 //  using the segmentation and the response model 
138     Float_t dx, dy;
139     //
140     // Width of the integration area
141     //
142     dx=fResponse->SigmaIntegration()*fResponse->ChargeSpreadX();
143     dy=fResponse->SigmaIntegration()*fResponse->ChargeSpreadY();
144     //
145     // Get pulse height from energy loss
146     Float_t qtot = fResponse->IntPH(eloss);
147     //
148     // Loop Over Pads
149     
150     Float_t qcheck=0, qp;
151     nnew=0;
152     
153     for (Int_t i=1; i<=fnsec; i++) {
154         qcheck=0;
155         AliSegmentation * segmentation=
156             (AliSegmentation *) (*fSegmentation)[i-1];
157         for (segmentation->FirstPad(xhit, yhit, zhit, dx, dy); 
158              segmentation->MorePads(); 
159              segmentation->NextPad()) 
160         {
161             qp=fResponse->IntXY(segmentation);
162             qp=TMath::Abs(qp);
163 //
164 //
165             if (qp > 1.e-4) {
166                 qcheck+=qp*qtot;
167             //
168             // --- store signal information
169                 newclust[0][nnew]=qtot;                     // total charge
170                 newclust[1][nnew]=segmentation->Ix();       // ix-position of pad
171                 newclust[2][nnew]=segmentation->Iy();       // iy-position of pad
172                 newclust[3][nnew]=qp * qtot;                // charge on pad
173                 newclust[4][nnew]=segmentation->ISector();  // sector id
174                 newclust[5][nnew]=(Float_t) i;              // counter
175                 nnew++;
176 //              if (i==2) printf("\n i, nnew, q %d %d %f", i, nnew, qp*qtot);
177                 
178             }
179         } // Pad loop
180         
181     } // Cathode plane loop
182 }
183
184
185
186 void AliMUONChamber::InitGeo(Float_t zpos)
187 {
188 //    sensitive gas gap
189       fdGas= 0.5;
190 //    3% radiation length of aluminum (X0=8.9 cm)      
191       fdAlu= 3.0/100*8.9;
192 }
193
194
195 AliMUONChamber & AliMUONChamber::operator =(const AliMUONChamber& rhs)
196 {
197 // Dummy assignment operator
198     return *this;
199 }