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