]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONChamberTrigger.cxx
Only getters to parameters declared constant.
[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.6  2000/07/03 11:54:57  morsch
19 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
20 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
21
22 Revision 1.5  2000/06/29 12:34:09  morsch
23 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
24 it usable with any other geometry class. The link to the object to which it belongs is
25 established via an index. This assumes that there exists a global geometry manager
26 from which the pointer to the parent object can be obtained (in our case gAlice).
27
28 Revision 1.4  2000/06/29 06:52:02  pcrochet
29 pow changed to TMath::Power
30
31 Revision 1.3  2000/06/28 15:16:35  morsch
32 (1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
33 to allow development of slat-muon chamber simulation and reconstruction code in the MUON
34 framework. The changes should have no side effects (mostly dummy arguments).
35 (2) Hit disintegration uses 3-dim hit coordinates to allow simulation
36 of chambers with overlapping modules (MakePadHits, Disintegration).
37
38 Revision 1.2  2000/06/15 07:58:48  morsch
39 Code from MUON-dev joined
40
41 Revision 1.1.2.3  2000/06/09 21:27:35  morsch
42 Most coding rule violations corrected.
43
44 Revision 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
48 Revision 1.1.2.1  2000/02/17 14:30:54  morsch
49 Draft 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
60 ClassImp(AliMUONChamberTrigger)
61
62 //-------------------------------------------
63
64     AliMUONChamberTrigger::AliMUONChamberTrigger()
65 {
66 // Default constructor
67 }
68
69
70 AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id) : AliMUONChamber(id)
71 {
72 // Constructor using chamber id
73 }
74
75 //-------------------------------------------
76 void AliMUONChamberTrigger::DisIntegration(Float_t eloss, Float_t tof, 
77                                            Float_t xhit, Float_t yhit, Float_t zhit, 
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;
86   if (tof<75*TMath::Power(10,-9)) {
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++) {
97     AliSegmentation * segmentation=
98       (AliSegmentation*) (*fSegmentation)[i-1];
99     
100 // Find the module & strip Id. which has fired
101     Int_t ix,iy;
102     
103     segmentation->GetPadI(xhit,yhit,0,ix,iy);
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
120       segmentation->SetHit(xhit,yhit,zhit);
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)
128         Float_t x,y,z;
129         segmentation->GetPadC(xList[j],yList[j],x,y,z);
130         // set pad (fX fY & fIx fIy are the current pad coord. & Id.)
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