Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Package:     Muons
0004 // Class  :     FWPhotonLegoProxyBuilder
0005 //
0006 //
0007 
0008 #include "TEveStraightLineSet.h"
0009 
0010 #include "Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h"
0011 
0012 #include "DataFormats/EgammaCandidates/interface/Photon.h"
0013 
0014 class FWPhotonLegoProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::Photon> {
0015 public:
0016   FWPhotonLegoProxyBuilder() {}
0017   ~FWPhotonLegoProxyBuilder() override {}
0018 
0019   REGISTER_PROXYBUILDER_METHODS();
0020 
0021   FWPhotonLegoProxyBuilder(const FWPhotonLegoProxyBuilder&) = delete;
0022   const FWPhotonLegoProxyBuilder& operator=(const FWPhotonLegoProxyBuilder&) = delete;
0023 
0024 private:
0025   using FWSimpleProxyBuilderTemplate<reco::Photon>::build;
0026   void build(const reco::Photon& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) override;
0027 };
0028 
0029 void FWPhotonLegoProxyBuilder::build(const reco::Photon& iData,
0030                                      unsigned int iIndex,
0031                                      TEveElement& oItemHolder,
0032                                      const FWViewContext*) {
0033   TEveStraightLineSet* marker = new TEveStraightLineSet("marker");
0034   setupAddElement(marker, &oItemHolder);
0035 
0036   const double delta = 0.1;
0037   marker->AddLine(iData.eta() - delta, iData.phi() - delta, 0.1, iData.eta() + delta, iData.phi() + delta, 0.1);
0038   marker->AddLine(iData.eta() - delta, iData.phi() + delta, 0.1, iData.eta() + delta, iData.phi() - delta, 0.1);
0039 }
0040 
0041 REGISTER_FWPROXYBUILDER(FWPhotonLegoProxyBuilder, reco::Photon, "Photons", FWViewType::kAllLegoBits);