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 
27  BranchToClass() = delete;
28  };
29 
30  TClass* BranchToClass::doit(const TBranch* iBranch) {
31  TClass* contained = nullptr;
32  TClass* type = TVirtualBranchBrowsable::GetCollectionContainedType(iBranch, nullptr, contained);
33  if (type == nullptr) {
34  type = contained;
35  }
36  return type;
37  }
38 
39 } // namespace
40 
41 TClass* branchToClass(const TBranch* iBranch) { return BranchToClass::doit(iBranch); }
42 //
43 // constants, enums and typedefs
44 //
45 
46 //
47 // static data member definitions
48 //
49 
50 //
51 // constructors and destructor
52 //
TClass * branchToClass(const TBranch *iBranch)