BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcFlagHold.cxx
Go to the documentation of this file.
1// MdcFlagHold.cxx
2
3/* Read instructions contained in file (file name in argument). Return
4 input and output file names as arguments. */
5
6//----------------------------------------------------------------------------
7#include "MdcTrkRecon/MdcFlagHold.h"
8#include "MdcGeom/MdcTrkReconCut.h"
9#include "TrkFitter/TrkHelixFitter.h"
10#include <iostream>
11#include <stdio.h>
12extern double MdcTrkReconCut_combAxPhi0;
13extern double MdcTrkReconCut_combAxCurv;
16//----------------------------------------------------------------------------
18 //----------------------------------------------------------------------------
19 m_debug = flag;
20 tkParTight.lPrint = flag;
21 segPar.lPrint = tkParTight.lPrint;
22}
23
24//----------------------------------------------------------------------------
26 //----------------------------------------------------------------------------
27 lHist = flag;
28 segPar.lHist = flag;
29 tkParTight.lHist = flag;
30}
31
32//----------------------------------------------------------------------------
33void MdcFlagHold::readPar( std::string inname ) {
34 //----------------------------------------------------------------------------
35
36 /* Declare variables */
37 FILE* ifp;
38 char comment[80];
39 std::cout << 0. << " readPar " << inname << std::endl;
40 /**************************************************************************/
41
42 if ( ( ifp = fopen( inname.c_str(), "r" ) ) != NULL )
43 {
44 if ( debugFlag() > 0 )
45 { std::cout << "Reading MdcTrackFinder params from " << inname << std::endl; }
46 int idebug = 0;
47 fscanf( ifp, "%d%s", &idebug, comment ); // debug?
48 fscanf( ifp, "%d%s", &lHist, comment ); // histogram?
49 fscanf( ifp, "%d%s", &findTracks, comment ); // find tracks?
50 fscanf( ifp, "%d%s", &findSegs, comment ); // find segs?
51 fscanf( ifp, "%d%s", &( segPar.lHist ), comment ); // hist segs?
52 fscanf( ifp, "%d%s", &( tkParTight.lHist ), comment ); // hist tracks?
53 fscanf( ifp, "%d%s", &( segPar.lPrint ), comment ); // print segs?
54 fscanf( ifp, "%d%s", &( tkParTight.lPrint ), comment ); // print track?
55 fscanf( ifp, "%d%s", &( segPar.segRefit ), comment ); // refit segs?
56 fscanf( ifp, "%d%s", &( segPar.useAllAmbig ), comment ); // use all ambig?
57 fscanf( ifp, "%d%s", &( segPar.dropDups ), comment ); // drop duplicate segs?
58 // std::cout<< __FILE__ << " " << __LINE__ << " "<<std::endl;
59 // fscanf(ifp,"%d%s", &(segPar.find3[0]),comment);
60 fscanf( ifp, "%d %d %d %d %d %d %d %d %d %d %d%s", &( segPar.find3[0] ),
61 &( segPar.find3[1] ), &( segPar.find3[2] ), &( segPar.find3[3] ),
62 &( segPar.find3[4] ), &( segPar.find3[5] ), &( segPar.find3[6] ),
63 &( segPar.find3[7] ), &( segPar.find3[8] ), &( segPar.find3[9] ),
64 &( segPar.find3[10] ), comment ); // find3 hit segs?
65 // std::cout<< __FILE__ << " " << __LINE__ << " "<<std::endl;
66 // fscanf(ifp,"%d%s", &(segPar.find3), comment); // find 3 hit segs? 2011-05-27
67 fscanf( ifp, "%d%s", &( segPar.addHits ), comment ); // add hits in seg finding?
68 fscanf( ifp, "%d%s", &( tkParTight.lUseQualCuts ), comment ); // use quality cut?
69 fscanf( ifp, "%lf%s", &( segPar.maxChisq ), comment );
70 fscanf( ifp, "%lf%s", &( segPar.nsigAddHit ), comment );
71 fscanf( ifp, "%lf%s", &( segPar.z0cut ), comment );
72 fscanf( ifp, "%lf%s", &( segPar.ctcut ), comment );
73 fscanf( ifp, "%lf%s", &( segPar.phiDiffDropMult ), comment );
74 fscanf( ifp, "%lf%s", &( segPar.slopeDiffDrop ), comment );
75 fscanf( ifp, "%lf%s", &( segPar.delZ0Cut ), comment );
76 fscanf( ifp, "%lf%s", &( segPar.delCtCut ), comment );
77 fscanf( ifp, "%d%s", &( tkParTight.minHits ), comment );
78 fscanf( ifp, "%lf%s", &( tkParTight.maxChisq ), comment );
79 fscanf( ifp, "%lf%s", &( tkParTight.maxNmissTrack ), comment );
80 fscanf( ifp, "%lf%s", &( tkParTight.maxNmissNorm ), comment );
81 fscanf( ifp, "%d%s", &( tkParTight.nOverlap ), comment );
82 fscanf( ifp, "%lf%s", &( tkParTight.maxSegChisqO ), comment );
83 fscanf( ifp, "%lf%s", &( tkParTight.maxInactiveResid ), comment );
84 fscanf( ifp, "%lf%s", &( tkParTight.maxActiveSigma ), comment );
85 fscanf( ifp, "%lf%s", &( tkParTight.pickHitFract ), comment );
86 fscanf( ifp, "%lf%s", &( tkParTight.pickHitMargin ), comment );
87 fscanf( ifp, "%lf%s", &MdcTrkReconCut_combAxPhi0, comment );
88 fscanf( ifp, "%lf%s", &MdcTrkReconCut_combAxCurv, comment );
89 fscanf( ifp, "%lf%s", &MdcTrkReconCut_combAxPhi0Cut, comment );
90 fscanf( ifp, "%lf%s", &MdcTrkReconCut_combAxCurvCut, comment );
91 fscanf( ifp, "%lf%s", &( tkParTight.pickHitFactor ), comment ); // yzhang add 2010-05-12
92 fscanf( ifp, "%d%s", &( tkParTight.lRemoveInActive ), comment ); // yzhang add 2010-05-14
93 fscanf( ifp, "%lf%s", &( tkParTight.pickHitPhiFactor ), comment ); // yzhang add 2010-05-18
94 fscanf( ifp, "%d%s", &( tkParTight.pickUitlLastLayer ), comment ); // yzhang add 2010-09-10
95 fscanf( ifp, "%d%s", &( tkParTight.nHitDeleted ), comment ); // yzhang add 2010-09-13
96 fscanf( ifp, "%d%s", &( tkParTight.pickSkipExistLayer ), comment ); // yzhang add
97 // 2011-05-04
98 fscanf( ifp, "%d%s", &( tkParTight.combineByFitHits ), comment ); // yzhang add 2011-05-11
99 fscanf( ifp, "%d%s", &( tkParTight.nGapGE2 ), comment ); // yzhang add 2011-07-29
100 fscanf( ifp, "%d%s", &( tkParTight.nGapGE3 ), comment ); // yzhang add 2011-07-29
101 fscanf( ifp, "%d%s", &( tkParTight.maxGapLength ), comment ); // yzhang add 2011-07-29
102 setDebug( idebug );
103 if ( plot == 0 )
104 {
105 plotTracks = 0;
106 plotSegs = 0;
107 plotTrackList = 0;
108 }
109 fclose( ifp );
110 }
111 else { std::cout << "Reading MdcTrackFinder params from default param!" << std::endl; }
112
113 tkParTight.lPlot = plot;
114 segPar.lPlot = plot;
115
116 if ( debugFlag() ) { printPar(); }
117 return;
118}
119
120//----------------------------------------------------------------------------
122 std::cout << "MdcFlagHold:\ndebug:" << debugFlag() << "\nhist:" << lHist
123 << "\nfindTracks:" << findTracks << "\nfindSegs:" << findSegs
124 << "\nhistSegs:" << segPar.lHist << "\nhistTracks:" << tkParTight.lHist
125 << "\nprintSeg:" << segPar.lPrint << "\nprintTrack:" << tkParTight.lPrint
126 << "\nrefitSeg:" << segPar.segRefit << "\nuseAllAmbig:" << segPar.useAllAmbig
127 << "\nsegPar.dropDups:" << segPar.dropDups << "\nsegPar.find3:";
128 for ( int ii = 0; ii < 11; ii++ ) { std::cout << segPar.find3[ii] << " "; }
129 std::cout << "\nsegPar.addHits:" << segPar.addHits
130 << "\ntkParTight.lUseQualCuts:" << tkParTight.lUseQualCuts
131 << "\nsegPar.maxChisq:" << segPar.maxChisq
132 << "\nsegPar.nsigAddHit:" << segPar.nsigAddHit << "\nsegPar.z0:" << segPar.z0cut
133 << "\nsegPar.ct:" << segPar.ctcut
134 << "\nsegPar.phiDiffDropMult:" << segPar.phiDiffDropMult
135 << "\nsegPar.slopeDiffDrop:" << segPar.slopeDiffDrop
136 << "\nsegPar.delZ0Cut:" << segPar.delZ0Cut
137 << "\nsegPar.delCtCut:" << segPar.delCtCut
138 << "\ntkParTight.minHits:" << tkParTight.minHits
139 << "\ntkParTight.maxChisq:" << tkParTight.maxChisq
140 << "\ntkParTight.maxNmissTrack:" << tkParTight.maxNmissTrack
141 << "\ntkParTight.maxNmissNorm:" << tkParTight.maxNmissNorm
142 << "\ntkParTight.nOverlap:" << tkParTight.nOverlap
143 << "\ntkParTight.maxsegChisq:" << tkParTight.maxSegChisqO
144 << "\ntkParTight.maxInactiveResid:" << tkParTight.maxInactiveResid
145 << "\ntkParTight.maxActiveSigma:" << tkParTight.maxActiveSigma
146 << "\ntkParTight.picHitFract:" << tkParTight.pickHitFract
147 << "\ntkParTight.pickHitMargin:" << tkParTight.pickHitMargin
148 << "\nMdcTrkReconCut_combAxPhi0:" << MdcTrkReconCut_combAxPhi0
149 << "\nMdcTrkReconCut_combAxCurv:" << MdcTrkReconCut_combAxCurv
150 << "\nMdcTrkReconCut_combAxPhi0Cut:" << MdcTrkReconCut_combAxPhi0Cut
151 << "\nMdcTrkReconCut_combAxCurvCut:" << MdcTrkReconCut_combAxCurvCut
152 << "\ntkParTight.pickHitFactor:" << tkParTight.pickHitFactor
153 << "\ntkParTight.lRemoveInActive:" << tkParTight.lRemoveInActive
154 << "\ntkParTight.pickHitPhiFactor:" << tkParTight.pickHitPhiFactor
155 << "\ntkParTight.pickUitlLastLayer:" << tkParTight.pickUitlLastLayer
156 << "\ntkParTight.nHitDeleted:" << tkParTight.nHitDeleted
157 << "\ntkParTight.pickSkipExistLayer:" << tkParTight.pickSkipExistLayer
158 << "\ntkParTight.combineByFitHits:" << tkParTight.combineByFitHits
159 << "\ntkParTight.nGapGE2:" << tkParTight.nGapGE2
160 << "\ntkParTight.nGapGE3:" << tkParTight.nGapGE3
161 << "\ntkParTight.maxGapLength:" << tkParTight.maxGapLength << std::endl;
162 std::cout << "nSigmaCut:" << std::endl;
163 for ( int i = 0; i < 43; i++ )
164 {
165 std::cout << TrkHelixFitter::nSigmaCut[i] << " ";
166 if ( ( i + 1 ) % 4 == 0 ) std::cout << std::endl;
167 }
168 std::cout << std::endl;
169 return;
170}
171//----------------------------------------------------------------------------
172
174 m_debug = 0; // => modest per-event output
175 plot = 0;
176 plotSegs = 0;
177 plotSegList = 0;
178 plotTracks = 0;
179 plotTrackList = 0;
180 lHist = 0;
181 findTracks = 1;
182 findSegs = 1;
183}
void setDebug(int debugFlag)
void readPar(std::string inname)
void setHist(int histFlag)