GFRecoHitFactory.h
Go to the documentation of this file.
1 /* Copyright 2008-2010, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert
3 
4  This file is part of GENFIT.
5 
6  GENFIT is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  GENFIT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public License
17  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
18 */
19 /** @addtogroup genfit
20  * @{ */
21 
22 /**
23  * @author Christian H&ouml;ppner (Technische Universit&auml;t M&uuml;nchen, original author)
24  * @author Sebastian Neubert (Technische Universit&auml;t M&uuml;nchen, original author)
25  *
26  */
27 
28 #ifndef GFRECOHITFACTORY_H
29 #define GFRECOHITFACTORY_H
30 
31 #include<vector>
32 #include<map>
33 
35 
36 namespace genf {
37 
38 class GFTrackCand;
39 class GFAbsRecoHit;
40 
41 
42 /** @brief Factory object to create RecoHits from digitized and clustered data
43  *
44  * The GFRecoHitFactory is used to automatically fill Track objects with
45  * hit data. For each detector type that is used, one GFRecoHitProducer
46  * has to be registered in the factory. The factory can the use the index
47  * information from a GFTrackCand object to load the indexed hits into
48  * the Track.
49  *
50  * @sa GFAbsRecoHitProducer
51  * @sa GFTrackCand
52  */
54 private:
55  std::map<int,GFAbsRecoHitProducer*> fHitProdMap;
56 
57 
58 public:
60  virtual ~GFRecoHitFactory();
61 
62  /** @brief Register a producer module to the factory
63  *
64  * For each type of hit a separate producer is needed. The type of hit
65  * is identified by the detector ID (detID). This index corresponds to the
66  * detector ID that is stored in the GFTrackCand object
67  */
68  void addProducer(int detID, GFAbsRecoHitProducer* hitProd);
69 
70  /** @brief Clear all hit producers
71  */
72  void clear();
73 
74  /** @brief Create a RecoHit
75  *
76  * RecoHits have to implement a Constructor which takes the cluster object
77  * from which the RecoHit is build as the only parameter.
78  * See GFAbsRecoHitProducer for details
79  */
80  GFAbsRecoHit* createOne (int detID,int index);
81 
82  /** @brief Creat a collection of RecoHits
83  *
84  * This is the standard way to prepare the hit collection for a Track. The
85  * resulting collection can contain hits from several detectors. The order
86  * of the hits is the same as in the GFTrackCand. It is assumed that this order
87  * is already along the track.
88  *
89  * RecoHits have to implement a constructor which takes the cluster object
90  * from which the RecoHit is build as the only parameter.
91  * See GFAbsRecoHitProducer for details
92  */
93  std::vector<GFAbsRecoHit*> createMany(const GFTrackCand& cand);
94 
95 
96 };
97 
98 } //namespace genf
99 #endif
100 
101 /** @} */
std::map< int, GFAbsRecoHitProducer * > fHitProdMap
Factory object to create RecoHits from digitized and clustered data.
GFAbsRecoHit * createOne(int detID, int index)
Create a RecoHit.
Generic Interface to magnetic fields in GENFIT.
Definition: GFAbsBField.h:35
std::vector< GFAbsRecoHit * > createMany(const GFTrackCand &cand)
Creat a collection of RecoHits.
void addProducer(int detID, GFAbsRecoHitProducer *hitProd)
Register a producer module to the factory.
Abstract interface class for GFRecoHitProducer.
void clear()
Clear all hit producers.