Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:18:25

0001 /* Copyright 2013
0002  *   Authors: Sergey Yashchenko and Tadeas Bilka
0003  *
0004  *   This file is part of GENFIT.
0005  *
0006  *   GENFIT is free software: you can redistribute it and/or modify
0007  *   it under the terms of the GNU Lesser General Public License as published
0008  *   by the Free Software Foundation, either version 3 of the License, or
0009  *   (at your option) any later version.
0010  *
0011  *   GENFIT is distributed in the hope that it will be useful,
0012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
0013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014  *   GNU Lesser General Public License for more details.
0015  *
0016  *   You should have received a copy of the GNU Lesser General Public License
0017  *   along with GENFIT.  If not, see <http://www.gnu.org/licenses/>.
0018  */
0019 /** @addtogroup genfit
0020  * @{
0021  */
0022 
0023 #ifndef GFGBL_H
0024 #define GFGBL_H
0025 
0026 #include "GblTrajectory.h"
0027 #include "AbsFitter.h"
0028 
0029 #include <map>
0030 #include <iostream>
0031 
0032 #include <TMatrixD.h>
0033 #include <assert.h>
0034 #include <sstream>
0035 
0036 #include <TMath.h>
0037 #include <TVector3.h>
0038 
0039 
0040 namespace genfit {
0041   
0042   
0043   /** @brief Generic GBL implementation
0044    * 
0045    * The interface class to GBL track fit
0046    *
0047    */
0048   class GFGbl : public AbsFitter {
0049     
0050   private:
0051     GFGbl(const GFGbl&);
0052     GFGbl& operator=(GFGbl const&);
0053     
0054     std::string m_milleFileName;
0055     std::string m_gblInternalIterations;
0056     double m_pValueCut;
0057     int m_minNdf;
0058     double m_chi2Cut;
0059     bool m_enableScatterers;
0060     bool m_enableIntermediateScatterer;
0061     
0062     
0063   public:
0064     
0065     /**
0066      * Constructor
0067      */
0068     GFGbl();
0069     
0070     /**
0071      * Destructor
0072      */
0073     virtual ~GFGbl() {;}
0074     
0075     /**
0076      * Creates the mille binary file for output of
0077      * data for Millepede II alignment, can be set by setMP2Options
0078      */
0079     void beginRun();
0080     
0081     /**
0082      * Required to write and close ROOT file
0083      * with debug output. Destructor cannot be used.
0084      * To be called from endRun function of a module
0085      */
0086     void endRun();
0087     
0088     
0089     /**
0090      * @brief Sets internal GBL down-weighting
0091      * @param internalIterations GBL internal down-weighting settings, see GBL doc
0092      * @return void
0093      */
0094     void setGBLOptions(std::string internalIterations = "THC", bool enableScatterers = true, bool enableIntermediateScatterer = true) {
0095       m_gblInternalIterations = internalIterations;
0096       if (!enableScatterers)
0097         enableIntermediateScatterer = false;
0098       m_enableScatterers = enableScatterers;
0099       m_enableIntermediateScatterer = enableIntermediateScatterer;
0100     }
0101     
0102     /**
0103      * @brief Sets GBL & Millepede settings
0104      * @param pValueCut minimum track p-value for MP2 output
0105      * @param minNdf minimum track NDF for MP2 output
0106      * @param mille_file_name name of MP2 binary file for output
0107      * @return void
0108      */
0109     void setMP2Options(double pValueCut = 0., unsigned int minNdf = 1, std::string mille_file_name = "millefile.dat", double chi2Cut = 0.) {
0110       m_pValueCut = pValueCut;
0111       m_minNdf = minNdf;
0112       m_milleFileName = mille_file_name;
0113       m_chi2Cut = chi2Cut;
0114     }
0115     
0116     /**
0117      * Performs fit on a Track.
0118      * Hit resorting currently NOT supported.
0119      */
0120     void processTrackWithRep(Track* trk, const AbsTrackRep* rep, bool resortHits = false) override;
0121     
0122     
0123   public:
0124     
0125     ClassDef(GFGbl, 1)
0126     
0127   };
0128   
0129 }  /* End of namespace genfit */
0130 /** @} */
0131 
0132 #endif // GFGBL_H
0133