a9e2aefa |
1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
e6738866 |
3 | * * |
a9e2aefa |
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$ |
2ae08086 |
17 | Revision 1.5 2000/10/02 16:58:29 egangler |
18 | Cleaning of the code : |
19 | -> coding conventions |
20 | -> void Streamers |
21 | -> some useless includes removed or replaced by "class" statement |
22 | |
ecfa008b |
23 | Revision 1.4 2000/07/03 11:54:57 morsch |
24 | AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER |
25 | The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC. |
26 | |
a30a000f |
27 | Revision 1.3 2000/06/25 17:02:19 pcrochet |
28 | scope problem on HP, i declared once, pow replaced by TMath::Power (PH) |
29 | |
e6738866 |
30 | Revision 1.2 2000/06/15 07:58:49 morsch |
31 | Code from MUON-dev joined |
32 | |
a9e2aefa |
33 | Revision 1.1.2.8 2000/06/14 14:54:34 morsch |
34 | Complete redesign, make use of TriggerCircuit and TriggerLut (PC) |
35 | |
36 | Revision 1.1.2.5 2000/04/26 19:59:57 morsch |
37 | Constructor added. |
38 | |
39 | Revision 1.1.2.4 2000/04/26 12:31:30 morsch |
40 | Modifications by P. Crochet: |
41 | - adapted to the new Trigger chamber geometry |
42 | - condition on soft background added |
43 | - contructor added in AliMUONTriggerDecision.h |
44 | - single-undefined taken into account in the output of GlobalTrigger() |
45 | - some bugs fixed |
46 | |
47 | Revision 1.1.2.3 2000/03/21 09:29:58 morsch |
48 | Put back comments |
49 | |
50 | Revision 1.1.2.2 2000/03/21 09:24:34 morsch |
51 | Author and responsible for the code: Philippe Crochet |
52 | */ |
53 | |
ecfa008b |
54 | #include "AliMUONTriggerCircuit.h" |
a9e2aefa |
55 | #include "AliMUONTriggerDecision.h" |
56 | #include "AliMUONTriggerLut.h" |
57 | #include "AliMUONHitMapA1.h" |
58 | #include "AliRun.h" |
59 | #include "AliMUON.h" |
60 | #include "AliMUONPoints.h" |
a30a000f |
61 | #include "AliSegmentation.h" |
a9e2aefa |
62 | #include "AliMUONResponse.h" |
63 | #include "AliMUONChamber.h" |
64 | #include "AliMUONDigit.h" |
65 | |
66 | |
67 | #include <TF1.h> |
68 | #include <TTree.h> |
69 | #include <TCanvas.h> |
70 | #include <TH1.h> |
71 | #include <TPad.h> |
72 | #include <TGraph.h> |
73 | #include <TPostScript.h> |
74 | #include <TMinuit.h> |
75 | #include <iostream.h> |
76 | |
77 | //---------------------------------------------------------------------- |
78 | ClassImp(AliMUONTriggerDecision) |
79 | |
80 | //---------------------------------------------------------------------- |
81 | AliMUONTriggerDecision::AliMUONTriggerDecision(Int_t iprint) |
82 | { |
83 | // Constructor |
ecfa008b |
84 | fDebug = iprint; // print option |
a9e2aefa |
85 | // iprint = 0 : don't print anything |
86 | // iprint = 1 : print Global Trigger Output |
87 | // iprint = 2 : print Local and Global Trigger Outputs |
88 | // iprint = 3 : iprint = 2 + detailed info on X strips |
89 | // iprint = 4 : iprint = 2 + detailed info on Y strip |
90 | // iprint = 5 : iprint = 2 + detailed info on X and Y strips |
91 | // Note : with iprint>2, the strips detailed info is given for all circuits |
92 | |
93 | // Global Trigger information |
e6738866 |
94 | Int_t i; |
95 | Int_t icirc; |
96 | Int_t istrip; |
97 | |
98 | for (i=0; i<3; i++) { // [0] : Low pt, [1] : High pt, [2] : All pt |
a9e2aefa |
99 | fGlobalSinglePlus[i]=0; // tot num of single plus |
100 | fGlobalSingleMinus[i]=0; // tot num of single minus |
101 | fGlobalSingleUndef[i]=0; // tot num of single undefined |
102 | fGlobalPairUnlike[i]=0; // tot num of unlike-sign pairs |
103 | fGlobalPairLike[i]=0; // tot num of like-sign pairs |
104 | } |
105 | // Local Trigger information |
e6738866 |
106 | for (icirc=0; icirc<234; icirc++){ |
ecfa008b |
107 | fTrigger[icirc]=0; // trigger or not |
a9e2aefa |
108 | fStripX11[icirc]=0; // X strip in MC11 which triggers |
ecfa008b |
109 | fDev[icirc]=0; // deviation which triggers |
a9e2aefa |
110 | fStripY11[icirc]=0; // Y strip in MC11 which triggers |
e6738866 |
111 | for (i=0; i<2; i++) { // pt information via LuT |
a9e2aefa |
112 | fLutLpt[icirc][i]=fLutHpt[icirc][i]=fLutApt[icirc][i]=0; |
113 | } |
114 | } |
115 | // bit pattern |
e6738866 |
116 | for (icirc=0; icirc<234; icirc++) { |
117 | for (istrip=0; istrip<16; istrip++) { |
a9e2aefa |
118 | fXbit11[icirc][istrip]=fXbit12[icirc][istrip]=0; |
119 | fYbit11[icirc][istrip]=fYbit12[icirc][istrip]=0; |
120 | fYbit21[icirc][istrip]=fYbit22[icirc][istrip]=0; |
121 | fYbit21U[icirc][istrip]=fYbit22U[icirc][istrip]=0; |
122 | fYbit21D[icirc][istrip]=fYbit22D[icirc][istrip]=0; |
123 | } |
e6738866 |
124 | for (istrip=0; istrip<32; istrip++) { |
a9e2aefa |
125 | fXbit21[icirc][istrip]=fXbit22[icirc][istrip]=0; |
126 | } |
127 | } |
128 | } |
129 | |
130 | //---------------------------------------------------------------------- |
131 | AliMUONTriggerDecision::~AliMUONTriggerDecision() |
132 | { |
133 | // Destructor |
134 | } |
135 | |
136 | //---------------------------------------------------------------------- |
137 | void AliMUONTriggerDecision::Trigger(){ |
138 | // main method of the class which calls the overall Trigger procedure |
139 | // cout << " In AliMUONTriggerDecision::Trigger " << "\n"; |
140 | |
141 | ResetBit(); |
142 | SetBit(); |
143 | SetBitUpDownY(); |
144 | |
145 | Int_t coinc44=0, resetMid=0; // initialize coincidence |
146 | |
147 | AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); |
148 | AliMUONTriggerCircuit* triggerCircuit; |
149 | |
150 | for (Int_t icirc=0; icirc<234; icirc++) { // loop on circuits |
151 | triggerCircuit = &(pMUON->TriggerCircuit(icirc)); |
152 | // Int_t idCircuit=triggerCircuit->GetIdCircuit(); |
153 | |
154 | Int_t minDevStrip[5], minDev[5], coordY[5]; |
155 | for (Int_t i=0; i<5; i++) { |
156 | minDevStrip[i]=minDev[i]=coordY[i]=0; |
157 | } |
158 | Int_t x2m=triggerCircuit->GetX2m(); |
159 | Int_t x2ud=triggerCircuit->GetX2ud(); |
160 | Int_t orMud[2]={0,0}; |
161 | triggerCircuit->GetOrMud(orMud); |
162 | |
163 | // call triggerX |
164 | TrigX(fXbit11[icirc],fXbit12[icirc],fXbit21[icirc],fXbit22[icirc], |
165 | coinc44, minDevStrip, minDev); |
166 | // call triggerY |
167 | TrigY(fYbit11[icirc],fYbit12[icirc],fYbit21[icirc],fYbit22[icirc], |
168 | fYbit21U[icirc],fYbit21D[icirc],fYbit22U[icirc],fYbit22D[icirc], |
169 | x2m,x2ud,orMud,resetMid,coinc44,coordY); |
170 | // call LocalTrigger |
171 | Int_t iTrigger=0; |
172 | LocalTrigger(icirc, minDevStrip, minDev, coordY, iTrigger); |
173 | |
ecfa008b |
174 | if (iTrigger==1&&fDebug>1) { |
a9e2aefa |
175 | PrintBitPatXInput(icirc); |
176 | PrintBitPatYInput(icirc); |
177 | PrintLocalOutput(minDevStrip, minDev, coordY); |
178 | } |
179 | } // end loop on circuits |
180 | |
181 | // call Global Trigger |
182 | GlobalTrigger(); |
183 | // cout << " Leaving AliMUONTriggerDecision::Trigger " << "\n"; |
184 | } |
185 | |
186 | //---------------------------------------------------------------------- |
187 | void AliMUONTriggerDecision::ResetBit(){ |
188 | // reset bit pattern, global and local trigger output tables to 0 |
189 | |
e6738866 |
190 | Int_t i; |
191 | Int_t icirc; |
192 | Int_t istrip; |
193 | |
194 | for (icirc=0; icirc<234; icirc++) { |
195 | for (istrip=0; istrip<16; istrip++) { |
a9e2aefa |
196 | fXbit11[icirc][istrip]=fXbit12[icirc][istrip]=0; |
197 | fYbit11[icirc][istrip]=fYbit12[icirc][istrip]=0; |
198 | fYbit21[icirc][istrip]=fYbit22[icirc][istrip]=0; |
199 | fYbit21U[icirc][istrip]=fYbit22U[icirc][istrip]=0; |
200 | fYbit21D[icirc][istrip]=fYbit22D[icirc][istrip]=0; |
201 | } |
e6738866 |
202 | for (istrip=0; istrip<32; istrip++) { |
a9e2aefa |
203 | fXbit21[icirc][istrip]=fXbit22[icirc][istrip]=0; |
204 | } |
205 | } |
e6738866 |
206 | for (i=0; i<3; i++) { |
a9e2aefa |
207 | fGlobalSinglePlus[i]=0; |
208 | fGlobalSingleMinus[i]=0; |
209 | fGlobalSingleUndef[i]=0; |
210 | fGlobalPairLike[i]=0; |
211 | fGlobalPairLike[i]=0; |
212 | } |
e6738866 |
213 | for (icirc=0; icirc<234; icirc++){ |
ecfa008b |
214 | fTrigger[icirc]=0; |
a9e2aefa |
215 | fStripX11[icirc]=0; |
ecfa008b |
216 | fDev[icirc]=0; |
a9e2aefa |
217 | fStripY11[icirc]=0; |
e6738866 |
218 | for (i=0; i<2; i++) { |
a9e2aefa |
219 | fLutLpt[icirc][i]=fLutHpt[icirc][i]=fLutApt[icirc][i]=0; |
220 | } |
221 | } |
222 | } |
223 | |
224 | //---------------------------------------------------------------------- |
225 | void AliMUONTriggerDecision::SetBit(){ |
226 | // 1) loop over chambers and cathodes |
227 | // 2) load digits |
228 | // 3) remove soft background |
229 | // 4) set the bit patterns |
230 | |
231 | AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); |
232 | AliMUONTriggerCircuit* triggerCircuit; |
233 | |
234 | for (Int_t chamber=11; chamber<15; chamber++){ |
235 | for (Int_t cathode=1; cathode<3; cathode++){ |
236 | |
a30a000f |
237 | AliMUONChamber* iChamber; |
238 | AliSegmentation* segmentation; |
a9e2aefa |
239 | |
240 | TClonesArray *muonDigits = pMUON->DigitsAddress(chamber-1); |
241 | if (muonDigits == 0) return; |
242 | |
243 | gAlice->ResetDigits(); |
244 | |
245 | Int_t nent=(Int_t)gAlice->TreeD()->GetEntries(); |
246 | gAlice->TreeD()->GetEvent(nent-2+cathode-1); |
247 | Int_t ndigits = muonDigits->GetEntriesFast(); |
248 | if (ndigits == 0) return; |
249 | |
250 | iChamber = &(pMUON->Chamber(chamber-1)); |
251 | segmentation=iChamber->SegmentationModel(cathode); |
252 | AliMUONDigit *mdig; |
253 | |
254 | for (Int_t digit=0; digit<ndigits; digit++) { |
255 | mdig = (AliMUONDigit*)muonDigits->UncheckedAt(digit); |
256 | // get the center of the pad Id |
2ae08086 |
257 | Int_t ix=mdig->PadX(); |
258 | Int_t iy=mdig->PadY(); |
a9e2aefa |
259 | // get the sum of the coded charge |
260 | // see coding convention in AliMUONChamberTrigger::DisIntegration |
261 | Int_t sumCharge=0; |
262 | for (Int_t icharge=0; icharge<10; icharge++) { |
2ae08086 |
263 | sumCharge=sumCharge+mdig->TrackCharge(icharge); |
a9e2aefa |
264 | } |
265 | // apply condition on soft background |
266 | Int_t testCharge=sumCharge-(Int_t(sumCharge/10))*10; |
267 | testCharge=sumCharge-testCharge*10; |
268 | if(sumCharge<=10||testCharge>0) { |
269 | // code pad |
270 | Int_t code=TMath::Abs(ix)*100+iy; |
271 | if (ix<0) { code=-code; } |
e6738866 |
272 | |
273 | Int_t icirc; |
274 | Int_t istrip; |
275 | Int_t nStrip; |
a9e2aefa |
276 | |
277 | if (cathode==1) { |
278 | switch (chamber) |
279 | { |
280 | case 11: |
e6738866 |
281 | for (icirc=0; icirc<234; icirc++) { |
a9e2aefa |
282 | triggerCircuit = &(pMUON->TriggerCircuit(icirc)); |
e6738866 |
283 | for (istrip=0; istrip<16; istrip++) { |
a9e2aefa |
284 | if (triggerCircuit->GetXcode(0,istrip)==code) |
285 | fXbit11[icirc][istrip]=1; |
286 | } |
287 | } |
288 | break; |
289 | case 12: |
e6738866 |
290 | for (icirc=0; icirc<234; icirc++) { |
a9e2aefa |
291 | triggerCircuit = &(pMUON->TriggerCircuit(icirc)); |
e6738866 |
292 | for (istrip=0; istrip<16; istrip++) { |
a9e2aefa |
293 | if (triggerCircuit->GetXcode(1,istrip)==code) |
294 | fXbit12[icirc][istrip]=1; |
295 | } |
296 | } |
297 | break; |
298 | case 13: |
e6738866 |
299 | for (icirc=0; icirc<234; icirc++) { |
a9e2aefa |
300 | triggerCircuit = &(pMUON->TriggerCircuit(icirc)); |
e6738866 |
301 | for (istrip=0; istrip<32; istrip++) { |
a9e2aefa |
302 | if (triggerCircuit->GetXcode(2,istrip)==code) |
303 | fXbit21[icirc][istrip]=1; |
304 | } |
305 | } |
306 | break; |
307 | case 14: |
e6738866 |
308 | for (icirc=0; icirc<234; icirc++) { |
a9e2aefa |
309 | triggerCircuit = &(pMUON->TriggerCircuit(icirc)); |
e6738866 |
310 | for (istrip=0; istrip<32; istrip++) { |
a9e2aefa |
311 | if (triggerCircuit->GetXcode(3,istrip)==code) |
312 | fXbit22[icirc][istrip]=1; |
313 | } |
314 | } |
315 | break; |
316 | } |
317 | |
318 | } else { // Y plane |
319 | switch (chamber) |
320 | { |
321 | case 11: |
e6738866 |
322 | for (icirc=0; icirc<234; icirc++) { |
a9e2aefa |
323 | triggerCircuit = &(pMUON->TriggerCircuit(icirc)); |
e6738866 |
324 | nStrip=triggerCircuit->GetNstripY(); |
325 | for (istrip=0; istrip<nStrip; istrip++) { |
a9e2aefa |
326 | if (triggerCircuit->GetYcode(0,istrip)==code) |
327 | fYbit11[icirc][istrip]=1; |
328 | } |
329 | } |
330 | break; |
331 | case 12: |
e6738866 |
332 | for (icirc=0; icirc<234; icirc++) { |
a9e2aefa |
333 | triggerCircuit = &(pMUON->TriggerCircuit(icirc)); |
e6738866 |
334 | nStrip=triggerCircuit->GetNstripY(); |
335 | for (istrip=0; istrip<nStrip; istrip++) { |
a9e2aefa |
336 | if (triggerCircuit->GetYcode(1,istrip)==code) |
337 | fYbit12[icirc][istrip]=1; |
338 | } |
339 | } |
340 | break; |
341 | case 13: |
e6738866 |
342 | for (icirc=0; icirc<234; icirc++) { |
a9e2aefa |
343 | triggerCircuit = &(pMUON->TriggerCircuit(icirc)); |
e6738866 |
344 | nStrip=triggerCircuit->GetNstripY(); |
345 | for (istrip=0; istrip<nStrip; istrip++) { |
a9e2aefa |
346 | if (triggerCircuit->GetYcode(2,istrip)==code) |
347 | fYbit21[icirc][istrip]=1; |
348 | } |
349 | } |
350 | break; |
351 | case 14: |
e6738866 |
352 | for (icirc=0; icirc<234; icirc++) { |
a9e2aefa |
353 | triggerCircuit = &(pMUON->TriggerCircuit(icirc)); |
e6738866 |
354 | nStrip=triggerCircuit->GetNstripY(); |
355 | for (istrip=0; istrip<nStrip; istrip++) { |
a9e2aefa |
356 | if (triggerCircuit->GetYcode(3,istrip)==code) |
357 | fYbit22[icirc][istrip]=1; |
358 | } |
359 | } |
360 | break; |
361 | } |
362 | } // if cathode |
363 | } // remove soft background |
364 | } // end loop on digit |
365 | } // end loop on cathode |
366 | } // end loop on chamber |
367 | } |
368 | |
369 | //---------------------------------------------------------------------- |
370 | void AliMUONTriggerDecision::SetBitUpDownY(){ |
371 | // Set Y bit for up and down parts of circuits |
372 | Int_t idModule, nStripX, nStripY, iPosCircuit; |
373 | |
374 | AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); |
375 | |
376 | for (Int_t icirc=0; icirc<234; icirc++) { |
377 | |
378 | AliMUONTriggerCircuit* circuit; // current circuit |
379 | AliMUONTriggerCircuit* circuitD; // circuit Down |
380 | AliMUONTriggerCircuit* circuitU; // circuit Up |
381 | |
382 | circuit = &(pMUON->TriggerCircuit(icirc)); |
383 | idModule=circuit->GetIdModule(); // corresponding module Id. |
384 | nStripX=circuit->GetNstripX(); // number of X strips |
385 | nStripY=circuit->GetNstripY(); // number of Y strips |
386 | iPosCircuit=circuit->GetPosCircuit(); // position of circuit in module |
387 | |
388 | // fill lower part |
389 | if (iPosCircuit==1) { // need to scan lower module |
390 | if(idModule<91&&TMath::Abs(idModule)!=41&&idModule>-91) { |
391 | Int_t icircD=circuit->GetICircuitD(); |
392 | circuitD = &(pMUON->TriggerCircuit(icircD)); |
393 | Int_t nStripD=circuitD->GetNstripY(); |
394 | |
395 | if (TMath::Abs(idModule)==42) { // shift of +8 bits |
396 | for (Int_t istrip=0; istrip<nStripD; istrip++) { |
397 | fYbit21D[icirc][istrip+8]=fYbit21[icircD][istrip]; |
398 | fYbit22D[icirc][istrip+8]=fYbit22[icircD][istrip]; |
399 | } |
400 | } else if (TMath::Abs(idModule)==52) { // shift of -8 bits |
401 | for (Int_t istrip=0; istrip<nStripD; istrip++) { |
402 | fYbit21D[icirc][istrip]=fYbit21[icircD][istrip+8]; |
403 | fYbit22D[icirc][istrip]=fYbit22[icircD][istrip+8]; |
404 | } |
405 | } else { |
406 | for (Int_t istrip=0; istrip<nStripD; istrip++) { |
407 | fYbit21D[icirc][istrip]=fYbit21[icircD][istrip]; |
408 | fYbit22D[icirc][istrip]=fYbit22[icircD][istrip]; |
409 | } |
410 | } |
411 | } |
412 | } else { // lower strips within same module |
413 | for (Int_t istrip=0; istrip<nStripY; istrip++) { |
414 | fYbit21D[icirc][istrip]=fYbit21[icirc][istrip]; |
415 | fYbit22D[icirc][istrip]=fYbit22[icirc][istrip]; |
416 | } |
417 | } |
418 | |
419 | // fill upper part |
420 | if ((iPosCircuit==1&&nStripX==16)||(iPosCircuit==2&&nStripX==32)|| |
421 | (iPosCircuit==3&&nStripX==48)||(iPosCircuit==4&&nStripX==64)) { |
422 | if ((idModule>17||idModule<-17)&&TMath::Abs(idModule)!=61) { |
423 | Int_t icircU=circuit->GetICircuitU(); |
424 | circuitU = &(pMUON->TriggerCircuit(icircU)); |
425 | Int_t nStripU=circuitU->GetNstripY(); |
426 | |
427 | if (TMath::Abs(idModule)==62) { // shift of +8 bits |
428 | for (Int_t istrip=0; istrip<nStripU; istrip++) { |
429 | fYbit21U[icirc][istrip+8]=fYbit21[icircU][istrip]; |
430 | fYbit22U[icirc][istrip+8]=fYbit22[icircU][istrip]; |
431 | } |
432 | } else if (TMath::Abs(idModule)==52) { // shift of -8 bits |
433 | for (Int_t istrip=0; istrip<nStripU; istrip++) { |
434 | fYbit21U[icirc][istrip]=fYbit21[icircU][istrip+8]; |
435 | fYbit22U[icirc][istrip]=fYbit22[icircU][istrip+8]; |
436 | } |
437 | } else { |
438 | for (Int_t istrip=0; istrip<nStripU; istrip++) { |
439 | fYbit21U[icirc][istrip]=fYbit21[icircU][istrip]; |
440 | fYbit22U[icirc][istrip]=fYbit22[icircU][istrip]; |
441 | } |
442 | } |
443 | } |
444 | } else { // upper strips within same module |
445 | for (Int_t istrip=0; istrip<nStripY; istrip++) { |
446 | fYbit21U[icirc][istrip]=fYbit21[icirc][istrip]; |
447 | fYbit22U[icirc][istrip]=fYbit22[icirc][istrip]; |
448 | } |
449 | } |
450 | } // loop on circuit |
451 | } |
452 | |
453 | //---------------------------------------------------------------------- |
454 | // x part of trigger Algo |
455 | //---------------------------------------------------------------------- |
456 | //---------------------------------------------------------------------- |
457 | void AliMUONTriggerDecision::TrigX(Int_t ch1q[16], Int_t ch2q[16], |
458 | Int_t ch3q[32], Int_t ch4q[32], |
459 | Int_t coinc44, Int_t minDevStrip[5], |
460 | Int_t minDev[5]){ |
461 | // note : coinc44 = flag 0 or 1 (0 coincidence -> 3/4, 1 coincidence -> 4/4) |
462 | //--------------------------------------------------------- |
463 | // step # 1 : declustering, reduction DS, calculate sgle & dble |
464 | //--------------------------------------------------------- |
465 | Int_t ch1e[19], ch2e[20], ch3e[35], ch4e[36]; |
466 | Int_t sgleHit1[31], sgleHit2[63]; |
467 | Int_t dbleHit1[31], dbleHit2[63]; |
468 | |
e6738866 |
469 | Int_t i; |
470 | Int_t j; |
471 | Int_t istrip; |
472 | |
473 | for (i=0; i<31; i++) { |
a9e2aefa |
474 | sgleHit1[i]=0; |
475 | dbleHit1[i]=0; |
476 | } |
e6738866 |
477 | for (i=0; i<63; i++) { |
a9e2aefa |
478 | sgleHit2[i]=0; |
479 | dbleHit2[i]=0; |
480 | } |
481 | |
482 | //--- inititialize che using chq |
e6738866 |
483 | for (i=0; i<19; i++) { |
a9e2aefa |
484 | if (i<1||i>16) ch1e[i]=0; |
485 | else ch1e[i]=ch1q[i-1]; |
486 | } |
e6738866 |
487 | for (i=0; i<20; i++) { |
a9e2aefa |
488 | if (i<2||i>17) ch2e[i]=0; |
489 | else ch2e[i]=ch2q[i-2]; |
490 | } |
e6738866 |
491 | for (i=0; i<35; i++) { |
a9e2aefa |
492 | if (i<1||i>32) ch3e[i]=0; |
493 | else ch3e[i]=ch3q[i-1]; |
494 | } |
e6738866 |
495 | for (i=0; i<36; i++) { |
a9e2aefa |
496 | if (i<2||i>33) ch4e[i]=0; |
497 | else ch4e[i]=ch4q[i-2]; |
498 | } |
499 | |
500 | |
501 | //--- calculate dble & sgle first station |
e6738866 |
502 | for (i=0; i<=15; i++) { |
a9e2aefa |
503 | sgleHit1[2*i] = (!ch1e[i+1]|(ch1e[i]^ch1e[i+2])) & |
504 | (!ch2e[i+2] | (ch2e[i+1]^ch2e[i+3])); |
505 | |
506 | dbleHit1[2*i] = ch1e[i+1]&!(ch1e[i+2]^ch1e[i]) & |
507 | (ch2e[i+2] | (!ch2e[i]&ch2e[i+1]) | (ch2e[i+3]&!ch2e[i+4])); |
508 | } |
509 | |
e6738866 |
510 | for (i=0; i<=14; i++) { |
a9e2aefa |
511 | sgleHit1[2*i+1] = (!ch1e[i+1]|!ch1e[i+2]|(ch1e[i]^ch1e[i+3])) & |
512 | (!ch2e[i+2] | !ch2e[i+3] | (ch2e[i+1]^ch2e[i+4])); |
513 | dbleHit1[2*i+1] = ch1e[i+1]&ch1e[i+2]&!(ch1e[i]^ch1e[i+3]) & |
514 | (ch2e[i+2]&(!ch2e[i+1]|!ch2e[i]) | |
515 | ch2e[i+3]&(ch2e[i+2]|!ch2e[i+4]|!ch2e[i+5])); |
516 | } |
517 | |
518 | //--- calculate dble & sgle second station |
e6738866 |
519 | for (i=0; i<=31; i++) { |
a9e2aefa |
520 | sgleHit2[2*i] = (!ch3e[i+1]|(ch3e[i]^ch3e[i+2])) & |
521 | (!ch4e[i+2] | (ch4e[i+1]^ch4e[i+3])); |
522 | dbleHit2[2*i] = ch3e[i+1]&!(ch3e[i+2]^ch3e[i]) & |
523 | (ch4e[i+2] | (!ch4e[i]&ch4e[i+1]) | (ch4e[i+3]&!ch4e[i+4])); |
524 | } |
525 | |
e6738866 |
526 | for (i=0; i<=30; i++) { |
a9e2aefa |
527 | sgleHit2[2*i+1] = (!ch3e[i+1]|!ch3e[i+2]|(ch3e[i]^ch3e[i+3])) & |
528 | (!ch4e[i+2] | !ch4e[i+3] | (ch4e[i+1]^ch4e[i+4])); |
529 | dbleHit2[2*i+1] = ch3e[i+1]&ch3e[i+2]&!(ch3e[i]^ch3e[i+3]) & |
530 | (ch4e[i+2]&(!ch4e[i+1]|!ch4e[i]) | |
531 | ch4e[i+3]&(ch4e[i+2]|!ch4e[i+4]|!ch4e[i+5])); |
532 | } |
533 | |
534 | //--- |
ecfa008b |
535 | if(fDebug==3||fDebug==5) { |
a9e2aefa |
536 | cout << "===============================================================" << "\n"; |
537 | cout << " X plane after sgle and dble " << " \n"; |
538 | cout << " 0987654321098765432109876543210"; |
539 | cout << "\n SGLE1 "; |
e6738866 |
540 | for (istrip=30; istrip>=0; istrip--) { cout << (!sgleHit1[istrip]); } |
a9e2aefa |
541 | cout << "\n DBLE1 "; |
e6738866 |
542 | for (istrip=30; istrip>=0; istrip--) { cout << dbleHit1[istrip]; } |
a9e2aefa |
543 | cout << "\n SGLE2 "; |
e6738866 |
544 | for (istrip=62; istrip>=0; istrip--) { cout << (!sgleHit2[istrip]); } |
a9e2aefa |
545 | cout << "\n DBLE2 "; |
e6738866 |
546 | for (istrip=62; istrip>=0; istrip--) { cout << dbleHit2[istrip]; } |
a9e2aefa |
547 | cout << "\n 210987654321098765432109876543210987654321098765432109876543210" << "\n"; |
548 | } |
549 | |
550 | //--------------------------------------------------------- |
551 | // step # 2 : coincidence 3/4 |
552 | //--------------------------------------------------------- |
553 | Int_t rearImage[31][31]; |
e6738866 |
554 | for (i=0; i<31; i++) { |
555 | for (j=0; j<31; j++) { |
a9e2aefa |
556 | rearImage[i][j]=0; |
557 | } |
558 | } |
559 | |
560 | Int_t notOr1=!dbleHit1[30] & !dbleHit1[29] & !dbleHit1[28] & !dbleHit1[27] & |
561 | !dbleHit1[26] & !dbleHit1[25] & !dbleHit1[24] & !dbleHit1[23] & |
562 | !dbleHit1[22] & !dbleHit1[21] & !dbleHit1[20] & !dbleHit1[19] & |
563 | !dbleHit1[18] & !dbleHit1[17] & !dbleHit1[16] & !dbleHit1[15] & |
564 | !dbleHit1[14] & !dbleHit1[13] & !dbleHit1[12] & !dbleHit1[11] & |
565 | !dbleHit1[10] & !dbleHit1[9] & !dbleHit1[8] & !dbleHit1[7] & |
566 | !dbleHit1[6] & !dbleHit1[5] & !dbleHit1[4] & !dbleHit1[3] & |
567 | !dbleHit1[2] & !dbleHit1[1] & !dbleHit1[0] & !coinc44; |
568 | |
569 | Int_t notOr2= !dbleHit2[62] & !dbleHit2[61] & !dbleHit2[60] & !dbleHit2[59] & |
570 | !dbleHit2[58] & !dbleHit2[57] & !dbleHit2[56] & !dbleHit2[55] & |
571 | !dbleHit2[54] & !dbleHit2[53] & !dbleHit2[52] & !dbleHit2[51] & |
572 | !dbleHit2[50] & !dbleHit2[49] & !dbleHit2[48] & !dbleHit2[47] & |
573 | !dbleHit2[46] & !dbleHit2[45] & !dbleHit2[44] & !dbleHit2[43] & |
574 | !dbleHit2[42] & !dbleHit2[41] & !dbleHit2[40] & !dbleHit2[39] & |
575 | !dbleHit2[38] & !dbleHit2[37] & !dbleHit2[36] & !dbleHit2[35] & |
576 | !dbleHit2[34] & !dbleHit2[33] & !dbleHit2[32] & !dbleHit2[31] & |
577 | !dbleHit2[30] & !dbleHit2[29] & !dbleHit2[28] & !dbleHit2[27] & |
578 | !dbleHit2[26] & !dbleHit2[25] & !dbleHit2[24] & !dbleHit2[23] & |
579 | !dbleHit2[22] & !dbleHit2[21] & !dbleHit2[20] & !dbleHit2[19] & |
580 | !dbleHit2[18] & !dbleHit2[17] & !dbleHit2[16] & !dbleHit2[15] & |
581 | !dbleHit2[14] & !dbleHit2[13] & !dbleHit2[12] & !dbleHit2[11] & |
582 | !dbleHit2[10] & !dbleHit2[9] & !dbleHit2[8] & !dbleHit2[7] & |
583 | !dbleHit2[6] & !dbleHit2[5] & !dbleHit2[4] & !dbleHit2[3] & |
584 | !dbleHit2[2] & !dbleHit2[1] & !dbleHit2[0] & !coinc44; |
585 | |
586 | // DS reduction |
e6738866 |
587 | for (i=0; i<31; i++) { |
a9e2aefa |
588 | sgleHit1[i] = !sgleHit1[i]¬Or1; |
589 | } |
e6738866 |
590 | for (i=0; i<63; i++) { |
a9e2aefa |
591 | sgleHit2[i] = !sgleHit2[i]¬Or2; |
592 | } |
593 | |
594 | // extract rearImage |
e6738866 |
595 | for (i=0; i<31; i++){ |
a9e2aefa |
596 | Int_t tmpSgleHit2[31]; |
597 | Int_t tmpDbleHit2[31]; |
e6738866 |
598 | for (j=0; j<31; j++){ |
a9e2aefa |
599 | tmpSgleHit2[j] = sgleHit2[i+j+1]; |
600 | tmpDbleHit2[j] = dbleHit2[i+j+1]; |
601 | } |
602 | |
603 | for (Int_t k=0; k<31; k++) { |
604 | rearImage[i][k]=(sgleHit1[i]&tmpDbleHit2[k])| |
605 | (dbleHit1[i]&(tmpSgleHit2[k]|tmpDbleHit2[k])); |
606 | } |
607 | } |
608 | |
609 | //----------- |
ecfa008b |
610 | if(fDebug==3||fDebug==5) { |
a9e2aefa |
611 | cout << "===============================================================" << "\n"; |
e6738866 |
612 | for (i=30; i>=0; i--) { |
a9e2aefa |
613 | cout << i << "\t "; |
e6738866 |
614 | for (istrip=31; istrip>=0; istrip--) { |
a9e2aefa |
615 | cout << rearImage[i][istrip]; |
616 | } |
617 | cout << " " << "\n"; |
618 | } |
619 | } |
620 | |
621 | |
622 | //--------------------------------------------------------- |
623 | // step # 3 : calculate deviation |
624 | //--------------------------------------------------------- |
625 | Int_t dev[31][6]; |
e6738866 |
626 | for (i=0; i<31; i++) { |
627 | for (j=0; j<6; j++) { |
a9e2aefa |
628 | dev[i][j]=0; |
629 | } |
630 | } |
631 | |
e6738866 |
632 | for (i=0; i<31; i++){ |
a9e2aefa |
633 | Int_t leftDev[5], rightDev[5]; |
634 | Int_t orL1, andL1, andL2, orR1, orR2, andR1, andR2, andR3; |
635 | |
636 | // calculate Left deviation |
637 | orL1=rearImage[i][16]|rearImage[i][18]|rearImage[i][20]|rearImage[i][22]; |
638 | andL1=!rearImage[i][17]&!rearImage[i][19]&!rearImage[i][21] & !orL1; |
639 | andL2=!rearImage[i][23]&!rearImage[i][24]&!rearImage[i][25]&!rearImage[i][26]; |
640 | |
641 | leftDev[0] = (rearImage[i][16]|!rearImage[i][17]) & |
642 | (rearImage[i][16]|rearImage[i][18]|!rearImage[i][19]& |
643 | (rearImage[i][20]|!rearImage[i][21])) & |
644 | (orL1|!rearImage[i][23]&(rearImage[i][24]|!rearImage[i][25])) & |
645 | (orL1|rearImage[i][24]|rearImage[i][26]|!rearImage[i][27]& |
646 | (rearImage[i][28]|!rearImage[i][29])); |
647 | |
648 | leftDev[1] = !rearImage[i][16] & |
649 | !(!rearImage[i][17]&!rearImage[i][18]&!rearImage[i][21]&!rearImage[i][22] & |
650 | (!rearImage[i][25]&!rearImage[i][26]&(rearImage[i][27]|rearImage[i][28]))) & |
651 | (rearImage[i][17]|rearImage[i][18] | !rearImage[i][19]&!rearImage[i][20]) & |
652 | (rearImage[i][17]|rearImage[i][18]|rearImage[i][21]|rearImage[i][22] | |
653 | !rearImage[i][23]&!rearImage[i][24]); |
654 | |
655 | leftDev[2] = (!rearImage[i][16]&!rearImage[i][17]&!rearImage[i][18]) & |
656 | (rearImage[i][19]|rearImage[i][20]|rearImage[i][21]|rearImage[i][22] | andL2); |
657 | |
658 | leftDev[3] = andL1; |
659 | |
660 | leftDev[4] = |
661 | !rearImage[i][27]&!rearImage[i][28]&!rearImage[i][29]&!rearImage[i][30] & |
662 | andL1 & andL2; |
663 | |
664 | // calculate Right deviation |
665 | orR1=rearImage[i][8]|rearImage[i][10]|rearImage[i][12]|rearImage[i][14]; |
666 | orR2=rearImage[i][8]|rearImage[i][9]|rearImage[i][10]|rearImage[i][11]; |
667 | andR1=!rearImage[i][12]&!rearImage[i][13]&!rearImage[i][14]&!rearImage[i][15]; |
668 | andR2= |
669 | !rearImage[i][8]&!rearImage[i][9]&!rearImage[i][10]&!rearImage[i][11] & andR1; |
670 | andR3=!rearImage[i][4]&!rearImage[i][5]&!rearImage[i][6]&!rearImage[i][7]; |
671 | |
672 | rightDev[0] = !rearImage[i][15]&(rearImage[i][14]|!rearImage[i][13]) & |
673 | ((rearImage[i][12]|rearImage[i][14]|!rearImage[i][11]& |
674 | (rearImage[i][10]|!rearImage[i][9])) & |
675 | ((orR1|!rearImage[i][7]&(rearImage[i][6]|!rearImage[i][5])) & |
676 | (orR1|rearImage[i][4]|rearImage[i][6]|!rearImage[i][3]&(rearImage[i][2]| |
677 | !rearImage[i][1])))); |
678 | |
679 | rightDev[1] = !rearImage[i][15]&!rearImage[i][14] & |
680 | !(!rearImage[i][4]&!rearImage[i][5]&!rearImage[i][8]&!rearImage[i][9] & |
681 | (!rearImage[i][12]&!rearImage[i][13]&(rearImage[i][2]|rearImage[i][3]))) & |
682 | (rearImage[i][12]|rearImage[i][13] | !rearImage[i][10]&!rearImage[i][11]) & |
683 | (rearImage[i][8]|rearImage[i][9]|rearImage[i][12]|rearImage[i][13] | |
684 | !rearImage[i][6]&!rearImage[i][7]); |
685 | |
686 | rightDev[2] = andR1 & (orR2 | andR3); |
687 | rightDev[3] = andR2; |
688 | rightDev[4] = |
689 | !rearImage[i][0]&!rearImage[i][1]&!rearImage[i][2]&!rearImage[i][3] & |
690 | andR2 & andR3 ; |
691 | |
692 | // compare Left & Right deviations |
693 | Int_t tmpLeftDev=0, tmpRightDev=0; |
e6738866 |
694 | for (j=0; j<5; j++){ |
695 | tmpLeftDev = tmpLeftDev + Int_t(leftDev[j]*TMath::Power(2,j)); |
696 | tmpRightDev = tmpRightDev + Int_t(rightDev[j]*TMath::Power(2,j)); |
a9e2aefa |
697 | } |
698 | |
699 | // assign mimimum deviation do dev[][] |
700 | if (tmpLeftDev < tmpRightDev ){ |
e6738866 |
701 | for (j=0; j<5; j++){ dev[i][j]=leftDev[j];} |
a9e2aefa |
702 | dev[i][5]=1; |
703 | } else { |
e6738866 |
704 | for (j=0; j<5; j++){ dev[i][j]=rightDev[j];} |
a9e2aefa |
705 | dev[i][5]=0; |
706 | } |
707 | } |
708 | |
709 | //--- |
ecfa008b |
710 | if(fDebug==3||fDebug==5) { |
a9e2aefa |
711 | cout << "===============================================================" << "\n"; |
e6738866 |
712 | for (i=30; i>=0; i--) { |
a9e2aefa |
713 | cout << i << "\t "; |
e6738866 |
714 | for (istrip=5; istrip>=0; istrip--) { cout << dev[i][istrip]; } |
a9e2aefa |
715 | cout << " " << "\n"; |
716 | } |
717 | } |
718 | |
719 | //--------------------------------------------------------- |
720 | // step # 4 : sort deviation |
721 | //--------------------------------------------------------- |
722 | Int_t bga1[16], bga2[8], bga3[4], bga4[2], bga5; |
723 | Int_t tmpbga1[16][6], tmpbga2[8][6], tmpbga3[4][6], tmpbga4[2][6], tmpbga5[6]; |
724 | Int_t tmpMax[6]={1,1,1,1,1,0}; |
725 | |
e6738866 |
726 | for (i=0; i<15; i++) { |
a9e2aefa |
727 | Sort2x5(dev[2*i],dev[2*i+1],tmpbga1[i],bga1[i]); |
728 | } |
729 | Sort2x5(dev[30],tmpMax,tmpbga1[15],bga1[15]); |
730 | |
731 | //-- |
ecfa008b |
732 | if(fDebug==3||fDebug==5) { |
a9e2aefa |
733 | cout << "===============================================================" << "\n"; |
734 | cout << " sorting : 1st level " << "\n"; |
e6738866 |
735 | for (i=15; i>=0; i--) { |
a9e2aefa |
736 | cout << i << "\t " << bga1[i] << "\t"; |
e6738866 |
737 | for (j=5; j>=0; j--) { |
a9e2aefa |
738 | cout << tmpbga1[i][j]; |
739 | } |
740 | cout << " " << "\n"; |
741 | } |
742 | } |
743 | |
e6738866 |
744 | for (i=0; i<8; i++) { |
a9e2aefa |
745 | Sort2x5(tmpbga1[2*i],tmpbga1[2*i+1],tmpbga2[i],bga2[i]); |
746 | } |
747 | |
748 | //-- |
ecfa008b |
749 | if(fDebug==3||fDebug==5) { |
a9e2aefa |
750 | cout << "===============================================================" << "\n"; |
751 | cout << " sorting : 2nd level " << "\n"; |
e6738866 |
752 | for (i=7; i>=0; i--) { |
a9e2aefa |
753 | cout << i << "\t " << bga2[i] << "\t"; |
e6738866 |
754 | for (j=5; j>=0; j--) { |
a9e2aefa |
755 | cout << tmpbga2[i][j]; |
756 | } |
757 | cout << " " << "\n"; |
758 | } |
759 | } |
760 | |
e6738866 |
761 | for (i=0; i<4; i++) { |
a9e2aefa |
762 | Sort2x5(tmpbga2[2*i],tmpbga2[2*i+1],tmpbga3[i],bga3[i]); |
763 | } |
764 | |
765 | //-- |
ecfa008b |
766 | if(fDebug==3||fDebug==5) { |
a9e2aefa |
767 | cout << "===============================================================" << "\n"; |
768 | cout << " sorting : 3rd level " << "\n"; |
e6738866 |
769 | for (i=3; i>=0; i--) { |
a9e2aefa |
770 | cout << i << "\t " << bga3[i] << "\t"; |
e6738866 |
771 | for (j=5; j>=0; j--) { |
a9e2aefa |
772 | cout << tmpbga3[i][j]; |
773 | } |
774 | cout << " " << "\n"; |
775 | } |
776 | } |
777 | |
e6738866 |
778 | for (i=0; i<2; i++) { |
a9e2aefa |
779 | Sort2x5(tmpbga3[2*i],tmpbga3[2*i+1],tmpbga4[i],bga4[i]); |
780 | } |
781 | |
782 | //-- |
ecfa008b |
783 | if(fDebug==3||fDebug==5) { |
a9e2aefa |
784 | cout << "===============================================================" << "\n"; |
785 | cout << " sorting : 4th level " << "\n"; |
e6738866 |
786 | for (i=1; i>=0; i--) { |
a9e2aefa |
787 | cout << i << "\t " << bga4[i] << "\t"; |
e6738866 |
788 | for (j=5; j>=0; j--) { |
a9e2aefa |
789 | cout << tmpbga4[i][j]; |
790 | } |
791 | cout << " " << "\n"; |
792 | } |
793 | } |
794 | |
795 | Sort2x5(tmpbga4[0],tmpbga4[1],tmpbga5,bga5); |
796 | |
797 | // coding from 6 to 5 bits |
798 | minDev[4] = tmpbga5[5] | tmpbga5[4]; |
e6738866 |
799 | for (i=0; i<4; i++) { |
a9e2aefa |
800 | minDev[i]=tmpbga5[i] & !tmpbga5[4]; |
801 | } |
802 | |
803 | // find address of strip with minimum deviation |
804 | minDevStrip[4]=bga5; |
805 | if (bga5<=1) minDevStrip[3]=bga4[bga5]; |
806 | |
807 | Int_t tmpAd=minDevStrip[3]+minDevStrip[4]*2; |
808 | if (tmpAd<=3) minDevStrip[2]=bga3[tmpAd]; |
809 | |
810 | tmpAd=minDevStrip[2]+minDevStrip[3]*2+minDevStrip[4]*4; |
811 | if (tmpAd<=7) minDevStrip[1]=bga2[tmpAd]; |
812 | |
813 | tmpAd=minDevStrip[1]+minDevStrip[2]*2+minDevStrip[3]*4+minDevStrip[4]*8; |
814 | if (tmpAd<=15) minDevStrip[0]=bga1[tmpAd]; |
815 | |
ecfa008b |
816 | if(fDebug==3||fDebug==5) { |
a9e2aefa |
817 | cout << "===============================================================" << "\n"; |
818 | cout << "minDevStrip = "; |
e6738866 |
819 | for (i=4; i>=0; i--) {cout << minDevStrip[i];} |
a9e2aefa |
820 | cout << " minDev = "; |
e6738866 |
821 | for (i=4; i>=0; i--) {cout << minDev[i];} |
a9e2aefa |
822 | cout << " " << "\n"; |
823 | cout << "===============================================================" << "\n"; |
824 | } |
825 | |
826 | } |
827 | |
828 | //--------------------------------------------- |
829 | void AliMUONTriggerDecision::Sort2x5(Int_t dev1[6], Int_t dev2[6], |
830 | Int_t minDev[6], Int_t &dev1GTdev2){ |
831 | // returns minimun between dev1 and dev2 |
832 | Int_t tmpDev1=0, tmpDev2=0; |
833 | for (Int_t j=0; j<5; j++){ |
e6738866 |
834 | tmpDev1 = tmpDev1 + Int_t(dev1[j]*TMath::Power(2,j)); |
835 | tmpDev2 = tmpDev2 + Int_t(dev2[j]*TMath::Power(2,j)); |
a9e2aefa |
836 | } |
837 | if (tmpDev1 <= tmpDev2 ){ |
838 | for (Int_t j=0; j<=5; j++) { minDev[j]=dev1[j];} |
839 | dev1GTdev2=0; |
840 | } else { |
841 | for (Int_t j=0; j<=5; j++) { minDev[j]=dev2[j];} |
842 | dev1GTdev2=1; |
843 | } |
844 | } |
845 | |
846 | //---------------------------------------------------------------------- |
847 | // y part of trigger Algo |
848 | //---------------------------------------------------------------------- |
849 | //---------------------------------------------------------------------- |
850 | void AliMUONTriggerDecision::TrigY(Int_t y1[16], Int_t y2[16], |
851 | Int_t y3[16], Int_t y4[16], |
852 | Int_t y3u[16], Int_t y3d[16], |
853 | Int_t y4u[16], Int_t y4d[16], |
854 | Int_t x2m, Int_t x2ud, Int_t orMud[2], |
855 | Int_t resetMid, Int_t coinc44, |
856 | Int_t coordY[5]){ |
857 | // note : resMid = 1 -> cancel |
858 | //--------------------------------------------------------- |
859 | // step # 1 : prehandling Y |
860 | //--------------------------------------------------------- |
e6738866 |
861 | Int_t i; |
862 | Int_t istrip; |
863 | |
864 | for (i=0; i<16; i++){ |
a9e2aefa |
865 | y3[i]=y3[i]&!resetMid; |
866 | y4[i]=y4[i]&!resetMid; |
867 | } |
868 | |
869 | Int_t ch1[16], ch2[16], ch3[16], ch4[16]; |
870 | |
871 | Int_t tmpy3to16[16], tmpy4to16[16]; |
872 | Int_t tmpy3uto16[16], tmpy3dto16[16], tmpy4uto16[16], tmpy4dto16[16]; |
e6738866 |
873 | for (i=0; i<8; i++){ |
a9e2aefa |
874 | ch1[2*i] = y1[i]&x2m | y1[2*i]&!x2m; |
875 | ch1[2*i+1] = y1[i]&x2m | y1[2*i+1]&!x2m; |
876 | |
877 | ch2[2*i] = y2[i]&x2m | y2[2*i]&!x2m; |
878 | ch2[2*i+1] = y2[i]&x2m | y2[2*i+1]&!x2m; |
879 | |
880 | tmpy3to16[2*i] = y3[i]&x2m | y3[2*i]&!x2m; |
881 | tmpy3to16[2*i+1] = y3[i]&x2m | y3[2*i+1]&!x2m; |
882 | |
883 | tmpy4to16[2*i] = y4[i]&x2m | y4[2*i]&!x2m; |
884 | tmpy4to16[2*i+1] = y4[i]&x2m | y4[2*i+1]&!x2m; |
885 | |
886 | tmpy3uto16[2*i] = y3u[i]&x2ud | y3u[2*i]&!x2ud; |
887 | tmpy3uto16[2*i+1] = y3u[i]&x2ud | y3u[2*i+1]&!x2ud; |
888 | |
889 | tmpy4uto16[2*i] = y4u[i]&x2ud | y4u[2*i]&!x2ud; |
890 | tmpy4uto16[2*i+1] = y4u[i]&x2ud | y4u[2*i+1]&!x2ud; |
891 | |
892 | tmpy3dto16[2*i] = y3d[i]&x2ud | y3d[2*i]&!x2ud; |
893 | tmpy3dto16[2*i+1] = y3d[i]&x2ud | y3d[2*i+1]&!x2ud; |
894 | |
895 | tmpy4dto16[2*i] = y4d[i]&x2ud | y4d[2*i]&!x2ud; |
896 | tmpy4dto16[2*i+1] = y4d[i]&x2ud | y4d[2*i+1]&!x2ud; |
897 | } |
898 | |
899 | if (orMud[0]==0&&orMud[1]==0){ |
e6738866 |
900 | for (i=0; i<16; i++){ |
a9e2aefa |
901 | ch3[i] = tmpy3to16[i]; |
902 | ch4[i] = tmpy4to16[i]; |
903 | } |
904 | } |
905 | if (orMud[0]==0&&orMud[1]==1){ |
e6738866 |
906 | for (i=0; i<16; i++){ |
a9e2aefa |
907 | ch3[i] = tmpy3uto16[i]|tmpy3to16[i]; |
908 | ch4[i] = tmpy4uto16[i]|tmpy4to16[i]; |
909 | } |
910 | } |
911 | if (orMud[0]==1&&orMud[1]==0){ |
e6738866 |
912 | for (i=0; i<16; i++){ |
a9e2aefa |
913 | ch3[i] = tmpy3dto16[i]|tmpy3to16[i]; |
914 | ch4[i] = tmpy4dto16[i]|tmpy4to16[i]; |
915 | } |
916 | } |
917 | if (orMud[0]==1&&orMud[1]==1){ |
e6738866 |
918 | for (i=0; i<16; i++){ |
a9e2aefa |
919 | ch3[i] = tmpy3dto16[i]|tmpy3to16[i]|tmpy3uto16[i]; |
920 | ch4[i] = tmpy4dto16[i]|tmpy4to16[i]|tmpy4uto16[i]; |
921 | } |
922 | } |
923 | |
924 | // debug |
ecfa008b |
925 | if(fDebug==4||fDebug==5) { |
a9e2aefa |
926 | cout << "===============================================================" << "\n"; |
927 | cout << " Y plane after PreHandling x2m x2ud orMud " |
928 | << x2m << " , " << x2ud << " , " << orMud[0] << orMud[1] << "\n"; |
929 | cout << " "; |
e6738866 |
930 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
931 | if (istrip>9) cout << istrip-10*Int_t(istrip/10); |
932 | if (istrip<10) cout << istrip; |
933 | } |
934 | cout << "\n YMC11 "; |
e6738866 |
935 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
936 | cout << ch1[istrip]; |
937 | } |
938 | cout << "\n YMC12 "; |
e6738866 |
939 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
940 | cout << ch2[istrip]; |
941 | } |
942 | cout << "\n YMC21 "; |
e6738866 |
943 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
944 | cout << ch3[istrip]; |
945 | } |
946 | cout << "\n YMC22 "; |
e6738866 |
947 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
948 | cout << ch4[istrip]; |
949 | } |
950 | cout << " \n"; |
951 | } |
952 | //debug |
953 | |
954 | //--------------------------------------------------------- |
955 | // step # 2 : calculate sgle and dble, apply DS reduction |
956 | //--------------------------------------------------------- |
957 | Int_t sgle1[16], dble1[16]; |
958 | Int_t sgle2[16], dble2[16]; |
959 | |
960 | // Calculate simple and double hits |
e6738866 |
961 | for (i=0; i<16; i++) { |
a9e2aefa |
962 | dble1[i] = ch1[i] & ch2[i]; |
963 | dble2[i] = ch3[i] & ch4[i]; |
964 | |
965 | sgle1[i] = (ch1[i]|ch2[i]); |
966 | sgle2[i] = (ch3[i]|ch4[i]); |
967 | } |
968 | |
969 | //debug |
ecfa008b |
970 | if(fDebug==4||fDebug==5) { |
a9e2aefa |
971 | cout << "===============================================================" << "\n"; |
972 | cout << " Y plane after sgle dble " << "\n"; |
973 | cout << " "; |
e6738866 |
974 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
975 | if (istrip>9) { cout << istrip-10*Int_t(istrip/10);} |
976 | if (istrip<10) { cout << istrip;} |
977 | } |
978 | cout << "\n SGLE1 "; |
e6738866 |
979 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
980 | cout << sgle1[istrip]; |
981 | } |
982 | cout << "\n DBLE1 "; |
e6738866 |
983 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
984 | cout << dble1[istrip]; |
985 | } |
986 | cout << "\n SGLE2 "; |
e6738866 |
987 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
988 | cout << sgle2[istrip]; |
989 | } |
990 | cout << "\n DBLE2 "; |
e6738866 |
991 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
992 | cout << dble2[istrip]; |
993 | } |
994 | cout << " \n"; |
995 | } |
996 | //debug |
997 | |
998 | // DS Reduction |
999 | Int_t notOr1, notOr2; |
1000 | |
1001 | notOr1=!dble1[15] & !dble1[14] & !dble1[13] & !dble1[12] & |
1002 | !dble1[11] & !dble1[10] & !dble1[9] & !dble1[8] & |
1003 | !dble1[7] & !dble1[6] & !dble1[5] & !dble1[4] & |
1004 | !dble1[3] & !dble1[2] & !dble1[1] & !dble1[0]; |
1005 | |
1006 | notOr2=!dble2[15] & !dble2[14] & !dble2[13] & !dble2[12] & |
1007 | !dble2[11] & !dble2[10] & !dble2[9] & !dble2[8] & |
1008 | !dble2[7] & !dble2[6] & !dble2[5] & !dble2[4] & |
1009 | !dble2[3] & !dble2[2] & !dble2[1] & !dble2[0]; |
1010 | |
e6738866 |
1011 | for (i=0; i<16; i++) { |
a9e2aefa |
1012 | sgle1[i] = sgle1[i] & notOr1 & !coinc44; |
1013 | sgle2[i] = sgle2[i] & notOr2 & !coinc44; |
1014 | } |
1015 | |
1016 | //--------------------------------------------------------- |
1017 | // step # 3 : 3/4 coincidence |
1018 | //--------------------------------------------------------- |
1019 | Int_t frontImage[16]; |
1020 | |
e6738866 |
1021 | for (i=1; i<15; i++) { |
a9e2aefa |
1022 | frontImage[i] = (dble1[i] | sgle1[i]) & |
1023 | (dble2[i+1] | dble2[i] | dble2[i-1]) | |
1024 | dble1[i] & (sgle2[i+1] | sgle2[i] | sgle2[i-1]); |
1025 | } |
1026 | frontImage[0] = (dble1[0] | sgle1[0]) & |
1027 | (dble2[1] | dble2[0]) | dble1[0] & (sgle2[1] | sgle2[0]); |
1028 | |
1029 | frontImage[15] = (dble1[15] | sgle1[15]) & |
1030 | (dble2[15] | dble2[14]) | dble1[15] & (sgle2[15] | sgle2[14]); |
1031 | |
1032 | |
1033 | //debug |
ecfa008b |
1034 | if(fDebug==4||fDebug==5) { |
a9e2aefa |
1035 | cout << "===============================================================" << "\n"; |
1036 | cout << " Y plane frontImage\n"; |
1037 | cout << " "; |
e6738866 |
1038 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
1039 | if (istrip>9) cout << istrip-10*Int_t(istrip/10); |
1040 | if (istrip<10) cout << istrip; |
1041 | } |
1042 | cout << "\n "; |
e6738866 |
1043 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
1044 | cout << frontImage[istrip]; |
1045 | } |
1046 | cout << "\n"; |
1047 | } |
1048 | //debug |
1049 | |
1050 | //--------------------------------------------------------- |
1051 | // step # 4 : Y position |
1052 | //--------------------------------------------------------- |
1053 | Int_t or1, or2, and1, and2, and3; |
1054 | |
1055 | or1 = frontImage[7]|frontImage[5]|frontImage[3]|frontImage[1]; |
1056 | or2 = frontImage[7]|frontImage[6]|frontImage[5]|frontImage[4]; |
1057 | and1 = !frontImage[3]&!frontImage[2]&!frontImage[1]&!frontImage[0]; |
1058 | and2 = !frontImage[7]&!frontImage[6]&!frontImage[5]&!frontImage[4] & and1; |
1059 | and3 = !frontImage[11]&!frontImage[10]&!frontImage[9]&!frontImage[8]; |
1060 | |
1061 | coordY[0] = !frontImage[0]&(frontImage[1]|!frontImage[2]) & |
1062 | (frontImage[3]|frontImage[1]|!frontImage[4]&(frontImage[5]|!frontImage[6])) & |
1063 | (or1|!frontImage[8]&(frontImage[9]|!frontImage[10])) & |
1064 | (or1|frontImage[11]|frontImage[9]|!frontImage[12]&(frontImage[13]|!frontImage[14])); |
1065 | |
1066 | coordY[1] = !frontImage[0]&!frontImage[1] & |
1067 | !(!frontImage[11]&!frontImage[10]&!frontImage[7]&!frontImage[6] & |
1068 | !frontImage[3]&!frontImage[2]&(frontImage[13]|frontImage[12])) & |
1069 | (frontImage[3]|frontImage[2] | !frontImage[5]&!frontImage[4]) & |
1070 | (frontImage[7]|frontImage[6]|frontImage[3]|frontImage[2] | |
1071 | !frontImage[9]&!frontImage[8]); |
1072 | |
1073 | coordY[2] = and1 & (or2 | and3); |
1074 | |
1075 | coordY[3] = and2; |
1076 | |
1077 | coordY[4] = !frontImage[15]&!frontImage[14]&!frontImage[13]&!frontImage[12] & |
1078 | and2 & and3 ; |
1079 | |
1080 | } |
1081 | //---------------------------------------------------------------------- |
1082 | // end of trigger Algo |
1083 | //---------------------------------------------------------------------- |
1084 | |
1085 | //---------------------------------------------------------------------- |
1086 | void AliMUONTriggerDecision::LocalTrigger(Int_t icirc, |
1087 | Int_t minDevStrip[5], |
1088 | Int_t minDev[5], Int_t coordY[5], |
1089 | Int_t &iTrigger){ |
1090 | // returns local trigger answer for circuit icirc |
e6738866 |
1091 | Int_t i; |
1092 | |
a9e2aefa |
1093 | AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); |
1094 | AliMUONTriggerCircuit* triggerCircuit; |
1095 | triggerCircuit = &(pMUON->TriggerCircuit(icirc)); |
1096 | Int_t idCircuit=triggerCircuit->GetIdCircuit(); |
1097 | |
1098 | Int_t signDev=minDev[4]; |
1099 | Int_t deviation=0; |
e6738866 |
1100 | for (i=0; i<4; i++) { // extract deviation |
1101 | deviation = deviation+Int_t(minDev[i]*TMath::Power(2,i)); |
a9e2aefa |
1102 | } |
1103 | |
1104 | Int_t istripX1Circ=0; |
e6738866 |
1105 | for (i=0; i<5; i++) { // extract X1 strip fired |
1106 | istripX1Circ = istripX1Circ+Int_t(minDevStrip[i]*TMath::Power(2,i)); |
a9e2aefa |
1107 | } |
1108 | |
1109 | Int_t iStripY=0; |
e6738866 |
1110 | for (i=0; i<4; i++) { // extract Y strip fired |
1111 | iStripY = iStripY+Int_t(coordY[i]*TMath::Power(2,i)); |
a9e2aefa |
1112 | } |
1113 | |
1114 | // trigger or not |
1115 | if (signDev==1&&deviation==0) { // something in X ? |
1116 | iTrigger=0; |
1117 | } else { |
1118 | if (coordY[4]==1&&iStripY==15) { // something in Y ? |
1119 | iTrigger=0; |
1120 | } else { |
1121 | iTrigger=1; |
1122 | } |
1123 | } |
1124 | |
1125 | if (iTrigger==1) { |
ecfa008b |
1126 | // fill fTrigger fStripX11 fStripY11 |
1127 | fTrigger[icirc] = 1; |
a9e2aefa |
1128 | fStripX11[icirc] = istripX1Circ; |
1129 | fStripY11[icirc] = iStripY; |
1130 | |
1131 | // calculate deviation in [0+30] |
1132 | Int_t sign=0; |
1133 | if (signDev==0&&deviation!=0) sign=-1; |
1134 | if (signDev==0&&deviation==0) sign=0; |
1135 | if (signDev==1) sign=1; |
ecfa008b |
1136 | fDev[icirc] = sign * deviation + 15; // fill fDev |
a9e2aefa |
1137 | |
1138 | // get Lut output for circuit/istripX/idev/istripY |
1139 | AliMUONTriggerLut* lut = new AliMUONTriggerLut; |
1140 | // lut->StartEvent(); |
ecfa008b |
1141 | lut->GetLutOutput(icirc,fStripX11[icirc],fDev[icirc],fStripY11[icirc], |
a9e2aefa |
1142 | fLutLpt[icirc],fLutHpt[icirc],fLutApt[icirc]); |
1143 | // lut->FinishEvent(); |
1144 | delete lut; |
1145 | |
ecfa008b |
1146 | if (fDebug>1) { |
a9e2aefa |
1147 | Float_t pt= // get ptCal corresponding to istripX1Circ/idev/iStripY |
ecfa008b |
1148 | triggerCircuit->PtCal(fStripX11[icirc],fDev[icirc],fStripY11[icirc]); |
a9e2aefa |
1149 | cout << "-------------------------------------------" << "\n"; |
1150 | cout << " Local Trigger info for circuit Id " << idCircuit |
1151 | << " (number " << icirc << ")" << "\n"; |
1152 | cout << " istripX1 signDev deviation istripY = " |
1153 | << istripX1Circ << " , " << signDev |
1154 | << " , " << deviation << " , " << iStripY << "\n"; |
1155 | cout << " pt = " << pt << " (GeV/c) " << "\n"; |
1156 | cout << "-------------------------------------------" << "\n"; |
1157 | cout << " Local Trigger Lut Output = Lpt : " ; |
e6738866 |
1158 | for (i=1; i>=0; i--) { cout << fLutLpt[icirc][i] ; } |
a9e2aefa |
1159 | cout << " Hpt : "; |
e6738866 |
1160 | for (i=1; i>=0; i--) { cout << fLutHpt[icirc][i] ; } |
a9e2aefa |
1161 | cout << " Apt : "; |
e6738866 |
1162 | for (i=1; i>=0; i--) { cout << fLutApt[icirc][i] ; } |
a9e2aefa |
1163 | cout << "\n"; |
1164 | cout << "-------------------------------------------" << "\n"; |
ecfa008b |
1165 | } // fDebug > 1 |
a9e2aefa |
1166 | } // local trigger = 1 |
1167 | } |
1168 | |
1169 | //---------------------------------------------------------------------- |
1170 | void AliMUONTriggerDecision::GlobalTrigger(){ |
1171 | // loop on Lut[icirc] and give Global Trigger output |
e6738866 |
1172 | Int_t i; |
a9e2aefa |
1173 | |
1174 | for (Int_t icirc=0; icirc<234; icirc++){ |
1175 | if (fLutLpt[icirc][0]==1&&fLutLpt[icirc][1]==1) |
1176 | fGlobalSingleUndef[0] = fGlobalSingleUndef[0] + 1; |
1177 | if (fLutHpt[icirc][0]==1&&fLutHpt[icirc][1]==1) |
1178 | fGlobalSingleUndef[1] = fGlobalSingleUndef[1] + 1; |
1179 | if (fLutApt[icirc][0]==1&&fLutApt[icirc][1]==1) |
1180 | fGlobalSingleUndef[2] = fGlobalSingleUndef[2] + 1; |
1181 | |
1182 | if (fLutLpt[icirc][0]==0&&fLutLpt[icirc][1]==1) |
1183 | fGlobalSinglePlus[0] = fGlobalSinglePlus[0] + 1; |
1184 | if (fLutHpt[icirc][0]==0&&fLutHpt[icirc][1]==1) |
1185 | fGlobalSinglePlus[1] = fGlobalSinglePlus[1] + 1; |
1186 | if (fLutApt[icirc][0]==0&&fLutApt[icirc][1]==1) |
1187 | fGlobalSinglePlus[2] = fGlobalSinglePlus[2] + 1; |
1188 | |
1189 | if (fLutLpt[icirc][0]==1&&fLutLpt[icirc][1]==0) |
1190 | fGlobalSingleMinus[0] = fGlobalSingleMinus[0] + 1; |
1191 | if (fLutHpt[icirc][0]==1&&fLutHpt[icirc][1]==0) |
1192 | fGlobalSingleMinus[1] = fGlobalSingleMinus[1] + 1; |
1193 | if (fLutApt[icirc][0]==1&&fLutApt[icirc][1]==0) |
1194 | fGlobalSingleMinus[2] = fGlobalSingleMinus[2] + 1; |
1195 | } |
1196 | |
1197 | // like sign low, high and all pt |
e6738866 |
1198 | for (i=0; i<3; i++) { |
a9e2aefa |
1199 | fGlobalPairLike[i]=fGlobalSingleMinus[i]*(fGlobalSingleMinus[i]-1)/2 + |
1200 | fGlobalSinglePlus[i]*(fGlobalSinglePlus[i]-1)/2 + |
1201 | fGlobalSingleUndef[i]*(fGlobalSingleUndef[i]-1)/2 + |
1202 | fGlobalSingleUndef[i]*fGlobalSinglePlus[i] + |
1203 | fGlobalSingleUndef[i]*fGlobalSingleMinus[i]; |
1204 | } |
1205 | |
1206 | // unlike sign low, high and all pt |
e6738866 |
1207 | for (i=0; i<3; i++) { |
a9e2aefa |
1208 | fGlobalPairUnlike[i]=fGlobalSingleMinus[i]*fGlobalSinglePlus[i] + |
1209 | fGlobalSingleUndef[i]*(fGlobalSingleUndef[i]-1)/2 + |
1210 | fGlobalSingleUndef[i]*fGlobalSinglePlus[i] + |
1211 | fGlobalSingleUndef[i]*fGlobalSingleMinus[i]; |
1212 | } |
1213 | |
ecfa008b |
1214 | if (fDebug>=1) { |
a9e2aefa |
1215 | cout << "\n"; |
1216 | cout << "===================================================" << "\n"; |
1217 | cout << " Global Trigger output " << "Low pt High pt All" << "\n"; |
1218 | cout << " number of Single Plus :\t"; |
e6738866 |
1219 | for (i=0; i<3; i++) { cout << fGlobalSinglePlus[i] <<"\t";} |
a9e2aefa |
1220 | cout << "\n"; |
1221 | cout << " number of Single Minus :\t"; |
e6738866 |
1222 | for (i=0; i<3; i++) { cout << fGlobalSingleMinus[i] <<"\t";} |
a9e2aefa |
1223 | cout << "\n"; |
1224 | cout << " number of Single Undefined :\t"; |
e6738866 |
1225 | for (i=0; i<3; i++) { cout << fGlobalSingleUndef[i] <<"\t";} |
a9e2aefa |
1226 | cout << "\n"; |
1227 | cout << " number of UnlikeSign pair :\t"; |
e6738866 |
1228 | for (i=0; i<3; i++) { cout << fGlobalPairUnlike[i] <<"\t";} |
a9e2aefa |
1229 | cout << "\n"; |
1230 | cout << " number of LikeSign pair :\t"; |
e6738866 |
1231 | for (i=0; i<3; i++) { cout << fGlobalPairLike[i] <<"\t";} |
a9e2aefa |
1232 | cout << "\n"; |
1233 | cout << "===================================================" << "\n"; |
1234 | } |
1235 | } |
1236 | |
1237 | //---------------------------------------------------------------------- |
1238 | void AliMUONTriggerDecision::PrintBitPatXInput(Int_t icirc){ |
1239 | // print bit pattern for X strips |
e6738866 |
1240 | |
1241 | Int_t istrip; |
1242 | |
a9e2aefa |
1243 | cout << "-------- TRIGGER INPUT ---------" << "\n"; |
1244 | cout << "===============================================================" << "\n"; |
1245 | cout << " 5432109876543210"; |
1246 | cout << "\n XMC11 "; |
e6738866 |
1247 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
1248 | cout << fXbit11[icirc][istrip]; |
1249 | } |
1250 | cout << "\n XMC12 "; |
e6738866 |
1251 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
1252 | cout << fXbit12[icirc][istrip]; |
1253 | } |
1254 | cout << "\n XMC21 "; |
e6738866 |
1255 | for (istrip=31; istrip>=0; istrip--) { |
a9e2aefa |
1256 | cout << fXbit21[icirc][istrip]; |
1257 | } |
1258 | cout << "\n XMC22 "; |
e6738866 |
1259 | for (istrip=31; istrip>=0; istrip--) { |
a9e2aefa |
1260 | cout << fXbit22[icirc][istrip]; |
1261 | } |
1262 | cout << "\n "; |
1263 | cout << "10987654321098765432109876543210" << "\n"; |
1264 | } |
1265 | |
1266 | //---------------------------------------------------------------------- |
1267 | void AliMUONTriggerDecision::PrintBitPatYInput(Int_t icirc){ |
1268 | // print bit pattern for Y strips |
e6738866 |
1269 | |
1270 | Int_t istrip; |
1271 | |
a9e2aefa |
1272 | AliMUON *pMUON = (AliMUON*)gAlice->GetModule("MUON"); |
1273 | AliMUONTriggerCircuit* triggerCircuit; |
1274 | triggerCircuit = &(pMUON->TriggerCircuit(icirc)); |
1275 | Int_t idCircuit=triggerCircuit->GetIdCircuit(); |
1276 | Int_t nStrip=triggerCircuit->GetNstripY(); |
1277 | |
1278 | cout << "---------------------------------------------------------------" << "\n"; |
1279 | cout << " "; |
e6738866 |
1280 | for (istrip=nStrip-1; istrip>=0; istrip--) { |
a9e2aefa |
1281 | if (istrip>9) { cout << istrip-10*Int_t(istrip/10);} |
1282 | if (istrip<10) { cout << istrip;} |
1283 | } |
1284 | cout << "\n YMC11 "; |
e6738866 |
1285 | for (istrip=nStrip-1; istrip>=0; istrip--) { |
a9e2aefa |
1286 | cout << fYbit11[icirc][istrip]; |
1287 | } |
1288 | cout << "\n YMC12 "; |
e6738866 |
1289 | for (istrip=nStrip-1; istrip>=0; istrip--) { |
a9e2aefa |
1290 | cout << fYbit12[icirc][istrip]; |
1291 | } |
1292 | cout << "\n YMC21 "; |
e6738866 |
1293 | for (istrip=nStrip-1; istrip>=0; istrip--) { |
a9e2aefa |
1294 | cout << fYbit21[icirc][istrip]; |
1295 | } |
1296 | cout << "\n YMC22 "; |
e6738866 |
1297 | for (istrip=nStrip-1; istrip>=0; istrip--) { |
a9e2aefa |
1298 | cout << fYbit22[icirc][istrip]; |
1299 | } |
1300 | cout << "\n"; |
1301 | // tmp |
1302 | cout << "---------------------------------------------------------------"; |
1303 | cout << "\n upper part of circuit " << idCircuit ; |
1304 | cout << "\n UMC21 "; |
e6738866 |
1305 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
1306 | cout << fYbit21U[icirc][istrip]; |
1307 | } |
1308 | cout << "\n UMC22 "; |
e6738866 |
1309 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
1310 | cout << fYbit22U[icirc][istrip]; |
1311 | } |
1312 | |
1313 | cout << "\n lower part of circuit " << idCircuit ; |
1314 | cout << "\n LMC21 "; |
e6738866 |
1315 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
1316 | cout << fYbit21D[icirc][istrip]; |
1317 | } |
1318 | cout << "\n LMC22 "; |
e6738866 |
1319 | for (istrip=15; istrip>=0; istrip--) { |
a9e2aefa |
1320 | cout << fYbit22D[icirc][istrip]; |
1321 | } |
1322 | cout << "\n"; |
1323 | cout << "===============================================================" << "\n"; |
1324 | } |
1325 | //---------------------------------------------------------------------- |
1326 | void AliMUONTriggerDecision::PrintLocalOutput(Int_t minDevStrip[5], |
1327 | Int_t minDev[5], |
1328 | Int_t coordY[5]){ |
1329 | // print Local trigger output before the LuT step |
e6738866 |
1330 | |
1331 | Int_t i; |
1332 | |
a9e2aefa |
1333 | cout << "===============================================================" << "\n"; |
1334 | cout << "-------- TRIGGER OUTPUT --------" << "\n"; |
1335 | cout << "minDevStrip = "; |
e6738866 |
1336 | for (i=4; i>=0; i--) {cout << minDevStrip[i];} |
a9e2aefa |
1337 | cout << " minDev = "; |
e6738866 |
1338 | for (i=4; i>=0; i--) {cout << minDev[i];} |
a9e2aefa |
1339 | cout << " coordY = "; |
e6738866 |
1340 | for (i=4; i>=0; i--) {cout << coordY[i];} |
a9e2aefa |
1341 | cout << " " << "\n"; |
1342 | } |
1343 | |
1344 | //---------------------------------------------------------------------- |
1345 | //--- methods which return member data related info |
1346 | //---------------------------------------------------------------------- |
1347 | Int_t AliMUONTriggerDecision::GetITrigger(Int_t icirc){ |
1348 | // returns Local Trigger Status |
ecfa008b |
1349 | return fTrigger[icirc]; |
a9e2aefa |
1350 | } |
1351 | //---------------------------------------------------------------------- |
1352 | Int_t AliMUONTriggerDecision::GetStripX11(Int_t icirc){ |
1353 | // returns fStripX11 |
1354 | return fStripX11[icirc]; |
1355 | } |
1356 | //---------------------------------------------------------------------- |
1357 | Int_t AliMUONTriggerDecision::GetDev(Int_t icirc){ |
1358 | // returns idev |
ecfa008b |
1359 | return fDev[icirc]; |
a9e2aefa |
1360 | } |
1361 | //---------------------------------------------------------------------- |
1362 | Int_t AliMUONTriggerDecision::GetStripY11(Int_t icirc){ |
1363 | // returns fStripY11; |
1364 | return fStripY11[icirc]; |
1365 | } |
1366 | //---------------------------------------------------------------------- |
1367 | void AliMUONTriggerDecision::GetLutOutput(Int_t icirc, Int_t lpt[2], |
1368 | Int_t hpt[2], Int_t apt[2]){ |
1369 | // returns Look up Table output |
1370 | for (Int_t i=0; i<2; i++) { |
1371 | lpt[i]=fLutLpt[icirc][i]; |
1372 | hpt[i]=fLutHpt[icirc][i]; |
1373 | apt[i]=fLutApt[icirc][i]; |
1374 | } |
1375 | } |
1376 | //---------------------------------------------------------------------- |
1377 | void AliMUONTriggerDecision::GetGlobalTrigger(Int_t singlePlus[3], |
1378 | Int_t singleMinus[3], |
1379 | Int_t singleUndef[3], |
1380 | Int_t pairUnlike[3], |
1381 | Int_t pairLike[3]){ |
1382 | // returns Global Trigger information (0,1,2 : Lpt,Hpt,Apt) |
1383 | for (Int_t i=0; i<3; i++) { |
1384 | singlePlus[i] = fGlobalSinglePlus[i]; |
1385 | singleMinus[i] = fGlobalSingleMinus[i]; |
1386 | singleUndef[i] = fGlobalSingleUndef[i]; |
1387 | pairUnlike[i] = fGlobalPairUnlike[i]; |
1388 | pairLike[i] = fGlobalPairLike[i]; |
1389 | } |
1390 | } |
1391 | //---------------------------------------------------------------------- |
1392 | //--- end of methods which return member data related info |
1393 | //---------------------------------------------------------------------- |
1394 | //---------------------------------------------------------------------- |
1395 | /* |
1396 | void AliMUONTriggerDecision::AddLocalTrigger(const AliMUONLocalTrigger c){ |
1397 | // Add a Local Trigger copy to the list |
1398 | AliMUON *MUON=(AliMUON*)gAlice->GetModule("MUON"); |
1399 | MUON->AddLocalTrigger(c); |
1400 | fNLocalTriggers++; |
1401 | } |
1402 | */ |