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 **************************************************************************/
20 #include "AliMUONChamberTrigger.h"
21 #include "AliMUONResponseTrigger.h"
22 #include "AliMUONHit.h"
24 #include "AliMUONSegmentation.h"
25 #include "AliMUONGeometrySegmentation.h"
26 #include "AliMUONGeometryTransformer.h"
30 /// \class AliMUONChamberTrigger
32 /// Implementation of AliMUONChamber for the trigger
34 /// This class is to be deprecated.
38 ClassImp(AliMUONChamberTrigger)
41 //-------------------------------------------
43 AliMUONChamberTrigger::AliMUONChamberTrigger()
47 /// Default constructor
50 //-------------------------------------------
52 AliMUONChamberTrigger:: ~AliMUONChamberTrigger()
57 //-------------------------------------------
59 AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id,
60 const AliMUONGeometryTransformer* kGeometryTransformer)
62 fkGeomTransformer(kGeometryTransformer)
64 /// Constructor using chamber id
67 //-------------------------------------------
68 void AliMUONChamberTrigger::DisIntegration(AliMUONHit* hit,
70 Float_t newclust[6][500])
72 /// Generates pad hits (simulated cluster)
73 /// using the segmentation and the response model
76 Float_t tof = hit->Age();
77 Float_t xhit = hit->X();
78 Float_t yhit = hit->Y();
79 Float_t zhit = hit->Z();
80 Int_t id = hit->DetElemId();
83 if (tof<75*TMath::Power(10,-9)) {
91 for (Int_t i = 1; i <= 2; i++) {
93 AliMUONGeometrySegmentation* segmentation=
94 fMUON->GetSegmentation()->GetModuleSegmentationByDEId(id, i-1);
97 // Find the module & strip Id. which has fired
100 segmentation->GetPadI(id,xhit,yhit,0,ix,iy);
101 // treatment of GEANT hits w/o corresponding strip (due to the fact that
102 // geometry & segmentation are computed in a very slightly different way)
106 fkGeomTransformer->Global2Local(id,xhit,yhit,0,lx,ly,lz);
107 AliWarning(Form("AliMUONChamberTrigger hit w/o strip %i-%d %e %e "
108 "local %e %e %e ix,iy=%d,%d\n",id,i-1,xhit,yhit,lx,ly,lz,ix,iy));
111 segmentation->SetPad(id,ix,iy);
112 if (xhit<0) ix = -ix;
113 // printf(" fId id fnsec xhit yhit zhit ix iy %i %i %i %f %f %f %i %i \n",fId,i,id,xhit,yhit,zhit,ix,iy);
114 // if (ix < 0 || ix > 10000) return;
115 // if (iy < 0 || iy > 10000) return;
117 // --- store signal information for this strip
118 newclust[0][nnew]=1.; // total charge
119 newclust[1][nnew]=ix; // ix-position of pad
120 newclust[2][nnew]=iy; // iy-position of pad
121 newclust[3][nnew]=twentyNano; // time of flight
122 newclust[4][nnew]=segmentation->ISector(); // sector id
123 newclust[5][nnew]=(Float_t) i; // counter
126 // cluster-size if AliMUONResponseTriggerV1, nothing if AliMUONResponseTrigger
127 if (((AliMUONResponseTrigger*) fResponse)->SetGenerCluster()) {
130 segmentation->SetHit(id,xhit,yhit,zhit);
131 // get the list of nearest neighbours
132 Int_t nList, xList[10], yList[10];
133 segmentation->Neighbours(id,ix,iy,&nList,xList,yList);
136 for (Int_t j=0; j<nList; j++){ // loop over neighbours
137 if (xList[j]!=0) { // existing neighbour
138 if (j==0||j==5||qp!=0) { // built-up cluster-size
140 // neighbour real coordinates (just for checks here)
142 segmentation->GetPadC(id,xList[j],yList[j],x,y,z);
143 // set pad (fx fy & fix fiy are the current pad coord. & Id.)
144 segmentation->SetPad(id,xList[j],yList[j]);
145 // get the chamber (i.e. current strip) response
146 qp=fResponse->IntXY(id,segmentation);
149 // --- store signal information for neighbours
150 newclust[0][nnew]=qp; // total charge
151 newclust[1][nnew]=segmentation->Ix(); // ix-pos. of pad
152 newclust[2][nnew]=segmentation->Iy(); // iy-pos. of pad
153 newclust[3][nnew]=twentyNano; // time of flight
154 newclust[4][nnew]=segmentation->ISector(); // sector id
155 newclust[5][nnew]=(Float_t) i; // counter
158 } // built-up cluster-size
159 } // existing neighbour
160 } // loop over neighbours
161 } // endif hit w/o strip
162 } // loop over planes
163 } // if AliMUONResponseTriggerV1