ATLAS Offline Software
Loading...
Searching...
No Matches
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}
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
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
CaloSampling::CaloSample CaloSample
Definition CaloCell_ID.h:53
This class groups all DetDescr information related to a CaloCell.
This class provides the client interface for accessing the detector description information common to...
static double fix(double phi)