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 **************************************************************************/
17 ///////////////////////////////////////////////////////////////////////////////
19 // ALICE Reconstruction parameterization: //
22 // Base Class for Detector reconstruction parameters //
23 // Revision: cvetan.cheshkov@cern.ch 12/06/2008 //
24 // Its structure has been revised and it is interfaced to AliEventInfo. //
26 ///////////////////////////////////////////////////////////////////////////////
28 #include "TObjArray.h"
29 #include "AliDetectorRecoParam.h"
32 #include "AliRecoParam.h"
35 ClassImp(AliRecoParam)
37 AliRecoParam::AliRecoParam():
41 // Default constructor
45 AliRecoParam::AliRecoParam(const char *detector):
46 TNamed(detector,detector),
49 // Default constructor
53 AliRecoParam::~AliRecoParam(){
56 // Delete the array with the reco-param objects
58 fRecoParamArray->Delete();
59 delete fRecoParamArray;
63 void AliRecoParam::Print(Option_t *option) const {
65 // Print reconstruction setup
67 printf("AliRecoParam object for %s\n",GetName());
68 if (!fRecoParamArray) return;
69 Int_t nparam = fRecoParamArray->GetEntriesFast();
70 for (Int_t iparam=0; iparam<nparam; iparam++){
71 AliDetectorRecoParam * param = (AliDetectorRecoParam *)fRecoParamArray->At(iparam);
77 AliDetectorRecoParam *AliRecoParam::GetRecoParam(const AliEventInfo &/*evInfo*/) const {
78 // To be implemented by the detectors
79 // Here we return the last AliDetectorRecoParam!!
80 if (!fRecoParamArray) return NULL;
81 if (fRecoParamArray->GetEntriesFast() != 1)
82 AliWarning(Form("Method not implemented by the detector %s, using the last AliDetectorRecoParam !",GetName()));
84 return (AliDetectorRecoParam *)fRecoParamArray->Last();
87 void AliRecoParam::AddRecoParam(AliDetectorRecoParam* param){
88 // Add an instance of reco params object into
89 // the fRecoParamArray
91 if (!fRecoParamArray) fRecoParamArray = new TObjArray;
92 fRecoParamArray->AddLast(param);