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 | Protected Attributes
FWCaloDataHistProxyBuilder Class Referenceabstract

#include <FWCaloDataHistProxyBuilder.h>

Inheritance diagram for FWCaloDataHistProxyBuilder:
FWCaloDataProxyBuilderBase FWProxyBuilderBase FWCaloTowerProxyBuilderBase FWCandidateTowerProxyBuilder FWPFCandidateTowerProxyBuilder FWECalCaloTowerProxyBuilder FWHCalCaloTowerProxyBuilder FWHOCaloTowerProxyBuilder FWECalPFCandidateProxyBuilder FWHCalPFCandidateProxyBuilder

Public Member Functions

 FWCaloDataHistProxyBuilder ()
 
virtual ~FWCaloDataHistProxyBuilder ()
 
- 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

void addEntryToTEveCaloData (float eta, float phi, float Et, bool isSelected)
 
virtual bool assertCaloDataSlice ()
 
virtual FWHistSliceSelectorinstantiateSliceSelector ()=0
 
virtual void itemBeingDestroyed (const FWEventItem *)
 
virtual void setCaloData (const fireworks::Context &)
 
- Protected Member Functions inherited from FWCaloDataProxyBuilderBase
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
virtual void fillCaloData ()=0
 
- 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 *)
 

Protected Attributes

TH2F * m_hist
 
FWHistSliceSelectorm_sliceSelector
 
- Protected Attributes inherited from FWCaloDataProxyBuilderBase
TEveCaloData * m_caloData
 
Int_t m_sliceIndex
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

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
 

Detailed Description

Definition at line 11 of file FWCaloDataHistProxyBuilder.h.

Constructor & Destructor Documentation

FWCaloDataHistProxyBuilder::FWCaloDataHistProxyBuilder ( )

Definition at line 15 of file FWCaloDataHistProxyBuilder.cc.

FWCaloDataHistProxyBuilder::~FWCaloDataHistProxyBuilder ( )
virtual

Definition at line 18 of file FWCaloDataHistProxyBuilder.cc.

19 {
20 }

Member Function Documentation

void FWCaloDataHistProxyBuilder::addEntryToTEveCaloData ( float  eta,
float  phi,
float  Et,
bool  isSelected 
)
protected

Definition at line 103 of file FWCaloDataHistProxyBuilder.cc.

References Abs(), FWHistSliceSelector::aggregatePhiCells(), ztail::d, FWCaloDataProxyBuilderBase::m_caloData, m_hist, FWCaloDataProxyBuilderBase::m_sliceIndex, m_sliceSelector, Pi, and fw3dlego::xbins.

Referenced by FWCandidateTowerProxyBuilder::fillCaloData(), FWPFCandidateTowerProxyBuilder::fillCaloData(), and FWCaloTowerProxyBuilderBase::fillCaloData().

104 {
105  using namespace TMath;
106  static float d = 2.5*Pi()/180;
107  // printf("comapre %f, %f \n", fw3dlego::xbins[80], fw3dlego::xbins[61] );
108 
109 
111  if (Abs(eta) > fw3dlego::xbins[80])
112  {
113  m_hist->Fill(eta,wrapPi(phi - 3*d), Et *0.25);
114  m_hist->Fill(eta,wrapPi(phi - d), Et *0.25);
115  m_hist->Fill(eta,wrapPi(phi + d), Et *0.25);
116  m_hist->Fill(eta,wrapPi(phi + 3*d), Et *0.25);
117  }
118  else if (Abs(eta) > fw3dlego::xbins[61])
119  {
120  m_hist->Fill(eta,wrapPi(phi - d), Et *0.5);
121  m_hist->Fill(eta,wrapPi(phi + d), Et *0.5);
122  }
123  else
124  {
125  m_hist->Fill(eta,phi, Et);
126  }
127  }
128  else
129  {
130  m_hist->Fill(eta,phi, Et);
131  }
132 
133  TEveCaloData::vCellId_t& selected = m_caloData->GetCellsSelected();
134  if(isSelected) {
135  //NOTE: I tried calling TEveCalo::GetCellList but it always returned 0, probably because of threshold issues
136  // but looking at the TEveCaloHist::GetCellList code the CellId_t is just the histograms bin # and the slice
137  // printf("applyChangesToAllModels ...check selected \n");
138 
139 
141  if (Abs(eta) > fw3dlego::xbins[80])
142  {
143  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(eta, wrapPi(phi -3*d)),m_sliceIndex));
144  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(eta, wrapPi(phi -d)) ,m_sliceIndex));
145  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(eta, wrapPi(phi +d)) ,m_sliceIndex));
146  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(eta, wrapPi(phi +3*d)),m_sliceIndex));
147  }
148  if (Abs(eta) > fw3dlego::xbins[60])
149  {
150  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(eta, wrapPi(phi -d)), m_sliceIndex));
151  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(eta, wrapPi(phi +d)), m_sliceIndex));
152  }
153  else
154  {
155  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(eta,phi),m_sliceIndex));
156  }
157  }
158  else
159  {
160  selected.push_back(TEveCaloData::CellId_t(m_hist->FindBin(eta,phi),m_sliceIndex));
161  }
162  }
163 }
const double Pi
const double xbins[]
tuple d
Definition: ztail.py:151
T Abs(T a)
Definition: MathUtil.h:49
virtual bool aggregatePhiCells() const
bool FWCaloDataHistProxyBuilder::assertCaloDataSlice ( )
protectedvirtual

Implements FWCaloDataProxyBuilderBase.

Definition at line 58 of file FWCaloDataHistProxyBuilder.cc.

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

59 {
60  if (m_hist == 0)
61  {
62  // add new slice
63  Bool_t status = TH1::AddDirectoryStatus();
64  TH1::AddDirectory(kFALSE); //Keeps histogram from going into memory
65  m_hist = new TH2F("caloHist",
66  "caloHist",
68  72, -M_PI, M_PI);
69  TH1::AddDirectory(status);
70  TEveCaloDataHist* ch = static_cast<TEveCaloDataHist*>(m_caloData);
71  m_sliceIndex = ch->AddHistogram(m_hist);
72 
73 
74 
75  m_caloData->RefSliceInfo(m_sliceIndex).Setup(item()->name().c_str(), 0.,
76  item()->defaultDisplayProperties().color(),
77  item()->defaultDisplayProperties().transparency());
78 
79  // add new selector
81  if (m_caloData->GetUserData())
82  {
83  FWFromEveSelectorBase* base = reinterpret_cast<FWFromEveSelectorBase*>(m_caloData->GetUserData());
84  assert(0!=base);
85  sel = dynamic_cast<FWFromTEveCaloDataSelector*> (base);
86  assert(0!=sel);
87  }
88  else
89  {
91  //make sure it is accessible via the base class
92  m_caloData->SetUserData(static_cast<FWFromEveSelectorBase*>(sel));
93  }
96 
97  return true;
98  }
99  return false;
100  }
tuple base
Main Program
Definition: newFWLiteAna.py:92
const double xbins[]
assert(m_qm.get())
void addSliceSelector(int iSlice, FWFromSliceSelector *)
const FWEventItem * item() const
virtual FWHistSliceSelector * instantiateSliceSelector()=0
#define M_PI
const int xbins_n
tuple status
Definition: ntuplemaker.py:245
virtual FWHistSliceSelector* FWCaloDataHistProxyBuilder::instantiateSliceSelector ( )
protectedpure virtual
void FWCaloDataHistProxyBuilder::itemBeingDestroyed ( const FWEventItem iItem)
protectedvirtual

Reimplemented from FWCaloDataProxyBuilderBase.

Definition at line 48 of file FWCaloDataHistProxyBuilder.cc.

References FWCaloDataProxyBuilderBase::itemBeingDestroyed(), and m_hist.

49 {
50 
51  if(0!=m_hist) {
52  m_hist->Reset();
53  }
55 }
virtual void itemBeingDestroyed(const FWEventItem *)
void FWCaloDataHistProxyBuilder::setCaloData ( const fireworks::Context )
protectedvirtual

Implements FWCaloDataProxyBuilderBase.

Definition at line 42 of file FWCaloDataHistProxyBuilder.cc.

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

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

Member Data Documentation

TH2F* FWCaloDataHistProxyBuilder::m_hist
protected
FWHistSliceSelector* FWCaloDataHistProxyBuilder::m_sliceSelector
protected

Definition at line 25 of file FWCaloDataHistProxyBuilder.h.

Referenced by addEntryToTEveCaloData(), and assertCaloDataSlice().