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