BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
PreXtCalib Class Reference

#include <PreXtCalib.h>

Inheritance diagram for PreXtCalib:

Public Member Functions

 PreXtCalib ()
 ~PreXtCalib ()
void init (TObjArray *hlist, MdcCosGeom *pGeom)
void mergeHist (TFile *fhist)
void calib (MdcCalibConst *calconst, TObjArray *newXtList, TObjArray *r2tList)
Public Member Functions inherited from CalibBase
 CalibBase ()
virtual ~CalibBase ()

Detailed Description

Definition at line 12 of file PreXtCalib.h.

Constructor & Destructor Documentation

◆ PreXtCalib()

PreXtCalib::PreXtCalib ( )

Definition at line 8 of file PreXtCalib.cpp.

8{ cout << "Calibration type: PreXtCalib" << endl; }

◆ ~PreXtCalib()

PreXtCalib::~PreXtCalib ( )

Definition at line 10 of file PreXtCalib.cpp.

10{}

Member Function Documentation

◆ calib()

void PreXtCalib::calib ( MdcCalibConst * calconst,
TObjArray * newXtList,
TObjArray * r2tList )
virtual

Implements CalibBase.

Definition at line 65 of file PreXtCalib.cpp.

65 {
66 double pi = 3.141592653;
67 double dist[NPreXtBin];
68 double xtpar[6];
69 char hname[200];
70
71 TF1* funXt = new TF1( "funXt", xtfun, 0, 300, 6 );
72 funXt->FixParameter( 0, 0.0 );
73 funXt->SetParameter( 1, 0.03 );
74 funXt->SetParameter( 2, 0.0 );
75 funXt->SetParameter( 3, 0.0 );
76 funXt->SetParameter( 4, 0.0 );
77 funXt->SetParameter( 5, 0.0 );
78
79 ofstream fxtlog( "preXtpar.dat" );
80 for ( int lay = 0; lay < NLAYER; lay++ )
81 {
82 sprintf( hname, "mgrPreXt%02d", lay );
83 m_grXt[lay] = new TGraph();
84 m_grXt[lay]->SetName( hname );
85 m_grXt[lay]->SetMarkerStyle( 20 );
86 m_fdPreXt->Add( m_grXt[lay] );
87
88 double layRad = m_pGeom->getLayer( lay )->getLayerRad();
89 int ncel = m_pGeom->getLayer( lay )->getNcell();
90 double dm = pi * layRad / (double)ncel;
91 Double_t nTot = m_nhitTot->GetBinContent( lay + 1 );
92 double tm = calconst->getXtpar( lay, 0, 0, 6 );
93
94 fxtlog << "layer " << lay << endl;
95 for ( int bin = 0; bin < NPreXtBin; bin++ )
96 {
97 Double_t nhitBin = m_nhitBin[lay]->GetBinContent( bin + 1 );
98 dist[bin] = dm * nhitBin / nTot;
99 m_grXt[lay]->SetPoint( bin, m_tbin[bin], dist[bin] );
100 fxtlog << setw( 4 ) << bin << setw( 15 ) << m_tbin[bin] << setw( 15 ) << dist[bin]
101 << setw( 15 ) << dm << setw( 10 ) << nhitBin << setw( 10 ) << nTot << endl;
102
103 if ( m_tbin[bin] >= tm ) break;
104 }
105
106 if ( 1 == gFgCalib[lay] )
107 {
108 m_grXt[lay]->Fit( funXt, "Q", "", 0.0, tm );
109 for ( int ord = 0; ord < 6; ord++ ) xtpar[ord] = funXt->GetParameter( ord );
110
111 for ( int iEntr = 0; iEntr < NENTRXT; iEntr++ )
112 {
113 for ( int iLR = 0; iLR < NLR; iLR++ )
114 {
115 for ( int ord = 0; ord < 6; ord++ )
116 { calconst->resetXtpar( lay, iEntr, iLR, ord, xtpar[ord] ); }
117 }
118 }
119 }
120 else
121 {
122 for ( int ord = 0; ord < 6; ord++ ) xtpar[ord] = calconst->getXtpar( lay, 0, 0, ord );
123 }
124
125 for ( int ord = 0; ord < 6; ord++ ) fxtlog << setw( 14 ) << xtpar[ord];
126 fxtlog << setw( 10 ) << tm << " 0" << endl;
127 } // end of layer loop
128 fxtlog.close();
129 cout << "preXt.dat was written." << endl;
130
131 renameHist();
132 delete funXt;
133}
sprintf(cut, "kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_" "pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)
double pi
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per bin
Definition FoamA.h:85
void resetXtpar(int lay, int entr, int lr, int order, double val)
double getXtpar(int lay, int entr, int lr, int order)

◆ init()

void PreXtCalib::init ( TObjArray * hlist,
MdcCosGeom * pGeom )
virtual

Implements CalibBase.

Definition at line 12 of file PreXtCalib.cpp.

12 {
13 m_pGeom = pGeom;
14
15 double twid = 10.0; // ns
16 for ( int bin = 0; bin < NPreXtBin; bin++ ) m_tbin[bin] = (double)( bin + 1 ) * twid;
17
18 m_fdPreXt = new TFolder( "mPreXt", "PreXt" );
19 hlist->Add( m_fdPreXt );
20
21 m_fdNhit = new TFolder( "mXtNhit", "XtNhit" );
22 hlist->Add( m_fdNhit );
23
24 m_haxis = new TH2F( "maxis", "", 50, 0, 300, 50, 0, 9 );
25 m_haxis->SetStats( 0 );
26 m_fdPreXt->Add( m_haxis );
27
28 m_nhitTot = new TH1F( "mnhitTot", "", 43, -0.5, 42.5 );
29 m_fdNhit->Add( m_nhitTot );
30
31 char hname[200];
32 for ( int lay = 0; lay < NLAYER; lay++ )
33 {
34 sprintf( hname, "mtrec%02d", lay );
35 m_htrec[lay] = new TH1F( hname, "", 310, -20, 600 );
36 m_fdPreXt->Add( m_htrec[lay] );
37
38 sprintf( hname, "mnhitBin%02d", lay );
39 m_nhitBin[lay] = new TH1F( hname, "", 40, 5.0, 405.0 );
40 m_fdNhit->Add( m_nhitBin[lay] );
41 }
42}

◆ mergeHist()

void PreXtCalib::mergeHist ( TFile * fhist)
virtual

Implements CalibBase.

Definition at line 44 of file PreXtCalib.cpp.

44 {
45 TFolder* fdPreXt = (TFolder*)fhist->Get( "PreXt" );
46 TFolder* fdNhit = (TFolder*)fhist->Get( "XtNhit" );
47
48 char hname[200];
49 TH1F* hist;
50 for ( int lay = 0; lay < NLAYER; lay++ )
51 {
52 sprintf( hname, "trec%02d", lay );
53 hist = (TH1F*)fdPreXt->FindObjectAny( hname );
54 m_htrec[lay]->Add( hist );
55
56 sprintf( hname, "nhitBin%02d", lay );
57 hist = (TH1F*)fdNhit->FindObjectAny( hname );
58 m_nhitBin[lay]->Add( hist );
59 }
60
61 hist = (TH1F*)fdNhit->FindObjectAny( "nhitTot" );
62 m_nhitTot->Add( hist );
63}

The documentation for this class was generated from the following files: