CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
FWCaloTauProxyBuilder Class Reference
Inheritance diagram for FWCaloTauProxyBuilder:
FWTauProxyBuilderBase FWProxyBuilderBase

Public Member Functions

 FWCaloTauProxyBuilder ()
 
 REGISTER_PROXYBUILDER_METHODS ()
 
virtual ~FWCaloTauProxyBuilder ()
 
- Public Member Functions inherited from FWTauProxyBuilderBase
virtual void cleanLocal ()
 
 FWTauProxyBuilderBase ()
 
virtual bool havePerViewProduct (FWViewType::EType) const
 
virtual bool haveSingleProduct () const
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
virtual ~FWTauProxyBuilderBase ()
 
- 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 &)
 
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 ()
 

Private Member Functions

virtual void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *vc)
 
 FWCaloTauProxyBuilder (const FWCaloTauProxyBuilder &)
 
const FWCaloTauProxyBuilderoperator= (const FWCaloTauProxyBuilder &)
 

Additional Inherited Members

- 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...
 
- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >
::iterator 
Product_it
 
- Protected Member Functions inherited from FWTauProxyBuilderBase
void buildBaseTau (const reco::BaseTau &iTau, const reco::Jet &iJet, TEveElement *comp, FWViewType::EType type, const FWViewContext *vc)
 
virtual void localModelChanges (const FWModelId &iId, TEveElement *iCompound, FWViewType::EType viewType, const FWViewContext *vc)
 
- Protected Member Functions inherited from FWProxyBuilderBase
virtual void build (const FWEventItem *iItem, TEveElementList *product, 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 modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
virtual bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 
- Protected Attributes inherited from FWTauProxyBuilderBase
float m_maxTheta
 
float m_minTheta
 
std::vector< double > m_phis
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 33 of file FWCaloTauProxyBuilder.cc.

Constructor & Destructor Documentation

FWCaloTauProxyBuilder::FWCaloTauProxyBuilder ( )
inline

Definition at line 36 of file FWCaloTauProxyBuilder.cc.

36 {}
virtual FWCaloTauProxyBuilder::~FWCaloTauProxyBuilder ( )
inlinevirtual

Definition at line 37 of file FWCaloTauProxyBuilder.cc.

37 {}
FWCaloTauProxyBuilder::FWCaloTauProxyBuilder ( const FWCaloTauProxyBuilder )
private

Member Function Documentation

void FWCaloTauProxyBuilder::buildViewType ( const FWEventItem iItem,
TEveElementList *  product,
FWViewType::EType  viewType,
const FWViewContext vc 
)
privatevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 50 of file FWCaloTauProxyBuilder.cc.

References fireworks::addCircle(), FWTauProxyBuilderBase::buildBaseTau(), reco::CaloTauTagInfo::calojetRef(), FWProxyBuilderBase::createCompound(), FWEventItem::get(), edm::Ref< C, T, F >::get(), reco::CaloJet::getCaloConstituents(), metsig::jet, FWViewType::kLego, FWTauProxyBuilderBase::m_maxTheta, FWTauProxyBuilderBase::m_minTheta, FWTauProxyBuilderBase::m_phis, max(), min, FWProxyBuilderBase::setupAddElement(), fireworks::thetaBins(), and ExpressReco_HICollisions_FallBack::towerEnd.

51 {
52  reco::CaloTauCollection const * caloTaus = 0;
53  iItem->get( caloTaus );
54  if( caloTaus == 0 ) return;
55 
56 
57  Int_t idx = 0;
58  for( reco::CaloTauCollection::const_iterator it = caloTaus->begin(), itEnd = caloTaus->end(); it != itEnd; ++it, ++idx)
59  {
60  TEveCompound* comp = createCompound();
61 
62  if (viewType == FWViewType::kLego)
63  {
64  fireworks::addCircle( (*it).eta(), (*it).phi(), 0.5, 20, comp, this );
65  }
66  else
67  {
68  const reco::CaloTauTagInfo *tauTagInfo = dynamic_cast<const reco::CaloTauTagInfo*>(((*it).caloTauTagInfoRef().get()));
69  const reco::CaloJet *jet = dynamic_cast<const reco::CaloJet*>((tauTagInfo->calojetRef().get()));
70 
71  int min = 100;
72  int max = -100;
73  std::vector<double> phis;
74  std::vector<CaloTowerPtr> towers = jet->getCaloConstituents();
75  for( std::vector<CaloTowerPtr>::const_iterator tower = towers.begin(), towerEnd = towers.end();
76  tower != towerEnd; ++tower )
77  {
78  unsigned int ieta = 41 + (*tower)->id().ieta();
79  if( ieta > 40 ) --ieta;
80  assert( ieta <= 82 );
81 
82  if( int(ieta) > max ) max = ieta;
83  if( int(ieta) < min ) min = ieta;
84  m_phis.push_back( (*tower)->phi() );
85  }
86  if( min > max ) {
87  min = 0; max = 0;
88  }
89  const std::vector<std::pair<double, double> > thetaBins = fireworks::thetaBins();
90  m_minTheta = thetaBins[min].first;
91  m_maxTheta = thetaBins[max].second;
92 
93  buildBaseTau(*it, *jet, comp, viewType, vc);
94  m_phis.clear();
95  }
96  setupAddElement( comp, product );
97  }
98 
99 }
Jets made from CaloTowers.
Definition: CaloJet.h:30
const CaloJetRef & calojetRef() const
std::vector< std::pair< double, double > > thetaBins()
Definition: thetaBins.cc:49
void setupAddElement(TEveElement *el, TEveElement *parent, bool set_color=true) const
void get(const T *&oData) const
Definition: FWEventItem.h:84
#define min(a, b)
Definition: mlp_lapack.h:161
virtual std::vector< CaloTowerPtr > getCaloConstituents() const
get all constituents
Definition: CaloJet.cc:94
std::vector< CaloTau > CaloTauCollection
collection of CaloTau objects
Definition: CaloTauFwd.h:9
const T & max(const T &a, const T &b)
void addCircle(double eta, double phi, double radius, const unsigned int nLineSegments, TEveElement *comp, FWProxyBuilderBase *pb)
void buildBaseTau(const reco::BaseTau &iTau, const reco::Jet &iJet, TEveElement *comp, FWViewType::EType type, const FWViewContext *vc)
TEveCompound * createCompound(bool set_color=true, bool propagate_color_to_all_children=false) const
std::vector< double > m_phis
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:239
const FWCaloTauProxyBuilder& FWCaloTauProxyBuilder::operator= ( const FWCaloTauProxyBuilder )
private
FWCaloTauProxyBuilder::REGISTER_PROXYBUILDER_METHODS ( )