]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliRecoParam.cxx
Updated DAs
[u/mrichter/AliRoot.git] / STEER / AliRecoParam.cxx
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
17 ///////////////////////////////////////////////////////////////////////////////
18 //                                                                           //
19 // ALICE Reconstruction parameterization:                                    //
20 //                                                                           //
21 //                                                                           //
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.      //
25 //                                                                           //
26 ///////////////////////////////////////////////////////////////////////////////
27
28 #include "TObjArray.h"
29 #include "AliDetectorRecoParam.h"
30
31 #include "AliLog.h"
32 #include "AliRecoParam.h"
33
34
35 ClassImp(AliRecoParam)
36
37 AliRecoParam::AliRecoParam(): 
38   TNamed("",""),
39   fRecoParamArray(0)
40 {
41   // Default constructor
42   // ...
43 }
44
45 AliRecoParam::AliRecoParam(const char *detector): 
46   TNamed(detector,detector),
47   fRecoParamArray(0)
48 {
49   // Default constructor
50   // ...
51 }
52
53 AliRecoParam::~AliRecoParam(){
54   // Destructor
55   // ...
56   // Delete the array with the reco-param objects
57   if (fRecoParamArray){
58     fRecoParamArray->Delete();
59     delete fRecoParamArray;
60   }
61 }
62
63 void  AliRecoParam::Print(Option_t *option) const {
64   //
65   // Print reconstruction setup
66   //
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);
72     if (!param) continue;
73     param->Print(option);
74   }
75 }
76
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()));
83
84   return (AliDetectorRecoParam *)fRecoParamArray->Last();
85 }
86
87 void  AliRecoParam::AddRecoParam(AliDetectorRecoParam* param){
88   // Add an instance of reco params object into
89   // the fRecoParamArray
90   //
91   if (!fRecoParamArray) fRecoParamArray = new TObjArray;
92   fRecoParamArray->AddLast(param);
93 }