CbmRoot
CbmStsTrackMapProducer.cxx
Go to the documentation of this file.
1 /*
2  * CbmStsTrackMapProducer.cxx
3  *
4  * Created on: 7 sie 2019
5  * Author: Daniel Wielanek
6  * E-mail: daniel.wielanek@gmail.com
7  * Warsaw University of Technology, Faculty of Physics
8  */
10 #include "CbmStsHit.h"
11 #include "CbmStsTrack.h"
12 #include <bitset>
13 #include <iostream>
15  fStsHits = new NicaTrackClones("CbmStsHit", "StsHit", "STS");
16  fStsTracks = new NicaTrackClones("CbmStsTrack", "StsTrack", "STS");
17 }
18 
20  fStsHits->GetFromTree();
21  fStsTracks->GetFromTree();
22  return kSUCCESS;
23 }
24 
25 void CbmStsTrackMapProducer::Exec(Option_t* /*opt*/) {
26  for (int i = 0; i < fStsTracks->GetEntriesFast(); i++) {
27  CbmStsTrack* track = (CbmStsTrack*) fStsTracks->UncheckedAt(i);
28  Int_t hits = track->GetNofStsHits();
29  UShort_t bitmap = 0;
30  Int_t stations[8] = {0};
31  for (int j = 0; j < hits; j++) {
32  CbmStsHit* hit =
33  (CbmStsHit*) fStsHits->UncheckedAt(track->GetHitIndex(j));
34  Int_t station_no = GetStation(hit);
35  stations[station_no]++;
36  }
37  for (int j = 0; j < 8; j++) {
38  switch (stations[j]) {
39  case 0: //do nothing
40  break;
41  case 1: //one hit per station
42  SETBIT(bitmap, j * 2);
43  break;
44  default: //at least two hits in station
45  std::cout << "MULTIPLE HIT ! " << std::endl;
46  SETBIT(bitmap, j * 2);
47  SETBIT(bitmap, j * 2 + 1);
48  break;
49  }
50  }
51  // track->SetStationMap(bitmap);
52  std::cout << std::bitset<16>(bitmap) << std::endl;
53  }
54 }
55 
57  Int_t z = hit->GetZ();
58  if (z < 35) return 0;
59  if (z < 45) return 1;
60  if (z < 55) return 2;
61  if (z < 65) return 3;
62  if (z < 75) return 4;
63  if (z < 85) return 5;
64  if (z < 95) return 6;
65  if (z < 105) return 7;
66  if (z < 115) return 8;
67  z = hit->GetZ() - 25;
68 
69 
70  return (z - z % 10) / 10;
71 }
72 
74  // TODO Auto-generated destructor stub
75 }
CbmStsTrackMapProducer::fStsHits
NicaTrackClones * fStsHits
Definition: CbmStsTrackMapProducer.h:17
CbmHit::GetZ
Double_t GetZ() const
Definition: CbmHit.h:70
CbmStsTrackMapProducer::Init
InitStatus Init()
Definition: CbmStsTrackMapProducer.cxx:19
CbmStsTrackMapProducer::GetStation
Int_t GetStation(CbmStsHit *hit) const
Definition: CbmStsTrackMapProducer.cxx:56
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmStsTrackMapProducer::CbmStsTrackMapProducer
CbmStsTrackMapProducer()
Definition: CbmStsTrackMapProducer.cxx:14
CbmStsTrackMapProducer.h
CbmStsTrackMapProducer::~CbmStsTrackMapProducer
virtual ~CbmStsTrackMapProducer()
Definition: CbmStsTrackMapProducer.cxx:73
CbmStsHit
data class for a reconstructed 3-d hit in the STS
Definition: CbmStsHit.h:31
CbmStsTrack.h
Data class for STS tracks.
CbmTrack::GetHitIndex
Int_t GetHitIndex(Int_t iHit) const
Definition: CbmTrack.h:54
CbmStsTrackMapProducer::Exec
void Exec(Option_t *)
Definition: CbmStsTrackMapProducer.cxx:25
hits
static vector< vector< QAHit > > hits
Definition: CbmTofHitFinderTBQA.cxx:114
CbmStsTrackMapProducer::fStsTracks
NicaTrackClones * fStsTracks
Definition: CbmStsTrackMapProducer.h:18
CbmStsTrack
Definition: CbmStsTrack.h:37
CbmStsHit.h
Data class for a reconstructed hit in the STS.
CbmStsTrack::GetNofStsHits
Int_t GetNofStsHits() const
Definition: CbmStsTrack.h:90