CMS 3D CMS Logo

PFLayer.cc
Go to the documentation of this file.
2 
4 
5 #include <cassert>
6 #include <iostream>
7 
8 using namespace reco;
9 using namespace std;
10 
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  case HGCAL : return CaloID(CaloID::DET_HGCAL_ENDCAP);
24  default : return CaloID();
25  }
26 }
27 
28 
30 
31  // cout<<"PFLayer::fromCaloID "<<id<<" "<<id.detector()<<endl;
32  if( !id.isSingleDetector() ) {
33  edm::LogError("PFLayer")<<"cannot convert "<<id<<" to a layer, as this CaloID does not correspond to a single detector";
34  }
35 
36  switch( id.detector() ) {
37  case CaloID::DET_ECAL_BARREL : return ECAL_BARREL;
38  case CaloID::DET_ECAL_ENDCAP : return ECAL_ENDCAP;
39  case CaloID::DET_PS1 : return PS1;
40  case CaloID::DET_PS2 : return PS2;
41  case CaloID::DET_HCAL_BARREL : return HCAL_BARREL1;
42  case CaloID::DET_HCAL_ENDCAP : return HCAL_ENDCAP;
43  case CaloID::DET_HF_EM : return HF_EM;
44  case CaloID::DET_HF_HAD : return HF_HAD;
45  case CaloID::DET_HO : return HCAL_BARREL2;
46  case CaloID::DET_HGCAL_ENDCAP : return HGCAL;
47  default : return NONE;
48  }
49 }
Layer
layer definition
Definition: PFLayer.h:31
static reco::CaloID toCaloID(Layer layer)
Definition: PFLayer.cc:11
fixed size matrix
static Layer fromCaloID(const reco::CaloID &id)
Definition: PFLayer.cc:29