Belle II Software  release-05-01-25
NoKickRTSel.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Valerio Bertacchi *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <TFile.h>
12 #include <tracking/dataobjects/RecoTrack.h>
13 #include <tracking/dataobjects/hitXP.h>
14 #include <TObject.h>
15 #include <tracking/trackFindingVXD/sectorMapTools/NoKickCuts.h>
16 #include <string>
17 #include "TLatex.h"
18 #include <TH1F.h>
19 #include <TTree.h>
20 
21 #pragma once
22 
23 
24 namespace Belle2 {
35  class NoKickRTSel: public TObject {
36 
37  public:
38  std::vector<hitXP> m_hitXP;
39  std::set<hitXP, hitXP::timeCompare> m_setHitXP;
40  std::vector<hitXP> m_8hitTrack;
41  NoKickCuts m_trackCuts;
42  double m_pmax = 10.;
44  bool m_outputFlag;
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  bool m_isCutted;
55  double m_pMag;
56  double m_pt;
57  double m_pdgID;
58  int m_Ncuts;
59  TTree* m_noKickTree;
62  NoKickRTSel(const std::string& fileName, bool outputHisto) :
63  m_trackCuts(fileName)
64  {
65  m_outputFlag = false;
67  initHistoNoKick(outputHisto);
68  }
69 
71  NoKickRTSel() :
72  m_trackCuts()
73  {
75  }
76 
78  void initNoKickRTSel()
79  {
80  m_hitXP.clear();
81  m_setHitXP.clear();
82  m_8hitTrack.clear();
83  m_numberOfCuts = 0;
84  }
85 
90  void hitXPBuilder(const RecoTrack& track);
91 
97  void hit8TrackBuilder(const RecoTrack& track);
98 
99 
104  bool trackSelector(const RecoTrack& track);
105 
109  bool segmentSelector(hitXP hit1, hitXP hit2, std::vector<double> selCut, NoKickCuts::EParameters par, 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 
153  ClassDef(NoKickRTSel, 1);
154  };
156 }
Belle2::NoKickRTSel::m_momEff
TH1F * m_momEff
histogram for efficiency
Definition: NoKickRTSel.h:57
Belle2::NoKickRTSel::m_outputFlag
bool m_outputFlag
true=produce validation output
Definition: NoKickRTSel.h:52
Belle2::NoKickRTSel::m_noKickTree
TTree * m_noKickTree
TTree to which the information is written.
Definition: NoKickRTSel.h:67
Belle2::NoKickRTSel::trackSelector
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:196
Belle2::NoKickRTSel::m_trackCuts
NoKickCuts m_trackCuts
auxiliary member to apply the cuts
Definition: NoKickRTSel.h:49
Belle2::NoKickRTSel::m_setHitXP
std::set< hitXP, hitXP::timeCompare > m_setHitXP
set of hit to order the hit in time
Definition: NoKickRTSel.h:47
Belle2::NoKickRTSel::m_isCutted
bool m_isCutted
Indicator if cut is applied.
Definition: NoKickRTSel.h:62
Belle2::NoKickRTSel::m_pdgID
double m_pdgID
pdg Code
Definition: NoKickRTSel.h:65
Belle2::NoKickRTSel::m_momSel
TH1F * m_momSel
histogram of selected tracks
Definition: NoKickRTSel.h:55
Belle2::NoKickCuts::EParameters
EParameters
enum for parameters name
Definition: NoKickCuts.h:54
Belle2::NoKickRTSel::m_Ncuts
int m_Ncuts
number of times the cut is applied on a particle
Definition: NoKickRTSel.h:66
Belle2::NoKickRTSel::m_noKickOutputTFile
TFile * m_noKickOutputTFile
validartion output TFile
Definition: NoKickRTSel.h:54
Belle2::NoKickRTSel::hit8TrackBuilder
void hit8TrackBuilder(const RecoTrack &track)
this metod build a vector of hitXP from a track selecting the first hit on each layer of VXD (8 hit f...
Definition: NoKickRTSel.cc:98
Belle2::NoKickRTSel::m_hitXP
std::vector< hitXP > m_hitXP
vector of hit, to convert the track
Definition: NoKickRTSel.h:46
Belle2::NoKickRTSel::m_pt
double m_pt
transverse momentum
Definition: NoKickRTSel.h:64
Belle2::hitXP
This class collects some information of a TrueHit, using SVDCLuster and MCParticle information too.
Definition: hitXP.h:42
Belle2::NoKickRTSel::hitXPBuilder
void hitXPBuilder(const RecoTrack &track)
this method build a vector of hitXP from a track.
Definition: NoKickRTSel.cc:23
Belle2::RecoTrack
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:78
Belle2::NoKickRTSel::initNoKickRTSel
void initNoKickRTSel()
Inizialize the class cleaning the member vectors.
Definition: NoKickRTSel.h:86
Belle2::NoKickRTSel::m_PDGIDEff
TH1F * m_PDGIDEff
histogram for efficiency for each PDGID
Definition: NoKickRTSel.h:60
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::NoKickRTSel::ClassDef
ClassDef(NoKickRTSel, 1)
Making this class a ROOT class.
Belle2::NoKickRTSel::m_momCut
TH1F * m_momCut
histrogram of cutted tracks
Definition: NoKickRTSel.h:56
Belle2::NoKickRTSel::m_pmax
double m_pmax
range analyzed with cuts
Definition: NoKickRTSel.h:50
Belle2::NoKickRTSel::produceHistoNoKick
void produceHistoNoKick()
This method produce the validation histograms (to be used the endrun combined with the filling in tra...
Definition: NoKickRTSel.cc:279
Belle2::NoKickRTSel::m_pMag
double m_pMag
momentum magnitut
Definition: NoKickRTSel.h:63
Belle2::NoKickRTSel::segmentSelector
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:137
Belle2::NoKickRTSel::m_8hitTrack
std::vector< hitXP > m_8hitTrack
vector of selected hit
Definition: NoKickRTSel.h:48
Belle2::NoKickRTSel::initHistoNoKick
void initHistoNoKick(bool outHisto)
This metod initialize some validation histograms of the Training Sample Selection.
Definition: NoKickRTSel.h:128
Belle2::NoKickRTSel::m_PDGIDSel
TH1F * m_PDGIDSel
histogram for PDGID of selected track
Definition: NoKickRTSel.h:59
Belle2::NoKickRTSel::globalCut
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:113
Belle2::NoKickRTSel::m_PDGIDCut
TH1F * m_PDGIDCut
histogram for PDGID of cutted track
Definition: NoKickRTSel.h:58
Belle2::NoKickRTSel::m_nCutHit
TH1F * m_nCutHit
histogram for number of cutted hist per track
Definition: NoKickRTSel.h:61
Belle2::NoKickRTSel::NoKickRTSel
NoKickRTSel()
Empty Constructor that uses the defaults cuts file.
Definition: NoKickRTSel.h:79
Belle2::NoKickRTSel::m_numberOfCuts
int m_numberOfCuts
number of catastrophic interaction for each track
Definition: NoKickRTSel.h:51