CbmRoot
Loading...
Searching...
No Matches
CbmMvdHit.cxx
Go to the documentation of this file.
1/* Copyright (C) 2006-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Philipp Sitzmann, Volker Friese [committer], Florian Uhlig */
4
5// -------------------------------------------------------------------------
6// ----- CbmMvdHit source file -----
7// ----- Created 07/11/06 by V. Friese -----
8// ----- Based on CbmStsMapsHit by M. Deveaux -----
9// -------------------------------------------------------------------------
10
11#include "CbmMvdHit.h"
12
13#include <Logger.h> // for Logger, LOG
14
15// ----- Default constructor -------------------------------------------
17 : CbmPixelHit()
18 , fFlag(-1)
19 , fClusterIndex(-1)
20 , fIndexCentralX(-1)
21 , fIndexCentralY(-1)
22 , fDetectorID(-1)
23{
24 SetTime(0.);
25 SetTimeError(0.);
26}
27// -------------------------------------------------------------------------
28
29
30// ----- Standard constructor ------------------------------------------
31CbmMvdHit::CbmMvdHit(int32_t statNr, TVector3& pos, TVector3& dpos, int32_t indexCentralX, int32_t indexCentralY,
32 int32_t clusterIndex, int32_t flag)
33 : CbmPixelHit(0, pos, dpos, 0., -1)
34 , fFlag(flag)
35 , fClusterIndex(clusterIndex)
36 , fIndexCentralX(indexCentralX)
37 , fIndexCentralY(indexCentralY)
38 , fDetectorID(-1)
39{
40 fDetectorID = DetectorId(statNr);
41 SetTime(0.);
42 SetTimeError(0.);
43}
44// -------------------------------------------------------------------------
45/*
46void CbmMvdHit::GetDigiIndexVector(TClonesArray* cbmMvdClusterArray, std::vector<int32_t>* digiIndexVector)
47{
48 CbmMvdCluster* cluster;
49
50 if(!digiIndexVector){digiIndexVector=new std::vector<int32_t>;}
51 if(digiIndexVector->size()!=0){digiIndexVector->clear();}
52
53 int32_t indexLow=fClusterIndex;
54
55 while (indexLow!=-1) {
56 cluster=(CbmMvdCluster*) cbmMvdClusterArray->At(indexLow);
57 indexLow=cluster->GetNeighbourDown();
58 }
59
60 int32_t* digiArray;
61 int32_t digisInCluster;
62 int32_t indexUp=0;
63
64 while (indexUp!=-1) {
65 digiArray = cluster->GetDigiList();
66 digisInCluster=cluster->GetTotalDigisInCluster();
67
68 for (int32_t i=0;i<digisInCluster; i++){
69 digiIndexVector->push_back(digiArray[i]);
70 };
71
72 indexUp=cluster->GetNeighbourUp();
73
74 }
75
76 if(static_cast<size_t>(cluster->GetTotalDigisInCluster())!=digiIndexVector->size()) {
77 LOG(warn) << "Inconsistent number of digis in cluster. Ignored. ";
78 }
79
80
81
82
83
84};
85*/
86// ----- Destructor ----------------------------------------------------
88// -------------------------------------------------------------------------
89
90
91// ----- Public method Print -------------------------------------------
92void CbmMvdHit::Print(const Option_t* /*opt*/) const
93{
94 LOG(info) << "MvdHit in station " << GetStationNr() << " at (" << GetX() << ", " << GetY() << ", " << GetZ()
95 << ") cm";
96}
97// -------------------------------------------------------------------------
98
99
ClassImp(CbmConverterManager)
TVector3 dpos
void SetTimeError(double error)
Definition CbmHit.h:91
double GetZ() const
Definition CbmHit.h:71
void SetTime(double time)
Definition CbmHit.h:85
int32_t DetectorId(int32_t iStation) const
virtual void Print(const Option_t *opt=nullptr) const
Definition CbmMvdHit.cxx:92
virtual int32_t GetStationNr() const
Definition CbmMvdHit.h:61
int32_t fDetectorID
Definition CbmMvdHit.h:84
virtual ~CbmMvdHit()
Definition CbmMvdHit.cxx:87
double GetY() const
Definition CbmPixelHit.h:74
double GetX() const
Definition CbmPixelHit.h:73