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 ()
 
 FWHGCRecHitProxyBuilder (const FWHGCRecHitProxyBuilder &)=delete
 
const FWHGCRecHitProxyBuilderoperator= (const FWHGCRecHitProxyBuilder &)=delete
 
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 ()
 
 FWSimpleProxyBuilderTemplate (const FWSimpleProxyBuilderTemplate &)=delete
 
const FWSimpleProxyBuilderTemplateoperator= (const FWSimpleProxyBuilderTemplate &)=delete
 
- Public Member Functions inherited from FWSimpleProxyBuilder
 FWSimpleProxyBuilder (const std::type_info &iType)
 
 FWSimpleProxyBuilder (const FWSimpleProxyBuilder &)=delete
 
const FWSimpleProxyBuilderoperator= (const FWSimpleProxyBuilder &)=delete
 
 ~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
 
void setItem (const FWEventItem *iItem) override
 

Static Private Attributes

static constexpr float gradient [3][gradient_steps]
 
static constexpr 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 FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void build (const void *, unsigned int iIndex, TEveElement &iItemHolder, const FWViewContext *)=0
 
void build ()
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
 
virtual void buildViewType (const void *, unsigned int iIndex, TEveElement &iItemHolder, FWViewType::EType, const FWViewContext *)=0
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) 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 ()
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
virtual void buildViewType (const FWEventItem *iItem, TEveElementList *, FWViewType::EType, const FWViewContext *)
 
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() [1/2]

FWHGCRecHitProxyBuilder::FWHGCRecHitProxyBuilder ( )
inline

Definition at line 11 of file FWHGCRecHitProxyBuilder.cc.

11 {}

◆ ~FWHGCRecHitProxyBuilder()

FWHGCRecHitProxyBuilder::~FWHGCRecHitProxyBuilder ( void  )
inlineoverride

Definition at line 12 of file FWHGCRecHitProxyBuilder.cc.

12 {}

◆ FWHGCRecHitProxyBuilder() [2/2]

FWHGCRecHitProxyBuilder::FWHGCRecHitProxyBuilder ( const FWHGCRecHitProxyBuilder )
delete

Member Function Documentation

◆ build()

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 65 of file FWHGCRecHitProxyBuilder.cc.

References CaloRecHit::energy(), FWEventItem::getConfig(), FWGeometry::getCorners(), FWEventItem::getGeom(), FWGeometry::getParameters(), FWGeometry::getShapePars(), gradient, gradient_steps, mps_fire::i, HGCRecHit::id(), FWProxyBuilderBase::item(), FWProxyBuilderBase::layer(), hltrates_dqm_sourceclient-live_cfg::offset, CosmicsPD_Skims::radius, FWProxyBuilderConfiguration::value(), testProducerWithPsetDescEmpty_cfi::x1, and z.

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

◆ classPurpose()

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

Definition at line 162 of file FWHGCRecHitProxyBuilder.cc.

◆ classRegisterTypeName()

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

Definition at line 162 of file FWHGCRecHitProxyBuilder.cc.

◆ classTypeName()

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

Definition at line 162 of file FWHGCRecHitProxyBuilder.cc.

◆ classView()

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

Definition at line 162 of file FWHGCRecHitProxyBuilder.cc.

◆ operator=()

const FWHGCRecHitProxyBuilder& FWHGCRecHitProxyBuilder::operator= ( const FWHGCRecHitProxyBuilder )
delete

◆ purpose()

const std::string& FWHGCRecHitProxyBuilder::purpose ( ) const
inline

Definition at line 14 of file FWHGCRecHitProxyBuilder.cc.

19 :
20  static constexpr uint8_t gradient_steps = 9;
static constexpr uint8_t gradient_steps

◆ setItem()

void FWHGCRecHitProxyBuilder::setItem ( const FWEventItem iItem)
overrideprivatevirtual

Reimplemented from FWProxyBuilderBase.

Definition at line 53 of file FWHGCRecHitProxyBuilder.cc.

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

53  {
55  if (iItem) {
56  iItem->getConfig()->keepEntries(true);
57  iItem->getConfig()->assertParam("Layer", 0L, 0L, 52L);
58  iItem->getConfig()->assertParam("EnergyCutOff", 0.5, 0.2, 5.0);
59  iItem->getConfig()->assertParam("Heatmap", true);
60  iItem->getConfig()->assertParam("Z+", true);
61  iItem->getConfig()->assertParam("Z-", true);
62  }
63 }
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:150
virtual void setItem(const FWEventItem *iItem)
FWGenericParameter< T > * assertParam(const std::string &name, T def)

◆ typeName()

const std::string& FWHGCRecHitProxyBuilder::typeName ( ) const
inline

Definition at line 14 of file FWHGCRecHitProxyBuilder.cc.

19 :
20  static constexpr uint8_t gradient_steps = 9;
static constexpr uint8_t gradient_steps

◆ view()

const std::string& FWHGCRecHitProxyBuilder::view ( ) const
inline

Definition at line 14 of file FWHGCRecHitProxyBuilder.cc.

19 :
20  static constexpr uint8_t gradient_steps = 9;
static constexpr uint8_t gradient_steps

Member Data Documentation

◆ gradient

constexpr 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().

◆ gradient_steps

constexpr uint8_t FWHGCRecHitProxyBuilder::gradient_steps = 9
staticprivate

Definition at line 20 of file FWHGCRecHitProxyBuilder.cc.

Referenced by build().