CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Member Functions

PFLayer Class Reference

layer definition for PFRecHit and PFCluster More...

#include <PFLayer.h>

List of all members.

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
virtual ~PFLayer ()=0
 destructor

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.

             {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};

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, ExpressReco_HICollisions_FallBack::detector, and NONE.

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

                                                    {

  //  cout<<"PFLayer::fromCaloID "<<id<<" "<<id.detector()<<endl;
  if( !id.isSingleDetector() ) {
    edm::LogError("PFLayer")<<"cannot convert "<<id<<" to a layer, as this CaloID does not correspond to a single detector"; 
  }

  switch( id.detector() ) {
  case CaloID::DET_ECAL_BARREL   : return  ECAL_BARREL;  
  case CaloID::DET_ECAL_ENDCAP   : return  ECAL_ENDCAP; 
  case CaloID::DET_PS1           : return  PS1;
  case CaloID::DET_PS2           : return  PS2;
  case CaloID::DET_HCAL_BARREL   : return  HCAL_BARREL1;
  case CaloID::DET_HCAL_ENDCAP   : return  HCAL_ENDCAP;
  case CaloID::DET_HF_EM         : return  HF_EM;
  case CaloID::DET_HF_HAD        : return  HF_HAD;
  case CaloID::DET_HO            : return  HCAL_BARREL2; 
  default                        : return  NONE;
  }
}
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().

                                      {
  
  switch(layer) {
  case PS2           : return  CaloID(CaloID::DET_PS2);      
  case PS1           : return  CaloID(CaloID::DET_PS1); 
  case ECAL_ENDCAP   : return  CaloID(CaloID::DET_ECAL_ENDCAP); 
  case ECAL_BARREL   : return  CaloID(CaloID::DET_ECAL_BARREL);  
  case HCAL_BARREL1  : return  CaloID(CaloID::DET_HCAL_BARREL); 
  case HCAL_BARREL2  : return  CaloID(CaloID::DET_HO); 
  case HCAL_ENDCAP   : return  CaloID(CaloID::DET_HCAL_ENDCAP); 
  case HF_EM         : return  CaloID(CaloID::DET_HF_EM); 
  case HF_HAD        : return  CaloID(CaloID::DET_HF_HAD); 
  default            : return  CaloID();
  }
}