Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to only store event if energy in a given region of space is above threshold #134

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions inc/TRestGeant4EventViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ class TRestGeant4EventViewer : public TRestEveEventViewer {
void DeleteCurrentEvent();
void AddEvent(TRestEvent* event);

void NextTrackVertex(Int_t trkID, TVector3 to);
void AddTrack(Int_t trkID, Int_t parentID, TVector3 from, TString name);
void AddParentTrack(Int_t trkID, TVector3 from, TString name);
void NextTrackVertex(Int_t trkID, const TVector3& to);
void AddTrack(Int_t trkID, Int_t parentID, const TVector3& from, const TString& name);
void AddParentTrack(Int_t trkID, const TVector3& from, const TString& name);

void AddText(TString text, TVector3 at);
void AddMarker(Int_t trkID, TVector3 at, TString name);
void AddText(const TString& text, const TVector3& at);
void AddMarker(Int_t trkID, const TVector3& at, const TString& name);

// Constructor
TRestGeant4EventViewer();
Expand Down
1 change: 1 addition & 0 deletions macros/REST_Geant4_ViewEvent.C
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "TRestBrowser.h"
#include "TRestGeant4Event.h"
#include "TRestTask.h"

#ifndef RestTask_ViewG4Events
Expand Down
25 changes: 12 additions & 13 deletions src/TRestGeant4EventViewer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
///
/// nov 2015: First concept
/// Viewer class for a TRestGeant4Event
/// Javier Galan/JuanAn Garcia
/// Javier Galan / JuanAn Garcia / Luis Obis
///_______________________________________________________________________________

#include "TRestGeant4EventViewer.h"
Expand All @@ -22,9 +22,7 @@ ClassImp(TRestGeant4EventViewer);

TRestGeant4EventViewer::TRestGeant4EventViewer() { Initialize(); }

TRestGeant4EventViewer::~TRestGeant4EventViewer() {
// TRestGeant4EventViewer destructor
}
TRestGeant4EventViewer::~TRestGeant4EventViewer() = default;

void TRestGeant4EventViewer::Initialize() {
fG4Event = new TRestGeant4Event();
Expand Down Expand Up @@ -232,8 +230,8 @@ void TRestGeant4EventViewer::AddEvent(TRestEvent* event) {
Update();
}

void TRestGeant4EventViewer::AddText(TString text, TVector3 at) {
TEveText* evText = new TEveText(text);
void TRestGeant4EventViewer::AddText(const TString& text, const TVector3& at) {
auto evText = new TEveText(text);
evText->SetName("Event title");
evText->SetFontSize(12);
evText->RefMainTrans().SetPos((at.X() + 15) * fGeomScale, (at.Y() + 15) * fGeomScale,
Expand All @@ -242,8 +240,8 @@ void TRestGeant4EventViewer::AddText(TString text, TVector3 at) {
gEve->AddElement(evText);
}

void TRestGeant4EventViewer::AddMarker(Int_t trkID, TVector3 at, TString name) {
TEvePointSet* marker = new TEvePointSet(1);
void TRestGeant4EventViewer::AddMarker(Int_t trkID, const TVector3& at, const TString& name) {
auto marker = new TEvePointSet(1);
marker->SetName(name);
marker->SetMarkerColor(kMagenta);
marker->SetMarkerStyle(3);
Expand All @@ -252,12 +250,13 @@ void TRestGeant4EventViewer::AddMarker(Int_t trkID, TVector3 at, TString name) {
fHitConnectors[trkID]->AddElement(marker);
}

void TRestGeant4EventViewer::NextTrackVertex(Int_t trkID, TVector3 to) {
void TRestGeant4EventViewer::NextTrackVertex(Int_t trkID, const TVector3& to) {
fHitConnectors[trkID]->SetNextPoint(to.X() * fGeomScale, to.Y() * fGeomScale, to.Z() * fGeomScale);
}

void TRestGeant4EventViewer::AddTrack(Int_t trkID, Int_t parentID, TVector3 from, TString name) {
TEveLine* evLine = new TEveLine();
void TRestGeant4EventViewer::AddTrack(Int_t trkID, Int_t parentID, const TVector3& from,
const TString& name) {
auto evLine = new TEveLine();
evLine->SetName(name);
fHitConnectors.push_back(evLine);

Expand All @@ -281,8 +280,8 @@ void TRestGeant4EventViewer::AddTrack(Int_t trkID, Int_t parentID, TVector3 from
}
}

void TRestGeant4EventViewer::AddParentTrack(Int_t trkID, TVector3 from, TString name) {
TEveLine* evLine = new TEveLine();
void TRestGeant4EventViewer::AddParentTrack(Int_t trkID, const TVector3& from, const TString& name) {
auto evLine = new TEveLine();
evLine->SetName(name);
fHitConnectors.push_back(evLine);

Expand Down
Loading