]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONChamber.cxx
Correct log and Id tag.
[u/mrichter/AliRoot.git] / MUON / AliMUONChamber.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$Log$
d81db581 17Revision 1.3 2000/06/28 15:16:35 morsch
18(1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
19to allow development of slat-muon chamber simulation and reconstruction code in the MUON
20framework. The changes should have no side effects (mostly dummy arguments).
21(2) Hit disintegration uses 3-dim hit coordinates to allow simulation
22of chambers with overlapping modules (MakePadHits, Disintegration).
23
802a864d 24Revision 1.2 2000/06/15 07:58:48 morsch
25Code from MUON-dev joined
26
a9e2aefa 27Revision 1.1.2.5 2000/06/09 21:27:01 morsch
28Most coding rule violations corrected.
29
30Revision 1.1.2.4 2000/05/05 11:34:12 morsch
31Log inside comments.
32
33Revision 1.1.2.3 2000/05/05 10:09:52 morsch
34Log messages included
35*/
36
37#include "AliMUONChamber.h"
38#include "AliMUONSegmentation.h"
39#include "AliMUONResponse.h"
40
41#include "TMath.h"
42ClassImp(AliMUONChamber)
43
d81db581 44 AliMUONChamber::AliMUONChamber()
45{
46// Default constructor
47 fSegmentation = new TObjArray(2);
48 (*fSegmentation)[0] = 0;
49 (*fSegmentation)[1] = 0;
50 fResponse=0;
51 fnsec=1;
52 fReconstruction=0;
53 fId=0;
54}
55
56 AliMUONChamber::AliMUONChamber(Int_t id)
a9e2aefa 57{
d81db581 58// Construtor with chamber id
a9e2aefa 59 fSegmentation = new TObjArray(2);
60 (*fSegmentation)[0] = 0;
61 (*fSegmentation)[1] = 0;
62 fResponse=0;
63 fnsec=1;
64 fReconstruction=0;
d81db581 65 fId=id;
a9e2aefa 66}
67
68AliMUONChamber::~AliMUONChamber()
69{
d81db581 70// Destructor
a9e2aefa 71 if (fSegmentation) delete fSegmentation;
72}
73
74AliMUONChamber::AliMUONChamber(const AliMUONChamber& rChamber)
75{
76// Dummy copy constructor
77 ;
78}
79
80
81void AliMUONChamber::Init()
82{
83// Initalisation ..
84//
85// ... for chamber segmentation
86 if ((*fSegmentation)[0])
d81db581 87 ((AliMUONSegmentation *) (*fSegmentation)[0])->Init(fId);
a9e2aefa 88
89 if (fnsec==2) {
90 if ((*fSegmentation)[1])
d81db581 91 ((AliMUONSegmentation *) (*fSegmentation)[1])->Init(fId);
a9e2aefa 92 }
93}
94
95Int_t AliMUONChamber::SigGenCond(Float_t x, Float_t y, Float_t z)
96{
97// Ask segmentation if signal should be generated
98 if (fnsec==1) {
99 return ((AliMUONSegmentation*) (*fSegmentation)[0])
100 ->SigGenCond(x, y, z) ;
101 } else {
102 return (((AliMUONSegmentation*) (*fSegmentation)[0])
103 ->SigGenCond(x, y, z)) ||
104 (((AliMUONSegmentation*) (*fSegmentation)[1])
105 ->SigGenCond(x, y, z)) ;
106 }
107}
108
109
110void AliMUONChamber::SigGenInit(Float_t x, Float_t y, Float_t z)
111{
112//
113// Initialisation of segmentation for hit
114//
115 if (fnsec==1) {
116 ((AliMUONSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
117 } else {
118 ((AliMUONSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
119 ((AliMUONSegmentation*) (*fSegmentation)[1])->SigGenInit(x, y, z) ;
120 }
121}
122
123void AliMUONChamber::DisIntegration(Float_t eloss, Float_t tof,
802a864d 124 Float_t xhit, Float_t yhit, Float_t zhit,
a9e2aefa 125 Int_t& nnew,Float_t newclust[6][500])
126{
127//
128// Generates pad hits (simulated cluster)
129// using the segmentation and the response model
130 Float_t dx, dy;
131 //
132 // Width of the integration area
133 //
134 dx=fResponse->SigmaIntegration()*fResponse->ChargeSpreadX();
135 dy=fResponse->SigmaIntegration()*fResponse->ChargeSpreadY();
136 //
137 // Get pulse height from energy loss
138 Float_t qtot = fResponse->IntPH(eloss);
139 //
140 // Loop Over Pads
141
142 Float_t qcheck=0, qp;
143 nnew=0;
144 for (Int_t i=1; i<=fnsec; i++) {
145 qcheck=0;
146 AliMUONSegmentation * segmentation=
147 (AliMUONSegmentation *) (*fSegmentation)[i-1];
802a864d 148 for (segmentation->FirstPad(xhit, yhit, zhit, dx, dy);
a9e2aefa 149 segmentation->MorePads();
150 segmentation->NextPad())
151 {
152 qp=fResponse->IntXY(segmentation);
153 qp=TMath::Abs(qp);
154
155//
156//
157 if (qp > 1.e-4) {
158 qcheck+=qp;
159 //
160 // --- store signal information
161 newclust[0][nnew]=qtot; // total charge
162 newclust[1][nnew]=segmentation->Ix(); // ix-position of pad
163 newclust[2][nnew]=segmentation->Iy(); // iy-position of pad
164 newclust[3][nnew]=qp * qtot; // charge on pad
165 newclust[4][nnew]=segmentation->ISector(); // sector id
166 newclust[5][nnew]=(Float_t) i; // counter
167 nnew++;
168 }
169 } // Pad loop
170 } // Cathode plane loop
171}
172
173
174
175void AliMUONChamber::InitGeo(Float_t zpos)
176{
177// sensitive gas gap
178 fdGas= 0.5;
179// 3% radiation length of aluminum (X0=8.9 cm)
180 fdAlu= 3.0/100*8.9;
181}
182
183
184AliMUONChamber & AliMUONChamber::operator =(const AliMUONChamber& rhs)
185{
186// Dummy assignment operator
187 return *this;
188}