CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions
FWHGCalTriggerCellProxyBuilder Class Reference
Inheritance diagram for FWHGCalTriggerCellProxyBuilder:
FWL1THGCalProxyTemplate< l1t::HGCalTriggerCell > FWSimpleProxyBuilderTemplate< l1t::HGCalTriggerCell > FWSimpleProxyBuilder FWProxyBuilderBase

Public Member Functions

 FWHGCalTriggerCellProxyBuilder (void)
 
 FWHGCalTriggerCellProxyBuilder (const FWHGCalTriggerCellProxyBuilder &)=delete
 
const
FWHGCalTriggerCellProxyBuilder
operator= (const FWHGCalTriggerCellProxyBuilder &)=delete
 
const std::string & purpose () const
 
const std::string & typeName () const
 
const std::string & view () const
 
 ~FWHGCalTriggerCellProxyBuilder (void) override
 
- Public Member Functions inherited from FWSimpleProxyBuilderTemplate< l1t::HGCalTriggerCell >
 FWSimpleProxyBuilderTemplate ()
 
 FWSimpleProxyBuilderTemplate (const FWSimpleProxyBuilderTemplate &)=delete
 
const
FWSimpleProxyBuilderTemplate
operator= (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::HGCalTriggerCell &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::HGCalTriggerCell >
std::unordered_set< unsigned > getCellsFromTriggerCell (const unsigned trigger_cell_id) const
 
void setItem (const FWEventItem *iItem) override
 
- Protected Member Functions inherited from FWSimpleProxyBuilderTemplate< l1t::HGCalTriggerCell >
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 l1t::HGCalTriggerCell &iData, unsigned int iIndex, TEveElement &oItemHolder, FWViewType::EType viewType, const FWViewContext *)
 
const l1t::HGCalTriggerCellmodelData (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 15 of file FWHGCalTriggerCellProxyBuilder.cc.

Constructor & Destructor Documentation

FWHGCalTriggerCellProxyBuilder::FWHGCalTriggerCellProxyBuilder ( void  )
inline

Definition at line 17 of file FWHGCalTriggerCellProxyBuilder.cc.

17 {}
FWHGCalTriggerCellProxyBuilder::~FWHGCalTriggerCellProxyBuilder ( void  )
inlineoverride

Definition at line 18 of file FWHGCalTriggerCellProxyBuilder.cc.

18 {}
FWHGCalTriggerCellProxyBuilder::FWHGCalTriggerCellProxyBuilder ( const FWHGCalTriggerCellProxyBuilder )
delete

Member Function Documentation

void FWHGCalTriggerCellProxyBuilder::build ( const l1t::HGCalTriggerCell 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::HGCalTriggerCell >.

Definition at line 32 of file FWHGCalTriggerCellProxyBuilder.cc.

References cells, l1t::HGCalTriggerCell::detId(), relval_parameters_module::energy, reco::LeafCandidate::energy(), FWL1THGCalProxyTemplate< l1t::HGCalTriggerCell >::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(), and z.

35  {
36  const long layer = item()->getConfig()->value<long>("Layer");
37  const double saturation_energy = item()->getConfig()->value<double>("EnergyCutOff");
38  const bool heatmap = item()->getConfig()->value<bool>("Heatmap");
39 
40  const bool z_plus = item()->getConfig()->value<bool>("Z+");
41  const bool z_minus = item()->getConfig()->value<bool>("Z-");
42 
43  bool h_hex(false);
44  TEveBoxSet *hex_boxset = new TEveBoxSet();
45  if (!heatmap)
46  hex_boxset->UseSingleColor();
47  hex_boxset->SetPickable(true);
48  hex_boxset->Reset(TEveBoxSet::kBT_Hex, true, 64);
49  hex_boxset->SetAntiFlick(true);
50 
51  bool h_box(false);
52  TEveBoxSet *boxset = new TEveBoxSet();
53  if (!heatmap)
54  boxset->UseSingleColor();
55  boxset->SetPickable(true);
56  boxset->Reset(TEveBoxSet::kBT_FreeBox, true, 64);
57  boxset->SetAntiFlick(true);
58 
59  const float energy = fmin(10 * iData.energy() / saturation_energy, 1.0);
60 
61  std::unordered_set<unsigned> cells = getCellsFromTriggerCell(iData.detId());
62 
63  for (std::unordered_set<unsigned>::const_iterator it = cells.begin(), itEnd = cells.end(); it != itEnd; ++it) {
64  const bool z = (*it >> 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);
71  const float *parameters = item()->getGeom()->getParameters(*it);
72  const float *shapes = item()->getGeom()->getShapePars(*it);
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 >> 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 >> (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  boxset->DigitColor(energy * 255, 0, 255 - energy * 255);
115 
116  h_box = true;
117  }
118  // Silicon
119  else {
120  const int offset = 9;
121 
122  float centerX = (corners[6] + corners[6 + offset]) / 2;
123  float centerY = (corners[7] + corners[7 + offset]) / 2;
124  float radius = fabs(corners[6] - corners[6 + offset]) / 2;
125  hex_boxset->AddHex(TEveVector(centerX, centerY, corners[2]), radius, 90.0, shapes[3]);
126  hex_boxset->DigitColor(energy * 255, 0, 255 - energy * 255);
127 
128  h_hex = true;
129  }
130  }
131 
132  if (h_hex) {
133  hex_boxset->RefitPlex();
134 
135  hex_boxset->CSCTakeAnyParentAsMaster();
136  if (!heatmap) {
137  hex_boxset->CSCApplyMainColorToMatchingChildren();
138  hex_boxset->CSCApplyMainTransparencyToMatchingChildren();
139  hex_boxset->SetMainColor(item()->modelInfo(iIndex).displayProperties().color());
140  hex_boxset->SetMainTransparency(item()->defaultDisplayProperties().transparency());
141  }
142  oItemHolder.AddElement(hex_boxset);
143  }
144 
145  if (h_box) {
146  boxset->RefitPlex();
147 
148  boxset->CSCTakeAnyParentAsMaster();
149  if (!heatmap) {
150  boxset->CSCApplyMainColorToMatchingChildren();
151  boxset->CSCApplyMainTransparencyToMatchingChildren();
152  boxset->SetMainColor(item()->modelInfo(iIndex).displayProperties().color());
153  boxset->SetMainTransparency(item()->defaultDisplayProperties().transparency());
154  }
155  oItemHolder.AddElement(boxset);
156  }
157 }
std::unordered_set< unsigned > getCellsFromTriggerCell(const unsigned trigger_cell_id) const
FWProxyBuilderConfiguration * getConfig() const
Definition: FWEventItem.h:150
const float * getParameters(unsigned int id) const
Definition: FWGeometry.cc:472
const FWEventItem * item() const
const float * getShapePars(unsigned int id) const
Definition: FWGeometry.cc:483
uint32_t detId() const
caConstants::TupleMultiplicity const CAHitNtupletGeneratorKernelsGPU::HitToTuple const cms::cuda::AtomicPairCounter GPUCACell const *__restrict__ cells
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:461
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
double energy() const final
energy
const std::string & FWHGCalTriggerCellProxyBuilder::classPurpose ( )
static

Definition at line 162 of file FWHGCalTriggerCellProxyBuilder.cc.

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

Definition at line 162 of file FWHGCalTriggerCellProxyBuilder.cc.

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

Definition at line 162 of file FWHGCalTriggerCellProxyBuilder.cc.

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

Definition at line 162 of file FWHGCalTriggerCellProxyBuilder.cc.

const FWHGCalTriggerCellProxyBuilder& FWHGCalTriggerCellProxyBuilder::operator= ( const FWHGCalTriggerCellProxyBuilder )
delete
const std::string& FWHGCalTriggerCellProxyBuilder::purpose ( ) const
inline
const std::string& FWHGCalTriggerCellProxyBuilder::typeName ( ) const
inline
const std::string& FWHGCalTriggerCellProxyBuilder::view ( ) const
inline