/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Reconstruction/MdcPatRec/MdcTrkRecon/MdcTrkRecon-00-03-45/src/MdcFlagHold.cxx

Go to the documentation of this file.
00001 // MdcFlagHold.cxx
00002 
00003 /* Read instructions contained in file (file name in argument).  Return 
00004    input and output file names as arguments. */
00005 
00006 //----------------------------------------------------------------------------
00007 #include <stdio.h>
00008 #include <iostream>
00009 #include "MdcTrkRecon/MdcFlagHold.h"
00010 #include "MdcGeom/MdcTrkReconCut.h"
00011 #include "TrkFitter/TrkHelixFitter.h"
00012 extern double MdcTrkReconCut_combAxPhi0;
00013 extern double MdcTrkReconCut_combAxCurv;
00014 extern double MdcTrkReconCut_combAxPhi0Cut;
00015 extern double MdcTrkReconCut_combAxCurvCut;
00016 //----------------------------------------------------------------------------
00017 void 
00018 MdcFlagHold::setDebug(int flag) {
00019 //----------------------------------------------------------------------------
00020   m_debug = flag;
00021   tkParTight.lPrint = flag;
00022   segPar.lPrint = tkParTight.lPrint;
00023 }
00024 
00025 //----------------------------------------------------------------------------
00026 void MdcFlagHold::setHist(int flag){
00027 //----------------------------------------------------------------------------
00028   lHist = flag;
00029   segPar.lHist = flag;
00030   tkParTight.lHist = flag;
00031 }
00032 
00033 //----------------------------------------------------------------------------
00034 void
00035 MdcFlagHold::readPar(std::string inname) {
00036 //----------------------------------------------------------------------------
00037 
00038   /* Declare variables */
00039   FILE *ifp;
00040   char comment[80];
00041   std::cout<< 0.  <<"  readPar "<< inname  << std::endl;
00042   /**************************************************************************/
00043   
00044   if ((ifp = fopen(inname.c_str(),"r")) != NULL) {
00045     if (debugFlag()>0) {
00046       std::cout << "Reading MdcTrackFinder params from " << inname << std::endl;
00047     }
00048     int idebug= 0;
00049     fscanf(ifp,"%d%s", &idebug, comment); // debug?
00050     fscanf(ifp,"%d%s", &lHist, comment);// histogram?
00051     fscanf(ifp,"%d%s", &findTracks, comment); // find tracks?
00052     fscanf(ifp,"%d%s", &findSegs, comment); // find segs?
00053     fscanf(ifp,"%d%s", &(segPar.lHist), comment); // hist segs?
00054     fscanf(ifp,"%d%s", &(tkParTight.lHist), comment); // hist tracks?
00055     fscanf(ifp,"%d%s", &(segPar.lPrint), comment); // print segs?
00056     fscanf(ifp,"%d%s", &(tkParTight.lPrint), comment); // print track?
00057     fscanf(ifp,"%d%s", &(segPar.segRefit), comment); // refit segs?
00058     fscanf(ifp,"%d%s", &(segPar.useAllAmbig), comment); // use all ambig?
00059     fscanf(ifp,"%d%s", &(segPar.dropDups), comment); // drop duplicate segs?
00060     //std::cout<< __FILE__ << "   " << __LINE__ << "   "<<std::endl;
00061     //fscanf(ifp,"%d%s", &(segPar.find3[0]),comment);
00062     fscanf(ifp,"%d %d %d %d %d %d %d %d %d %d %d%s", 
00063         &(segPar.find3[0]), &(segPar.find3[1]), &(segPar.find3[2]), &(segPar.find3[3]),
00064         &(segPar.find3[4]), &(segPar.find3[5]), &(segPar.find3[6]), &(segPar.find3[7]),
00065         &(segPar.find3[8]), &(segPar.find3[9]), &(segPar.find3[10]), comment); // find3 hit segs?
00066     //std::cout<< __FILE__ << "   " << __LINE__ << "   "<<std::endl;
00067     //fscanf(ifp,"%d%s", &(segPar.find3), comment); // find 3 hit segs? 2011-05-27 
00068     fscanf(ifp,"%d%s", &(segPar.addHits), comment); // add hits in seg finding?
00069     fscanf(ifp,"%d%s", &(tkParTight.lUseQualCuts), comment); // use quality cut?
00070     fscanf(ifp,"%lf%s", &(segPar.maxChisq), comment); 
00071     fscanf(ifp,"%lf%s", &(segPar.nsigAddHit), comment);
00072     fscanf(ifp,"%lf%s", &(segPar.z0cut), comment);
00073     fscanf(ifp,"%lf%s", &(segPar.ctcut), comment);
00074     fscanf(ifp,"%lf%s", &(segPar.phiDiffDropMult), comment);
00075     fscanf(ifp,"%lf%s", &(segPar.slopeDiffDrop), comment);
00076     fscanf(ifp,"%lf%s", &(segPar.delZ0Cut), comment);
00077     fscanf(ifp,"%lf%s", &(segPar.delCtCut), comment);
00078     fscanf(ifp,"%d%s",  &(tkParTight.minHits), comment);
00079     fscanf(ifp,"%lf%s", &(tkParTight.maxChisq), comment);
00080     fscanf(ifp,"%lf%s", &(tkParTight.maxNmissTrack), comment);
00081     fscanf(ifp,"%lf%s", &(tkParTight.maxNmissNorm), comment);
00082     fscanf(ifp,"%d%s",  &(tkParTight.nOverlap), comment);
00083     fscanf(ifp,"%lf%s", &(tkParTight.maxSegChisqO), comment);
00084     fscanf(ifp,"%lf%s", &(tkParTight.maxInactiveResid), comment);
00085     fscanf(ifp,"%lf%s", &(tkParTight.maxActiveSigma), comment);
00086     fscanf(ifp,"%lf%s", &(tkParTight.pickHitFract), comment);
00087     fscanf(ifp,"%lf%s", &(tkParTight.pickHitMargin), comment);
00088     fscanf(ifp,"%lf%s", &MdcTrkReconCut_combAxPhi0, comment);
00089     fscanf(ifp,"%lf%s", &MdcTrkReconCut_combAxCurv, comment);
00090     fscanf(ifp,"%lf%s", &MdcTrkReconCut_combAxPhi0Cut, comment);
00091     fscanf(ifp,"%lf%s", &MdcTrkReconCut_combAxCurvCut, comment);
00092     fscanf(ifp,"%lf%s", &(tkParTight.pickHitFactor), comment);//yzhang add 2010-05-12 
00093     fscanf(ifp,"%d%s", &(tkParTight.lRemoveInActive), comment);//yzhang add 2010-05-14 
00094     fscanf(ifp,"%lf%s", &(tkParTight.pickHitPhiFactor), comment);//yzhang add 2010-05-18 
00095     fscanf(ifp,"%d%s", &(tkParTight.pickUitlLastLayer), comment);//yzhang add 2010-09-10 
00096     fscanf(ifp,"%d%s", &(tkParTight.nHitDeleted), comment);//yzhang add 2010-09-13 
00097     fscanf(ifp,"%d%s", &(tkParTight.pickSkipExistLayer ), comment);//yzhang add 2011-05-04
00098     fscanf(ifp,"%d%s", &(tkParTight.combineByFitHits), comment);//yzhang add 2011-05-11 
00099     fscanf(ifp,"%d%s", &(tkParTight.nGapGE2), comment);//yzhang add 2011-07-29 
00100     fscanf(ifp,"%d%s", &(tkParTight.nGapGE3), comment);//yzhang add 2011-07-29 
00101     fscanf(ifp,"%d%s", &(tkParTight.maxGapLength), comment);//yzhang add 2011-07-29 
00102     setDebug(idebug);
00103     if (plot == 0) {
00104       plotTracks = 0;
00105       plotSegs = 0;
00106       plotTrackList = 0;
00107     }
00108     fclose(ifp);
00109   }else{
00110       std::cout << "Reading MdcTrackFinder params from default param!" << std::endl;
00111   }
00112 
00113   tkParTight.lPlot = plot;
00114   segPar.lPlot = plot;
00115   
00116   if (debugFlag()) { printPar(); }
00117   return;
00118 }
00119 
00120 //----------------------------------------------------------------------------
00121 void
00122 MdcFlagHold::printPar() {
00123   std::cout << "MdcFlagHold:\ndebug:"<<debugFlag()
00124        << "\nhist:"<<lHist
00125        << "\nfindTracks:"<<findTracks
00126        <<"\nfindSegs:"<<findSegs
00127        <<"\nhistSegs:"<<segPar.lHist
00128        <<"\nhistTracks:"<<tkParTight.lHist
00129        <<"\nprintSeg:"<<segPar.lPrint
00130        <<"\nprintTrack:"<<tkParTight.lPrint
00131        <<"\nrefitSeg:"<<segPar.segRefit
00132        <<"\nuseAllAmbig:"<<segPar.useAllAmbig
00133        <<"\nsegPar.dropDups:"<<segPar.dropDups
00134        <<"\nsegPar.find3:";
00135   for(int ii=0;ii<11;ii++){
00136     std::cout <<segPar.find3[ii] << " ";
00137   }
00138   std::cout <<"\nsegPar.addHits:"<<segPar.addHits
00139     <<"\ntkParTight.lUseQualCuts:"<<tkParTight.lUseQualCuts
00140     <<"\nsegPar.maxChisq:"<<segPar.maxChisq
00141     <<"\nsegPar.nsigAddHit:"<<segPar.nsigAddHit
00142     <<"\nsegPar.z0:"<<segPar.z0cut
00143     <<"\nsegPar.ct:"<<segPar.ctcut
00144     <<"\nsegPar.phiDiffDropMult:"<<segPar.phiDiffDropMult
00145     <<"\nsegPar.slopeDiffDrop:"<<segPar.slopeDiffDrop
00146     <<"\nsegPar.delZ0Cut:"<<segPar.delZ0Cut
00147     <<"\nsegPar.delCtCut:"<<segPar.delCtCut
00148     <<"\ntkParTight.minHits:"<<tkParTight.minHits
00149     <<"\ntkParTight.maxChisq:"<<tkParTight.maxChisq
00150     <<"\ntkParTight.maxNmissTrack:"<<tkParTight.maxNmissTrack
00151     <<"\ntkParTight.maxNmissNorm:"<<tkParTight.maxNmissNorm
00152     <<"\ntkParTight.nOverlap:"<<tkParTight.nOverlap
00153     <<"\ntkParTight.maxsegChisq:"<<tkParTight.maxSegChisqO
00154     <<"\ntkParTight.maxInactiveResid:"<<tkParTight.maxInactiveResid
00155     <<"\ntkParTight.maxActiveSigma:"<<tkParTight.maxActiveSigma
00156     <<"\ntkParTight.picHitFract:"<<tkParTight.pickHitFract
00157     <<"\ntkParTight.pickHitMargin:"<<tkParTight.pickHitMargin
00158     <<"\nMdcTrkReconCut_combAxPhi0:"<<MdcTrkReconCut_combAxPhi0
00159     <<"\nMdcTrkReconCut_combAxCurv:"<<MdcTrkReconCut_combAxCurv
00160     <<"\nMdcTrkReconCut_combAxPhi0Cut:"<<MdcTrkReconCut_combAxPhi0Cut
00161     <<"\nMdcTrkReconCut_combAxCurvCut:"<<MdcTrkReconCut_combAxCurvCut
00162     <<"\ntkParTight.pickHitFactor:"<<tkParTight.pickHitFactor
00163     <<"\ntkParTight.lRemoveInActive:"<<tkParTight.lRemoveInActive
00164     <<"\ntkParTight.pickHitPhiFactor:"<<tkParTight.pickHitPhiFactor
00165     <<"\ntkParTight.pickUitlLastLayer:"<<tkParTight.pickUitlLastLayer
00166     <<"\ntkParTight.nHitDeleted:"<<tkParTight.nHitDeleted
00167     <<"\ntkParTight.pickSkipExistLayer:"<<tkParTight.pickSkipExistLayer
00168     <<"\ntkParTight.combineByFitHits:"<<tkParTight.combineByFitHits
00169     <<"\ntkParTight.nGapGE2:"<<tkParTight.nGapGE2
00170     <<"\ntkParTight.nGapGE3:"<<tkParTight.nGapGE3
00171     <<"\ntkParTight.maxGapLength:"<<tkParTight.maxGapLength
00172     <<std::endl;
00173   std::cout<<"nSigmaCut:"<<std::endl;
00174   for (int i=0;i<43;i++) {
00175     std::cout<<TrkHelixFitter::nSigmaCut[i]<<" ";
00176     if((i+1)%4==0) std::cout<<std::endl;
00177   }
00178   std::cout<<std::endl;
00179   return;
00180 }
00181 //----------------------------------------------------------------------------
00182 
00183 
00184 MdcFlagHold::MdcFlagHold() { 
00185   m_debug = 0;  // => modest per-event output
00186   plot = 0;
00187   plotSegs = 0;
00188   plotSegList = 0;
00189   plotTracks = 0;
00190   plotTrackList = 0;
00191   lHist = 0;
00192   findTracks = 1;
00193   findSegs = 1;
00194 }

Generated on Tue Nov 29 23:13:33 2016 for BOSS_7.0.2 by  doxygen 1.4.7