#include <FWPFEcalRecHitRPProxyBuilder.h>
Public Member Functions | |
virtual void | build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) |
virtual void | cleanLocal () |
FWPFEcalRecHitRPProxyBuilder () | |
virtual bool | havePerViewProduct (FWViewType::EType) const |
REGISTER_PROXYBUILDER_METHODS () | |
virtual void | scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc) |
virtual | ~FWPFEcalRecHitRPProxyBuilder () |
Static Public Member Functions | |
static std::string | typeOfBuilder () |
Used by the plugin system to determine how the proxy uses the data from FWEventItem. | |
Private Member Functions | |
TEveVector | calculateCentre (const float *corners) |
float | calculateEt (const TEveVector ¢re, float E) |
FWPFEcalRecHitRPProxyBuilder (const FWPFEcalRecHitRPProxyBuilder &) | |
const FWPFEcalRecHitRPProxyBuilder & | operator= (const FWPFEcalRecHitRPProxyBuilder &) |
Private Attributes | |
FWPFUtils * | m_pfUtils |
std::vector< FWPFRhoPhiRecHit * > | m_towers |
Definition at line 34 of file FWPFEcalRecHitRPProxyBuilder.h.
FWPFEcalRecHitRPProxyBuilder::FWPFEcalRecHitRPProxyBuilder | ( | ) | [inline] |
Definition at line 40 of file FWPFEcalRecHitRPProxyBuilder.h.
References m_pfUtils.
virtual FWPFEcalRecHitRPProxyBuilder::~FWPFEcalRecHitRPProxyBuilder | ( | ) | [inline, virtual] |
Definition at line 41 of file FWPFEcalRecHitRPProxyBuilder.h.
References m_pfUtils.
{ delete m_pfUtils; }
FWPFEcalRecHitRPProxyBuilder::FWPFEcalRecHitRPProxyBuilder | ( | const FWPFEcalRecHitRPProxyBuilder & | ) | [private] |
void FWPFEcalRecHitRPProxyBuilder::build | ( | const FWEventItem * | iItem, |
TEveElementList * | product, | ||
const FWViewContext * | vc | ||
) | [virtual] |
Reimplemented from FWProxyBuilderBase.
Definition at line 63 of file FWPFEcalRecHitRPProxyBuilder.cc.
References calculateCentre(), calculateEt(), FWProxyBuilderBase::context(), funct::cos(), FWProxyBuilderBase::createCompound(), CaloRecHit::detid(), CaloRecHit::energy(), ExpressReco_HICollisions_FallBack::et, FWPFUtils::getCaloR1(), FWGeometry::getCorners(), FWEventItem::getGeom(), i, getHLTprescales::index, FWProxyBuilderBase::item(), m_pfUtils, m_towers, FWProxyBuilderTemplate< EcalRecHit >::modelData(), phi, funct::sin(), FWEventItem::size(), ExpressReco_HICollisions_FallBack::vertices, and fireworks::Context::voteMaxEtAndEnergy().
{ m_towers.clear(); // Bug fix required for when multiple RhoPhiPF views are active for( unsigned int index = 0; index < static_cast<unsigned int>( iItem->size() ); ++index ) { TEveCompound *itemHolder = createCompound(); product->AddElement( itemHolder ); bool added = false; float E, et; float ecalR = m_pfUtils->getCaloR1(); Double_t lPhi, rPhi; const EcalRecHit &iData = modelData( index ); const float *vertices = item()->getGeom()->getCorners( iData.detid() ); TEveVector centre = calculateCentre( vertices ); TEveVector lVec = TEveVector( vertices[0], vertices[1], 0 ); // Bottom left corner of tower TEveVector rVec = TEveVector( vertices[9], vertices[10], 0 ); // Bottom right corner of tower lPhi = lVec.Phi(); rPhi = rVec.Phi(); E = iData.energy(); et = calculateEt( centre, E ); for( unsigned int i = 0; i < m_towers.size(); i++ ) { // Small range to catch rounding inaccuracies etc. Double_t phi = m_towers[i]->getlPhi(); if( ( lPhi == phi ) || ( ( lPhi < phi + 0.0005 ) && ( lPhi > phi - 0.0005 ) ) ) { m_towers[i]->addChild( this, itemHolder, vc, E, et ); context().voteMaxEtAndEnergy( et, E ); added = true; break; } } if( !added ) { rVec.fX = ecalR * cos( rPhi ); rVec.fY = ecalR * sin( rPhi ); lVec.fX = ecalR * cos( lPhi ); lVec.fY = ecalR * sin( lPhi ); std::vector<TEveVector> bCorners(2); bCorners[0] = lVec; bCorners[1] = rVec; FWPFRhoPhiRecHit *rh = new FWPFRhoPhiRecHit( this, itemHolder, vc, E, et, lPhi, rPhi, bCorners ); context().voteMaxEtAndEnergy(et, E); m_towers.push_back( rh ); } } }
TEveVector FWPFEcalRecHitRPProxyBuilder::calculateCentre | ( | const float * | corners | ) | [private] |
Definition at line 30 of file FWPFEcalRecHitRPProxyBuilder.cc.
Referenced by build().
float FWPFEcalRecHitRPProxyBuilder::calculateEt | ( | const TEveVector & | centre, |
float | E | ||
) | [private] |
Definition at line 49 of file FWPFEcalRecHitRPProxyBuilder.cc.
References ExpressReco_HICollisions_FallBack::et.
Referenced by build().
void FWPFEcalRecHitRPProxyBuilder::cleanLocal | ( | ) | [virtual] |
virtual bool FWPFEcalRecHitRPProxyBuilder::havePerViewProduct | ( | FWViewType::EType | ) | const [inline, virtual] |
Reimplemented from FWProxyBuilderBase.
Definition at line 46 of file FWPFEcalRecHitRPProxyBuilder.h.
{ return true; }
const FWPFEcalRecHitRPProxyBuilder& FWPFEcalRecHitRPProxyBuilder::operator= | ( | const FWPFEcalRecHitRPProxyBuilder & | ) | [private] |
FWPFEcalRecHitRPProxyBuilder::REGISTER_PROXYBUILDER_METHODS | ( | ) |
void FWPFEcalRecHitRPProxyBuilder::scaleProduct | ( | TEveElementList * | parent, |
FWViewType::EType | type, | ||
const FWViewContext * | vc | ||
) | [virtual] |
Reimplemented from FWProxyBuilderBase.
Definition at line 5 of file FWPFEcalRecHitRPProxyBuilder.cc.
References i, getHLTprescales::index, and m_towers.
static std::string FWPFEcalRecHitRPProxyBuilder::typeOfBuilder | ( | ) | [inline, static] |
Used by the plugin system to determine how the proxy uses the data from FWEventItem.
Reimplemented from FWProxyBuilderBase.
Definition at line 37 of file FWPFEcalRecHitRPProxyBuilder.h.
{ return "simple#"; }
FWPFUtils* FWPFEcalRecHitRPProxyBuilder::m_pfUtils [private] |
Definition at line 62 of file FWPFEcalRecHitRPProxyBuilder.h.
Referenced by build(), FWPFEcalRecHitRPProxyBuilder(), and ~FWPFEcalRecHitRPProxyBuilder().
std::vector<FWPFRhoPhiRecHit*> FWPFEcalRecHitRPProxyBuilder::m_towers [private] |
Definition at line 61 of file FWPFEcalRecHitRPProxyBuilder.h.
Referenced by build(), cleanLocal(), and scaleProduct().