CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
26 {
27 public:
29 
30  virtual ~FWPhotonProxyBuilder( void ) {}
31 
32  virtual bool haveSingleProduct( void ) const override { return false; }
33 
35 
36 private:
39 
40  virtual void buildViewType( const reco::Photon& photon, unsigned int iIndex, TEveElement& oItemHolder, FWViewType::EType type , const FWViewContext*) override;
41 };
42 
43 void
44 FWPhotonProxyBuilder::buildViewType( const reco::Photon& photon, unsigned int iIndex, TEveElement& oItemHolder, FWViewType::EType type , const FWViewContext*)
45 {
46  const FWGeometry *geom = item()->getGeom();
47 
48  if( type == FWViewType::kRhoPhi || type == FWViewType::kRhoPhiPF )
49  {
51  photon.superCluster(),
52  photon.phi(),
53  oItemHolder );
54  }
55 
56  else if( type == FWViewType::kRhoZ )
58  photon.superCluster(),
59  photon.phi(),
60  oItemHolder );
61 
62  else if( type == FWViewType::kISpy )
63  {
64  std::vector<std::pair<DetId, float> > detIds = photon.superCluster()->hitsAndFractions();
65 
66  TEveBoxSet* boxset = new TEveBoxSet();
67  boxset->Reset(TEveBoxSet::kBT_FreeBox, true, 64);
68  boxset->UseSingleColor();
69  boxset->SetPickable(1);
70 
71  for( std::vector<std::pair<DetId, float> >::iterator id = detIds.begin(), ide = detIds.end();
72  id != ide; ++id )
73  {
74  const float* corners = geom->getCorners( id->first.rawId() );
75 
76  if( corners == 0 )
77  {
79  << "No corners available for supercluster constituent" << std::endl;
80  continue;
81  }
82  boxset->AddBox( &corners[0]);
83  }
84 
85  boxset->RefitPlex();
86  setupAddElement(boxset, &oItemHolder);
87  }
88 }
89 
type
Definition: HCALResponse.h:21
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
static const int kAllRPZBits
Definition: FWViewType.h:58
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
reco::SuperClusterRef superCluster() const
Ref to SuperCluster.
Definition: Photon.cc:58
const FWEventItem * item() const
static const int kAll3DBits
Definition: FWViewType.h:59
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
virtual void buildViewType(const reco::Photon &photon, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType type, const FWViewContext *) override
bool makeRhoZSuperCluster(FWProxyBuilderBase *, const reco::SuperClusterRef &iCluster, float iPhi, TEveElement &oItemHolder)
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:277
#define fwLog(_level_)
Definition: fwLog.h:50
bool makeRhoPhiSuperCluster(FWProxyBuilderBase *, const reco::SuperClusterRef &iCluster, float iPhi, TEveElement &oItemHolder)
virtual ~FWPhotonProxyBuilder(void)
virtual bool haveSingleProduct(void) const override
const FWPhotonProxyBuilder & operator=(const FWPhotonProxyBuilder &)
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:681