File indexing completed on 2024-04-06 12:11:49
0001
0002
0003
0004
0005
0006
0007
0008 #include "TEvePointSet.h"
0009
0010 #include "Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h"
0011 #include "DataFormats/MuonReco/interface/Muon.h"
0012 #include "DataFormats/TrackReco/interface/Track.h"
0013
0014 class FWMuonLegoProxyBuilder : public FWSimpleProxyBuilderTemplate<reco::Muon> {
0015 public:
0016 FWMuonLegoProxyBuilder(void) {}
0017 ~FWMuonLegoProxyBuilder(void) override {}
0018
0019 REGISTER_PROXYBUILDER_METHODS();
0020
0021
0022 FWMuonLegoProxyBuilder(const FWMuonLegoProxyBuilder&) = delete;
0023
0024 const FWMuonLegoProxyBuilder& operator=(const FWMuonLegoProxyBuilder&) = delete;
0025
0026 private:
0027 using FWSimpleProxyBuilderTemplate<reco::Muon>::build;
0028 void build(const reco::Muon& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) override;
0029 };
0030
0031 void FWMuonLegoProxyBuilder::build(const reco::Muon& iData,
0032 unsigned int iIndex,
0033 TEveElement& oItemHolder,
0034 const FWViewContext*) {
0035 TEvePointSet* points = new TEvePointSet;
0036 setupAddElement(points, &oItemHolder);
0037
0038 points->SetMarkerStyle(2);
0039 points->SetMarkerSize(0.2);
0040
0041
0042 if (iData.isEnergyValid() && iData.calEnergy().ecal_position.r() > 100) {
0043 points->SetNextPoint(iData.calEnergy().ecal_position.eta(), iData.calEnergy().ecal_position.phi(), 0.1);
0044 return;
0045 }
0046
0047
0048 if (iData.track().isAvailable() && iData.track()->extra().isAvailable()) {
0049 points->SetNextPoint(iData.track()->outerPosition().eta(), iData.track()->outerPosition().phi(), 0.1);
0050 return;
0051 }
0052
0053
0054 if (iData.standAloneMuon().isAvailable() && iData.standAloneMuon()->extra().isAvailable()) {
0055 if (iData.standAloneMuon()->innerPosition().R() < iData.standAloneMuon()->outerPosition().R())
0056 points->SetNextPoint(
0057 iData.standAloneMuon()->innerPosition().eta(), iData.standAloneMuon()->innerPosition().phi(), 0.1);
0058 else
0059 points->SetNextPoint(
0060 iData.standAloneMuon()->outerPosition().eta(), iData.standAloneMuon()->outerPosition().phi(), 0.1);
0061 return;
0062 }
0063
0064
0065 points->SetNextPoint(iData.eta(), iData.phi(), 0.1);
0066 }
0067
0068 REGISTER_FWPROXYBUILDER(FWMuonLegoProxyBuilder, reco::Muon, "Muons", FWViewType::kAllLegoBits);