CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/Fireworks/Muons/plugins/FWMuonRhoPhiProxyBuilder.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     Muons
00004 // Class  :     FWMuonRhoPhiProxyBuilder
00005 //
00006 // $Id: FWMuonRhoPhiProxyBuilder.cc,v 1.2 2010/11/11 20:25:28 amraktad Exp $
00007 //
00008 
00009 #include "Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h"
00010 #include "Fireworks/Muons/interface/FWMuonBuilder.h"
00011 #include "DataFormats/MuonReco/interface/Muon.h"
00012 
00013 class FWMuonRhoPhiProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::Muon>
00014 {
00015 public:
00016    FWMuonRhoPhiProxyBuilder( void ) {}
00017    virtual ~FWMuonRhoPhiProxyBuilder( void ) {}
00018 
00019    REGISTER_PROXYBUILDER_METHODS();
00020 
00021 private:
00022    // Disable default copy constructor
00023    FWMuonRhoPhiProxyBuilder( const FWMuonRhoPhiProxyBuilder& );
00024    // Disable default assignment operator
00025    const FWMuonRhoPhiProxyBuilder& operator=( const FWMuonRhoPhiProxyBuilder& );
00026 
00027    void build( const reco::Muon& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* );
00028 
00029    virtual void localModelChanges( const FWModelId& iId, TEveElement* iCompound,
00030                                    FWViewType::EType viewType, const FWViewContext* vc );
00031 
00032    mutable FWMuonBuilder m_builder;
00033 };
00034 
00035 void
00036 FWMuonRhoPhiProxyBuilder::build( const reco::Muon& iData, unsigned int iIndex,
00037                                  TEveElement& oItemHolder, const FWViewContext* ) 
00038 {
00039    // To build in RhoPhi we should simply disable the Endcap drawing
00040    // by passing a false flag to a muon builder:
00041    m_builder.buildMuon( this, &iData, &oItemHolder, false, false );
00042 
00043    increaseComponentTransparency( iIndex, &oItemHolder, "Chamber", 40 );
00044 }
00045 
00046 void
00047 FWMuonRhoPhiProxyBuilder::localModelChanges( const FWModelId& iId, TEveElement* iCompound,
00048                                              FWViewType::EType viewType, const FWViewContext* vc )
00049 {
00050    increaseComponentTransparency( iId.index(), iCompound, "Chamber", 40 );
00051 }
00052 
00053 REGISTER_FWPROXYBUILDER( FWMuonRhoPhiProxyBuilder, reco::Muon, "Muons", FWViewType::kRhoPhiBit |  FWViewType::kRhoPhiPFBit);