Belle II Software  release-08-01-10
CDCDedxValidation.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 
10 #pragma once
11 
12 #include <framework/core/HistoModule.h>
13 #include <framework/datastore/StoreArray.h>
14 #include <framework/dataobjects/EventMetaData.h>
15 #include <framework/database/DBObjPtr.h>
16 
17 #include <mdst/dataobjects/TrackFitResult.h>
18 
19 #include <reconstruction/dataobjects/CDCDedxTrack.h>
20 #include <reconstruction/dbobjects/CDCDedxRunGain.h>
21 
22 
23 #include "TH1D.h"
24 #include "TF1.h"
25 #include "TList.h"
26 #include "TFile.h"
27 #include "TString.h"
28 
29 namespace Belle2 {
43 
44  public:
45 
51 
56 
61  virtual void initialize() override;
62 
67  virtual void beginRun() override;
68 
73  virtual void event() override;
74 
79  virtual void endRun() override;
80 
85  virtual void terminate() override;
86 
87 
92  void DefineHistograms(TString level, Int_t iR);
93 
98  void FillHistograms(CDCDedxTrack* dedxTrack, const TrackFitResult* mTrack);
99 
104  void ExtractHistograms(TString level);
105 
110  Bool_t IsSelectedTrack(const TrackFitResult* mTrack);
111 
116  void setD0Cut(Double_t value) {fD0Window = value;}
117 
122  void setZ0Cut(Double_t value) {fZ0Window = value;}
123 
124 
125  private:
126 
136  Double_t fD0Window;
137  Double_t fZ0Window;
138  Int_t fnRunCounter;
139  Int_t fiRun;
141  Int_t fnBinsdedx;
142  Double_t fnBinsdedxLE;
143  Double_t fnBinsdedxUE;
145  Int_t fnRuns;
147  Double_t fcRunGain;
148  Double_t fTrkEoverP;
150  TFile* fFileOutput = nullptr;
151  TList* fBasic = nullptr;
152  TList* fPRdEdx = nullptr;
153  TList* fPRdEdxinP = nullptr;
155  std::string fOutFileName;
156  std::string fCollType;
158  std::vector<Double_t> TotMean;
159  std::vector<Double_t> TotMeanE;
160  std::vector<Double_t> TotSigma;
161  std::vector<Double_t> TotSigmaE;
162  std::vector<Int_t> TotRunN;
164  std::vector<TH1D*> hdEdx_PR;
167  };
168 
170 }
Debug output for CDCDedxPID module.
Definition: CDCDedxTrack.h:25
First version commited on Feb 21 2019 Extracts dE/dx information for validation and writes a ROOT fil...
std::vector< Double_t > TotMean
Mean of dedx by Fit.
Double_t fnBinsdedxUE
up edge of dedx
void FillHistograms(CDCDedxTrack *dedxTrack, const TrackFitResult *mTrack)
Filling histograms This will fill histogram defined histograms in above function.
TFile * fFileOutput
Write final objects to file for RG.
std::string fOutFileName
name of output ROOT file
Double_t fcRunGain
existing run gain
Int_t fCurrentRunNum
current run number
DBObjPtr< CDCDedxRunGain > m_DBRunGain
Run gain DB object.
Int_t fnRunCounter
Total runs used counter.
void setD0Cut(Double_t value)
d0 Selection set/change d0 while executing this module from external script
TList * fBasic
List of basic histos.
virtual void initialize() override
Initialize This is inherited from base class.
std::vector< TH1D * > hdEdx_PR
histogram array per run
virtual void event() override
fuction to execute event (event by event) This is inherited from base class
std::vector< Double_t > TotSigma
Sigma of dedx by Fit.
CDCDedxValidationModule()
Default constructor contain list of members with initial values.
TList * fPRdEdxinP
list per run dedx in P histos
Double_t fTrkEoverP
E/p ratio for cut.
virtual void endRun() override
fuction is called after each event This is inherited from base class
std::vector< Int_t > TotRunN
veector array of runs processed
virtual void terminate() override
Terminate after all data processed This is inherited from base class.
std::vector< Double_t > TotSigmaE
Sigma Error of dedx by Fit.
std::vector< Double_t > TotMeanE
Mean Error of dedx by Fit.
void setZ0Cut(Double_t value)
z0 Selection set/change z0 while executing this module from external script
virtual ~CDCDedxValidationModule()
Default destructor.
virtual void beginRun() override
Fuction to execute each run This is inherited from base class.
StoreArray< CDCDedxTrack > m_cdcDedxTracks
Data members for objects, cuts and others.
Double_t fnBinsdedxLE
low edge of dedx
TList * fPRdEdx
List of per run dedx histos.
void ExtractHistograms(TString level)
Extrating histogram and some calucation Higher level histograms are filled after each run or full pro...
void DefineHistograms(TString level, Int_t iR)
Defination of histograms This contain a list of histogram for validation.
Int_t fnRuns
Number of runs ref.
Int_t fiRun
Current run number.
Int_t fnBinsdedx
nbin of dedx range
std::string fCollType
collision type
Bool_t IsSelectedTrack(const TrackFitResult *mTrack)
Track selection A clean way to impliment selections on tracks (so far few only)
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
Values of the result of a track fit with a given particle hypothesis.
Abstract base class for different kinds of events.