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 //#include <TRandom.h>
21 //#include <Riostream.h>
23 #include "AliMUONSegmentationTrigger.h"
24 #include "AliMUONTriggerConstants.h"
27 #include "AliMUONChamber.h"
29 ClassImp(AliMUONSegmentationTrigger)
31 //------------------------------------------------------------------
32 AliMUONSegmentationTrigger::AliMUONSegmentationTrigger()
33 : AliMUONSegmentationV0()
40 //------------------------------------------------------------------
41 void AliMUONSegmentationTrigger::Init(Int_t chamber)
43 // initialize Module geometry
44 AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON");
45 AliMUONChamber* iChamber=&(pMUON->Chamber(chamber));
47 if(pMUON->GetDebug()>1) printf("%s: Initialize Trigger Chamber Module Geometry\n",ClassName());
49 Float_t zPos=iChamber->Z();
50 Float_t z1Pos=-1603.5;
57 // Float_t z1PosPlus=z1Pos+dz/2.;
58 // Float_t z1PosMinus=z1Pos-dz/2.;
59 Float_t z1PosPlus=z1Pos-dz/2.;
60 Float_t z1PosMinus=z1Pos+dz/2.;
62 Float_t z1pm=z1PosPlus/z1PosMinus;
63 Float_t z1mp=z1PosMinus/z1PosPlus;
65 if(pMUON->GetDebug()>1) printf("%s: fZscale = %f \n",ClassName(),fZscale);
67 // calculate yCmin and fYcmax
69 for (i=62; i>=0; i--) {
70 Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left
71 if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==5) { // start with middle chamber
72 if (AliMUONTriggerConstants::ModuleId(i)==51) { // special case (empty module)
73 fYcmin[i]=fYcmax[i]=fYcmin[j]=fYcmax[j]=0.;
75 y1Cmin[i]=y1Cmin[j]=-34;
76 y1Cmax[i]=y1Cmax[j]=34;
77 fYcmin[i]=fYcmin[j]=-34.;
79 fYcmax[i]=fYcmax[j]=34.;
81 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==4) { // up
82 if (AliMUONTriggerConstants::ModuleId(i)!=41) {
83 y1Cmin[i]=y1Cmax[i+7]*z1pm;
84 y1Cmax[i]=y1Cmin[i]+68.;
86 fYcmax[i]=fYcmin[i]+68.;
88 y1Cmin[j]=y1Cmax[j+7]*z1mp;
89 y1Cmax[j]=y1Cmin[j]+68.;
91 fYcmax[j]=fYcmin[j]+68.;
93 y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17;
94 y1Cmax[i]=y1Cmin[i]+51.;
96 fYcmax[i]=fYcmin[i]+51.;
98 y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17;
99 y1Cmax[j]=y1Cmin[j]+51.;
101 fYcmax[j]=fYcmin[j]+51.;
103 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) {
104 y1Cmin[i]=y1Cmax[i+7]*z1mp;
105 y1Cmax[i]=y1Cmin[i]+68.;
107 fYcmax[i]=fYcmin[i]+68.;
109 y1Cmin[j]=y1Cmax[j+7]*z1pm;
110 y1Cmax[j]=y1Cmin[j]+68.;
112 fYcmax[j]=fYcmin[j]+68.;
113 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==2) {
114 y1Cmin[i]=y1Cmax[i+7]*z1pm;
115 y1Cmax[i]=y1Cmin[i]+68.;
117 fYcmax[i]=fYcmin[i]+68.;
119 y1Cmin[j]=y1Cmax[j+7]*z1mp;
120 y1Cmax[j]=y1Cmin[j]+68.;
122 fYcmax[j]=fYcmin[j]+68.;
123 } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==1) {
124 y1Cmin[i]=y1Cmax[i+7]*z1mp;
125 y1Cmax[i]=y1Cmin[i]+68.;
127 fYcmax[i]=fYcmin[i]+68.;
129 y1Cmin[j]=y1Cmax[j+7]*z1pm;
130 y1Cmax[j]=y1Cmin[j]+68.;
132 fYcmax[j]=fYcmin[j]+68.;
136 for (i=0; i<63; i++) { // second loop (fill lower part)
137 Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left
138 if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==6) {
139 fYcmin[i]=-fYcmax[i-14];
140 fYcmax[i]=-fYcmin[i-14];
141 fYcmin[j]=-fYcmax[j-14];
142 fYcmax[j]=-fYcmin[j-14];
143 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==7) {
144 fYcmin[i]=-fYcmax[i-28];
145 fYcmax[i]=-fYcmin[i-28];
146 fYcmin[j]=-fYcmax[j-28];
147 fYcmax[j]=-fYcmin[j-28];
148 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==8) {
149 fYcmin[i]=-fYcmax[i-42];
150 fYcmax[i]=-fYcmin[i-42];
151 fYcmin[j]=-fYcmax[j-42];
152 fYcmax[j]=-fYcmin[j-42];
153 } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==9) {
154 fYcmin[i]=-fYcmax[i-56];
155 fYcmax[i]=-fYcmin[i-56];
156 fYcmin[j]=-fYcmax[j-56];
157 fYcmax[j]=-fYcmin[j-56];
164 // Set parent chamber number
165 fChamber=&(pMUON->Chamber(chamber));
169 //------------------------------------------------------------------
170 void AliMUONSegmentationTrigger::Draw(const char * /*opt*/) {}
171 //------------------------------------------------------------------
172 Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){
173 // returns module number (from 0 to 126) corresponding to module imodule
175 for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) {
176 if (AliMUONTriggerConstants::ModuleId(i)==imodule) {
183 //------------------------------------------------------------------
184 void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit, Float_t /*zhit*/)
188 //------------------------------------------------------------------
189 Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){
190 // Returns x-strip size for given module imodule
192 Int_t absimodule=TMath::Abs(imodule);
193 Int_t moduleNum=ModuleNumber(imodule);
194 if (absimodule==51) {
197 return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/
198 AliMUONTriggerConstants::NstripX(moduleNum));
202 //------------------------------------------------------------------
203 Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){
204 // Returns y-strip size for given module imodule
206 Int_t absimodule=TMath::Abs(imodule);
207 Int_t moduleNum=ModuleNumber(imodule);
208 if (absimodule==51) {
211 return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) -
212 AliMUONTriggerConstants::XcMin(moduleNum)) /
213 AliMUONTriggerConstants::NstripY(moduleNum));
217 //------------------------------------------------------------------
218 void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit)
220 // Sets virtual hit position, needed for evaluating pad response
221 // outside the tracking program