FairShip
Loading...
Searching...
No Matches
TrackInfo.cxx
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP
3// Collaboration
4
5#include "TrackInfo.h"
6
7#include "AbsMeasurement.h"
8#include "KalmanFitterInfo.h"
9
10// ----- Default constructor -------------------------------------------
11TrackInfo::TrackInfo() : TObject() {}
12
13// ----- Standard constructor ------------------------------------------
14TrackInfo::TrackInfo(const genfit::Track* tr) {
15 for (unsigned int i = 0; i < tr->getNumPointsWithMeasurement(); i += 1) {
16 genfit::TrackPoint* tp = tr->getPointWithMeasurement(i);
17 genfit::AbsMeasurement* rawM = tp->getRawMeasurement();
18 genfit::KalmanFitterInfo* info =
19 static_cast<genfit::KalmanFitterInfo*>(tp->getFitterInfo());
20 fDetIDs.push_back(rawM->getDetId());
21 if (info) {
22 fWL.push_back(info->getWeights()[0]);
23 fWR.push_back(info->getWeights()[1]);
24 } else {
25 // std::cout << "no info"<<std::endl;
26 fWL.push_back(0);
27 fWR.push_back(0);
28 }
29 // std::cout << "weights " << ((fWL)[i])<<" "<<((fWR)[i])<<"
30 // "<<((fDetIDs)[i])<<std::endl;
31 }
32}
33
34// ----- Copy constructor ----------------------------------------------
36 : TObject(ti), fDetIDs(ti.fDetIDs), fWL(ti.fWL), fWR(ti.fWR) {}
37// ----- Destructor ----------------------------------------------------
39// -------------------------------------------------------------------------
std::vector< float > fWR
Definition: TrackInfo.h:40
~TrackInfo() override
Definition: TrackInfo.cxx:38
std::vector< float > fWL
Definition: TrackInfo.h:39
std::vector< unsigned int > fDetIDs
array of measurements
Definition: TrackInfo.h:38