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 36 of file FWCaloTowerProxyBuilder.h.

Constructor & Destructor Documentation

FWCaloTowerProxyBuilderBase::FWCaloTowerProxyBuilderBase ( )

Definition at line 37 of file FWCaloTowerProxyBuilder.cc.

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

Definition at line 43 of file FWCaloTowerProxyBuilder.cc.

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

Member Function Documentation

bool FWCaloTowerProxyBuilderBase::assertCaloDataSlice ( )
protectedvirtual

Implements FWCaloDataProxyBuilderBase.

Definition at line 159 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.

160 {
161  if (m_hist == 0)
162  {
163  // add new slice
164  Bool_t status = TH1::AddDirectoryStatus();
165  TH1::AddDirectory(kFALSE); //Keeps histogram from going into memory
166  m_hist = new TH2F("caloHist",
167  "caloHist",
169  72, -M_PI, M_PI);
170  TH1::AddDirectory(status);
171  TEveCaloDataHist* ch = static_cast<TEveCaloDataHist*>(m_caloData);
172  m_sliceIndex = ch->AddHistogram(m_hist);
173 
174 
175 
176  m_caloData->RefSliceInfo(m_sliceIndex).Setup(item()->name().c_str(), 0.,
177  item()->defaultDisplayProperties().color(),
178  item()->defaultDisplayProperties().transparency());
179 
180  // add new selector
182  if (m_caloData->GetUserData())
183  {
184  FWFromEveSelectorBase* base = reinterpret_cast<FWFromEveSelectorBase*>(m_caloData->GetUserData());
185  assert(0!=base);
186  sel = dynamic_cast<FWFromTEveCaloDataSelector*> (base);
187  assert(0!=sel);
188  }
189  else
190  {
192  //make sure it is accessible via the base class
193  m_caloData->SetUserData(static_cast<FWFromEveSelectorBase*>(sel));
194  }
195 
197 
198  return true;
199  }
200  return false;
201 }
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 59 of file FWCaloTowerProxyBuilder.cc.

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

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

Implements FWCaloDataProxyBuilderBase.

Definition at line 97 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().

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

References FWCaloDataProxyBuilderBase::itemBeingDestroyed(), and m_hist.

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

Implements FWCaloDataProxyBuilderBase.

Definition at line 52 of file FWCaloTowerProxyBuilder.cc.

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

53 {
55 }
const fireworks::Context & context() const
TEveCaloDataHist * getCaloData() const
Definition: Context.h:81

Member Data Documentation

TH2F* FWCaloTowerProxyBuilderBase::m_hist
private

Definition at line 62 of file FWCaloTowerProxyBuilder.h.

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

const CaloTowerCollection* FWCaloTowerProxyBuilderBase::m_towers
private

Definition at line 61 of file FWCaloTowerProxyBuilder.h.

Referenced by build(), and fillCaloData().