]>
Commit | Line | Data |
---|---|---|
a9e2aefa | 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 | ||
88cb7938 | 16 | /* $Id$ */ |
a9e2aefa | 17 | |
18 | #include "AliMUONChamberTrigger.h" | |
a9e2aefa | 19 | #include "AliMUONResponseTrigger.h" |
76fa1113 | 20 | #include "AliMUONHit.h" |
21 | #include "AliMUONGeometrySegmentation.h" | |
c4a97bcd | 22 | #include "AliLog.h" |
a9e2aefa | 23 | |
24 | ClassImp(AliMUONChamberTrigger) | |
25 | ||
26 | //------------------------------------------- | |
d81db581 | 27 | |
03f221a7 | 28 | AliMUONChamberTrigger::AliMUONChamberTrigger() |
30178c30 | 29 | : AliMUONChamber() |
d81db581 | 30 | { |
31 | // Default constructor | |
32 | } | |
33 | ||
34 | ||
30178c30 | 35 | AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id) |
36 | : AliMUONChamber(id) | |
a9e2aefa | 37 | { |
d81db581 | 38 | // Constructor using chamber id |
a9e2aefa | 39 | } |
40 | ||
41 | //------------------------------------------- | |
24fe6002 | 42 | void AliMUONChamberTrigger::DisIntegration(Float_t /*eloss*/, Float_t tof, |
802a864d | 43 | Float_t xhit, Float_t yhit, Float_t zhit, |
a9e2aefa | 44 | Int_t& nnew, |
45 | Float_t newclust[6][500]) | |
46 | { | |
47 | // | |
48 | // Generates pad hits (simulated cluster) | |
49 | // using the segmentation and the response model | |
50 | ||
51 | Int_t twentyNano; | |
39f5a0e6 | 52 | if (tof<75*TMath::Power(10,-9)) { |
a9e2aefa | 53 | twentyNano=1; |
54 | } else { | |
55 | twentyNano=100; | |
56 | } | |
57 | ||
a9e2aefa | 58 | Float_t qp; |
59 | nnew=0; | |
60 | for (Int_t i=1; i<=fnsec; i++) { | |
a30a000f | 61 | AliSegmentation * segmentation= |
62 | (AliSegmentation*) (*fSegmentation)[i-1]; | |
a9e2aefa | 63 | |
64 | // Find the module & strip Id. which has fired | |
65 | Int_t ix,iy; | |
66 | ||
a30a000f | 67 | segmentation->GetPadI(xhit,yhit,0,ix,iy); |
a9e2aefa | 68 | segmentation->SetPad(ix,iy); |
8c343c7c | 69 | |
a9e2aefa | 70 | // treatment of GEANT hits w/o corresponding strip (due to the fact that |
71 | // the 2 geometries are computed in a very slightly different way) | |
72 | if (ix==0&&iy==0) { | |
c4a97bcd | 73 | AliInfo(Form("AliMUONChamberTrigger hit w/o strip %f %f \n",xhit,yhit)); |
a9e2aefa | 74 | } else { |
75 | // --- store signal information for this strip | |
76 | newclust[0][nnew]=1.; // total charge | |
77 | newclust[1][nnew]=ix; // ix-position of pad | |
78 | newclust[2][nnew]=iy; // iy-position of pad | |
79 | newclust[3][nnew]=twentyNano; // time of flight | |
80 | newclust[4][nnew]=segmentation->ISector(); // sector id | |
81 | newclust[5][nnew]=(Float_t) i; // counter | |
82 | nnew++; | |
03f221a7 | 83 | |
84 | // cluster-size if AliMUONResponseTriggerV1, nothing if AliMUONResponseTrigger | |
85 | if (((AliMUONResponseTrigger*) fResponse)->SetGenerCluster()) { | |
86 | ||
87 | // set hits | |
88 | segmentation->SetHit(xhit,yhit,zhit); | |
89 | // get the list of nearest neighbours | |
90 | Int_t nList, xList[10], yList[10]; | |
91 | segmentation->Neighbours(ix,iy,&nList,xList,yList); | |
a9e2aefa | 92 | |
03f221a7 | 93 | qp = 0; |
94 | for (Int_t j=0; j<nList; j++){ // loop over neighbours | |
95 | if (xList[j]!=0) { // existing neighbour | |
96 | if (j==0||j==5||qp!=0) { // built-up cluster-size | |
97 | ||
98 | // neighbour real coordinates (just for checks here) | |
99 | Float_t x,y,z; | |
100 | segmentation->GetPadC(xList[j],yList[j],x,y,z); | |
101 | // set pad (fx fy & fix fiy are the current pad coord. & Id.) | |
102 | segmentation->SetPad(xList[j],yList[j]); | |
103 | // get the chamber (i.e. current strip) response | |
104 | qp=fResponse->IntXY(segmentation); | |
105 | ||
106 | if (qp > 0.5) { | |
107 | // --- store signal information for neighbours | |
108 | newclust[0][nnew]=qp; // total charge | |
109 | newclust[1][nnew]=segmentation->Ix(); // ix-pos. of pad | |
110 | newclust[2][nnew]=segmentation->Iy(); // iy-pos. of pad | |
111 | newclust[3][nnew]=twentyNano; // time of flight | |
112 | newclust[4][nnew]=segmentation->ISector(); // sector id | |
113 | newclust[5][nnew]=(Float_t) i; // counter | |
114 | nnew++; | |
115 | } // qp > 0.5 | |
116 | } // built-up cluster-size | |
117 | } // existing neighbour | |
118 | } // loop over neighbours | |
119 | } // endif hit w/o strip | |
120 | } // loop over planes | |
121 | } // if AliMUONResponseTriggerV1 | |
a9e2aefa | 122 | } |
123 | ||
124 | ||
125 | ||
76fa1113 | 126 | //------------------------------------------- |
127 | void AliMUONChamberTrigger::DisIntegration(AliMUONHit* hit, | |
128 | Int_t& nnew, | |
129 | Float_t newclust[6][500]) | |
130 | { | |
131 | // | |
132 | // Generates pad hits (simulated cluster) | |
133 | // using the segmentation and the response model | |
134 | ||
135 | ||
136 | Float_t tof = hit->Age(); | |
137 | Float_t xhit = hit->X(); | |
138 | Float_t yhit = hit->Y(); | |
139 | Float_t zhit = hit->Z(); | |
140 | Int_t id = hit->DetElemId(); | |
141 | ||
142 | Int_t twentyNano; | |
143 | if (tof<75*TMath::Power(10,-9)) { | |
144 | twentyNano=1; | |
145 | } else { | |
146 | twentyNano=100; | |
147 | } | |
148 | ||
149 | Float_t qp; | |
150 | nnew=0; | |
151 | for (Int_t i=1; i<=fnsec; i++) { | |
152 | AliMUONGeometrySegmentation * segmentation= | |
153 | (AliMUONGeometrySegmentation*) (*fSegmentation2)[i-1]; | |
154 | ||
155 | // Find the module & strip Id. which has fired | |
156 | Int_t ix,iy; | |
157 | segmentation->GetPadI(id,xhit,yhit,0,ix,iy); | |
158 | segmentation->SetPad(id,ix,iy); | |
159 | // if (ix < 0 || ix > 10000) return; | |
160 | // if (iy < 0 || iy > 10000) return; | |
a9e2aefa | 161 | |
76fa1113 | 162 | // treatment of GEANT hits w/o corresponding strip (due to the fact that |
163 | // the 2 geometries are computed in a very slightly different way) | |
164 | if (ix==0&&iy==0) { | |
165 | AliInfo(Form("AliMUONChamberTrigger hit w/o strip %f %f \n",xhit,yhit)); | |
166 | } else { | |
167 | // --- store signal information for this strip | |
168 | newclust[0][nnew]=1.; // total charge | |
169 | newclust[1][nnew]=ix; // ix-position of pad | |
170 | newclust[2][nnew]=iy; // iy-position of pad | |
171 | newclust[3][nnew]=twentyNano; // time of flight | |
172 | newclust[4][nnew]=segmentation->ISector(); // sector id | |
173 | newclust[5][nnew]=(Float_t) i; // counter | |
174 | nnew++; | |
175 | ||
176 | // cluster-size if AliMUONResponseTriggerV1, nothing if AliMUONResponseTrigger | |
177 | if (((AliMUONResponseTrigger*) fResponse)->SetGenerCluster()) { | |
178 | ||
179 | // set hits | |
180 | segmentation->SetHit(id,xhit,yhit,zhit); | |
181 | // get the list of nearest neighbours | |
182 | Int_t nList, xList[10], yList[10]; | |
183 | segmentation->Neighbours(id,ix,iy,&nList,xList,yList); | |
184 | ||
185 | qp = 0; | |
186 | for (Int_t j=0; j<nList; j++){ // loop over neighbours | |
187 | if (xList[j]!=0) { // existing neighbour | |
188 | if (j==0||j==5||qp!=0) { // built-up cluster-size | |
189 | ||
190 | // neighbour real coordinates (just for checks here) | |
191 | Float_t x,y,z; | |
192 | segmentation->GetPadC(id,xList[j],yList[j],x,y,z); | |
193 | // set pad (fx fy & fix fiy are the current pad coord. & Id.) | |
194 | segmentation->SetPad(id,xList[j],yList[j]); | |
195 | // get the chamber (i.e. current strip) response | |
196 | qp=fResponse->IntXY(id,segmentation); | |
197 | ||
198 | if (qp > 0.5) { | |
199 | // --- store signal information for neighbours | |
200 | newclust[0][nnew]=qp; // total charge | |
201 | newclust[1][nnew]=segmentation->Ix(); // ix-pos. of pad | |
202 | newclust[2][nnew]=segmentation->Iy(); // iy-pos. of pad | |
203 | newclust[3][nnew]=twentyNano; // time of flight | |
204 | newclust[4][nnew]=segmentation->ISector(); // sector id | |
205 | newclust[5][nnew]=(Float_t) i; // counter | |
206 | nnew++; | |
207 | } // qp > 0.5 | |
208 | } // built-up cluster-size | |
209 | } // existing neighbour | |
210 | } // loop over neighbours | |
211 | } // endif hit w/o strip | |
212 | } // loop over planes | |
213 | } // if AliMUONResponseTriggerV1 | |
214 | } | |
a9e2aefa | 215 | |
216 | ||
217 | ||
218 | ||
03f221a7 | 219 | |
220 |