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