Line data Source code
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 :
16 : /* $Id$ */
17 :
18 : //-----------------------------------------------------------------------------
19 : // Class AliMUON
20 : // ------------------
21 : // AliDetector class for MUON subsystem
22 : // providing simulation data management
23 : //-----------------------------------------------------------------------------
24 :
25 : #include <TTree.h>
26 : #include "AliMUON.h"
27 :
28 : #include "AliMUONSDigitizerV2.h"
29 : #include "AliMUONDigitizerV3.h"
30 : #include "AliMUONDigitMaker.h"
31 : #include "AliMUONDigit.h"
32 : #include "AliMUONCalibrationData.h"
33 :
34 : #include "AliMUONDigitStoreV1.h"
35 : #include "AliMUONTriggerStoreV1.h"
36 : #include "AliMUONHitStoreV1.h"
37 :
38 : #include "AliMUONChamberTrigger.h"
39 : #include "AliMUONConstants.h"
40 : #include "AliMUONGeometry.h"
41 : #include "AliMUONGeometryTransformer.h"
42 : #include "AliMUONGeometryBuilder.h"
43 : #include "AliMUONVGeometryBuilder.h"
44 : #include "AliMUONCommonGeometryBuilder.h"
45 : #include "AliMUONSt1GeometryBuilderV2.h"
46 : #include "AliMUONSt2GeometryBuilderV2.h"
47 : #include "AliMUONSlatGeometryBuilder.h"
48 : #include "AliMUONTriggerGeometryBuilder.h"
49 : #include "AliMUONDigitCalibrator.h"
50 : #include "AliMUONRecoParam.h"
51 : #include "AliCDBManager.h"
52 : #include "AliCDBEntry.h"
53 :
54 : #include "AliMUONRawWriter.h"
55 :
56 : #include "AliLoader.h"
57 : #include "AliCDBManager.h"
58 : #include "AliDigitizationInput.h"
59 : #include "AliMC.h"
60 : #include "AliRun.h"
61 : #include "AliRawDataHeaderSim.h"
62 : #include "AliLog.h"
63 :
64 : #include <TObjArray.h>
65 :
66 : // Defaults parameters for Z positions of chambers
67 : // taken from values for "stations" in AliMUON::AliMUON
68 : // const Float_t zch[7]={528, 690., 975., 1249., 1449., 1610, 1710.};
69 : // and from array "dstation" in AliMUONv1::CreateGeometry
70 : // Float_t dstation[5]={20., 20., 20, 20., 20.};
71 : // for tracking chambers,
72 : // according to (Z1 = zch - dstation) and (Z2 = zch + dstation)
73 : // for the first and second chambers in the station, respectively,
74 : // and from "DTPLANES" in AliMUONv1::CreateGeometry
75 : // const Float_t DTPLANES = 15.;
76 : // for trigger chambers,
77 : // according to (Z1 = zch) and (Z2 = zch + DTPLANES)
78 : // for the first and second chambers in the station, respectively
79 :
80 : /// \cond CLASSIMP
81 16 : ClassImp(AliMUON)
82 : /// \endcond
83 :
84 : //__________________________________________________________________
85 : AliMUON::AliMUON()
86 12 : : AliDetector(),
87 12 : fNCh(0),
88 12 : fNTrackingCh(0),
89 12 : fSplitLevel(0),
90 12 : fChambers(0),
91 12 : fGeometryBuilder(0),
92 12 : fAccCut(kFALSE),
93 12 : fAccMin(0.),
94 12 : fAccMax(0.),
95 12 : fMaxStepGas(0.),
96 12 : fMaxStepAlu(0.),
97 12 : fMaxDestepGas(0.),
98 12 : fMaxDestepAlu(0.),
99 12 : fMaxIterPad(0),
100 12 : fCurIterPad(0),
101 12 : fIsMaxStep(kTRUE),
102 12 : fTriggerScalerEvent(kFALSE),
103 12 : fTriggerResponseV1(2),
104 12 : fTriggerCoinc44(0),
105 12 : fTriggerEffCells(kTRUE),
106 12 : fDigitizerWithNoise(1),
107 12 : fDigitizerNSigmas(4.0),
108 12 : fIsTailEffect(kTRUE),
109 12 : fConvertTrigger(kFALSE),
110 12 : fRawWriter(0x0),
111 12 : fDigitMaker(0x0),
112 12 : fHitStore(0x0),
113 12 : fDigitStoreConcreteClassName(),
114 12 : fCalibrationData(0x0),
115 12 : fDigitCalibrator(0x0)
116 36 : {
117 : /// Default Constructor
118 :
119 60 : AliDebug(1,Form("default (empty) ctor this=%p",this));
120 12 : fIshunt = 0;
121 12 : }
122 :
123 : //__________________________________________________________________
124 : AliMUON::AliMUON(const char *name, const char* title)
125 1 : : AliDetector(name, title),
126 2 : fNCh(AliMUONConstants::NCh()),
127 2 : fNTrackingCh(AliMUONConstants::NTrackingCh()),
128 1 : fSplitLevel(0),
129 1 : fChambers(0),
130 1 : fGeometryBuilder(0),
131 1 : fAccCut(kFALSE),
132 1 : fAccMin(0.),
133 1 : fAccMax(0.),
134 1 : fMaxStepGas(0.1),
135 1 : fMaxStepAlu(0.1),
136 1 : fMaxDestepGas(-1), // Negatives values are ignored by geant3 CONS200
137 1 : fMaxDestepAlu(-1), // in the calculation of the tracking parameters
138 1 : fMaxIterPad(0),
139 1 : fCurIterPad(0),
140 1 : fIsMaxStep(kTRUE),
141 1 : fTriggerScalerEvent(kFALSE),
142 1 : fTriggerResponseV1(2),
143 1 : fTriggerCoinc44(0),
144 1 : fTriggerEffCells(kTRUE),
145 1 : fDigitizerWithNoise(1),
146 1 : fDigitizerNSigmas(4.0),
147 1 : fIsTailEffect(kTRUE),
148 1 : fConvertTrigger(kFALSE),
149 1 : fRawWriter(0x0),
150 3 : fDigitMaker(new AliMUONDigitMaker),
151 1 : fHitStore(0x0),
152 1 : fDigitStoreConcreteClassName("AliMUONDigitStoreV2S"),
153 1 : fCalibrationData(),
154 1 : fDigitCalibrator(0x0)
155 3 : {
156 : /// Standard constructor
157 :
158 5 : AliDebug(1,Form("ctor this=%p",this));
159 1 : fIshunt = 0;
160 :
161 : //PH SetMarkerColor(kRed);//
162 :
163 : // Geometry builder
164 3 : fGeometryBuilder = new AliMUONGeometryBuilder(this);
165 :
166 : // Common geometry definitions
167 1 : fGeometryBuilder
168 3 : ->AddBuilder(new AliMUONCommonGeometryBuilder(this));
169 :
170 : // By default, add also all the needed geometry builders.
171 : // If you want to change this from outside, please use ResetGeometryBuilder
172 : // method, followed by AddGeometryBuilder ones.
173 :
174 3 : AddGeometryBuilder(new AliMUONSt1GeometryBuilderV2(this));
175 3 : AddGeometryBuilder(new AliMUONSt2GeometryBuilderV2(this));
176 3 : AddGeometryBuilder(new AliMUONSlatGeometryBuilder(this));
177 3 : AddGeometryBuilder(new AliMUONTriggerGeometryBuilder(this));
178 :
179 : //
180 : // Creating List of Chambers
181 : Int_t ch;
182 4 : fChambers = new TObjArray(AliMUONConstants::NCh());
183 1 : fChambers->SetOwner(kTRUE);
184 :
185 : // Loop over stations
186 24 : for (Int_t st = 0; st < AliMUONConstants::NCh() / 2; st++) {
187 : // Loop over 2 chambers in the station
188 42 : for (Int_t stCH = 0; stCH < 2; stCH++) {
189 : //
190 : //
191 : // Default Parameters for Muon Tracking Stations
192 14 : ch = 2 * st + stCH;
193 42 : if (ch < AliMUONConstants::NTrackingCh()) {
194 44 : fChambers->AddAt(new AliMUONChamber(ch),ch);
195 : } else {
196 16 : fChambers->AddAt(new AliMUONChamberTrigger(ch, GetGeometryTransformer()),ch);
197 : }
198 : } // Chamber stCH (0, 1) in
199 : } // Station st (0...)
200 :
201 2 : Int_t runnumber = AliCDBManager::Instance()->GetRun();
202 :
203 3 : fCalibrationData = new AliMUONCalibrationData(runnumber);
204 1 : }
205 :
206 : //____________________________________________________________________
207 : AliMUON::~AliMUON()
208 26 : {
209 : /// Destructor
210 :
211 65 : AliDebug(1,Form("dtor this=%p",this));
212 26 : delete fChambers;
213 26 : delete fGeometryBuilder;
214 14 : delete fRawWriter;
215 14 : delete fDigitMaker;
216 14 : delete fHitStore;
217 26 : delete fCalibrationData;
218 13 : delete fDigitCalibrator;
219 13 : }
220 :
221 : //_____________________________________________________________________________
222 : void AliMUON::AddGeometryBuilder(AliMUONVGeometryBuilder* geomBuilder)
223 : {
224 : /// Add the geometry builder to the list
225 :
226 8 : fGeometryBuilder->AddBuilder(geomBuilder);
227 4 : }
228 :
229 : //____________________________________________________________________
230 : const AliMUONGeometry* AliMUON::GetGeometry() const
231 : {
232 : /// Return geometry parametrisation
233 :
234 341592 : if ( !fGeometryBuilder) {
235 0 : AliWarningStream() << "GeometryBuilder not defined." << std::endl;
236 0 : return 0;
237 : }
238 :
239 170796 : return fGeometryBuilder->GetGeometry();
240 170796 : }
241 :
242 : //____________________________________________________________________
243 : const AliMUONGeometryTransformer* AliMUON::GetGeometryTransformer() const
244 : {
245 : /// Return geometry parametrisation
246 :
247 572 : const AliMUONGeometry* kGeometry = GetGeometry();
248 :
249 286 : if ( !kGeometry) return 0;
250 :
251 286 : return kGeometry->GetTransformer();
252 286 : }
253 :
254 : //__________________________________________________________________
255 : void
256 : AliMUON::MakeBranch(Option_t* opt)
257 : {
258 : /// Create branche(s) to hold MUON hits
259 16 : AliDebug(1,"");
260 :
261 4 : TString sopt(opt);
262 8 : if ( sopt != "H" ) return;
263 :
264 4 : if (!fHitStore)
265 : {
266 3 : fHitStore = new AliMUONHitStoreV1;
267 1 : if ( gAlice->GetMCApp() )
268 : {
269 1 : if ( gAlice->GetMCApp()->GetHitLists() )
270 : {
271 : // AliStack::PurifyKine needs to be able to loop on our hits
272 : // to remap the track numbers.
273 2 : gAlice->GetMCApp()->AddHitList(fHitStore->Collection());
274 : }
275 : }
276 : }
277 :
278 4 : TTree* treeH = fLoader->TreeH();
279 :
280 4 : if (!treeH)
281 : {
282 0 : AliFatal("No TreeH");
283 : }
284 :
285 4 : fHitStore->Connect(*treeH);
286 8 : }
287 :
288 : //__________________________________________________________________
289 : void
290 : AliMUON::SetTreeAddress()
291 : {
292 : /// Set Hits tree address
293 :
294 : // if ( gAlice->GetMCApp() && fHitStore )
295 : // {
296 : // TList* l = gAlice->GetMCApp()->GetHitLists();
297 : // if ( l )
298 : // {
299 : // TObject* o = l->First();
300 : // if (o!=fHitStore->HitCollection())
301 : // {
302 : // AliError(Form("Something is strange hitcollection=%x",fHitStore->HitCollection()));
303 : // l->Print();
304 : // }
305 : // }
306 : // }
307 294 : }
308 :
309 : //_________________________________________________________________
310 : void
311 : AliMUON::ResetHits()
312 : {
313 : /// Reset hits
314 :
315 1808 : AliDebug(1,"");
316 567 : if (fHitStore) fHitStore->Clear();
317 452 : }
318 :
319 : //_________________________________________________________________
320 : void AliMUON::SetChargeSlope(Int_t id, Float_t p1)
321 : {
322 : /// Set the inverse charge slope for chamber id
323 :
324 0 : Int_t i=2*(id-1); //PH ((AliMUONChamber*) (*fChambers)[i])->SetSigmaIntegration(p1);
325 : //PH ((AliMUONChamber*) (*fChambers)[i+1])->SetSigmaIntegration(p1);
326 0 : ((AliMUONChamber*) fChambers->At(i))->SetChargeSlope(p1);
327 0 : ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSlope(p1);
328 0 : }
329 : //__________________________________________________________________
330 : void AliMUON::SetChargeSpread(Int_t id, Float_t p1, Float_t p2)
331 : {
332 : /// Set sigma of charge spread for chamber id
333 :
334 0 : Int_t i=2*(id-1);
335 0 : ((AliMUONChamber*) fChambers->At(i))->SetChargeSpread(p1,p2);
336 0 : ((AliMUONChamber*) fChambers->At(i+1))->SetChargeSpread(p1,p2);
337 0 : }
338 : //___________________________________________________________________
339 : void AliMUON::SetSigmaIntegration(Int_t id, Float_t p1)
340 : {
341 : /// Set integration limits for charge spread
342 0 : Int_t i=2*(id-1);
343 0 : ((AliMUONChamber*) fChambers->At(i))->SetSigmaIntegration(p1);
344 0 : ((AliMUONChamber*) fChambers->At(i+1))->SetSigmaIntegration(p1);
345 0 : }
346 :
347 : //__________________________________________________________________
348 : void AliMUON::SetMaxAdc(Int_t id, Int_t p1)
349 : {
350 : /// Set maximum number for ADCcounts (saturation)
351 :
352 0 : Int_t i=2*(id-1);
353 0 : ((AliMUONChamber*) fChambers->At(i))->SetMaxAdc(p1);
354 0 : ((AliMUONChamber*) fChambers->At(i+1))->SetMaxAdc(p1);
355 0 : }
356 :
357 : //__________________________________________________________________
358 : void AliMUON::SetMaxStepGas(Float_t p1)
359 : {
360 : /// Set stepsize in gas
361 :
362 2 : fMaxStepGas=p1;
363 1 : }
364 : //__________________________________________________________________
365 : void AliMUON::SetMaxStepAlu(Float_t p1)
366 : {
367 : /// Set step size in Alu
368 :
369 2 : fMaxStepAlu=p1;
370 1 : }
371 : //__________________________________________________________________
372 : void AliMUON::SetMaxDestepGas(Float_t p1)
373 : {
374 : /// Set maximum step size in Gas
375 :
376 0 : fMaxDestepGas=p1;
377 0 : }
378 : //__________________________________________________________________
379 : void AliMUON::SetMaxDestepAlu(Float_t p1)
380 : {
381 : /// Set maximum step size in Alu
382 :
383 0 : fMaxDestepAlu=p1;
384 0 : }
385 :
386 : //____________________________________________________________________
387 : Float_t AliMUON::GetMaxStepGas() const
388 : {
389 : /// Return stepsize in gas
390 :
391 2 : return fMaxStepGas;
392 : }
393 :
394 : //____________________________________________________________________
395 : Float_t AliMUON::GetMaxStepAlu() const
396 : {
397 : /// Return step size in Alu
398 :
399 4 : return fMaxStepAlu;
400 : }
401 :
402 : //____________________________________________________________________
403 : Float_t AliMUON::GetMaxDestepGas() const
404 : {
405 : /// Return maximum step size in Gas
406 :
407 2 : return fMaxDestepGas;
408 : }
409 :
410 : //____________________________________________________________________
411 : Float_t AliMUON::GetMaxDestepAlu() const
412 : {
413 : /// Return maximum step size in Gas
414 :
415 4 : return fMaxDestepAlu;
416 : }
417 :
418 : //____________________________________________________________________
419 : void AliMUON::SetAlign(Bool_t align)
420 : {
421 : /// Set option for alignement to geometry builder
422 :
423 0 : fGeometryBuilder->SetAlign(align);
424 0 : }
425 :
426 : //____________________________________________________________________
427 : void AliMUON::SetAlign(const TString& fileName, Bool_t align)
428 : {
429 : /// Set option for alignement to geometry builder
430 :
431 0 : fGeometryBuilder->SetAlign(fileName, align);
432 0 : }
433 :
434 : //____________________________________________________________________
435 : void AliMUON::SetResponseModel(Int_t id, const AliMUONResponse& response)
436 : {
437 : /// Set the response for chamber id
438 28 : ((AliMUONChamber*) fChambers->At(id))->SetResponseModel(response);
439 14 : }
440 :
441 : //____________________________________________________________________
442 : AliDigitizer* AliMUON::CreateDigitizer(AliDigitizationInput* digInput) const
443 : {
444 : /// Return digitizer
445 :
446 2 : AliMUONDigitizerV3* digitizer = new AliMUONDigitizerV3(digInput, fDigitizerWithNoise);
447 1 : AliMUONDigitizerV3::SetNSigmas(fDigitizerNSigmas);
448 1 : digitizer->SetCalibrationData(fCalibrationData,GetRecoParam());
449 1 : return digitizer;
450 0 : }
451 :
452 : //_____________________________________________________________________
453 : void AliMUON::SDigits2Digits()
454 : {
455 : /// Write TreeD here only
456 :
457 0 : char hname[30];
458 : // sprintf(hname,"TreeD%d",fLoader->GetHeader()->GetEvent());
459 0 : fLoader->TreeD()->Write(hname,TObject::kOverwrite);
460 0 : fLoader->TreeD()->Reset();
461 0 : }
462 :
463 : //_____________________________________________________________________
464 : void AliMUON::Hits2SDigits()
465 : {
466 : /// Perform Hits2Digits using SDigitizerV2
467 :
468 2 : AliMUONSDigitizerV2 sdigitizer;
469 1 : sdigitizer.Digitize();
470 1 : }
471 :
472 : //_____________________________________________________________________
473 : void AliMUON::Digits2Raw()
474 : {
475 : /// Convert digits of the current event to raw data
476 :
477 8 : AliRawDataHeaderSim header;
478 :
479 4 : if (!fRawWriter)
480 : {
481 2 : fRawWriter = new AliMUONRawWriter;
482 3 : AliDebug(1,Form("Creating %s",fRawWriter->ClassName()));
483 1 : if (fTriggerScalerEvent == kTRUE)
484 : {
485 0 : fRawWriter->SetScalersNumbers();
486 0 : }
487 : }
488 :
489 4 : fLoader->LoadDigits("READ");
490 :
491 4 : TTree* treeD = fLoader->TreeD();
492 :
493 4 : if (!treeD)
494 : {
495 0 : AliError("Could not get TreeD");
496 0 : return;
497 : }
498 :
499 4 : AliMUONVTriggerStore* triggerStore = AliMUONVTriggerStore::Create(*treeD);
500 4 : AliMUONVDigitStore* digitStore = AliMUONVDigitStore::Create(*treeD);
501 :
502 4 : triggerStore->Connect(*treeD,kFALSE);
503 4 : digitStore->Connect(*treeD,kFALSE);
504 :
505 4 : treeD->GetEvent(0);
506 :
507 4 : fRawWriter->SetHeader(header);
508 4 : if (!fRawWriter->Digits2Raw(digitStore,triggerStore))
509 : {
510 0 : AliError("pb writting raw data");
511 0 : }
512 :
513 8 : delete triggerStore;
514 8 : delete digitStore;
515 :
516 4 : fLoader->UnloadDigits();
517 8 : }
518 :
519 : //_____________________________________________________________________
520 : Bool_t AliMUON::Raw2SDigits(AliRawReader* rawReader)
521 : {
522 : /// Convert raw data to SDigit
523 :
524 0 : if (!fLoader->TreeS()) fLoader->MakeSDigitsContainer();
525 :
526 0 : TTree* treeS = fLoader->TreeS();
527 :
528 0 : AliMUONVDigitStore* sDigitStore = AliMUONVDigitStore::Create(DigitStoreClassName());
529 : AliMUONVTriggerStore* triggerStore = 0x0;
530 :
531 0 : sDigitStore->Connect(*treeS);
532 :
533 0 : if (!fDigitMaker) fDigitMaker = new AliMUONDigitMaker;
534 :
535 0 : if (fConvertTrigger) {
536 0 : triggerStore = new AliMUONTriggerStoreV1;
537 0 : triggerStore->Connect(*treeS,true);
538 0 : fDigitMaker->SetMakeTriggerDigits(true);
539 0 : }
540 :
541 0 : if (!fDigitCalibrator)
542 : {
543 0 : AliMUONRecoParam* recoParam = GetRecoParam();
544 :
545 0 : if (!recoParam)
546 : {
547 0 : AliFatal("Cannot work without recoparams !");
548 0 : }
549 :
550 0 : fDigitCalibrator = new AliMUONDigitCalibrator(*fCalibrationData,recoParam);
551 0 : }
552 :
553 0 : fDigitMaker->Raw2Digits(rawReader,sDigitStore,triggerStore);
554 :
555 0 : fDigitCalibrator->Calibrate(*sDigitStore);
556 :
557 0 : TIter next(sDigitStore->CreateIterator());
558 : AliMUONDigit* sdigit;
559 :
560 : // now tweak the digits to make them "as fresh as possible", i.e.
561 : // reset their calibrated status, as they'll be calibrated again
562 : // once embedded.
563 0 : while ( ( sdigit = static_cast<AliMUONDigit*>(next()) ) )
564 : {
565 0 : sdigit->Calibrated(kFALSE);
566 : }
567 :
568 0 : treeS->Fill();
569 :
570 0 : fLoader->WriteSDigits("OVERWRITE");
571 :
572 0 : fLoader->UnloadSDigits();
573 :
574 0 : delete sDigitStore;
575 :
576 0 : delete triggerStore;
577 :
578 : return kTRUE;
579 0 : }
580 :
581 : //_______________________________________________________________________
582 : AliLoader* AliMUON::MakeLoader(const char* topfoldername)
583 : {
584 : /// Build standard getter (AliLoader type);
585 : /// if detector wants to use castomized getter, it must overload this method
586 :
587 4 : AliDebug(1,Form("Creating standard getter for detector %s. Top folder is %s.",
588 : GetName(),topfoldername));
589 3 : fLoader = new AliLoader(GetName(),topfoldername);
590 :
591 1 : return fLoader;
592 0 : }
593 :
594 : //________________________________________________________________________
595 : void
596 : AliMUON::ResetGeometryBuilder()
597 : {
598 : /// Only to be used by "experts" wanting to change the geometry builders
599 : /// to be used.
600 : /// As the ctor of AliMUON now defines a default geometrybuilder, this
601 : /// ResetGeometryBuilder() must be called prior to call the
602 : /// AddGeometryBuilder()
603 :
604 0 : delete fGeometryBuilder;
605 0 : fGeometryBuilder = new AliMUONGeometryBuilder(this);
606 0 : fGeometryBuilder
607 0 : ->AddBuilder(new AliMUONCommonGeometryBuilder(this));
608 0 : }
609 :
610 : //____________________________________________________________________
611 : Int_t AliMUON::GetTriggerResponseV1() const
612 : {
613 : ///
614 : /// Returns fTriggerResponseV1
615 : ///
616 2 : return fTriggerResponseV1;
617 :
618 : }
619 :
620 : //____________________________________________________________________
621 : Int_t AliMUON::GetTriggerCoinc44() const
622 : {
623 : ///
624 : /// Returns fTriggerCoinc44
625 : ///
626 0 : return fTriggerCoinc44;
627 :
628 : }
629 :
630 : //____________________________________________________________________
631 : Bool_t AliMUON::GetTriggerEffCells() const
632 : {
633 : ///
634 : /// Returns fTriggerEffCells
635 : ///
636 2 : return fTriggerEffCells;
637 :
638 : }
639 :
640 : //____________________________________________________________________
641 : Int_t AliMUON::GetDigitizerWithNoise() const
642 : {
643 : ///
644 : /// Returns fDigitizerWithNoise
645 : ///
646 0 : return fDigitizerWithNoise;
647 :
648 : }
649 :
650 : //____________________________________________________________________
651 : AliMUONRecoParam* AliMUON::GetRecoParam() const
652 : {
653 : AliMUONRecoParam* recoParam = 0x0;
654 :
655 3 : AliCDBEntry* entry = AliCDBManager::Instance()->Get("MUON/Calib/RecoParam");
656 :
657 1 : if (entry)
658 : {
659 : // load recoParam according OCDB content (single or array)
660 3 : if (!(recoParam = dynamic_cast<AliMUONRecoParam*>(entry->GetObject())))
661 : {
662 1 : TObjArray* recoParamArray = static_cast<TObjArray*>(entry->GetObject());
663 :
664 2 : for(Int_t i = 0; i < recoParamArray->GetEntriesFast(); ++i)
665 : {
666 1 : recoParam = static_cast<AliMUONRecoParam*>(recoParamArray->UncheckedAt(i));
667 3 : if (recoParam && recoParam->IsDefault()) break;
668 : recoParam = 0x0;
669 : }
670 1 : }
671 : }
672 1 : return recoParam;
673 0 : }
674 :
675 :
|