CbmRoot
CbmRichTrackExtrapolationLittrack.cxx
Go to the documentation of this file.
1 
8 
12 
13 #include "CbmGlobalTrack.h"
14 #include "CbmStsTrack.h"
15 #include "FairRootManager.h"
16 #include "FairTrackParam.h"
17 
18 #include "TClonesArray.h"
19 
20 #include <iostream>
21 
22 using std::cout;
23 using std::endl;
24 
26  : CbmRichTrackExtrapolationBase(), fStsTracks(0), fLitPropagator() {}
27 
29 
31  FairRootManager* ioman = FairRootManager::Instance();
32  if (NULL == ioman) {
33  Fatal("CbmRichTrackExtrapolationLittrack::Init",
34  "RootManager not instantised!");
35  }
36 
37  fStsTracks = (TClonesArray*) ioman->GetObject("StsTrack");
38  if (NULL == fStsTracks) {
39  Fatal("CbmRichTrackExtrapolationLittrack::Init", "No StsTrack array!");
40  }
41 
43 }
44 
46  TClonesArray* globalTracks,
47  TClonesArray* extrapolatedTrackParams,
48  double z) {
49  cout << "CbmRichTrackExtrapolationLittrack::DoExtrapolation" << endl;
50  if (NULL == extrapolatedTrackParams) {
51  cout << "-E- CbmRichTrackExtrapolationLittrack::DoExtrapolate: "
52  "TrackParamArray missing!"
53  << endl;
54  return;
55  }
56 
57  if (NULL == globalTracks) {
58  cout << "-E- CbmRichTrackExtrapolationLittrack::DoExtrapolate: Track Array "
59  "missing!"
60  << endl;
61  return;
62  }
63 
64  Int_t nTracks = globalTracks->GetEntriesFast();
65  for (Int_t iTrack = 0; iTrack < nTracks; iTrack++) {
66  CbmGlobalTrack* gTrack = (CbmGlobalTrack*) globalTracks->At(iTrack);
67  new ((*extrapolatedTrackParams)[iTrack]) FairTrackParam();
68  Int_t idSTS = gTrack->GetStsTrackIndex();
69  if (idSTS < 0) continue;
70  CbmStsTrack* pSTStr = (CbmStsTrack*) fStsTracks->At(idSTS);
71  if (NULL == pSTStr) continue;
72 
73  CbmLitTrackParam litInParam, litOutParam;
75  pSTStr->GetParamLast(), &litInParam);
76  std::vector<litfloat> F(25);
77  litfloat length = 0;
78 
79  fLitPropagator->Propagate(&litInParam, &litOutParam, z, 11, &F, &length);
80 
81  FairTrackParam outParam;
83  &litOutParam, &outParam);
84 
85  *(FairTrackParam*) (extrapolatedTrackParams->At(iTrack)) = outParam;
86  }
87 }
CbmLitToolFactory::CreateTrackPropagator
static TrackPropagatorPtr CreateTrackPropagator(const string &name)
Create track propagation tool by name.
Definition: CbmLitToolFactory.cxx:58
litfloat
double litfloat
Definition: CbmLitFloat.h:15
CbmTrack::GetParamLast
const FairTrackParam * GetParamLast() const
Definition: CbmTrack.h:62
CbmRichTrackExtrapolationLittrack::CbmRichTrackExtrapolationLittrack
CbmRichTrackExtrapolationLittrack()
Default constructor.
Definition: CbmRichTrackExtrapolationLittrack.cxx:25
CbmLitTrackParam
Data class for track parameters.
Definition: CbmLitTrackParam.h:29
CbmLitToolFactory.h
Tool factory for creation of littrack algorithms.
CbmRichTrackExtrapolationLittrack::fStsTracks
TClonesArray * fStsTracks
Definition: CbmRichTrackExtrapolationLittrack.h:58
CbmGlobalTrack.h
CbmRichTrackExtrapolationLittrack::Init
virtual void Init()
Inherited from CbmRichTrackExtrapolationBase.
Definition: CbmRichTrackExtrapolationLittrack.cxx:30
CbmLitConverterFairTrackParam::CbmLitTrackParamToFairTrackParam
static void CbmLitTrackParamToFairTrackParam(const CbmLitTrackParam *litPar, FairTrackParam *par)
Definition: CbmLitConverterFairTrackParam.h:110
CbmStsTrack.h
Data class for STS tracks.
CbmGlobalTrack::GetStsTrackIndex
Int_t GetStsTrackIndex() const
Definition: CbmGlobalTrack.h:38
CbmRichTrackExtrapolationLittrack::fLitPropagator
TrackPropagatorPtr fLitPropagator
Definition: CbmRichTrackExtrapolationLittrack.h:59
CbmLitConverterFairTrackParam.h
CbmLitTGeoTrackPropagator.h
CbmGlobalTrack
Definition: CbmGlobalTrack.h:26
CbmRichTrackExtrapolationLittrack::~CbmRichTrackExtrapolationLittrack
virtual ~CbmRichTrackExtrapolationLittrack()
Destructor.
Definition: CbmRichTrackExtrapolationLittrack.cxx:28
CbmRichTrackExtrapolationLittrack.h
"TrackExtrapolation" from STS tracks based on Littrack. It reads the track array form STS and extrapo...
CbmRichTrackExtrapolationBase
Definition: CbmRichTrackExtrapolationBase.h:15
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmRichTrackExtrapolationLittrack::DoExtrapolation
virtual void DoExtrapolation(TClonesArray *globalTracks, TClonesArray *extrapolatedTrackParams, double z)
Inherited from CbmRichTrackExtrapolationBase.
Definition: CbmRichTrackExtrapolationLittrack.cxx:45
CbmLitConverterFairTrackParam::FairTrackParamToCbmLitTrackParam
static void FairTrackParamToCbmLitTrackParam(const FairTrackParam *par, CbmLitTrackParam *litPar)
Definition: CbmLitConverterFairTrackParam.h:40