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  // Disable default copy constructor
19  // Disable default assignment operator
21 
22 private:
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",
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:67
const SimClusterRefVector & simClusters() const
Definition: CaloParticle.h:72
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
static const int kAll3DBits
Definition: FWViewType.h:68
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:439
const FWECaloParticleProxyBuilder & operator=(const FWECaloParticleProxyBuilder &)=delete
Definition: DetId.h:17
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
const FWEventItem * item() const