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 **************************************************************************/
19 // Class AliMUONTriggerResponseV1
21 // Trigger chamber response
22 // with cluster size activated
24 #include "AliMUONResponseTriggerV1.h"
25 #include "AliMUONGeometrySegmentation.h"
27 #include "AliMUONDigit.h"
28 #include "AliMUONGeometryTransformer.h"
29 #include "AliMUONSegmentation.h"
30 #include "AliMUONConstants.h"
33 #include "AliMpSegmentation.h"
34 #include "AliMpVSegmentation.h"
35 #include "AliMpCathodType.h"
43 ClassImp(AliMUONResponseTriggerV1)
50 return static_cast<AliMUON*>(gAlice->GetModule("MUON"));
53 void Global2Local(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg,
54 Double_t& xl, Double_t& yl, Double_t& zl)
56 // ideally should be :
58 // AliMUONGeometry::Global2Local(detElemId,xg,yg,zg,x,y,z);
59 // but while waiting for this geometry singleton, let's go through
62 const AliMUONGeometryTransformer* transformer = muon()->GetGeometryTransformer();
63 transformer->Global2Local(detElemId,xg,yg,zg,xl,yl,zl);
66 AliMUONSegmentation* Segmentation()
68 static AliMUONSegmentation* segmentation = muon()->GetSegmentation();
73 //------------------------------------------------------------------
74 AliMUONResponseTriggerV1::AliMUONResponseTriggerV1()
75 : AliMUONResponseTrigger(),
81 /// default constructor
86 //------------------------------------------------------------------
87 AliMUONResponseTriggerV1::AliMUONResponseTriggerV1(Float_t hv)
88 : AliMUONResponseTrigger(),
98 //------------------------------------------------------------------
99 AliMUONResponseTriggerV1::~AliMUONResponseTriggerV1()
104 //------------------------------------------------------------------
105 void AliMUONResponseTriggerV1::SetParameters(Float_t hv)
107 /// initialize parameters accoring to HV
108 /// (see V.Barret B.Espagnon and P.Rosnet Alice/note xxx)
109 fA = 6.089 * hv - 52.70;
111 fC = 4.3e-4 * hv - 3.5e-3;
114 //------------------------------------------------------------------
115 Int_t AliMUONResponseTriggerV1::SetGenerCluster()
117 /// Set the GenerCluster parameter and return 1
118 fGenerCluster = gRandom->Rndm();
122 //------------------------------------------------------------------
123 Float_t AliMUONResponseTriggerV1::FireStripProb(Float_t x4, Float_t theta)
126 // parametrisation of the probability that a strip neighbour of the main
127 // strip is fired (V.Barret B.Espagnon and P.Rosnet INT/DIM/01-04 (2001)
128 // WARNING : need to convert x4 from cm to mm
131 (TMath::Cos(theta)*fA/(fA+TMath::Cos(theta)*TMath::Power(x4*10.,fB))+fC)/
132 (TMath::Cos(theta)+fC);
135 //------------------------------------------------------------------
136 void AliMUONResponseTriggerV1::DisIntegrate(const AliMUONHit& hit, TList& digits)
138 /// Generate digits (on each cathode) from 1 hit, with cluster-size
143 Float_t xhit = hit.X();
144 Float_t yhit = hit.Y();
145 Float_t zhit = 0; // FIXME : should it be hit.Z() ?
146 Int_t detElemId = hit.DetElemId();
149 Global2Local(detElemId,xhit,yhit,zhit,x,y,z);
151 Float_t tof = hit.Age();
152 Int_t twentyNano(100);
153 if (tof<AliMUONConstants::TriggerTofLimit())
158 for ( Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; ++cath )
160 const AliMpVSegmentation* seg
161 = AliMpSegmentation::Instance()
162 ->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
164 AliMpPad pad = seg->PadByPosition(TVector2(x,y),kFALSE);
165 Int_t ix = pad.GetIndices().GetFirst();
166 Int_t iy = pad.GetIndices().GetSecond();
168 AliMUONDigit* d = new AliMUONDigit;
169 d->SetDetElemId(detElemId);
174 d->SetSignal(twentyNano);
175 d->AddPhysicsSignal(d->Signal());
179 SetGenerCluster(); // 1 randum number per cathode (to be checked)
181 Int_t xList[10], yList[10];
182 Neighbours(cath,ix,iy,xList,yList);
184 // cout << " detElemId cath ix iy = " << detElemId << " " << cath
185 // << " " << ix << " " << iy << "\n";
186 // for (Int_t i=0; i<10; i++) cout << " " << xList[i] << " " << yList[i];
189 Int_t qp = 0; // fired/no-fired strip = 1/0
190 for (Int_t i=0; i<10; i++) { // loop on neighbors
191 if (i==0||i==5||qp!=0) { // built-up cluster
193 // need to iterate in iy/ix for bending/non-bending plane
194 Int_t ixNeigh = ( cath == 0 ) ? ix : xList[i];
195 Int_t iyNeigh = ( cath == 0 ) ? yList[i] : iy;
197 AliMpIntPair pairNeigh = AliMpIntPair(ixNeigh,iyNeigh);
198 AliMpPad padNeigh = seg->PadByIndices(pairNeigh,kFALSE);
199 if(padNeigh.IsValid()){ // existing neighbourg
201 Int_t dix=-(ixNeigh-ix);
202 Int_t diy=-(iyNeigh-iy);
203 Float_t xlocalNeigh = padNeigh.Position().X();
204 Float_t ylocalNeigh = padNeigh.Position().Y();
205 Float_t dpx = padNeigh.Dimensions().X();
206 Float_t dpy = padNeigh.Dimensions().Y();
207 Float_t distX = TMath::Abs((Float_t)dix) * ((Float_t)dix * dpx + xlocalNeigh - x);
208 Float_t distY = TMath::Abs((Float_t)diy) * ((Float_t)diy * dpy + ylocalNeigh - y);
209 Float_t dist = TMath::Sqrt(distX*distX+distY*distY);
211 // cout << " here " << dist << " " << fGenerCluster << " " << FireStripProb(dist,0) << "\n";
213 if (fGenerCluster<FireStripProb(dist,0)) qp = 1;
216 if (qp == 1) { // this digit is fired
217 AliMUONDigit* dNeigh = new AliMUONDigit;
218 dNeigh->SetDetElemId(detElemId);
220 dNeigh->SetPadX(ixNeigh);
221 dNeigh->SetPadY(iyNeigh);
223 dNeigh->SetSignal(twentyNano);
224 dNeigh->AddPhysicsSignal(dNeigh->Signal());
225 dNeigh->SetCathode(cath);
229 } // built-up cluster
230 } // loop on neighbors
234 //------------------------------------------------------------------
235 void AliMUONResponseTriggerV1::Neighbours(const Int_t cath,
236 const Int_t ix, const Int_t iy,
237 Int_t Xlist[10], Int_t Ylist[10])
239 ///-----------------BENDING----------------------------------------- /n
240 /// Returns list of 10 next neighbours for given X strip (ix, iy) /n
241 /// neighbour number 4 in the list - /n
242 /// neighbour number 3 in the list | /n
243 /// neighbour number 2 in the list |_ Upper part /n
244 /// neighbour number 1 in the list | /n
245 /// neighbour number 0 in the list - /n
246 /// X strip (ix, iy) /n
247 /// neighbour number 5 in the list - /n
248 /// neighbour number 6 in the list | _ Lower part /n
249 /// neighbour number 7 in the list | /n
250 /// neighbour number 8 in the list | /n
251 /// neighbour number 9 in the list - /n
253 ///-----------------NON-BENDING------------------------------------- /n
254 /// Returns list of 10 next neighbours for given Y strip (ix, iy) /n
255 /// neighbour number 9 8 7 6 5 (Y strip (ix, iy)) 0 1 2 3 4 in the list /n
256 /// |_______| |_______/ /n
260 for (Int_t i=0; i<10; i++) {
265 Int_t iList[10]={9,8,7,6,5, 0,1,2,3,4};
267 // need to iterate in iy/ix for bending/non-bending plane
268 Int_t iNeigh = ( cath == 0 ) ? iy : ix;
271 for (Int_t j=iNeigh-5; j<=iNeigh+5; j++){
272 if (j == iNeigh) continue;
273 // need to iterate in iy/ix for bending/non-bending plane
274 Int_t ixNeigh = ( cath == 0 ) ? ix : j;
275 Int_t iyNeigh = ( cath == 0 ) ? j : iy;
277 // cout << " " << cath << " " << ix << " " << iy
278 // << " " << ixNeigh << " " << iyNeigh << "\n";
280 Xlist[iList[i]]=ixNeigh;
281 Ylist[iList[i]]=iyNeigh;