src
Fireworks
SimData
plugins
FWECaloParticleProxyBuilder.cc
Go to the documentation of this file.
1
#include "
Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h
"
2
#include "
Fireworks/Core/interface/Context.h
"
3
#include "
Fireworks/Core/interface/FWGeometry.h
"
4
#include "
SimDataFormats/CaloAnalysis/interface/CaloParticle.h
"
5
#include "
SimDataFormats/CaloAnalysis/interface/CaloParticleFwd.h
"
6
#include "
SimDataFormats/CaloAnalysis/interface/SimCluster.h
"
7
8
#include "TEveBoxSet.h"
9
10
class
FWECaloParticleProxyBuilder
:
public
FWSimpleProxyBuilderTemplate
<CaloParticle> {
11
public
:
12
FWECaloParticleProxyBuilder
(
void
) {}
13
~FWECaloParticleProxyBuilder
(
void
)
override
{}
14
15
REGISTER_PROXYBUILDER_METHODS
();
16
17
// Disable default copy constructor
18
FWECaloParticleProxyBuilder
(
const
FWECaloParticleProxyBuilder
&) =
delete
;
19
// Disable default assignment operator
20
const
FWECaloParticleProxyBuilder
&
operator=
(
const
FWECaloParticleProxyBuilder
&) =
delete
;
21
22
private
:
23
void
build
(
const
CaloParticle
&iData,
unsigned
int
iIndex, TEveElement &oItemHolder,
const
FWViewContext
*)
override
;
24
};
25
26
void
FWECaloParticleProxyBuilder::build
(
const
CaloParticle
&iData,
27
unsigned
int
iIndex,
28
TEveElement &oItemHolder,
29
const
FWViewContext
*) {
30
TEveBoxSet *boxset =
new
TEveBoxSet();
31
boxset->UseSingleColor();
32
boxset->SetPickable(
true
);
33
boxset->Reset(TEveBoxSet::kBT_FreeBox,
true
, 64);
34
boxset->SetAntiFlick(
true
);
35
36
for
(
const
auto
&
c
: iData.
simClusters
()) {
37
for
(
const
auto
&
it
: (*c).hits_and_fractions()) {
38
if
(
DetId
(
it
.first).
det
() != DetId::Detector::Ecal) {
39
std::cerr
<<
"this proxy should be used only for ECAL"
;
40
return
;
41
}
42
43
const
float
*corners =
item
()->
getGeom
()->
getCorners
(
it
.first);
44
if
(corners ==
nullptr
)
45
continue
;
46
47
boxset->AddBox(corners);
48
}
49
}
50
51
boxset->RefitPlex();
52
boxset->CSCTakeAnyParentAsMaster();
53
boxset->CSCApplyMainColorToMatchingChildren();
54
boxset->CSCApplyMainTransparencyToMatchingChildren();
55
boxset->SetMainColor(
item
()->modelInfo(iIndex).displayProperties().color());
56
boxset->SetMainTransparency(
item
()->defaultDisplayProperties().transparency());
57
oItemHolder.AddElement(boxset);
58
}
59
60
REGISTER_FWPROXYBUILDER
(
FWECaloParticleProxyBuilder
,
61
CaloParticle
,
62
"ECaloParticle"
,
63
FWViewType::kAll3DBits
|
FWViewType::kAllRPZBits
);
SimCluster.h
FWSimpleProxyBuilderTemplate.h
CaloParticle.h
REGISTER_PROXYBUILDER_METHODS
#define REGISTER_PROXYBUILDER_METHODS()
Definition:
register_dataproxybuilder_macro.h:31
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition:
FWProxyBuilderFactory.h:33
FWGeometry.h
FWViewType::kAllRPZBits
static const int kAllRPZBits
Definition:
FWViewType.h:67
CaloParticle::simClusters
const SimClusterRefVector & simClusters() const
Definition:
CaloParticle.h:72
FWECaloParticleProxyBuilder
Definition:
FWECaloParticleProxyBuilder.cc:10
FWViewContext
Definition:
FWViewContext.h:32
Context.h
CaloParticleFwd.h
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition:
DetId.h:46
HltBtagPostValidation_cff.c
c
Definition:
HltBtagPostValidation_cff.py:35
FWViewType::kAll3DBits
static const int kAll3DBits
Definition:
FWViewType.h:68
FWGeometry::getCorners
const float * getCorners(unsigned int id) const
Definition:
FWGeometry.cc:439
FWECaloParticleProxyBuilder::~FWECaloParticleProxyBuilder
~FWECaloParticleProxyBuilder(void) override
Definition:
FWECaloParticleProxyBuilder.cc:13
FWECaloParticleProxyBuilder::operator=
const FWECaloParticleProxyBuilder & operator=(const FWECaloParticleProxyBuilder &)=delete
FWProxyBuilderBase::build
void build()
Definition:
FWProxyBuilderBase.cc:110
DetId
Definition:
DetId.h:17
CaloParticle
Definition:
CaloParticle.h:16
FWEventItem::getGeom
const FWGeometry * getGeom() const
Definition:
FWEventItem.cc:548
DMR_cfg.cerr
cerr
Definition:
DMR_cfg.py:78
ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it
auto & it
Definition:
splitVertices.h:48
FWECaloParticleProxyBuilder::FWECaloParticleProxyBuilder
FWECaloParticleProxyBuilder(void)
Definition:
FWECaloParticleProxyBuilder.cc:12
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition:
FWProxyBuilderBase.h:64
FWSimpleProxyBuilderTemplate
Definition:
FWSimpleProxyBuilderTemplate.h:30
Generated for CMSSW Reference Manual by
1.8.14