CMS 3D CMS Logo

FWMuonLegoProxyBuilder.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Muons
4 // Class : FWMuonLegoProxyBuilder
5 //
6 //
7 
8 #include "TEvePointSet.h"
9 
13 
15 public:
17  ~FWMuonLegoProxyBuilder(void) override {}
18 
20 
21 private:
22  // Disable default copy constructor
24  // Disable default assignment operator
26 
28  void build(const reco::Muon& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext*) override;
29 };
30 
32  unsigned int iIndex,
33  TEveElement& oItemHolder,
34  const FWViewContext*) {
35  TEvePointSet* points = new TEvePointSet;
36  setupAddElement(points, &oItemHolder);
37 
38  points->SetMarkerStyle(2);
39  points->SetMarkerSize(0.2);
40 
41  // get ECAL position of the propagated trajectory if available
42  if (iData.isEnergyValid() && iData.calEnergy().ecal_position.r() > 100) {
43  points->SetNextPoint(iData.calEnergy().ecal_position.eta(), iData.calEnergy().ecal_position.phi(), 0.1);
44  return;
45  }
46 
47  // get position of the muon at surface of the tracker
48  if (iData.track().isAvailable() && iData.track()->extra().isAvailable()) {
49  points->SetNextPoint(iData.track()->outerPosition().eta(), iData.track()->outerPosition().phi(), 0.1);
50  return;
51  }
52 
53  // get position of the inner state of the stand alone muon
54  if (iData.standAloneMuon().isAvailable() && iData.standAloneMuon()->extra().isAvailable()) {
55  if (iData.standAloneMuon()->innerPosition().R() < iData.standAloneMuon()->outerPosition().R())
56  points->SetNextPoint(
57  iData.standAloneMuon()->innerPosition().eta(), iData.standAloneMuon()->innerPosition().phi(), 0.1);
58  else
59  points->SetNextPoint(
60  iData.standAloneMuon()->outerPosition().eta(), iData.standAloneMuon()->outerPosition().phi(), 0.1);
61  return;
62  }
63 
64  // WARNING: use direction at POCA as the last option
65  points->SetNextPoint(iData.eta(), iData.phi(), 0.1);
66 }
67 
HLT_2018_cff.points
points
Definition: HLT_2018_cff.py:20125
Muon.h
FWSimpleProxyBuilderTemplate.h
FWMuonLegoProxyBuilder::operator=
const FWMuonLegoProxyBuilder & operator=(const FWMuonLegoProxyBuilder &)=delete
reco::Muon::calEnergy
MuonEnergy calEnergy() const
get energy deposition information
Definition: Muon.h:106
edm::Ref::isAvailable
bool isAvailable() const
Definition: Ref.h:537
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition: FWProxyBuilderFactory.h:33
REGISTER_PROXYBUILDER_METHODS
#define REGISTER_PROXYBUILDER_METHODS()
Definition: register_dataproxybuilder_macro.h:28
reco::Muon::isEnergyValid
bool isEnergyValid() const
Definition: Muon.h:104
reco::Muon
Definition: Muon.h:27
Track.h
FWViewType::kAllLegoBits
static const int kAllLegoBits
Definition: FWViewType.h:69
reco::LeafCandidate::eta
double eta() const final
momentum pseudorapidity
Definition: LeafCandidate.h:152
FWMuonLegoProxyBuilder
Definition: FWMuonLegoProxyBuilder.cc:14
FWMuonLegoProxyBuilder::FWMuonLegoProxyBuilder
FWMuonLegoProxyBuilder(void)
Definition: FWMuonLegoProxyBuilder.cc:16
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
FWProxyBuilderBase::build
void build()
Definition: FWProxyBuilderBase.cc:110
FWViewContext
Definition: FWViewContext.h:32
reco::Muon::track
TrackRef track() const override
reference to a Track
Definition: Muon.h:46
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
reco::MuonEnergy::ecal_position
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
Definition: MuonEnergy.h:53
FWSimpleProxyBuilderTemplate
Definition: FWSimpleProxyBuilderTemplate.h:30
FWMuonLegoProxyBuilder::~FWMuonLegoProxyBuilder
~FWMuonLegoProxyBuilder(void) override
Definition: FWMuonLegoProxyBuilder.cc:17
reco::Muon::standAloneMuon
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:49