CMS 3D CMS Logo

FWECaloParticleProxyBuilder.cc
Go to the documentation of this file.
7 
8 #include "TEveBoxSet.h"
9 
11 public:
13  ~FWECaloParticleProxyBuilder(void) override {}
14 
16 
17 private:
18  // Disable default copy constructor
20  // Disable default assignment operator
22 
23  void build(const CaloParticle &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *) override;
24 };
25 
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 
62  "ECaloParticle",
FWSimpleProxyBuilderTemplate.h
FWGeometry::getCorners
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:464
FWECaloParticleProxyBuilder
Definition: FWECaloParticleProxyBuilder.cc:10
FWViewType::kAllRPZBits
static const int kAllRPZBits
Definition: FWViewType.h:67
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition: FWProxyBuilderFactory.h:33
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
CaloParticleFwd.h
REGISTER_PROXYBUILDER_METHODS
#define REGISTER_PROXYBUILDER_METHODS()
Definition: register_dataproxybuilder_macro.h:28
FWViewType::kAll3DBits
static const int kAll3DBits
Definition: FWViewType.h:68
DetId
Definition: DetId.h:17
SimCluster.h
FWGeometry.h
CaloParticle
Definition: CaloParticle.h:16
FWECaloParticleProxyBuilder::~FWECaloParticleProxyBuilder
~FWECaloParticleProxyBuilder(void) override
Definition: FWECaloParticleProxyBuilder.cc:13
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
CaloParticle.h
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
FWProxyBuilderBase::build
void build()
Definition: FWProxyBuilderBase.cc:110
FWViewContext
Definition: FWViewContext.h:32
FWEventItem::getGeom
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition: FWProxyBuilderBase.h:64
FWSimpleProxyBuilderTemplate
Definition: FWSimpleProxyBuilderTemplate.h:30
CaloParticle::simClusters
const SimClusterRefVector & simClusters() const
Definition: CaloParticle.h:72
FWECaloParticleProxyBuilder::operator=
const FWECaloParticleProxyBuilder & operator=(const FWECaloParticleProxyBuilder &)=delete
Context.h
FWECaloParticleProxyBuilder::FWECaloParticleProxyBuilder
FWECaloParticleProxyBuilder(void)
Definition: FWECaloParticleProxyBuilder.cc:12