Changeset 2ca23b5 in git
- Timestamp:
- Oct 22, 2014, 10:30:47 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 3f51314
- Parents:
- 8b04b31
- Location:
- display
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
display/DelphesBranchElement.cc
r8b04b31 r2ca23b5 27 27 28 28 // special case for calo towers 29 template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color ):DelphesBranchBase(name, branch, color) {29 template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt):DelphesBranchBase(name, branch, color, maxPt) { 30 30 data_ = new DelphesCaloData(2); 31 31 data_->RefSliceInfo(0).Setup("ECAL", 0.1, kRed); … … 49 49 50 50 // special case for element lists 51 template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color ):DelphesBranchBase(name, branch, color) {51 template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt):DelphesBranchBase(name, branch, color, maxPt) { 52 52 data_ = new TEveElementList(name); 53 53 data_->SetMainColor(color_); … … 78 78 TEveArrow *eveMet; 79 79 // Missing Et 80 Double_t maxPt = 50.;81 // TODO to be changed as we don't have access to maxPt anymore. MET scale could be a general parameter set in GUI82 80 while((MET = (MissingET*) itMet.Next())) { 83 eveMet = new TEveArrow((tkRadius_ * MET->MET/maxPt )*cos(MET->Phi), (tkRadius_ * MET->MET/maxPt)*sin(MET->Phi), 0., 0., 0., 0.);81 eveMet = new TEveArrow((tkRadius_ * MET->MET/maxPt_)*cos(MET->Phi), (tkRadius_ * MET->MET/maxPt_)*sin(MET->Phi), 0., 0., 0., 0.); 84 82 eveMet->SetMainColor(GetColor()); 85 83 eveMet->SetTubeR(0.04); … … 95 93 96 94 // special case for track lists 97 template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color ):DelphesBranchBase(name, branch, color) {95 template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt):DelphesBranchBase(name, branch, color, maxPt) { 98 96 data_ = new TEveTrackList(name); 99 97 data_->SetMainColor(color_); … … 185 183 GenParticle *particle; 186 184 while((particle = (GenParticle *) itTrack.Next())) { 185 if(particle->Status != 1) continue; 187 186 TParticle pb(particle->PID, particle->Status, particle->M1, particle->M2, particle->D1, particle->D2, 188 187 particle->P4().Px(), particle->P4().Py(), -
display/DelphesBranchElement.h
r8b04b31 r2ca23b5 34 34 { 35 35 public: 36 DelphesBranchBase(const char* name="", TClonesArray* branch=NULL, const enum EColor color=kBlack ):name_(name),branch_(branch),color_(color) {}36 DelphesBranchBase(const char* name="", TClonesArray* branch=NULL, const enum EColor color=kBlack, Float_t maxPt=50.):name_(name),branch_(branch),color_(color) {} 37 37 virtual ~DelphesBranchBase() {} 38 38 const char* GetName() const { return (const char*)name_; } … … 46 46 protected: 47 47 TString name_; 48 Float_t maxPt_; 48 49 TClonesArray* branch_; 49 50 const enum EColor color_; … … 56 57 public: 57 58 // constructor 58 DelphesBranchElement(const char* name="", TClonesArray* branch=NULL, const enum EColor color=kBlack ):DelphesBranchBase(name, branch, color) {59 DelphesBranchElement(const char* name="", TClonesArray* branch=NULL, const enum EColor color=kBlack, Float_t maxPt=50.):DelphesBranchBase(name, branch, color, maxPt) { 59 60 throw std::exception(); 60 61 } … … 85 86 86 87 // special case for calo towers 87 template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color );88 template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt); 88 89 template<> void DelphesBranchElement<DelphesCaloData>::Reset(); 89 90 template<> void DelphesBranchElement<DelphesCaloData>::ReadBranch(); 90 91 91 92 // special case for element lists 92 template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color );93 template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt); 93 94 template<> void DelphesBranchElement<TEveElementList>::Reset(); 94 95 template<> void DelphesBranchElement<TEveElementList>::ReadBranch(); 95 96 96 97 // special case for track lists 97 template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color );98 template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt); 98 99 template<> void DelphesBranchElement<TEveTrackList>::SetTrackingVolume(Float_t r, Float_t l, Float_t Bz); 99 100 template<> void DelphesBranchElement<TEveTrackList>::Reset(); -
display/DelphesEventDisplay.cc
r8b04b31 r2ca23b5 45 45 #include "TRootBrowser.h" 46 46 #include "TGButton.h" 47 #include "TRootEmbeddedCanvas.h" 47 48 #include "TClonesArray.h" 48 49 #include "TEveEventManager.h" 50 #include "TCanvas.h" 51 #include "TH1F.h" 49 52 50 53 DelphesEventDisplay::DelphesEventDisplay() … … 81 84 // initialize the application 82 85 TEveManager::Create(kTRUE, "IV"); 86 fStatusBar_ = gEve->GetBrowser()->GetStatusBar(); 83 87 TGeoManager* geom = gGeoManager; 84 88 … … 108 112 109 113 // Create object of class ExRootTreeReader 110 printf("*** Opening Delphes data file ***\n");114 fStatusBar_->SetText("Opening Delphes data file", 1); 111 115 treeReader_ = new ExRootTreeReader(chain_); 112 116 … … 150 154 151 155 //ready... 156 fStatusBar_->SetText("Ready.", 1); 152 157 load_event(); 153 158 gEve->Redraw3D(kTRUE); … … 235 240 if(event_id_ >= treeReader_->GetEntries() || event_id_<0 ) return; 236 241 237 // TODO move this to the status bar ???238 printf("Loading event %d.\n", event_id_);242 // message 243 fStatusBar_->SetText(Form("Loading event %d.", event_id_), 1); 239 244 240 245 // clear the previous event … … 257 262 delphesDisplay_->ImportEventRhoZ(top); 258 263 update_html_summary(); 264 //TODO: update plot tab (show current event on top) 259 265 260 266 gEve->Redraw3D(kFALSE, kTRUE); 267 fStatusBar_->SetText(Form("Loaded event %d.", event_id_), 1); 261 268 } 262 269 … … 370 377 TEveWindowFrame *wf = slot->MakeFrame(gHtml_); 371 378 gHtml_->MapSubwindows(); 372 wf->SetElementName("Summary"); 373 374 } 375 379 wf->SetElementName("Summary tables"); 380 381 // plot tab 382 slot = TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight()); 383 TEveWindowTab* tab = slot->MakeTab(); 384 tab->SetElementName("Summary plots"); 385 tab->SetShowTitleBar(kFALSE); 386 plotSummary_ = new DelphesPlotSummary(tab); 387 plotSummary_->Init(elements_); 388 plotSummary_->FillSample(treeReader_); //TODO later, control it via a GUI button. 389 plotSummary_->FillEvent(); //TODO later move to event loop 390 391 //for test 392 TH1F* h; 393 TRootEmbeddedCanvas* trec; 394 TCanvas* gCanvas_; 395 396 slot = tab->NewSlot(); 397 trec = new TRootEmbeddedCanvas(); 398 gCanvas_ = trec->GetCanvas(); 399 wf = slot->MakeFrame(trec); 400 wf->SetElementName("Tracks"); 401 h = new TH1F("tracks","tracks",100,0,100); 402 gCanvas_->cd(); 403 h->Draw(); 404 405 slot = tab->NewSlot(); 406 trec = new TRootEmbeddedCanvas(); 407 gCanvas_ = trec->GetCanvas(); 408 wf = slot->MakeFrame(trec); 409 wf->SetElementName("Electrons"); 410 h = new TH1F("electrons","electrons",100,0,100); 411 gCanvas_->cd(); 412 h->Draw(); 413 414 // TODO: here we have, for each collection, Pt,Eta,Phi for all, leading, subleading 415 // for each event, we will then add a marker with the current value and/or a histo for current event. 416 // this means to create one tab with subtabs (one per collection). 417 418 } 419 -
display/DelphesEventDisplay.h
r8b04b31 r2ca23b5 26 26 #include "display/Delphes3DGeometry.h" 27 27 #include "display/DelphesHtmlSummary.h" 28 #include "display/DelphesPlotSummary.h" 28 29 #include "TChain.h" 29 30 #include "TAxis.h" 30 31 #include "TGHtml.h" 31 32 #include "TClonesArray.h" 33 #include "TGStatusBar.h" 32 34 33 35 /* … … 61 63 DelphesHtmlSummary *htmlSummary_; 62 64 TGHtml *gHtml_; 65 DelphesPlotSummary *plotSummary_; 66 TGStatusBar* fStatusBar_; 63 67 64 68 // gui controls
Note:
See TracChangeset
for help on using the changeset viewer.