CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
FWHGCalTriggerClusterProxyBuilder Class Reference
Inheritance diagram for FWHGCalTriggerClusterProxyBuilder:
FWL1THGCalProxyTemplate< l1t::HGCalMulticluster > FWSimpleProxyBuilderTemplate< l1t::HGCalMulticluster > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWHGCalTriggerClusterProxyBuilder (void)
 
 FWHGCalTriggerClusterProxyBuilder (const FWHGCalTriggerClusterProxyBuilder &)=delete
 
const FWHGCalTriggerClusterProxyBuilderoperator= (const FWHGCalTriggerClusterProxyBuilder &)=delete
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWHGCalTriggerClusterProxyBuilder (void) override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< l1t::HGCalMulticluster >
 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 l1t::HGCalMulticluster &iData, unsigned int iIndex, TEveElement &oItemHolder, const FWViewContext *) override
 

Additional Inherited Members

- Protected Types inherited from FWProxyBuilderBase
typedef std::vector< Product * >::iterator Product_it
 
- Protected Member Functions inherited from FWL1THGCalProxyTemplate< l1t::HGCalMulticluster >
std::unordered_set< unsigned > getCellsFromTriggerCell (const unsigned trigger_cell_id) const
 
void setItem (const FWEventItem *iItem) override
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< l1t::HGCalMulticluster >
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 l1t::HGCalMulticluster &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
const l1t::HGCalMulticlustermodelData (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 18 of file FWHGCalTriggerClusterProxyBuilder.cc.

Constructor & Destructor Documentation

◆ FWHGCalTriggerClusterProxyBuilder() [1/2]

FWHGCalTriggerClusterProxyBuilder::FWHGCalTriggerClusterProxyBuilder ( void  )
inline

Definition at line 20 of file FWHGCalTriggerClusterProxyBuilder.cc.

20 {}

◆ ~FWHGCalTriggerClusterProxyBuilder()

FWHGCalTriggerClusterProxyBuilder::~FWHGCalTriggerClusterProxyBuilder ( void  )
inlineoverride

Definition at line 21 of file FWHGCalTriggerClusterProxyBuilder.cc.

21 {}

◆ FWHGCalTriggerClusterProxyBuilder() [2/2]

FWHGCalTriggerClusterProxyBuilder::FWHGCalTriggerClusterProxyBuilder ( const FWHGCalTriggerClusterProxyBuilder )
delete

Member Function Documentation

◆ build()

void FWHGCalTriggerClusterProxyBuilder::build ( const l1t::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 FWSimpleProxyBuilderTemplate< l1t::HGCalMulticluster >.

Definition at line 36 of file FWHGCalTriggerClusterProxyBuilder.cc.

References hgcalTBTopologyTester_cfi::cells, l1t::HGCalClusterT< C >::constituents(), HCALHighEnergyHPDFilter_cfi::energy, reco::LeafCandidate::energy(), FWL1THGCalProxyTemplate< l1t::HGCalMulticluster >::getCellsFromTriggerCell(), FWEventItem::getConfig(), FWGeometry::getCorners(), FWEventItem::getGeom(), FWGeometry::getParameters(), FWGeometry::getShapePars(), mps_fire::i, FWProxyBuilderBase::item(), FWProxyBuilderBase::layer(), hltrates_dqm_sourceclient-live_cfg::offset, CosmicsPD_Skims::radius, FWProxyBuilderConfiguration::value(), testProducerWithPsetDescEmpty_cfi::x1, and z.

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

◆ classPurpose()

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

Definition at line 168 of file FWHGCalTriggerClusterProxyBuilder.cc.

◆ classRegisterTypeName()

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

Definition at line 168 of file FWHGCalTriggerClusterProxyBuilder.cc.

◆ classTypeName()

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

Definition at line 168 of file FWHGCalTriggerClusterProxyBuilder.cc.

◆ classView()

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

Definition at line 168 of file FWHGCalTriggerClusterProxyBuilder.cc.

◆ operator=()

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

◆ purpose()

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

◆ typeName()

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

◆ view()

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