ATLAS Offline Software
MmReadoutGeomTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include <GaudiKernel/SystemOfUnits.h>
9 
12 #include <GeoModelKernel/GeoFullPhysVol.h>
13 #include <GeoModelKernel/GeoPhysVol.h>
14 #include <GeoModelKernel/GeoTrd.h>
15 
16 #include <GeoModelRead/ReadGeoModel.h>
19 
20 using namespace ActsTrk;
21 
22 using namespace CxxUtils;
23 
24 namespace MuonGMR4 {
25 
26 
28 
29 MmReadoutGeomTool::MmReadoutGeomTool(const std::string& type,
30  const std::string& name,
31  const IInterface* parent)
32  : AthAlgTool{type, name, parent} {
33  declareInterface<IMuonReadoutGeomTool>(this);
34 
35 }
37  FactoryCache& factoryCache) {
38 
39  ATH_MSG_VERBOSE("Load dimensions of "<<m_idHelperSvc->toString(define.detElId)
40  <<std::endl<<std::endl<<m_geoUtilTool->dumpVolume(define.physVol->getParent()));
41  const GeoShape* shape = m_geoUtilTool->extractShape(define.physVol);
42  if (!shape) {
43  ATH_MSG_FATAL("Failed to deduce a valid shape for "<<m_idHelperSvc->toString(define.detElId));
44  return StatusCode::FAILURE;
45  }
46  ATH_MSG_DEBUG("Extracted shape "<<m_geoUtilTool->dumpShape(shape));
48  if (shape->typeID() != GeoTrd::getClassTypeID()) {
49  ATH_MSG_FATAL(__FILE__<<":"<<__LINE__<<" expect shape to be a trapezoid but it's "<<m_geoUtilTool->dumpShape(shape));
50  return StatusCode::FAILURE;
51  }
52 
53  const GeoTrd* trapezoid = static_cast<const GeoTrd*>(shape);
54  define.halfThickness = trapezoid->getXHalfLength1() * Gaudi::Units::mm;
55  define.halfShortWidth = trapezoid->getYHalfLength1() * Gaudi::Units::mm;
56  define.halfLongWidth = trapezoid->getYHalfLength2() * Gaudi::Units::mm;
57  define.halfHeight = trapezoid->getZHalfLength() * Gaudi::Units::mm;
58 
59  ATH_MSG_DEBUG("Extracted parameters "
60  <<", halfThickness: "<<define.halfThickness<<"/"
61  <<", halfShortWidth : "<<define.halfShortWidth<<"/"
62  <<", halfLongWidth : "<<define.halfLongWidth<<"/"
63  <<", halfHeight : "<<define.halfHeight);
64 
65 
66  std::vector<physVolWithTrans> allGasGaps = m_geoUtilTool->findAllLeafNodesByName(define.physVol, "actMicroMegaGas");
67  if (allGasGaps.empty()) {
68  ATH_MSG_FATAL("The volume "<<m_idHelperSvc->toStringDetEl(define.detElId)<<" does not have any children actMicroMegaGas");
69  return StatusCode::FAILURE;
70  }
71 
73  define.nGasGaps = allGasGaps.size();
74  ATH_MSG_VERBOSE("The number of gasGaps are: " << define.nGasGaps);
75 
76  FactoryCache::ParamBookTable::const_iterator parBookItr = factoryCache.parameterBook.find(define.chambDesign);
77  if (parBookItr == factoryCache.parameterBook.end()) {
78  ATH_MSG_FATAL("The chamber "<<define.chambDesign<<" is not part of the WMM table");
79  return StatusCode::FAILURE;
80  }
81 
82  const wMMTable& paramBook{parBookItr->second};
83 
84  define.readoutSide = paramBook.readoutSide;
85 
86  /*Sort Gas Gaps in a module quadruplet based on their Z position
87  On side A the gas gap have local x axis translations : -24.975 , -8.175 , 8.175, 24.975
88  This order refers to the gap closest to the origin to the outermost gap of the experiement.
89  On side C the order is reversed : 24.975 , 8.175 , -8.175, -24.975.
90  I'm sorting the gas gap with the first one being closest to the experiment's origin.
91  I doing this in case the gaps aren't sorted in that way within the Full Phys Vol Quadruplet.
92  Also, now the stereoAngles and totalActiveStrips vectors will match the sequence of the allGasGaps vector.*/
93 
94  std::sort(allGasGaps.begin(), allGasGaps.end(),
95  [](const physVolWithTrans&gapI, const physVolWithTrans & gapJ) {
96  const Amg::Vector3D posGapI = gapI.transform.translation();
97  const Amg::Vector3D posGapJ = gapJ.transform.translation();
98  return posGapI.x() < posGapJ.x();
99  });
100  ATH_MSG_DEBUG("**************************************");
101  for (std::size_t gap = 0; gap < allGasGaps.size(); ++gap) {
102 
103  auto& gapVol = allGasGaps[gap];
104  const Amg::Vector3D posGapI = gapVol.transform.translation();
105 
106  //Check sorting of gasGaps. For Q1 --> Eta layers should be first. For Q2--> Stereo Layers should be first.
107  //Add ATH_MSG_INFO("**************************************"); before the gasGap loop.
108  ATH_MSG_DEBUG("quadruplet " << define.chambDesign.substr(6,7) << " stereoAngle : " << paramBook.stereoAngle.at(gap) << " totalStrips " << paramBook.totalActiveStrips.at(gap) << " GasGAP POS X : " << posGapI.x() );
109 
110  const GeoShape* gapShape = m_geoUtilTool->extractShape(gapVol.volume);
111  if (gapShape->typeID() != GeoTrd::getClassTypeID()) {
112  ATH_MSG_FATAL("Failed to extract a geo shape");
113  return StatusCode::FAILURE;
114  }
115 
116  bool isStereo = static_cast<bool>(paramBook.stereoAngle.at(gap));
117 
118  const GeoTrd* gapTrd = static_cast<const GeoTrd*>(gapShape);
119  ATH_MSG_DEBUG("MicroMegas Gas gap dimensions "<<m_geoUtilTool->dumpShape(gapTrd));
120  double gapHalfHeight = gapTrd->getZHalfLength();
121  double gapHalfShortY = std::min(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
122  double gapHalfLongY = std::max(gapTrd->getYHalfLength1(), gapTrd->getYHalfLength2());
123 
124  double firstStripPos{0.};
125  int firstActiveStrip{0};
126  if (isStereo) {
127  firstActiveStrip = paramBook.nMissedBottomStereo + 1;
128  firstStripPos = -gapHalfHeight + (1.*(firstActiveStrip - paramBook.nMissedTopEta) + 2.5)* paramBook.stripPitch;
129  } else {
130  firstActiveStrip = paramBook.nMissedBottomEta + 1;
131  firstStripPos = -gapHalfHeight + 1.5 *paramBook.stripPitch;
132  }
133 
134 
135 
136  /*The origin of the chamber/gasGap axes system is located at the center of the chamber.
137  We subtract the HalfLength across the Z axis to transform from the center to the origin of the trapezoid
138  The we add the strip pitch to reach the position of the first strip.*/
139  StripDesignPtr stripDesign = std::make_unique<StripDesign>();
140 
141  stripDesign->defineStripLayout(firstStripPos * Amg::Vector2D::UnitX(),
142  paramBook.stripPitch,
143  paramBook.stripWidth,
144  paramBook.totalActiveStrips.at(gap),
145  firstActiveStrip);
146 
148  stripDesign->defineTrapezoid(gapHalfShortY, gapHalfLongY, gapHalfHeight, paramBook.stereoAngle.at(gap));
149 
150  //Necessary strip layer rotation to match the alignment coordinate system
151  Amg::Transform3D stripLayerRotation{gapVol.transform
154  * Amg::getRotateZ3D(-stripDesign->stereoAngle())};
155 
156 
157  stripDesign = (*factoryCache.stripDesigns.emplace(stripDesign).first);
158  auto stripLayer = std::make_unique<StripLayer>(stripLayerRotation, stripDesign,
159  IdentifierHash{static_cast<unsigned int>(gap)});
160  define.layers.push_back(*factoryCache.stripLayers.emplace(std::move(stripLayer)).first);
161  } //end of gas gap loop
162  return StatusCode::SUCCESS;
163 }
164 
166  ATH_CHECK(m_geoDbTagSvc.retrieve());
167  ATH_CHECK(m_idHelperSvc.retrieve());
168  ATH_CHECK(m_geoUtilTool.retrieve());
169  GeoModelIO::ReadGeoModel* sqliteReader = m_geoDbTagSvc->getSqliteReader();
170  if (!sqliteReader) {
171  ATH_MSG_FATAL("Error, the tool works exclusively from sqlite geometry inputs");
172  return StatusCode::FAILURE;
173  }
174 
175  FactoryCache facCache{};
176  ATH_CHECK(readParameterBook(facCache));
177 
178 
179  const MmIdHelper& idHelper{m_idHelperSvc->mmIdHelper()};
180  // Get the list of full phys volumes from SQLite, and create detector elements
182  physNodeMap mapFPV = sqliteReader->getPublishedNodes<std::string, GeoFullPhysVol*>("Muon");
183 #ifndef SIMULATIONBASE
184  SurfaceBoundSetPtr<Acts::TrapezoidBounds> layerBounds= std::make_shared<SurfaceBoundSet<Acts::TrapezoidBounds>>();
185 #endif
186 
187  for (auto& [key, pv] : mapFPV) {
190  // e.g. MM_SM1Q2_1_6_1 . It's the "type" Attribute in the new GeoModel XML files.
191  std::vector<std::string> key_tokens = tokenize(key, "_");
192 
193  if (key_tokens[0].find("MM") == std::string::npos){
194  continue;
195  }
196  ATH_MSG_DEBUG("Retrieving MicroMegas Quadruplet : " << key );
197 
199  bool isValid{false};
200  define.detElId = idHelper.channelID(key_tokens[1][0] == 'S' ? "MMS" : "MML", // Replace <MM> string part with <MMS> or <MML> to match the Identifier.
201  atoi(key_tokens[2].c_str()), // Eta index
202  atoi(key_tokens[3].c_str()), // Phi index (from 0 to 7 in GeoModel). needs a +1
203  atoi(key_tokens[4].c_str()), 1, 1, isValid); //Copy Number which reflects the number of the multilayer.
204  // THen the two 1s are reflecting gasGap and channel Number. They can be set to 1s as this is all we need
205  // to get the Identifier for the multilayer.
206 
207 
208  if (!isValid) {
209  ATH_MSG_FATAL("Failed to build a good identifier out of " << key);
210  return StatusCode::FAILURE;
211  }
212 
213  ATH_MSG_DEBUG("Key "<<key<<" brought us "<<m_idHelperSvc->toStringDetEl(define.detElId));
214  define.physVol = pv;
215  define.chambDesign = key_tokens[0]+"_"+key_tokens[1]; // Recover the string denoted in WMM tables. e.g. chambDesign = "MM_SM1Q2"
216  define.alignTransform = m_geoUtilTool->findAlignableTransform(define.physVol);
217  ATH_CHECK(loadDimensions(define, facCache));
218 #ifndef SIMULATIONBASE
219  define.layerBounds = layerBounds;
220 #endif
221  std::unique_ptr<MmReadoutElement> readoutEle = std::make_unique<MmReadoutElement>(std::move(define));
222  ATH_CHECK(mgr.addMmReadoutElement(std::move(readoutEle)));
223  }
224  return StatusCode::SUCCESS;
225 }
226 
227 
228 
230 
231  ServiceHandle<IRDBAccessSvc> accessSvc(m_geoDbTagSvc->getParamSvcName(), name());
232  ATH_CHECK(accessSvc.retrieve());
233  IRDBRecordset_ptr paramTable = accessSvc->getRecordsetPtr("WMM", "");
234  if (paramTable->size() == 0) {
235  ATH_MSG_FATAL("Empty parameter book table found");
236  return StatusCode::FAILURE;
237  }
238  ATH_MSG_VERBOSE("Found the " << paramTable->nodeName() << " ["
239  << paramTable->tagName() << "] table with "
240  << paramTable->size() << " records");
241 
242 
243 
244  for (const IRDBRecord_ptr& record : *paramTable) {
245  const std::string chambType = record->getString("WMM_TYPE");
246  wMMTable& parBook = cache.parameterBook[chambType];
247  parBook.stripPitch = record->getDouble("stripPitch") ;
248  parBook.stripWidth = record->getDouble("stripWidth") ;
249  parBook.stereoAngle = tokenizeDouble(record->getString("stereoAngle"), ";");
250  parBook.totalActiveStrips = tokenizeInt(record->getString("totalActiveStrips"), ";");
251  parBook.readoutSide = tokenizeInt(record->getString("readoutSide"),";");
252  parBook.nMissedBottomEta = record->getInt("nMissedBottomEta");
253  parBook.nMissedBottomStereo = record->getInt("nMissedBottomStereo");
254  parBook.nMissedTopEta = record->getInt("nMissedTopEta");
255  parBook.distBotFrameStrip = record->getDouble("dR_botFrame1stStrip");
256 
257  ATH_MSG_VERBOSE("Extracted parameters for chamber "<<chambType
258  <<", stripPitch: "<<parBook.stripPitch
259  <<", stripWidth: "<<parBook.stripWidth
260  <<", steroAngle: "<<parBook.stereoAngle
261  <<", totalActiveStrips: "<<parBook.totalActiveStrips
262  <<", readoutSites: "<<parBook.readoutSide);
263  }
264 
265  return StatusCode::SUCCESS;
266 }
267 
268 
269 
270 
271 
272 } // namespace MuonGMR4
GeoModel::TransientConstSharedPtr< StripDesign >
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
CxxUtils::tokenizeDouble
std::vector< double > tokenizeDouble(const std::string &the_str, std::string_view delimiter)
Definition: Control/CxxUtils/Root/StringUtils.cxx:34
max
#define max(a, b)
Definition: cfImp.cxx:41
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
MuonGMR4::MuonDetectorManager
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:61
MuonGMR4::MmReadoutGeomTool::wMMTable::readoutSide
std::vector< int > readoutSide
Definition: MmReadoutGeomTool.h:44
CxxUtils::tokenizeInt
std::vector< int > tokenizeInt(const std::string &the_str, std::string_view delimiter)
Definition: Control/CxxUtils/Root/StringUtils.cxx:55
CxxUtils::tokenize
std::vector< std::string > tokenize(const std::string &the_str, std::string_view delimiters)
Splits the string into smaller substrings.
Definition: Control/CxxUtils/Root/StringUtils.cxx:15
MuonGMR4::MmReadoutGeomTool::wMMTable::stripWidth
double stripWidth
Definition: MmReadoutGeomTool.h:40
MuonGMR4::MmReadoutGeomTool::wMMTable::stereoAngle
std::vector< double > stereoAngle
Definition: MmReadoutGeomTool.h:42
MuonGMR4::MmReadoutGeomTool::FactoryCache::parameterBook
ParamBookTable parameterBook
Definition: MmReadoutGeomTool.h:58
deg
#define deg
Definition: SbPolyhedron.cxx:17
MuonGMR4::MmReadoutElement::parameterBook::halfThickness
double halfThickness
Trapezoid dimensions of MicroMegas envelope half-thickness along z-axis.
Definition: MmReadoutElement.h:26
MuonGMR4::MmReadoutGeomTool::FactoryCache
Definition: MmReadoutGeomTool.h:52
MuonGMR4::MmReadoutElement::parameterBook::readoutSide
std::vector< int > readoutSide
Readout sides.
Definition: MmReadoutElement.h:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
isValid
bool isValid(const T &p)
Definition: AtlasPID.h:214
MuonGMR4::MmReadoutElement::parameterBook::halfShortWidth
double halfShortWidth
width of the lower edge
Definition: MmReadoutElement.h:28
CaloSwCorrections.gap
def gap(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:212
Amg::getRotateZ3D
Amg::Transform3D getRotateZ3D(double angle)
get a rotation transformation around Z-axis
Definition: GeoPrimitivesHelpers.h:270
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
Amg::getRotateX3D
Amg::Transform3D getRotateX3D(double angle)
get a rotation transformation around X-axis
Definition: GeoPrimitivesHelpers.h:252
MuonGMR4::MmReadoutElement::parameterBook::nGasGaps
unsigned int nGasGaps
number of gasGaps
Definition: MmReadoutElement.h:34
MuonGMR4::MmReadoutGeomTool::wMMTable::totalActiveStrips
std::vector< int > totalActiveStrips
Definition: MmReadoutGeomTool.h:43
IRDBAccessSvc.h
Definition of the abstract IRDBAccessSvc interface.
MuonGMR4
A muon chamber is a collection of readout elements belonging to the same station.
Definition: ChamberAssembleTool.h:16
EventPrimitivesToStringConverter.h
MuonGMR4::MmReadoutGeomTool::wMMTable::distBotFrameStrip
double distBotFrameStrip
Definition: MmReadoutGeomTool.h:41
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
MuonGMR4::MmReadoutElement::parameterBook::halfHeight
double halfHeight
length in the radial direction
Definition: MmReadoutElement.h:32
MuonGMR4::MmReadoutGeomTool::wMMTable::stripPitch
double stripPitch
Definition: MmReadoutGeomTool.h:39
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
CxxUtils
Definition: aligned_vector.h:29
MuonDetectorManager.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonGMR4::MmReadoutElement::parameterBook::halfLongWidth
double halfLongWidth
width of the upper edge
Definition: MmReadoutElement.h:30
MuonGMR4::MmReadoutGeomTool::buildReadOutElements
StatusCode buildReadOutElements(MuonDetectorManager &mgr) override final
Retrieves the GeoModel from the GeoModelSvc and append the ReadoutElements of the Given MuonDetectorT...
Definition: MmReadoutGeomTool.cxx:165
IRDBRecordset_ptr
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition: IRDBAccessSvc.h:25
MuonGMR4::MmReadoutGeomTool::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MmReadoutGeomTool.h:30
min
#define min(a, b)
Definition: cfImp.cxx:40
MuonGMR4::MmReadoutElement::parameterBook::layers
std::vector< StripLayerPtr > layers
Pointers to the strip layers.
Definition: MmReadoutElement.h:38
MuonGMR4::MuonReadoutElement::defineArgs::chambDesign
std::string chambDesign
chamber design name as it's occuring in the parameter book tables E.g. BMS5, RPC10,...
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:49
MuonGMR4::MmReadoutGeomTool::FactoryCache::stripLayers
std::set< StripLayerPtr, StripLayerSorter > stripLayers
Definition: MmReadoutGeomTool.h:56
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
MuonGMR4::MmReadoutGeomTool::m_geoDbTagSvc
ServiceHandle< IGeoDbTagSvc > m_geoDbTagSvc
Definition: MmReadoutGeomTool.h:33
MuonGMR4::physVolWithTrans
IMuonGeoUtilityTool::physVolWithTrans physVolWithTrans
Definition: MdtReadoutGeomTool.cxx:25
Amg::getRotateY3D
Amg::Transform3D getRotateY3D(double angle)
get a rotation transformation around Y-axis
Definition: GeoPrimitivesHelpers.h:261
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonGMR4::MmReadoutGeomTool::readParameterBook
StatusCode readParameterBook(FactoryCache &cache)
Retrieves the auxillary tables from the database.
Definition: MmReadoutGeomTool.cxx:229
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
MuonGMR4::MmReadoutGeomTool::wMMTable
Struct to cache the relevant parameters of from the WRPC tables.
Definition: MmReadoutGeomTool.h:38
MuonGMR4::MmReadoutGeomTool::m_geoUtilTool
PublicToolHandle< IMuonGeoUtilityTool > m_geoUtilTool
Definition: MmReadoutGeomTool.h:35
IRDBRecord.h
Definition of the abstract IRDBRecord interface.
MmIdHelper
Definition: MmIdHelper.h:54
MuonGMR4::MmReadoutGeomTool::wMMTable::nMissedBottomEta
int nMissedBottomEta
Definition: MmReadoutGeomTool.h:45
GeoPrimitivesHelpers.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
IRDBRecord_ptr
std::unique_ptr< IRDBRecord > IRDBRecord_ptr
Definition: IRDBRecordset.h:23
python.changerun.pv
pv
Definition: changerun.py:81
MuonGMR4::MmReadoutGeomTool::wMMTable::nMissedTopEta
int nMissedTopEta
Definition: MmReadoutGeomTool.h:47
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
MuonGMR4::MuonReadoutElement::defineArgs::detElId
Identifier detElId
ATLAS identifier.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:51
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:34
ActsTrk::SurfaceBoundSetPtr
std::shared_ptr< SurfaceBoundSet< BoundType > > SurfaceBoundSetPtr
Aberivation to create a new SurfaceBoundSetPtr.
Definition: SurfaceBoundSet.h:50
IRDBRecordset.h
Definition of the abstract IRDBRecordset interface.
AthAlgTool
Definition: AthAlgTool.h:26
MuonGMR4::IMuonReadoutGeomTool::physNodeMap
std::map< std::string, GeoFullPhysVol * > physNodeMap
Definition: IMuonReaoutGeomTool.h:25
MuonGMR4::MuonReadoutElement::defineArgs::physVol
GeoIntrusivePtr< GeoVFullPhysVol > physVol
Pointer to the underlying physical volume in GeoModel.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:45
MuonGMR4::MmReadoutGeomTool::wMMTable::nMissedBottomStereo
int nMissedBottomStereo
Definition: MmReadoutGeomTool.h:46
MuonGMR4::MmReadoutGeomTool::FactoryCache::stripDesigns
std::set< StripDesignPtr, StripDesignSorter > stripDesigns
Definition: MmReadoutGeomTool.h:55
MmReadoutGeomTool.h
MuonGMR4::MmReadoutElement::defineArgs
Definition: MmReadoutElement.h:48
MuonGMR4::MmReadoutGeomTool::loadDimensions
StatusCode loadDimensions(MmReadoutElement::defineArgs &args, FactoryCache &factory)
Loads the chamber dimensions from GeoModel.
Definition: MmReadoutGeomTool.cxx:36
ServiceHandle< IRDBAccessSvc >
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37