ATLAS Offline Software
eflowCellPosition.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /********************************************************************
6 
7 NAME: eflowCellPosition.h
8 PACKAGE: offline/Reconstruction/eflowRec
9 
10 AUTHORS: M.Hodgkinson, R Duxfield (based on R.Duxfields Root package)
11 CREATED: 18th Aug, 2005
12 
13 ********************************************************************/
14 
15 //Athena Headers
18 #include "eflowRec/eflowDatabase.h"
19 
20 #include "CaloEvent/CaloCell.h"
21 
23 
24 //C++ Headers
25 #include <cmath>
26 
28  m_layer(layer),m_deposit(deposit) {
29  m_eta = deposit->etaFF(layer) + dR;
30  m_phi = deposit->phiFF(layer);
31 }
32 
34  m_eta(cell->eta()), m_phi(cell->phi()), m_deposit(deposit) {
35  const CaloDetDescrElement* caloDDE = cell->caloDDE();
36 
37  if (caloDDE) {
38  CaloCell_ID::CaloSample caloSampl = caloDDE->getSampling();
40  } else {
42  }
43 }
44 
46  if (m_layer != rhs.m_layer) {
47  return m_layer < rhs.m_layer;
48  } else {
49  double r1 = m_deposit->dR2(m_eta, m_phi, m_layer);
50  double r2 = m_deposit->dR2(rhs.m_eta, rhs.m_phi, m_layer);
51 
52  if (fabs(r1 - r2) < 1.0e-12) {
53  if (fabs(m_eta - rhs.m_eta) < 1.0e-6) {
55  } else {
56  return (m_eta < rhs.m_eta);
57  }
58  } else {
59  return (r1 < r2);
60  }
61  }
62 }
63 
64 double eflowCellPosition::dR() const {
65  return m_deposit->dR(m_eta, m_phi, m_layer);
66 }
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
eflowCellPosition::eflowCellPosition
eflowCellPosition(const eflowAbstractCellList *deposit, eflowCaloENUM layer, double dR)
Definition: eflowCellPosition.cxx:27
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
eflowAbstractCellList::dR2
virtual double dR2(double eta, double phi, eflowCaloENUM layer) const =0
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
eflowCellPosition::dR
double dR() const
Definition: eflowCellPosition.cxx:64
eflowCellPosition.h
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
xAODP4Helpers.h
eflowCalo::Unknown
@ Unknown
Definition: eflowCaloRegions.h:50
eflowDatabase.h
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
CaloCell.h
xAOD::P4Helpers::deltaPhi
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition: xAODP4Helpers.h:69
CxxUtils::fpcompare::greater
bool greater(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition: fpcompare.h:140
eflowCellPosition
This class stores the eta,phi and layer of the calorimeter cell and defines a "<" operator which can ...
Definition: eflowCellPosition.h:36
eflowCellPosition::m_deposit
const eflowAbstractCellList * m_deposit
Definition: eflowCellPosition.h:52
eflowAbstractCellList::dR
virtual double dR(double eta, double phi, eflowCaloENUM layer) const =0
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
eflowAbstractCellList::phiFF
virtual double phiFF(eflowCaloENUM layer) const =0
eflowAbstractCellList.h
eflowCellPosition::m_layer
eflowCaloENUM m_layer
Definition: eflowCellPosition.h:50
eflowAbstractCellList::etaFF
virtual double etaFF(eflowCaloENUM layer) const =0
eflowCellPosition::m_phi
double m_phi
Definition: eflowCellPosition.h:51
eflowAbstractCellList
Definition: eflowAbstractCellList.h:31
eflowCellPosition::operator<
bool operator<(const eflowCellPosition &rhs) const
Definition: eflowCellPosition.cxx:45
eflowCalo::LAYER
LAYER
Definition: eflowCaloRegions.h:36
CaloCell
Data object for each calorimeter readout cell.
Definition: CaloCell.h:57
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
eflowCalo::translateSampl
static LAYER translateSampl(CaloCell_ID::CaloSample sampl)
Definition: eflowCaloRegions.cxx:45
eflowCellPosition::m_eta
double m_eta
Definition: eflowCellPosition.h:51