ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtSpacePointMeasurement.cxx
Go to the documentation of this file.
1 /* Copyright 2008-2010, Technische Universitaet Muenchen,
2  Authors: Christian Hoeppner & Sebastian Neubert & Johannes Rauch
3  This file is part of GENFIT.
4  GENFIT is free software: you can redistribute it and/or modify
5  it under the terms of the GNU Lesser General Public License as published
6  by the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8  GENFIT is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU Lesser General Public License for more details.
12  You should have received a copy of the GNU Lesser General Public License
13  along with GENFIT. If not, see <http://www.gnu.org/licenses/>.
14 */
15 
16 /*
17 Rearranged by: Genie Jhang (geniejhang@nuclear.korea.ac.kr, Korea University)
18 Adapted to AtTPCROOTv2 by Yassid Ayyad ayyadlim@frib.msu.edu
19 */
20 
22 
23 #include "AtHitCluster.h"
24 
25 #include <Math/Point3D.h>
26 #include <TMatrixDSymfwd.h>
27 #include <TMatrixDfwd.h>
28 #include <TMatrixT.h>
29 #include <TMatrixTSym.h>
30 #include <TVectorDfwd.h>
31 #include <TVectorT.h>
32 #include <TrackCandHit.h>
33 
34 #include <SpacepointMeasurement.h>
35 
36 namespace genfit {
37 class AbsMeasurement;
38 } // namespace genfit
39 
41 
42  namespace genfit
43 {
44 
45  AtSpacepointMeasurement::AtSpacepointMeasurement() : SpacepointMeasurement() {}
46 
47  AtSpacepointMeasurement::AtSpacepointMeasurement(const AtHitCluster *detHit, const TrackCandHit *hit)
48  : SpacepointMeasurement(), fCharge(detHit->GetCharge())
49  {
50  auto pos = detHit->GetPosition();
51  TMatrixD mat = detHit->GetCovMatrix();
52 
53  rawHitCoords_(0) = pos.X() / 10.;
54  rawHitCoords_(1) = pos.Y() / 10.;
55  rawHitCoords_(2) = pos.Z() / 10.;
56 
57  TMatrixDSym cov(3);
58 
59  /*cov(0,0) = detHit -> GetDx();
60  cov(1,1) = detHit -> GetDy();
61  cov(2,2) = detHit -> GetDz();*/ //TODO: Compute position variance
62 
63  cov(0, 1) = 0.0;
64  cov(1, 2) = 0.0;
65  cov(2, 0) = 0.0;
66 
67  // Forced covariance matrix to be constant. Need to study later.
68  cov(0, 0) = 1.0 / 1.0; // 0.2
69  cov(1, 1) = 1.0 / 1.0; // 0.2
70  cov(2, 2) = 1.28 / 1.0; // 1.28
71 
72  rawHitCov_ = cov;
73  detId_ = hit->getDetId();
74  hitId_ = hit->getHitId();
75 
76  // std::cout<<" AtSpacepointMeasurement::AtSpacepointMeasurement "<<"\n";
77  // std::cout<<rawHitCoords_(0)<<" "<<rawHitCoords_(1)<<" "<<rawHitCoords_(2)<<" "<<fCharge<<" "<<detId_<<"
78  // "<<hitId_<<"\n";
79 
80  this->initG();
81  }
82 
83  AbsMeasurement *AtSpacepointMeasurement::clone() const { return new AtSpacepointMeasurement(*this); }
84 
85  Double_t AtSpacepointMeasurement::GetCharge() { return fCharge; }
86 
87 } /* End of namespace genfit */
genfit::AtSpacepointMeasurement
Class for a spacepoint measurement which can be created from STHitCluster via the MeasurementFactory.
Definition: AtSpacePointMeasurement.h:42
AtHitCluster
: Class representing a cluster of hits that arise from the same deposition of charge in space....
Definition: AtHitCluster.h:37
AtHitCluster.h
genfit
Definition: AtFitter.h:20
genfit::AtSpacepointMeasurement::clone
virtual AbsMeasurement * clone() const
ClassImp
ClassImp(genfit::AtSpacepointMeasurement) namespace genfit
Definition: AtSpacePointMeasurement.cxx:40
AtHit::GetPosition
const XYZPoint & GetPosition() const
Definition: AtHit.h:79
genfit::AtSpacepointMeasurement::AtSpacepointMeasurement
AtSpacepointMeasurement()
AtSpacePointMeasurement.h
genfit::AtSpacepointMeasurement::GetCharge
Double_t GetCharge()
AtHit::GetCharge
Double_t GetCharge() const
Definition: AtHit.h:82
AtHitCluster::GetCovMatrix
const TMatrixDSym & GetCovMatrix() const
Definition: AtHitCluster.h:75