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