CMS 3D CMS Logo

FWPhotonProxyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Photons
4 // Class : FWPhotonProxyBuilder
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Wed Nov 26 14:52:01 EST 2008
11 //
12 
13 #include "TEveBoxSet.h"
14 
20 
22 
24 
25 class FWPhotonProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::Photon> {
26 public:
28 
29  ~FWPhotonProxyBuilder(void) override {}
30 
31  bool haveSingleProduct(void) const override { return false; }
32 
34 
35 private:
37  const FWPhotonProxyBuilder& operator=(const FWPhotonProxyBuilder&) = delete;
38 
40  void buildViewType(const reco::Photon& photon,
41  unsigned int iIndex,
42  TEveElement& oItemHolder,
44  const FWViewContext*) override;
45 };
46 
48  unsigned int iIndex,
49  TEveElement& oItemHolder,
51  const FWViewContext*) {
52  const FWGeometry* geom = item()->getGeom();
53 
55  fireworks::makeRhoPhiSuperCluster(this, photon.superCluster(), photon.phi(), oItemHolder);
56  }
57 
58  else if (type == FWViewType::kRhoZ)
59  fireworks::makeRhoZSuperCluster(this, photon.superCluster(), photon.phi(), oItemHolder);
60 
61  else if (type == FWViewType::kISpy) {
62  std::vector<std::pair<DetId, float> > detIds = photon.superCluster()->hitsAndFractions();
63 
64  TEveBoxSet* boxset = new TEveBoxSet();
65  boxset->Reset(TEveBoxSet::kBT_FreeBox, true, 64);
66  boxset->UseSingleColor();
67  boxset->SetPickable(true);
68 
69  for (std::vector<std::pair<DetId, float> >::iterator id = detIds.begin(), ide = detIds.end(); id != ide; ++id) {
70  const float* corners = geom->getCorners(id->first.rawId());
71 
72  if (corners == nullptr) {
73  fwLog(fwlog::kWarning) << "No corners available for supercluster constituent" << std::endl;
74  continue;
75  }
76  boxset->AddBox(&corners[0]);
77  }
78 
79  boxset->RefitPlex();
80  setupAddElement(boxset, &oItemHolder);
81  }
82 }
83 
muons2muons_cfi.photon
photon
Definition: muons2muons_cfi.py:28
fwLog
#define fwLog(_level_)
Definition: fwLog.h:45
FWGeometry
Definition: FWGeometry.h:27
FWSimpleProxyBuilderTemplate.h
FWViewType::EType
EType
Definition: FWViewType.h:31
FWViewType::kAllRPZBits
static const int kAllRPZBits
Definition: FWViewType.h:67
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition: FWProxyBuilderFactory.h:33
FWViewType::kRhoZ
Definition: FWViewType.h:33
REGISTER_PROXYBUILDER_METHODS
#define REGISTER_PROXYBUILDER_METHODS()
Definition: register_dataproxybuilder_macro.h:28
FWViewType::kAll3DBits
static const int kAll3DBits
Definition: FWViewType.h:68
Photon.h
FWViewType.h
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
FWPhotonProxyBuilder::operator=
const FWPhotonProxyBuilder & operator=(const FWPhotonProxyBuilder &)=delete
FWGeometry.h
FWPhotonProxyBuilder::haveSingleProduct
bool haveSingleProduct(void) const override
Definition: FWPhotonProxyBuilder.cc:31
fireworks::makeRhoZSuperCluster
bool makeRhoZSuperCluster(FWProxyBuilderBase *, const reco::SuperClusterRef &iCluster, float iPhi, TEveElement &oItemHolder)
Definition: makeSuperCluster.cc:69
FWPhotonProxyBuilder::buildViewType
void buildViewType(const reco::Photon &photon, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType type, const FWViewContext *) override
Definition: FWPhotonProxyBuilder.cc:47
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
FWPhotonProxyBuilder::FWPhotonProxyBuilder
FWPhotonProxyBuilder(void)
Definition: FWPhotonProxyBuilder.cc:27
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
FWPhotonProxyBuilder
Definition: FWPhotonProxyBuilder.cc:25
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
fwlog::kWarning
Definition: fwLog.h:35
fwLog.h
FWEventItem.h
FWViewContext
Definition: FWViewContext.h:32
fireworks::makeRhoPhiSuperCluster
bool makeRhoPhiSuperCluster(FWProxyBuilderBase *, const reco::SuperClusterRef &iCluster, float iPhi, TEveElement &oItemHolder)
Definition: makeSuperCluster.cc:29
FWPhotonProxyBuilder::~FWPhotonProxyBuilder
~FWPhotonProxyBuilder(void) override
Definition: FWPhotonProxyBuilder.cc:29
FWEventItem::getGeom
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
reco::Photon
Definition: Photon.h:21
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition: FWProxyBuilderBase.h:64
makeSuperCluster.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
FWViewType::kISpy
Definition: FWViewType.h:35
FWSimpleProxyBuilderTemplate
Definition: FWSimpleProxyBuilderTemplate.h:30
FWViewType::kRhoPhiPF
Definition: FWViewType.h:42
FWViewType::kRhoPhi
Definition: FWViewType.h:32