CMS 3D CMS Logo

branchToClass.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWLite
4 // Class : BranchToClass
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Chris Jones
10 // Created: Wed Aug 2 09:04:04 EDT 2006
11 //
12 
13 // system include files
14 class TBranch;
15 class TClass;
16 #include "TBranchBrowsable.h"
17 
18 // user include files
20 
21 namespace {
22  class BranchToClass : private TVirtualBranchBrowsable {
23  public:
24  static TClass* doit(const TBranch* iBranch);
25 
26  private:
28  BranchToClass() = delete;
29  };
30 
31  TClass* BranchToClass::doit(const TBranch* iBranch) {
32  TClass* contained = nullptr;
33  TClass* type = TVirtualBranchBrowsable::GetCollectionContainedType(iBranch, nullptr, contained);
34  if (type == nullptr) {
35  type = contained;
36  }
37  return type;
38  }
39 
40 } // namespace
41 
42 TClass* branchToClass(const TBranch* iBranch) { return BranchToClass::doit(iBranch); }
43 //
44 // constants, enums and typedefs
45 //
46 
47 //
48 // static data member definitions
49 //
50 
51 //
52 // constructors and destructor
53 //
type
Definition: HCALResponse.h:21
TClass * branchToClass(const TBranch *iBranch)