Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
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
default
:
return
CaloID
();
24
}
25
}
26
27
28
PFLayer::Layer
PFLayer::fromCaloID
(
const
CaloID
&
id
) {
29
30
// cout<<"PFLayer::fromCaloID "<<id<<" "<<id.detector()<<endl;
31
if
( !
id
.isSingleDetector() ) {
32
edm::LogError
(
"PFLayer"
)<<
"cannot convert "
<<
id
<<
" to a layer, as this CaloID does not correspond to a single detector"
;
33
}
34
35
switch
(
id
.detector() ) {
36
case
CaloID::DET_ECAL_BARREL
:
return
ECAL_BARREL;
37
case
CaloID::DET_ECAL_ENDCAP
:
return
ECAL_ENDCAP;
38
case
CaloID::DET_PS1
:
return
PS1;
39
case
CaloID::DET_PS2
:
return
PS2;
40
case
CaloID::DET_HCAL_BARREL
:
return
HCAL_BARREL1;
41
case
CaloID::DET_HCAL_ENDCAP
:
return
HCAL_ENDCAP;
42
case
CaloID::DET_HF_EM
:
return
HF_EM;
43
case
CaloID::DET_HF_HAD
:
return
HF_HAD;
44
case
CaloID::DET_HO
:
return
HCAL_BARREL2;
45
default
:
return
NONE
;
46
}
47
}
reco::CaloID::DET_ECAL_BARREL
Definition:
CaloID.h:22
MessageLogger.h
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:105
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
NONE
Definition:
CaloDirection.h:9
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:28
reco::CaloID::DET_HO
Definition:
CaloID.h:31
Generated for CMSSW Reference Manual by
1.8.5