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