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 *vc) override
 
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 reco::HGCalMultiCluster &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
const reco::HGCalMultiClustermodelData (int index)
 
void setItem (const FWEventItem *iItem) override
 
- Protected Member Functions inherited from FWSimpleProxyBuilder
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 uint8_t gradient [3][gradient_steps]
 
static uint8_t gradient_steps
 

Detailed Description

Definition at line 10 of file FWHGCalMultiClusterProxyBuilder.cc.

Constructor & Destructor Documentation

FWHGCalMultiClusterProxyBuilder::FWHGCalMultiClusterProxyBuilder ( void  )
inline

Definition at line 13 of file FWHGCalMultiClusterProxyBuilder.cc.

13 {}
FWHGCalMultiClusterProxyBuilder::~FWHGCalMultiClusterProxyBuilder ( void  )
inlineoverride

Definition at line 14 of file FWHGCalMultiClusterProxyBuilder.cc.

14 {}
FWHGCalMultiClusterProxyBuilder::FWHGCalMultiClusterProxyBuilder ( const FWHGCalMultiClusterProxyBuilder )
privatedelete

Member Function Documentation

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 26 of file FWHGCalMultiClusterProxyBuilder.cc.

References EnergyCorrector::c, fastPrimaryVertexProducer_cfi::clusters, reco::HGCalMultiCluster::clusters(), create_public_lumi_plots::color, 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(), PFRecoTauDiscriminationByIsolation_cfi::offset, TCMET_cfi::radius, FWProxyBuilderConfiguration::value(), globals_cff::x1, and z.

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

Definition at line 181 of file FWHGCalMultiClusterProxyBuilder.cc.

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

Definition at line 181 of file FWHGCalMultiClusterProxyBuilder.cc.

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

Definition at line 181 of file FWHGCalMultiClusterProxyBuilder.cc.

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

Definition at line 181 of file FWHGCalMultiClusterProxyBuilder.cc.

const FWHGCalMultiClusterProxyBuilder& FWHGCalMultiClusterProxyBuilder::operator= ( const FWHGCalMultiClusterProxyBuilder )
privatedelete
const std::string& FWHGCalMultiClusterProxyBuilder::purpose ( ) const
inline
const std::string& FWHGCalMultiClusterProxyBuilder::typeName ( ) const
inline
const std::string& FWHGCalMultiClusterProxyBuilder::view ( ) const
inline