DataFormats
ParticleFlowReco
src
PFLayer.cc
Go to the documentation of this file.
1
#include "
DataFormats/ParticleFlowReco/interface/PFLayer.h
"
2
3
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
4
5
#include <cassert>
6
#include <iostream>
7
8
using namespace
reco
;
9
using namespace
std
;
10
11
CaloID
PFLayer::toCaloID
(
Layer
layer) {
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:
18
return
CaloID
(
CaloID::DET_ECAL_ENDCAP
);
19
case
ECAL_BARREL:
20
return
CaloID
(
CaloID::DET_ECAL_BARREL
);
21
case
HCAL_BARREL1:
22
return
CaloID
(
CaloID::DET_HCAL_BARREL
);
23
case
HCAL_BARREL2:
24
return
CaloID
(
CaloID::DET_HO
);
25
case
HCAL_ENDCAP:
26
return
CaloID
(
CaloID::DET_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:
32
return
CaloID
(
CaloID::DET_HGCAL_ENDCAP
);
33
default
:
34
return
CaloID
();
35
}
36
}
37
38
PFLayer::Layer
PFLayer::fromCaloID
(
const
CaloID
&
id
) {
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
()) {
46
case
CaloID::DET_ECAL_BARREL
:
47
return
ECAL_BARREL;
48
case
CaloID::DET_ECAL_ENDCAP
:
49
return
ECAL_ENDCAP;
50
case
CaloID::DET_PS1
:
51
return
PS1;
52
case
CaloID::DET_PS2
:
53
return
PS2;
54
case
CaloID::DET_HCAL_BARREL
:
55
return
HCAL_BARREL1;
56
case
CaloID::DET_HCAL_ENDCAP
:
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;
64
case
CaloID::DET_HGCAL_ENDCAP
:
65
return
HGCAL;
66
default
:
67
return
NONE
;
68
}
69
}
MessageLogger.h
reco::CaloID::DET_HGCAL_ENDCAP
Definition:
CaloID.h:30
PFLayer::toCaloID
static reco::CaloID toCaloID(Layer layer)
Definition:
PFLayer.cc:11
reco::CaloID::DET_ECAL_ENDCAP
Definition:
CaloID.h:21
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:45
reco::CaloID::DET_PS2
Definition:
CaloID.h:23
PFLayer.h
reco::CaloID::DET_HF_HAD
Definition:
CaloID.h:28
reco::CaloID::DET_HF_EM
Definition:
CaloID.h:27
PFLayer::Layer
Layer
layer definition
Definition:
PFLayer.h:29
reco::CaloID::DET_HCAL_ENDCAP
Definition:
CaloID.h:25
reco::CaloID::DET_PS1
Definition:
CaloID.h:22
edm::LogError
Definition:
MessageLogger.h:183
reco::CaloID::DET_HCAL_BARREL
Definition:
CaloID.h:24
reco::CaloID
Definition:
CaloID.h:17
std
Definition:
JetResolutionObject.h:76
NONE
Definition:
TkAlStyle.cc:47
hgcalTestNeighbor_cfi.detector
detector
Definition:
hgcalTestNeighbor_cfi.py:6
reco::CaloID::DET_HO
Definition:
CaloID.h:29
PFLayer::fromCaloID
static Layer fromCaloID(const reco::CaloID &id)
Definition:
PFLayer.cc:38
reco::CaloID::DET_ECAL_BARREL
Definition:
CaloID.h:20
Generated for CMSSW Reference Manual by
1.8.16