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 // --- MUON includes ---
19 #include "AliMUONChamber.h"
20 #include "AliMUONChamberGeometry.h"
22 // --- ROOT includes ---
27 ClassImp(AliMUONChamber)
29 AliMUONChamber::AliMUONChamber()
31 // Default constructor
39 // to avoid mistakes if ChargeCorrelInit is not called
43 AliMUONChamber::AliMUONChamber(Int_t id)
45 // Construtor with chamber id
46 fSegmentation = new TObjArray(2);
47 fSegmentation->AddAt(0,0);
48 fSegmentation->AddAt(0,1);
53 fGeometry = new AliMUONChamberGeometry(fId);
54 // to avoid mistakes if ChargeCorrelInit is not called
58 AliMUONChamber::~AliMUONChamber()
62 fSegmentation->Delete();
68 AliMUONChamber::AliMUONChamber(const AliMUONChamber& rChamber):TObject(rChamber)
70 // Dummy copy constructor
75 Bool_t AliMUONChamber::IsSensId(Int_t volId) const
77 // Returns true if the volume specified by volId is in the list
78 // of sesitive volumes for this chamber
80 return fGeometry->IsSensitiveVolume(volId);
83 void AliMUONChamber::Init()
87 // ... for chamber segmentation
88 //PH if ((*fSegmentation)[0])
89 //PH ((AliSegmentation *) (*fSegmentation)[0])->Init(fId);
90 if (fSegmentation->At(0))
91 ((AliSegmentation *) fSegmentation->At(0))->Init(fId);
94 //PH if ((*fSegmentation)[1])
95 //PH ((AliSegmentation *) (*fSegmentation)[1])->Init(fId);
96 if (fSegmentation->At(1))
97 ((AliSegmentation *) fSegmentation->At(1))->Init(fId);
101 Int_t AliMUONChamber::SigGenCond(Float_t x, Float_t y, Float_t z)
103 // Ask segmentation if signal should be generated
105 //PH return ((AliSegmentation*) (*fSegmentation)[0])
106 return ((AliSegmentation*) fSegmentation->At(0))
107 ->SigGenCond(x, y, z) ;
109 //PH return (((AliSegmentation*) (*fSegmentation)[0])
110 return (((AliSegmentation*) fSegmentation->At(0))
111 ->SigGenCond(x, y, z)) ||
112 //PH (((AliSegmentation*) (*fSegmentation)[1])
113 (((AliSegmentation*) fSegmentation->At(1))
114 ->SigGenCond(x, y, z)) ;
119 void AliMUONChamber::SigGenInit(Float_t x, Float_t y, Float_t z)
122 // Initialisation of segmentation for hit
125 //PH ((AliSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
126 ((AliSegmentation*) fSegmentation->At(0))->SigGenInit(x, y, z) ;
128 //PH ((AliSegmentation*) (*fSegmentation)[0])->SigGenInit(x, y, z) ;
129 //PH ((AliSegmentation*) (*fSegmentation)[1])->SigGenInit(x, y, z) ;
130 ((AliSegmentation*) fSegmentation->At(0))->SigGenInit(x, y, z) ;
131 ((AliSegmentation*) fSegmentation->At(1))->SigGenInit(x, y, z) ;
135 void AliMUONChamber::ChargeCorrelationInit() {
136 // Initialisation of charge correlation for current hit
137 // the value is stored, and then used by Disintegration
141 // exponential is here to avoid eventual problems in 0
142 // factor 2 because chargecorrel is q1/q2 and not q1/qtrue
143 fCurrentCorrel = TMath::Exp(gRandom->Gaus(0,fResponse->ChargeCorrel()/2));
146 void AliMUONChamber::DisIntegration(Float_t eloss, Float_t /*tof*/,
147 Float_t xhit, Float_t yhit, Float_t zhit,
148 Int_t& nnew,Float_t newclust[6][500])
151 // Generates pad hits (simulated cluster)
152 // using the segmentation and the response model
155 // Width of the integration area
157 dx=fResponse->SigmaIntegration()*fResponse->ChargeSpreadX();
158 dy=fResponse->SigmaIntegration()*fResponse->ChargeSpreadY();
160 // Get pulse height from energy loss
161 Float_t qtot = fResponse->IntPH(eloss);
165 Float_t qcheck=0, qp;
168 // Cathode plane loop
169 for (Int_t i=1; i<=fnsec; i++) {
171 Float_t qcath = qtot * (i==1? fCurrentCorrel : 1/fCurrentCorrel);
172 AliSegmentation * segmentation=
173 //PH (AliSegmentation *) (*fSegmentation)[i-1];
174 (AliSegmentation *) fSegmentation->At(i-1);
175 for (segmentation->FirstPad(xhit, yhit, zhit, dx, dy);
176 segmentation->MorePads();
177 segmentation->NextPad())
179 qp=fResponse->IntXY(segmentation);
186 // --- store signal information
187 newclust[0][nnew]=qcath; // total charge
188 newclust[1][nnew]=segmentation->Ix(); // ix-position of pad
189 newclust[2][nnew]=segmentation->Iy(); // iy-position of pad
190 newclust[3][nnew]=qp * qcath; // charge on pad
191 newclust[4][nnew]=segmentation->ISector(); // sector id
192 newclust[5][nnew]=(Float_t) i; // counter
194 // if (i==2) printf("\n i, nnew, q %d %d %f", i, nnew, qp*qcath);
199 } // Cathode plane loop
204 void AliMUONChamber::InitGeo(Float_t /*zpos*/)
208 // 3% radiation length of aluminum (X0=8.9 cm)
213 AliMUONChamber & AliMUONChamber::operator =(const AliMUONChamber& /*rhs*/)
215 // Dummy assignment operator