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 {
16 public:
18  ~FWMuonLegoProxyBuilder( void ) override {}
19 
21 
22 private:
23  // Disable default copy constructor
25  // Disable default assignment operator
27 
29  void build( const reco::Muon& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* ) override;
30 };
31 
32 void
33 FWMuonLegoProxyBuilder::build( const reco::Muon& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* )
34 {
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  {
44  points->SetNextPoint( iData.calEnergy().ecal_position.eta(),
45  iData.calEnergy().ecal_position.phi(),
46  0.1 );
47  return;
48  }
49 
50  // get position of the muon at surface of the tracker
51  if( iData.track().isAvailable() && iData.track()->extra().isAvailable())
52  {
53  points->SetNextPoint( iData.track()->outerPosition().eta(),
54  iData.track()->outerPosition().phi(),
55  0.1 );
56  return;
57  }
58 
59  // get position of the inner state of the stand alone muon
60  if( iData.standAloneMuon().isAvailable() && iData.standAloneMuon()->extra().isAvailable())
61  {
62  if( iData.standAloneMuon()->innerPosition().R() < iData.standAloneMuon()->outerPosition().R())
63  points->SetNextPoint( iData.standAloneMuon()->innerPosition().eta(),
64  iData.standAloneMuon()->innerPosition().phi(),
65  0.1 );
66  else
67  points->SetNextPoint( iData.standAloneMuon()->outerPosition().eta(),
68  iData.standAloneMuon()->outerPosition().phi(),
69  0.1 );
70  return;
71  }
72 
73  // WARNING: use direction at POCA as the last option
74  points->SetNextPoint( iData.eta(), iData.phi(), 0.1 );
75 }
76 
78 
bool isAvailable() const
Definition: Ref.h:577
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
TrackRef track() const override
reference to a Track
Definition: Muon.h:49
double eta() const final
momentum pseudorapidity
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
~FWMuonLegoProxyBuilder(void) override
bool isEnergyValid() const
Definition: Muon.h:109
TrackRef standAloneMuon() const override
reference to a stand-alone muon Track
Definition: Muon.h:52
MuonEnergy calEnergy() const
get energy deposition information
Definition: Muon.h:111
const FWMuonLegoProxyBuilder & operator=(const FWMuonLegoProxyBuilder &)=delete
static const int kAllLegoBits
Definition: FWViewType.h:60
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
Definition: MuonEnergy.h:43
double phi() const final
momentum azimuthal angle