CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions
PFLayer Class Referenceabstract

layer definition for PFRecHit and PFCluster More...

#include <PFLayer.h>

Public Types

enum  Layer {
  PS2 = -12, PS1 = -11, ECAL_ENDCAP = -2, ECAL_BARREL = -1,
  NONE = 0, HCAL_BARREL1 = 1, HCAL_BARREL2 = 2, HCAL_ENDCAP = 3,
  HF_EM = 11, HF_HAD = 12
}
 layer definition More...
 

Public Member Functions

 PFLayer ()
 constructor More...
 
virtual ~PFLayer ()=0
 destructor More...
 

Static Public Member Functions

static Layer fromCaloID (const reco::CaloID &id)
 
static reco::CaloID toCaloID (Layer layer)
 

Detailed Description

layer definition for PFRecHit and PFCluster

These definitions are intended for internal use in the particle flow packages.

Author
Colin Bernet
Date
July 2006

Definition at line 21 of file PFLayer.h.

Member Enumeration Documentation

layer definition

Enumerator
PS2 
PS1 
ECAL_ENDCAP 
ECAL_BARREL 
NONE 
HCAL_BARREL1 
HCAL_BARREL2 
HCAL_ENDCAP 
HF_EM 
HF_HAD 

Definition at line 31 of file PFLayer.h.

31  {PS2 = -12,
32  PS1 = -11,
33  ECAL_ENDCAP = -2,
34  ECAL_BARREL = -1,
35  NONE = 0,
36  HCAL_BARREL1 = 1,
37  HCAL_BARREL2 = 2,
38  HCAL_ENDCAP = 3,
39  HF_EM = 11,
40  HF_HAD = 12};

Constructor & Destructor Documentation

PFLayer::PFLayer ( )

constructor

virtual PFLayer::~PFLayer ( )
pure virtual

destructor

Member Function Documentation

PFLayer::Layer PFLayer::fromCaloID ( const reco::CaloID id)
static

Definition at line 28 of file PFLayer.cc.

References reco::CaloID::DET_ECAL_BARREL, reco::CaloID::DET_ECAL_ENDCAP, reco::CaloID::DET_HCAL_BARREL, reco::CaloID::DET_HCAL_ENDCAP, reco::CaloID::DET_HF_EM, reco::CaloID::DET_HF_HAD, reco::CaloID::DET_HO, reco::CaloID::DET_PS1, reco::CaloID::DET_PS2, and NONE.

Referenced by reco::PFCluster::layer().

28  {
29 
30  // cout<<"PFLayer::fromCaloID "<<id<<" "<<id.detector()<<endl;
31  if( !id.isSingleDetector() ) {
32  edm::LogError("PFLayer")<<"cannot convert "<<id<<" to a layer, as this CaloID does not correspond to a single detector";
33  }
34 
35  switch( id.detector() ) {
36  case CaloID::DET_ECAL_BARREL : return ECAL_BARREL;
37  case CaloID::DET_ECAL_ENDCAP : return ECAL_ENDCAP;
38  case CaloID::DET_PS1 : return PS1;
39  case CaloID::DET_PS2 : return PS2;
40  case CaloID::DET_HCAL_BARREL : return HCAL_BARREL1;
41  case CaloID::DET_HCAL_ENDCAP : return HCAL_ENDCAP;
42  case CaloID::DET_HF_EM : return HF_EM;
43  case CaloID::DET_HF_HAD : return HF_HAD;
44  case CaloID::DET_HO : return HCAL_BARREL2;
45  default : return NONE;
46  }
47 }
CaloID PFLayer::toCaloID ( Layer  layer)
static

Definition at line 11 of file PFLayer.cc.

References reco::CaloID::DET_ECAL_BARREL, reco::CaloID::DET_ECAL_ENDCAP, reco::CaloID::DET_HCAL_BARREL, reco::CaloID::DET_HCAL_ENDCAP, reco::CaloID::DET_HF_EM, reco::CaloID::DET_HF_HAD, reco::CaloID::DET_HO, reco::CaloID::DET_PS1, and reco::CaloID::DET_PS2.

Referenced by reco::PFCluster::setLayer().

11  {
12 
13  switch(layer) {
14  case PS2 : return CaloID(CaloID::DET_PS2);
15  case PS1 : return CaloID(CaloID::DET_PS1);
16  case ECAL_ENDCAP : return CaloID(CaloID::DET_ECAL_ENDCAP);
17  case ECAL_BARREL : return CaloID(CaloID::DET_ECAL_BARREL);
18  case HCAL_BARREL1 : return CaloID(CaloID::DET_HCAL_BARREL);
19  case HCAL_BARREL2 : return CaloID(CaloID::DET_HO);
20  case HCAL_ENDCAP : return CaloID(CaloID::DET_HCAL_ENDCAP);
21  case HF_EM : return CaloID(CaloID::DET_HF_EM);
22  case HF_HAD : return CaloID(CaloID::DET_HF_HAD);
23  default : return CaloID();
24  }
25 }