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 // --- ROOT includes ---
24 // --- MUON includes ---
26 #include "AliMUONChamber.h"
27 #include "AliMUONSegmentation.h"
28 #include "AliMUONHit.h"
31 ClassImp(AliMUONChamber)
33 AliMUONChamber::AliMUONChamber()
36 fCurrentCorrel(1), // to avoid mistakes if ChargeCorrelInit is not called
40 // Default constructor
42 AliDebug(1, Form("default (empty) ctor this = %p", this));
45 //_______________________________________________________
46 AliMUONChamber::AliMUONChamber(Int_t id)
49 fCurrentCorrel(1), // to avoid mistakes if ChargeCorrelInit is not called
55 fMUON = (AliMUON*)gAlice->GetModule("MUON");
57 AliFatal("MUON detector not defined.");
61 AliDebug(1, Form("ctor this = %p", this) );
64 //_______________________________________________________
65 AliMUONChamber::AliMUONChamber(const AliMUONChamber& rChamber)
68 // Protected copy constructor
70 AliFatal("Not implemented.");
71 // Dummy copy constructor
74 //_______________________________________________________
75 AliMUONChamber::~AliMUONChamber()
79 AliDebug(1, Form("dtor this = %p", this));
82 //_______________________________________________________
83 AliMUONChamber & AliMUONChamber::operator =(const AliMUONChamber& rhs)
85 // Protected assignement operator
87 if (this == &rhs) return *this;
89 AliFatal("Not implemented.");
94 //_____________________________________________________
95 void AliMUONChamber::ChargeCorrelationInit() {
96 // Initialisation of charge correlation for current hit
97 // the value is stored, and then used by Disintegration
99 // exponential is here to avoid eventual problems in 0
100 // factor 2 because chargecorrel is q1/q2 and not q1/qtrue
101 fCurrentCorrel = TMath::Exp(gRandom->Gaus(0,fResponse->ChargeCorrel()/2));
104 //_______________________________________________________
105 void AliMUONChamber::DisIntegration(AliMUONHit *hit,
106 Int_t& nnew,Float_t newclust[6][500])
109 // Generates pad hits (simulated cluster)
110 // using the segmentation and the response model
113 Float_t xhit = hit->X();
114 Float_t yhit = hit->Y();
115 Float_t zhit = hit->Z();
116 Int_t id = hit->DetElemId();
117 Float_t eloss = hit->Eloss();
120 // Width of the integration area
122 dx=fResponse->SigmaIntegration()*fResponse->ChargeSpreadX();
123 dy=fResponse->SigmaIntegration()*fResponse->ChargeSpreadY();
125 // Get pulse height from energy loss
126 Float_t qtot = fResponse->IntPH(eloss);
133 // Cathode plane loop
134 for (Int_t i = 1; i <= 2; i++) {
135 Float_t qcath = qtot * (i==1? fCurrentCorrel : 1/fCurrentCorrel);
137 AliMUONGeometrySegmentation* segmentation=
138 fMUON->GetSegmentation()->GetModuleSegmentation(fId, i-1);
140 for (segmentation->FirstPad(id, xhit, yhit, zhit, dx, dy);
141 segmentation->MorePads(id);
142 segmentation->NextPad(id))
144 qp=fResponse->IntXY(id, segmentation);
150 if (nnew >= 500) // Perform a bounds check on nnew since it is assumed
151 // newclust only contains 500 elements.
153 AliError("Limit of 500 pad responses reached.");
157 // --- store signal information
158 newclust[0][nnew]=qcath; // total charge
159 newclust[1][nnew]=segmentation->Ix(); // ix-position of pad
160 newclust[2][nnew]=segmentation->Iy(); // iy-position of pad
161 newclust[3][nnew]=qp * qcath; // charge on pad
162 newclust[4][nnew]=segmentation->ISector(); // sector id
163 newclust[5][nnew]=(Float_t) i; // counter
168 } // Cathode plane loop