Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TrackTpcToFThresholdlessCut.cxx
1/*
2 * TrackTpcToFCut2.cxx
3 *
4 * Created on: 17 lip 2018
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "TrackTpcToFThresholdlessCut.h"
10
11#include "DataFormat.h"
12#include "ExpTrack.h"
13
14namespace Hal {
15 TrackTpcToFThresholdlessCut::TrackTpcToFThresholdlessCut(TrackTpcCut* tpc, TrackToFMass2Cut* tof) : TrackTpcToFCut(tpc, tof) {}
16
17 Bool_t TrackTpcToFThresholdlessCut::Pass(Track* tr) {
18 TpcTrack* track_tpc = (TpcTrack*) ((ExpTrack*) tr)->GetDetTrack(DetectorID::kTPC);
19 ToFTrack* track_tof = (ToFTrack*) ((ExpTrack*) tr)->GetDetTrack(DetectorID::kTOF);
20 SetValue(track_tof->GetMass2(), 7);
21 SetValue(track_tpc->GetSigmaPion(), PionSigma());
22 SetValue(track_tpc->GetSigmaKaon(), KaonSigma());
23 SetValue(track_tpc->GetSigmaProton(), ProtonSigma());
24 SetValue(track_tpc->GetSigmaElectron(), ElectronSigma());
25 SetValue(track_tpc->GetDeDx(), DeDx());
26 SetValue(tr->GetCharge(), Charge());
27 SetValue(track_tpc->GetNHits(), TpcHits());
28 Bool_t require_tof = kFALSE;
29 for (int i = 0; i < 4; i++) {
30 Int_t par = i + PionSigma();
31 Double_t sigma = GetValue(par);
32 if (par == fTpc->GetActiveSigma()) { // active sigma veryfication
33 if (sigma < GetMin(par)) return ForcedUpdate(kFALSE);
34 if (sigma > GetMax(par)) return ForcedUpdate(kFALSE);
35 } else {
36 if (sigma > GetMin(par) && sigma < GetMax(par)) // overlapping dedx require tof
37 require_tof = kTRUE;
38 }
39 }
40 Double_t m2 = fToF->GetValue(0);
41 if (require_tof) {
42 if (m2 == 0.0 || m2 < -1) return ForcedUpdate(kFALSE); // no tof data
43 }
44 if (m2 == 0.0 || m2 < -1) return ForcedUpdate(kTRUE); // no tof data accept
45 if (m2 < fToF->GetMin()) return ForcedUpdate(kFALSE);
46 if (m2 > fToF->GetMax()) return ForcedUpdate(kFALSE);
47 return ForcedUpdate(kTRUE);
48 }
49
50 TrackTpcToFThresholdlessCut::~TrackTpcToFThresholdlessCut() {}
51} // namespace Hal
Float_t GetMass2() const
Definition ToFTrack.h:60
Float_t GetSigmaPion() const
Definition TpcTrack.h:54
Float_t GetDeDx() const
Definition TpcTrack.h:94
Int_t GetNHits() const
Definition TpcTrack.h:49
Float_t GetSigmaProton() const
Definition TpcTrack.h:64
Float_t GetSigmaKaon() const
Definition TpcTrack.h:59
Float_t GetSigmaElectron() const
Definition TpcTrack.h:69
Double_t GetCharge() const
Definition Track.h:184