]>
Commit | Line | Data |
---|---|---|
4c039060 | 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 | **************************************************************************/ | |
4c039060 | 15 | |
88cb7938 | 16 | /* $Id$ */ |
17 | ||
a9e2aefa | 18 | |
19 | /////////////////////////////////////////////// | |
fe4da5cc | 20 | // Manager and hits classes for set:MUON // |
21 | //////////////////////////////////////////////// | |
22 | ||
88cb7938 | 23 | #include "Riostream.h" |
24 | ||
25 | #include <AliPDG.h> | |
a897a37a | 26 | #include <TBRIK.h> |
88cb7938 | 27 | #include <TCanvas.h> |
28 | #include <TDirectory.h> | |
29 | #include <TFile.h> | |
94de3818 | 30 | #include <TGeometry.h> |
88cb7938 | 31 | #include <TMinuit.h> |
fe4da5cc | 32 | #include <TNode.h> |
88cb7938 | 33 | #include <TNtuple.h> |
fe4da5cc | 34 | #include <TObjArray.h> |
88cb7938 | 35 | #include <TObject.h> |
36 | #include <TObjectTable.h> | |
37 | #include <TPad.h> | |
a897a37a | 38 | #include <TParticle.h> |
39 | #include <TROOT.h> | |
88cb7938 | 40 | #include <TRandom.h> |
41 | #include <TRotMatrix.h> | |
42 | #include <TTUBE.h> | |
a9e2aefa | 43 | #include <TTUBE.h> |
88cb7938 | 44 | #include <TTree.h> |
45 | #include <TVector.h> | |
46 | #include <TVirtualMC.h> | |
fe4da5cc | 47 | |
d4bb94a1 | 48 | //#include "AliHeader.h" |
88cb7938 | 49 | #include "AliLoader.h" |
dbb4e169 | 50 | #include "AliRunDigitizer.h" |
307d9d04 | 51 | #include "AliMC.h" |
fac3a970 | 52 | #include "AliRun.h" |
fe4da5cc | 53 | #include "AliMUON.h" |
88cb7938 | 54 | #include "AliMUONChamberTrigger.h" |
88cb7938 | 55 | #include "AliMUONConstants.h" |
ffd9faa2 | 56 | #include "AliMUONHit.h" |
a9e2aefa | 57 | #include "AliMUONRawCluster.h" |
88cb7938 | 58 | #include "AliMUONTransientDigit.h" |
ecfa008b | 59 | #include "AliMUONTriggerCircuit.h" |
504d0837 | 60 | #include "AliMUONGeometry.h" |
61 | #include "AliMUONGeometryTransformer.h" | |
d4bb94a1 | 62 | #include "AliMUONGeometryBuilder.h" |
e118b27e | 63 | #include "AliMUONCommonGeometryBuilder.h" |
d1cd2474 | 64 | #include "AliMUONVGeometryBuilder.h" |
a713db22 | 65 | #include "AliMUONGeometrySegmentation.h" |
dbb4e169 | 66 | #include "AliMUONDigitizerv2.h" |
d1775029 | 67 | #include "AliMUONSDigitizerv1.h" |
a19e2543 | 68 | #include "AliMUONRawWriter.h" |
504d0837 | 69 | #include "AliMUONSegmentation.h" |
8c343c7c | 70 | #include "AliLog.h" |
a9e2aefa | 71 | |
68585390 | 72 | #include "AliMUONSDigitizerV2.h" |
73 | #include "AliMUONDigitizerV3.h" | |
74 | ||
d5609cfc | 75 | #include "AliMUONSt1GeometryBuilderV2.h" |
76 | #include "AliMUONSt2GeometryBuilderV2.h" | |
77 | #include "AliMUONSlatGeometryBuilder.h" | |
78 | #include "AliMUONTriggerGeometryBuilder.h" | |
79 | ||
a9e2aefa | 80 | // Defaults parameters for Z positions of chambers |
81 | // taken from values for "stations" in AliMUON::AliMUON | |
82 | // const Float_t zch[7]={528, 690., 975., 1249., 1449., 1610, 1710.}; | |
83 | // and from array "dstation" in AliMUONv1::CreateGeometry | |
84 | // Float_t dstation[5]={20., 20., 20, 20., 20.}; | |
85 | // for tracking chambers, | |
86 | // according to (Z1 = zch - dstation) and (Z2 = zch + dstation) | |
87 | // for the first and second chambers in the station, respectively, | |
88 | // and from "DTPLANES" in AliMUONv1::CreateGeometry | |
89 | // const Float_t DTPLANES = 15.; | |
90 | // for trigger chambers, | |
91 | // according to (Z1 = zch) and (Z2 = zch + DTPLANES) | |
92 | // for the first and second chambers in the station, respectively | |
fe4da5cc | 93 | |
fe4da5cc | 94 | ClassImp(AliMUON) |
30178c30 | 95 | |
ce3f5e87 | 96 | //__________________________________________________________________ |
fe4da5cc | 97 | AliMUON::AliMUON() |
30178c30 | 98 | : AliDetector(), |
99 | fNCh(0), | |
100 | fNTrackingCh(0), | |
101 | fMUONData(0), | |
102 | fSplitLevel(0), | |
103 | fChambers(0), | |
30178c30 | 104 | fTriggerCircuits(0), |
d4bb94a1 | 105 | fGeometryBuilder(0), |
504d0837 | 106 | fSegmentation(0), |
30178c30 | 107 | fAccCut(kFALSE), |
108 | fAccMin(0.), | |
109 | fAccMax(0.), | |
110 | fMaxStepGas(0.), | |
111 | fMaxStepAlu(0.), | |
112 | fMaxDestepGas(0.), | |
113 | fMaxDestepAlu(0.), | |
114 | fMaxIterPad(0), | |
ced309a5 | 115 | fCurIterPad(0), |
68585390 | 116 | fTriggerScalerEvent(kFALSE), |
117 | fSDigitizerType(""), | |
d5609cfc | 118 | fDigitizerType(""), |
119 | fRawWriter(0x0) | |
fe4da5cc | 120 | { |
de05461e | 121 | // Default Constructor |
122 | // | |
edee5e63 | 123 | AliDebug(1,Form("default (empty) ctor this=%p",this)); |
1bd26093 | 124 | fIshunt = 0; |
fe4da5cc | 125 | } |
30178c30 | 126 | |
ce3f5e87 | 127 | //__________________________________________________________________ |
68585390 | 128 | AliMUON::AliMUON(const char *name, const char *title, |
129 | const char* sDigitizerClassName, | |
130 | const char* digitizerClassName) | |
30178c30 | 131 | : AliDetector(name,title), |
132 | fNCh(AliMUONConstants::NCh()), | |
133 | fNTrackingCh(AliMUONConstants::NTrackingCh()), | |
134 | fMUONData(0), | |
135 | fSplitLevel(0), | |
136 | fChambers(0), | |
30178c30 | 137 | fTriggerCircuits(0), |
d4bb94a1 | 138 | fGeometryBuilder(0), |
504d0837 | 139 | fSegmentation(0), |
30178c30 | 140 | fAccCut(kFALSE), |
141 | fAccMin(0.), | |
142 | fAccMax(0.), | |
143 | fMaxStepGas(0.1), | |
144 | fMaxStepAlu(0.1), | |
145 | fMaxDestepGas(-1), // Negatives values are ignored by geant3 CONS200 | |
146 | fMaxDestepAlu(-1), // in the calculation of the tracking parameters | |
147 | fMaxIterPad(0), | |
ced309a5 | 148 | fCurIterPad(0), |
68585390 | 149 | fTriggerScalerEvent(kFALSE), |
150 | fSDigitizerType(sDigitizerClassName), | |
d5609cfc | 151 | fDigitizerType(digitizerClassName), |
152 | fRawWriter(0x0) | |
fe4da5cc | 153 | { |
edee5e63 | 154 | AliDebug(1,Form("ctor this=%p",this)); |
30178c30 | 155 | fIshunt = 0; |
a897a37a | 156 | |
ce3f5e87 | 157 | SetMarkerColor(kRed);// |
e118b27e | 158 | |
159 | // Geometry builder | |
160 | fGeometryBuilder = new AliMUONGeometryBuilder(this); | |
161 | ||
162 | // Common geometry definitions | |
163 | fGeometryBuilder | |
164 | ->AddBuilder(new AliMUONCommonGeometryBuilder(this)); | |
165 | ||
d5609cfc | 166 | // By default, add also all the needed geometry builders. |
167 | // If you want to change this from outside, please use ResetGeometryBuilder | |
168 | // method, followed by AddGeometryBuilder ones. | |
169 | ||
170 | AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(this)); | |
171 | AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(this)); | |
172 | AddGeometryBuilder(new AliMUONSlatGeometryBuilder(this)); | |
173 | AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(this)); | |
174 | ||
175 | // | |
176 | // Creating List of Chambers | |
a9e2aefa | 177 | Int_t ch; |
f665c1ea | 178 | fChambers = new TObjArray(AliMUONConstants::NCh()); |
d1cd2474 | 179 | |
a9e2aefa | 180 | // Loop over stations |
f665c1ea | 181 | for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) { |
a9e2aefa | 182 | // Loop over 2 chambers in the station |
ce3f5e87 | 183 | for (Int_t stCH = 0; stCH < 2; stCH++) { |
184 | // | |
185 | // | |
186 | // Default Parameters for Muon Tracking Stations | |
187 | ch = 2 * st + stCH; | |
188 | if (ch < AliMUONConstants::NTrackingCh()) { | |
189 | fChambers->AddAt(new AliMUONChamber(ch),ch); | |
190 | } else { | |
504d0837 | 191 | fChambers->AddAt(new AliMUONChamberTrigger(ch, GetGeometryTransformer()),ch); |
ce3f5e87 | 192 | } |
ce3f5e87 | 193 | } // Chamber stCH (0, 1) in |
a9e2aefa | 194 | } // Station st (0...) |
ce3f5e87 | 195 | |
ce3f5e87 | 196 | // cp new design of AliMUONTriggerDecision |
197 | fTriggerCircuits = new TObjArray(AliMUONConstants::NTriggerCircuit()); | |
198 | for (Int_t circ=0; circ<AliMUONConstants::NTriggerCircuit(); circ++) { | |
199 | fTriggerCircuits->AddAt(new AliMUONTriggerCircuit(),circ); | |
200 | } | |
fe4da5cc | 201 | } |
30178c30 | 202 | |
ce3f5e87 | 203 | //____________________________________________________________________ |
30178c30 | 204 | AliMUON::AliMUON(const AliMUON& rMUON) |
205 | : AliDetector(rMUON) | |
a9e2aefa | 206 | { |
30178c30 | 207 | // Protected copy constructor |
208 | ||
8c343c7c | 209 | AliFatal("Not implemented."); |
a9e2aefa | 210 | } |
30178c30 | 211 | |
ce3f5e87 | 212 | //____________________________________________________________________ |
fe4da5cc | 213 | AliMUON::~AliMUON() |
214 | { | |
de05461e | 215 | // Destructor |
edee5e63 | 216 | AliDebug(1,Form("dtor this=%p",this)); |
ce3f5e87 | 217 | fIshunt = 0; |
d1cd2474 | 218 | |
c6df4ef2 | 219 | if (fChambers){ |
220 | fChambers->Delete(); | |
221 | delete fChambers; | |
222 | } | |
223 | if (fTriggerCircuits){ | |
224 | fTriggerCircuits->Delete(); | |
225 | delete fTriggerCircuits; | |
226 | } | |
227 | delete fMUONData; | |
d4bb94a1 | 228 | delete fGeometryBuilder; |
504d0837 | 229 | delete fSegmentation; |
d5609cfc | 230 | delete fRawWriter; |
d1cd2474 | 231 | } |
30178c30 | 232 | |
233 | //________________________________________________________________________ | |
234 | AliMUON& AliMUON::operator = (const AliMUON& rhs) | |
235 | { | |
236 | // Protected assignement operator | |
237 | ||
238 | if (this == &rhs) return *this; | |
239 | ||
8c343c7c | 240 | AliFatal("Not implemented."); |
30178c30 | 241 | |
242 | return *this; | |
243 | } | |
244 | ||
d1cd2474 | 245 | //_____________________________________________________________________________ |
246 | void AliMUON::AddGeometryBuilder(AliMUONVGeometryBuilder* geomBuilder) | |
247 | { | |
248 | // Adds the geometry builder to the list | |
249 | // --- | |
250 | ||
d4bb94a1 | 251 | fGeometryBuilder->AddBuilder(geomBuilder); |
a897a37a | 252 | } |
c9d10ab5 | 253 | |
ce3f5e87 | 254 | //____________________________________________________________________ |
fe4da5cc | 255 | void AliMUON::BuildGeometry() |
256 | { | |
de05461e | 257 | // Geometry for event display |
c9d10ab5 | 258 | |
002920d1 | 259 | |
ae89d471 | 260 | // for (Int_t i = 0; i < AliMUONConstants::NCh(); i++) |
261 | // this->Chamber(i).SegmentationModel2(1)->Draw("eventdisplay");// to be check ! | |
262 | ||
002920d1 | 263 | |
fe4da5cc | 264 | } |
c9d10ab5 | 265 | |
504d0837 | 266 | //____________________________________________________________________ |
267 | const AliMUONGeometry* AliMUON::GetGeometry() const | |
268 | { | |
269 | // Return geometry parametrisation | |
270 | ||
271 | if ( !fGeometryBuilder) { | |
272 | AliWarningStream() << "GeometryBuilder not defined." << std::endl; | |
273 | return 0; | |
274 | } | |
275 | ||
276 | return fGeometryBuilder->GetGeometry(); | |
277 | } | |
278 | ||
279 | //____________________________________________________________________ | |
280 | const AliMUONGeometryTransformer* AliMUON::GetGeometryTransformer() const | |
281 | { | |
282 | // Return geometry parametrisation | |
283 | ||
284 | const AliMUONGeometry* kGeometry = GetGeometry(); | |
285 | ||
286 | if ( !kGeometry) return 0; | |
287 | ||
288 | return kGeometry->GetTransformer(); | |
289 | } | |
290 | ||
ce3f5e87 | 291 | //__________________________________________________________________ |
292 | void AliMUON::SetTreeAddress() | |
a897a37a | 293 | { |
ce3f5e87 | 294 | GetMUONData()->SetLoader(fLoader); |
d1775029 | 295 | // GetMUONData()->MakeBranch("D,S,RC"); |
296 | // GetMUONData()->SetTreeAddress("H,D,S,RC"); | |
52c9bc11 | 297 | GetMUONData()->SetTreeAddress("H"); |
307d9d04 | 298 | if (fHits != GetMUONData()->Hits()) { |
ae31c826 | 299 | if ( gAlice->GetMCApp() ) |
6d2f7cbd | 300 | if ( gAlice->GetMCApp()->GetHitLists() ) { |
301 | fHits = GetMUONData()->Hits(); | |
302 | gAlice->GetMCApp()->AddHitList(fHits); // For purifyKine, only necessary when Hit list is created in AliMUONData | |
303 | } | |
307d9d04 | 304 | } |
6d2f7cbd | 305 | fHits = GetMUONData()->Hits(); // Added by Ivana to use the methods FisrtHit, NextHit of AliDetector |
a9e2aefa | 306 | } |
307 | ||
ce3f5e87 | 308 | //_________________________________________________________________ |
a897a37a | 309 | void AliMUON::SetChargeSlope(Int_t id, Float_t p1) |
fe4da5cc | 310 | { |
de05461e | 311 | // Set the inverse charge slope for chamber id |
ce3f5e87 | 312 | Int_t i=2*(id-1); //PH ((AliMUONChamber*) (*fChambers)[i])->SetSigmaIntegration(p1); |
313 | //PH ((AliMUONChamber*) (*fChambers)[i+1])->SetSigmaIntegration(p1); | |
2682e810 | 314 | ((AliMUONChamber*) fChambers->At(i))->SetChargeSlope(p1); |
315 | ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSlope(p1); | |
fe4da5cc | 316 | } |
ce3f5e87 | 317 | //__________________________________________________________________ |
a897a37a | 318 | void AliMUON::SetChargeSpread(Int_t id, Float_t p1, Float_t p2) |
fe4da5cc | 319 | { |
de05461e | 320 | // Set sigma of charge spread for chamber id |
fe4da5cc | 321 | Int_t i=2*(id-1); |
2682e810 | 322 | ((AliMUONChamber*) fChambers->At(i))->SetChargeSpread(p1,p2); |
323 | ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSpread(p1,p2); | |
fe4da5cc | 324 | } |
ce3f5e87 | 325 | //___________________________________________________________________ |
a897a37a | 326 | void AliMUON::SetSigmaIntegration(Int_t id, Float_t p1) |
fe4da5cc | 327 | { |
de05461e | 328 | // Set integration limits for charge spread |
fe4da5cc | 329 | Int_t i=2*(id-1); |
2682e810 | 330 | ((AliMUONChamber*) fChambers->At(i))->SetSigmaIntegration(p1); |
331 | ((AliMUONChamber*) fChambers->At(i+1))->SetSigmaIntegration(p1); | |
fe4da5cc | 332 | } |
333 | ||
ce3f5e87 | 334 | //__________________________________________________________________ |
d09fafb0 | 335 | void AliMUON::SetMaxAdc(Int_t id, Int_t p1) |
fe4da5cc | 336 | { |
de05461e | 337 | // Set maximum number for ADCcounts (saturation) |
fe4da5cc | 338 | Int_t i=2*(id-1); |
2682e810 | 339 | ((AliMUONChamber*) fChambers->At(i))->SetMaxAdc(p1); |
340 | ((AliMUONChamber*) fChambers->At(i+1))->SetMaxAdc(p1); | |
fe4da5cc | 341 | } |
d4bb94a1 | 342 | |
ce3f5e87 | 343 | //__________________________________________________________________ |
a897a37a | 344 | void AliMUON::SetMaxStepGas(Float_t p1) |
fe4da5cc | 345 | { |
de05461e | 346 | // Set stepsize in gas |
ce3f5e87 | 347 | fMaxStepGas=p1; |
fe4da5cc | 348 | } |
ce3f5e87 | 349 | //__________________________________________________________________ |
a897a37a | 350 | void AliMUON::SetMaxStepAlu(Float_t p1) |
fe4da5cc | 351 | { |
de05461e | 352 | // Set step size in Alu |
fe4da5cc | 353 | fMaxStepAlu=p1; |
354 | } | |
ce3f5e87 | 355 | //__________________________________________________________________ |
a897a37a | 356 | void AliMUON::SetMaxDestepGas(Float_t p1) |
fe4da5cc | 357 | { |
de05461e | 358 | // Set maximum step size in Gas |
fe4da5cc | 359 | fMaxDestepGas=p1; |
360 | } | |
ce3f5e87 | 361 | //__________________________________________________________________ |
a897a37a | 362 | void AliMUON::SetMaxDestepAlu(Float_t p1) |
fe4da5cc | 363 | { |
de05461e | 364 | // Set maximum step size in Alu |
ce3f5e87 | 365 | fMaxDestepAlu=p1; |
fe4da5cc | 366 | } |
d4bb94a1 | 367 | |
d1cd2474 | 368 | //____________________________________________________________________ |
369 | Float_t AliMUON::GetMaxStepGas() const | |
370 | { | |
371 | // Return stepsize in gas | |
372 | ||
373 | return fMaxStepGas; | |
374 | } | |
375 | ||
376 | //____________________________________________________________________ | |
377 | Float_t AliMUON::GetMaxStepAlu() const | |
378 | { | |
379 | // Return step size in Alu | |
380 | ||
381 | return fMaxStepAlu; | |
382 | } | |
383 | ||
384 | //____________________________________________________________________ | |
385 | Float_t AliMUON::GetMaxDestepGas() const | |
386 | { | |
387 | // Return maximum step size in Gas | |
388 | ||
389 | return fMaxDestepGas; | |
390 | } | |
391 | ||
392 | //____________________________________________________________________ | |
393 | Float_t AliMUON::GetMaxDestepAlu() const | |
394 | { | |
395 | // Return maximum step size in Gas | |
396 | ||
397 | return fMaxDestepAlu; | |
398 | } | |
d4bb94a1 | 399 | |
883746f3 | 400 | //____________________________________________________________________ |
401 | void AliMUON::SetAlign(Bool_t align) | |
a713db22 | 402 | { |
883746f3 | 403 | // Sets option for alignement to geometry builder |
404 | ||
405 | fGeometryBuilder->SetAlign(align); | |
406 | } | |
fe4da5cc | 407 | |
82d1ac0a | 408 | //____________________________________________________________________ |
409 | void AliMUON::SetAlign(const TString& fileName, Bool_t align) | |
410 | { | |
411 | // Sets option for alignement to geometry builder | |
412 | ||
413 | fGeometryBuilder->SetAlign(fileName, align); | |
414 | } | |
415 | ||
ce3f5e87 | 416 | //____________________________________________________________________ |
a9e2aefa | 417 | void AliMUON::SetResponseModel(Int_t id, AliMUONResponse *response) |
fe4da5cc | 418 | { |
de05461e | 419 | // Set the response for chamber id |
2682e810 | 420 | ((AliMUONChamber*) fChambers->At(id))->SetResponseModel(response); |
fe4da5cc | 421 | } |
ce3f5e87 | 422 | //____________________________________________________________________ |
c92eb8ad | 423 | AliDigitizer* AliMUON::CreateDigitizer(AliRunDigitizer* manager) const |
85a5290f | 424 | { |
68585390 | 425 | // FIXME: the selection of the class should be done through a factory |
426 | // mechanism. (see also Hits2SDigits()). | |
427 | ||
428 | AliInfo(Form("Digitizer used : %s",fDigitizerType.Data())); | |
429 | ||
430 | if ( fDigitizerType == "digitizer:default" ) | |
431 | { | |
432 | return new AliMUONDigitizerv2(manager); | |
433 | } | |
434 | else if ( fDigitizerType == "digitizer:NewDigitizerNewTrigger" ) | |
435 | { | |
436 | return new AliMUONDigitizerV3(manager,AliMUONDigitizerV3::kTriggerElectronics); | |
437 | } | |
438 | else if ( fDigitizerType == "digitizer:NewDigitizerOldTrigger" ) | |
439 | { | |
4142b82d | 440 | return new AliMUONDigitizerV3(manager,AliMUONDigitizerV3::kTriggerDecision, kFALSE, kFALSE); |
68585390 | 441 | } |
4142b82d | 442 | else if ( fDigitizerType == "digitizer:NewDigitizerEffTrigger" ) |
443 | { | |
444 | return new AliMUONDigitizerV3(manager,AliMUONDigitizerV3::kTriggerDecision, kTRUE, kFALSE); | |
445 | } | |
446 | else if ( fDigitizerType == "digitizer:NewDigitizerWithNoiseOldTrigger" ) | |
447 | { | |
448 | return new AliMUONDigitizerV3(manager,AliMUONDigitizerV3::kTriggerDecision, kFALSE, kTRUE); | |
449 | } | |
68585390 | 450 | else |
451 | { | |
452 | AliFatal(Form("Unknown digitizer type : %s",fDigitizerType.Data())); | |
453 | } | |
454 | return 0x0; | |
455 | } | |
456 | ||
457 | //_____________________________________________________________________ | |
458 | TString | |
459 | AliMUON::SDigitizerType() const | |
460 | { | |
461 | return fSDigitizerType; | |
85a5290f | 462 | } |
68585390 | 463 | |
ce3f5e87 | 464 | //_____________________________________________________________________ |
2ab0c725 | 465 | void AliMUON::SDigits2Digits() |
466 | { | |
d963c261 | 467 | |
468 | // write TreeD here | |
469 | ||
d963c261 | 470 | char hname[30]; |
88cb7938 | 471 | // sprintf(hname,"TreeD%d",fLoader->GetHeader()->GetEvent()); |
472 | fLoader->TreeD()->Write(hname,TObject::kOverwrite); | |
473 | fLoader->TreeD()->Reset(); | |
2ab0c725 | 474 | } |
a9e2aefa | 475 | |
d1775029 | 476 | //_____________________________________________________________________ |
477 | void AliMUON::Hits2SDigits() | |
478 | { | |
68585390 | 479 | // FIXME: the selection of the sdigitizer should be done through a |
480 | // factory mechanism. | |
481 | ||
482 | AliInfo(Form("SDigitizer used : %s",fSDigitizerType.Data())); | |
483 | ||
484 | if ( fSDigitizerType == "sdigitizer:default" ) | |
485 | { | |
486 | // Adaption of AliMUONSDigitizerv1 to be excuted by the AliSimulation framework | |
487 | AliRunLoader* runLoader = fLoader->GetRunLoader(); | |
488 | AliRunDigitizer * manager = new AliRunDigitizer(1,1); | |
489 | manager->SetInputStream(0,runLoader->GetFileName(),AliConfig::GetDefaultEventFolderName()); | |
490 | AliMUONDigitizer * dMUON = new AliMUONSDigitizerv1(manager); | |
491 | fLoader->LoadHits("READ"); | |
492 | for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++) { | |
493 | runLoader->GetEvent(iEvent); | |
494 | dMUON->Exec(""); | |
495 | } | |
496 | fLoader->UnloadHits(); | |
497 | } | |
498 | else if ( fSDigitizerType == "sdigitizer:AliMUONSDigitizerV2" ) | |
499 | { | |
500 | TTask* sdigitizer = new AliMUONSDigitizerV2; | |
501 | sdigitizer->ExecuteTask(); | |
dbb4e169 | 502 | } |
68585390 | 503 | else |
504 | { | |
505 | AliFatal(Form("Unknown sdigitizer classname : %s",fSDigitizerType.Data())); | |
506 | } | |
507 | } | |
508 | ||
509 | //_____________________________________________________________________ | |
510 | TString | |
511 | AliMUON::DigitizerType() const | |
512 | { | |
513 | return fDigitizerType; | |
d1775029 | 514 | } |
68585390 | 515 | |
39e39255 | 516 | //_____________________________________________________________________ |
517 | void AliMUON::Digits2Raw() | |
518 | { | |
519 | // convert digits of the current event to raw data | |
d5609cfc | 520 | if (!fRawWriter) |
521 | { | |
522 | fRawWriter = new AliMUONRawWriter(fMUONData); | |
523 | if (fTriggerScalerEvent == kTRUE) | |
524 | { | |
525 | fRawWriter->SetScalerEvent(); | |
526 | } | |
527 | } | |
528 | ||
529 | if (!fRawWriter->Digits2Raw()) | |
530 | { | |
531 | AliError("pb writting raw data"); | |
532 | } | |
39e39255 | 533 | } |
68585390 | 534 | |
ce3f5e87 | 535 | //_______________________________________________________________________ |
3fa6cfdd | 536 | AliLoader* AliMUON::MakeLoader(const char* topfoldername) |
537 | { | |
538 | //builds standard getter (AliLoader type) | |
539 | //if detector wants to use castomized getter, it must overload this method | |
540 | ||
8c343c7c | 541 | |
542 | AliDebug(1,Form("Creating standard getter for detector %s. Top folder is %s.", | |
543 | GetName(),topfoldername)); | |
128843d9 | 544 | fLoader = new AliLoader(GetName(),topfoldername); |
ce3f5e87 | 545 | fMUONData = new AliMUONData(fLoader,GetName(),GetName()); |
d652f85c | 546 | fMUONData->SetSplitLevel(fSplitLevel); |
3fa6cfdd | 547 | return fLoader; |
548 | } | |
ce3f5e87 | 549 | //_______________________________________________________________________ |
a897a37a | 550 | |
551 | AliMUONRawCluster *AliMUON::RawCluster(Int_t ichamber, Int_t icathod, Int_t icluster) | |
552 | { | |
de05461e | 553 | // |
554 | // Return rawcluster (icluster) for chamber ichamber and cathode icathod | |
555 | // Obsolete ?? | |
ce3f5e87 | 556 | TClonesArray *muonRawCluster = GetMUONData()->RawClusters(ichamber); |
a897a37a | 557 | ResetRawClusters(); |
88cb7938 | 558 | TTree *treeR = fLoader->TreeR(); |
a9e2aefa | 559 | Int_t nent=(Int_t)treeR->GetEntries(); |
560 | treeR->GetEvent(nent-2+icathod-1); | |
561 | //treeR->GetEvent(icathod); | |
562 | //Int_t nrawcl = (Int_t)muonRawCluster->GetEntriesFast(); | |
a897a37a | 563 | |
a9e2aefa | 564 | AliMUONRawCluster * mRaw = (AliMUONRawCluster*)muonRawCluster->UncheckedAt(icluster); |
a897a37a | 565 | //printf("RawCluster _ nent nrawcl icluster mRaw %d %d %d%p\n",nent,nrawcl,icluster,mRaw); |
566 | ||
567 | return mRaw; | |
568 | } | |
ffd9faa2 | 569 | |
d5609cfc | 570 | //________________________________________________________________________ |
571 | void | |
572 | AliMUON::ResetGeometryBuilder() | |
573 | { | |
574 | // Only to be used by "experts" wanting to change the geometry builders | |
575 | // to be used. | |
576 | // As the ctor of AliMUON now defines a default geometrybuilder, this | |
577 | // ResetGeometryBuilder() must be called prior to call the | |
578 | // AddGeometryBuilder() | |
579 | delete fGeometryBuilder; | |
580 | fGeometryBuilder = new AliMUONGeometryBuilder(this); | |
581 | fGeometryBuilder | |
582 | ->AddBuilder(new AliMUONCommonGeometryBuilder(this)); | |
583 | } |