ATLAS Offline Software
CaloCellDetPos.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // for a given calorimeter layer, this class will convert detector eta,phi to Atlas eta,phi
6 // and vice versa, taking into account calorimeter alignment
7 // this assumes that the shift is the one of the cell to which the eta-phi position belongs
8 // the methods return true if an element of the correct layer is found within the cell, false otherwise
9 
11 #include "CaloDetDescr/CaloDetDescrElement.h"
12 
15  double etaAtlas, double phiAtlas,
16  double& etaDet, double& phiDet) {
17 
18  const CaloDetDescrElement* elt = mgr.get_element(sam,etaAtlas,phiAtlas);
19  if (!elt) {
20  etaDet = etaAtlas;
21  phiDet = phiAtlas;
22  return false;
23  }
24  etaDet = etaAtlas + elt->eta_raw()-elt->eta();
25  phiDet = CaloPhiRange::fix(phiAtlas + elt->phi_raw()-elt->phi());
26  return true;
27 }
28 
31  double etaDet, double phiDet,
32  double& etaAtlas,
33  double& phiAtlas) {
34 
35  const CaloDetDescrElement* elt = mgr.get_element_raw(sam,etaDet,phiDet);
36  if (!elt) {
37  etaAtlas = etaDet;
38  phiAtlas = phiDet;
39  return false;
40  }
41  etaAtlas = etaDet + elt->eta()-elt->eta_raw();
42  phiAtlas = CaloPhiRange::fix(phiDet + elt->phi()-elt->phi_raw());
43  return true;
44 }
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloDetDescrElement::eta_raw
float eta_raw() const
cell eta_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:350
BchCleanup.mgr
mgr
Definition: BchCleanup.py:294
CaloCellDetPos::getAtlasPosition
static bool getAtlasPosition(const CaloDetDescrManager &mgr, CaloCell_ID::CaloSample sam, double etaDet, double phiDet, double &etaAtlas, double &phiAtlas)
get Atlas (aligned) level eta-phi position from detector level eta-phi positions
Definition: CaloCellDetPos.cxx:29
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
CaloCellDetPos.h
CaloPhiRange::fix
static double fix(double phi)
Definition: CaloPhiRange.cxx:14
CaloCellDetPos::getDetPosition
static bool getDetPosition(const CaloDetDescrManager &mgr, CaloCell_ID::CaloSample sam, double etaAtlas, double phiAtlas, double &etaDet, double &phiDet)
get Detector level eta-phi position from Atlas level (aligned) position
Definition: CaloCellDetPos.cxx:13
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
CaloDetDescrElement::eta
float eta() const
cell eta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
CaloDetDescrElement::phi
float phi() const
cell phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
CaloDetDescrElement::phi_raw
float phi_raw() const
cell phi_raw
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:352