Fork me on GitHub

Changeset 2ca23b5 in git for display


Ignore:
Timestamp:
Oct 22, 2014, 10:30:47 PM (10 years ago)
Author:
Christophe Delaere <christophe.delaere@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
3f51314
Parents:
8b04b31
Message:

Started to work on the summary plots

Investigated the way to add a tab with summary plots. A new class is in
place (dummy for now) to manage these plots.
Other small changes: use the status bar, clean the maxPt for MET (easier
to change later on), filter GenParticles on status==1.

Location:
display
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • display/DelphesBranchElement.cc

    r8b04b31 r2ca23b5  
    2727
    2828// special case for calo towers
    29 template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color):DelphesBranchBase(name, branch, color) {
     29template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt):DelphesBranchBase(name, branch, color, maxPt) {
    3030    data_ = new DelphesCaloData(2);
    3131    data_->RefSliceInfo(0).Setup("ECAL", 0.1, kRed);
     
    4949
    5050// special case for element lists
    51 template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color):DelphesBranchBase(name, branch, color) {
     51template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt):DelphesBranchBase(name, branch, color, maxPt) {
    5252    data_ = new TEveElementList(name);
    5353    data_->SetMainColor(color_);
     
    7878    TEveArrow *eveMet;
    7979    // 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 GUI
    8280    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.);
    8482      eveMet->SetMainColor(GetColor());
    8583      eveMet->SetTubeR(0.04);
     
    9593
    9694// special case for track lists
    97 template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color):DelphesBranchBase(name, branch, color) {
     95template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt):DelphesBranchBase(name, branch, color, maxPt) {
    9896  data_ = new TEveTrackList(name);
    9997  data_->SetMainColor(color_);
     
    185183    GenParticle *particle;
    186184    while((particle = (GenParticle *) itTrack.Next())) {
     185      if(particle->Status != 1) continue;
    187186      TParticle pb(particle->PID, particle->Status, particle->M1, particle->M2, particle->D1, particle->D2,
    188187                   particle->P4().Px(), particle->P4().Py(),
  • display/DelphesBranchElement.h

    r8b04b31 r2ca23b5  
    3434{
    3535  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) {}
    3737    virtual ~DelphesBranchBase() {}
    3838    const char* GetName() const { return (const char*)name_; }
     
    4646  protected:
    4747    TString name_;
     48    Float_t maxPt_;
    4849    TClonesArray* branch_;
    4950    const enum EColor color_;
     
    5657  public:
    5758    // 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) {
    5960      throw std::exception();
    6061    }
     
    8586
    8687// special case for calo towers
    87 template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color);
     88template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt);
    8889template<> void DelphesBranchElement<DelphesCaloData>::Reset();
    8990template<> void DelphesBranchElement<DelphesCaloData>::ReadBranch();
    9091
    9192// special case for element lists
    92 template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color);
     93template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt);
    9394template<> void DelphesBranchElement<TEveElementList>::Reset();
    9495template<> void DelphesBranchElement<TEveElementList>::ReadBranch();
    9596
    9697// special case for track lists
    97 template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color);
     98template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt);
    9899template<> void DelphesBranchElement<TEveTrackList>::SetTrackingVolume(Float_t r, Float_t l, Float_t Bz);
    99100template<> void DelphesBranchElement<TEveTrackList>::Reset();
  • display/DelphesEventDisplay.cc

    r8b04b31 r2ca23b5  
    4545#include "TRootBrowser.h"
    4646#include "TGButton.h"
     47#include "TRootEmbeddedCanvas.h"
    4748#include "TClonesArray.h"
    4849#include "TEveEventManager.h"
     50#include "TCanvas.h"
     51#include "TH1F.h"
    4952
    5053DelphesEventDisplay::DelphesEventDisplay()
     
    8184   // initialize the application
    8285   TEveManager::Create(kTRUE, "IV");
     86   fStatusBar_ = gEve->GetBrowser()->GetStatusBar();
    8387   TGeoManager* geom = gGeoManager;
    8488
     
    108112
    109113   // Create object of class ExRootTreeReader
    110    printf("*** Opening Delphes data file ***\n");
     114   fStatusBar_->SetText("Opening Delphes data file", 1);
    111115   treeReader_ = new ExRootTreeReader(chain_);
    112116
     
    150154
    151155   //ready...
     156   fStatusBar_->SetText("Ready.", 1);
    152157   load_event();
    153158   gEve->Redraw3D(kTRUE);   
     
    235240   if(event_id_ >= treeReader_->GetEntries() || event_id_<0 ) return;
    236241
    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);
    239244
    240245   // clear the previous event
     
    257262   delphesDisplay_->ImportEventRhoZ(top);
    258263   update_html_summary();
     264   //TODO: update plot tab (show current event on top)
    259265
    260266   gEve->Redraw3D(kFALSE, kTRUE);
     267   fStatusBar_->SetText(Form("Loaded event %d.", event_id_), 1);
    261268}
    262269
     
    370377   TEveWindowFrame *wf = slot->MakeFrame(gHtml_);
    371378   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  
    2626#include "display/Delphes3DGeometry.h"
    2727#include "display/DelphesHtmlSummary.h"
     28#include "display/DelphesPlotSummary.h"
    2829#include "TChain.h"
    2930#include "TAxis.h"
    3031#include "TGHtml.h"
    3132#include "TClonesArray.h"
     33#include "TGStatusBar.h"
    3234
    3335/*
     
    6163    DelphesHtmlSummary *htmlSummary_;
    6264    TGHtml *gHtml_;
     65    DelphesPlotSummary *plotSummary_;
     66    TGStatusBar* fStatusBar_;
    6367
    6468    // gui controls
Note: See TracChangeset for help on using the changeset viewer.