CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
CgemMilleAlign.h
Go to the documentation of this file.
1/* Millepede matrix method for alignment, author: Volker Blobel */
2/* First used in BESIII drift chamber by Wu Linghui ([email protected]) */
3#ifndef INICGEMALIGN_H
4#define INICGEMALIGN_H
5
6#include "GaudiKernel/Algorithm.h"
7#include "GaudiKernel/NTuple.h"
8#include "GaudiKernel/INTupleSvc.h"
12//#include "CgemGeomSvc/CgemUtilitySvc.h"
13
16// I need to prepare it
17
18#include "TROOT.h"
19#include "TFile.h"
20#include "TObjArray.h"
21#include "TH1F.h"
22#include "TF1.h"
23#include "TTree.h"
24#include "TFolder.h"
25#include "TGraph.h"
26
27#include <fstream>
28
30public:
33 //void initialize(TObjArray* hlist, TTree* tree, ICgemGeomSvc* cgemGeomSvc, ICgemCalibFunSvc* cgemFunSvc);
34 void initialize(TObjArray* hlist, ICgemGeomSvc* cgemGeomSvc, ICgemCalibFunSvc* cgemFunSvc);
35 void setParam(CgemAliParams& param);
36 bool fillHist(CgemAliEvent* event, CgemAlignPar* alignPar);
37 bool updateAlignPar(CgemAlignPar* alignPar);
38 void clear();
39
40private:
41 int getAlignParId(int lay, int iparHit);
42 bool getDeriLoc(int Intra, int ipar, int lay, int sheet, int dir, double mPhi, double mV, double laypos[], HepVector helix, HepSymMatrix &helixErr, double &deri_phi, double &deri_v);
43 bool getDeriGlo(int Intra, int iparHit, int iparGB, int lay, int sheet, int dir, double mPhi, double mV, double laypos[], HepVector helix, HepSymMatrix &helixErr,double &deri_phi, double &deri_v);
44
45 bool iniGeoAlignPar();
46
47 NTuple::Tuple* m_tuple;
48 NTuple::Item<double> run;
49
50 ICgemGeomSvc* m_cgemGeomSvc;
51 ICgemCalibFunSvc* m_cgemFunSvc;
52
53 CgemAliParams m_param;
54 TObjArray* m_hlist;
55 //CgemUtilitySvc* m_cgemUtilitySvc;
56
57 double m_resiCut_phi[LAYERNMAX];
58 double m_resiCut_v[LAYERNMAX];
59 double m_docaCut[LAYERNMAX];
60
61 //double m_p[20][15];
62 //double m_dxini[NEP];
63 //double m_dyini[NEP];
64 //double m_rzini[NEP];
65 int m_GeoMethod;
66 bool Plot_der;
67 bool debug;
68 bool re_3lay;
69 bool record_pos;
70 bool use_phi;
71 bool use_v;
72 bool mul_R;
73 bool mul_Ste_ang;
74 int nTrack_tot;
75
76 int count[30];
77 double m_r[6];
78 double m_z[6];
79 double Ste_ang[6];
80 double sig_phi[6];
81 double sig_v[6];
82
83 double cut_derLC_Phi[5][2] ;
84 double cut_derLC_V[5][2] ;
85 double cut_derGB_Phi[4][2] ;
86 double cut_derGB_V[4][2] ;
87
88 double ini_alig_par[6][6] ;
89
90 CgemMidDriftPlane* m_middriftplane;
91 CgemGeoAlign* m_geoalign;
92
93 /* for millepede */
94 Millepede* m_pMilleAlign;
95 int m_npar;
96 bool m_dofs[NDOFALIGN];
97 double m_sigm[NDOFALIGN*NLAYER];
98 //double m_sigm[NDOFALIGN];
99 int m_nGloHit; /* number of global pars for each hit */
100 int m_nglo_on_lay;
101 int m_nloc;
102 int m_nlay;
103 std::vector<double> m_par;
104 std::vector<double> m_error;
105 std::vector<double> m_pull;
106 std::vector<double> m_derGB_Phi;
107 std::vector<double> m_derGB_V;
108 std::vector<double> m_derNonLin_Phi;
109 std::vector<double> m_derNonLin_V;
110 std::vector<double> m_derLC_Phi;
111 std::vector<double> m_derLC_V;
112
113 /* histograms */
114 TH1F* m_hresAll_phi;
115 TH1F* m_hresAll_v;
116 TH1F* m_hresAll_z;
117 //TH1F* m_hresInn;
118 //TH1F* m_hresStp;
119 //TH1F* m_hresOut;
120 TH1F* m_hresLay_phi[LAYERNMAX];
121 TH1F* m_hresLay_v[LAYERNMAX];
122 TH1F* m_hresLay_z[LAYERNMAX];
123
124 //TH1F* m_hresAllRec;
125 //TH1F* m_hresLayRec[LAYERNMAX];
126
127 TH1F* m_hddoca; /* for debug */
128 TH1F* m_hddocaLay[LAYERNMAX]; /* for debug */
129
130};
133 m_param = param;
134}
135#endif
virtual void setParam(CgemAliParams &param)=0
bool fillHist(CgemAliEvent *event, CgemAlignPar *alignPar)
void initialize(TObjArray *hlist, ICgemGeomSvc *cgemGeomSvc, ICgemCalibFunSvc *cgemFunSvc)
bool updateAlignPar(CgemAlignPar *alignPar)
void setParam(CgemAliParams &param)
const int NLAYER
const int NDOFALIGN
const int LAYERNMAX