]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONChamberTrigger.cxx
Adding comment
[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 /* $Id$ */
17
18 #include <TMath.h>
19
20 #include "AliMUONChamberTrigger.h"
21 #include "AliMUONResponseTrigger.h"
22 #include "AliMUONHit.h"
23 #include "AliMUON.h"
24 #include "AliMUONSegmentation.h"
25 #include "AliMUONGeometrySegmentation.h"
26 #include "AliMUONGeometryTransformer.h"
27 #include "AliLog.h"
28
29 ///
30 /// \class AliMUONChamberTrigger
31 ///
32 /// Implementation of AliMUONChamber for the trigger
33 ///
34 /// This class is to be deprecated.
35 ///
36
37 /// \cond CLASSIMP
38 ClassImp(AliMUONChamberTrigger)
39 /// \endcond
40
41 //-------------------------------------------
42
43 AliMUONChamberTrigger::AliMUONChamberTrigger()
44   : AliMUONChamber(),
45     fkGeomTransformer(0)
46 {
47 /// Default constructor
48 }
49
50 //-------------------------------------------
51
52 AliMUONChamberTrigger:: ~AliMUONChamberTrigger()
53 {
54 /// Destructor
55 }
56
57 //-------------------------------------------
58
59 AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id,
60                               const AliMUONGeometryTransformer* kGeometryTransformer) 
61   : AliMUONChamber(id),
62     fkGeomTransformer(kGeometryTransformer)
63 {
64 /// Constructor using chamber id
65 }
66
67 //-------------------------------------------
68 void AliMUONChamberTrigger::DisIntegration(AliMUONHit* hit,
69                                            Int_t& nnew,
70                                            Float_t newclust[6][500]) 
71 {
72 ///  Generates pad hits (simulated cluster) 
73 ///  using the segmentation and the response model
74
75
76   Float_t   tof = hit->Age();
77   Float_t  xhit = hit->X();
78   Float_t  yhit = hit->Y();
79   Float_t  zhit = hit->Z();
80   Int_t      id = hit->DetElemId();
81
82   Int_t twentyNano;
83   if (tof<75*TMath::Power(10,-9)) {
84     twentyNano=1;
85   } else {
86     twentyNano=100;
87   }
88
89   Float_t qp;
90   nnew=0;
91   for (Int_t i = 1; i <= 2; i++) {
92
93     AliMUONGeometrySegmentation* segmentation=
94       fMUON->GetSegmentation()->GetModuleSegmentationByDEId(id, i-1); 
95
96     
97 // Find the module & strip Id. which has fired
98     Int_t ix(-1);
99     Int_t iy(-1);
100     segmentation->GetPadI(id,xhit,yhit,0,ix,iy);
101 // treatment of GEANT hits w/o corresponding strip (due to the fact that
102 // geometry & segmentation are computed in a very slightly different way) 
103     if ( ix<0 || iy<0 ) 
104     {
105       Float_t lx,ly,lz;
106       fkGeomTransformer->Global2Local(id,xhit,yhit,0,lx,ly,lz);
107       AliWarning(Form("AliMUONChamberTrigger hit w/o strip %i-%d %e %e "
108                       "local %e %e %e ix,iy=%d,%d\n",id,i-1,xhit,yhit,lx,ly,lz,ix,iy));
109     } else 
110     {          
111       segmentation->SetPad(id,ix,iy);
112       if (xhit<0) ix = -ix;
113       //    printf(" fId id fnsec xhit yhit zhit ix iy %i %i %i %f %f %f %i %i \n",fId,i,id,xhit,yhit,zhit,ix,iy);
114       //     if (ix < 0 || ix > 10000) return;
115       //     if (iy < 0 || iy > 10000) return;
116       
117       // --- store signal information for this strip
118       newclust[0][nnew]=1.;                       // total charge
119       newclust[1][nnew]=ix;                       // ix-position of pad
120       newclust[2][nnew]=iy;                       // iy-position of pad
121       newclust[3][nnew]=twentyNano;               // time of flight
122       newclust[4][nnew]=segmentation->ISector();  // sector id
123       newclust[5][nnew]=(Float_t) i;              // counter
124       nnew++;
125       
126       // cluster-size if AliMUONResponseTriggerV1, nothing if AliMUONResponseTrigger
127       if (((AliMUONResponseTrigger*) fResponse)->SetGenerCluster()) {
128             
129             // set hits
130             segmentation->SetHit(id,xhit,yhit,zhit);
131             // get the list of nearest neighbours
132             Int_t nList, xList[10], yList[10];
133             segmentation->Neighbours(id,ix,iy,&nList,xList,yList);
134             
135             qp = 0;
136             for (Int_t j=0; j<nList; j++){       // loop over neighbours          
137                 if (xList[j]!=0) {                 // existing neighbour            
138                     if (j==0||j==5||qp!=0) {         // built-up cluster-size
139                         
140                         // neighbour real coordinates (just for checks here)
141                         Float_t x,y,z;
142                         segmentation->GetPadC(id,xList[j],yList[j],x,y,z);
143                         // set pad (fx fy & fix fiy are the current pad coord. & Id.)
144                         segmentation->SetPad(id,xList[j],yList[j]);       
145                         // get the chamber (i.e. current strip) response
146                         qp=fResponse->IntXY(id,segmentation);     
147                         
148                         if (qp > 0.5) {         
149                             // --- store signal information for neighbours 
150                             newclust[0][nnew]=qp;                      // total charge
151                             newclust[1][nnew]=segmentation->Ix();      // ix-pos. of pad
152                             newclust[2][nnew]=segmentation->Iy();      // iy-pos. of pad
153                             newclust[3][nnew]=twentyNano;              // time of flight
154                             newclust[4][nnew]=segmentation->ISector(); // sector id
155                             newclust[5][nnew]=(Float_t) i;             // counter
156                             nnew++;
157                         } // qp > 0.5 
158                     } // built-up cluster-size
159                 } // existing neighbour
160             } // loop over neighbours
161         } // endif hit w/o strip
162     } // loop over planes
163   } // if AliMUONResponseTriggerV1
164 }
165
166
167
168
169
170