DelphesFactory.h
Go to the documentation of this file.
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 #ifndef DelphesFactory_h
20 #define DelphesFactory_h
21 
35 #include "TNamed.h"
36 
37 #include <map>
38 #include <set>
39 #include "boca/io/TreeBranch.hh"
40 
41 class TObjArray;
42 
43 // namespace delphes{
44 
45 class Candidate;
46 
47 class DelphesFactory: public TNamed
48 {
49 public:
50 
51  DelphesFactory(char const *name = "ObjectFactory");
52 
54 
55  using TNamed::Clear;
56  void Clear();
57 
58  TObjArray *NewPermanentArray();
59 
60  TObjArray *NewArray() { return New<TObjArray>(); }
61 
63 
64  TObject *New(TClass *cl);
65 
66  template<typename T>
67  T *New() { return static_cast<T *>(New(T::Class())); }
68 
69 private:
70 
71  ExRootTreeBranch *fObjArrays;
72 
73 #if !defined(__CINT__) && !defined(__CLING__)
74  std::map< const TClass*, ExRootTreeBranch* > fBranches;
75 #endif
76 
77  std::set< TObject* > fPool;
78 
79 // ClassDef(DelphesFactory, 1)
80 };
81 
82 // }
83 
86 #endif /* DelphesFactory */
87 
T * New()
Definition: DelphesFactory.h:67
TObjArray * NewPermanentArray()
Definition: DelphesFactory.cc:82
Definition: DelphesFactory.h:47
Definition: TreeBranch.hh:12
~DelphesFactory()
Definition: DelphesFactory.cc:50
void Clear()
Definition: DelphesFactory.cc:63
Definition: DelphesClasses.h:493
DelphesFactory(char const *name="ObjectFactory")
Definition: DelphesFactory.cc:42
Candidate * NewCandidate()
Definition: DelphesFactory.cc:91
TObjArray * NewArray()
Definition: DelphesFactory.h:60