1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 // -----------------------
19 // Class AliMUONChamber
20 // -----------------------
21 // MUON tracking chamber class
22 // now only providing DisIntegration function
24 // --- ROOT includes ---
30 // --- MUON includes ---
32 #include "AliMUONChamber.h"
33 #include "AliMUONSegmentation.h"
34 #include "AliMUONHit.h"
37 ClassImp(AliMUONChamber)
39 AliMUONChamber::AliMUONChamber()
42 fCurrentCorrel(1), // to avoid mistakes if ChargeCorrelInit is not called
46 /// Default constructor
48 AliDebug(1, Form("default (empty) ctor this = %p", this));
51 //_______________________________________________________
52 AliMUONChamber::AliMUONChamber(Int_t id)
55 fCurrentCorrel(1), // to avoid mistakes if ChargeCorrelInit is not called
59 /// Standard constructor
62 fMUON = (AliMUON*)gAlice->GetModule("MUON");
64 AliFatal("MUON detector not defined.");
68 AliDebug(1, Form("ctor this = %p", this) );
71 //_______________________________________________________
72 AliMUONChamber::AliMUONChamber(const AliMUONChamber& rChamber)
75 /// Protected copy constructor
77 AliFatal("Not implemented.");
78 // Dummy copy constructor
81 //_______________________________________________________
82 AliMUONChamber::~AliMUONChamber()
86 AliDebug(1, Form("dtor this = %p", this));
89 //_______________________________________________________
90 AliMUONChamber & AliMUONChamber::operator =(const AliMUONChamber& rhs)
92 /// Protected assignement operator
94 if (this == &rhs) return *this;
96 AliFatal("Not implemented.");
101 //_____________________________________________________
102 void AliMUONChamber::ChargeCorrelationInit()
104 /// Initialisation of charge correlation for current hit
105 /// the value is stored, and then used by Disintegration
107 // exponential is here to avoid eventual problems in 0
108 // factor 2 because chargecorrel is q1/q2 and not q1/qtrue
109 fCurrentCorrel = TMath::Exp(gRandom->Gaus(0,fResponse->ChargeCorrel()/2));
112 //_______________________________________________________
113 void AliMUONChamber::DisIntegration(AliMUONHit *hit,
114 Int_t& nnew,Float_t newclust[6][500])
116 /// Generates pad hits (simulated cluster)
117 /// using the segmentation and the response model
121 Float_t xhit = hit->X();
122 Float_t yhit = hit->Y();
123 Float_t zhit = hit->Z();
124 Int_t id = hit->DetElemId();
125 Float_t eloss = hit->Eloss();
128 // Width of the integration area
130 dx=fResponse->SigmaIntegration()*fResponse->ChargeSpreadX();
131 dy=fResponse->SigmaIntegration()*fResponse->ChargeSpreadY();
133 // Get pulse height from energy loss
134 Float_t qtot = fResponse->IntPH(eloss);
141 // Cathode plane loop
142 for (Int_t i = 1; i <= 2; i++) {
143 Float_t qcath = qtot * (i==1? fCurrentCorrel : 1/fCurrentCorrel);
145 AliMUONGeometrySegmentation* segmentation=
146 fMUON->GetSegmentation()->GetModuleSegmentation(fId, i-1);
148 for (segmentation->FirstPad(id, xhit, yhit, zhit, dx, dy);
149 segmentation->MorePads(id);
150 segmentation->NextPad(id))
152 qp=fResponse->IntXY(id, segmentation);
158 if (nnew >= 500) // Perform a bounds check on nnew since it is assumed
159 // newclust only contains 500 elements.
161 AliError("Limit of 500 pad responses reached.");
165 // --- store signal information
166 newclust[0][nnew]=qcath; // total charge
167 newclust[1][nnew]=segmentation->Ix(); // ix-position of pad
168 newclust[2][nnew]=segmentation->Iy(); // iy-position of pad
169 newclust[3][nnew]=qp * qcath; // charge on pad
170 newclust[4][nnew]=segmentation->ISector(); // sector id
171 newclust[5][nnew]=(Float_t) i; // counter
176 } // Cathode plane loop