CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
FWCaloTowerProxyBuilderBase Class Referenceabstract

#include <FWCaloTowerProxyBuilder.h>

Inheritance diagram for FWCaloTowerProxyBuilderBase:
FWCaloDataProxyBuilderBase FWProxyBuilderBase FWECalCaloTowerProxyBuilder FWHCalCaloTowerProxyBuilder FWHOCaloTowerProxyBuilder

Public Member Functions

 FWCaloTowerProxyBuilderBase ()
 
virtual double getEt (const CaloTower &) const =0
 
virtual ~FWCaloTowerProxyBuilderBase ()
 
- Public Member Functions inherited from FWCaloDataProxyBuilderBase
 FWCaloDataProxyBuilderBase ()
 
virtual bool willHandleInteraction () const
 
virtual ~FWCaloDataProxyBuilderBase ()
 
- 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 havePerViewProduct (FWViewType::EType) const
 
virtual bool haveSingleProduct () const
 
const FWEventItemitem () const
 
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 ~FWProxyBuilderBase ()
 

Protected Member Functions

bool assertCaloDataSlice ()
 
virtual void fillCaloData ()
 
virtual void itemBeingDestroyed (const FWEventItem *)
 
virtual void setCaloData (const fireworks::Context &)
 
- Protected Member Functions inherited from FWProxyBuilderBase
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
virtual void clean ()
 
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)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
virtual bool visibilityModelChanges (const FWModelId &, TEveElement *, FWViewType::EType, const FWViewContext *)
 

Private Member Functions

virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
 FWCaloTowerProxyBuilderBase (const FWCaloTowerProxyBuilderBase &)
 
const FWCaloTowerProxyBuilderBaseoperator= (const FWCaloTowerProxyBuilderBase &)
 

Private Attributes

TH2F * m_hist
 
const CaloTowerCollectionm_towers
 

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 Attributes inherited from FWCaloDataProxyBuilderBase
TEveCaloData * m_caloData
 
Int_t m_sliceIndex
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Description: <one line="" class="" summary>="">

Usage: <usage>

Definition at line 35 of file FWCaloTowerProxyBuilder.h.

Constructor & Destructor Documentation

FWCaloTowerProxyBuilderBase::FWCaloTowerProxyBuilderBase ( )

Definition at line 36 of file FWCaloTowerProxyBuilder.cc.

36  :
37 m_towers(0),
38 m_hist(0)
39 {
40 }
const CaloTowerCollection * m_towers
FWCaloTowerProxyBuilderBase::~FWCaloTowerProxyBuilderBase ( )
virtual

Definition at line 42 of file FWCaloTowerProxyBuilder.cc.

43 {
44 }
FWCaloTowerProxyBuilderBase::FWCaloTowerProxyBuilderBase ( const FWCaloTowerProxyBuilderBase )
private

Member Function Documentation

bool FWCaloTowerProxyBuilderBase::assertCaloDataSlice ( )
protectedvirtual

Implements FWCaloDataProxyBuilderBase.

Definition at line 158 of file FWCaloTowerProxyBuilder.cc.

References FWFromTEveCaloDataSelector::addSliceSelector(), newFWLiteAna::base, create_public_lumi_plots::color, FWProxyBuilderBase::item(), FWCaloDataProxyBuilderBase::m_caloData, m_hist, M_PI, FWCaloDataProxyBuilderBase::m_sliceIndex, mergeVDriftHistosByStation::name, EgammaValidation_Wenu_cff::sel, ntuplemaker::status, fw3dlego::xbins, and fw3dlego::xbins_n.

159 {
160  if (m_hist == 0)
161  {
162  // add new slice
163  Bool_t status = TH1::AddDirectoryStatus();
164  TH1::AddDirectory(kFALSE); //Keeps histogram from going into memory
165  m_hist = new TH2F("caloHist",
166  "caloHist",
168  72, -M_PI, M_PI);
169  TH1::AddDirectory(status);
170  TEveCaloDataHist* ch = static_cast<TEveCaloDataHist*>(m_caloData);
171  m_sliceIndex = ch->AddHistogram(m_hist);
172 
173 
174 
175  m_caloData->RefSliceInfo(m_sliceIndex).Setup(item()->name().c_str(), 0.,
176  item()->defaultDisplayProperties().color(),
177  item()->defaultDisplayProperties().transparency());
178 
179  // add new selector
181  if (m_caloData->GetUserData())
182  {
183  FWFromEveSelectorBase* base = reinterpret_cast<FWFromEveSelectorBase*>(m_caloData->GetUserData());
184  assert(0!=base);
185  sel = dynamic_cast<FWFromTEveCaloDataSelector*> (base);
186  assert(0!=sel);
187  }
188  else
189  {
191  //make sure it is accessible via the base class
192  m_caloData->SetUserData(static_cast<FWFromEveSelectorBase*>(sel));
193  }
194 
196 
197  return true;
198  }
199  return false;
200 }
tuple base
Main Program
Definition: newFWLiteAna.py:92
const double xbins[]
void addSliceSelector(int iSlice, FWFromSliceSelector *)
const FWEventItem * item() const
const int xbins_n
#define M_PI
Definition: BFit3D.cc:3
tuple status
Definition: ntuplemaker.py:245
void FWCaloTowerProxyBuilderBase::build ( const FWEventItem iItem,
TEveElementList *  product,
const FWViewContext ctx 
)
privatevirtual

Reimplemented from FWCaloDataProxyBuilderBase.

Definition at line 58 of file FWCaloTowerProxyBuilder.cc.

References FWProxyBuilderBase::build(), FWEventItem::get(), and m_towers.

60 {
61  m_towers=0;
62  if (iItem)
63  {
64  iItem->get(m_towers);
65  FWCaloDataProxyBuilderBase::build(iItem, el, ctx);
66  }
67 }
void get(const T *&oData) const
Definition: FWEventItem.h:84
const CaloTowerCollection * m_towers
void FWCaloTowerProxyBuilderBase::fillCaloData ( )
protectedvirtual

Implements FWCaloDataProxyBuilderBase.

Definition at line 96 of file FWCaloTowerProxyBuilder.cc.

References edm::SortedCollection< T, SORT >::begin(), FWEventItem::ModelInfo::displayProperties(), edm::SortedCollection< T, SORT >::end(), getEt(), getHLTprescales::index, info(), FWEventItem::ModelInfo::isSelected(), FWDisplayProperties::isVisible(), FWProxyBuilderBase::item(), FWCaloDataProxyBuilderBase::m_caloData, m_hist, FWCaloDataProxyBuilderBase::m_sliceIndex, m_towers, FWEventItem::modelInfo(), Pi, and wrapPi().

97 {
98  static float d = 2.5*TMath::Pi()/180;
99  m_hist->Reset();
100 
101  if (m_towers)
102  {
103  TEveCaloData::vCellId_t& selected = m_caloData->GetCellsSelected();
104 
105  if(item()->defaultDisplayProperties().isVisible()) {
106  // assert(item()->size() >= m_towers->size());
107  unsigned int index=0;
108  for(CaloTowerCollection::const_iterator tower = m_towers->begin(); tower != m_towers->end(); ++tower,++index) {
109  const FWEventItem::ModelInfo& info = item()->modelInfo(index);
110  if(info.displayProperties().isVisible()) {
111  if (tower->ietaAbs() > 39)
112  {
113  m_hist->Fill(tower->eta(),wrapPi(tower->phi() - 3*d), getEt(*tower) *0.25);
114  m_hist->Fill(tower->eta(),wrapPi(tower->phi() - d), getEt(*tower) *0.25);
115  m_hist->Fill(tower->eta(),wrapPi(tower->phi() + d), getEt(*tower) *0.25);
116  m_hist->Fill(tower->eta(),wrapPi(tower->phi() + 3*d), getEt(*tower) *0.25);
117  }
118  else if (tower->ietaAbs() > 20)
119  {
120  m_hist->Fill(tower->eta(),wrapPi(tower->phi() - d), getEt(*tower) *0.5);
121  m_hist->Fill(tower->eta(),wrapPi(tower->phi() + d), getEt(*tower) *0.5);
122  }
123  else
124  {
125  m_hist->Fill(tower->eta(),tower->phi(), getEt(*tower));
126  }
127  }
128  if(info.isSelected()) {
129  //NOTE: I tried calling TEveCalo::GetCellList but it always returned 0, probably because of threshold issues
130  // but looking at the TEveCaloHist::GetCellList code the CellId_t is just the histograms bin # and the slice
131  // printf("applyChangesToAllModels ...check selected \n");
132 
133  if (tower->ietaAbs() > 39)
134  {
135  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(tower->eta(), wrapPi(tower->phi() -3*d)),m_sliceIndex));
136  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(tower->eta(), wrapPi(tower->phi() -d)) ,m_sliceIndex));
137  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(tower->eta(), wrapPi(tower->phi() +d)) ,m_sliceIndex));
138  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(tower->eta(), wrapPi(tower->phi() +3*d)),m_sliceIndex));
139  }
140  else if (tower->ietaAbs() > 20)
141  {
142  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(tower->eta(), wrapPi(tower->phi() -d)), m_sliceIndex));
143  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(tower->eta(), wrapPi(tower->phi() +d)), m_sliceIndex));
144  }
145  else
146  {
147  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(tower->eta(),tower->phi()),m_sliceIndex));
148  }
149  }
150  }
151  }
152  }
153 
154 }
const double Pi
static const TGPicture * info(bool iBackgroundIsBlack)
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:67
bool isSelected() const
Definition: FWEventItem.h:70
std::vector< CaloTower >::const_iterator const_iterator
const FWEventItem * item() const
const CaloTowerCollection * m_towers
const_iterator end() const
virtual double getEt(const CaloTower &) const =0
double wrapPi(double val)
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:535
const_iterator begin() const
virtual double FWCaloTowerProxyBuilderBase::getEt ( const CaloTower ) const
pure virtual
void FWCaloTowerProxyBuilderBase::itemBeingDestroyed ( const FWEventItem iItem)
protectedvirtual

Reimplemented from FWCaloDataProxyBuilderBase.

Definition at line 70 of file FWCaloTowerProxyBuilder.cc.

References FWCaloDataProxyBuilderBase::itemBeingDestroyed(), and m_hist.

71 {
72 
73  if(0!=m_hist) {
74  m_hist->Reset();
75  }
77 }
virtual void itemBeingDestroyed(const FWEventItem *)
const FWCaloTowerProxyBuilderBase& FWCaloTowerProxyBuilderBase::operator= ( const FWCaloTowerProxyBuilderBase )
private
void FWCaloTowerProxyBuilderBase::setCaloData ( const fireworks::Context )
protectedvirtual

Implements FWCaloDataProxyBuilderBase.

Definition at line 51 of file FWCaloTowerProxyBuilder.cc.

References FWProxyBuilderBase::context(), fireworks::Context::getCaloData(), and FWCaloDataProxyBuilderBase::m_caloData.

52 {
54 }
const fireworks::Context & context() const
TEveCaloDataHist * getCaloData() const
Definition: Context.h:80

Member Data Documentation

TH2F* FWCaloTowerProxyBuilderBase::m_hist
private

Definition at line 61 of file FWCaloTowerProxyBuilder.h.

Referenced by assertCaloDataSlice(), fillCaloData(), and itemBeingDestroyed().

const CaloTowerCollection* FWCaloTowerProxyBuilderBase::m_towers
private

Definition at line 60 of file FWCaloTowerProxyBuilder.h.

Referenced by build(), and fillCaloData().