15#include "TRestDetectorHitsEventViewer.h"
22TRestDetectorHitsEventViewer::TRestDetectorHitsEventViewer() { Initialize(); }
24TRestDetectorHitsEventViewer::~TRestDetectorHitsEventViewer() {
28void TRestDetectorHitsEventViewer::Initialize() {
33void TRestDetectorHitsEventViewer::DeleteCurrentEvent() {
34 TRestEveEventViewer::DeleteCurrentEvent();
35 cout <<
"Removing event" << endl;
38void TRestDetectorHitsEventViewer::AddEvent(
TRestEvent* ev) {
43 Double_t eDepMin = 1.e6;
45 Double_t totalEDep = 0;
47 for (
unsigned int hit = 0; hit < fHitsEvent->GetNumberOfHits(); hit++) {
48 Double_t eDep = fHitsEvent->GetEnergy(hit);
49 if (eDep > eDepMax) eDepMax = eDep;
50 if (eDep < eDepMin) eDepMin = eDep;
55 if (eDepMin == eDepMax)
58 slope = (fMaxRadius - fMinRadius) / (eDepMax - eDepMin);
60 Double_t bias = fMinRadius - slope * eDepMin;
62 for (
unsigned int hit = 0; hit < fHitsEvent->GetNumberOfHits(); hit++) {
63 Float_t x = fHitsEvent->
GetX(hit);
64 Float_t y = fHitsEvent->
GetY(hit);
65 Float_t energy = fHitsEvent->GetEnergy(hit);
66 Float_t z = fHitsEvent->
GetZ(hit);
68 Float_t radius = slope * energy + bias;
74 AddSphericalHit(x, y, z, radius, energy);
Double_t GetX(int n) const
Returns the X-coordinate of hit entry n in mm.
Double_t GetY(int n) const
Returns the Y-coordinate of hit entry n in mm.
Double_t GetZ(int n) const
Returns the Z-coordinate of hit entry n in mm.
A base class for any REST event.