Global transformation correction (ivana)
[u/mrichter/AliRoot.git] / MUON / AliMUONChamberTrigger.cxx
CommitLineData
a9e2aefa 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
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
88cb7938 16/* $Id$ */
a9e2aefa 17
18#include "AliMUONChamberTrigger.h"
a9e2aefa 19#include "AliMUONResponseTrigger.h"
c4a97bcd 20#include "AliLog.h"
a9e2aefa 21
22ClassImp(AliMUONChamberTrigger)
23
24//-------------------------------------------
d81db581 25
03f221a7 26AliMUONChamberTrigger::AliMUONChamberTrigger()
30178c30 27 : AliMUONChamber()
d81db581 28{
29// Default constructor
30}
31
32
30178c30 33AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id)
34 : AliMUONChamber(id)
a9e2aefa 35{
d81db581 36// Constructor using chamber id
a9e2aefa 37}
38
39//-------------------------------------------
24fe6002 40void AliMUONChamberTrigger::DisIntegration(Float_t /*eloss*/, Float_t tof,
802a864d 41 Float_t xhit, Float_t yhit, Float_t zhit,
a9e2aefa 42 Int_t& nnew,
43 Float_t newclust[6][500])
44{
45//
46// Generates pad hits (simulated cluster)
47// using the segmentation and the response model
48
49 Int_t twentyNano;
39f5a0e6 50 if (tof<75*TMath::Power(10,-9)) {
a9e2aefa 51 twentyNano=1;
52 } else {
53 twentyNano=100;
54 }
55
a9e2aefa 56 Float_t qp;
57 nnew=0;
58 for (Int_t i=1; i<=fnsec; i++) {
a30a000f 59 AliSegmentation * segmentation=
60 (AliSegmentation*) (*fSegmentation)[i-1];
a9e2aefa 61
62// Find the module & strip Id. which has fired
63 Int_t ix,iy;
64
a30a000f 65 segmentation->GetPadI(xhit,yhit,0,ix,iy);
a9e2aefa 66 segmentation->SetPad(ix,iy);
8c343c7c 67
a9e2aefa 68// treatment of GEANT hits w/o corresponding strip (due to the fact that
69// the 2 geometries are computed in a very slightly different way)
70 if (ix==0&&iy==0) {
c4a97bcd 71 AliInfo(Form("AliMUONChamberTrigger hit w/o strip %f %f \n",xhit,yhit));
a9e2aefa 72 } else {
73 // --- store signal information for this strip
74 newclust[0][nnew]=1.; // total charge
75 newclust[1][nnew]=ix; // ix-position of pad
76 newclust[2][nnew]=iy; // iy-position of pad
77 newclust[3][nnew]=twentyNano; // time of flight
78 newclust[4][nnew]=segmentation->ISector(); // sector id
79 newclust[5][nnew]=(Float_t) i; // counter
80 nnew++;
03f221a7 81
82// cluster-size if AliMUONResponseTriggerV1, nothing if AliMUONResponseTrigger
83 if (((AliMUONResponseTrigger*) fResponse)->SetGenerCluster()) {
84
85 // set hits
86 segmentation->SetHit(xhit,yhit,zhit);
87 // get the list of nearest neighbours
88 Int_t nList, xList[10], yList[10];
89 segmentation->Neighbours(ix,iy,&nList,xList,yList);
a9e2aefa 90
03f221a7 91 qp = 0;
92 for (Int_t j=0; j<nList; j++){ // loop over neighbours
93 if (xList[j]!=0) { // existing neighbour
94 if (j==0||j==5||qp!=0) { // built-up cluster-size
95
96 // neighbour real coordinates (just for checks here)
97 Float_t x,y,z;
98 segmentation->GetPadC(xList[j],yList[j],x,y,z);
99 // set pad (fx fy & fix fiy are the current pad coord. & Id.)
100 segmentation->SetPad(xList[j],yList[j]);
101 // get the chamber (i.e. current strip) response
102 qp=fResponse->IntXY(segmentation);
103
104 if (qp > 0.5) {
105 // --- store signal information for neighbours
106 newclust[0][nnew]=qp; // total charge
107 newclust[1][nnew]=segmentation->Ix(); // ix-pos. of pad
108 newclust[2][nnew]=segmentation->Iy(); // iy-pos. of pad
109 newclust[3][nnew]=twentyNano; // time of flight
110 newclust[4][nnew]=segmentation->ISector(); // sector id
111 newclust[5][nnew]=(Float_t) i; // counter
112 nnew++;
113 } // qp > 0.5
114 } // built-up cluster-size
115 } // existing neighbour
116 } // loop over neighbours
117 } // endif hit w/o strip
118 } // loop over planes
119 } // if AliMUONResponseTriggerV1
a9e2aefa 120}
121
122
123
124
125
126
127
128
03f221a7 129
130