GFRecoHitIfc.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 #ifndef GFRECOHITIFC_H
24 #define GFRECOHITIFC_H
25 
26 
27 #include "TMatrixT.h"
28 
31 
32 
33 /** @brief RecoHit interface template class. Provides comfortable
34  * interface to create RecoHits
35  *
36  * @author Christian H&ouml;ppner (Technische Universit&auml;t M&uuml;nchen, original author)
37  * @author Sebastian Neubert (Technische Universit&auml;t M&uuml;nchen, original author)
38  *
39  * This class defines a comfortable interface to create hit classes in genfit.
40  * It is a template class. The template parameter is used to specify a certain
41  * basic type of hit:
42  * - GFRecoHitIfc<PlanarHitPolicy> a basic planar hit
43  * - GFRecoHitIfc<SpacepointHitPolicy> a basic space point hit
44  * - GFRecoHitIfc<WirepointHitPolicy> a basic hit on a wire
45  *
46  * To create a hit for a detector simply inherit from one of the options
47  * above and fill in your data. For details look at the respective
48  * HitPolicy documentations. You can also directly inherit from
49  * GFAbsRecoHit though this is not recommended. If a new hit geometry is needed
50  * one should think about implementing a new HitPolicy for this type of hit.
51  *
52  * @sa PlanarHitPolicy
53  * @sa SpacepointHitPolicy
54  * @sa WirepointHitPolicy
55  *
56  * Implementation details: The actual implementations of the methods
57  * declared here can be found in the HitPolicy objects.
58  */
59 namespace genf {
60 
61 template<class HitPolicy>
62 class GFRecoHitIfc : public GFAbsRecoHit{
63  protected:
64  HitPolicy fPolicy;
65 
66  public:
67 
68  /** @brief Constructor specifying dimension of hit coordinate vector
69  */
70  GFRecoHitIfc(int dim) : GFAbsRecoHit(dim){;}
71  virtual ~GFRecoHitIfc(){;}
72 
73  /** @brief Returns the detector plane object for this hit and a given track
74  * representation.
75  *
76  * The actutal code for this method depends on the hit geometry and is
77  * implemented in the HitPolicy
78  * @sa PlanarHitPolicy
79  * @sa SpacepointHitPolicy
80  * @sa WirepointHitPolicy
81  */
82  virtual const GFDetPlane& getDetPlane(GFAbsTrackRep* rep){return fPolicy.detPlane(this,rep);}
83 
84  /** @brief Get hit coordinates in a specific detector plane
85  *
86  * Implementation in the HitPolicy
87  */
88  virtual TMatrixT<Double_t> getHitCoord(const GFDetPlane& plane,const GFDetPlane& planePrev)
89  {return fPolicy.hitCoord(this,plane,planePrev);}
90  virtual TMatrixT<Double_t> getHitCoord(const GFDetPlane& plane)
91  {return fPolicy.hitCoord(this,plane);}
92 
93  /** @brief Get hit covariances in a specific detector plane
94  *
95  * Implementation in the HitPolicy
96  */
97  virtual TMatrixT<Double_t> getHitCov(const GFDetPlane& plane)
98  {return fPolicy.hitCov(this,plane);}
99  virtual TMatrixT<Double_t> getHitCov(const GFDetPlane& plane, const GFDetPlane& planePrev, const TMatrixT<Double_t>& state, const Double_t& mass)
100  {return fPolicy.hitCov(this,plane,planePrev, state, mass);}
101 
102  const std::string& getPolicyName(){return fPolicy.getName();}
103 
104  //public:
105  // ClassDef(GFRecoHitIfc,1);
106 
107 };
108 
109 }
110 
111 #endif
112 
113 
114 /** @} */
115 
116 
const std::string & getPolicyName()
Definition: GFRecoHitIfc.h:102
virtual const GFDetPlane & getDetPlane(GFAbsTrackRep *rep)
Returns the detector plane object for this hit and a given track representation.
Definition: GFRecoHitIfc.h:82
GFRecoHitIfc(int dim)
Constructor specifying dimension of hit coordinate vector.
Definition: GFRecoHitIfc.h:70
std::string string
Definition: nybbler.cc:12
Generic Interface to magnetic fields in GENFIT.
Definition: GFAbsBField.h:35
virtual TMatrixT< Double_t > getHitCov(const GFDetPlane &plane, const GFDetPlane &planePrev, const TMatrixT< Double_t > &state, const Double_t &mass)
Definition: GFRecoHitIfc.h:99
virtual TMatrixT< Double_t > getHitCoord(const GFDetPlane &plane, const GFDetPlane &planePrev)
Get hit coordinates in a specific detector plane.
Definition: GFRecoHitIfc.h:88
virtual ~GFRecoHitIfc()
Definition: GFRecoHitIfc.h:71
Base Class for genfit track representations. Defines interface for track parameterizations.
Definition: GFAbsTrackRep.h:83
virtual TMatrixT< Double_t > getHitCov(const GFDetPlane &plane)
Get hit covariances in a specific detector plane.
Definition: GFRecoHitIfc.h:97
virtual TMatrixT< Double_t > getHitCoord(const GFDetPlane &plane)
Definition: GFRecoHitIfc.h:90