]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONChamberTrigger.cxx
Included the geometry through geant4_vmc/FLUGG
[u/mrichter/AliRoot.git] / MUON / AliMUONChamberTrigger.cxx
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$
18 Revision 1.8  2000/11/20 21:44:17  pcrochet
19 some modifications to account for the new class AliMUONResponseTriggerV1
20
21 Revision 1.7  2000/10/02 16:58:29  egangler
22 Cleaning of the code :
23 -> coding conventions
24 -> void Streamers
25 -> some useless includes removed or replaced by "class" statement
26
27 Revision 1.6  2000/07/03 11:54:57  morsch
28 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
29 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
30
31 Revision 1.5  2000/06/29 12:34:09  morsch
32 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
33 it usable with any other geometry class. The link to the object to which it belongs is
34 established via an index. This assumes that there exists a global geometry manager
35 from which the pointer to the parent object can be obtained (in our case gAlice).
36
37 Revision 1.4  2000/06/29 06:52:02  pcrochet
38 pow changed to TMath::Power
39
40 Revision 1.3  2000/06/28 15:16:35  morsch
41 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
42 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
43 framework. The changes should have no side effects (mostly dummy arguments).
44 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
45 of chambers with overlapping modules (MakePadHits, Disintegration).
46
47 Revision 1.2  2000/06/15 07:58:48  morsch
48 Code from MUON-dev joined
49
50 Revision 1.1.2.3  2000/06/09 21:27:35  morsch
51 Most coding rule violations corrected.
52
53 Revision 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
57 Revision 1.1.2.1  2000/02/17 14:30:54  morsch
58 Draft version
59
60 */
61
62 #include "AliMUONChamberTrigger.h"
63 #include "AliMUONSegmentationTrigger.h"
64 #include "AliMUONResponseTrigger.h"
65 #include "AliMUONResponseTriggerV1.h"
66 #include <TObjArray.h>
67 #include <TMath.h>
68 #include <Riostream.h>
69
70 ClassImp(AliMUONChamberTrigger)
71
72 //-------------------------------------------
73
74 AliMUONChamberTrigger::AliMUONChamberTrigger()
75 {
76 // Default constructor
77 }
78
79
80 AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id) : AliMUONChamber(id)
81 {
82 // Constructor using chamber id
83 }
84
85 //-------------------------------------------
86 void AliMUONChamberTrigger::DisIntegration(Float_t eloss, Float_t tof, 
87                                            Float_t xhit, Float_t yhit, Float_t zhit, 
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;
96   if (tof<75*TMath::Power(10,-9)) {
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++) {
107     AliSegmentation * segmentation=
108       (AliSegmentation*) (*fSegmentation)[i-1];
109     
110 // Find the module & strip Id. which has fired
111     Int_t ix,iy;
112     
113     segmentation->GetPadI(xhit,yhit,0,ix,iy);
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++;
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);
138         
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
168 }
169
170
171
172
173
174
175
176
177
178