CMS 3D CMS Logo

FWPCaloHitProxyBuilder.cc
Go to the documentation of this file.
1 /*
2  * FWPCaloHitProxyBuilder.cc
3  * FWorks
4  *
5  * Created by Ianna Osborne on 9/9/10.
6  *
7  */
8 
16 
18 public:
20  ~FWPCaloHitProxyBuilder(void) override {}
21 
23 
24 private:
27 
29  void build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*) override;
30 };
31 
32 void FWPCaloHitProxyBuilder::build(const FWEventItem* iItem, TEveElementList* product, const FWViewContext*) {
33  const edm::PCaloHitContainer* collection = nullptr;
34  iItem->get(collection);
35  if (!collection)
36  return;
37 
38  TEveBoxSet* boxSet = addBoxSetToProduct(product);
39  int index = 0;
40  for (std::vector<PCaloHit>::const_iterator it = collection->begin(); it != collection->end(); ++it) {
41  const float* corners = item()->getGeom()->getCorners((*it).id());
42 
43  std::vector<float> scaledCorners(24);
44  if (corners)
45  fireworks::energyTower3DCorners(corners, (*it).energy() * 10, scaledCorners);
46 
47  addBox(boxSet, &scaledCorners[0], iItem->modelInfo(index++).displayProperties());
48  }
49 }
50 
51 // !AMT TEveBoxSet is not projectable. Can't be added to RPZ views empty.
54  "PCaloHits",
FWEventItem::modelInfo
ModelInfo modelInfo(int iIndex) const
Definition: FWEventItem.cc:446
FWDigitSetProxyBuilder::addBoxSetToProduct
TEveBoxSet * addBoxSetToProduct(TEveElementList *product)
Definition: FWDigitSetProxyBuilder.cc:73
FWGeometry::getCorners
const float * getCorners(unsigned int id) const
Definition: FWGeometry.cc:467
FWDigitSetProxyBuilder
Definition: FWDigitSetProxyBuilder.h:31
FWViewType::kAllRPZBits
static const int kAllRPZBits
Definition: FWViewType.h:67
REGISTER_FWPROXYBUILDER
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
Definition: FWProxyBuilderFactory.h:33
FWEventItem::get
void get(const T *&oData) const
Definition: FWEventItem.h:78
FWPCaloHitProxyBuilder
Definition: FWPCaloHitProxyBuilder.cc:17
REGISTER_PROXYBUILDER_METHODS
#define REGISTER_PROXYBUILDER_METHODS()
Definition: register_dataproxybuilder_macro.h:27
BuilderUtils.h
FWDigitSetProxyBuilder::addBox
void addBox(TEveBoxSet *set, const float *pnts, const FWDisplayProperties &dp)
Definition: FWDigitSetProxyBuilder.cc:94
FWPCaloHitProxyBuilder::operator=
const FWPCaloHitProxyBuilder & operator=(const FWPCaloHitProxyBuilder &)=delete
FWViewType::kAll3DBits
static const int kAll3DBits
Definition: FWViewType.h:68
FWPCaloHitProxyBuilder::FWPCaloHitProxyBuilder
FWPCaloHitProxyBuilder(void)
Definition: FWPCaloHitProxyBuilder.cc:19
fireworks::energyTower3DCorners
void energyTower3DCorners(const float *corners, float scale, std::vector< float > &, bool reflect=false)
Definition: BuilderUtils.cc:287
FWDigitSetProxyBuilder.h
EcalSubdetector.h
FWGeometry.h
PCaloHit.h
universalConfigTemplate.collection
collection
Definition: universalConfigTemplate.py:81
FWProxyBuilderBase::build
void build()
Definition: FWProxyBuilderBase.cc:110
FWEventItem.h
FWEventItem::ModelInfo::displayProperties
const FWDisplayProperties & displayProperties() const
Definition: FWEventItem.h:64
FWViewContext
Definition: FWViewContext.h:32
FWEventItem::getGeom
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:548
FWProxyBuilderBase::item
const FWEventItem * item() const
Definition: FWProxyBuilderBase.h:64
FWEventItem
Definition: FWEventItem.h:56
FWPCaloHitProxyBuilder::~FWPCaloHitProxyBuilder
~FWPCaloHitProxyBuilder(void) override
Definition: FWPCaloHitProxyBuilder.cc:20
edm::PCaloHitContainer
std::vector< PCaloHit > PCaloHitContainer
Definition: PCaloHitContainer.h:8
PCaloHitContainer.h
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46