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