]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONChamber.cxx
45a4027e3de9f9ef7b772e151079842ea15d0793
[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.2  2000/06/15 07:58:48  morsch
18 Code from MUON-dev joined
19
20 Revision 1.1.2.5  2000/06/09 21:27:01  morsch
21 Most coding rule violations corrected.
22
23 Revision 1.1.2.4  2000/05/05 11:34:12  morsch
24 Log inside comments.
25
26 Revision 1.1.2.3  2000/05/05 10:09:52  morsch
27 Log messages included
28 */
29
30 #include "AliMUONChamber.h"
31 #include "AliMUONSegmentation.h"
32 #include "AliMUONResponse.h"
33
34 #include "TMath.h"
35 ClassImp(AliMUONChamber)        
36
37     AliMUONChamber::AliMUONChamber() 
38 {
39     fSegmentation = new TObjArray(2);
40     (*fSegmentation)[0] = 0;
41     (*fSegmentation)[1] = 0;    
42     fResponse=0;
43     fnsec=1;
44     fReconstruction=0;
45 }
46
47 AliMUONChamber::~AliMUONChamber() 
48 {
49     if (fSegmentation) delete fSegmentation;
50 }
51
52 AliMUONChamber::AliMUONChamber(const AliMUONChamber& rChamber)
53 {
54 // Dummy copy constructor
55     ;
56 }
57
58
59 void AliMUONChamber::Init()
60 {
61 // Initalisation ..
62 //
63 // ... for chamber segmentation
64     if ((*fSegmentation)[0]) 
65     ((AliMUONSegmentation *) (*fSegmentation)[0])->Init(this);
66
67     if (fnsec==2) {
68         if ((*fSegmentation)[1])
69         ((AliMUONSegmentation *) (*fSegmentation)[1])->Init(this);
70     }
71 }
72
73 Int_t   AliMUONChamber::SigGenCond(Float_t x, Float_t y, Float_t z)
74 {
75 // Ask segmentation if signal should be generated 
76     if (fnsec==1) {
77         return ((AliMUONSegmentation*) (*fSegmentation)[0])
78             ->SigGenCond(x, y, z) ;
79     } else {
80         return (((AliMUONSegmentation*) (*fSegmentation)[0])
81                 ->SigGenCond(x, y, z)) ||
82             (((AliMUONSegmentation*) (*fSegmentation)[1])
83              ->SigGenCond(x, y, z)) ;
84     }
85 }
86
87
88 void    AliMUONChamber::SigGenInit(Float_t x, Float_t y, Float_t z)
89 {
90 //
91 // Initialisation of segmentation for hit
92 //  
93     if (fnsec==1) {
94         ((AliMUONSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
95     } else {
96         ((AliMUONSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
97         ((AliMUONSegmentation*) (*fSegmentation)[1])->SigGenInit(x, y, z) ;
98     }
99 }
100
101 void AliMUONChamber::DisIntegration(Float_t eloss, Float_t tof, 
102                                     Float_t xhit, Float_t yhit, Float_t zhit,
103                                     Int_t& nnew,Float_t newclust[6][500]) 
104 {
105 //    
106 //  Generates pad hits (simulated cluster) 
107 //  using the segmentation and the response model 
108     Float_t dx, dy;
109     //
110     // Width of the integration area
111     //
112     dx=fResponse->SigmaIntegration()*fResponse->ChargeSpreadX();
113     dy=fResponse->SigmaIntegration()*fResponse->ChargeSpreadY();
114     //
115     // Get pulse height from energy loss
116     Float_t qtot = fResponse->IntPH(eloss);
117     //
118     // Loop Over Pads
119     
120     Float_t qcheck=0, qp;
121     nnew=0;
122     for (Int_t i=1; i<=fnsec; i++) {
123         qcheck=0;
124         AliMUONSegmentation * segmentation=
125             (AliMUONSegmentation *) (*fSegmentation)[i-1];
126         for (segmentation->FirstPad(xhit, yhit, zhit, dx, dy); 
127              segmentation->MorePads(); 
128              segmentation->NextPad()) 
129         {
130             qp=fResponse->IntXY(segmentation);
131             qp=TMath::Abs(qp);
132             
133 //
134 //
135             if (qp > 1.e-4) {
136                 qcheck+=qp;
137             //
138             // --- store signal information
139                 newclust[0][nnew]=qtot;                     // total charge
140                 newclust[1][nnew]=segmentation->Ix();       // ix-position of pad
141                 newclust[2][nnew]=segmentation->Iy();       // iy-position of pad
142                 newclust[3][nnew]=qp * qtot;                // charge on pad
143                 newclust[4][nnew]=segmentation->ISector();  // sector id
144                 newclust[5][nnew]=(Float_t) i;              // counter
145                 nnew++;
146             }
147         } // Pad loop
148     } // Cathode plane loop
149 }
150
151
152
153 void AliMUONChamber::InitGeo(Float_t zpos)
154 {
155 //    sensitive gas gap
156       fdGas= 0.5;
157 //    3% radiation length of aluminum (X0=8.9 cm)      
158       fdAlu= 3.0/100*8.9;
159 }
160
161
162 AliMUONChamber & AliMUONChamber::operator =(const AliMUONChamber& rhs)
163 {
164 // Dummy assignment operator
165     return *this;
166 }