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  switch (layer) {
13  case PS2:
14  return CaloID(CaloID::DET_PS2);
15  case PS1:
16  return CaloID(CaloID::DET_PS1);
17  case ECAL_ENDCAP:
19  case ECAL_BARREL:
21  case HCAL_BARREL1:
23  case HCAL_BARREL2:
24  return CaloID(CaloID::DET_HO);
25  case HCAL_ENDCAP:
27  case HF_EM:
28  return CaloID(CaloID::DET_HF_EM);
29  case HF_HAD:
30  return CaloID(CaloID::DET_HF_HAD);
31  case HGCAL:
33  default:
34  return CaloID();
35  }
36 }
37 
39  // cout<<"PFLayer::fromCaloID "<<id<<" "<<id.detector()<<endl;
40  if (!id.isSingleDetector()) {
41  edm::LogError("PFLayer") << "cannot convert " << id
42  << " to a layer, as this CaloID does not correspond to a single detector";
43  }
44 
45  switch (id.detector()) {
47  return ECAL_BARREL;
49  return ECAL_ENDCAP;
50  case CaloID::DET_PS1:
51  return PS1;
52  case CaloID::DET_PS2:
53  return PS2;
55  return HCAL_BARREL1;
57  return HCAL_ENDCAP;
58  case CaloID::DET_HF_EM:
59  return HF_EM;
60  case CaloID::DET_HF_HAD:
61  return HF_HAD;
62  case CaloID::DET_HO:
63  return HCAL_BARREL2;
65  return HGCAL;
66  default:
67  return NONE;
68  }
69 }
Log< level::Error, false > LogError
constexpr std::array< uint8_t, layerIndexSize > layer
Layer
layer definition
Definition: PFLayer.h:29
static reco::CaloID toCaloID(Layer layer)
Definition: PFLayer.cc:11
fixed size matrix
static Layer fromCaloID(const reco::CaloID &id)
Definition: PFLayer.cc:38