Reco parameters were adjusted to make consistent a reconstruction
[u/mrichter/AliRoot.git] / PHOS / AliPHOSRecoParam.cxx
CommitLineData
58f66025 1/**************************************************************************
2 * Copyright(c) 2007, 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// Base class for the PHOS reconstruction parameters.
19// Do not use in the reconstruction; use derivative classes instead.
20// Author: Boris Polichtchouk.
21
22// --- AliRoot header files ---
7e88424f 23#include "AliCDBManager.h"
24#include "AliCDBEntry.h"
0428f331 25#include "AliLog.h"
58f66025 26#include "AliPHOSRecoParam.h"
27
28ClassImp(AliPHOSRecoParam)
29
7e88424f 30TObjArray* AliPHOSRecoParam::fgkMaps =0; //ALTRO mappings
31
58f66025 32//-----------------------------------------------------------------------------
75b88769 33AliPHOSRecoParam::AliPHOSRecoParam() :
cf4e2a86 34 AliDetectorRecoParam(),
7e88424f 35 fEMCClusteringThreshold(0.2),
36 fEMCLocMaxCut(0.03),
12dd7f10 37 fEMCRawDigitThreshold(2),
38 fEMCMinE(0.012),
7e88424f 39 fEMCW0(4.5),
40 fEMCSampleQualityCut(1.),
41 fEMCEcoreRadius(3.),
42 fEMCEcore2ESD(kFALSE),
43 fEMCSubtractPedestals(kTRUE),
44 fEMCUnfold(kTRUE),
71994f35 45 fEMCEnergyCorrectionOn(kTRUE),
7e88424f 46 fEMCDecoderVersion(""),
0428f331 47 fGlobalAltroOffset(0),
7e88424f 48 fCPVClusteringThreshold(0.0),
49 fCPVLocMaxCut(0.03),
50 fCPVMinE(0.0),
51 fCPVW0(4.0),
52 fCPVUnfold(kTRUE)
58f66025 53{
54 //Default constructor.
55}
56
57//-----------------------------------------------------------------------------
308fb942 58AliPHOSRecoParam::AliPHOSRecoParam(const AliPHOSRecoParam& ):
cf4e2a86 59 AliDetectorRecoParam(),
7e88424f 60 fEMCClusteringThreshold(0.2),
61 fEMCLocMaxCut(0.03),
12dd7f10 62 fEMCRawDigitThreshold(2),
63 fEMCMinE(0.012),
7e88424f 64 fEMCW0(4.5),
65 fEMCSampleQualityCut(1.),
66 fEMCEcoreRadius(3.),
67 fEMCEcore2ESD(kFALSE),
68 fEMCSubtractPedestals(kTRUE),
69 fEMCUnfold(kTRUE),
71994f35 70 fEMCEnergyCorrectionOn(kTRUE),
7e88424f 71 fEMCDecoderVersion(""),
0428f331 72 fGlobalAltroOffset(0),
7e88424f 73 fCPVClusteringThreshold(0.0),
74 fCPVLocMaxCut(0.03),
75 fCPVMinE(0.0),
76 fCPVW0(4.0),
77 fCPVUnfold(kTRUE)
58f66025 78{
79 //Copy constructor.
80}
81
82//-----------------------------------------------------------------------------
83AliPHOSRecoParam& AliPHOSRecoParam::operator = (const AliPHOSRecoParam& recoParam)
84{
85 //Assignment operator.
86
87 if(this != &recoParam) {
7e88424f 88 fEMCClusteringThreshold = recoParam.fEMCClusteringThreshold;
89 fEMCLocMaxCut = recoParam.fEMCLocMaxCut;
12dd7f10 90 fEMCRawDigitThreshold = recoParam.fEMCRawDigitThreshold;
7e88424f 91 fEMCMinE = recoParam.fEMCMinE;
92 fEMCW0 = recoParam.fEMCW0;
93 fEMCSampleQualityCut = recoParam.fEMCSampleQualityCut;
94 fEMCEcoreRadius = recoParam.fEMCEcoreRadius;
95 fEMCEcore2ESD = recoParam.fEMCEcore2ESD;
96 fEMCSubtractPedestals = recoParam.fEMCSubtractPedestals;
97 fEMCUnfold = recoParam.fEMCUnfold;
71994f35 98 fEMCEnergyCorrectionOn = recoParam.fEMCEnergyCorrectionOn;
7e88424f 99 fEMCDecoderVersion = recoParam.fEMCDecoderVersion;
0428f331 100 fGlobalAltroOffset = recoParam.fGlobalAltroOffset;
7e88424f 101 fCPVClusteringThreshold = recoParam.fCPVClusteringThreshold;
102 fCPVLocMaxCut = recoParam.fCPVLocMaxCut;
103 fCPVMinE = recoParam.fCPVMinE;
104 fCPVW0 = recoParam.fCPVW0;
105 fCPVUnfold = recoParam.fCPVUnfold;
58f66025 106 }
107
108 return *this;
109}
7e88424f 110
0428f331 111//-----------------------------------------------------------------------------
332c745b 112void AliPHOSRecoParam::Print(Option_t * /*option*/) const
0428f331 113{
114 AliDebug(2,Form("PHOS reconstruction parameters:\n"
115 "\tEMCClusteringThreshold = %f\n"
116 "\tEMCLocMaxCut = %f\n"
12dd7f10 117 "\tEMCRawDigitThreshold = %f\n"
0428f331 118 "\tEMCMinE = %f\n"
119 "\tEMCW0 = %f\n"
120 "\tEMCSampleQualityCut = %f\n"
121 "\tEMCEcoreRadius = %f\n"
122 "\tEMCEcore2ESD = %d\n"
123 "\tEMCSubtractPedestals = %d\n"
124 "\tEMCUnfold = %d\n"
71994f35 125 "\tEMCEnergyCorrectionOn = %d\n"
0428f331 126 "\tEMCDecoderVersion = \"%s\"\n"
127 "\tGlobalAltroOffset = %d",
128 fEMCClusteringThreshold,
129 fEMCLocMaxCut,
12dd7f10 130 fEMCRawDigitThreshold,
0428f331 131 fEMCMinE,
132 fEMCW0,
133 fEMCSampleQualityCut,
134 fEMCEcoreRadius,
135 fEMCEcore2ESD,
136 fEMCSubtractPedestals,
137 fEMCUnfold,
71994f35 138 fEMCEnergyCorrectionOn,
0428f331 139 fEMCDecoderVersion.Data(),
140 fGlobalAltroOffset));
141
142}
143
7e88424f 144//-----------------------------------------------------------------------------
145AliPHOSRecoParam* AliPHOSRecoParam::GetDefaultParameters()
146{
147 //Default parameters for the reconstruction
148
149 AliPHOSRecoParam* params = new AliPHOSRecoParam();
150 return params;
151}
152
153//-----------------------------------------------------------------------------
154const TObjArray* AliPHOSRecoParam::GetMappings()
155{
156 //Returns array of AliAltroMappings for RCU0..RCU3.
157 //If not found, read it from OCDB.
158
159 //Quick check as follows:
160 // root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
161 // root [1] AliCDBManager::Instance()->SetRun(1);
162 // root [2] TObjArray* maps = AliPHOSRecoParam::GetMappings();
163 // root [3] maps->Print();
164
165 if(fgkMaps) return fgkMaps;
166
167 AliCDBEntry* entry = AliCDBManager::Instance()->Get("PHOS/Calib/Mapping");
168 if(entry)
169 fgkMaps = (TObjArray*)entry->GetObject();
170
171 return fgkMaps;
172
173}