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