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.",
84 printf(
"%f, %f %f, %f \n", fEtaMin, fEtaMax, fPhiMin, fPhiMax);
92 if (fBinData[bin] == -1)
94 fBinData[bin] = fSliceData.size();
96 for (
Int_t i=0; i<fNSlices; i++)
97 fSliceData.push_back(0.f);
100 return &fSliceData[fBinData[bin]];
164 cellData.
Eta(), cellData.
Phi());
166 if (single)
return s;
182 impSelSet.insert(*i);
197 printf(
"Tower [%d] Slice [%d] Value [%.2f] ", i->fTower, i->fSlice, cellData.fValue);
198 printf(
"Eta:(%f, %f) Phi(%f, %f)\n", cellData.fEtaMin, cellData.fEtaMax, cellData.fPhiMin, cellData.fPhiMax);
209 typedef std::set<CellId_t> sCellId_t;
210 typedef std::set<CellId_t>::iterator sCellId_i;
214 static void fill_cell_set(sCellId_t& cset,
vCellId_t& cvec)
216 for (
vCellId_i i = cvec.begin(); i != cvec.end(); ++i)
219 static void fill_cell_vec(
vCellId_t& cvec, sCellId_t& cset)
221 for (sCellId_i i = cset.begin(); i != cset.end(); ++i)
230 if (!sel_cells.empty())
232 cells.swap(sel_cells);
238 if (!sel_cells.empty())
243 helper::fill_cell_set(cs, cells);
244 for (
vCellId_i i = sel_cells.begin(); i != sel_cells.end(); ++i)
246 std::set<CellId_t>::iterator csi = cs.find(*i);
259 helper::fill_cell_vec(cells, cs);
266 if (cells.size() == sel_cells.size())
269 helper::fill_cell_set(cs, cells);
270 for (
vCellId_i i = sel_cells.begin(); i != sel_cells.end(); ++i)
272 if (cs.find(*i) == cs.end())
285 cells.swap(sel_cells);
413 using namespace TMath;
444 fSliceVec.assign(nslices, std::vector<Float_t> ());
462 fSliceVec.push_back(std::vector<Float_t> ());
515 using namespace TMath;
517 Float_t etaMin = eta - etaD*0.5;
520 Float_t phiMin = phi - phiD*0.5;
521 Float_t phiMax = phi + phiD*0.5;
526 Float_t fracx=0, fracy=0, frac;
544 else if (minQ > phiMax)
550 if (maxQ >= phiMin && minQ <= phiMax)
556 for (
Int_t s=0; s<nS; s++)
559 out.push_back(
CellId_t(tower, s, frac));
577 for (
vCellId_i it = ids.begin(); it != ids.end(); ++it)
584 for (
Int_t i = iMin; i <= iMax; ++i)
586 if (i < 0 || i > ax->
GetNbins())
continue;
587 for (
Int_t j = jMin; j <= jMax; ++j)
589 if (j < 0 || j > ay->
GetNbins())
continue;
597 slices[(*it).fSlice] += ratio * cd.
Value(et);
610 cellData.CellGeom_t::operator=(
fGeomVec[
id.fTower] );
619 using namespace TMath;
650 std::vector<Double_t> binX;
651 std::vector<Double_t> binY;
657 binX.push_back(ch.
EtaMin());
658 binX.push_back(ch.
EtaMax());
659 binY.push_back(ch.
PhiMin());
660 binY.push_back(ch.
PhiMax());
663 std::sort(binX.begin(), binX.end());
664 std::sort(binY.begin(), binY.end());
671 Double_t dx = binX.back() - binX.front();
673 std::vector<Double_t> newX;
674 newX.push_back(binX.front());
675 Int_t nX = binX.size()-1;
676 for(
Int_t i=0; i<nX; i++)
678 val = (sum +binX[i])/(cnt+1);
679 if (binX[i+1] -val > epsX)
691 newX.push_back(binX.back());
696 std::vector<Double_t> newY;
697 Double_t dy = binY.back() - binY.front();
699 newY.push_back(binY.front());
700 Int_t nY = binY.size()-1;
701 for(
Int_t i=0 ; i<nY; i++)
703 val = (sum +binY[i])/(cnt+1);
704 if (binY[i+1] -val > epsY )
717 newY.push_back(binY.back());
761 using namespace TMath;
802 using namespace TMath;
817 for (
Int_t ieta = 1; ieta <= nEta; ++ieta)
821 for (
Int_t iphi = 1; iphi <= nPhi; ++iphi)
836 for (
Int_t s = 0; s < nSlices; ++s)
839 bin = hist->
GetBin(ieta, iphi);
862 for (
vCellId_i it=ids.begin(); it!=ids.end(); ++it)
873 val[(*it).fSlice] += cd.
Value(et)*ratio;
917 assert(slice >= 0 && slice < fHStack->GetHists()->GetSize());
Float_t GetSliceThreshold(Int_t slice) const
Get threshold for given slice.
void SetSecSelResult(ESecSelResult r)
A central manager for calorimeter event data.
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
std::vector< CellId_t >::iterator vCellId_i
The Histogram stack class.
TEveCaloDataVec(const TEveCaloDataVec &)
vCellId_t fCellsHighlighted
Color_t GetSliceColor(Int_t slice) const
Get color for given slice.
std::set< TEveElement * > Set_t
void Configure(Float_t etaMin, Float_t etaMax, Float_t phiMin, Float_t phiMax)
std::vector< Int_t > fBinData
virtual void DataChanged()
Tell users (TEveCaloViz instances using this data) that data has changed and they should update the l...
virtual void GetEtaLimits(Double_t &min, Double_t &max) const
Get eta limits.
Char_t GetSliceTransparency(Int_t slice) const
Get transparency for given slice.
virtual void SetNdivisions(Int_t n=510, Bool_t optim=kTRUE)
Set the number of divisions for this axis.
virtual TString GetHighlightTooltip()
virtual Double_t GetBinLowEdge(Int_t bin) const
Return low edge of bin.
ESecSelResult GetSecSelResult() const
std::vector< vFloat_t >::iterator vvFloat_i
Calo data for universal cell geometry.
virtual void GetCellData(const TEveCaloData::CellId_t &id, TEveCaloData::CellData_t &data) const
Get cell geometry and value from cell ID.
TEveCaloData(const TEveCaloData &)
void FillSlice(Int_t slice, Float_t value)
Fill given slice in the current tower.
T etaMax()
Function providing the maximum possible value of pseudorapidity for a non-zero rho, in the Scalar type with the largest dynamic range.
virtual void Rebin(TAxis *ax, TAxis *ay, vCellId_t &in, Bool_t et, RebinData_t &out) const
Rebin.
void SetSliceColor(Int_t slice, Color_t col)
Set color for given slice.
virtual TObject * At(Int_t idx) const
Returns the object at position idx. Returns 0 if idx is out of range.
virtual void UnHighlighted()
Virtual method TEveElement::UnHighlighted.
virtual void FillImpliedSelectedSet(Set_t &impSelSet)
Populate set impSelSet with derived / dependant elements.
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 TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
static Float_t EtaToTheta(Float_t eta)
The TNamed class is the base class for all named ROOT classes.
virtual ~TEveCaloDataHist()
Destructor.
virtual void InvalidateUsersCellIdCache()
Invalidate cell ids cache on back ptr references.
std::vector< CellId_t > vCellId_t
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void UnSelected()
Virtual method TEveElement::UnSelect.
Bool_t GetMultiple() const
Int_t AddHistogram(TH2F *hist)
Add new slice to calo tower.
List_t::const_iterator List_ci
Service class for 2-Dim histogram classes.
Class to manage histogram axis.
void InvalidateCellIdCache()
virtual void DataChanged()
Update limits and notify data users.
double Pi()
Mathematical constants.
void ProcessSelection(vCellId_t &sel_cells, TGLSelectRecord &rec)
Process newly selected cells with given select-record.
TEveCaloDataHist()
Constructor.
virtual void GetCellData(const TEveCaloData::CellId_t &id, TEveCaloData::CellData_t &data) const
Get cell geometry and value from cell ID.
virtual Double_t GetBinUpEdge(Int_t bin) const
Return up edge of bin.
2-D histogram with a float per channel (see TH1 documentation)}
Standard selection record including information about containing scene and details ob out selected ob...
Cell geometry inner structure.
virtual void GetCellData(const CellId_t &id, CellData_t &data) const =0
virtual const char * GetName() const
Returns name of object.
virtual void CellSelectionChanged()
Tell users (TEveCaloViz instances using this data) that cell selection has changed and they should up...
virtual void Dump() const
Print member data.
virtual void CellSelectionChanged()
virtual Color_t GetLineColor() const
void SetAxisFromBins(Double_t epsX=0.001, Double_t epsY=0.001)
Set XY axis from cells geometry.
void StampColorSelection()
Float_t Value(Bool_t) const
Return energy value associated with the cell, usually Et.
virtual void GetCellList(Float_t etaMin, Float_t etaMax, Float_t phi, Float_t phiRng, vCellId_t &out) const
Get list of cell IDs in given eta and phi range.
virtual Int_t GetBin(Int_t binx, Int_t biny, Int_t binz=0) const
Return Global bin number corresponding to binx,y,z.
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
Int_t AddTower(Float_t etaMin, Float_t etaMax, Float_t phiMin, Float_t phiMax)
Add tower within eta/phi range.
virtual void GetCellList(Float_t etaMin, Float_t etaMax, Float_t phi, Float_t phiRng, vCellId_t &out) const
Get list of cell-ids for given eta/phi range.
virtual void DataChanged()
Update limits and notify data users.
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
void SetSliceTransparency(Int_t slice, Char_t t)
Set transparency for given slice.
TH2F * GetHist(Int_t slice) const
Get histogram in given slice.
virtual void Add(TH1 *h, Option_t *option="")
add a new histogram to the list Only 1-d and 2-d histograms currently supported.
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.
Base class for calorimeter data visualization.
void DataChanged()
Update setting and cache on data changed.
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
virtual void Rebin(TAxis *ax, TAxis *ay, vCellId_t &in, Bool_t et, RebinData_t &out) const
Rebin cells.
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
std::vector< CellGeom_t >::const_iterator vCellGeom_ci
virtual void GetPhiLimits(Double_t &min, Double_t &max) const
Get phi limits.
Bool_t GetHighlight() const
virtual ~TEveCaloDataVec()
Destructor.
Cell data inner structure.
void PrintCellsSelected()
Print selected cells info.
virtual void Dump() const
Print member data.
void SetSliceThreshold(Int_t slice, Float_t threshold)
Set threshold for given slice.
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...
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Float_t * GetSliceVals(Int_t bin)
A central manager for calorimeter data of an event written in TH2F.
Int_t AddSlice()
Add new slice.