Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-03 04:10:03

0001 // -*- C++ -*-
0002 //
0003 // Package:     Muons
0004 // Class  :     FWMuonProxyBuilder
0005 //
0006 // Implementation:
0007 //     <Notes on implementation>
0008 //
0009 // Original Author:  Chris Jones
0010 //         Created:  Thu Dec  4 19:28:07 EST 2008
0011 //
0012 #include "TEveTrack.h"
0013 
0014 #include "Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h"
0015 #include "Fireworks/Core/interface/FWProxyBuilderConfiguration.h"
0016 #include "Fireworks/Core/interface/FWEventItem.h"
0017 #include "Fireworks/Muons/interface/FWMuonBuilder.h"
0018 #include "DataFormats/MuonReco/interface/Muon.h"
0019 
0020 class FWMuonProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::Muon> {
0021 public:
0022   FWMuonProxyBuilder(void) {}
0023   ~FWMuonProxyBuilder(void) override {}
0024 
0025   void setItem(const FWEventItem* iItem) override;
0026 
0027   REGISTER_PROXYBUILDER_METHODS();
0028 
0029   // Disable default copy constructor
0030   FWMuonProxyBuilder(const FWMuonProxyBuilder&) = delete;
0031   // Disable default assignment operator
0032   const FWMuonProxyBuilder& operator=(const FWMuonProxyBuilder&) = delete;
0033 
0034 private:
0035   using FWSimpleProxyBuilderTemplate<reco::Muon>::build;
0036   void build(const reco::Muon& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) override;
0037 
0038   void localModelChanges(const FWModelId& iId,
0039                          TEveElement* iCompound,
0040                          FWViewType::EType viewType,
0041                          const FWViewContext* vc) override;
0042 
0043   mutable FWMuonBuilder m_builder;
0044 };
0045 
0046 void FWMuonProxyBuilder::setItem(const FWEventItem* iItem) {
0047   FWProxyBuilderBase::setItem(iItem);
0048 
0049   if (iItem) {
0050     iItem->getConfig()->assertParam("LineWidth", long(1), long(1), long(4));
0051   }
0052 }
0053 
0054 void FWMuonProxyBuilder::build(const reco::Muon& iData,
0055                                unsigned int iIndex,
0056                                TEveElement& oItemHolder,
0057                                const FWViewContext*) {
0058   int width = item()->getConfig()->value<long>("LineWidth");
0059   m_builder.setLineWidth(width);
0060 
0061   m_builder.buildMuon(this, &iData, &oItemHolder, true, false);
0062   increaseComponentTransparency(iIndex, &oItemHolder, "Chamber", 60);
0063 }
0064 
0065 void FWMuonProxyBuilder::localModelChanges(const FWModelId& iId,
0066                                            TEveElement* iCompound,
0067                                            FWViewType::EType viewType,
0068                                            const FWViewContext* vc) {
0069   increaseComponentTransparency(iId.index(), iCompound, "Chamber", 60);
0070 }
0071 
0072 REGISTER_FWPROXYBUILDER(FWMuonProxyBuilder, reco::Muon, "Muons", FWViewType::kAll3DBits | FWViewType::kRhoZBit);