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