Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:12:45

0001 #ifndef TRACKLETHISTOGRAMNEW_H
0002 #define TRACKLETHISTOGRAMNEW_H
0003 
0004 
0005 #include "../ClusHistogram/ClusHistogram.h"
0006 
0007 #include "../EvtVtxZTracklet/structure.h"
0008 
0009 #include "../Constants.h"
0010 
0011 class TrackletHistogramNew : public ClusHistogram{
0012     public:
0013         TrackletHistogramNew(
0014             int process_id_in,
0015             int runnumber_in,
0016             int run_nEvents_in,
0017             std::string input_directory_in,
0018             std::string input_file_name_in,
0019             std::string output_directory_in,
0020 
0021             std::string output_file_name_suffix_in,
0022             std::pair<double, double> vertexXYIncm_in,
0023 
0024             std::pair<bool, TH1D*> vtxZReweight_in,
0025             bool BcoFullDiffCut_in,
0026             bool INTT_vtxZ_QA_in,
0027             std::pair<bool, std::pair<double, double>> isClusQA_in, // note : {adc, phi size}
0028             bool HaveGeoOffsetTag_in,
0029             std::pair<bool, int> SetRandomHits_in = {false, 0},
0030             bool RandInttZ_in = false,
0031             bool ColMulMask_in = true
0032         );
0033 
0034         void MainProcess() override; 
0035         void EndRun() override;
0036 
0037     protected:
0038         void EvtCleanUp() override;
0039         void PrepareOutPutFileName() override;
0040         void PrepareOutPutRootFile() override;
0041         void PrepareHistograms() override;
0042 
0043         // note : ----------------- for the histogram -----------------
0044         std::map<std::string,TH1D*> h1D_map;
0045         std::map<std::string, TH2D*> h2D_map;
0046         
0047         TH1D * h1D_PairDeltaEta_inclusive;
0048         TH1D * h1D_PairDeltaPhi_inclusive;
0049 
0050         TH1D * h1D_eta_template;
0051 
0052         TH1D * h1D_Inner_ClusEta_INTTz;
0053         TH1D * h1D_Outer_ClusEta_INTTz;
0054 
0055         TH1D * h1D_INTTvtxZ_FineBin;
0056         TH1D * h1D_INTTvtxZ_FineBin_NoVtxZWeight;
0057         TH2D * h2D_INTTvtxZFineBin_CentralityBin;
0058 
0059         // note : ----------------- for the analysis -----------------
0060         std::vector<pair_str> evt_TrackletPair_vec;
0061         std::vector<pair_str> evt_TrackletPairRotate_vec; 
0062         std::vector<std::vector<std::pair<bool,ClusHistogram::clu_info>>> inner_clu_phi_map;
0063         std::vector<std::vector<std::pair<bool,ClusHistogram::clu_info>>> outer_clu_phi_map;
0064 
0065         void GetTrackletPair(std::vector<pair_str> &input_TrackletPair_vec, bool isRotated);
0066         void FillPairs(std::vector<pair_str> input_TrackletPair_vec, bool isRotated, int Mbin_in, int vtxz_bin_in, double vtxZ_weight_in, int eID_in);
0067 
0068         std::pair<double,double> Get_possible_zvtx(double rvtx, std::vector<double> p0, std::vector<double> p1); // note : inner p0, outer p1, vector {r,z, zid}, -> {y,x}
0069         double get_delta_phi(double angle_1, double angle_2);
0070         double get_radius(double x, double y);
0071         std::pair<double,double> Get_eta(std::vector<double>p0, std::vector<double>p1, std::vector<double>p2);
0072         double grEY_stddev(TGraphErrors * input_grr);
0073         std::pair<double, double> mirrorPolynomial(double a, double b);
0074         std::pair<double, double> rotatePoint(double x, double y);
0075         std::vector<ClusHistogram::clu_info> GetRotatedClusterVec(std::vector<ClusHistogram::clu_info> input_cluster_vec);
0076         double Get_extrapolation(double given_y, double p0x, double p0y, double p1x, double p1y); // note : x : z, y : r
0077         
0078         TGraphErrors * track_gr;
0079         TF1 * fit_rz;
0080         std::vector<double> Pair_DeltaPhi_vec;
0081         std::vector<int> Used_Clus_index_vec;
0082 
0083 
0084         // note : ----------------- for constants -----------------
0085 
0086         double rotate_phi_angle = 180.;
0087 
0088         // note : for deta_phi
0089         double DeltaPhiEdge_min = -0.07; // note : rad ~ -4 degree
0090         double DeltaPhiEdge_max = 0.07;  // note : rad ~ 4 degree
0091         int    nDeltaPhiBin = 140;
0092 
0093         // note : for deta_eta
0094         double DeltaEtaEdge_min = -1.; // note : rad ~ -4 degree
0095         double DeltaEtaEdge_max = 1.;  // note : rad ~ 4 degree
0096         int    nDeltaEtaBin = 100;
0097 
0098         // note : for the best pair
0099         std::pair<double, double> cut_bestPair_DeltaPhi = {0,0.04}; // note : rad
0100         std::pair<double, double> cut_GoodProtoTracklet_DeltaPhi = {-0.04,0.04}; // note : rad
0101 
0102         double typeA_sensor_half_length_incm = Constants::typeA_sensor_half_length_incm;
0103         double typeB_sensor_half_length_incm = Constants::typeB_sensor_half_length_incm;
0104 };
0105 
0106 #endif