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 
TrackRef track() const override
reference to a Track
Definition: Muon.h:46
double eta() const final
momentum pseudorapidity
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
bool isAvailable() const
Definition: Ref.h:537
~FWMuonLegoProxyBuilder(void) override
bool isEnergyValid() const
Definition: Muon.h:104
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:49
MuonEnergy calEnergy() const
get energy deposition information
Definition: Muon.h:106
const FWMuonLegoProxyBuilder & operator=(const FWMuonLegoProxyBuilder &)=delete
static const int kAllLegoBits
Definition: FWViewType.h:69
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
Definition: MuonEnergy.h:53
double phi() const final
momentum azimuthal angle