Fork me on GitHub

source: git/display/DelphesBranchElement.cc@ fafc433

ImprovedOutputFile Timing dual_readout llp
Last change on this file since fafc433 was a3b2495, checked in by Christophe Delaere <christophe.delaere@…>, 10 years ago

Display of automatically selected elements working

The original features are back, but with a much more flexible code that
selects automatically the list of branches from the tcl file. The main
issue left is the GUI (handler not found), and then some more
cleaning. One idea is to further exploit templating to avoid ifs when
leading events.

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/*
2 * Delphes: a framework for fast simulation of a generic collider experiment
3 * Copyright (C) 2012-2014 Universite catholique de Louvain (UCL), Belgium
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#include "display/DelphesBranchElement.h"
20
21// special case for calo towers
22template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
23 if(TString(type)=="tower") {
24 data_ = new DelphesCaloData(2);
25 data_->RefSliceInfo(0).Setup("ECAL", 0.1, kRed);
26 data_->RefSliceInfo(1).Setup("HCAL", 0.1, kBlue);
27 data_->IncDenyDestroy();
28 } else {
29 throw std::exception();
30 }
31 }
32template<> void DelphesBranchElement<DelphesCaloData>::Reset() { data_->ClearTowers(); }
33
34// special case for element lists
35template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
36 if(TString(type)=="vector" || TString(type)=="jet") {
37 data_ = new TEveElementList(name);
38 data_->SetMainColor(color_);
39 } else {
40 throw std::exception();
41 }
42 }
43template<> void DelphesBranchElement<TEveElementList>::Reset() { data_->DestroyElements(); }
44
45//TODO: does the type really make sense?
46// special case for track lists
47template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
48 if(TString(type)=="track") {
49 data_ = new TEveTrackList(name);
50 data_->SetMainColor(color_);
51 data_->SetMarkerColor(color_);
52 data_->SetMarkerStyle(kCircle);
53 data_->SetMarkerSize(0.5);
54 } else if(TString(type)=="photon") {
55 data_ = new TEveTrackList(name);
56 data_->SetMainColor(color_);
57 data_->SetMarkerColor(color_);
58 data_->SetMarkerStyle(kCircle);
59 data_->SetMarkerSize(0.5);
60 } else {
61 data_ = new TEveTrackList(name);
62 data_->SetMainColor(color_);
63 data_->SetMarkerColor(color_);
64 data_->SetMarkerStyle(kCircle);
65 data_->SetMarkerSize(0.5);
66 //throw std::exception();
67 }
68 }
69template<> void DelphesBranchElement<TEveTrackList>::Reset() { data_->DestroyElements(); }
70
Note: See TracBrowser for help on using the repository browser.