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  :     FWMuonGlimpseProxyBuilder
0005 //
0006 //
0007 
0008 #include "TEveScalableStraightLineSet.h"
0009 #include "Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h"
0010 #include "Fireworks/Candidates/interface/CandidateUtils.h"
0011 #include "DataFormats/MuonReco/interface/Muon.h"
0012 
0013 class FWMuonGlimpseProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::Muon> {
0014 public:
0015   FWMuonGlimpseProxyBuilder(void) {}
0016   ~FWMuonGlimpseProxyBuilder(void) override {}
0017 
0018   REGISTER_PROXYBUILDER_METHODS();
0019 
0020   // Disable default copy constructor
0021   FWMuonGlimpseProxyBuilder(const FWMuonGlimpseProxyBuilder&) = delete;
0022   // Disable default assignment operator
0023   const FWMuonGlimpseProxyBuilder& operator=(const FWMuonGlimpseProxyBuilder&) = delete;
0024 
0025 private:
0026   using FWSimpleProxyBuilderTemplate<reco::Muon>::build;
0027   void build(const reco::Muon& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) override;
0028 };
0029 
0030 void FWMuonGlimpseProxyBuilder::build(const reco::Muon& iData,
0031                                       unsigned int iIndex,
0032                                       TEveElement& oItemHolder,
0033                                       const FWViewContext*) {
0034   TEveScalableStraightLineSet* marker = new TEveScalableStraightLineSet("", "");
0035   marker->SetLineWidth(2);
0036   fireworks::addStraightLineSegment(marker, &iData, 1.0);
0037   setupAddElement(marker, &oItemHolder);
0038   //add to scaler at end so that it can scale the line after all ends have been added
0039   // FIXME:   scaler()->addElement(marker);
0040 }
0041 
0042 REGISTER_FWPROXYBUILDER(FWMuonGlimpseProxyBuilder, reco::Muon, "Muons", FWViewType::kGlimpseBit);