previous error corrected
[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
16/*
17$Log$
ecfa008b 18Revision 1.6 2000/07/03 11:54:57 morsch
19AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
20The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
21
a30a000f 22Revision 1.5 2000/06/29 12:34:09 morsch
23AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
24it usable with any other geometry class. The link to the object to which it belongs is
25established via an index. This assumes that there exists a global geometry manager
26from which the pointer to the parent object can be obtained (in our case gAlice).
27
d81db581 28Revision 1.4 2000/06/29 06:52:02 pcrochet
29pow changed to TMath::Power
30
39f5a0e6 31Revision 1.3 2000/06/28 15:16:35 morsch
32(1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
33to allow development of slat-muon chamber simulation and reconstruction code in the MUON
34framework. The changes should have no side effects (mostly dummy arguments).
35(2) Hit disintegration uses 3-dim hit coordinates to allow simulation
36of chambers with overlapping modules (MakePadHits, Disintegration).
37
802a864d 38Revision 1.2 2000/06/15 07:58:48 morsch
39Code from MUON-dev joined
40
a9e2aefa 41Revision 1.1.2.3 2000/06/09 21:27:35 morsch
42Most coding rule violations corrected.
43
44Revision 1.1.2.2 2000/04/26 12:28:25 morsch
45- flag pad hits with condition on ToF (CP)
46- Tof included in the method DisIntegration (CP)
47
48Revision 1.1.2.1 2000/02/17 14:30:54 morsch
49Draft version
50
51*/
52
53#include "AliMUONChamberTrigger.h"
54#include "AliMUONSegmentationTrigger.h"
55#include "AliMUONResponseTrigger.h"
56#include <TObjArray.h>
57#include <TMath.h>
58#include <iostream.h>
59
60ClassImp(AliMUONChamberTrigger)
61
62//-------------------------------------------
d81db581 63
64 AliMUONChamberTrigger::AliMUONChamberTrigger()
65{
66// Default constructor
67}
68
69
70AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id) : AliMUONChamber(id)
a9e2aefa 71{
d81db581 72// Constructor using chamber id
a9e2aefa 73}
74
75//-------------------------------------------
76void AliMUONChamberTrigger::DisIntegration(Float_t eloss, Float_t tof,
802a864d 77 Float_t xhit, Float_t yhit, Float_t zhit,
a9e2aefa 78 Int_t& nnew,
79 Float_t newclust[6][500])
80{
81//
82// Generates pad hits (simulated cluster)
83// using the segmentation and the response model
84
85 Int_t twentyNano;
39f5a0e6 86 if (tof<75*TMath::Power(10,-9)) {
a9e2aefa 87 twentyNano=1;
88 } else {
89 twentyNano=100;
90 }
91
92 // cout << " time = " << tof << " , " << twentyNano << "\n";
93
94 Float_t qp;
95 nnew=0;
96 for (Int_t i=1; i<=fnsec; i++) {
a30a000f 97 AliSegmentation * segmentation=
98 (AliSegmentation*) (*fSegmentation)[i-1];
a9e2aefa 99
100// Find the module & strip Id. which has fired
101 Int_t ix,iy;
102
a30a000f 103 segmentation->GetPadI(xhit,yhit,0,ix,iy);
a9e2aefa 104 segmentation->SetPad(ix,iy);
105
106// treatment of GEANT hits w/o corresponding strip (due to the fact that
107// the 2 geometries are computed in a very slightly different way)
108 if (ix==0&&iy==0) {
109 cout << " AliMUONChamberTrigger hit w/o strip " << xhit << " , " << yhit << "\n";
110 } else {
111 // --- store signal information for this strip
112 newclust[0][nnew]=1.; // total charge
113 newclust[1][nnew]=ix; // ix-position of pad
114 newclust[2][nnew]=iy; // iy-position of pad
115 newclust[3][nnew]=twentyNano; // time of flight
116 newclust[4][nnew]=segmentation->ISector(); // sector id
117 newclust[5][nnew]=(Float_t) i; // counter
118 nnew++;
119 // set hits
802a864d 120 segmentation->SetHit(xhit,yhit,zhit);
a9e2aefa 121 // get the list of nearest neighbours
122 Int_t nList, xList[2], yList[2];
123 segmentation->Neighbours(ix,iy,&nList,xList,yList);
124
125 for (Int_t j=0; j<nList; j++){
126
127 // neighbour real coordinates (just for checks here)
802a864d 128 Float_t x,y,z;
a30a000f 129 segmentation->GetPadC(xList[j],yList[j],x,y,z);
ecfa008b 130 // set pad (fX fY & fIx fIy are the current pad coord. & Id.)
a9e2aefa 131 segmentation->SetPad(xList[j],yList[j]);
132 // get the chamber (i.e. current strip) response
133 qp=fResponse->IntXY(segmentation);
134
135 if (qp > 0.5) {
136 // --- store signal information for neighbours
137 newclust[0][nnew]=qp; // total charge
138 newclust[1][nnew]=segmentation->Ix(); // ix-position of pad
139 newclust[2][nnew]=segmentation->Iy(); // iy-position of pad
140 newclust[3][nnew]=twentyNano; // time of flight
141 newclust[4][nnew]=segmentation->ISector(); // sector id
142 newclust[5][nnew]=(Float_t) i; // counter
143 nnew++;
144 } // qp > 0.5
145 } // loop on neighbour
146 } // endif hit w/o strip
147 } // loop over planes
148}
149
150
151
152
153
154
155
156