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
81 std::vector<std::pair<DetId, float>> clusterDetIds = iData.
hitsAndFractions();
84 TEveBoxSet *hex_boxset =
new TEveBoxSet();
86 hex_boxset->UseSingleColor();
87 hex_boxset->SetPickable(
true);
88 hex_boxset->Reset(TEveBoxSet::kBT_Hex,
true, 64);
89 hex_boxset->SetAntiFlick(
true);
92 TEveBoxSet *boxset =
new TEveBoxSet();
94 boxset->UseSingleColor();
95 boxset->SetPickable(
true);
96 boxset->Reset(TEveBoxSet::kBT_FreeBox,
true, 64);
97 boxset->SetAntiFlick(
true);
99 for (
std::vector<std::pair<DetId, float>>::iterator it = clusterDetIds.begin(), itEnd = clusterDetIds.end();
102 const uint8_t
type = ((it->first >> 28) & 0xF);
105 if (corners ==
nullptr)
114 const bool z = (it->first >> 25) & 0
x1;
123 if (
parameters ==
nullptr || shapes ==
nullptr)
127 const bool isScintillator = (total_points == 4);
142 if (ll != ((it->first >> (isScintillator ? 17 : 20)) & 0x1F))
147 if (iData.
seed().
rawId() == it->first.rawId()) {
148 TEveStraightLineSet *marker =
new TEveStraightLineSet;
149 marker->SetLineWidth(1);
152 const float center[3] = {corners[total_points * 3 + 0],
153 corners[total_points * 3 + 1],
154 corners[total_points * 3 + 2] + shapes[3] * 0.5f};
157 const float crossScale = 1.0f + fmin(iData.
energy(), 5.0f);
158 marker->AddLine(center[0] - crossScale, center[1], center[2], center[0] + crossScale, center[1], center[2]);
159 marker->AddLine(center[0], center[1] - crossScale, center[2], center[0], center[1] + crossScale, center[2]);
160 marker->AddLine(center[0], center[1], center[2] - crossScale, center[0], center[1], center[2] + crossScale);
162 oItemHolder.AddElement(marker);
164 TEveStraightLineSet *position_marker =
new TEveStraightLineSet;
165 position_marker->SetLineWidth(2);
166 position_marker->SetLineColor(kOrange);
168 const float position_crossScale = crossScale * 0.5;
169 position_marker->AddLine(
170 pos.x() - position_crossScale,
pos.y(),
pos.z(),
pos.x() + position_crossScale,
pos.y(),
pos.z());
171 position_marker->AddLine(
172 pos.x(),
pos.y() - position_crossScale,
pos.z(),
pos.x(),
pos.y() + position_crossScale,
pos.z());
174 oItemHolder.AddElement(position_marker);
178 fmin((
item()->getConfig()->value<bool>(
"Cluster(0)/RecHit(1)") ?
hitmap->at(it->first)->energy()
185 if (isScintillator) {
186 const int total_vertices = 3 * total_points;
188 std::vector<float> pnts(24);
189 for (
int i = 0;
i < total_points; ++
i) {
190 pnts[
i * 3 + 0] = corners[
i * 3];
191 pnts[
i * 3 + 1] = corners[
i * 3 + 1];
192 pnts[
i * 3 + 2] = corners[
i * 3 + 2];
194 pnts[(
i * 3 + 0) + total_vertices] = corners[
i * 3];
195 pnts[(
i * 3 + 1) + total_vertices] = corners[
i * 3 + 1];
196 pnts[(
i * 3 + 2) + total_vertices] = corners[
i * 3 + 2] + shapes[3];
198 boxset->AddBox(&pnts[0]);
201 : boxset->DigitColor(64, 64, 64);
210 float centerX = (corners[6] + corners[6 +
offset]) / 2;
211 float centerY = (corners[7] + corners[7 +
offset]) / 2;
212 float radius = fabs(corners[6] - corners[6 +
offset]) / 2;
213 hex_boxset->AddHex(TEveVector(centerX, centerY, corners[2]),
radius, shapes[2], shapes[3]);
216 : hex_boxset->DigitColor(64, 64, 64);
226 std::vector<float> pnts(24);
228 boxset->AddBox(&pnts[0]);
233 hex_boxset->RefitPlex();
235 hex_boxset->CSCTakeAnyParentAsMaster();
237 hex_boxset->CSCApplyMainColorToMatchingChildren();
238 hex_boxset->CSCApplyMainTransparencyToMatchingChildren();
239 hex_boxset->SetMainColor(
item()->modelInfo(iIndex).displayProperties().color());
240 hex_boxset->SetMainTransparency(
item()->defaultDisplayProperties().transparency());
242 oItemHolder.AddElement(hex_boxset);
248 boxset->CSCTakeAnyParentAsMaster();
250 boxset->CSCApplyMainColorToMatchingChildren();
251 boxset->CSCApplyMainTransparencyToMatchingChildren();
252 boxset->SetMainColor(
item()->modelInfo(iIndex).displayProperties().color());
253 boxset->SetMainTransparency(
item()->defaultDisplayProperties().transparency());
255 oItemHolder.AddElement(boxset);
const math::XYZPoint & position() const
cluster centroid position
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
AlgoId algo() const
algorithm identifier
static constexpr uint8_t gradient_steps
const_reference_type get(ProductID id, size_t idx) const
DetId seed() const
return DetId of seed
const float * getCorners(unsigned int id) const
static constexpr uint8_t gradient[3][gradient_steps]
double energy() const
cluster energy
void energyTower3DCorners(const float *corners, float scale, std::vector< float > &, bool reflect=false)
edm::Handle< edm::ValueMap< std::pair< float, float > > > TimeValueMapHandle
const FWGeometry * getGeom() const
constexpr uint32_t rawId() const
get the raw id
const float * getShapePars(unsigned int id) const
const float * getParameters(unsigned int id) const
const FWEventItem * item() const
std::unordered_map< DetId, const HGCRecHit *> * hitmap