File indexing completed on 2025-08-09 08:12:19
0001 #ifndef TRACKLETHISTOGRAM_H
0002 #define TRACKLETHISTOGRAM_H
0003
0004 #include <iostream>
0005 #include <vector>
0006 #include <string>
0007 #include <numeric>
0008
0009 #include <TFile.h>
0010 #include <TTree.h>
0011 #include <TH2D.h>
0012 #include <TH1D.h>
0013 #include <TMath.h>
0014 #include <TF1.h>
0015 #include <TProfile.h>
0016 #include <TCanvas.h>
0017 #include <TPad.h>
0018 #include <TGraphErrors.h>
0019 #include <TLatex.h>
0020
0021 #include <TCanvas.h> // note : for the combined case
0022 #include <TGraph.h> // note : for the combined case
0023
0024 #include <TRandom.h> // note : for the offset
0025 #include <TRandom3.h> // note : for the offset
0026
0027 #include <TColor.h>
0028
0029 #include <TObjArray.h>
0030
0031 #include "../EvtVtxZTracklet/structure.h"
0032
0033 #include "TrackletHistogramFill.h"
0034
0035 #include "../Constants.h"
0036
0037 class TrackletHistogram{
0038 public:
0039 TrackletHistogram(
0040 int process_id_in,
0041 int runnumber_in,
0042 int run_nEvents_in,
0043 std::string input_directory_in,
0044 std::string input_file_name_in,
0045 std::string output_directory_in,
0046 std::string output_file_name_suffix_in,
0047
0048 std::pair<bool, TH1D*> vtxZReweight_in,
0049 bool BcoFullDiffCut_in,
0050 bool INTT_vtxZ_QA_in,
0051 bool isWithRotate_in,
0052 std::pair<bool, std::pair<double, double>> isClusQA_in
0053 );
0054
0055 std::string GetOutputFileName() {return tracklet_histogram_fill -> GetOutputFileName();}
0056 void SetVtxZReweightHist(TH1D * input_hist) {tracklet_histogram_fill -> SetVtxZReweightHist(input_hist);}
0057 void MainProcess();
0058 void EndRun();
0059
0060 protected:
0061
0062 int process_id;
0063 int runnumber;
0064 int run_nEvents;
0065 std::string input_directory;
0066 std::string input_file_name;
0067 std::string output_directory;
0068 std::string output_file_name_suffix;
0069
0070 std::pair<bool, TH1D*> vtxZReweight;
0071 bool BcoFullDiffCut;
0072 bool INTT_vtxZ_QA;
0073 bool isWithRotate;
0074 std::pair<bool, std::pair<double, double>> isClusQA;
0075
0076
0077 TrackletHistogramFill * tracklet_histogram_fill;
0078
0079
0080 TFile * file_in;
0081 TTree * tree_in;
0082 void PrepareInputRootFile();
0083 std::map<std::string, int> GetInputTreeBranchesMap(TTree * m_tree_in);
0084
0085
0086
0087
0088 float MBD_z_vtx;
0089 bool is_min_bias;
0090 float MBD_centrality;
0091 float MBD_south_charge_sum;
0092 float MBD_north_charge_sum;
0093 float MBD_charge_sum;
0094 float MBD_charge_asymm;
0095 int InttBcoFullDiff_next;
0096
0097
0098 int MBDNSg2;
0099 int MBDNSg2_vtxZ10cm;
0100 int MBDNSg2_vtxZ30cm;
0101 int MBDNSg2_vtxZ60cm;
0102
0103 std::vector<float> *ClusX;
0104 std::vector<float> *ClusY;
0105 std::vector<float> *ClusZ;
0106 std::vector<int> *ClusLayer;
0107 std::vector<unsigned char> *ClusLadderZId;
0108 std::vector<unsigned char> *ClusLadderPhiId;
0109 std::vector<int> *ClusAdc;
0110 std::vector<float> *ClusPhiSize;
0111
0112
0113 double INTTvtxZ;
0114 double INTTvtxZError;
0115 double NgroupTrapezoidal;
0116 double NgroupCoarse;
0117 double TrapezoidalFitWidth;
0118 double TrapezoidalFWHM;
0119
0120
0121 std::vector<pair_str> *evt_TrackletPair_vec;
0122 std::vector<pair_str> *evt_TrackletPairRotate_vec;
0123
0124
0125 float TruthPV_trig_x;
0126 float TruthPV_trig_y;
0127 float TruthPV_trig_z;
0128 int NTruthVtx;
0129 int NPrimaryG4P;
0130 std::vector<float> *PrimaryG4P_Pt;
0131 std::vector<float> *PrimaryG4P_Eta;
0132 std::vector<float> *PrimaryG4P_Phi;
0133 std::vector<float> *PrimaryG4P_E;
0134 std::vector<float> *PrimaryG4P_PID;
0135 std::vector<int> *PrimaryG4P_isChargeHadron;
0136 };
0137
0138 #endif