Belle II Software  release-08-01-10
SVDPositionErrorScaleFactorImporterModule.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 #pragma once
10 
11 
12 #include <framework/core/Module.h>
13 #include <framework/datastore/StoreArray.h>
14 #include <framework/database/Database.h>
15 #include <framework/database/IntervalOfValidity.h>
16 
17 #include <svd/dataobjects/SVDHistograms.h>
18 #include <svd/dataobjects/SVDCluster.h>
19 #include <svd/dataobjects/SVDTrueHit.h>
20 
21 #include <string>
22 #include <TFile.h>
23 #include <TTree.h>
24 #include <TBranch.h>
25 #include <TH1F.h>
26 
27 namespace Belle2 {
40 
41  public:
42 
47 
49  virtual void initialize() override;
50 
52  virtual void beginRun() override;
53 
55  virtual void event() override;
56 
62  virtual void endRun() override;
63 
64  private:
65 
66  /* user-defined parameters */
67  std::string m_rootFileName;
69  std::string m_posAlgorithm = "CoGOnly";
71  bool m_noOutliers = false;
73  float m_min = -10;
74  float m_max = 10;
75  float m_nBins = 100;
76  std::string m_uniqueID = "PositionErrorScaleFactors_TEST";
81  //* ROOT file related parameters
82  TFile* m_rootFilePtr = nullptr;
83  TTree* m_tree = nullptr;
85  //tree variables
86  int m_exp = -1;
87  int m_run = -1;
88  int m_layer = -1;
89  int m_ladder = -1;
90  int m_sensor = -1;
91  int m_side = -1;
92  int m_size = -1;
93  float m_clsCharge = -1;
94  float m_clsTime = -1;
95  float m_clsPos = -1;
96  float m_clsErr = -1;
97  float m_clsResid = -1;
98  float m_clsPull = -1;
103  double oneSigma(TH1F*);
104 
105  //CLUSTER PULLS
112  const int maxSize = 5;
113  TH1F* m_hL3Pulls[5][2] = {};
114  TH1F* m_hFWPulls[5][2] = {};
115  TH1F* m_hBWPulls[5][2] = {};
116  TH1F* m_hORPulls[5][2] = {};
118  };
120 }
121 
Base class for Modules.
Definition: Module.h:72
Module that produces a localdb with position error scale factors for different position algoritms.
SVDHistograms< TH1F > * m_hClsPullSize1
cluster size 1, position error scale factor histo
TTree * m_tree
pointer at tree containing the mean and RMS of calibration constants
TH1F * m_hFWPulls[5][2]
cumulative FW pulls histograms [size][side]
TH1F * m_hORPulls[5][2]
cumulative ORIGAMI pulls histograms [size][side]
virtual void initialize() override
check presence of data objects
bool m_noOutliers
if True removes outliers from scale factor computation
SVDHistograms< TH1F > * m_hClsPullSize5
cluster size 5, position error scale factor histo
virtual void endRun() override
create cumulative histograms, compute scale factors, create payloads and import it to a localdb,...
SVDPositionErrorScaleFactorImporterModule()
Constructor: Sets the description, the properties and the parameters of the module.
SVDHistograms< TH1F > * m_hClsPullSize3
cluster size 3, position error scale factor histo
virtual void beginRun() override
initialize the TTrees and create histograms
TH1F * m_hL3Pulls[5][2]
cumulative L3 pulls histograms [size][side]
SVDHistograms< TH1F > * m_hClsPullSize2
cluster size 2, position error scale factor histo
SVDHistograms< TH1F > * m_hClsPullSize4
cluster size 4, position error scale factor histo
TH1F * m_hBWPulls[5][2]
cumulative BW pulls histograms [size][side]
double oneSigma(TH1F *)
computes the scale factor by requiring that 68% of the pull distribution is between ±1
TFile * m_rootFilePtr
pointer at root file used for storing histograms
Abstract base class for different kinds of events.