CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
FWPFEcalRecHitRPProxyBuilder Class Reference

#include <FWPFEcalRecHitRPProxyBuilder.h>

Inheritance diagram for FWPFEcalRecHitRPProxyBuilder:
FWProxyBuilderTemplate< EcalRecHit > FWProxyBuilderBase

Public Member Functions

void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
void cleanLocal () override
 
 FWPFEcalRecHitRPProxyBuilder ()
 
 FWPFEcalRecHitRPProxyBuilder (const FWPFEcalRecHitRPProxyBuilder &)=delete
 
bool havePerViewProduct (FWViewType::EType) const override
 
const FWPFEcalRecHitRPProxyBuilderoperator= (const FWPFEcalRecHitRPProxyBuilder &)=delete
 
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
 
 ~FWPFEcalRecHitRPProxyBuilder () override
 
- Public Member Functions inherited from FWProxyBuilderTemplate< EcalRecHit >
 FWProxyBuilderTemplate ()
 
 FWProxyBuilderTemplate (const FWProxyBuilderTemplate &)=delete
 
const FWProxyBuilderTemplateoperator= (const FWProxyBuilderTemplate &)=delete
 
 ~FWProxyBuilderTemplate () 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
 
virtual bool haveSingleProduct () 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 std::string typeOfBuilder ()
 
- 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

TEveVector calculateCentre (const float *corners)
 

Private Attributes

std::vector< FWPFRhoPhiRecHit * > m_towers
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWProxyBuilderTemplate< EcalRecHit >
const EcalRecHitmodelData (int index)
 
- Protected Member Functions inherited from FWProxyBuilderBase
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
virtual void clean ()
 
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 &)
 
virtual bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 35 of file FWPFEcalRecHitRPProxyBuilder.h.

Constructor & Destructor Documentation

◆ FWPFEcalRecHitRPProxyBuilder() [1/2]

FWPFEcalRecHitRPProxyBuilder::FWPFEcalRecHitRPProxyBuilder ( )
inline

Definition at line 40 of file FWPFEcalRecHitRPProxyBuilder.h.

40 {}

◆ ~FWPFEcalRecHitRPProxyBuilder()

FWPFEcalRecHitRPProxyBuilder::~FWPFEcalRecHitRPProxyBuilder ( )
inlineoverride

Definition at line 41 of file FWPFEcalRecHitRPProxyBuilder.h.

41 {}

◆ FWPFEcalRecHitRPProxyBuilder() [2/2]

FWPFEcalRecHitRPProxyBuilder::FWPFEcalRecHitRPProxyBuilder ( const FWPFEcalRecHitRPProxyBuilder )
delete

Member Function Documentation

◆ build()

void FWPFEcalRecHitRPProxyBuilder::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext vc 
)
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 42 of file FWPFEcalRecHitRPProxyBuilder.cc.

References calculateCentre(), FWPFMaths::calculateEt(), FWPFGeom::caloR1(), FWProxyBuilderBase::context(), funct::cos(), FWProxyBuilderBase::createCompound(), EcalRecHit::detid(), EcalRecHit::energy(), EgHLTOffHistBins_cfi::et, FWGeometry::getCorners(), FWEventItem::getGeom(), mps_fire::i, info(), FWProxyBuilderBase::item(), m_towers, FWProxyBuilderTemplate< EcalRecHit >::modelData(), FWEventItem::modelInfo(), phi, funct::sin(), FWEventItem::size(), AlignmentTracksFromVertexSelector_cfi::vertices, and fireworks::Context::voteMaxEtAndEnergy().

42  {
43  m_towers.clear(); // Bug fix required for when multiple RhoPhiPF views are active
44  for (unsigned int index = 0; index < static_cast<unsigned int>(iItem->size()); ++index) {
45  TEveCompound *itemHolder = createCompound();
46  product->AddElement(itemHolder);
48 
49  if (info.displayProperties().isVisible()) {
50  bool added = false;
51  float E, et;
52  float ecalR = FWPFGeom::caloR1();
53  Double_t lPhi, rPhi;
54  const EcalRecHit &iData = modelData(index);
55  const float *vertices = item()->getGeom()->getCorners(iData.detid());
56 
57  TEveVector centre = calculateCentre(vertices);
58  TEveVector lVec = TEveVector(vertices[0], vertices[1], 0); // Bottom left corner of tower
59  TEveVector rVec = TEveVector(vertices[9], vertices[10], 0); // Bottom right corner of tower
60 
61  lPhi = lVec.Phi();
62  rPhi = rVec.Phi();
63  E = iData.energy();
64  et = FWPFMaths::calculateEt(centre, E);
65 
66  for (unsigned int i = 0; i < m_towers.size(); i++) { // Small range to catch rounding inaccuracies etc.
67  Double_t phi = m_towers[i]->getlPhi();
68  if ((lPhi == phi) || ((lPhi < phi + 0.0005) && (lPhi > phi - 0.0005))) {
69  m_towers[i]->addChild(this, itemHolder, vc, E, et);
71  added = true;
72  break;
73  }
74  }
75 
76  if (!added) {
77  rVec.fX = ecalR * cos(rPhi);
78  rVec.fY = ecalR * sin(rPhi);
79  lVec.fX = ecalR * cos(lPhi);
80  lVec.fY = ecalR * sin(lPhi);
81  std::vector<TEveVector> bCorners(2);
82  bCorners[0] = lVec;
83  bCorners[1] = rVec;
84 
85  FWPFRhoPhiRecHit *rh = new FWPFRhoPhiRecHit(this, itemHolder, vc, E, et, lPhi, rPhi, bCorners);
87  m_towers.push_back(rh);
88  }
89  }
90  }
91 }
size_t size() const
Definition: FWEventItem.cc:457
static const TGPicture * info(bool iBackgroundIsBlack)
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
const fireworks::Context & context() const
const EcalRecHit & modelData(int index)
float caloR1()
Definition: FWPFGeom.h:20
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:439
void voteMaxEtAndEnergy(float Et, float energy) const
Definition: Context.cc:169
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
TEveVector calculateCentre(const float *corners)
float calculateEt(const TEveVector &centre, float e)
Definition: FWPFMaths.cc:115
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
const DetId & detid() const
Definition: EcalRecHit.h:72
std::vector< FWPFRhoPhiRecHit * > m_towers
float energy() const
Definition: EcalRecHit.h:68
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
const FWEventItem * item() const

◆ calculateCentre()

TEveVector FWPFEcalRecHitRPProxyBuilder::calculateCentre ( const float *  corners)
private

Definition at line 26 of file FWPFEcalRecHitRPProxyBuilder.cc.

References mps_fire::i, dqmiolumiharvest::j, and AlignmentTracksFromVertexSelector_cfi::vertices.

Referenced by build().

26  {
27  TEveVector centre;
28 
29  for (unsigned int i = 0; i < 8; i++) {
30  int j = i * 3;
31  centre.fX += vertices[j];
32  centre.fY += vertices[j + 1]; // Total x,y,z values
33  centre.fZ += vertices[j + 2];
34  }
35 
36  centre *= 1.0f / 8.0f; // Actually calculate the centre point
37 
38  return centre;
39 }

◆ classPurpose()

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

Definition at line 94 of file FWPFEcalRecHitRPProxyBuilder.cc.

◆ classRegisterTypeName()

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

Definition at line 94 of file FWPFEcalRecHitRPProxyBuilder.cc.

◆ classTypeName()

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

Definition at line 94 of file FWPFEcalRecHitRPProxyBuilder.cc.

◆ classView()

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

Definition at line 94 of file FWPFEcalRecHitRPProxyBuilder.cc.

◆ cleanLocal()

void FWPFEcalRecHitRPProxyBuilder::cleanLocal ( )
overridevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 17 of file FWPFEcalRecHitRPProxyBuilder.cc.

References mps_fire::i, and m_towers.

17  {
18  typedef std::vector<FWPFRhoPhiRecHit *> rpRecHits;
19  for (rpRecHits::iterator i = m_towers.begin(); i != m_towers.end(); ++i)
20  (*i)->clean();
21 
22  m_towers.clear();
23 }
std::vector< FWPFRhoPhiRecHit * > m_towers

◆ havePerViewProduct()

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

Reimplemented from FWProxyBuilderBase.

Definition at line 46 of file FWPFEcalRecHitRPProxyBuilder.h.

46 { return true; }

◆ operator=()

const FWPFEcalRecHitRPProxyBuilder& FWPFEcalRecHitRPProxyBuilder::operator= ( const FWPFEcalRecHitRPProxyBuilder )
delete

◆ purpose()

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

Definition at line 50 of file FWPFEcalRecHitRPProxyBuilder.h.

55 :
56  // --------------------- Member Functions --------------------------

◆ scaleProduct()

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

Reimplemented from FWProxyBuilderBase.

Definition at line 4 of file FWPFEcalRecHitRPProxyBuilder.cc.

References mps_fire::i, and m_towers.

6  {
7  typedef std::vector<FWPFRhoPhiRecHit *> rpRecHits;
8  unsigned int index = 0;
9 
10  for (rpRecHits::iterator i = m_towers.begin(); i != m_towers.end(); ++i) {
11  m_towers[index]->updateScale(vc);
12  index++;
13  }
14 }
std::vector< FWPFRhoPhiRecHit * > m_towers

◆ typeName()

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

Definition at line 50 of file FWPFEcalRecHitRPProxyBuilder.h.

55 :
56  // --------------------- Member Functions --------------------------

◆ typeOfBuilder()

static std::string FWPFEcalRecHitRPProxyBuilder::typeOfBuilder ( )
inlinestatic

Definition at line 37 of file FWPFEcalRecHitRPProxyBuilder.h.

37 { return "simple#"; }

◆ view()

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

Definition at line 50 of file FWPFEcalRecHitRPProxyBuilder.h.

55 :
56  // --------------------- Member Functions --------------------------

Member Data Documentation

◆ m_towers

std::vector<FWPFRhoPhiRecHit *> FWPFEcalRecHitRPProxyBuilder::m_towers
private

Definition at line 60 of file FWPFEcalRecHitRPProxyBuilder.h.

Referenced by build(), cleanLocal(), and scaleProduct().