54 ::Error(
"TEveCaloData::CellGeom_t::Configure",
"phiMin and phiMax should be between -2*pi and 2*pi (min=%f, max=%f). RhoZ projection will be wrong.",
163 cellData.
Eta(), cellData.
Phi());
165 if (single)
return s;
181 impSelSet.insert(*i);
196 printf(
"Tower [%d] Slice [%d] Value [%.2f] ", i->fTower, i->fSlice, cellData.
fValue);
208 typedef std::set<CellId_t> sCellId_t;
209 typedef std::set<CellId_t>::iterator sCellId_i;
213 static void fill_cell_set(sCellId_t& cset,
vCellId_t& cvec)
215 for (
vCellId_i i = cvec.begin(); i != cvec.end(); ++i)
218 static void fill_cell_vec(
vCellId_t& cvec, sCellId_t& cset)
220 for (sCellId_i i = cset.begin(); i != cset.end(); ++i)
229 if (!sel_cells.empty())
231 cells.swap(sel_cells);
237 if (!sel_cells.empty())
242 helper::fill_cell_set(cs, cells);
243 for (
vCellId_i i = sel_cells.begin(); i != sel_cells.end(); ++i)
245 std::set<CellId_t>::iterator csi = cs.find(*i);
258 helper::fill_cell_vec(cells, cs);
265 if (cells.size() == sel_cells.size())
268 helper::fill_cell_set(cs, cells);
269 for (
vCellId_i i = sel_cells.begin(); i != sel_cells.end(); ++i)
271 if (cs.find(*i) == cs.end())
284 cells.swap(sel_cells);
412 using namespace TMath;
442 fSliceVec.assign(nslices, std::vector<Float_t> ());
460 fSliceVec.push_back(std::vector<Float_t> ());
471 assert (etaMin < etaMax);
472 assert (phiMin < phiMax);
513 using namespace TMath;
515 Float_t etaMin = eta - etaD*0.5;
516 Float_t etaMax = eta + etaD*0.5;
518 Float_t phiMin = phi - phiD*0.5;
519 Float_t phiMax = phi + phiD*0.5;
524 Float_t fracx=0, fracy=0, frac;
542 else if (minQ > phiMax)
548 if (maxQ >= phiMin && minQ <= phiMax)
554 for (
Int_t s=0; s<nS; s++)
557 out.push_back(
CellId_t(tower, s, frac));
575 for (
vCellId_i it = ids.begin(); it != ids.end(); ++it)
582 for (
Int_t i = iMin; i <= iMax; ++i)
584 if (i < 0 || i > ax->GetNbins())
continue;
585 for (
Int_t j = jMin; j <= jMax; ++j)
587 if (j < 0 || j > ay->
GetNbins())
continue;
595 slices[(*it).fSlice] += ratio * cd.
Value(et);
608 cellData.CellGeom_t::operator=(
fGeomVec[
id.fTower] );
617 using namespace TMath;
648 std::vector<Double_t> binX;
649 std::vector<Double_t> binY;
655 binX.push_back(ch.
EtaMin());
656 binX.push_back(ch.
EtaMax());
657 binY.push_back(ch.
PhiMin());
658 binY.push_back(ch.
PhiMax());
661 std::sort(binX.begin(), binX.end());
662 std::sort(binY.begin(), binY.end());
669 Double_t dx = binX.back() - binX.front();
671 std::vector<Double_t> newX;
672 newX.push_back(binX.front());
673 Int_t nX = binX.size()-1;
674 for(
Int_t i=0; i<nX; i++)
676 val = (
sum +binX[i])/(cnt+1);
677 if (binX[i+1] -val > epsX)
689 newX.push_back(binX.back());
694 std::vector<Double_t> newY;
695 Double_t dy = binY.back() - binY.front();
697 newY.push_back(binY.front());
698 Int_t nY = binY.size()-1;
699 for(
Int_t i=0 ; i<nY; i++)
701 val = (
sum +binY[i])/(cnt+1);
702 if (binY[i+1] -val > epsY )
715 newY.push_back(binY.back());
758 using namespace TMath;
799 using namespace TMath;
814 for (
Int_t ieta = 1; ieta <= nEta; ++ieta)
816 if (
fEtaAxis->GetBinLowEdge(ieta) >= etaMin &&
fEtaAxis->GetBinUpEdge(ieta) <= etaMax)
818 for (
Int_t iphi = 1; iphi <= nPhi; ++iphi)
823 (phiMin, phiMax,
fPhiAxis->GetBinLowEdge(iphi),
fPhiAxis->GetBinUpEdge(iphi));
827 accept =
fPhiAxis->GetBinLowEdge(iphi) >= phiMin &&
fPhiAxis->GetBinUpEdge(iphi) <= phiMax &&
828 fPhiAxis->GetBinLowEdge(iphi) >= phiMin &&
fPhiAxis->GetBinUpEdge(iphi) <= phiMax;
833 for (
Int_t s = 0; s < nSlices; ++s)
836 bin = hist->
GetBin(ieta, iphi);
859 for (
vCellId_i it=ids.begin(); it!=ids.end(); ++it)
863 binx = ax->FindBin(
fEtaAxis->GetBinCenter(i));
865 bin = biny*(ax->GetNbins()+2)+binx;
870 val[(*it).fSlice] += cd.
Value(et)*ratio;
914 assert(slice >= 0 && slice < fHStack->GetHists()->GetSize());
int Int_t
Signed integer 4 bytes (int).
char Char_t
Character 1 byte (char).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
bool Bool_t
Boolean (0=false, 1=true) (bool).
double Double_t
Double 8 bytes.
short Color_t
Color number (short).
float Float_t
Float 4 bytes (float).
virtual Color_t GetLineColor() const
Return the line color.
Class to manage histogram axis.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
TH2F * GetHist(Int_t slice) const
Get histogram in given slice.
void Rebin(TAxis *ax, TAxis *ay, vCellId_t &in, Bool_t et, RebinData_t &out) const override
Rebin.
void GetCellList(Float_t etaMin, Float_t etaMax, Float_t phi, Float_t phiRng, vCellId_t &out) const override
Get list of cell IDs in given eta and phi range.
Int_t AddHistogram(TH2F *hist)
Add new slice to calo tower.
TEveCaloDataHist()
Constructor.
void GetEtaLimits(Double_t &min, Double_t &max) const override
Get eta limits.
void GetCellData(const TEveCaloData::CellId_t &id, TEveCaloData::CellData_t &data) const override
Get cell geometry and value from cell ID.
void DataChanged() override
Update limits and notify data users.
~TEveCaloDataHist() override
Destructor.
void GetPhiLimits(Double_t &min, Double_t &max) const override
Get phi limits.
void Rebin(TAxis *ax, TAxis *ay, vCellId_t &in, Bool_t et, RebinData_t &out) const override
Rebin cells.
Int_t AddSlice()
Add new slice.
void SetAxisFromBins(Double_t epsX=0.001, Double_t epsY=0.001)
Set XY axis from cells geometry.
~TEveCaloDataVec() override
Destructor.
TEveCaloDataVec(const TEveCaloDataVec &)
std::vector< vFloat_t >::iterator vvFloat_i
void FillSlice(Int_t slice, Float_t value)
Fill given slice in the current tower.
void DataChanged() override
Update limits and notify data users.
Int_t AddTower(Float_t etaMin, Float_t etaMax, Float_t phiMin, Float_t phiMax)
Add tower within eta/phi range.
void GetCellList(Float_t etaMin, Float_t etaMax, Float_t phi, Float_t phiRng, vCellId_t &out) const override
Get list of cell-ids for given eta/phi range.
void GetCellData(const TEveCaloData::CellId_t &id, TEveCaloData::CellData_t &data) const override
Get cell geometry and value from cell ID.
TEveCaloData(const TEveCaloData &)
void FillImpliedSelectedSet(Set_t &impSelSet) override
Populate set impSelSet with derived / dependant elements.
std::vector< CellId_t > vCellId_t
static Float_t EtaToTheta(Float_t eta)
void SetSliceColor(Int_t slice, Color_t col)
Set color for given slice.
void ProcessSelection(vCellId_t &sel_cells, TGLSelectRecord &rec)
Process newly selected cells with given select-record.
virtual void GetCellData(const CellId_t &id, CellData_t &data) const =0
Char_t GetSliceTransparency(Int_t slice) const
Get transparency for given slice.
vCellId_t fCellsHighlighted
void UnHighlighted() override
Virtual method TEveElement::UnHighlighted.
void SetSliceTransparency(Int_t slice, Char_t t)
Set transparency for given slice.
void SetSliceThreshold(Int_t slice, Float_t threshold)
Set threshold for given slice.
virtual void InvalidateUsersCellIdCache()
Invalidate cell ids cache on back ptr references.
Color_t GetSliceColor(Int_t slice) const
Get color for given slice.
virtual void DataChanged()
Tell users (TEveCaloViz instances using this data) that data has changed and they should update the l...
TString GetHighlightTooltip() override
std::vector< CellGeom_t >::const_iterator vCellGeom_ci
virtual void CellSelectionChanged()
Tell users (TEveCaloViz instances using this data) that cell selection has changed and they should up...
Float_t GetSliceThreshold(Int_t slice) const
Get threshold for given slice.
void UnSelected() override
Virtual method TEveElement::UnSelect.
void PrintCellsSelected()
Print selected cells info.
std::vector< CellId_t >::iterator vCellId_i
Base class for calorimeter data visualization.
virtual void CellSelectionChanged()
void InvalidateCellIdCache()
void DataChanged()
Update setting and cache on data changed.
void StampColorSelection()
std::set< TEveElement * > Set_t
List_t::const_iterator List_ci
TEveElement()
Default constructor.
static Float_t GetFraction(Float_t minM, Float_t maxM, Float_t minQ, Float_t maxQ)
Get fraction of interval [minQ, maxQ] in [minM, maxM].
static Bool_t IsU1IntervalContainedByMinMax(Float_t minM, Float_t maxM, Float_t minQ, Float_t maxQ)
Return true if interval Q is contained within interval M for U1 variables.
Standard selection record including information about containing scene and details ob out selected ob...
@ kModifyingInternalSelection
Bool_t GetHighlight() const
Bool_t GetMultiple() const
ESecSelResult GetSecSelResult() const
void SetSecSelResult(ESecSelResult r)
virtual void GetBinXYZ(Int_t binglobal, Int_t &binx, Int_t &biny, Int_t &binz) const
Return binx, biny, binz corresponding to the global bin number globalbin see TH1::GetBin function abo...
2-D histogram with a float per channel (see TH1 documentation)
Service class for 2-D histogram classes.
Int_t GetBin(Int_t binx, Int_t biny, Int_t binz=0) const override
Return Global bin number corresponding to binx,y,z.
Double_t GetBinContent(Int_t binx, Int_t biny) const override
const char * GetName() const override
Returns name of object.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
Double_t ATan(Double_t)
Returns the principal value of the arc tangent of x, expressed in radians.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
constexpr Double_t TwoPi()
Cell data inner structure.
Float_t Value(Bool_t) const
Return energy value associated with the cell, usually Et.
void Dump() const override
Print member data.
Cell geometry inner structure.
virtual void Dump() const
Print member data.
void Configure(Float_t etaMin, Float_t etaMax, Float_t phiMin, Float_t phiMax)
std::vector< Float_t > fSliceData
std::vector< Int_t > fBinData
Float_t * GetSliceVals(Int_t bin)
static uint64_t sum(uint64_t i)