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
80 std::vector<std::pair<DetId, float>> clusterDetIds = iData.
hitsAndFractions();
83 TEveBoxSet *hex_boxset =
new TEveBoxSet();
85 hex_boxset->UseSingleColor();
86 hex_boxset->SetPickable(
true);
87 hex_boxset->Reset(TEveBoxSet::kBT_Hex,
true, 64);
88 hex_boxset->SetAntiFlick(
true);
91 TEveBoxSet *boxset =
new TEveBoxSet();
93 boxset->UseSingleColor();
94 boxset->SetPickable(
true);
95 boxset->Reset(TEveBoxSet::kBT_FreeBox,
true, 64);
96 boxset->SetAntiFlick(
true);
98 for (std::vector<std::pair<DetId, float>>::iterator it = clusterDetIds.begin(), itEnd = clusterDetIds.end();
101 const uint8_t
type = ((it->first >> 28) & 0xF);
104 if (corners ==
nullptr)
108 if (iData.
algo() == 8 || (type >= 8 && type <= 10))
114 const bool z = (it->first >> 25) & 0
x1;
119 (((
z_plus | z_minus) == 0) || !(z == z_minus || z == !
z_plus)))
125 if (parameters ==
nullptr || shapes ==
nullptr)
128 const int total_points = parameters[0];
129 const bool isScintillator = (total_points == 4);
150 if (ll != ((it->first >> (isScintillator ? 17 : 20)) & 0x1F))
155 if (iData.
seed().
rawId() == it->first.rawId())
157 TEveStraightLineSet *
marker =
new TEveStraightLineSet;
158 marker->SetLineWidth(1);
161 const float center[3] = { corners[total_points*3 + 0], corners[total_points*3+ 1], corners[total_points*3 + 2] + shapes[3] * 0.5f };
164 const float crossScale = 1.0f + fmin(iData.
energy(), 5.0f);
166 center[0] - crossScale, center[1], center[2],
167 center[0] + crossScale, center[1], center[2]);
169 center[0], center[1] - crossScale, center[2],
170 center[0], center[1] + crossScale, center[2]);
172 center[0], center[1], center[2] - crossScale,
173 center[0], center[1], center[2] + crossScale);
175 oItemHolder.AddElement(marker);
184 const int total_vertices = 3 * total_points;
186 std::vector<float> pnts(24);
187 for (
int i = 0;
i < total_points; ++
i)
189 pnts[
i * 3 + 0] = corners[
i * 3];
190 pnts[
i * 3 + 1] = corners[
i * 3 + 1];
191 pnts[
i * 3 + 2] = corners[
i * 3 + 2];
193 pnts[(
i * 3 + 0) + total_vertices] = corners[
i * 3];
194 pnts[(
i * 3 + 1) + total_vertices] = corners[
i * 3 + 1];
195 pnts[(
i * 3 + 2) + total_vertices] = corners[
i * 3 + 2] + shapes[3];
197 boxset->AddBox(&pnts[0]);
202 boxset->DigitColor(64, 64, 64);
212 float centerX = (corners[6] + corners[6 +
offset]) / 2;
213 float centerY = (corners[7] + corners[7 +
offset]) / 2;
214 float radius = fabs(corners[6] - corners[6 + offset]) / 2;
215 hex_boxset->AddHex(TEveVector(centerX, centerY, corners[2]),
216 radius, 90.0, shapes[3]);
221 hex_boxset->DigitColor(64, 64, 64);
232 std::vector<float> pnts(24);
234 boxset->AddBox(&pnts[0]);
240 hex_boxset->RefitPlex();
242 hex_boxset->CSCTakeAnyParentAsMaster();
245 hex_boxset->CSCApplyMainColorToMatchingChildren();
246 hex_boxset->CSCApplyMainTransparencyToMatchingChildren();
247 hex_boxset->SetMainColor(
item()->modelInfo(iIndex).displayProperties().
color());
248 hex_boxset->SetMainTransparency(
item()->defaultDisplayProperties().transparency());
250 oItemHolder.AddElement(hex_boxset);
257 boxset->CSCTakeAnyParentAsMaster();
260 boxset->CSCApplyMainColorToMatchingChildren();
261 boxset->CSCApplyMainTransparencyToMatchingChildren();
262 boxset->SetMainColor(
item()->modelInfo(iIndex).displayProperties().
color());
263 boxset->SetMainTransparency(
item()->defaultDisplayProperties().transparency());
265 oItemHolder.AddElement(boxset);
edm::Handle< edm::ValueMap< float > > TimeValueMapHandle
std::map< DetId, const HGCRecHit * > hitmap
static uint8_t gradient[3][gradient_steps]
const float * getParameters(unsigned int id) const
constexpr uint32_t rawId() const
get the raw id
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
const FWEventItem * item() const
AlgoId algo() const
algorithm identifier
const float * getShapePars(unsigned int id) const
double energy() const
cluster energy
const_reference_type get(ProductID id, size_t idx) const
void energyTower3DCorners(const float *corners, float scale, std::vector< float > &, bool reflect=false)
DetId seed() const
return DetId of seed
const float * getCorners(unsigned int id) const
static uint8_t gradient_steps
const FWGeometry * getGeom() const