/* * Delphes: a framework for fast simulation of a generic collider experiment * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "display/DelphesHtmlSummary.h" #include "TEveElement.h" #include "TEveEventManager.h" #include "TEveManager.h" #include "TEvePointSet.h" #include "TEveTrack.h" #include "TGHtml.h" //============================================================================== DelphesHtmlSummary *fgDelphesHtmlSummary = 0; TGHtml *fgHtml = 0; //============================================================================== //______________________________________________________________________________ DelphesHtmlObjTable::DelphesHtmlObjTable(const char *name, Int_t nfields, Int_t nvals, Bool_t exp) : fName(name), fNValues(nvals), fNFields(nfields), fExpand(exp) { // Constructor. fValues = new TArrayF[fNFields]; for(int i = 0; i < fNFields; i++) fValues[i].Set(nvals); fLabels = new TString[fNFields]; } //______________________________________________________________________________ DelphesHtmlObjTable::~DelphesHtmlObjTable() { // Destructor. delete[] fValues; delete[] fLabels; } //______________________________________________________________________________ void DelphesHtmlObjTable::Build() { // Build HTML code. fHtml = " ", BuildTitle(); if(fExpand && (fNFields > 0) && (fNValues > 0)) { BuildLabels(); BuildTable(); } fHtml += "
"; } //______________________________________________________________________________ void DelphesHtmlObjTable::BuildTitle() { // Build table title. fHtml += "", fNFields + 1); fHtml += ""; fHtml += ""; fHtml += ""; fHtml += "
"; fHtml += ""; fHtml += fName; fHtml += ""; fHtml += " "; fHtml += ""; fHtml += Form("Size = %d", fNValues); fHtml += "
"; fHtml += ""; } //______________________________________________________________________________ void DelphesHtmlObjTable::BuildLabels() { // Build table labels. Int_t i; fHtml += ""; fHtml += " "; // for the check boxes for(i = 0; i < fNFields; i++) { fHtml += " "; fHtml += fLabels[i]; fHtml += " "; // for the check boxes } fHtml += ""; } //______________________________________________________________________________ void DelphesHtmlObjTable::BuildTable() { // Build part of table with values. for(int i = 0; i < fNValues; i++) { if(i % 2) fHtml += ""; else fHtml += ""; TString name = fName; name.ReplaceAll(" ", "_"); // checkboxes fHtml += ""; fHtml += "", i); fHtml += ""; for(int j = 0; j < fNFields; j++) { fHtml += "AddFirst(table); else fObjTables->Add(table); return table; } //______________________________________________________________________________ void DelphesHtmlSummary::Clear(Option_t *option) { // Clear the table list. if(option && option[0] == 'D') fObjTables->Delete(option); else fObjTables->Clear(option); fNTables = 0; } //______________________________________________________________________________ void DelphesHtmlSummary::Reset(Option_t *) { // Reset (delete) the table list; delete fObjTables; fObjTables = 0; fNTables = 0; } //______________________________________________________________________________ void DelphesHtmlSummary::Build() { // Build the summary. MakeHeader(); for(int i = 0; i < fNTables; i++) { GetTable(i)->Build(); fHtml += GetTable(i)->Html(); } MakeFooter(); } //______________________________________________________________________________ void DelphesHtmlSummary::MakeHeader() { // Make HTML header. fHeader = ""; fHeader += fTitle; fHeader += ""; fHeader += "

"; fHeader += fTitle; fHeader += "

"; fHtml = fHeader; } //______________________________________________________________________________ void DelphesHtmlSummary::MakeFooter() { // Make HTML footer. fFooter = "


"; fFooter += "Example of using Html widget to display tabular data"; fFooter += "
"; fFooter += "(c) 2007-2010 Bertrand Bellenot"; fFooter += "
"; fHtml += fFooter; }