Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
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 <assert.h>
6
#include <iostream>
7
8
using namespace
reco
;
9
using namespace
std;
10
11
CaloID
PFLayer::toCaloID
(
Layer
layer) {
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
29
PFLayer::Layer
PFLayer::fromCaloID
(
const
CaloID
&
id
) {
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
}
reco::CaloID::DET_ECAL_BARREL
Definition:
CaloID.h:22
MessageLogger.h
reco::CaloID::DET_HGCAL_ENDCAP
Definition:
CaloID.h:32
reco::CaloID::DET_ECAL_ENDCAP
Definition:
CaloID.h:23
reco::CaloID
Definition:
CaloID.h:17
reco::CaloID::DET_HF_HAD
Definition:
CaloID.h:30
dt_dqm_sourceclient_common_cff.reco
tuple reco
Definition:
dt_dqm_sourceclient_common_cff.py:107
reco::CaloID::DET_PS2
Definition:
CaloID.h:25
edm::LogError
Definition:
MessageLogger.h:164
reco::CaloID::DET_HF_EM
Definition:
CaloID.h:29
reco::CaloID::DET_HCAL_ENDCAP
Definition:
CaloID.h:27
reco::CaloID::DET_HCAL_BARREL
Definition:
CaloID.h:26
reco::CaloID::DET_PS1
Definition:
CaloID.h:24
PFLayer::Layer
Layer
layer definition
Definition:
PFLayer.h:31
PFLayer.h
PFLayer::toCaloID
static reco::CaloID toCaloID(Layer layer)
Definition:
PFLayer.cc:11
PFLayer::fromCaloID
static Layer fromCaloID(const reco::CaloID &id)
Definition:
PFLayer.cc:29
reco::CaloID::DET_HO
Definition:
CaloID.h:31
NONE
Definition:
TkAlStyle.cc:47
Generated for CMSSW Reference Manual by
1.8.5