]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONChamberTrigger.cxx
AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
[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
16/*
17$Log$
d81db581 18Revision 1.4 2000/06/29 06:52:02 pcrochet
19pow changed to TMath::Power
20
39f5a0e6 21Revision 1.3 2000/06/28 15:16:35 morsch
22(1) Client code adapted to new method signatures in AliMUONSegmentation (see comments there)
23to allow development of slat-muon chamber simulation and reconstruction code in the MUON
24framework. The changes should have no side effects (mostly dummy arguments).
25(2) Hit disintegration uses 3-dim hit coordinates to allow simulation
26of chambers with overlapping modules (MakePadHits, Disintegration).
27
802a864d 28Revision 1.2 2000/06/15 07:58:48 morsch
29Code from MUON-dev joined
30
a9e2aefa 31Revision 1.1.2.3 2000/06/09 21:27:35 morsch
32Most coding rule violations corrected.
33
34Revision 1.1.2.2 2000/04/26 12:28:25 morsch
35- flag pad hits with condition on ToF (CP)
36- Tof included in the method DisIntegration (CP)
37
38Revision 1.1.2.1 2000/02/17 14:30:54 morsch
39Draft version
40
41*/
42
43#include "AliMUONChamberTrigger.h"
44#include "AliMUONSegmentationTrigger.h"
45#include "AliMUONResponseTrigger.h"
46#include <TObjArray.h>
47#include <TMath.h>
48#include <iostream.h>
49
50ClassImp(AliMUONChamberTrigger)
51
52//-------------------------------------------
d81db581 53
54 AliMUONChamberTrigger::AliMUONChamberTrigger()
55{
56// Default constructor
57}
58
59
60AliMUONChamberTrigger::AliMUONChamberTrigger(Int_t id) : AliMUONChamber(id)
a9e2aefa 61{
d81db581 62// Constructor using chamber id
a9e2aefa 63}
64
65//-------------------------------------------
66void AliMUONChamberTrigger::DisIntegration(Float_t eloss, Float_t tof,
802a864d 67 Float_t xhit, Float_t yhit, Float_t zhit,
a9e2aefa 68 Int_t& nnew,
69 Float_t newclust[6][500])
70{
71//
72// Generates pad hits (simulated cluster)
73// using the segmentation and the response model
74
75 Int_t twentyNano;
39f5a0e6 76 if (tof<75*TMath::Power(10,-9)) {
a9e2aefa 77 twentyNano=1;
78 } else {
79 twentyNano=100;
80 }
81
82 // cout << " time = " << tof << " , " << twentyNano << "\n";
83
84 Float_t qp;
85 nnew=0;
86 for (Int_t i=1; i<=fnsec; i++) {
87 AliMUONSegmentation * segmentation=
88 (AliMUONSegmentation*) (*fSegmentation)[i-1];
89
90// Find the module & strip Id. which has fired
91 Int_t ix,iy;
92
802a864d 93 segmentation->GetPadIxy(xhit,yhit,0,ix,iy);
a9e2aefa 94 segmentation->SetPad(ix,iy);
95
96// treatment of GEANT hits w/o corresponding strip (due to the fact that
97// the 2 geometries are computed in a very slightly different way)
98 if (ix==0&&iy==0) {
99 cout << " AliMUONChamberTrigger hit w/o strip " << xhit << " , " << yhit << "\n";
100 } else {
101 // --- store signal information for this strip
102 newclust[0][nnew]=1.; // total charge
103 newclust[1][nnew]=ix; // ix-position of pad
104 newclust[2][nnew]=iy; // iy-position of pad
105 newclust[3][nnew]=twentyNano; // time of flight
106 newclust[4][nnew]=segmentation->ISector(); // sector id
107 newclust[5][nnew]=(Float_t) i; // counter
108 nnew++;
109 // set hits
802a864d 110 segmentation->SetHit(xhit,yhit,zhit);
a9e2aefa 111 // get the list of nearest neighbours
112 Int_t nList, xList[2], yList[2];
113 segmentation->Neighbours(ix,iy,&nList,xList,yList);
114
115 for (Int_t j=0; j<nList; j++){
116
117 // neighbour real coordinates (just for checks here)
802a864d 118 Float_t x,y,z;
119 segmentation->GetPadCxy(xList[j],yList[j],x,y,z);
a9e2aefa 120 // set pad (fx fy & fix fiy are the current pad coord. & Id.)
121 segmentation->SetPad(xList[j],yList[j]);
122 // get the chamber (i.e. current strip) response
123 qp=fResponse->IntXY(segmentation);
124
125 if (qp > 0.5) {
126 // --- store signal information for neighbours
127 newclust[0][nnew]=qp; // total charge
128 newclust[1][nnew]=segmentation->Ix(); // ix-position of pad
129 newclust[2][nnew]=segmentation->Iy(); // iy-position of pad
130 newclust[3][nnew]=twentyNano; // time of flight
131 newclust[4][nnew]=segmentation->ISector(); // sector id
132 newclust[5][nnew]=(Float_t) i; // counter
133 nnew++;
134 } // qp > 0.5
135 } // loop on neighbour
136 } // endif hit w/o strip
137 } // loop over planes
138}
139
140
141
142
143
144
145
146