#ifndef HKED_h #define HKED_h #include "HKEVInfo.h" #include "Picker.h" #include "hyperk_esd_html_summary.h" #include "TGHtml.h" #include #include #include #include #include #include #include #include #include #include #include #include "fitQunDisplay.h" #include /* Singleton class which control HyperK Event Display */ class HKED { private: static HKED * HKDisplayManager; static std::mutex mutex_; protected: HKED(); ~HKED() {} public: /** * HKEDs should not be cloneable. */ HKED(HKED &other) = delete; /** * HKEDs should not be assignable. */ void operator=(const HKED &) = delete; /** * This is the static method that controls the access to the HKED * instance. On the first run, it creates a HKED object and places it * into the static field. On subsequent runs, it returns the client existing * object stored in the static field. */ static HKED *GetInstance(); public: HKEVInfo *fHKEVInfo; HKEVInfo *fHKEVInfo2D; Picker *fPicker; Picker *fPicker2D; HtmlSummary *fgHtmlSummary; TGHtml *fgHtml; TEveGeoTopNode *geomRoot; WCSimRootGeom *wcsimrootgeom; WCSimRootEvent *wcsimrootEvent; WCSimRootTrigger *wcsimrootTrigger; TGeoVolume *WorldVolume; TGeoVolume *SimpleVolume; TEveElementList *FlatGeometry; TEveScene *UnrolledScene; TEveScene *flatGeometryScene; TEveViewer *UnrolledView; TEveRGBAPalette *fHitPalette{nullptr}; TEveRGBAPaletteOverlay *fPalletteOverlay{nullptr}; TGLAnnotation *fPaletteTitle{nullptr}; TGLAnnotation *fPaletteTitle2{nullptr}; TFile *WCSimFile{nullptr}; TTree *wcsimGeoT{nullptr}; TTree *wcsimT{nullptr}; TTree *fiTQunTree{nullptr}; int event_id; bool fFirstTime{kTRUE}; int fPredefinedPalette{kRainBow}; bool fAccumulateEvents{kFALSE}; fitQunDisplay fiTQun; float minTruthTrackEnergyToKeep{0.0}; float minTruthTrackEnergyToDraw{100.0}; bool fSimpleGeometry,fDigitIsTime; public: void InitialiseWCSim(TFile* WCSimFile ); void Setup(); void load_event(); void wcsim_load_event(int iTrigger,bool &firstTrackIsNeutrino,bool &secondTrackIsTarget ); void showTruthCones(bool drawThem); void update_html_summary(int iTrigger,WCSimRootTrigger * wcsimrootTrigger,bool firstTrackIsNeutrino,bool secondTrackIsTarget); void fitqun_load_event(); TString ParticleName(int pdgCode); void reload_wcsim_hits(); void reload_wcsim_hits(int iTrigger); void wcsim_load_cherenkov(int iTrigger); void wcsim_load_truth_tracks(int iTrigger,bool &firstTrackIsNeutrino,bool &secondTrackIsTarget); void PrintCherenkovHitInformation(Picker* picker,TEveDigitSet* ds, Int_t idx, TObject* obj); static void PrintCherenkovHitInformation3D(TEveDigitSet* ds, Int_t idx, TObject* obj); static void PrintCherenkovHitInformation2D(TEveDigitSet* ds, Int_t idx, TObject* obj); void ColourIsTimeBoxChanged(Bool_t s); void setDrawTruthCones(bool state){drawTruthCones=state;}; bool getDrawTruthCones(){return drawTruthCones;}; bool SwitchGeometry(); TString paletteText(); void reload_truth(); void SetLimits(float maxX, float maxY,float minZ,float maxZ, float maxR ) { this->maxX=maxX; this->maxY=maxY; this->minZ=minZ; this->maxZ=maxZ; this->maxR=maxR; } private: void selectTruthTrack(WCSimRootTrack * wcsimroottrack,bool& keep,bool& draw); void CartesianToPolar(double &mom,double &theta,double &phi,double p[3]); void make_gui(); TEveViewer* New2dView(TString name,TGLViewer::ECameraType type, TEveScene* scene); float TrackLength(double Start[3], float Stop[3]); float TrackLength(float Start[3], double Stop[3]); void FillStop(float Stop[3],WCSimRootTrack* wcsimroottrack); void FillStart(float Start[3],WCSimRootTrack* wcsimroottrack); float maxX,maxY,minZ,maxZ,maxR; bool drawTruthCones{kTRUE}; //TEveElementList *fTrueCones2D; }; #endif