Fork me on GitHub

Changeset 115298d in git


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.

Files:
4 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 
  • display/DelphesBranchElement.h

    r5bb66c9 r115298d  
    3131{
    3232  public:
    33     DelphesBranchBase(const char* name="", const char*type="", const enum EColor color=kBlack):name_(name),type_(type),color_(color) {}
     33    DelphesBranchBase():color_(kBlack) {}
     34    DelphesBranchBase(const char* name, const char*type, const enum EColor color):name_(name),type_(type),color_(color) {}
    3435    virtual ~DelphesBranchBase() {};
    3536    const char* GetName() const { return (const char*)name_; }
     
    5051  public:
    5152    // constructor
    52     DelphesBranchElement(const char* name="", const char*type="", const enum EColor color=kBlack):DelphesBranchBase(name, type, color) {
    53       throw std::exception();
    54     }
     53    DelphesBranchElement():DelphesBranchBase() {}
     54    DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {}
    5555
    5656    // destructor
     
    6161
    6262    // resets the collection (before moving to the next event)
    63     virtual void Reset() {};
     63    virtual void Reset() = 0;
    6464
    6565    // template class name
     
    7171
    7272// special case for calo towers
    73 template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, const char*type, const enum EColor color);
    74 template<> void DelphesBranchElement<DelphesCaloData>::Reset();
     73template<> class DelphesBranchElement<DelphesCaloData>: public DelphesBranchBase
     74{
     75  public:
     76    // constructor
     77    DelphesBranchElement():DelphesBranchBase() {}
     78    DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
     79      if(TString(type)=="tower") {
     80        data_ = new DelphesCaloData(2);
     81        data_->RefSliceInfo(0).Setup("ECAL", 0.1, kRed);
     82        data_->RefSliceInfo(1).Setup("HCAL", 0.1, kBlue);
     83        data_->IncDenyDestroy();
     84      } else {
     85        throw std::exception();
     86      }
     87    }
     88
     89    // destructor
     90    virtual ~DelphesBranchElement() { delete data_; }
     91
     92    // get the container (ElementList, TrackList, or CaloData)
     93    DelphesCaloData* GetContainer() { return data_; }
     94
     95    // resets the collection (before moving to the next event)
     96    virtual void Reset() { data_->ClearTowers(); }
     97
     98    // template class name
     99    virtual const char* GetClassName() { return data_->ClassName(); }
     100
     101  private:
     102    DelphesCaloData* data_;
     103};
     104//template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, const char*type, const enum EColor color);
     105//template<> void DelphesBranchElement<DelphesCaloData>::Reset();
    75106
    76107// special case for element lists
    77 template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color);
    78 template<> void DelphesBranchElement<TEveElementList>::Reset();
     108template<> class DelphesBranchElement<TEveElementList>: public DelphesBranchBase
     109{
     110  public:
     111    // constructor
     112    DelphesBranchElement():DelphesBranchBase() {}
     113    DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
     114      if(TString(type)=="vector" || TString(type)=="jet") {
     115        data_ = new TEveElementList(name);
     116        data_->SetMainColor(color_);
     117      } else {
     118        throw std::exception();
     119      }
     120    }
     121
     122    // destructor
     123    virtual ~DelphesBranchElement() { delete data_; }
     124
     125    // get the container (ElementList, TrackList, or CaloData)
     126    TEveElementList* GetContainer() { return data_; }
     127
     128    // resets the collection (before moving to the next event)
     129    virtual void Reset() { data_->DestroyElements(); }
     130
     131    // template class name
     132    virtual const char* GetClassName() { return data_->ClassName(); }
     133
     134  private:
     135    TEveElementList* data_;
     136};
     137//template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color);
     138//template<> void DelphesBranchElement<TEveElementList>::Reset();
    79139
    80140// special case for track lists
    81 template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color);
    82 template<> void DelphesBranchElement<TEveTrackList>::Reset();
     141template<> class DelphesBranchElement<TEveTrackList>: public DelphesBranchBase
     142{
     143  public:
     144    // constructor
     145    DelphesBranchElement():DelphesBranchBase() {}
     146    DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
     147      if(TString(type)=="track") {
     148        data_ = new TEveTrackList(name);
     149        data_->SetMainColor(color_);
     150        data_->SetMarkerColor(color_);
     151        data_->SetMarkerStyle(kCircle);
     152        data_->SetMarkerSize(0.5);
     153      } else if(TString(type)=="photon") {
     154        data_ = new TEveTrackList(name);
     155        data_->SetMainColor(color_);
     156        data_->SetMarkerColor(color_);
     157        data_->SetMarkerStyle(kCircle);
     158        data_->SetMarkerSize(0.5);
     159      } else {
     160        throw std::exception();
     161      }
     162    }
     163
     164    // destructor
     165    virtual ~DelphesBranchElement() { delete data_; }
     166
     167    // get the container (ElementList, TrackList, or CaloData)
     168    TEveTrackList* GetContainer() { return data_; }
     169
     170    // resets the collection (before moving to the next event)
     171    virtual void Reset() { data_->DestroyElements(); }
     172
     173    // template class name
     174    virtual const char* GetClassName() { return data_->ClassName(); }
     175
     176  private:
     177    TEveTrackList* data_;
     178};
     179//template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color);
     180//template<> void DelphesBranchElement<TEveTrackList>::Reset();
    83181
    84182#endif //DelphesBranchElement_h
  • display/DisplayLinkDef.h

    r5bb66c9 r115298d  
    4242#pragma link C++ class DelphesDisplay+;
    4343#pragma link C++ class DelphesCaloData+;
    44 #pragma link C++ class DelphesBranchElement<DelphesCaloData>-!;
    45 #pragma link C++ class DelphesBranchElement<TEveElementList>-!;
    46 #pragma link C++ class DelphesBranchElement<TEveTrackList>-!;
     44//#pragma link C++ function DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char*, const char*, const enum EColor);
     45//#pragma link C++ function DelphesBranchElement<DelphesCaloData>::Reset();
     46#pragma link C++ class DelphesBranchElement<DelphesCaloData>;
     47#pragma link C++ class DelphesBranchElement<TEveElementList>;
     48#pragma link C++ class DelphesBranchElement<TEveTrackList>;
    4749
    4850#endif
  • examples/geometry.C

    r5bb66c9 r115298d  
    1919//#include "display/DelphesCaloData.h"
    2020//#include "display/DelphesDisplay.h"
     21//#include "display/DelphesBranchElement.h"
    2122//#include "classes/DelphesClasses.h"
    2223#include "TF2.h"
     
    498499/******************************************************************************/
    499500
     501// function that parses the config to extract the branches of interest and prepare containers
     502void readConfig(const char *configFile, Delphes3DGeometry& det3D, std::vector<DelphesBranchBase*>& elements, std::vector<TClonesArray*>& arrays) {
     503   ExRootConfReader *confReader = new ExRootConfReader;
     504   confReader->ReadFile(configFile);
     505   Double_t tk_radius = det3D.getTrackerRadius();
     506   Double_t tk_length = det3D.getTrackerHalfLength();
     507   Double_t tk_Bz     = det3D.getBField();
     508   Double_t mu_radius = det3D.getDetectorRadius();
     509   Double_t mu_length = det3D.getDetectorHalfLength();
     510   TAxis*   etaAxis   = det3D.getCaloAxes().first;
     511   TAxis*   phiAxis   = det3D.getCaloAxes().second;
     512   ExRootConfParam branches = confReader->GetParam("TreeWriter::Branch");
     513   Int_t nBranches = branches.GetSize()/3;
     514   DelphesBranchElement<TEveTrackList>* tlist;
     515   DelphesBranchElement<DelphesCaloData>* clist;
     516   DelphesBranchElement<TEveTrackList>* elist;
     517   for(Int_t b = 0; b<nBranches; ++b) {
     518     TString input = branches[b*3].GetString();
     519     TString name = branches[b*3+1].GetString();
     520     TString className = branches[b*3+2].GetString();
     521     if(className=="Track") {
     522       if(input.Contains("eflow",TString::kIgnoreCase) || name.Contains("eflow",TString::kIgnoreCase)) continue; //no eflow
     523       elist = new DelphesBranchElement<TEveTrackList>(name,"track",kBlue);
     524       elements.push_back(elist);
     525       TEveTrackPropagator *trkProp = elist->GetContainer()->GetPropagator();
     526       trkProp->SetMagField(0., 0., -tk_Bz);
     527       trkProp->SetMaxR(tk_radius);
     528       trkProp->SetMaxZ(tk_length);
     529     } else if(className=="Tower") {
     530       if(input.Contains("eflow",TString::kIgnoreCase) || name.Contains("eflow",TString::kIgnoreCase)) continue; //no eflow
     531       clist = new DelphesBranchElement<DelphesCaloData>(name,"tower",kBlack);
     532       clist->GetContainer()->SetEtaBins(etaAxis);
     533       clist->GetContainer()->SetPhiBins(phiAxis);
     534       elements.push_back(clist);
     535     } else if(className=="Jet") {
     536       if(input.Contains("GenJetFinder")) {
     537         elist = new DelphesBranchElement<TEveElementList>(name,"jet",kCyan);
     538         elist->GetContainer()->SetRnrSelf(false);
     539         elist->GetContainer()->SetRnrChildren(false);
     540         elements.push_back(elist);
     541       } else {
     542         elements.push_back(new DelphesBranchElement<TEveElementList>(name,"jet",kYellow));
     543       }
     544     } else if(className=="Electron") {
     545       tlist = new DelphesBranchElement<TEveTrackList>(name,"track",kRed);
     546       elements.push_back(tlist);
     547       TEveTrackPropagator *trkProp = tlist->GetContainer()->GetPropagator();
     548       trkProp->SetMagField(0., 0., -tk_Bz);
     549       trkProp->SetMaxR(tk_radius);
     550       trkProp->SetMaxZ(tk_length);
     551     } else if(className=="Photon") {
     552       tlist = new DelphesBranchElement<TEveTrackList>(name,"photon",kYellow);
     553       elements.push_back(tlist);
     554       TEveTrackPropagator *trkProp = tlist->GetContainer()->GetPropagator();
     555       trkProp->SetMagField(0., 0., 0.);
     556       trkProp->SetMaxR(tk_radius);
     557       trkProp->SetMaxZ(tk_length);
     558     } else if(className=="Muon") {
     559       tlist = new DelphesBranchElement<TEveTrackList>(name,"track",kGreen);
     560       elements.push_back(tlist);
     561       TEveTrackPropagator *trkProp = tlist->GetContainer()->GetPropagator();
     562       trkProp->SetMagField(0., 0., -tk_Bz);
     563       trkProp->SetMaxR(mu_radius);
     564       trkProp->SetMaxZ(mu_length);
     565     } else if(className=="MissingET") {
     566       elements.push_back(new DelphesBranchElement<TEveElementList>(name,"vector",kViolet));
     567     } else if(className=="GenParticle") {
     568       tlist = new DelphesBranchElement<TEveTrackList>(name,"track",kCyan);
     569       elements.push_back(tlist);
     570       tlist->GetContainer()->SetRnrSelf(false);
     571       tlist->GetContainer()->SetRnrChildren(false);
     572       TEveTrackPropagator *trkProp = tlist->GetContainer()->GetPropagator();
     573       trkProp->SetMagField(0., 0., -tk_Bz);
     574       trkProp->SetMaxR(tk_radius);
     575       trkProp->SetMaxZ(tk_length);
     576     }
     577     arrays.push_back(gTreeReader->UseBranch(name));
     578   }
     579}
     580
    500581void delphes_event_display(const char *configFile, const char *inputFile, Delphes3DGeometry& det3D)
    501582{
     
    513594   gPhiAxis = det3D.getCaloAxes().second;
    514595
     596   //TODO specific to some classical detector... could use better the det3D
    515597   TGeoVolume* top = det3D.getDetector(false);
    516598   geom->SetTopVolume(top);
     
    553635   std::vector<DelphesBranchBase*> elements;
    554636   std::vector<TClonesArray*> arrays;
    555    //readConfig(configFile, det3D, elements, arrays);
     637   readConfig(configFile, det3D, elements, arrays);
    556638   // Get pointers to branches
    557 //TODO make it configurable, for more objects (or can we guess from the config?)
     639   // TODO not needed. use arrays above.
    558640   gBranchTower  = gTreeReader->UseBranch("Tower");
    559641   gBranchTrack  = gTreeReader->UseBranch("Track");
     
    566648
    567649   // data
     650   // TODO not needed. use elements above
    568651   gCaloData = new DelphesCaloData(2);
    569652   gCaloData->RefSliceInfo(0).Setup("ECAL", 0.1, kRed);
     
    586669   gMetList->SetMainColor(kViolet);
    587670   gEve->AddElement(gMetList);
    588 //   gMet = new TEveArrow(1., 0., 0., 0., 0., 0.);
    589 //   gMet->SetMainColor(kViolet);
    590 //   gMet->SetTubeR(0.02);
    591 //   gMet->SetPickable(kTRUE);
    592 //   gMet->SetName("Missing Et");
    593 //   gEve->GetCurrentEvent()->AddElement(gMet);
    594671
    595672   TEveTrackPropagator *trkProp;
     
    675752   gEve->GetViewers()->DeleteAnnotations();
    676753
     754   //TODO use the elements vector and call Reset for all
    677755   if(gCaloData) gCaloData->ClearTowers();
    678756   if(gJetList) gJetList->DestroyElements();
     
    700778{
    701779
     780  //TODO use the existing arrays in std loop.
    702781  TIter itTower(gBranchTower);
    703782  TIter itTrack(gBranchTrack);
     
    730809  // Load selected branches with data from specified event
    731810  gTreeReader->ReadEntry(event_id);
     811
     812
     813  //TODO the code below should go in small methods.
     814  //it's maybe time to convert that in a class.
    732815
    733816  // Loop over all towers
     
    9621045
    9631046   // create the application items
    964    delphes_event_display("delphes_card_CMS.tcl", "../delphes_output.root", det3D);
     1047   delphes_event_display("delphes_card_CMS.tcl", "../delphes_output.root", det3D); //TODO root file as input cfg
    9651048   make_gui();
    9661049   load_event();
     
    9811064}
    9821065
    983 // virtual class to represent objects from a Delphes-tree branch
    984 class DelphesBranchBase
    985 {
    986   public:
    987     DelphesBranchBase(const char* name, const char*type, const enum EColor color):name_(name),type_(type),color_(color) {}
    988     virtual ~DelphesBranchBase() {};
    989     const char* GetName() const { return (const char*)name_; }
    990     const char* GetType() const { return (const char*)type_; }
    991     enum EColor GetColor() const { return color_; }
    992     virtual const char* GetClassName() = 0;
    993     virtual void Reset() = 0;
    994 
    995   private:
    996     TString name_;
    997     TString type_; // needed for parsing the branch later on
    998     const enum EColor color_;
    999 };
    1000 // concrete implementations. EveContainer can be a TrackList, ElementList or CaloData.
    1001 template<typename EveContainer> class DelphesBranchElement: public DelphesBranchBase
    1002 {
    1003   public:
    1004     DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
    1005       throw std::exception();
    1006     }
    1007 
    1008     // destructor
    1009     virtual ~DelphesBranchElement() {
    1010       delete data_;
    1011     }
    1012  
    1013     // get the container (ElementList, TrackList, or CaloData)
    1014     EveContainer* GetContainer() { return data_; }
    1015 
    1016     // resets the collection (before moving to the next event)
    1017     // making it pure virtual implies that only the specializations below will compile
    1018     virtual void Reset() {};
    1019 
    1020     // template class name
    1021     virtual const char* GetClassName() { return data_->ClassName(); }
    1022 
    1023   private:
    1024     EveContainer* data_;
    1025 };
    1026 // special case for calo towers
    1027 template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
    1028       if(TString(type)=="tower") {
    1029         data_ = new DelphesCaloData(2);
    1030         data_->RefSliceInfo(0).Setup("ECAL", 0.1, kRed);
    1031         data_->RefSliceInfo(1).Setup("HCAL", 0.1, kBlue);
    1032         data_->IncDenyDestroy();
    1033       } else {
    1034         throw std::exception();
    1035       }
    1036     }
    1037 template<> void DelphesBranchElement<DelphesCaloData>::Reset() { data_->ClearTowers(); }
    1038 // special case for element lists
    1039 template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
    1040       if(TString(type)=="vector" || TString(type)=="jet") {
    1041         data_ = new TEveElementList(name);
    1042         data_->SetMainColor(color_);
    1043       } else {
    1044         throw std::exception();
    1045       }
    1046     }
    1047 template<> void DelphesBranchElement<TEveElementList>::Reset() { data_->DestroyElements(); }
    1048 // special case for track lists
    1049 template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color):DelphesBranchBase(name, type, color) {
    1050       if(TString(type)=="track") {
    1051         data_ = new TEveTrackList(name);
    1052         data_->SetMainColor(color_);
    1053         data_->SetMarkerColor(color_);
    1054         data_->SetMarkerStyle(kCircle);
    1055         data_->SetMarkerSize(0.5);
    1056       } else if(TString(type)=="photon") {
    1057         data_ = new TEveTrackList(name);
    1058         data_->SetMainColor(color_);
    1059         data_->SetMarkerColor(color_);
    1060         data_->SetMarkerStyle(kCircle);
    1061         data_->SetMarkerSize(0.5);
    1062       } else {
    1063         throw std::exception();
    1064       }
    1065     }
    1066 template<> void DelphesBranchElement<TEveTrackList>::Reset() { data_->DestroyElements(); }
    1067 
    1068 // function that parses the config to extract the branches of interest and prepare containers
    1069 void readConfig(const char *configFile, Delphes3DGeometry& det3D, std::vector<DelphesBranchBase*>& elements, std::vector<TClonesArray*>& arrays) {
    1070    ExRootConfReader *confReader = new ExRootConfReader;
    1071    confReader->ReadFile(configFile);
    1072    Double_t tk_radius = det3D.getTrackerRadius();
    1073    Double_t tk_length = det3D.getTrackerHalfLength();
    1074    Double_t tk_Bz     = det3D.getBField();
    1075    Double_t mu_radius = det3D.getDetectorRadius();
    1076    Double_t mu_length = det3D.getDetectorHalfLength();
    1077    TAxis*   etaAxis   = det3D.getCaloAxes().first;
    1078    TAxis*   phiAxis   = det3D.getCaloAxes().second;
    1079    ExRootConfParam branches = confReader->GetParam("TreeWriter::Branch");
    1080    Int_t nBranches = branches.GetSize()/3;
    1081    for(Int_t b = 0; b<nBranches; ++b) {
    1082      TString input = branches[b*3].GetString();
    1083      TString name = branches[b*3+1].GetString();
    1084      TString className = branches[b*3+2].GetString();
    1085      if(className=="Track") {
    1086        if(input.Contains("eflow",TString::kIgnoreCase) || name.Contains("eflow",TString::kIgnoreCase)) continue; //no eflow
    1087        DelphesBranchElement<TEveTrackList>* list = new DelphesBranchElement<TEveTrackList>(name,"track",kBlue);
    1088        elements.push_back(list);
    1089        TEveTrackPropagator *trkProp = list->GetContainer()->GetPropagator();
    1090        trkProp->SetMagField(0., 0., -tk_Bz);
    1091        trkProp->SetMaxR(tk_radius);
    1092        trkProp->SetMaxZ(tk_length);
    1093      } else if(className=="Tower") {
    1094        if(input.Contains("eflow",TString::kIgnoreCase) || name.Contains("eflow",TString::kIgnoreCase)) continue; //no eflow
    1095        DelphesBranchElement<DelphesCaloData>* list = new DelphesBranchElement<DelphesCaloData>(name,"tower",kBlack);
    1096        list->GetContainer()->SetEtaBins(etaAxis);
    1097        list->GetContainer()->SetPhiBins(phiAxis);
    1098        elements.push_back(list);
    1099      } else if(className=="Jet") {
    1100        if(input.Contains("GenJetFinder")) {
    1101          DelphesBranchElement<TEveElementList>* list = new DelphesBranchElement<TEveElementList>(name,"jet",kCyan);
    1102          list->GetContainer()->SetRnrSelf(false);
    1103          list->GetContainer()->SetRnrChildren(false);
    1104          elements.push_back(list);
    1105        } else {
    1106          elements.push_back(new DelphesBranchElement<TEveElementList>(name,"jet",kYellow));
    1107        }
    1108      } else if(className=="Electron") {
    1109        DelphesBranchElement<TEveTrackList>* list = new DelphesBranchElement<TEveTrackList>(name,"track",kRed);
    1110        elements.push_back(list);
    1111        TEveTrackPropagator *trkProp = list->GetContainer()->GetPropagator();
    1112        trkProp->SetMagField(0., 0., -tk_Bz);
    1113        trkProp->SetMaxR(tk_radius);
    1114        trkProp->SetMaxZ(tk_length);
    1115      } else if(className=="Photon") {
    1116        DelphesBranchElement<TEveTrackList>* list = new DelphesBranchElement<TEveTrackList>(name,"photon",kYellow);
    1117        elements.push_back(list);
    1118        TEveTrackPropagator *trkProp = list->GetContainer()->GetPropagator();
    1119        trkProp->SetMagField(0., 0., 0.);
    1120        trkProp->SetMaxR(tk_radius);
    1121        trkProp->SetMaxZ(tk_length);
    1122      } else if(className=="Muon") {
    1123        DelphesBranchElement<TEveTrackList>* list = new DelphesBranchElement<TEveTrackList>(name,"track",kGreen);
    1124        elements.push_back(list);
    1125        TEveTrackPropagator *trkProp = list->GetContainer()->GetPropagator();
    1126        trkProp->SetMagField(0., 0., -tk_Bz);
    1127        trkProp->SetMaxR(mu_radius);
    1128        trkProp->SetMaxZ(mu_length);
    1129      } else if(className=="MissingET") {
    1130        elements.push_back(new DelphesBranchElement<TEveElementList>(name,"vector",kViolet));
    1131      } else if(className=="GenParticle") {
    1132        DelphesBranchElement<TEveTrackList>* list = new DelphesBranchElement<TEveTrackList>(name,"track",kCyan);
    1133        elements.push_back(list);
    1134        list->GetContainer()->SetRnrSelf(false);
    1135        list->GetContainer()->SetRnrChildren(false);
    1136        TEveTrackPropagator *trkProp = list->GetContainer()->GetPropagator();
    1137        trkProp->SetMagField(0., 0., -tk_Bz);
    1138        trkProp->SetMaxR(tk_radius);
    1139        trkProp->SetMaxZ(tk_length);
    1140      }
    1141      arrays.push_back(gTreeReader->UseBranch(name));
    1142    }
    1143 }
Note: See TracChangeset for help on using the changeset viewer.