CbmRoot
CbmTofTrackCuts.cxx
Go to the documentation of this file.
1 /*
2  * CbmTofTrackCuts.cxx
3  *
4  * Created on: 31 lip 2019
5  * Author: Daniel Wielanek
6  * E-mail: daniel.wielanek@gmail.com
7  * Warsaw University of Technology, Faculty of Physics
8  */
9 #include "CbmTofTrackCuts.h"
10 #include "CbmGlobalTrack.h"
11 #include "CbmTofHit.h"
12 #include "NicaCbmTrack.h"
13 
15  : NicaTrackCut(2), fOneOverC(1.0 / 29.99792458) {
16  SetUnitName("#beta [c]", Beta());
17  SetUnitName("m^2 [GeV^2/c^4]", M2());
18  SetMinMax(0, 2, Beta());
19  SetMinMax(-10, 10, M2());
20 }
21 
22 void CbmTofTrackCuts::SetM2Cut(Double_t min, Double_t max) {
23  SetMinMax(min, max, M2());
24 }
25 
26 void CbmTofTrackCuts::SetBetaCut(Double_t min, Double_t max) {
27  SetMinMax(min, max, Beta());
28 }
29 
30 Bool_t CbmTofTrackCuts::Pass(NicaTrack* track) {
31  NicaCbmTrack* tr = (NicaCbmTrack*) track;
32  Double_t l = tr->GetTrackLenght();
33  CbmTofHit* h = tr->GetTofTrack();
34  if (h == NULL) {
35  SetValue(2, Beta());
36  SetValue(-1000, M2());
37  return ForcedUpdate(kFALSE);
38  }
39  Double_t t = h->GetTime();
40  Double_t beta = l / t / (29.9792458);
41  Double_t p = tr->GetMomentum()->P();
42  Double_t m2 = p * p * (1. / beta / beta - 1.);
43  SetValue(beta, Beta());
44  SetValue(m2, M2());
45  return Validate();
46 }
47 
49  // TODO Auto-generated destructor stub
50 }
51 
52 CbmTofM2Cut::CbmTofM2Cut() : fOneOverC(1.0 / 29.99792458) {
53  SetUnitName("m^2 [GeV^2/c^4]");
54 }
55 
56 Bool_t CbmTofM2Cut::Pass(NicaTrack* track) {
57  NicaCbmTrack* tr = (NicaCbmTrack*) track;
58  Double_t l = tr->GetTrackLenght();
59  CbmTofHit* h = tr->GetTofTrack();
60  if (h == NULL) {
61  SetValue(-1000);
62  return ForcedUpdate(kFALSE);
63  }
64  Double_t p = tr->GetMomentum()->P();
65  Double_t t = h->GetTime();
66  Double_t beta = l / t / (29.9792458);
67  Double_t m2 = p * p * (1. / beta / beta - 1.);
68  SetValue(m2);
69  Double_t min = fLowLine[0] + fLowLine[1] * p + fLowLine[2] * p * p;
70  Double_t max = fHighLine[0] + fHighLine[1] * p + fHighLine[2] * p * p;
71  if (m2 > max || m2 < min) { return ForcedUpdate(kFALSE); }
72  return Validate();
73 }
74 
76 
77 CbmTofMassCut::CbmTofMassCut() : fOneOverC(1.0 / 29.99792458) {
78  SetUnitName("m [GeV/c]");
79 }
80 
81 Bool_t CbmTofMassCut::Pass(NicaTrack* track) {
82  NicaCbmTrack* tr = (NicaCbmTrack*) track;
83  Double_t l = tr->GetTrackLenght();
84  CbmTofHit* h = tr->GetTofTrack();
85  if (h == NULL) {
86  SetValue(-1000);
87  return ForcedUpdate(kFALSE);
88  }
89  Double_t t = h->GetTime();
90  Double_t beta = l / t / (29.9792458);
91  Double_t p = tr->GetMomentum()->P();
92  Double_t gamma = 1. / (TMath::Sqrt(1. - beta * beta));
93  Double_t m = p / beta / gamma;
94  SetValue(m);
95  return Validate();
96 }
97 
99 
100 Bool_t CbmTofM2Cut::Init(Int_t format_id) {
101  fInit = kTRUE;
102  return FormatInhertis("NicaCbmEvent", format_id);
103 }
104 
106  : NicaTrackToFMass2Cut(other), fOneOverC(1.0 / 29.99792458) {
107  for (int i = 0; i < 3; i++) {
108  fLowLine[i] = other.fLowLine[i];
109  fHighLine[i] = other.fHighLine[i];
110  }
111 }
CbmTofTrackCuts.h
i
int i
Definition: L1/vectors/P4_F32vec4.h:25
CbmGlobalTrack.h
NicaCbmTrack::GetTofTrack
CbmTofHit * GetTofTrack() const
Definition: NicaCbmTrack.h:38
CbmTofM2Cut::Pass
Bool_t Pass(NicaTrack *track)
Definition: CbmTofTrackCuts.cxx:56
NicaCbmTrack
Definition: NicaCbmTrack.h:20
CbmTofM2Cut::CbmTofM2Cut
CbmTofM2Cut()
Definition: CbmTofTrackCuts.cxx:52
min
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:33
CbmTofM2Cut::Init
virtual Bool_t Init(Int_t format_id=0)
Definition: CbmTofTrackCuts.cxx:100
CbmTofMassCut::CbmTofMassCut
CbmTofMassCut()
Definition: CbmTofTrackCuts.cxx:77
CbmTofM2Cut::~CbmTofM2Cut
virtual ~CbmTofM2Cut()
Definition: CbmTofTrackCuts.cxx:75
h
Data class with information on a STS local track.
CbmTofTrackCuts::Beta
static Int_t Beta()
Definition: CbmTofTrackCuts.h:21
CbmTofM2Cut
Definition: CbmTofTrackCuts.h:29
CbmTofMassCut::Pass
Bool_t Pass(NicaTrack *track)
Definition: CbmTofTrackCuts.cxx:81
CbmTofTrackCuts::M2
static Int_t M2()
Definition: CbmTofTrackCuts.h:20
NicaCbmTrack.h
CbmTofTrackCuts::SetBetaCut
void SetBetaCut(Double_t min, Double_t max)
Definition: CbmTofTrackCuts.cxx:26
CbmTofTrackCuts::~CbmTofTrackCuts
virtual ~CbmTofTrackCuts()
Definition: CbmTofTrackCuts.cxx:48
CbmTofMassCut::~CbmTofMassCut
virtual ~CbmTofMassCut()
Definition: CbmTofTrackCuts.cxx:98
m
__m128 m
Definition: L1/vectors/P4_F32vec4.h:26
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
CbmTofTrackCuts::CbmTofTrackCuts
CbmTofTrackCuts()
Definition: CbmTofTrackCuts.cxx:14
CbmTofTrackCuts::SetM2Cut
void SetM2Cut(Double_t min, Double_t max)
Definition: CbmTofTrackCuts.cxx:22
max
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: L1/vectors/P4_F32vec4.h:36
CbmTofTrackCuts::Pass
Bool_t Pass(NicaTrack *track)
Definition: CbmTofTrackCuts.cxx:30