Belle II Software development
NoKickRTSel.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <TFile.h>
10#include <tracking/dataobjects/RecoTrack.h>
11#include <tracking/dataobjects/hitXP.h>
12#include <TObject.h>
13#include <tracking/trackFindingVXD/sectorMapTools/NoKickCuts.h>
14#include <string>
15#include <TLatex.h>
16#include <TH1F.h>
17#include <TTree.h>
18
19#pragma once
20
21
22namespace Belle2 {
27
32
33 class NoKickRTSel: public TObject {
34
35 public:
36 std::vector<hitXP> m_hitXP;
37 std::set<hitXP, hitXP::timeCompare> m_setHitXP;
38 std::vector<hitXP> m_8hitTrack;
40 double m_pmax = 10.;
41 double m_pMag;
42 double m_pt;
43 double m_pdgID;
44
46 TTree* m_noKickTree;
47 TH1F* m_momSel;
48 TH1F* m_momCut;
49 TH1F* m_momEff;
50 TH1F* m_PDGIDCut;
51 TH1F* m_PDGIDSel;
52 TH1F* m_PDGIDEff;
53 TH1F* m_nCutHit;
54
56 int m_Ncuts;
59
61 NoKickRTSel(const std::string& fileName, bool outputHisto) :
62 m_trackCuts(fileName)
63 {
64 m_outputFlag = false;
66 initHistoNoKick(outputHisto);
67 }
68
72 {
74 }
75
78 {
79 m_hitXP.clear();
80 m_setHitXP.clear();
81 m_8hitTrack.clear();
83 }
84
89 void hitXPBuilder(const RecoTrack& track);
90
96 void hit8TrackBuilder(const RecoTrack& track);
97
98
103 bool trackSelector(const RecoTrack& track);
104
108 bool segmentSelector(const hitXP& hit1, const hitXP& hit2, const std::vector<double>& selCut, NoKickCuts::EParameters par,
109 bool is0 = false);
110
115 bool globalCut(const std::vector<hitXP>& track8);
116
120 void initHistoNoKick(bool outHisto)
121 {
122 if (outHisto) {
123 m_noKickOutputTFile = new TFile("TrackSelection_NoKick.root", "RECREATE");
124 m_momSel = new TH1F("m_momSel", "m_momSel", 100, 0, 4);
125 m_momCut = new TH1F("m_momCut", "m_momCut", 100, 0, 4);
126 m_momEff = new TH1F("m_momEff", "m_momEff", 100, 0, 4);
127
128 m_PDGIDSel = new TH1F("m_PDGIDSel", "m_PDGIDSel", 6000, -3000, 3000);
129 m_PDGIDCut = new TH1F("m_PDGIDCut", "m_PDGIDCut", 6000, -3000, 3000);
130 m_PDGIDEff = new TH1F("m_PDGIDEff", "m_PDGIDEff", 6000, -3000, 3000);
131
132 m_nCutHit = new TH1F("m_nCutHit", "m_nCutHit", 30, 0, 30);
133
134
135 m_noKickTree = new TTree("noKickTree", "noKickTree");
136 m_noKickTree->Branch("is_rejected", &m_isCutted);
137 m_noKickTree->Branch("p_mag", &m_pMag);
138 m_noKickTree->Branch("pt", &m_pt);
139 m_noKickTree->Branch("pdgID", &m_pdgID);
140 m_noKickTree->Branch("number_of_rejected_SP", &m_Ncuts);
141
142 m_outputFlag = true;
143 }
144
145 }
146
150 void produceHistoNoKick();
151
154 };
155
156}
This class is an auxiliary class that implement methods to access to a single cut,...
Definition NoKickCuts.h:25
EParameters
enum for parameters name
Definition NoKickCuts.h:44
TFile * m_noKickOutputTFile
validation output TFile
Definition NoKickRTSel.h:45
int m_numberOfCuts
number of catastrophic interaction for each track
Definition NoKickRTSel.h:55
NoKickCuts m_trackCuts
auxiliary member to apply the cuts
Definition NoKickRTSel.h:39
double m_pmax
range analyzed with cuts
Definition NoKickRTSel.h:40
std::vector< hitXP > m_8hitTrack
vector of selected hit
Definition NoKickRTSel.h:38
NoKickRTSel(const std::string &fileName, bool outputHisto)
Constructor with input file for use specific cuts file and allows validation.
Definition NoKickRTSel.h:61
int m_Ncuts
number of times the cut is applied on a particle
Definition NoKickRTSel.h:56
double m_pdgID
pdg Code
Definition NoKickRTSel.h:43
void initHistoNoKick(bool outHisto)
This method initialize some validation histograms of the Training Sample Selection.
TH1F * m_momEff
histogram for efficiency
Definition NoKickRTSel.h:49
void hitXPBuilder(const RecoTrack &track)
this method build a vector of hitXP from a track.
bool segmentSelector(const hitXP &hit1, const hitXP &hit2, const std::vector< double > &selCut, NoKickCuts::EParameters par, bool is0=false)
This method return true if a couple of hits resects the cuts constraints.
TTree * m_noKickTree
TTree to which the information is written.
Definition NoKickRTSel.h:46
void initNoKickRTSel()
Initialize the class cleaning the member vectors.
Definition NoKickRTSel.h:77
TH1F * m_PDGIDCut
histogram for PDGID of cut track
Definition NoKickRTSel.h:50
TH1F * m_PDGIDSel
histogram for PDGID of selected track
Definition NoKickRTSel.h:51
bool globalCut(const std::vector< hitXP > &track8)
This method make some global cuts on the tracks (layer 3 and 6 required, d0 and z0 inside beam pipe).
NoKickRTSel()
Empty Constructor that uses the defaults cuts file.
Definition NoKickRTSel.h:70
double m_pMag
momentum magnitut
Definition NoKickRTSel.h:41
TH1F * m_PDGIDEff
histogram for efficiency for each PDGID
Definition NoKickRTSel.h:52
TH1F * m_momCut
histogram of cut tracks
Definition NoKickRTSel.h:48
std::set< hitXP, hitXP::timeCompare > m_setHitXP
set of hit to order the hit in time
Definition NoKickRTSel.h:37
bool trackSelector(const RecoTrack &track)
This method return true if every segment (see segmentSelector) of the input track respects the cuts c...
void produceHistoNoKick()
This method produce the validation histograms (to be used the endrun combined with the filling in tra...
bool m_isCutted
Indicator if cut is applied.
Definition NoKickRTSel.h:58
bool m_outputFlag
true=produce validation output
Definition NoKickRTSel.h:57
TH1F * m_nCutHit
histogram for number of cut hist per track
Definition NoKickRTSel.h:53
ClassDef(NoKickRTSel, 2)
Making this class a ROOT class.
std::vector< hitXP > m_hitXP
vector of hit, to convert the track
Definition NoKickRTSel.h:36
TH1F * m_momSel
histogram of selected tracks
Definition NoKickRTSel.h:47
void hit8TrackBuilder(const RecoTrack &track)
this method build a vector of hitXP from a track selecting the first hit on each layer of VXD (8 hit ...
double m_pt
transverse momentum
Definition NoKickRTSel.h:42
This is the Reconstruction Event-Data Model Track.
Definition RecoTrack.h:79
This class collects some information of a TrueHit, using SVDCLuster and MCParticle information too.
Definition hitXP.h:32
Abstract base class for different kinds of events.