CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  virtual ~FWMuonLegoProxyBuilder( void ) {}
19 
21 
22 private:
23  // Disable default copy constructor
25  // Disable default assignment operator
27 
28  virtual void build( const reco::Muon& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* ) override;
29 };
30 
31 void
32 FWMuonLegoProxyBuilder::build( const reco::Muon& iData, unsigned int iIndex, TEveElement& oItemHolder, const FWViewContext* )
33 {
34  TEvePointSet* points = new TEvePointSet;
35  setupAddElement( points, &oItemHolder );
36 
37  points->SetMarkerStyle( 2 );
38  points->SetMarkerSize( 0.2 );
39 
40  // get ECAL position of the propagated trajectory if available
41  if( iData.isEnergyValid() && iData.calEnergy().ecal_position.r() > 100 )
42  {
43  points->SetNextPoint( iData.calEnergy().ecal_position.eta(),
44  iData.calEnergy().ecal_position.phi(),
45  0.1 );
46  return;
47  }
48 
49  // get position of the muon at surface of the tracker
50  if( iData.track().isAvailable() && iData.track()->extra().isAvailable())
51  {
52  points->SetNextPoint( iData.track()->outerPosition().eta(),
53  iData.track()->outerPosition().phi(),
54  0.1 );
55  return;
56  }
57 
58  // get position of the inner state of the stand alone muon
59  if( iData.standAloneMuon().isAvailable() && iData.standAloneMuon()->extra().isAvailable())
60  {
61  if( iData.standAloneMuon()->innerPosition().R() < iData.standAloneMuon()->outerPosition().R())
62  points->SetNextPoint( iData.standAloneMuon()->innerPosition().eta(),
63  iData.standAloneMuon()->innerPosition().phi(),
64  0.1 );
65  else
66  points->SetNextPoint( iData.standAloneMuon()->outerPosition().eta(),
67  iData.standAloneMuon()->outerPosition().phi(),
68  0.1 );
69  return;
70  }
71 
72  // WARNING: use direction at POCA as the last option
73  points->SetNextPoint( iData.eta(), iData.phi(), 0.1 );
74 }
75 
77 
const FWMuonLegoProxyBuilder & operator=(const FWMuonLegoProxyBuilder &)
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
virtual TrackRef track() const
reference to a Track
Definition: Muon.h:49
bool isAvailable() const
Definition: Ref.h:276
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
bool isEnergyValid() const
Definition: Muon.h:109
virtual float eta() const GCC11_FINAL
momentum pseudorapidity
MuonEnergy calEnergy() const
get energy deposition information
Definition: Muon.h:111
static const int kAllLegoBits
Definition: FWViewType.h:60
math::XYZPointF ecal_position
Trajectory position at the calorimeter.
Definition: MuonEnergy.h:43
virtual TrackRef standAloneMuon() const
reference to a stand-alone muon Track
Definition: Muon.h:52