CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes
FWHGCRecHitProxyBuilder Class Reference
Inheritance diagram for FWHGCRecHitProxyBuilder:
FWSimpleProxyBuilderTemplate< HGCRecHit > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWHGCRecHitProxyBuilder ()
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWHGCRecHitProxyBuilder (void) override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< HGCRecHit >
 FWSimpleProxyBuilderTemplate ()
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
 ~FWSimpleProxyBuilder () override
 
- 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
 
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 setupAddElement (TEveElement *el, TEveElement *parent, bool set_color=true) const
 
void setupElement (TEveElement *el, bool color=true) const
 
virtual bool willHandleInteraction () const
 
virtual ~FWProxyBuilderBase ()
 

Static Public Member Functions

static const std::string & classPurpose ()
 
static const std::string & classRegisterTypeName ()
 
static const std::string & classTypeName ()
 
static const std::string & classView ()
 
- Static Public Member Functions inherited from FWSimpleProxyBuilder
static std::string typeOfBuilder ()
 Used by the plugin system to determine how the proxy uses the data from FWEventItem. More...
 
- 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...
 

Private Member Functions

void build (const HGCRecHit &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *) override
 
 FWHGCRecHitProxyBuilder (const FWHGCRecHitProxyBuilder &)=delete
 
const FWHGCRecHitProxyBuilderoperator= (const FWHGCRecHitProxyBuilder &)=delete
 
void setItem (const FWEventItem *iItem) override
 

Static Private Attributes

static float gradient [3][gradient_steps]
 
static uint8_t gradient_steps = 9
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< HGCRecHit >
void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
 
void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
 
virtual void buildViewType (const HGCRecHit &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
const HGCRecHitmodelData (int index)
 
- Protected Member Functions inherited from FWSimpleProxyBuilder
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
 
void clean () override
 
- Protected Member Functions inherited from FWProxyBuilderBase
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)
 
virtual void modelChanges (const FWModelIds &, Product *)
 
const FWProxyBuilderBaseoperator= (const FWProxyBuilderBase &)
 
virtual void scaleProduct (TEveElementList *parent, FWViewType::EType, const FWViewContext *vc)
 
- Protected Attributes inherited from FWSimpleProxyBuilder
FWSimpleProxyHelper m_helper
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 

Detailed Description

Definition at line 9 of file FWHGCRecHitProxyBuilder.cc.

Constructor & Destructor Documentation

FWHGCRecHitProxyBuilder::FWHGCRecHitProxyBuilder ( )
inline

Definition at line 12 of file FWHGCRecHitProxyBuilder.cc.

12 {}
FWHGCRecHitProxyBuilder::~FWHGCRecHitProxyBuilder ( void  )
inlineoverride

Definition at line 13 of file FWHGCRecHitProxyBuilder.cc.

13 {}
FWHGCRecHitProxyBuilder::FWHGCRecHitProxyBuilder ( const FWHGCRecHitProxyBuilder )
privatedelete

Member Function Documentation

void FWHGCRecHitProxyBuilder::build ( const HGCRecHit iData,
unsigned int  iIndex,
TEveElement &  oItemHolder,
const FWViewContext  
)
overrideprivatevirtual

iIndex is the index where iData is found in the container from which it came iItemHolder is the object to which you add your own objects which inherit from TEveElement

Reimplemented from FWSimpleProxyBuilderTemplate< HGCRecHit >.

Definition at line 45 of file FWHGCRecHitProxyBuilder.cc.

References create_public_lumi_plots::color, CaloRecHit::energy(), FWEventItem::getConfig(), FWGeometry::getCorners(), FWEventItem::getGeom(), FWGeometry::getParameters(), FWGeometry::getShapePars(), gradient, gradient_steps, mps_fire::i, HGCRecHit::id(), FWProxyBuilderBase::item(), FWProxyBuilderBase::layer(), PFRecoTauDiscriminationByIsolation_cfi::offset, TCMET_cfi::radius, FWProxyBuilderConfiguration::value(), globals_cff::x1, and z.

46 {
47  const long layer = item()->getConfig()->value<long>("Layer");
48  const double saturation_energy = item()->getConfig()->value<double>("EnergyCutOff");
49  const bool heatmap = item()->getConfig()->value<bool>("Heatmap");
50  const bool z_plus = item()->getConfig()->value<bool>("Z+");
51  const bool z_minus = item()->getConfig()->value<bool>("Z-");
52 
53  TEveBoxSet* boxset = new TEveBoxSet();
54  if(!heatmap)
55  boxset->UseSingleColor();
56  boxset->SetPickable(true);
57  boxset->SetAntiFlick(true);
58 
59  unsigned int ID = iData.id();
60 
61  const bool z = (ID >> 25) & 0x1;
62 
63  // discard everything thats not at the side that we are intersted in
64  if (
65  ((z_plus & z_minus) != 1) &&
66  (((z_plus | z_minus) == 0) || !(z == z_minus || z == !z_plus)))
67  return;
68 
69  const float *corners = item()->getGeom()->getCorners(ID);
70  const float *parameters = item()->getGeom()->getParameters(ID);
71  const float *shapes = item()->getGeom()->getShapePars(ID);
72 
73  if (corners == nullptr || parameters == nullptr || shapes == nullptr)
74  return;
75 
76  const int total_points = parameters[0];
77  const bool isScintillator = (total_points == 4);
78  const uint8_t type = ((ID >> 28) & 0xF);
79 
80  uint8_t ll = layer;
81  if (layer > 0)
82  {
83  if (layer > 28)
84  {
85  if (type == 8)
86  {
87  return;
88  }
89  ll -= 28;
90  }
91  else
92  {
93  if (type != 8)
94  {
95  return;
96  }
97  }
98 
99  if (ll != ((ID >> (isScintillator ? 17 : 20)) & 0x1F))
100  return;
101  }
102 
103  boxset->Reset(isScintillator ? TEveBoxSet::kBT_FreeBox : TEveBoxSet::kBT_Hex, true, 64);
104 
105  // Scintillator
106  if (isScintillator)
107  {
108  const int total_vertices = 3 * total_points;
109 
110  std::vector<float> pnts(24);
111  for (int i = 0; i < total_points; ++i)
112  {
113  pnts[i * 3 + 0] = corners[i * 3];
114  pnts[i * 3 + 1] = corners[i * 3 + 1];
115  pnts[i * 3 + 2] = corners[i * 3 + 2];
116 
117  pnts[(i * 3 + 0) + total_vertices] = corners[i * 3];
118  pnts[(i * 3 + 1) + total_vertices] = corners[i * 3 + 1];
119  pnts[(i * 3 + 2) + total_vertices] = corners[i * 3 + 2] + shapes[3];
120  }
121  boxset->AddBox(&pnts[0]);
122  }
123  // Silicon
124  else
125  {
126  const int offset = 9;
127 
128  float centerX = (corners[6] + corners[6 + offset]) / 2;
129  float centerY = (corners[7] + corners[7 + offset]) / 2;
130  float radius = fabs(corners[6] - corners[6 + offset]) / 2;
131  boxset->AddHex(TEveVector(centerX, centerY, corners[2]),
132  radius, 90.0, shapes[3]);
133  }
134 
135  if(heatmap) {
136  const uint8_t colorFactor = gradient_steps*(fmin(iData.energy()/saturation_energy, 1.0f));
137  boxset->DigitColor(gradient[0][colorFactor], gradient[1][colorFactor], gradient[2][colorFactor]);
138  }
139 
140  boxset->RefitPlex();
141 
142  boxset->CSCTakeAnyParentAsMaster();
143  if (!heatmap)
144  {
145  boxset->CSCApplyMainColorToMatchingChildren();
146  boxset->CSCApplyMainTransparencyToMatchingChildren();
147  boxset->SetMainColor(item()->defaultDisplayProperties().color());
148  boxset->SetMainTransparency(item()->defaultDisplayProperties().transparency());
149  }
150  oItemHolder.AddElement(boxset);
151 }
constexpr float energy() const
Definition: CaloRecHit.h:31
type
Definition: HCALResponse.h:21
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:169
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:446
uint32_t ID
Definition: Definitions.h:26
const FWEventItem * item() const
const float * getShapePars(unsigned int id) const
Definition: FWGeometry.cc:462
DetId id() const
get the id
Definition: HGCRecHit.h:69
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:430
static float gradient[3][gradient_steps]
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:686
const std::string & FWHGCRecHitProxyBuilder::classPurpose ( )
static

Definition at line 153 of file FWHGCRecHitProxyBuilder.cc.

const std::string & FWHGCRecHitProxyBuilder::classRegisterTypeName ( )
static

Definition at line 153 of file FWHGCRecHitProxyBuilder.cc.

const std::string & FWHGCRecHitProxyBuilder::classTypeName ( )
static

Definition at line 153 of file FWHGCRecHitProxyBuilder.cc.

const std::string & FWHGCRecHitProxyBuilder::classView ( )
static

Definition at line 153 of file FWHGCRecHitProxyBuilder.cc.

const FWHGCRecHitProxyBuilder& FWHGCRecHitProxyBuilder::operator= ( const FWHGCRecHitProxyBuilder )
privatedelete
const std::string& FWHGCRecHitProxyBuilder::purpose ( ) const
inline
void FWHGCRecHitProxyBuilder::setItem ( const FWEventItem iItem)
overrideprivatevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 31 of file FWHGCRecHitProxyBuilder.cc.

References FWProxyBuilderConfiguration::assertParam(), FWEventItem::getConfig(), FWProxyBuilderConfiguration::keepEntries(), dttmaxenums::L, and FWProxyBuilderBase::setItem().

Referenced by Vispa.Plugins.EdmBrowser.EventContentView.EventContentView::_addRow(), Vispa.Views.TableView.TableView::_createItem(), Vispa.Views.PropertyView.PropertyView::addCategory(), and Vispa.Views.PropertyView.PropertyView::append().

32 {
34  if (iItem)
35  {
36  iItem->getConfig()->keepEntries(true);
37  iItem->getConfig()->assertParam("Layer", 0L, 0L, 52L);
38  iItem->getConfig()->assertParam("EnergyCutOff", 0.5, 0.2, 5.0);
39  iItem->getConfig()->assertParam("Heatmap", true);
40  iItem->getConfig()->assertParam("Z+", true);
41  iItem->getConfig()->assertParam("Z-", true);
42  }
43 }
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:169
virtual void setItem(const FWEventItem *iItem)
FWGenericParameter< T > * assertParam(const std::string &name, T def)
const std::string& FWHGCRecHitProxyBuilder::typeName ( ) const
inline
const std::string& FWHGCRecHitProxyBuilder::view ( ) const
inline

Member Data Documentation

float FWHGCRecHitProxyBuilder::gradient[3][gradient_steps]
staticprivate
Initial value:
= {
{0.2082*255, 0.0592*255, 0.0780*255, 0.0232*255, 0.1802*255, 0.5301*255, 0.8186*255, 0.9956*255, 0.9764*255},
{0.1664*255, 0.3599*255, 0.5041*255, 0.6419*255, 0.7178*255, 0.7492*255, 0.7328*255, 0.7862*255, 0.9832*255},
{0.5293*255, 0.8684*255, 0.8385*255, 0.7914*255, 0.6425*255, 0.4662*255, 0.3499*255, 0.1968*255, 0.0539*255}
}

Definition at line 21 of file FWHGCRecHitProxyBuilder.cc.

Referenced by build().

uint8_t FWHGCRecHitProxyBuilder::gradient_steps = 9
staticprivate

Definition at line 20 of file FWHGCRecHitProxyBuilder.cc.

Referenced by build().