]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONChamberTrigger.cxx
From Artur:
[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 "AliMUONGeometrySegmentation.h"
22 #include "AliLog.h"
23
24 ClassImp(AliMUONChamberTrigger)
25
26 //-------------------------------------------
27
28 AliMUONChamberTrigger::AliMUONChamberTrigger()
29   : AliMUONChamber()
30 {
31 // Default constructor
32 }
33
34
35 AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id) 
36   : AliMUONChamber(id)
37 {
38 // Constructor using chamber id
39 }
40
41 //-------------------------------------------
42 void AliMUONChamberTrigger::DisIntegration(AliMUONHit* hit,
43                                            Int_t& nnew,
44                                            Float_t newclust[6][500]) 
45 {
46 //    
47 //  Generates pad hits (simulated cluster) 
48 //  using the segmentation and the response model
49
50
51   Float_t   tof = hit->Age();
52   Float_t  xhit = hit->X();
53   Float_t  yhit = hit->Y();
54   Float_t  zhit = hit->Z();
55   Int_t      id = hit->DetElemId();
56
57   Int_t twentyNano;
58   if (tof<75*TMath::Power(10,-9)) {
59     twentyNano=1;
60   } else {
61     twentyNano=100;
62   }
63
64   Float_t qp;
65   nnew=0;
66   for (Int_t i = 1; i <= 2; i++) {
67     AliMUONGeometrySegmentation * segmentation=
68       (AliMUONGeometrySegmentation*) (*fSegmentation2)[i-1];
69     
70 // Find the module & strip Id. which has fired
71     Int_t ix,iy;
72     segmentation->GetPadI(id,xhit,yhit,0,ix,iy);
73     segmentation->SetPad(id,ix,iy);
74     if (xhit<0) ix = -ix;
75 //    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);
76 //     if (ix < 0 || ix > 10000) return;
77 //     if (iy < 0 || iy > 10000) return;
78
79 // treatment of GEANT hits w/o corresponding strip (due to the fact that
80 // the 2 geometries are computed in a very slightly different way) 
81     if (ix==0&&iy==0) {
82       AliInfo(Form("AliMUONChamberTrigger hit w/o strip %f %f \n",xhit,yhit));
83     } else {          
84       // --- store signal information for this strip
85       newclust[0][nnew]=1.;                       // total charge
86       newclust[1][nnew]=ix;                       // ix-position of pad
87       newclust[2][nnew]=iy;                       // iy-position of pad
88       newclust[3][nnew]=twentyNano;               // time of flight
89       newclust[4][nnew]=segmentation->ISector();  // sector id
90       newclust[5][nnew]=(Float_t) i;              // counter
91       nnew++;
92
93 // cluster-size if AliMUONResponseTriggerV1, nothing if AliMUONResponseTrigger
94       if (((AliMUONResponseTrigger*) fResponse)->SetGenerCluster()) {
95   
96         // set hits
97         segmentation->SetHit(id,xhit,yhit,zhit);
98         // get the list of nearest neighbours
99         Int_t nList, xList[10], yList[10];
100         segmentation->Neighbours(id,ix,iy,&nList,xList,yList);
101         
102         qp = 0;
103         for (Int_t j=0; j<nList; j++){       // loop over neighbours      
104           if (xList[j]!=0) {                 // existing neighbour          
105             if (j==0||j==5||qp!=0) {         // built-up cluster-size
106               
107               // neighbour real coordinates (just for checks here)
108               Float_t x,y,z;
109               segmentation->GetPadC(id,xList[j],yList[j],x,y,z);
110               // set pad (fx fy & fix fiy are the current pad coord. & Id.)
111               segmentation->SetPad(id,xList[j],yList[j]);         
112               // get the chamber (i.e. current strip) response
113               qp=fResponse->IntXY(id,segmentation);       
114               
115               if (qp > 0.5) {           
116                 // --- store signal information for neighbours 
117                 newclust[0][nnew]=qp;                      // total charge
118                 newclust[1][nnew]=segmentation->Ix();      // ix-pos. of pad
119                 newclust[2][nnew]=segmentation->Iy();      // iy-pos. of pad
120                 newclust[3][nnew]=twentyNano;              // time of flight
121                 newclust[4][nnew]=segmentation->ISector(); // sector id
122                 newclust[5][nnew]=(Float_t) i;             // counter
123                 nnew++;
124               } // qp > 0.5 
125             } // built-up cluster-size
126           } // existing neighbour
127         } // loop over neighbours
128       } // endif hit w/o strip
129     } // loop over planes
130   } // if AliMUONResponseTriggerV1
131 }
132
133
134
135
136
137