CMS 3D CMS Logo

FWMuonRhoPhiProxyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Muons
4 // Class : FWMuonRhoPhiProxyBuilder
5 //
6 //
7 
13 
15 {
16 public:
18  virtual ~FWMuonRhoPhiProxyBuilder( void ) {}
19 
20  virtual void setItem(const FWEventItem* iItem) override;
21 
23 
24 private:
25  // Disable default copy constructor
27  // Disable default assignment operator
29 
31  void build( const reco::Muon& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* ) override;
32 
33  virtual void localModelChanges( const FWModelId& iId, TEveElement* iCompound,
34  FWViewType::EType viewType, const FWViewContext* vc ) override;
35 
37 };
38 
39 void
41 {
43 
44  if (iItem) {
45  iItem->getConfig()->assertParam("LineWidth", long(1), long(1), long(4));
46  }
47 }
48 
49 void
50 FWMuonRhoPhiProxyBuilder::build( const reco::Muon& iData, unsigned int iIndex,
51  TEveElement& oItemHolder, const FWViewContext* )
52 {
53  int width = item()->getConfig()->value<long>("LineWidth");
54  m_builder.setLineWidth(width);
55 
56  // To build in RhoPhi we should simply disable the Endcap drawing
57  // by passing a false flag to a muon builder:
58  m_builder.buildMuon( this, &iData, &oItemHolder, false, false );
59 
60  increaseComponentTransparency( iIndex, &oItemHolder, "Chamber", 40 );
61 }
62 
63 void
64 FWMuonRhoPhiProxyBuilder::localModelChanges( const FWModelId& iId, TEveElement* iCompound,
65  FWViewType::EType viewType, const FWViewContext* vc )
66 {
67  increaseComponentTransparency( iId.index(), iCompound, "Chamber", 40 );
68 }
69 
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:170
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
virtual void setItem(const FWEventItem *iItem) override
void setLineWidth(int w)
Definition: FWMuonBuilder.h:40
const FWMuonRhoPhiProxyBuilder & operator=(const FWMuonRhoPhiProxyBuilder &)
void buildMuon(FWProxyBuilderBase *, const reco::Muon *muon, TEveElement *tList, bool showEndcap, bool onlyTracks=false)
const FWEventItem * item() const
virtual void localModelChanges(const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc) override
int index() const
Definition: FWModelId.h:49
virtual void setItem(const FWEventItem *iItem)
FWGenericParameter< T > * assertParam(const std::string &name, T def)
void increaseComponentTransparency(unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)