8 #include "TEveBoxSet.h" 9 #include "TEveStraightLineSet.h" 36 TEveElement &oItemHolder,
54 item()->getConfig()->value<double>(
"TimeUpperBound(ns)"));
56 item()->getConfig()->value<double>(
"TimeUpperBound(ns)"));
60 <<
" couldn't locate 'hgcalLayerClusters:timeLayerCluster' ValueMap in input file. Trying to access " 61 "'hgcalMergeLayerClusters:timeLayerClusters' ValueMap" 65 <<
" couldn't locate 'hgcalMergeLayerClusters:timeLayerCluster' ValueMap in input file." << std::endl;
81 TEveElement &oItemHolder,
89 std::vector<std::pair<DetId, float>> clusterDetIds = iData.
hitsAndFractions();
92 TEveBoxSet *hex_boxset =
new TEveBoxSet();
94 hex_boxset->UseSingleColor();
95 hex_boxset->SetPickable(
true);
96 hex_boxset->Reset(TEveBoxSet::kBT_Hex,
true, 64);
97 hex_boxset->SetAntiFlick(
true);
100 TEveBoxSet *boxset =
new TEveBoxSet();
102 boxset->UseSingleColor();
103 boxset->SetPickable(
true);
104 boxset->Reset(TEveBoxSet::kBT_FreeBox,
true, 64);
105 boxset->SetAntiFlick(
true);
107 for (
std::vector<std::pair<DetId, float>>::iterator
it = clusterDetIds.begin(), itEnd = clusterDetIds.end();
110 const uint8_t
type = ((
it->first >> 28) & 0xF);
113 if (corners ==
nullptr)
122 const bool z = (
it->first >> 25) & 0
x1;
131 if (
parameters ==
nullptr || shapes ==
nullptr)
135 const bool isScintillator = (total_points == 4);
150 if (ll != ((
it->first >> (isScintillator ? 17 : 20)) & 0x1F))
156 TEveStraightLineSet *marker =
new TEveStraightLineSet;
157 marker->SetLineWidth(1);
160 const float center[3] = {corners[total_points * 3 + 0],
161 corners[total_points * 3 + 1],
162 corners[total_points * 3 + 2] + shapes[3] * 0.5f};
165 const float crossScale = 1.0f + fmin(iData.
energy(), 5.0f);
166 marker->AddLine(center[0] - crossScale, center[1], center[2], center[0] + crossScale, center[1], center[2]);
167 marker->AddLine(center[0], center[1] - crossScale, center[2], center[0], center[1] + crossScale, center[2]);
168 marker->AddLine(center[0], center[1], center[2] - crossScale, center[0], center[1], center[2] + crossScale);
170 oItemHolder.AddElement(marker);
172 TEveStraightLineSet *position_marker =
new TEveStraightLineSet;
173 position_marker->SetLineWidth(2);
174 position_marker->SetLineColor(kOrange);
176 const float position_crossScale = crossScale * 0.5;
177 position_marker->AddLine(
178 pos.x() - position_crossScale,
pos.y(),
pos.z(),
pos.x() + position_crossScale,
pos.y(),
pos.z());
179 position_marker->AddLine(
180 pos.x(),
pos.y() - position_crossScale,
pos.z(),
pos.x(),
pos.y() + position_crossScale,
pos.z());
182 oItemHolder.AddElement(position_marker);
186 fmin((
item()->getConfig()->value<bool>(
"Cluster(0)/RecHit(1)") ?
hitmap->at(
it->first)->energy()
193 if (isScintillator) {
194 const int total_vertices = 3 * total_points;
196 std::vector<float> pnts(24);
197 for (
int i = 0;
i < total_points; ++
i) {
198 pnts[
i * 3 + 0] = corners[
i * 3];
199 pnts[
i * 3 + 1] = corners[
i * 3 + 1];
200 pnts[
i * 3 + 2] = corners[
i * 3 + 2];
202 pnts[(
i * 3 + 0) + total_vertices] = corners[
i * 3];
203 pnts[(
i * 3 + 1) + total_vertices] = corners[
i * 3 + 1];
204 pnts[(
i * 3 + 2) + total_vertices] = corners[
i * 3 + 2] + shapes[3];
206 boxset->AddBox(&pnts[0]);
209 : boxset->DigitColor(64, 64, 64);
218 float centerX = (corners[6] + corners[6 +
offset]) / 2;
219 float centerY = (corners[7] + corners[7 +
offset]) / 2;
220 float radius = fabs(corners[6] - corners[6 +
offset]) / 2;
221 hex_boxset->AddHex(TEveVector(centerX, centerY, corners[2]),
radius, shapes[2], shapes[3]);
224 : hex_boxset->DigitColor(64, 64, 64);
234 std::vector<float> pnts(24);
236 boxset->AddBox(&pnts[0]);
241 hex_boxset->RefitPlex();
243 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);
256 boxset->CSCTakeAnyParentAsMaster();
258 boxset->CSCApplyMainColorToMatchingChildren();
259 boxset->CSCApplyMainTransparencyToMatchingChildren();
260 boxset->SetMainColor(
item()->modelInfo(iIndex).displayProperties().color());
261 boxset->SetMainTransparency(
item()->defaultDisplayProperties().transparency());
263 oItemHolder.AddElement(boxset);
const math::XYZPoint & position() const
cluster centroid position
#define REGISTER_PROXYBUILDER_METHODS()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
const std::vector< std::pair< DetId, float > > & hitsAndFractions() const
FWCaloClusterProxyBuilder(void)
AlgoId algo() const
algorithm identifier
void setItem(const FWEventItem *iItem) override
~FWCaloClusterProxyBuilder(void) override
FWProxyBuilderConfiguration * getConfig() const
static constexpr uint8_t gradient_steps
const_reference_type get(ProductID id, size_t idx) const
DetId seed() const
return DetId of seed
bool getByLabel(InputTag const &, Handle< T > &) const
void setItem(const FWEventItem *iItem) override
const float * getCorners(unsigned int id) const
static constexpr uint8_t gradient[3][gradient_steps]
const edm::EventBase * getEvent() const
FWGenericParameter< T > * assertParam(const std::string &name, T def)
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 FWCaloClusterProxyBuilder & operator=(const FWCaloClusterProxyBuilder &)=delete
const float * getShapePars(unsigned int id) const
const float * getParameters(unsigned int id) const
T value(const std::string &name)
const FWEventItem * item() const
std::unordered_map< DetId, const HGCRecHit *> * hitmap
static constexpr unsigned int kISpyBit