CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
FWHGCalMultiClusterProxyBuilder Class Reference
Inheritance diagram for FWHGCalMultiClusterProxyBuilder:
FWHeatmapProxyBuilderTemplate< reco::HGCalMultiCluster > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWHGCalMultiClusterProxyBuilder (void)
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWHGCalMultiClusterProxyBuilder (void) override
 
- Public Member Functions inherited from FWHeatmapProxyBuilderTemplate< reco::HGCalMultiCluster >
 FWHeatmapProxyBuilderTemplate ()
 
- 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 reco::HGCalMultiCluster &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *) override
 
 FWHGCalMultiClusterProxyBuilder (const FWHGCalMultiClusterProxyBuilder &)=delete
 
const FWHGCalMultiClusterProxyBuilderoperator= (const FWHGCalMultiClusterProxyBuilder &)=delete
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWHeatmapProxyBuilderTemplate< reco::HGCalMultiCluster >
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *) override
 
void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *vc) override
 
virtual void build (const void *, unsigned int iIndex, TEveElement &iItemHolder, const FWViewContext *)=0
 
void build (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *context) override
 
void buildViewType (const FWEventItem *iItem, TEveElementList *product, FWViewType::EType viewType, const FWViewContext *) override
 
virtual void buildViewType (const reco::HGCalMultiCluster &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
virtual void buildViewType (const void *, unsigned int iIndex, TEveElement &iItemHolder, FWViewType::EType, const FWViewContext *)=0
 
void buildViewType (const void *iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *context) override
 
const reco::HGCalMultiClustermodelData (int index)
 
void setItem (const FWEventItem *iItem) override
 
- Protected Member Functions inherited from FWSimpleProxyBuilder
void build ()
 
virtual void build (const FWEventItem *iItem, TEveElementList *product, const FWViewContext *)
 
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 FWHeatmapProxyBuilderTemplate< reco::HGCalMultiCluster >
std::map< DetId, const HGCRecHit * > hitmap
 
- Protected Attributes inherited from FWSimpleProxyBuilder
FWSimpleProxyHelper m_helper
 
- Protected Attributes inherited from FWProxyBuilderBase
std::vector< Product * > m_products
 
- Static Protected Attributes inherited from FWHeatmapProxyBuilderTemplate< reco::HGCalMultiCluster >
static constexpr uint8_t gradient [3][gradient_steps]
 
static constexpr uint8_t gradient_steps
 

Detailed Description

Definition at line 10 of file FWHGCalMultiClusterProxyBuilder.cc.

Constructor & Destructor Documentation

◆ FWHGCalMultiClusterProxyBuilder() [1/2]

FWHGCalMultiClusterProxyBuilder::FWHGCalMultiClusterProxyBuilder ( void  )
inline

Definition at line 12 of file FWHGCalMultiClusterProxyBuilder.cc.

12 {}

◆ ~FWHGCalMultiClusterProxyBuilder()

FWHGCalMultiClusterProxyBuilder::~FWHGCalMultiClusterProxyBuilder ( void  )
inlineoverride

Definition at line 13 of file FWHGCalMultiClusterProxyBuilder.cc.

13 {}

◆ FWHGCalMultiClusterProxyBuilder() [2/2]

FWHGCalMultiClusterProxyBuilder::FWHGCalMultiClusterProxyBuilder ( const FWHGCalMultiClusterProxyBuilder )
privatedelete

Member Function Documentation

◆ build()

void FWHGCalMultiClusterProxyBuilder::build ( const reco::HGCalMultiCluster 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 FWHeatmapProxyBuilderTemplate< reco::HGCalMultiCluster >.

Definition at line 27 of file FWHGCalMultiClusterProxyBuilder.cc.

30  {
31  const long layer = item()->getConfig()->value<long>("Layer");
32  const double saturation_energy = item()->getConfig()->value<double>("EnergyCutOff");
33  const bool heatmap = item()->getConfig()->value<bool>("Heatmap");
34  const bool z_plus = item()->getConfig()->value<bool>("Z+");
35  const bool z_minus = item()->getConfig()->value<bool>("Z-");
36 
37  const auto &clusters = iData.clusters();
38 
39  bool h_hex(false);
40  TEveBoxSet *hex_boxset = new TEveBoxSet("Silicon");
41  if (!heatmap)
42  hex_boxset->UseSingleColor();
43  hex_boxset->SetPickable(true);
44  hex_boxset->Reset(TEveBoxSet::kBT_Hex, true, 64);
45  hex_boxset->SetAntiFlick(kTRUE);
46 
47  bool h_box(false);
48  TEveBoxSet *boxset = new TEveBoxSet("Scintillator");
49  if (!heatmap)
50  boxset->UseSingleColor();
51  boxset->SetPickable(true);
52  boxset->Reset(TEveBoxSet::kBT_FreeBox, true, 64);
53  boxset->SetAntiFlick(kTRUE);
54 
55  for (const auto &c : clusters) {
56  std::vector<std::pair<DetId, float>> clusterDetIds = c->hitsAndFractions();
57 
58  for (std::vector<std::pair<DetId, float>>::iterator it = clusterDetIds.begin(), itEnd = clusterDetIds.end();
59  it != itEnd;
60  ++it) {
61  if (heatmap && hitmap.find(it->first) == hitmap.end())
62  continue;
63 
64  const bool z = (it->first >> 25) & 0x1;
65 
66  // discard everything thats not at the side that we are intersted in
67  if (((z_plus & z_minus) != 1) && (((z_plus | z_minus) == 0) || !(z == z_minus || z == !z_plus)))
68  continue;
69 
70  const float *corners = item()->getGeom()->getCorners(it->first);
71  const float *parameters = item()->getGeom()->getParameters(it->first);
72  const float *shapes = item()->getGeom()->getShapePars(it->first);
73 
74  if (corners == nullptr || parameters == nullptr || shapes == nullptr) {
75  continue;
76  }
77 
78  const int total_points = parameters[0];
79  const bool isScintillator = (total_points == 4);
80  const uint8_t type = ((it->first >> 28) & 0xF);
81 
82  uint8_t ll = layer;
83  if (layer > 0) {
84  if (layer > 28) {
85  if (type == 8) {
86  continue;
87  }
88  ll -= 28;
89  } else {
90  if (type != 8) {
91  continue;
92  }
93  }
94 
95  if (ll != ((it->first >> (isScintillator ? 17 : 20)) & 0x1F))
96  continue;
97  }
98 
99  // Scintillator
100  if (isScintillator) {
101  const int total_vertices = 3 * total_points;
102 
103  std::vector<float> pnts(24);
104  for (int i = 0; i < total_points; ++i) {
105  pnts[i * 3 + 0] = corners[i * 3];
106  pnts[i * 3 + 1] = corners[i * 3 + 1];
107  pnts[i * 3 + 2] = corners[i * 3 + 2];
108 
109  pnts[(i * 3 + 0) + total_vertices] = corners[i * 3];
110  pnts[(i * 3 + 1) + total_vertices] = corners[i * 3 + 1];
111  pnts[(i * 3 + 2) + total_vertices] = corners[i * 3 + 2] + shapes[3];
112  }
113  boxset->AddBox(&pnts[0]);
114  if (heatmap) {
115  const uint8_t colorFactor = gradient_steps * (fmin(hitmap[it->first]->energy() / saturation_energy, 1.0f));
116  boxset->DigitColor(gradient[0][colorFactor], gradient[1][colorFactor], gradient[2][colorFactor]);
117  }
118 
119  h_box = true;
120  }
121  // Silicon
122  else {
123  const int offset = 9;
124 
125  float centerX = (corners[6] + corners[6 + offset]) / 2;
126  float centerY = (corners[7] + corners[7 + offset]) / 2;
127  float radius = fabs(corners[6] - corners[6 + offset]) / 2;
128  hex_boxset->AddHex(TEveVector(centerX, centerY, corners[2]), radius, 90.0, shapes[3]);
129  if (heatmap) {
130  const uint8_t colorFactor = gradient_steps * (fmin(hitmap[it->first]->energy() / saturation_energy, 1.0f));
131  hex_boxset->DigitColor(gradient[0][colorFactor], gradient[1][colorFactor], gradient[2][colorFactor]);
132  }
133 
134  h_hex = true;
135  }
136  }
137  }
138 
139  if (h_hex) {
140  hex_boxset->RefitPlex();
141 
142  hex_boxset->CSCTakeAnyParentAsMaster();
143  if (!heatmap) {
144  hex_boxset->CSCApplyMainColorToMatchingChildren();
145  hex_boxset->CSCApplyMainTransparencyToMatchingChildren();
146  hex_boxset->SetMainColor(item()->modelInfo(iIndex).displayProperties().color());
147  hex_boxset->SetMainTransparency(item()->defaultDisplayProperties().transparency());
148  }
149  oItemHolder.AddElement(hex_boxset);
150  }
151 
152  if (h_box) {
153  boxset->RefitPlex();
154 
155  boxset->CSCTakeAnyParentAsMaster();
156  if (!heatmap) {
157  boxset->CSCApplyMainColorToMatchingChildren();
158  boxset->CSCApplyMainTransparencyToMatchingChildren();
159  boxset->SetMainColor(item()->modelInfo(iIndex).displayProperties().color());
160  boxset->SetMainTransparency(item()->defaultDisplayProperties().transparency());
161  }
162  oItemHolder.AddElement(boxset);
163  }
164 }

References HltBtagPostValidation_cff::c, reco::HGCalMultiCluster::clusters(), bsc_activity_cfg::clusters, FWEventItem::getConfig(), FWGeometry::getCorners(), FWEventItem::getGeom(), FWGeometry::getParameters(), FWGeometry::getShapePars(), FWHeatmapProxyBuilderTemplate< reco::HGCalMultiCluster >::gradient, FWHeatmapProxyBuilderTemplate< reco::HGCalMultiCluster >::gradient_steps, FWHeatmapProxyBuilderTemplate< reco::HGCalMultiCluster >::hitmap, mps_fire::i, FWProxyBuilderBase::item(), FWProxyBuilderBase::layer(), hltrates_dqm_sourceclient-live_cfg::offset, CosmicsPD_Skims::radius, FWProxyBuilderConfiguration::value(), testProducerWithPsetDescEmpty_cfi::x1, and z.

◆ classPurpose()

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

Definition at line 169 of file FWHGCalMultiClusterProxyBuilder.cc.

◆ classRegisterTypeName()

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

Definition at line 169 of file FWHGCalMultiClusterProxyBuilder.cc.

◆ classTypeName()

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

Definition at line 169 of file FWHGCalMultiClusterProxyBuilder.cc.

◆ classView()

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

Definition at line 169 of file FWHGCalMultiClusterProxyBuilder.cc.

◆ operator=()

const FWHGCalMultiClusterProxyBuilder& FWHGCalMultiClusterProxyBuilder::operator= ( const FWHGCalMultiClusterProxyBuilder )
privatedelete

◆ purpose()

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

Definition at line 15 of file FWHGCalMultiClusterProxyBuilder.cc.

17 :
18  FWHGCalMultiClusterProxyBuilder(const FWHGCalMultiClusterProxyBuilder &) = delete; // stop default

◆ typeName()

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

Definition at line 15 of file FWHGCalMultiClusterProxyBuilder.cc.

17 :
18  FWHGCalMultiClusterProxyBuilder(const FWHGCalMultiClusterProxyBuilder &) = delete; // stop default

◆ view()

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

Definition at line 15 of file FWHGCalMultiClusterProxyBuilder.cc.

17 :
18  FWHGCalMultiClusterProxyBuilder(const FWHGCalMultiClusterProxyBuilder &) = delete; // stop default
reco::HGCalMultiCluster::clusters
const edm::PtrVector< reco::BasicCluster > & clusters() const
Definition: HGCalMultiCluster.h:23
mps_fire.i
i
Definition: mps_fire.py:355
FWGeometry::getCorners
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:464
FWEventItem::getConfig
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:150
FWHeatmapProxyBuilderTemplate< reco::HGCalMultiCluster >::gradient_steps
static constexpr uint8_t gradient_steps
Definition: FWHeatmapProxyBuilderTemplate.h:49
FWHeatmapProxyBuilderTemplate< reco::HGCalMultiCluster >::hitmap
std::map< DetId, const HGCRecHit * > hitmap
Definition: FWHeatmapProxyBuilderTemplate.h:47
FWHGCalMultiClusterProxyBuilder::FWHGCalMultiClusterProxyBuilder
FWHGCalMultiClusterProxyBuilder(void)
Definition: FWHGCalMultiClusterProxyBuilder.cc:12
FWGeometry::getShapePars
const float * getShapePars(unsigned int id) const
Definition: FWGeometry.cc:486
FWHGCalMultiClusterProxyBuilder
Definition: FWHGCalMultiClusterProxyBuilder.cc:10
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
FWGeometry::getParameters
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:475
FWProxyBuilderBase::layer
int layer() const
Definition: FWProxyBuilderBase.cc:414
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
DDAxes::z
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
FWHeatmapProxyBuilderTemplate< reco::HGCalMultiCluster >::gradient
static constexpr uint8_t gradient[3][gradient_steps]
Definition: FWHeatmapProxyBuilderTemplate.h:50
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
FWEventItem::getGeom
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition: FWProxyBuilderBase.h:64
type
type
Definition: HCALResponse.h:21
FWProxyBuilderConfiguration::value
T value(const std::string &name)
Definition: FWProxyBuilderConfiguration.cc:123
CosmicsPD_Skims.radius
radius
Definition: CosmicsPD_Skims.py:135
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:78