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 // Retrieving paramaters:
23 // 0. Read the parameters from database
24 // 1. Using the ConfigRecoParam.C script (example : $ALICE_ROOT/macros)
25 // 2. Register additional parametes (AliRecoParam::Instance()->RegisterRecoParam(tpcRecoParam);
28 // Using the reconstruction parameters
29 // AliRecoParam::Instance()->GetRecoParam(detType, eventType) //
31 // 1. Detectors - ITS, TPC, TRD, TOF ...
32 // 2. Process - V0, Kink, ESDcuts
35 ///////////////////////////////////////////////////////////////////////////////
37 #include "TObjArray.h"
38 #include "AliDetectorRecoParam.h"
40 #include "AliRecoParam.h"
43 ClassImp(AliRecoParam)
46 AliRecoParam* AliRecoParam::fgInstance = 0x0;
49 //_____________________________________________________________________________
50 AliRecoParam* AliRecoParam::Instance()
53 // returns AliRecoParam instance (singleton)
56 fgInstance = new AliRecoParam();
64 AliRecoParam::AliRecoParam():
65 TNamed("ALICE","ALICE"),
73 AliRecoParam::~AliRecoParam(){
78 fRecoParamArray->Delete();
79 delete fRecoParamArray;
83 void AliRecoParam::Print(Option_t *option) const{
85 // Print reconstruction setup
87 printf("AliRecoParam\n");
88 if (!fRecoParamArray) return;
89 Int_t nparam = fRecoParamArray->GetEntriesFast();
90 for (Int_t iparam=0; iparam<nparam; iparam++){
91 AliDetectorRecoParam * param = (AliDetectorRecoParam *)fRecoParamArray->At(iparam);
97 void AliRecoParam::RegisterRecoParam(AliDetectorRecoParam* param){
101 if (!fRecoParamArray) fRecoParamArray = new TObjArray;
102 fRecoParamArray->AddLast(param);
105 TObjArray * AliRecoParam::GetRecoParam(const char * detType, Int_t */*eventType*/){
107 // Get the list of Reconstruction parameters for given detector
110 if (!fRecoParamArray) return 0;
111 TObjArray * array = 0;
112 Int_t nparam = fRecoParamArray->GetEntriesFast();
113 for (Int_t iparam=0;iparam<nparam; iparam++){
114 AliDetectorRecoParam * param = (AliDetectorRecoParam *)fRecoParamArray->At(iparam);
115 if (!param) continue;
116 TString str(param->GetName());
117 if (!str.Contains(detType)) continue;
118 if (!array) array = new TObjArray;
119 array->AddLast(param);