Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
src
Fireworks
Tracks
plugins
FWBeamSpotProxyBuilder.cc
Go to the documentation of this file.
1
/*
2
* FWBeamSpotProxyBuilder.cc
3
* FWorks
4
*
5
* Created by Ianna Osborne on 7/29/10.
6
*
7
*/
8
#include "TEveStraightLineSet.h"
9
10
#include "
Fireworks/Core/interface/FWSimpleProxyBuilderTemplate.h
"
11
#include "
Fireworks/Core/interface/FWEventItem.h
"
12
13
#include "
DataFormats/BeamSpot/interface/BeamSpot.h
"
14
15
class
FWBeamSpotProxyBuilder
:
public
FWSimpleProxyBuilderTemplate
<reco::BeamSpot>
16
{
17
public
:
18
FWBeamSpotProxyBuilder
(
void
) {}
19
virtual
~FWBeamSpotProxyBuilder
(
void
) {}
20
21
REGISTER_PROXYBUILDER_METHODS
();
22
23
private
:
24
// Disable default copy constructor
25
FWBeamSpotProxyBuilder
(
const
FWBeamSpotProxyBuilder
& );
26
// Disable default assignment operator
27
const
FWBeamSpotProxyBuilder
&
operator=
(
const
FWBeamSpotProxyBuilder
& );
28
virtual
void
localModelChanges
(
const
FWModelId
& iId, TEveElement*
parent
,
FWViewType::EType
viewType,
const
FWViewContext
* vc)
override
;
29
30
using
FWSimpleProxyBuilderTemplate<reco::BeamSpot>::build
;
31
virtual
void
build
(
const
reco::BeamSpot
& iData,
unsigned
int
iIndex, TEveElement& oItemHolder,
const
FWViewContext
* )
override
;
32
};
33
34
void
FWBeamSpotProxyBuilder::localModelChanges
(
const
FWModelId
& iId, TEveElement*
parent
,
FWViewType::EType
viewType,
const
FWViewContext
* vc)
35
{
36
if
( TEveStraightLineSet *
ls
= dynamic_cast<TEveStraightLineSet*> ( *parent->BeginChildren() ))
37
{
38
Color_t
c
=
FWProxyBuilderBase::item
()->
modelInfo
( iId.
index
() ).displayProperties().color();
39
for
(TEveProjectable::ProjList_i
j
=
ls
->BeginProjecteds();
j
!=
ls
->EndProjecteds(); ++
j
)
40
{
41
if
( TEveStraightLineSet *pls = dynamic_cast<TEveStraightLineSet*> (*
j
))
42
{
43
pls->SetMarkerColor(c);
44
pls->ElementChanged();
45
}
46
}
47
48
ls
->SetMarkerColor(c);
49
ls
->ElementChanged();
50
}
51
}
52
53
void
54
FWBeamSpotProxyBuilder::build
(
const
reco::BeamSpot
& bs,
unsigned
int
iIndex, TEveElement& oItemHolder,
const
FWViewContext
* )
55
{
56
TEveStraightLineSet*
ls
=
new
TEveStraightLineSet();
57
58
double
pos[3] = { bs.
x0
(), bs.
y0
(), bs.
z0
() };
59
double
e
[3] = { bs.
x0Error
(), bs.
y0Error
(), bs.
z0Error
() };
60
61
const
Int_t
N
= 32;
62
const
Float_t
S
= 2*
TMath::Pi
()/
N
;
63
64
Float_t
a
= e[0],
b
= e[1];
65
for
(Int_t
i
= 0;
i
<
N
;
i
++)
66
ls->AddLine(a*TMath::Cos(
i
*S) , b*TMath::Sin(
i
*S) , 0,
67
a*TMath::Cos(
i
*S+S), b*TMath::Sin(
i
*S+S), 0);
68
69
a = e[0]; b = e[2];
70
for
(Int_t
i
= 0;
i
<
N
;
i
++)
71
ls->AddLine(a*TMath::Cos(
i
*S) , 0, b*TMath::Sin(
i
*S),
72
a*TMath::Cos(
i
*S+S), 0, b*TMath::Sin(
i
*S+S));
73
74
a = e[1]; b = e[2];
75
for
(Int_t
i
= 0;
i
<
N
;
i
++)
76
ls->AddLine(0, a*TMath::Cos(
i
*S) , b*TMath::Sin(
i
*S),
77
0, a*TMath::Cos(
i
*S+S), b*TMath::Sin(
i
*S+S));
78
79
ls->AddLine(0,0,0,0,0,0);
80
ls->AddMarker(0,0,0);
81
ls->SetMarkerStyle(21);
82
const
FWDisplayProperties
&dp =
83
FWProxyBuilderBase::item
()->
defaultDisplayProperties
();
84
ls->SetMarkerColor( dp.
color
() );
85
86
ls->RefMainTrans().SetPos(pos);
87
setupAddElement
(ls, &oItemHolder);
88
}
89
90
REGISTER_FWPROXYBUILDER
(
FWBeamSpotProxyBuilder
,
reco::BeamSpot
,
"Beam Spot"
,
FWViewType::kAll3DBits
|
FWViewType::kAllRPZBits
);
FWSimpleProxyBuilderTemplate.h
Pi
const double Pi
Definition:
CosmicMuonParameters.h:18
reco::BeamSpot::z0
double z0() const
z coordinate
Definition:
BeamSpot.h:68
i
int i
Definition:
DBlmapReader.cc:9
FWEventItem::defaultDisplayProperties
const FWDisplayProperties & defaultDisplayProperties() const
Definition:
FWEventItem.cc:451
REGISTER_PROXYBUILDER_METHODS
#define REGISTER_PROXYBUILDER_METHODS()
Definition:
register_dataproxybuilder_macro.h:28
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition:
FWProxyBuilderFactory.h:33
dbtoconf.parent
list parent
Definition:
dbtoconf.py:74
FWViewType::kAllRPZBits
static const int kAllRPZBits
Definition:
FWViewType.h:58
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition:
FWProxyBuilderBase.cc:429
FWViewContext
Definition:
FWViewContext.h:32
FWBeamSpotProxyBuilder::~FWBeamSpotProxyBuilder
virtual ~FWBeamSpotProxyBuilder(void)
Definition:
FWBeamSpotProxyBuilder.cc:19
FWModelId
Definition:
FWModelId.h:28
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition:
FWProxyBuilderBase.h:67
FWViewType::kAll3DBits
static const int kAll3DBits
Definition:
FWViewType.h:59
FWDisplayProperties::color
Color_t color() const
Definition:
FWDisplayProperties.h:51
FWBeamSpotProxyBuilder::FWBeamSpotProxyBuilder
FWBeamSpotProxyBuilder(void)
Definition:
FWBeamSpotProxyBuilder.cc:18
FWBeamSpotProxyBuilder::localModelChanges
virtual void localModelChanges(const FWModelId &iId, TEveElement *parent, FWViewType::EType viewType, const FWViewContext *vc) override
Definition:
FWBeamSpotProxyBuilder.cc:34
FWModelId::index
int index() const
Definition:
FWModelId.h:49
FWBeamSpotProxyBuilder
Definition:
FWBeamSpotProxyBuilder.cc:15
j
int j
Definition:
DBlmapReader.cc:9
FWProxyBuilderBase::build
void build()
Definition:
FWProxyBuilderBase.cc:131
reco::BeamSpot::z0Error
double z0Error() const
error on z
Definition:
BeamSpot.h:94
FWBeamSpotProxyBuilder::operator=
const FWBeamSpotProxyBuilder & operator=(const FWBeamSpotProxyBuilder &)
reco::BeamSpot::x0Error
double x0Error() const
error on x
Definition:
BeamSpot.h:90
reco::BeamSpot::y0Error
double y0Error() const
error on y
Definition:
BeamSpot.h:92
FWEventItem.h
N
#define N
Definition:
blowfish.cc:9
b
double b
Definition:
hdecay.h:120
trackerHits.c
tuple c
Definition:
trackerHits.py:26
FWViewType::EType
EType
Definition:
FWViewType.h:33
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition:
Particle.cc:99
alignCSCRings.e
list e
Definition:
alignCSCRings.py:90
FWDisplayProperties
Definition:
FWDisplayProperties.h:28
a
double a
Definition:
hdecay.h:121
BeamSpot.h
reco::BeamSpot::y0
double y0() const
y coordinate
Definition:
BeamSpot.h:66
FWEventItem::modelInfo
ModelInfo modelInfo(int iIndex) const
Definition:
FWEventItem.cc:535
reco::BeamSpot
Definition:
BeamSpot.h:22
FWSimpleProxyBuilderTemplate
Definition:
FWSimpleProxyBuilderTemplate.h:29
python.rootplot.utilities.ls
def ls
Definition:
utilities.py:408
reco::BeamSpot::x0
double x0() const
x coordinate
Definition:
BeamSpot.h:64
Generated for CMSSW Reference Manual by
1.8.5