Code from MUON-dev joined
[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$
18Revision 1.1.2.3 2000/06/09 21:27:35 morsch
19Most coding rule violations corrected.
20
21Revision 1.1.2.2 2000/04/26 12:28:25 morsch
22- flag pad hits with condition on ToF (CP)
23- Tof included in the method DisIntegration (CP)
24
25Revision 1.1.2.1 2000/02/17 14:30:54 morsch
26Draft version
27
28*/
29
30#include "AliMUONChamberTrigger.h"
31#include "AliMUONSegmentationTrigger.h"
32#include "AliMUONResponseTrigger.h"
33#include <TObjArray.h>
34#include <TMath.h>
35#include <iostream.h>
36
37ClassImp(AliMUONChamberTrigger)
38
39//-------------------------------------------
40AliMUONChamberTrigger::AliMUONChamberTrigger() : AliMUONChamber()
41{
42// Default Constructor
43}
44
45//-------------------------------------------
46void AliMUONChamberTrigger::DisIntegration(Float_t eloss, Float_t tof,
47 Float_t xhit, Float_t yhit,
48 Int_t& nnew,
49 Float_t newclust[6][500])
50{
51//
52// Generates pad hits (simulated cluster)
53// using the segmentation and the response model
54
55 Int_t twentyNano;
56 if (tof<75*pow(10,-9)) {
57 twentyNano=1;
58 } else {
59 twentyNano=100;
60 }
61
62 // cout << " time = " << tof << " , " << twentyNano << "\n";
63
64 Float_t qp;
65 nnew=0;
66 for (Int_t i=1; i<=fnsec; i++) {
67 AliMUONSegmentation * segmentation=
68 (AliMUONSegmentation*) (*fSegmentation)[i-1];
69
70// Find the module & strip Id. which has fired
71 Int_t ix,iy;
72
73 segmentation->GetPadIxy(xhit,yhit,ix,iy);
74 segmentation->SetPad(ix,iy);
75
76// treatment of GEANT hits w/o corresponding strip (due to the fact that
77// the 2 geometries are computed in a very slightly different way)
78 if (ix==0&&iy==0) {
79 cout << " AliMUONChamberTrigger hit w/o strip " << xhit << " , " << yhit << "\n";
80 } else {
81 // --- store signal information for this strip
82 newclust[0][nnew]=1.; // total charge
83 newclust[1][nnew]=ix; // ix-position of pad
84 newclust[2][nnew]=iy; // iy-position of pad
85 newclust[3][nnew]=twentyNano; // time of flight
86 newclust[4][nnew]=segmentation->ISector(); // sector id
87 newclust[5][nnew]=(Float_t) i; // counter
88 nnew++;
89 // set hits
90 segmentation->SetHit(xhit,yhit);
91 // get the list of nearest neighbours
92 Int_t nList, xList[2], yList[2];
93 segmentation->Neighbours(ix,iy,&nList,xList,yList);
94
95 for (Int_t j=0; j<nList; j++){
96
97 // neighbour real coordinates (just for checks here)
98 Float_t x,y;
99 segmentation->GetPadCxy(xList[j],yList[j],x,y);
100 // set pad (fx fy & fix fiy are the current pad coord. & Id.)
101 segmentation->SetPad(xList[j],yList[j]);
102 // get the chamber (i.e. current strip) response
103 qp=fResponse->IntXY(segmentation);
104
105 if (qp > 0.5) {
106 // --- store signal information for neighbours
107 newclust[0][nnew]=qp; // total charge
108 newclust[1][nnew]=segmentation->Ix(); // ix-position of pad
109 newclust[2][nnew]=segmentation->Iy(); // iy-position of pad
110 newclust[3][nnew]=twentyNano; // time of flight
111 newclust[4][nnew]=segmentation->ISector(); // sector id
112 newclust[5][nnew]=(Float_t) i; // counter
113 nnew++;
114 } // qp > 0.5
115 } // loop on neighbour
116 } // endif hit w/o strip
117 } // loop over planes
118}
119
120
121
122
123
124
125
126