Fork me on GitHub

Ignore:
Timestamp:
Feb 12, 2019, 9:29:17 PM (6 years ago)
Author:
Pavel Demin <pavel-demin@…>
Branches:
ImprovedOutputFile, Timing, llp, master
Children:
6455202
Parents:
45e58be
Message:

apply .clang-format to all .h, .cc and .cpp files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • display/DelphesBranchElement.h

    r45e58be r341014c  
    2020#define DelphesBranchElement_h
    2121
     22#include "TClass.h"
     23#include "TClonesArray.h"
    2224#include "TColor.h"
     25#include "TEveElement.h"
     26#include "TEveTrack.h"
    2327#include "TString.h"
    24 #include "TClonesArray.h"
    25 #include "TClass.h"
     28#include "display/DelphesCaloData.h"
    2629#include <exception>
    2730#include <iostream>
    28 #include "display/DelphesCaloData.h"
    29 #include "TEveElement.h"
    30 #include "TEveTrack.h"
    3131
    3232// virtual class to represent objects from a Delphes-tree branch
    3333class DelphesBranchBase
    3434{
    35   public:
    36     DelphesBranchBase(const char* name="", TClonesArray* branch=NULL, const enum EColor color=kBlack, Float_t maxPt=50.):name_(name),maxPt_(maxPt),branch_(branch),color_(color) {}
    37     virtual ~DelphesBranchBase() {}
    38     const char* GetName() const { return (const char*)name_; }
    39     const char* GetType() const { return branch_ ? branch_->GetClass()->GetName() : "None"; }
    40     virtual const char* GetClassName() = 0;
    41     enum EColor GetColor() const { return color_; }
    42     virtual void Reset() = 0;
    43     virtual void SetTrackingVolume(Float_t r, Float_t l, Float_t Bz=0.) { tkRadius_ = r; tkHalfLength_ = l; tk_Bz_ = Bz; }
    44     virtual void ReadBranch() = 0;
    45     virtual std::vector<TLorentzVector> GetVectors() = 0;
     35public:
     36  DelphesBranchBase(const char *name = "", TClonesArray *branch = NULL, const enum EColor color = kBlack, Float_t maxPt = 50.) :
     37    name_(name), maxPt_(maxPt), branch_(branch), color_(color) {}
     38  virtual ~DelphesBranchBase() {}
     39  const char *GetName() const { return (const char *)name_; }
     40  const char *GetType() const { return branch_ ? branch_->GetClass()->GetName() : "None"; }
     41  virtual const char *GetClassName() = 0;
     42  enum EColor GetColor() const { return color_; }
     43  virtual void Reset() = 0;
     44  virtual void SetTrackingVolume(Float_t r, Float_t l, Float_t Bz = 0.)
     45  {
     46    tkRadius_ = r;
     47    tkHalfLength_ = l;
     48    tk_Bz_ = Bz;
     49  }
     50  virtual void ReadBranch() = 0;
     51  virtual std::vector<TLorentzVector> GetVectors() = 0;
    4652
    47   protected:
    48     TString name_;
    49     Float_t maxPt_;
    50     TClonesArray* branch_;
    51     const enum EColor color_;
    52     Float_t tkRadius_,tkHalfLength_, tk_Bz_;
     53protected:
     54  TString name_;
     55  Float_t maxPt_;
     56  TClonesArray *branch_;
     57  const enum EColor color_;
     58  Float_t tkRadius_, tkHalfLength_, tk_Bz_;
    5359};
    5460
    5561// concrete implementations. EveContainer can be a TrackList, ElementList or CaloData.
    56 template<typename EveContainer> class DelphesBranchElement: public DelphesBranchBase
     62template <typename EveContainer>
     63class DelphesBranchElement: public DelphesBranchBase
    5764{
    58   public:
    59     // constructor
    60     DelphesBranchElement(const char* name="", TClonesArray* branch=NULL, const enum EColor color=kBlack, Float_t maxPt=50.):DelphesBranchBase(name, branch, color, maxPt) {
    61       throw std::exception();
    62     }
     65public:
     66  // constructor
     67  DelphesBranchElement(const char *name = "", TClonesArray *branch = NULL, const enum EColor color = kBlack, Float_t maxPt = 50.) :
     68    DelphesBranchBase(name, branch, color, maxPt)
     69  {
     70    throw std::exception();
     71  }
    6372
    64     // destructor
    65     virtual ~DelphesBranchElement() { delete data_; }
     73  // destructor
     74  virtual ~DelphesBranchElement() { delete data_; }
    6675
    67     // get the container (ElementList, TrackList, or CaloData)
    68     EveContainer* GetContainer() { return data_; }
     76  // get the container (ElementList, TrackList, or CaloData)
     77  EveContainer *GetContainer() { return data_; }
    6978
    70     // tracking volume
    71     virtual void SetTrackingVolume(Float_t r, Float_t l, Float_t Bz=0.) { tkRadius_ = r; tkHalfLength_ = l; tk_Bz_ = Bz; }
     79  // tracking volume
     80  virtual void SetTrackingVolume(Float_t r, Float_t l, Float_t Bz = 0.)
     81  {
     82    tkRadius_ = r;
     83    tkHalfLength_ = l;
     84    tk_Bz_ = Bz;
     85  }
    7286
    73     // resets the collection (before moving to the next event)
    74     virtual void Reset() {};
     87  // resets the collection (before moving to the next event)
     88  virtual void Reset(){};
    7589
    76     // template class name
    77     virtual const char* GetClassName() { return data_->ClassName(); }
     90  // template class name
     91  virtual const char *GetClassName() { return data_->ClassName(); }
    7892
    79     // read the branch and fill elements for display
    80     virtual void ReadBranch() {}
     93  // read the branch and fill elements for display
     94  virtual void ReadBranch() {}
    8195
    82     // return the vector for all elements
    83     virtual std::vector<TLorentzVector> GetVectors() { std::vector<TLorentzVector> v; return v; }
     96  // return the vector for all elements
     97  virtual std::vector<TLorentzVector> GetVectors()
     98  {
     99    std::vector<TLorentzVector> v;
     100    return v;
     101  }
    84102
    85   private:
    86     EveContainer* data_;
     103private:
     104  EveContainer *data_;
    87105};
    88106
     
    90108
    91109// special case for calo towers
    92 template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt);
    93 template<> void DelphesBranchElement<DelphesCaloData>::Reset();
    94 template<> void DelphesBranchElement<DelphesCaloData>::ReadBranch();
    95 template<> std::vector<TLorentzVector> DelphesBranchElement<DelphesCaloData>::GetVectors();
     110template <>
     111DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char *name, TClonesArray *branch, const enum EColor color, Float_t maxPt);
     112template <>
     113void DelphesBranchElement<DelphesCaloData>::Reset();
     114template <>
     115void DelphesBranchElement<DelphesCaloData>::ReadBranch();
     116template <>
     117std::vector<TLorentzVector> DelphesBranchElement<DelphesCaloData>::GetVectors();
    96118
    97119// special case for element lists
    98 template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt);
    99 template<> void DelphesBranchElement<TEveElementList>::Reset();
    100 template<> void DelphesBranchElement<TEveElementList>::ReadBranch();
    101 template<> std::vector<TLorentzVector> DelphesBranchElement<TEveElementList>::GetVectors();
     120template <>
     121DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char *name, TClonesArray *branch, const enum EColor color, Float_t maxPt);
     122template <>
     123void DelphesBranchElement<TEveElementList>::Reset();
     124template <>
     125void DelphesBranchElement<TEveElementList>::ReadBranch();
     126template <>
     127std::vector<TLorentzVector> DelphesBranchElement<TEveElementList>::GetVectors();
    102128
    103129// special case for track lists
    104 template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color, Float_t maxPt);
    105 template<> void DelphesBranchElement<TEveTrackList>::SetTrackingVolume(Float_t r, Float_t l, Float_t Bz);
    106 template<> void DelphesBranchElement<TEveTrackList>::Reset();
    107 template<> void DelphesBranchElement<TEveTrackList>::ReadBranch();
    108 template<> std::vector<TLorentzVector> DelphesBranchElement<TEveTrackList>::GetVectors();
     130template <>
     131DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char *name, TClonesArray *branch, const enum EColor color, Float_t maxPt);
     132template <>
     133void DelphesBranchElement<TEveTrackList>::SetTrackingVolume(Float_t r, Float_t l, Float_t Bz);
     134template <>
     135void DelphesBranchElement<TEveTrackList>::Reset();
     136template <>
     137void DelphesBranchElement<TEveTrackList>::ReadBranch();
     138template <>
     139std::vector<TLorentzVector> DelphesBranchElement<TEveTrackList>::GetVectors();
    109140
    110141#endif // CINT, CLING
Note: See TracChangeset for help on using the changeset viewer.