Fork me on GitHub

Ignore:
Timestamp:
Oct 15, 2014, 2:09:13 AM (10 years ago)
Author:
Christophe Delaere <christophe.delaere@…>
Branches:
ImprovedOutputFile, Timing, dual_readout, llp, master
Children:
b3c42d3
Parents:
5bb66c9
Message:

Working classes for automatic parsing of branches

Slightly less elegant, but it works.
The code in geometry.C is able to call the new methods and classes but
doesn't use it yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • display/DelphesBranchElement.cc

    r5bb66c9 r115298d  
    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
    22 template<> 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     }
    32 template<> void DelphesBranchElement<DelphesCaloData>::Reset() { data_->ClearTowers(); }
    33 
    34 // special case for element lists
    35 template<> 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     }
    43 template<> void DelphesBranchElement<TEveElementList>::Reset() { data_->DestroyElements(); }
    44 
    45 // special case for track lists
    46 template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
    47       if(TString(type)=="track") {
    48         data_ = new TEveTrackList(name);
    49         data_->SetMainColor(color_);
    50         data_->SetMarkerColor(color_);
    51         data_->SetMarkerStyle(kCircle);
    52         data_->SetMarkerSize(0.5);
    53       } else if(TString(type)=="photon") {
    54         data_ = new TEveTrackList(name);
    55         data_->SetMainColor(color_);
    56         data_->SetMarkerColor(color_);
    57         data_->SetMarkerStyle(kCircle);
    58         data_->SetMarkerSize(0.5);
    59       } else {
    60         throw std::exception();
    61       }
    62     }
    63 template<> void DelphesBranchElement<TEveTrackList>::Reset() { data_->DestroyElements(); }
    64 
Note: See TracChangeset for help on using the changeset viewer.