CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
FWMETProxyBuilder Class Reference
Inheritance diagram for FWMETProxyBuilder:
FWSimpleProxyBuilderTemplate< reco::MET > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWMETProxyBuilder ()
 
bool havePerViewProduct (FWViewType::EType) const override
 
bool haveSingleProduct () const override
 
const std::string & purpose () const
 
void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc) override
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWMETProxyBuilder () override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::MET >
 FWSimpleProxyBuilderTemplate ()
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
 ~FWSimpleProxyBuilder () override
 
- Public Member Functions inherited from FWProxyBuilderBase
void build ()
 
virtual bool canHandle (const FWEventItem &)
 
const fireworks::Contextcontext () const
 
TEveElementList * createProduct (FWViewType::EType, const FWViewContext *)
 
 FWProxyBuilderBase ()
 
bool getHaveWindow () const
 
const FWEventItemitem () const
 
virtual void itemBeingDestroyed (const FWEventItem *)
 
void itemChanged (const FWEventItem *)
 
int layer () const
 
void modelChanges (const FWModelIds &)
 
void removePerViewProduct (FWViewType::EType, const FWViewContext *vc)
 
void scaleChanged (const FWViewContext *)
 
void setHaveWindow (bool iFlag)
 
virtual void setInteractionList (FWInteractionList *, const std::string &)
 
virtual void setItem (const FWEventItem *iItem)
 
void setupAddElement (TEveElement *el, TEveElement *parent, bool set_color=true) const
 
void setupElement (TEveElement *el, bool color=true) const
 
virtual bool willHandleInteraction () const
 
virtual ~FWProxyBuilderBase ()
 

Static Public Member Functions

static const std::string & classPurpose ()
 
static const std::string & classRegisterTypeName ()
 
static const std::string & classTypeName ()
 
static const std::string & classView ()
 
- Static Public Member Functions inherited from FWSimpleProxyBuilder
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 
- Static Public Member Functions inherited from FWProxyBuilderBase
static bool representsSubPart ()
 
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 

Private Member Functions

void buildViewType (const reco::MET &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType type, const FWViewContext *) override
 
 FWMETProxyBuilder (const FWMETProxyBuilder &)=delete
 
const FWMETProxyBuilderoperator= (const FWMETProxyBuilder &)=delete
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< reco::MET >
void build ()
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void build (const reco::MET &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *)
 
virtual void build (const void *, unsigned int iIndex, TEveElement &iItemHolder, const FWViewContext *)=0
 
void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
 
virtual void buildViewType (const void *, unsigned int iIndex, TEveElement &iItemHolder, FWViewType::EType, const FWViewContext *)=0
 
void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
 
const reco::METmodelData (int index)
 
- Protected Member Functions inherited from FWSimpleProxyBuilder
void build ()
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
 
void clean () override
 
- Protected Member Functions inherited from FWProxyBuilderBase
virtual void cleanLocal ()
 
TEveCompound * createCompound (bool set_color=true, bool propagate_color_to_all_children=false) const
 
 FWProxyBuilderBase (const FWProxyBuilderBase &)
 
void increaseComponentTransparency (unsigned int index, TEveElement *holder, const std::string &name, Char_t transpOffset)
 
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
virtual void modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
- Protected Attributes inherited from FWSimpleProxyBuilder
FWSimpleProxyHelper m_helper
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 37 of file FWMETProxyBuilder.cc.

Constructor & Destructor Documentation

◆ FWMETProxyBuilder() [1/2]

FWMETProxyBuilder::FWMETProxyBuilder ( )
inline

Definition at line 39 of file FWMETProxyBuilder.cc.

39 {}

◆ ~FWMETProxyBuilder()

FWMETProxyBuilder::~FWMETProxyBuilder ( )
inlineoverride

Definition at line 40 of file FWMETProxyBuilder.cc.

40 {}

◆ FWMETProxyBuilder() [2/2]

FWMETProxyBuilder::FWMETProxyBuilder ( const FWMETProxyBuilder )
privatedelete

Member Function Documentation

◆ buildViewType()

void FWMETProxyBuilder::buildViewType ( const reco::MET iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
FWViewType::EType  type,
const FWViewContext vc 
)
overrideprivatevirtual

Reimplemented from FWSimpleProxyBuilderTemplate< reco::MET >.

Definition at line 81 of file FWMETProxyBuilder.cc.

85  {
86  using namespace TMath;
87  double phi = met.phi();
88  double theta = met.theta();
89  double size = 1.f;
90 
91  FWViewEnergyScale* caloScale = vc->getEnergyScale();
92 
93  TEveScalableStraightLineSet* marker = new TEveScalableStraightLineSet("MET marker");
94  marker->SetLineWidth(2);
95 
96  if (type == FWViewType::kRhoZ) {
97  // body
98  double r0;
99  if (TMath::Abs(met.eta()) < context().caloTransEta()) {
100  r0 = context().caloR1() / sin(theta);
101  } else {
102  r0 = context().caloZ1() / fabs(cos(theta));
103  }
104  marker->SetScaleCenter(0., Sign(r0 * sin(theta), phi), r0 * cos(theta));
105  double r1 = r0 + 1;
106  marker->AddLine(0., Sign(r0 * sin(theta), phi), r0 * cos(theta), 0., Sign(r1 * sin(theta), phi), r1 * cos(theta));
107 
108  // arrow pointer
109  double r2 = r1 - 0.1;
110  double dy = 0.05 * size;
111  marker->AddLine(0.,
112  Sign(r2 * sin(theta) + dy * cos(theta), phi),
113  r2 * cos(theta) - dy * sin(theta),
114  0.,
115  Sign(r1 * sin(theta), phi),
116  r1 * cos(theta));
117  dy = -dy;
118  marker->AddLine(0.,
119  Sign(r2 * sin(theta) + dy * cos(theta), phi),
120  r2 * cos(theta) - dy * sin(theta),
121  0.,
122  Sign(r1 * sin(theta), phi),
123  r1 * cos(theta));
124 
125  // segment
127  this, &oItemHolder, context().caloR1() - 1, context().caloZ1() - 1, theta - 0.04, theta + 0.04, phi);
128  } else {
129  // body
130  double r0 = context().caloR1();
131  double r1 = r0 + 1;
132  marker->SetScaleCenter(r0 * cos(phi), r0 * sin(phi), 0);
133  marker->AddLine(r0 * cos(phi), r0 * sin(phi), 0, r1 * cos(phi), r1 * sin(phi), 0);
134 
135  // arrow pointer, xy rotate offset point ..
136  double r2 = r1 - 0.1;
137  double dy = 0.05 * size;
138 
139  marker->AddLine(r2 * cos(phi) - dy * sin(phi), r2 * sin(phi) + dy * cos(phi), 0, r1 * cos(phi), r1 * sin(phi), 0);
140  dy = -dy;
141  marker->AddLine(r2 * cos(phi) - dy * sin(phi), r2 * sin(phi) + dy * cos(phi), 0, r1 * cos(phi), r1 * sin(phi), 0);
142 
143  // segment
144  double min_phi = phi - M_PI / 36 / 2;
145  double max_phi = phi + M_PI / 36 / 2;
146  TEveGeoManagerHolder gmgr(TEveGeoShape::GetGeoMangeur());
147  TEveGeoShape* element =
148  fireworks::getShape("spread", new TGeoTubeSeg(r0 - 2, r0, 1, min_phi * 180 / M_PI, max_phi * 180 / M_PI), 0);
149  element->SetPickable(kTRUE);
150  setupAddElement(element, &oItemHolder);
151  }
152 
153  marker->SetScale(caloScale->getScaleFactor3D() * (caloScale->getPlotEt() ? met.et() : met.energy()));
154  setupAddElement(marker, &oItemHolder);
155 
156  // printf("add line %s %f %f .... eta %f theta %f\n", item()->name().c_str(), met.et(), met.energy(), met.eta(), met.theta());
157 
158  context().voteMaxEtAndEnergy(met.et(), met.energy());
159 }

References Abs(), fireworks::addRhoZEnergyProjection(), FWPFGeom::caloR1(), fireworks::Context::caloR1(), fireworks::Context::caloTransEta(), FWPFGeom::caloZ1(), fireworks::Context::caloZ1(), FWProxyBuilderBase::context(), funct::cos(), PVValHelper::dy, FWViewContext::getEnergyScale(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactor3D(), fireworks::getShape(), FWViewType::kRhoZ, M_PI, BTaggingMonitor_cfi::met, phi, diffTwoXMLs::r1, diffTwoXMLs::r2, FWProxyBuilderBase::setupAddElement(), Sign(), funct::sin(), findQualityFiles::size, theta(), and fireworks::Context::voteMaxEtAndEnergy().

◆ classPurpose()

const std::string & FWMETProxyBuilder::classPurpose ( )
static

Definition at line 161 of file FWMETProxyBuilder.cc.

◆ classRegisterTypeName()

const std::string & FWMETProxyBuilder::classRegisterTypeName ( )
static

Definition at line 161 of file FWMETProxyBuilder.cc.

◆ classTypeName()

const std::string & FWMETProxyBuilder::classTypeName ( )
static

Definition at line 161 of file FWMETProxyBuilder.cc.

◆ classView()

const std::string & FWMETProxyBuilder::classView ( )
static

Definition at line 161 of file FWMETProxyBuilder.cc.

◆ havePerViewProduct()

bool FWMETProxyBuilder::havePerViewProduct ( FWViewType::EType  ) const
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 44 of file FWMETProxyBuilder.cc.

44 { return true; } // used energy scaling

◆ haveSingleProduct()

bool FWMETProxyBuilder::haveSingleProduct ( void  ) const
inlineoverridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 42 of file FWMETProxyBuilder.cc.

42 { return false; } // use buildViewType instead of buildView

◆ operator=()

const FWMETProxyBuilder& FWMETProxyBuilder::operator= ( const FWMETProxyBuilder )
privatedelete

◆ purpose()

const std::string& FWMETProxyBuilder::purpose ( ) const
inline

Definition at line 48 of file FWMETProxyBuilder.cc.

50 :
51  FWMETProxyBuilder(const FWMETProxyBuilder&) = delete; // stop default

◆ scaleProduct()

void FWMETProxyBuilder::scaleProduct ( TEveElementList *  parent,
FWViewType::EType  type,
const FWViewContext vc 
)
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 62 of file FWMETProxyBuilder.cc.

62  {
63  int idx = 0;
64  for (auto& c : product->RefChildren()) {
65  // line set element is added at the end of the buildViewType function, therefore last child
66  TEveScalableStraightLineSet* lineSet = dynamic_cast<TEveScalableStraightLineSet*>(c->LastChild());
67  if (lineSet) {
68  // compund index in the product is an index of model data in the collection
69  const void* modelData = item()->modelData(idx);
70  const reco::MET* met = (const reco::MET*)(modelData);
71  float value = vc->getEnergyScale()->getPlotEt() ? met->et() : met->energy();
72  lineSet->SetScale(vc->getEnergyScale()->getScaleFactor3D() * value);
73  for (TEveProjectable::ProjList_i j = lineSet->BeginProjecteds(); j != lineSet->EndProjecteds(); ++j) {
74  (*j)->UpdateProjection();
75  }
76  }
77  idx++;
78  }
79 }

References c, FWViewContext::getEnergyScale(), FWViewEnergyScale::getPlotEt(), FWViewEnergyScale::getScaleFactor3D(), heavyIonCSV_trainingSettings::idx, FWProxyBuilderBase::item(), dqmiolumiharvest::j, BTaggingMonitor_cfi::met, FWSimpleProxyBuilderTemplate< reco::MET >::modelData(), FWEventItem::modelData(), and relativeConstraints::value.

◆ typeName()

const std::string& FWMETProxyBuilder::typeName ( ) const
inline

Definition at line 48 of file FWMETProxyBuilder.cc.

50 :
51  FWMETProxyBuilder(const FWMETProxyBuilder&) = delete; // stop default

◆ view()

const std::string& FWMETProxyBuilder::view ( ) const
inline

Definition at line 48 of file FWMETProxyBuilder.cc.

50 :
51  FWMETProxyBuilder(const FWMETProxyBuilder&) = delete; // stop default
FWViewType::kRhoZ
Definition: FWViewType.h:33
FWSimpleProxyBuilderTemplate< reco::MET >::modelData
const reco::MET & modelData(int index)
Definition: FWSimpleProxyBuilderTemplate.h:43
Sign
T Sign(T A, T B)
Definition: MathUtil.h:54
FWEventItem::modelData
const void * modelData(int iIndex) const
Definition: FWEventItem.cc:466
FWViewEnergyScale::getPlotEt
bool getPlotEt() const
Definition: FWViewEnergyScale.h:47
fireworks::getShape
TEveGeoShape * getShape(const char *name, TGeoBBox *shape, Color_t color)
Definition: BuilderUtils.cc:44
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
reco::MET
Definition: MET.h:41
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Abs
T Abs(T a)
Definition: MathUtil.h:49
fireworks::Context::voteMaxEtAndEnergy
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:162
fireworks::Context::caloTransEta
static float caloTransEta()
Definition: Context.cc:187
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
fireworks::addRhoZEnergyProjection
void addRhoZEnergyProjection(FWProxyBuilderBase *, TEveElement *, double r_ecal, double z_ecal, double theta_min, double theta_max, double phi)
Definition: BuilderUtils.cc:58
FWMETProxyBuilder::FWMETProxyBuilder
FWMETProxyBuilder()
Definition: FWMETProxyBuilder.cc:39
FWPFGeom::caloR1
float caloR1()
Definition: FWPFGeom.h:20
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
diffTwoXMLs.r2
r2
Definition: diffTwoXMLs.py:73
FWPFGeom::caloZ1
float caloZ1()
Definition: FWPFGeom.h:21
FWProxyBuilderBase::setupAddElement
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
Definition: FWProxyBuilderBase.cc:350
value
Definition: value.py:1
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
PVValHelper::dy
Definition: PVValidationHelpers.h:50
DDAxes::phi
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition: FWProxyBuilderBase.h:64
FWViewEnergyScale::getScaleFactor3D
float getScaleFactor3D() const
Definition: FWViewEnergyScale.h:44
fireworks::Context::caloZ1
static float caloZ1(bool offset=true)
Definition: Context.cc:183
diffTwoXMLs.r1
r1
Definition: diffTwoXMLs.py:53
relativeConstraints.value
value
Definition: relativeConstraints.py:53
FWViewEnergyScale
Definition: FWViewEnergyScale.h:34
FWProxyBuilderBase::context
const fireworks::Context & context() const
Definition: FWProxyBuilderBase.cc:412
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
FWViewContext::getEnergyScale
FWViewEnergyScale * getEnergyScale() const
Definition: FWViewContext.cc:25
fireworks::Context::caloR1
static float caloR1(bool offset=true)
Definition: Context.cc:180
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
FWMETProxyBuilder
Definition: FWMETProxyBuilder.cc:37