File indexing completed on 2025-08-06 08:14:00
0001 #pragma once
0002
0003 #include "HistSetting.hh"
0004
0005 class MipHist
0006 {
0007 private:
0008 int bin_num_ = 20;
0009 int color_ = kBlack;
0010
0011 double xmin_ = 0;
0012 double xmax_ = 600;
0013 double modification_factor_ = 0.35;
0014 double alpha_ = 0.1;
0015
0016 string name_;
0017 string title_;
0018 string tag_ = "";;
0019
0020 bool does_adc7_correction_ = true;
0021 bool does_adc14_correction_ = true;
0022
0023 TH1D* hist_raw_;
0024 TH1D* hist_;
0025 TH1D* hist_shc_adc7_;
0026 TH1D* hist_dhc_adc14_;
0027 TF1* f_;
0028
0029 void Fill( TH1D* hist, int val );
0030 void Init();
0031 void ModifyAdc( TH1D* hist_ref, double power_factor );
0032
0033 public:
0034 MipHist( string name, string title );
0035
0036 void Fill( int val );
0037 void FillAll( int val, bool is_single, bool is_double );
0038 void FillSingleHitCluster( int val );
0039 void FillDoubleHitCluster( int val );
0040
0041 void DrawLine( TF1* f );
0042
0043 int GetColor(){ return color_;};
0044 double GetAlpha(){ return alpha_;}
0045 TF1* GetFunction(){ return f_;};
0046 TH1D* GetHist(){ return hist_;};
0047 TF1* GetNormalizedFunction( double top_val = 1.0);
0048 TH1D* GetNormalizedHist( double top_val = 1.0 );
0049 string GetTag(){ return tag_;};
0050
0051 void ModifyAdc();
0052 void SetColorAlpha( int color, double alpha, bool does_all = false );
0053 void SetAdc7Correction( bool flag=true ){ does_adc7_correction_ = flag; };
0054 void SetAdc14Correction( bool flag=true ){ does_adc14_correction_ = flag; };
0055 void SetTag( string tag ){ tag_ = tag;}
0056
0057 void Print();
0058 };
0059
0060
0061 #ifndef MipHist_cc
0062 #include "MipHist.cc"
0063 #endif