13 #include "TEveBoxSet.h"
14 #include "TEveStraightLineSet.h"
45 TEveElement &oItemHolder,
70 <<
"lower time bound is larger than upper time bound. Maybe opposite is desired?";
73 edm::LogWarning(
"DataNotFound|InvalidData") <<
"couldn't locate 'timeLayerCluster' ValueMap in root file.";
77 edm::LogWarning(
"DataNotFound|InvalidData") <<
"couldn't locate 'timeLayerCluster' ValueMap in root file.";
95 TEveElement &oItemHolder,
104 const size_t N = trackster.
vertices().size();
108 TEveBoxSet *hex_boxset =
new TEveBoxSet();
110 hex_boxset->UseSingleColor();
111 hex_boxset->SetPickable(
true);
112 hex_boxset->Reset(TEveBoxSet::kBT_Hex,
true, 64);
113 hex_boxset->SetAntiFlick(
true);
116 TEveBoxSet *boxset =
new TEveBoxSet();
118 boxset->UseSingleColor();
119 boxset->SetPickable(
true);
120 boxset->Reset(TEveBoxSet::kBT_FreeBox,
true, 64);
121 boxset->SetAntiFlick(
true);
123 for (
size_t i = 0;
i <
N; ++
i) {
125 std::vector<std::pair<DetId, float>> clusterDetIds = layerCluster.
hitsAndFractions();
127 for (
std::vector<std::pair<DetId, float>>::iterator it = clusterDetIds.begin(), itEnd = clusterDetIds.end();
130 const uint8_t
type = ((it->first >> 28) & 0xF);
133 if (corners ==
nullptr)
139 const bool z = (it->first >> 25) & 0
x1;
148 if (
parameters ==
nullptr || shapes ==
nullptr)
152 const bool isScintillator = (total_points == 4);
167 if (ll != ((it->first >> (isScintillator ? 17 : 20)) & 0x1F))
172 if (layerCluster.
seed().
rawId() == it->first.rawId()) {
173 const float crossScale = 1.0f + fmin(layerCluster.
energy(), 5.0f);
175 TEveStraightLineSet *marker =
new TEveStraightLineSet;
176 marker->SetLineWidth(1);
179 const float center[3] = {corners[total_points * 3 + 0],
180 corners[total_points * 3 + 1],
181 corners[total_points * 3 + 2] + shapes[3] * 0.5f};
184 marker->AddLine(center[0] - crossScale, center[1], center[2], center[0] + crossScale, center[1], center[2]);
185 marker->AddLine(center[0], center[1] - crossScale, center[2], center[0], center[1] + crossScale, center[2]);
186 marker->AddLine(center[0], center[1], center[2] - crossScale, center[0], center[1], center[2] + crossScale);
188 oItemHolder.AddElement(marker);
192 TEveStraightLineSet *position_marker =
new TEveStraightLineSet;
193 position_marker->SetLineWidth(2);
194 position_marker->SetLineColor(kOrange);
196 const float position_crossScale = crossScale * 0.5;
197 position_marker->AddLine(
198 pos.x() - position_crossScale,
pos.y(),
pos.z(),
pos.x() + position_crossScale,
pos.y(),
pos.z());
199 position_marker->AddLine(
200 pos.x(),
pos.y() - position_crossScale,
pos.z(),
pos.x(),
pos.y() + position_crossScale,
pos.z());
202 oItemHolder.AddElement(position_marker);
207 fmin((
item()->getConfig()->value<bool>(
"Cluster(0)/RecHit(1)") ?
hitmap->at(it->first)->energy()
208 : layerCluster.
energy()) /
214 if (isScintillator) {
215 const int total_vertices = 3 * total_points;
217 std::vector<float> pnts(24);
218 for (
int i = 0;
i < total_points; ++
i) {
219 pnts[
i * 3 + 0] = corners[
i * 3];
220 pnts[
i * 3 + 1] = corners[
i * 3 + 1];
221 pnts[
i * 3 + 2] = corners[
i * 3 + 2];
223 pnts[(
i * 3 + 0) + total_vertices] = corners[
i * 3];
224 pnts[(
i * 3 + 1) + total_vertices] = corners[
i * 3 + 1];
225 pnts[(
i * 3 + 2) + total_vertices] = corners[
i * 3 + 2] + shapes[3];
227 boxset->AddBox(&pnts[0]);
230 : boxset->DigitColor(64, 64, 64);
239 float centerX = (corners[6] + corners[6 +
offset]) / 2;
240 float centerY = (corners[7] + corners[7 +
offset]) / 2;
241 float radius = fabs(corners[6] - corners[6 +
offset]) / 2;
242 hex_boxset->AddHex(TEveVector(centerX, centerY, corners[2]),
radius, 90.0, shapes[3]);
245 : hex_boxset->DigitColor(64, 64, 64);
256 for (
auto edge :
edges) {
259 const bool isScintillatorIn = doublet.first.seed().det() ==
DetId::HGCalHSc;
260 const bool isScintillatorOut = doublet.second.seed().det() ==
DetId::HGCalHSc;
271 layerOut += offsetOut;
273 const bool isAdjacent = (layerOut - layerIn) == 1;
275 TEveStraightLineSet *marker =
new TEveStraightLineSet;
276 marker->SetLineWidth(2);
278 marker->SetLineColor(kYellow);
280 marker->SetLineColor(kRed);
284 if (
layer == 0 || fabs(layerIn -
layer) == 0 || fabs(layerOut -
layer) == 0) {
285 marker->AddLine(doublet.first.x(),
293 oItemHolder.AddElement(marker);
298 hex_boxset->RefitPlex();
300 hex_boxset->CSCTakeAnyParentAsMaster();
302 hex_boxset->CSCApplyMainColorToMatchingChildren();
303 hex_boxset->CSCApplyMainTransparencyToMatchingChildren();
304 hex_boxset->SetMainColor(
item()->modelInfo(iIndex).displayProperties().color());
305 hex_boxset->SetMainTransparency(
item()->defaultDisplayProperties().transparency());
307 oItemHolder.AddElement(hex_boxset);
313 boxset->CSCTakeAnyParentAsMaster();
315 boxset->CSCApplyMainColorToMatchingChildren();
316 boxset->CSCApplyMainTransparencyToMatchingChildren();
317 boxset->SetMainColor(
item()->modelInfo(iIndex).displayProperties().color());
318 boxset->SetMainTransparency(
item()->defaultDisplayProperties().transparency());
320 oItemHolder.AddElement(boxset);