StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTrackFitTraits.h
1 
5 /***************************************************************************
6  *
7  * $Id: StTrackFitTraits.h,v 2.22 2015/10/16 00:30:22 perev Exp $
8  *
9  * Author: Thomas Ullrich, Sep 1999
10  ***************************************************************************
11  *
12  * Description:
13  *
14  * With the arrival of new detectors when even not known will be this
15  * detector installed or not the following modification was made:
16  1) mNumberOfFitPoints == 0xA000 + total number of fit points
17  2) numberOfFitPoints() returns total amount of fitted points
18  3) number of hits for XXXX detector is
19  numberOfFitPoints()-numberOfFitPoints(kTpcId)
20  4) If detector XXXX will be installed, according member could be added
21 
22  (VP)
23 
24  * Note the following: with the arrival of ITTF it is now possible to
25  * store the numberOfFitPoints for every detector individually. Before
26  * that and because of the way the tables were defined TPC and FTPC were
27  * one and the same. This caused confusion. However, since we have to
28  * stay backwards compatible the "old way" is still working.
29  * If
30  * a) mNumberOfFitPoints == 0 the new encoding is the one to use, i.e.,
31  * mNumberOfFitPointsTpc
32  * mNumberOfFitPointsFtpcWest
33  * mNumberOfFitPointsFtpcEast
34  * mNumberOfFitPointsSvt
35  * mNumberOfFitPointsSsd
36  * are the ones that count
37  * b) mNumberOfFitPoints != 0 then we still loaded the info from
38  * the tables and all is as it was before, i.e., we do not distinguish
39  * between FTPC and TPC.
40  *
41  ***************************************************************************
42  *
43  * $Log: StTrackFitTraits.h,v $
44  * Revision 2.22 2015/10/16 00:30:22 perev
45  * ClassDef++, schema evolution
46  *
47  * Revision 2.21 2015/05/13 17:06:14 ullrich
48  * Added hooks and interfaces to Sst detector (part of HFT).
49  *
50  * Revision 2.20 2013/07/23 11:21:49 jeromel
51  * Undo past week changes
52  *
53  * Revision 2.18 2013/04/10 19:15:53 jeromel
54  * Step back from StEvent changes - previous change recoverable [Thomas OK-ed]
55  *
56  * Revision 2.16 2012/04/27 01:45:12 perev
57  * Logic for total numbers of fit points changed
58  *
59  * Revision 2.15 2009/11/23 16:34:07 fisyak
60  * Cleanup, remove dependence on dst tables, clean up software monitors
61  *
62  * Revision 2.14 2008/03/19 14:40:56 fisyak
63  * Add access to covariance matrix array
64  *
65  * Revision 2.13 2007/10/11 21:52:32 ullrich
66  * Added member to handle number of fit points for PXL and IST.
67  *
68  * Revision 2.12 2004/12/02 23:35:13 ullrich
69  * Added misisng setXXX functions.
70  *
71  * Revision 2.11 2004/08/13 18:15:42 ullrich
72  * Added +1 to the number of fit points when bool flag is set.
73  *
74  * Revision 2.10 2004/08/12 17:22:31 fisyak
75  * Switch to automatic streamer for version >4 to account new no. of fit points definition
76  *
77  * Revision 2.9 2004/08/05 22:24:32 ullrich
78  * Changes to the handling of numberOfPoints() to allow ITTF more flexibility.
79  *
80  * Revision 2.8 2002/02/22 22:56:52 jeromel
81  * Doxygen basic documentation in all header files. None of this is required
82  * for QM production.
83  *
84  * Revision 2.7 2001/05/04 19:50:52 perev
85  * Streamer to account old ROOT2
86  *
87  * Revision 2.6 2001/04/05 04:00:45 ullrich
88  * Replaced all (U)Long_t by (U)Int_t and all redundant ROOT typedefs.
89  *
90  * Revision 2.5 2001/03/24 03:35:00 perev
91  * clone() -> clone() const
92  *
93  * Revision 2.4 2001/03/16 21:31:42 ullrich
94  * Changed version number from 1 to 2.
95  *
96  * Revision 2.3 2001/03/16 20:57:45 ullrich
97  * Covariant matrix now stored in TArrayF.
98  *
99  * Revision 2.2 1999/11/01 12:45:17 ullrich
100  * Modified unpacking of point counter
101  *
102  * Revision 2.1 1999/10/28 22:27:35 ullrich
103  * Adapted new StArray version. First version to compile on Linux and Sun.
104  *
105  * Revision 2.0 1999/10/12 18:43:02 ullrich
106  * Completely Revised for New Version
107  *
108  **************************************************************************/
109 #ifndef StTrackFitTraits_hh
110 #define StTrackFitTraits_hh
111 #include "StObject.h"
112 #include "StEnumerations.h"
113 #include "StMatrixF.hh"
114 #include "TArrayF.h"
115 
117 
118 class StTrackFitTraits : public StObject {
119 public:
121  StTrackFitTraits(unsigned short, unsigned short, float[2], float[15]);
122  // StTrackFitTraits(const StTrackFitTraits&); use default
123  // StTrackFitTraits& operator=(const StTrackFitTraits&); use default
124  virtual ~StTrackFitTraits();
125 
126  unsigned short numberOfFitPoints() const;
127  unsigned short numberOfFitPoints(StDetectorId) const;
128  StParticleDefinition* pidHypothesis() const;
129  StMatrixF covariantMatrix() const;
130  const float* covariance() const {return mCovariantMatrix.GetArray();}
131  double chi2(unsigned int = 0) const;
132  bool primaryVertexUsedInFit() const;
133 
134  void clearCovariantMatrix();
135  void setNumberOfFitPoints(unsigned char n, StDetectorId id=kUnknownId);
136  void setPrimaryVertexUsedInFit(bool);
137 
138  void setPidHypothesis(unsigned short);
139  void setChi2(float, unsigned int = 0);
140  void setCovariantMatrix(float[15]);
141 
142 protected:
143  UShort_t mPidHypothesis; // GeantId
144  UShort_t mNumberOfFitPoints; // obsolete since ITTF
145  UChar_t mNumberOfFitPointsTpc;
146  UChar_t mNumberOfFitPointsFtpcWest;
147  UChar_t mNumberOfFitPointsFtpcEast;
148  UChar_t mNumberOfFitPointsSvt;
149  UChar_t mNumberOfFitPointsSsd;
150  UChar_t mNumberOfFitPointsSst;
151  UChar_t mNumberOfFitPointsPxl;
152  UChar_t mNumberOfFitPointsIst;
153  Bool_t mPrimaryVertexUsedInFit;
154  Float_t mChi2[2];
155  TArrayF mCovariantMatrix;
156 
157  ClassDef(StTrackFitTraits,9)
158 };
159 #endif