/usr/include/root/TEveCaloData.h is in libroot-graf3d-eve-dev 5.34.30-0ubuntu8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 | // @(#)root/eve:$Id$
// Author: Matevz Tadel 2007
/*************************************************************************
* Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TEveCaloData
#define ROOT_TEveCaloData
#include <vector>
#include "TEveElement.h"
#include "TMath.h"
class TGLSelectRecord;
class TH2F;
class TAxis;
class THStack;
class TEveCaloData: public TEveElement,
public TNamed
{
public:
struct SliceInfo_t
{
TString fName; // Name of the slice, eg. ECAL, HCAL.
Float_t fThreshold; // Only display towers with higher energy.
Color_t fColor; // Color used to draw this longitudinal slice.
Color_t fTransparency; // Transparency used to draw this longitudinal slice.
SliceInfo_t(): fName(""), fThreshold(0), fColor(kRed), fTransparency(0) {}
virtual ~SliceInfo_t() {}
void Setup(const char* name, Float_t threshold, Color_t col, Char_t transp = 101)
{
fName = name;
fThreshold = threshold;
fColor = col;
if (transp <= 100) fTransparency = transp;
};
ClassDef(SliceInfo_t, 0); // Slice info for histogram stack.
};
typedef std::vector<SliceInfo_t> vSliceInfo_t;
typedef std::vector<SliceInfo_t>::iterator vSliceInfo_i;
/**************************************************************************/
struct CellId_t
{
// Cell ID inner structure.
Int_t fTower;
Int_t fSlice;
Float_t fFraction;
CellId_t(Int_t t, Int_t s, Float_t f=1.0f) : fTower(t), fSlice(s), fFraction(f) {}
bool operator<(const CellId_t& o) const
{ return (fTower == o.fTower) ? fSlice < o.fSlice : fTower < o.fTower; }
};
struct CellGeom_t
{
// Cell geometry inner structure.
Float_t fPhiMin;
Float_t fPhiMax;
Float_t fEtaMin;
Float_t fEtaMax;
Float_t fThetaMin; // cached
Float_t fThetaMax; // cached
CellGeom_t(): fPhiMin(0), fPhiMax(0), fEtaMin(0), fEtaMax(0), fThetaMin(0), fThetaMax(0) {}
CellGeom_t(Float_t etaMin, Float_t etaMax, Float_t phiMin, Float_t phiMax) {Configure(etaMin, etaMax, phiMin, phiMax);}
virtual ~CellGeom_t() {}
void Configure(Float_t etaMin, Float_t etaMax, Float_t phiMin, Float_t phiMax);
Float_t EtaMin() const { return fEtaMin; }
Float_t EtaMax() const { return fEtaMax; }
Float_t Eta() const { return (fEtaMin+fEtaMax)*0.5f; }
Float_t EtaDelta() const { return fEtaMax-fEtaMin; }
Float_t PhiMin() const { return fPhiMin; }
Float_t PhiMax() const { return fPhiMax; }
Float_t Phi() const { return (fPhiMin+fPhiMax)*0.5f; }
Float_t PhiDelta() const { return fPhiMax-fPhiMin; }
Float_t ThetaMin() const { return fThetaMin; }
Float_t ThetaMax() const { return fThetaMax; }
Float_t Theta() const { return (fThetaMax+fThetaMin)*0.5f; }
Float_t ThetaDelta() const { return fThetaMax-fThetaMin; }
Bool_t IsUpperRho() const
{
const Float_t phi = Phi();
return ((phi > 0 && phi <= TMath::Pi()) || phi < - TMath::Pi());
}
virtual void Dump() const;
};
struct CellData_t : public CellGeom_t
{
// Cell data inner structure.
Float_t fValue;
CellData_t() : CellGeom_t(), fValue(0) {}
virtual ~CellData_t() {}
Float_t Value(Bool_t) const;
virtual void Dump() const;
};
struct RebinData_t
{
Int_t fNSlices;
std::vector<Float_t> fSliceData;
std::vector<Int_t> fBinData;
Float_t* GetSliceVals(Int_t bin);
void Clear()
{
fSliceData.clear();
fBinData.clear();
}
};
/**************************************************************************/
typedef std::vector<CellId_t> vCellId_t;
typedef std::vector<CellId_t>::iterator vCellId_i;
typedef std::vector<CellGeom_t> vCellGeom_t;
typedef std::vector<CellGeom_t>::iterator vCellGeom_i;
typedef std::vector<CellGeom_t>::const_iterator vCellGeom_ci;
private:
TEveCaloData(const TEveCaloData&); // Not implemented
TEveCaloData& operator=(const TEveCaloData&); // Not implemented
protected:
vSliceInfo_t fSliceInfos;
TAxis* fEtaAxis;
TAxis* fPhiAxis;
Bool_t fWrapTwoPi;
Float_t fMaxValEt; // cached
Float_t fMaxValE; // cached
Float_t fEps;
vCellId_t fCellsSelected;
vCellId_t fCellsHighlighted;
public:
TEveCaloData(const char* n="TEveCalData", const char* t="");
virtual ~TEveCaloData() {}
virtual void UnSelected();
virtual void UnHighlighted();
virtual TString GetHighlightTooltip();
virtual void FillImpliedSelectedSet(Set_t& impSelSet);
virtual void GetCellList(Float_t etaMin, Float_t etaMax,
Float_t phi, Float_t phiRng,
vCellId_t &out) const = 0;
vCellId_t& GetCellsSelected() { return fCellsSelected; }
vCellId_t& GetCellsHighlighted() { return fCellsHighlighted; }
void PrintCellsSelected();
void ProcessSelection(vCellId_t& sel_cells, TGLSelectRecord& rec);
virtual void Rebin(TAxis *ax, TAxis *ay, vCellId_t &in, Bool_t et, RebinData_t &out) const = 0;
virtual void GetCellData(const CellId_t &id, CellData_t& data) const = 0;
virtual void InvalidateUsersCellIdCache();
virtual void DataChanged();
virtual void CellSelectionChanged();
Int_t GetNSlices() const { return fSliceInfos.size(); }
SliceInfo_t& RefSliceInfo(Int_t s) { return fSliceInfos[s]; }
void SetSliceThreshold(Int_t slice, Float_t threshold);
Float_t GetSliceThreshold(Int_t slice) const;
void SetSliceColor(Int_t slice, Color_t col);
Color_t GetSliceColor(Int_t slice) const;
void SetSliceTransparency(Int_t slice, Char_t t);
Char_t GetSliceTransparency(Int_t slice) const;
virtual void GetEtaLimits(Double_t &min, Double_t &max) const = 0;
virtual void GetPhiLimits(Double_t &min, Double_t &max) const = 0;
virtual Float_t GetMaxVal(Bool_t et) const { return et ? fMaxValEt : fMaxValE; }
Bool_t Empty() const { return fMaxValEt < 1e-5; }
virtual TAxis* GetEtaBins() const { return fEtaAxis; }
virtual void SetEtaBins(TAxis* ax) { fEtaAxis=ax; }
virtual TAxis* GetPhiBins() const { return fPhiAxis; }
virtual void SetPhiBins(TAxis* ax) { fPhiAxis=ax; }
virtual Float_t GetEps() const { return fEps; }
virtual void SetEps(Float_t eps) { fEps=eps; }
Bool_t GetWrapTwoPi() const { return fWrapTwoPi; }
void SetWrapTwoPi(Bool_t w) { fWrapTwoPi=w; }
static Float_t EtaToTheta(Float_t eta);
ClassDef(TEveCaloData, 0); // Manages calorimeter event data.
};
/**************************************************************************/
/**************************************************************************/
class TEveCaloDataVec: public TEveCaloData
{
private:
TEveCaloDataVec(const TEveCaloDataVec&); // Not implemented
TEveCaloDataVec& operator=(const TEveCaloDataVec&); // Not implemented
protected:
typedef std::vector<Float_t> vFloat_t;
typedef std::vector<Float_t>::iterator vFloat_i;
typedef std::vector<vFloat_t> vvFloat_t;
typedef std::vector<vFloat_t>::iterator vvFloat_i;
vvFloat_t fSliceVec;
vCellGeom_t fGeomVec;
Int_t fTower; // current tower
Float_t fEtaMin;
Float_t fEtaMax;
Float_t fPhiMin;
Float_t fPhiMax;
public:
TEveCaloDataVec(Int_t nslices);
virtual ~TEveCaloDataVec();
Int_t AddSlice();
Int_t AddTower(Float_t etaMin, Float_t etaMax, Float_t phiMin, Float_t phiMax);
void FillSlice(Int_t slice, Float_t value);
void FillSlice(Int_t slice, Int_t tower, Float_t value);
Int_t GetNCells() { return fGeomVec.size(); }
std::vector<Float_t>& GetSliceVals(Int_t slice) { return fSliceVec[slice]; }
std::vector<TEveCaloData::CellGeom_t>& GetCellGeom() { return fGeomVec; }
virtual void GetCellList(Float_t etaMin, Float_t etaMax,
Float_t phi, Float_t phiRng,
vCellId_t &out) const;
virtual void Rebin(TAxis *ax, TAxis *ay, vCellId_t &in, Bool_t et, RebinData_t &out) const;
virtual void GetCellData(const TEveCaloData::CellId_t &id, TEveCaloData::CellData_t& data) const;
virtual void GetEtaLimits(Double_t &min, Double_t &max) const { min=fEtaMin, max=fEtaMax;}
virtual void GetPhiLimits(Double_t &min, Double_t &max) const { min=fPhiMin; max=fPhiMax;}
virtual void DataChanged();
void SetAxisFromBins(Double_t epsX=0.001, Double_t epsY=0.001);
ClassDef(TEveCaloDataVec, 0); // Manages calorimeter event data.
};
/**************************************************************************/
/**************************************************************************/
class TEveCaloDataHist: public TEveCaloData
{
private:
TEveCaloDataHist(const TEveCaloDataHist&); // Not implemented
TEveCaloDataHist& operator=(const TEveCaloDataHist&); // Not implemented
protected:
THStack* fHStack;
public:
TEveCaloDataHist();
virtual ~TEveCaloDataHist();
virtual void GetCellList( Float_t etaMin, Float_t etaMax,
Float_t phi, Float_t phiRng, vCellId_t &out) const;
virtual void Rebin(TAxis *ax, TAxis *ay, vCellId_t &in, Bool_t et, RebinData_t &out) const;
virtual void GetCellData(const TEveCaloData::CellId_t &id, TEveCaloData::CellData_t& data) const;
virtual void GetEtaLimits(Double_t &min, Double_t &max) const;
virtual void GetPhiLimits(Double_t &min, Double_t &max) const;
virtual void DataChanged();
THStack* GetStack() { return fHStack; }
TH2F* GetHist(Int_t slice) const;
Int_t AddHistogram(TH2F* hist);
ClassDef(TEveCaloDataHist, 0); // Manages calorimeter TH2F event data.
};
#endif
|