1 /**************************************************************************
2 * Copyright(c) 2007, 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 **************************************************************************/
18 // Base class for the PHOS reconstruction parameters.
19 // Do not use in the reconstruction; use derivative classes instead.
20 // Author: Boris Polichtchouk.
22 // --- AliRoot header files ---
23 #include "AliCDBManager.h"
24 #include "AliCDBEntry.h"
26 #include "AliPHOSRecoParam.h"
28 ClassImp(AliPHOSRecoParam)
30 TObjArray* AliPHOSRecoParam::fgkMaps =0; //ALTRO mappings
32 //-----------------------------------------------------------------------------
33 AliPHOSRecoParam::AliPHOSRecoParam() :
34 AliDetectorRecoParam(),
35 fEMCClusteringThreshold(0.2),
37 fEMCRawDigitThreshold(2),
40 fEMCSampleQualityCut(1.),
42 fEMCEcore2ESD(kFALSE),
43 fEMCSubtractPedestals(kTRUE),
45 fEMCEnergyCorrectionOn(kTRUE),
46 fEMCFitterVersion(""),
47 fGlobalAltroOffset(0),
48 fGlobalAltroThreshold(0),
49 fCPVClusteringThreshold(0.0),
55 //Default constructor.
58 //-----------------------------------------------------------------------------
59 AliPHOSRecoParam::AliPHOSRecoParam(const AliPHOSRecoParam& ):
60 AliDetectorRecoParam(),
61 fEMCClusteringThreshold(0.2),
63 fEMCRawDigitThreshold(2),
66 fEMCSampleQualityCut(1.),
68 fEMCEcore2ESD(kFALSE),
69 fEMCSubtractPedestals(kTRUE),
71 fEMCEnergyCorrectionOn(kTRUE),
72 fEMCFitterVersion(""),
73 fGlobalAltroOffset(0),
74 fGlobalAltroThreshold(0),
75 fCPVClusteringThreshold(0.0),
84 //-----------------------------------------------------------------------------
85 AliPHOSRecoParam& AliPHOSRecoParam::operator = (const AliPHOSRecoParam& recoParam)
87 //Assignment operator.
89 if(this != &recoParam) {
90 fEMCClusteringThreshold = recoParam.fEMCClusteringThreshold;
91 fEMCLocMaxCut = recoParam.fEMCLocMaxCut;
92 fEMCRawDigitThreshold = recoParam.fEMCRawDigitThreshold;
93 fEMCMinE = recoParam.fEMCMinE;
94 fEMCW0 = recoParam.fEMCW0;
95 fEMCSampleQualityCut = recoParam.fEMCSampleQualityCut;
96 fEMCEcoreRadius = recoParam.fEMCEcoreRadius;
97 fEMCEcore2ESD = recoParam.fEMCEcore2ESD;
98 fEMCSubtractPedestals = recoParam.fEMCSubtractPedestals;
99 fEMCUnfold = recoParam.fEMCUnfold;
100 fEMCEnergyCorrectionOn = recoParam.fEMCEnergyCorrectionOn;
101 fEMCFitterVersion = recoParam.fEMCFitterVersion;
102 fGlobalAltroOffset = recoParam.fGlobalAltroOffset;
103 fGlobalAltroThreshold = recoParam.fGlobalAltroThreshold;
104 fCPVClusteringThreshold = recoParam.fCPVClusteringThreshold;
105 fCPVLocMaxCut = recoParam.fCPVLocMaxCut;
106 fCPVMinE = recoParam.fCPVMinE;
107 fCPVW0 = recoParam.fCPVW0;
108 fCPVUnfold = recoParam.fCPVUnfold;
114 //-----------------------------------------------------------------------------
115 void AliPHOSRecoParam::Print(Option_t * /*option*/) const
117 AliDebug(2,Form("PHOS reconstruction parameters:\n"
118 "\tEMCClusteringThreshold = %f\n"
119 "\tEMCLocMaxCut = %f\n"
120 "\tEMCRawDigitThreshold = %f\n"
123 "\tEMCSampleQualityCut = %f\n"
124 "\tEMCEcoreRadius = %f\n"
125 "\tEMCEcore2ESD = %d\n"
126 "\tEMCSubtractPedestals = %d\n"
128 "\tEMCEnergyCorrectionOn = %d\n"
129 "\tEMCFitterVersion = \"%s\"\n"
130 "\tGlobalAltroOffset = %d\n"
131 "\tGlobalAltroThreshold = %d",
132 fEMCClusteringThreshold,
134 fEMCRawDigitThreshold,
137 fEMCSampleQualityCut,
140 fEMCSubtractPedestals,
142 fEMCEnergyCorrectionOn,
143 fEMCFitterVersion.Data(),
145 fGlobalAltroThreshold));
149 //-----------------------------------------------------------------------------
150 AliPHOSRecoParam* AliPHOSRecoParam::GetDefaultParameters()
152 //Default parameters for the reconstruction
154 AliPHOSRecoParam* params = new AliPHOSRecoParam();
158 //-----------------------------------------------------------------------------
159 const TObjArray* AliPHOSRecoParam::GetMappings()
161 //Returns array of AliAltroMappings for RCU0..RCU3.
162 //If not found, read it from OCDB.
164 //Quick check as follows:
165 // root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
166 // root [1] AliCDBManager::Instance()->SetRun(1);
167 // root [2] TObjArray* maps = AliPHOSRecoParam::GetMappings();
168 // root [3] maps->Print();
170 if(fgkMaps) return fgkMaps;
172 AliCDBEntry* entry = AliCDBManager::Instance()->Get("PHOS/Calib/Mapping");
174 fgkMaps = (TObjArray*)entry->GetObject();