Belle II Software  release-06-01-15
CDCDedxWireGainAlgorithm.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 #include <reconstruction/dbobjects/CDCDedxWireGain.h>
12 #include <reconstruction/dbobjects/CDCDedxBadWires.h>
13 #include <calibration/CalibrationAlgorithm.h>
14 #include <framework/database/DBObjPtr.h>
15 #include <string>
16 #include <vector>
17 #include "TH1D.h"
18 #include "TH2F.h"
19 
20 namespace Belle2 {
30 
31  public:
32 
37 
42 
46  void setMergePayload(bool value = true) {isMergePayload = value;}
47 
51  void setMonitoringPlots(bool value = false) {isMakePlots = value;}
52 
56  void setLocalTrucation(bool value = false) {isLTruc = value;}
57 
61  void setLayerScaling(bool value = false) {isLayerScale = value;}
62 
66  void generateNewPayloads(std::vector<double> dedxTruncmean);
67 
71  void getTrucationBins(TH1D* htemp, int& binlow, int& binhigh);
72 
76  void plotBadWires(int nDeadwires, int oDeadwires, int Badwires);
77 
81  TH2F* getHistoPattern(TString badFileName, TString suffix);
82 
86  double getIndexVal(int iWire, TString what);
87 
91  double getLayerAverage(std::vector<double> tempWire);
92 
93  protected:
94 
98  virtual EResult calibrate() override;
99 
100 
101  private:
102 
109  std::string m_badWireFPath;
110  std::string m_badWireFName;
111  bool isMakePlots;
113  bool isLTruc;
115  int fdEdxBins;
116  double fdEdxMin;
117  double fdEdxMax;
118  double fTrucMin;
119  double fTrucMax;
120  int fStartRun;
121  std::vector<double> flayerAvg;
125  };
127 } // namespace Belle2
A calibration algorithm for CDC dE/dx wire gains.
bool isLayerScale
method of scaling layer avg
void setLocalTrucation(bool value=false)
funtion to set trucation method (local vs global)
double fTrucMax
max trunc range for mean
double getLayerAverage(std::vector< double > tempWire)
function to get layer avg from outer layers
TH2F * getHistoPattern(TString badFileName, TString suffix)
function to plot wires in hist with input file
int fStartRun
boundary start at this run
double fdEdxMax
max dedx range for wiregain cal
std::string m_badWireFPath
Save arithmetic and truncated mean for the 'dedx' values.
bool isMergePayload
merge payload at the of calibration
bool isLTruc
method of trunc range for mean
DBObjPtr< CDCDedxBadWires > m_DBBadWires
Bad wire DB object.
std::vector< double > flayerAvg
layer wire avg of trun mean
void setLayerScaling(bool value=false)
funtion to set layer scaling
CDCDedxWireGainAlgorithm()
Constructor: Sets the description, the properties and the parameters of the algorithm.
DBObjPtr< CDCDedxWireGain > m_DBWireGains
Wire gain DB object.
double fTrucMin
min trunc range for mean
double getIndexVal(int iWire, TString what)
function to return various CDC indexing for given wire
void setMergePayload(bool value=true)
function to decide merge vs relative gains
virtual EResult calibrate() override
Wire gain algorithm.
std::string m_badWireFName
name of bad wire file
double fdEdxMin
min dedx range for wiregain cal
void getTrucationBins(TH1D *htemp, int &binlow, int &binhigh)
function to get bins of trunction from histogram
int fdEdxBins
number of bins for dedx histogram
bool isMakePlots
produce plots for status
void setMonitoringPlots(bool value=false)
funtion to set flag active for plotting
void plotBadWires(int nDeadwires, int oDeadwires, int Badwires)
function to plot bad wire status (then and now)
void generateNewPayloads(std::vector< double > dedxTruncmean)
function to finally store new payload after full calibration
Base class for calibration algorithms.
EResult
The result of calibration.
Class for accessing objects in the database.
Definition: DBObjPtr.h:21
Abstract base class for different kinds of events.