CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
CaloCellId Class Reference

#include <CaloCellId.h>

Public Types

enum  System { Barrel = 1, Endcap = 2, Forward = 3 }
 

Public Member Functions

 CaloCellId (double theEtaMin, double theEtaMax, double thePhiMin, double thePhiMax, System theSubSys)
 
 CaloCellId (const CaloCellId &)
 
double getEtaMax () const
 
double getEtaMin () const
 
double getPhiMax () const
 
double getPhiMin () const
 
System getSubSys () const
 
double getThetaCell ()
 
bool isInCell (double thisEta, double thisPhi)
 
bool operator== (const CaloCellId &) const
 
virtual ~CaloCellId ()
 

Private Attributes

double etaMax
 
double etaMin
 
double phiMax
 
double phiMin
 
System subSys
 

Detailed Description

Definition at line 14 of file CaloCellId.h.

Member Enumeration Documentation

◆ System

Enumerator
Barrel 
Endcap 
Forward 

Definition at line 16 of file CaloCellId.h.

Constructor & Destructor Documentation

◆ CaloCellId() [1/2]

CaloCellId::CaloCellId ( double  theEtaMin,
double  theEtaMax,
double  thePhiMin,
double  thePhiMax,
System  theSubSys 
)

Definition at line 19 of file CaloCellId.cc.

20  : etaMin(theEtaMin), etaMax(theEtaMax), phiMin(thePhiMin), phiMax(thePhiMax), subSys(theSubSys) {}
double phiMin
Definition: CaloCellId.h:37
System subSys
Definition: CaloCellId.h:39
double phiMax
Definition: CaloCellId.h:38
double etaMax
Definition: CaloCellId.h:36
double etaMin
Definition: CaloCellId.h:35

◆ CaloCellId() [2/2]

CaloCellId::CaloCellId ( const CaloCellId id)

Definition at line 22 of file CaloCellId.cc.

23  : etaMin(id.etaMin), etaMax(id.etaMax), phiMin(id.phiMin), phiMax(id.phiMax), subSys(id.subSys) {}
double phiMin
Definition: CaloCellId.h:37
System subSys
Definition: CaloCellId.h:39
double phiMax
Definition: CaloCellId.h:38
double etaMax
Definition: CaloCellId.h:36
double etaMin
Definition: CaloCellId.h:35

◆ ~CaloCellId()

CaloCellId::~CaloCellId ( )
virtual

Definition at line 25 of file CaloCellId.cc.

25 {}

Member Function Documentation

◆ getEtaMax()

double CaloCellId::getEtaMax ( ) const
inline

Definition at line 23 of file CaloCellId.h.

References etaMax.

23 { return etaMax; }
double etaMax
Definition: CaloCellId.h:36

◆ getEtaMin()

double CaloCellId::getEtaMin ( ) const
inline

Definition at line 22 of file CaloCellId.h.

References etaMin.

Referenced by MBUEandQCDValidation::analyze().

22 { return etaMin; }
double etaMin
Definition: CaloCellId.h:35

◆ getPhiMax()

double CaloCellId::getPhiMax ( ) const
inline

Definition at line 25 of file CaloCellId.h.

References phiMax.

25 { return phiMax; }
double phiMax
Definition: CaloCellId.h:38

◆ getPhiMin()

double CaloCellId::getPhiMin ( ) const
inline

Definition at line 24 of file CaloCellId.h.

References phiMin.

24 { return phiMin; }
double phiMin
Definition: CaloCellId.h:37

◆ getSubSys()

System CaloCellId::getSubSys ( ) const
inline

Definition at line 26 of file CaloCellId.h.

References subSys.

Referenced by MBUEandQCDValidation::analyze().

26 { return subSys; }
System subSys
Definition: CaloCellId.h:39

◆ getThetaCell()

double CaloCellId::getThetaCell ( )

Definition at line 49 of file CaloCellId.cc.

References etaMax, etaMin, JetChargeProducer_cfi::exp, and theta().

Referenced by MBUEandQCDValidation::analyze().

49  {
50  double etaAve = 0.5 * (etaMax + etaMin);
51  double theta = 2. * std::atan(std::exp(-1. * etaAve));
52  return theta;
53 }
double etaMax
Definition: CaloCellId.h:36
Geom::Theta< T > theta() const
double etaMin
Definition: CaloCellId.h:35

◆ isInCell()

bool CaloCellId::isInCell ( double  thisEta,
double  thisPhi 
)

Definition at line 34 of file CaloCellId.cc.

References etaMin, phiMax, phiMin, and pi.

34  {
35  double myPhi = thisPhi;
36 
37  bool itIs = false;
38  if (myPhi < -1. * CLHEP::pi) {
39  myPhi = myPhi + CLHEP::twopi;
40  } else if (myPhi > CLHEP::pi) {
41  myPhi = myPhi - CLHEP::twopi;
42  }
43  if (thisEta >= etaMin && thisEta < etaMax && myPhi >= phiMin && myPhi < phiMax) {
44  itIs = true;
45  }
46  return itIs;
47 }
const Double_t pi
double phiMin
Definition: CaloCellId.h:37
double phiMax
Definition: CaloCellId.h:38
double etaMin
Definition: CaloCellId.h:35

◆ operator==()

bool CaloCellId::operator== ( const CaloCellId id) const

Definition at line 27 of file CaloCellId.cc.

References etaMax, etaMin, phiMax, phiMin, subSys, and funct::true.

27  {
28  return (etaMin == id.etaMin && etaMax == id.etaMax && phiMin == id.phiMin && phiMax == id.phiMax &&
29  subSys == id.subSys)
30  ? true
31  : false;
32 }
double phiMin
Definition: CaloCellId.h:37
System subSys
Definition: CaloCellId.h:39
double phiMax
Definition: CaloCellId.h:38
double etaMax
Definition: CaloCellId.h:36
double etaMin
Definition: CaloCellId.h:35

Member Data Documentation

◆ etaMax

double CaloCellId::etaMax
private

Definition at line 36 of file CaloCellId.h.

Referenced by getEtaMax(), getThetaCell(), and operator==().

◆ etaMin

double CaloCellId::etaMin
private

Definition at line 35 of file CaloCellId.h.

Referenced by getEtaMin(), getThetaCell(), isInCell(), and operator==().

◆ phiMax

double CaloCellId::phiMax
private

Definition at line 38 of file CaloCellId.h.

Referenced by getPhiMax(), isInCell(), and operator==().

◆ phiMin

double CaloCellId::phiMin
private

Definition at line 37 of file CaloCellId.h.

Referenced by getPhiMin(), isInCell(), and operator==().

◆ subSys

System CaloCellId::subSys
private

Definition at line 39 of file CaloCellId.h.

Referenced by getSubSys(), and operator==().