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 {
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.;
45 TH1F* m_momSel;
46 TH1F* m_momCut;
47 TH1F* m_momEff;
48 TH1F* m_PDGIDCut;
49 TH1F* m_PDGIDSel;
50 TH1F* m_PDGIDEff;
51 TH1F* m_nCutHit;
53 double m_pMag;
54 double m_pt;
55 double m_pdgID;
56 int m_Ncuts;
57 TTree* m_noKickTree;
60 NoKickRTSel(const std::string& fileName, bool outputHisto) :
61 m_trackCuts(fileName)
62 {
63 m_outputFlag = false;
65 initHistoNoKick(outputHisto);
66 }
67
71 {
73 }
74
77 {
78 m_hitXP.clear();
79 m_setHitXP.clear();
80 m_8hitTrack.clear();
82 }
83
88 void hitXPBuilder(const RecoTrack& track);
89
95 void hit8TrackBuilder(const RecoTrack& track);
96
97
102 bool trackSelector(const RecoTrack& track);
103
107 bool segmentSelector(hitXP hit1, hitXP hit2, std::vector<double> selCut, NoKickCuts::EParameters par, bool is0 = false);
108
113 bool globalCut(const std::vector<hitXP>& track8);
114
118 void initHistoNoKick(bool outHisto)
119 {
120 if (outHisto) {
121 m_noKickOutputTFile = new TFile("TrackSelection_NoKick.root", "RECREATE");
122 m_momSel = new TH1F("m_momSel", "m_momSel", 100, 0, 4);
123 m_momCut = new TH1F("m_momCut", "m_momCut", 100, 0, 4);
124 m_momEff = new TH1F("m_momEff", "m_momEff", 100, 0, 4);
125
126 m_PDGIDSel = new TH1F("m_PDGIDSel", "m_PDGIDSel", 6000, -3000, 3000);
127 m_PDGIDCut = new TH1F("m_PDGIDCut", "m_PDGIDCut", 6000, -3000, 3000);
128 m_PDGIDEff = new TH1F("m_PDGIDEff", "m_PDGIDEff", 6000, -3000, 3000);
129
130 m_nCutHit = new TH1F("m_nCutHit", "m_nCutHit", 30, 0, 30);
131
132
133 m_noKickTree = new TTree("noKickTree", "noKickTree");
134 m_noKickTree->Branch("is_rejected", &m_isCutted);
135 m_noKickTree->Branch("p_mag", &m_pMag);
136 m_noKickTree->Branch("pt", &m_pt);
137 m_noKickTree->Branch("pdgID", &m_pdgID);
138 m_noKickTree->Branch("number_of_rejected_SP", &m_Ncuts);
139
140 m_outputFlag = true;
141 }
142
143 }
144
148 void produceHistoNoKick();
149
152 };
154}
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
This class implement some methods useful for the application of cuts evaluated in NoKickCutsEval modu...
Definition: NoKickRTSel.h:33
TFile * m_noKickOutputTFile
validation output TFile
Definition: NoKickRTSel.h:44
int m_numberOfCuts
number of catastrophic interaction for each track
Definition: NoKickRTSel.h:41
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:60
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:55
ClassDef(NoKickRTSel, 1)
Making this class a ROOT class.
void initHistoNoKick(bool outHisto)
This method initialize some validation histograms of the Training Sample Selection.
Definition: NoKickRTSel.h:118
TH1F * m_momEff
histogram for efficiency
Definition: NoKickRTSel.h:47
void hitXPBuilder(const RecoTrack &track)
this method build a vector of hitXP from a track.
Definition: NoKickRTSel.cc:21
TTree * m_noKickTree
TTree to which the information is written.
Definition: NoKickRTSel.h:57
void initNoKickRTSel()
Initialize the class cleaning the member vectors.
Definition: NoKickRTSel.h:76
TH1F * m_PDGIDCut
histogram for PDGID of cut track
Definition: NoKickRTSel.h:48
TH1F * m_PDGIDSel
histogram for PDGID of selected track
Definition: NoKickRTSel.h:49
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).
Definition: NoKickRTSel.cc:111
NoKickRTSel()
Empty Constructor that uses the defaults cuts file.
Definition: NoKickRTSel.h:69
double m_pMag
momentum magnitut
Definition: NoKickRTSel.h:53
TH1F * m_PDGIDEff
histogram for efficiency for each PDGID
Definition: NoKickRTSel.h:50
TH1F * m_momCut
histogram of cut tracks
Definition: NoKickRTSel.h:46
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...
Definition: NoKickRTSel.cc:194
bool segmentSelector(hitXP hit1, hitXP hit2, std::vector< double > selCut, NoKickCuts::EParameters par, bool is0=false)
This method return true if a couple of hits resects the cuts constraints.
Definition: NoKickRTSel.cc:135
void produceHistoNoKick()
This method produce the validation histograms (to be used the endrun combined with the filling in tra...
Definition: NoKickRTSel.cc:277
bool m_isCutted
Indicator if cut is applied.
Definition: NoKickRTSel.h:52
bool m_outputFlag
true=produce validation output
Definition: NoKickRTSel.h:42
TH1F * m_nCutHit
histogram for number of cut hist per track
Definition: NoKickRTSel.h:51
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:45
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 ...
Definition: NoKickRTSel.cc:96
double m_pt
transverse momentum
Definition: NoKickRTSel.h:54
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.