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),
39 fEMCSampleQualityCut(1.),
41 fEMCEcore2ESD(kFALSE),
42 fEMCSubtractPedestals(kTRUE),
44 fEMCEnergyCorrectionOn(kTRUE),
45 fEMCDecoderVersion(""),
46 fGlobalAltroOffset(0),
47 fCPVClusteringThreshold(0.0),
53 //Default constructor.
56 //-----------------------------------------------------------------------------
57 AliPHOSRecoParam::AliPHOSRecoParam(const AliPHOSRecoParam& ):
58 AliDetectorRecoParam(),
59 fEMCClusteringThreshold(0.2),
63 fEMCSampleQualityCut(1.),
65 fEMCEcore2ESD(kFALSE),
66 fEMCSubtractPedestals(kTRUE),
68 fEMCEnergyCorrectionOn(kTRUE),
69 fEMCDecoderVersion(""),
70 fGlobalAltroOffset(0),
71 fCPVClusteringThreshold(0.0),
80 //-----------------------------------------------------------------------------
81 AliPHOSRecoParam& AliPHOSRecoParam::operator = (const AliPHOSRecoParam& recoParam)
83 //Assignment operator.
85 if(this != &recoParam) {
86 fEMCClusteringThreshold = recoParam.fEMCClusteringThreshold;
87 fEMCLocMaxCut = recoParam.fEMCLocMaxCut;
88 fEMCMinE = recoParam.fEMCMinE;
89 fEMCW0 = recoParam.fEMCW0;
90 fEMCSampleQualityCut = recoParam.fEMCSampleQualityCut;
91 fEMCEcoreRadius = recoParam.fEMCEcoreRadius;
92 fEMCEcore2ESD = recoParam.fEMCEcore2ESD;
93 fEMCSubtractPedestals = recoParam.fEMCSubtractPedestals;
94 fEMCUnfold = recoParam.fEMCUnfold;
95 fEMCEnergyCorrectionOn = recoParam.fEMCEnergyCorrectionOn;
96 fEMCDecoderVersion = recoParam.fEMCDecoderVersion;
97 fGlobalAltroOffset = recoParam.fGlobalAltroOffset;
98 fCPVClusteringThreshold = recoParam.fCPVClusteringThreshold;
99 fCPVLocMaxCut = recoParam.fCPVLocMaxCut;
100 fCPVMinE = recoParam.fCPVMinE;
101 fCPVW0 = recoParam.fCPVW0;
102 fCPVUnfold = recoParam.fCPVUnfold;
108 //-----------------------------------------------------------------------------
109 void AliPHOSRecoParam::Print(Option_t *option) const
111 AliDebug(2,Form("PHOS reconstruction parameters:\n"
112 "\tEMCClusteringThreshold = %f\n"
113 "\tEMCLocMaxCut = %f\n"
116 "\tEMCSampleQualityCut = %f\n"
117 "\tEMCEcoreRadius = %f\n"
118 "\tEMCEcore2ESD = %d\n"
119 "\tEMCSubtractPedestals = %d\n"
121 "\tEMCEnergyCorrectionOn = %d\n"
122 "\tEMCDecoderVersion = \"%s\"\n"
123 "\tGlobalAltroOffset = %d",
124 fEMCClusteringThreshold,
128 fEMCSampleQualityCut,
131 fEMCSubtractPedestals,
133 fEMCEnergyCorrectionOn,
134 fEMCDecoderVersion.Data(),
135 fGlobalAltroOffset));
139 //-----------------------------------------------------------------------------
140 AliPHOSRecoParam* AliPHOSRecoParam::GetDefaultParameters()
142 //Default parameters for the reconstruction
144 AliPHOSRecoParam* params = new AliPHOSRecoParam();
148 //-----------------------------------------------------------------------------
149 const TObjArray* AliPHOSRecoParam::GetMappings()
151 //Returns array of AliAltroMappings for RCU0..RCU3.
152 //If not found, read it from OCDB.
154 //Quick check as follows:
155 // root [0] AliCDBManager::Instance()->SetDefaultStorage("local://$ALICE_ROOT");
156 // root [1] AliCDBManager::Instance()->SetRun(1);
157 // root [2] TObjArray* maps = AliPHOSRecoParam::GetMappings();
158 // root [3] maps->Print();
160 if(fgkMaps) return fgkMaps;
162 AliCDBEntry* entry = AliCDBManager::Instance()->Get("PHOS/Calib/Mapping");
164 fgkMaps = (TObjArray*)entry->GetObject();