Changeset 4fd37d4 in git for display/DelphesBranchElement.h
- Timestamp:
- Oct 18, 2014, 12:27:15 PM (10 years ago)
- Branches:
- ImprovedOutputFile, Timing, dual_readout, llp, master
- Children:
- 5fbcfe8
- Parents:
- 400597a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
display/DelphesBranchElement.h
r400597a r4fd37d4 22 22 #include "TColor.h" 23 23 #include "TString.h" 24 #include "TClonesArray.h" 25 #include "TClass.h" 24 26 #include <exception> 27 #include <iostream> 25 28 #include "display/DelphesCaloData.h" 26 29 #include "TEveElement.h" … … 31 34 { 32 35 public: 33 DelphesBranchBase(const char* name="", const char*type="", const enum EColor color=kBlack):name_(name),type_(type),color_(color) {}34 virtual ~DelphesBranchBase() {} ;36 DelphesBranchBase(const char* name="", TClonesArray* branch=NULL, const enum EColor color=kBlack):name_(name),branch_(branch),color_(color) {} 37 virtual ~DelphesBranchBase() {} 35 38 const char* GetName() const { return (const char*)name_; } 36 const char* GetType() const { return (const char*)type_; } 39 const char* GetType() const { return branch_ ? branch_->GetClass()->GetName() : "None"; } 40 virtual const char* GetClassName() = 0; 37 41 enum EColor GetColor() const { return color_; } 38 virtual const char* GetClassName() = 0;39 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; 40 45 41 46 protected: 42 47 TString name_; 43 T String type_; // needed for parsing the branch later on48 TClonesArray* branch_; 44 49 const enum EColor color_; 50 Float_t tkRadius_,tkHalfLength_, tk_Bz_; 45 51 }; 46 52 … … 50 56 public: 51 57 // constructor 52 DelphesBranchElement(const char* name="", const char*type="", const enum EColor color=kBlack):DelphesBranchBase(name, type, color) {58 DelphesBranchElement(const char* name="", TClonesArray* branch=NULL, const enum EColor color=kBlack):DelphesBranchBase(name, branch, color) { 53 59 throw std::exception(); 54 60 } … … 60 66 EveContainer* GetContainer() { return data_; } 61 67 68 // tracking volume 69 virtual void SetTrackingVolume(Float_t r, Float_t l, Float_t Bz=0.) { tkRadius_ = r; tkHalfLength_ = l; tk_Bz_ = Bz; } 70 62 71 // resets the collection (before moving to the next event) 63 72 virtual void Reset() {}; … … 65 74 // template class name 66 75 virtual const char* GetClassName() { return data_->ClassName(); } 76 77 // read the branch and fill elements for display 78 virtual void ReadBranch() {} 67 79 68 80 private: … … 73 85 74 86 // special case for calo towers 75 template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, const char*type, const enum EColor color);87 template<> DelphesBranchElement<DelphesCaloData>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color); 76 88 template<> void DelphesBranchElement<DelphesCaloData>::Reset(); 89 template<> void DelphesBranchElement<DelphesCaloData>::ReadBranch(); 77 90 78 91 // special case for element lists 79 template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color);92 template<> DelphesBranchElement<TEveElementList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color); 80 93 template<> void DelphesBranchElement<TEveElementList>::Reset(); 94 template<> void DelphesBranchElement<TEveElementList>::ReadBranch(); 81 95 82 96 // special case for track lists 83 template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, const char*type, const enum EColor color); 97 template<> DelphesBranchElement<TEveTrackList>::DelphesBranchElement(const char* name, TClonesArray* branch, const enum EColor color); 98 template<> void DelphesBranchElement<TEveTrackList>::SetTrackingVolume(Float_t r, Float_t l, Float_t Bz); 84 99 template<> void DelphesBranchElement<TEveTrackList>::Reset(); 100 template<> void DelphesBranchElement<TEveTrackList>::ReadBranch(); 85 101 86 102 #endif // CINT, CLING
Note:
See TracChangeset
for help on using the changeset viewer.