16 #include "TEveCaloData.h" 49 item()->defaultDisplayProperties().color(),
50 item()->defaultDisplayProperties().transparency());
56 assert(
nullptr != base);
58 assert(
nullptr != sel);
62 m_caloData->SetUserData(static_cast<FWFromEveSelectorBase*>(sel));
84 for (std::vector<float>::iterator
i = sliceVals.begin();
i != sliceVals.end(); ++
i) {
94 for (std::vector<float>::iterator
i = sliceVals.begin();
i != sliceVals.end(); ++
i) {
99 TEveCaloData::vCellId_t& selected =
m_vecData->GetCellsSelected();
101 if (
item()->defaultDisplayProperties().isVisible()) {
104 unsigned int index = 0;
105 TEveCaloData::vCellId_t cellId;
109 unsigned int rawid = (*it).detid().rawId();
113 selected.push_back(TEveCaloData::CellId_t(tower,
m_sliceIndex));
122 using namespace TMath;
123 const static float upPhiLimit =
Pi() - 10 * DegToRad() - 1
e-5;
125 TEveCaloData::vCellId_t cellIds;
128 fwLog(
fwlog::kInfo) <<
"FWHFTowerProxyBuilderBase cannot get geometry for DetId: " << rawid <<
". Ignored.\n";
132 const float* corners = geom->
getCorners(rawid);
134 fwLog(
fwlog::kInfo) <<
"FWHFTowerProxyBuilderBase cannot get corners for DetId: " << rawid <<
". Ignored.\n";
138 std::vector<TEveVector> front(4);
140 bool plusSignPhi =
false;
141 bool minusSignPhi =
false;
143 for (
int i = 0;
i < 4; ++
i) {
144 front[
i] = TEveVector(corners[j], corners[j + 1], corners[j + 2]);
147 eta[
i] = front[
i].Eta();
148 phi[
i] = front[
i].Phi();
151 phi[
i] =
Sign(phi[
i], front[i].fY);
153 (phi[
i] >= 0) ? plusSignPhi =
true : minusSignPhi =
true;
157 if (plusSignPhi && minusSignPhi) {
158 for (
int i = 0;
i < 4; ++
i) {
159 if (phi[
i] >= upPhiLimit) {
170 for (
int i = 0;
i < 4; ++
i) {
171 etam =
Min(etam, eta[
i]);
172 etaM =
Max(etaM, eta[i]);
173 phim =
Min(phim, phi[i]);
174 phiM =
Max(phiM, phi[i]);
183 Float_t ceta = (etam + etaM) * 0.5;
184 Float_t cphi = (phim + phiM) * 0.5;
187 for (TEveCaloData::vCellGeom_i
i =
m_vecData->GetCellGeom().begin();
i !=
m_vecData->GetCellGeom().end();
189 const TEveCaloData::CellGeom_t& cg = *
i;
190 if ((ceta > cg.fEtaMin && ceta < cg.fEtaMax) && (cphi > cg.fPhiMin && cphi < cg.fPhiMax)) {
198 tower =
m_vecData->AddTower(etam, etaM, phim, phiM);
TEveCaloDataVec * getCaloDataHF() const
const FWDisplayProperties & displayProperties() const
void setCaloData(const fireworks::Context &) override
static const int kAllRPZBits
void get(const T *&oData) const
std::vector< T >::const_iterator const_iterator
void fillCaloData() override
void addSliceSelector(int iSlice, FWFromSliceSelector *)
const FWEventItem * item() const
TEveCaloDataVec * m_vecData
void itemBeingDestroyed(const FWEventItem *) override
void itemBeingDestroyed(const FWEventItem *) override
bool contains(unsigned int id) const
const_iterator end() const
~FWHFTowerProxyBuilderBase() override
const float * getCorners(unsigned int id) const
FWHFTowerProxyBuilderBase()
#define REGISTER_FWPROXYBUILDER(_name_, _type_, _purpose_, _view_)
const HFRecHitCollection * m_hits
ModelInfo modelInfo(int iIndex) const
bool assertCaloDataSlice() override
int fillTowerForDetId(unsigned int rawid, float)
const FWGeometry * getGeom() const
const_iterator begin() const
TEveCaloData * m_caloData