MarlinTrk  02.08
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MarlinAidaTT.cc
Go to the documentation of this file.
3 
4 // // //SJA:FIXME: only needed for storing the modules in the layers map
5 // #include <UTIL/BitField64.h>
6 // #include "UTIL/LCTrackerConf.h"
7 
8 #include "aidaTT/IBField.hh"
9 #include "aidaTT/ConstantSolenoidBField.hh"
10 #include "aidaTT/analyticalPropagation.hh"
11 #include "aidaTT/simplifiedPropagation.hh"
12 #include "aidaTT/GBLInterface.hh"
13 #include "aidaTT/fitResults.hh"
14 #include "aidaTT/Vector5.hh"
15 #include "aidaTT/utilities.hh"
16 #include "aidaTT/LCIOPersistency.hh"
17 #include "aidaTT/Vector3D.hh"
18 #include "aidaTT/IGeometry.hh"
19 
20 
21 #include "DD4hep/Detector.h"
22 #include "DD4hep/Fields.h"
23 #include "DD4hep/DD4hepUnits.h"
24 
25 #include <algorithm>
26 #include <string>
27 #include <math.h>
28 #include <cmath>
29 
30 #include <utility>
31 
32 #include "streamlog/streamlog.h"
33 
34 namespace MarlinTrk{
35 
36 
37  MarlinAidaTT::MarlinAidaTT() : _useQMS(false), _usedEdx(false) ,_is_initialised(false){
38 
39  this->registerOptions() ;
40 
41  streamlog_out( DEBUG4 ) << " MarlinAidaTT - constructed " << std::endl ;
42  }
43 
45  delete _geom ;
46  delete _bfield ;
47  delete _fitter ;
48  delete _propagation ;
49  }
50 
51 
53 
55 
57 
58  streamlog_out( DEBUG5 ) << " -------------------------------------------------------------------------------- " << std::endl ;
59  streamlog_out( DEBUG5 ) << " MarlinAidaTT::init() called with the following options : " << std::endl ;
60  streamlog_out( DEBUG5 ) << this->getOptions() ;
61  streamlog_out( DEBUG5 ) << " -------------------------------------------------------------------------------- " << std::endl ;
62 
63  if( _is_initialised ) {
64 
65  streamlog_out( DEBUG5 ) << " MarlinAidaTT::init() - already initialized - only options are set .. " << std::endl ;
66 
67  return ;
68  }
69 
70 
71  streamlog_out( DEBUG5 ) << " ##################### MarlinAidaTT::init() - initializing " << std::endl ;
72 
73  dd4hep::Detector& theDetector = dd4hep::Detector::getInstance();
74 
75 
76  double origin[3] = { 0., 0., 0. }, bfield[3] ;
77  theDetector.field().magneticField( origin , bfield ) ;
78 
79  _bfield = new aidaTT::ConstantSolenoidBField( bfield[2] / dd4hep::tesla ) ;
80 
81  _propagation = new aidaTT::analyticalPropagation();
82  //_propagation = new aidaTT::simplifiedPropagation();
83 
84 
85  _fitter = new aidaTT::GBLInterface();
86 
87  _geom = & aidaTT::IGeometry::instance() ;
88 
89  const std::vector<const aidaTT::ISurface*>& surfaces = _geom->getSurfaces() ;
90 
91  for(std::vector<const aidaTT::ISurface*>::const_iterator surf = surfaces.begin() ; surf != surfaces.end() ; ++surf) {
92  _surfMap.insert( std::make_pair( (*surf)->id(), *surf ) ) ;
93  }
94 
95  streamlog_out( DEBUG5 ) << " MarlinAidaTT - number of surfaces = " << _surfMap.size() << std::endl ;
96 
97  _is_initialised = true;
98 
99  }
100 
102 
103  if ( ! _is_initialised ) {
104 
105  std::stringstream errorMsg;
106 
107  errorMsg << "MarlinAidaTT::createTrack: Fitter not initialised. MarlinAidaTT::init() must be called before MarlinAidaTT::createTrack()" << std::endl ;
108  throw MarlinTrk::Exception(errorMsg.str());
109 
110  }
111  return new MarlinAidaTTTrack(this) ;
112 
113  }
114 
115 
116 
117 } // end of namespace MarlinTrk
MarlinAidaTT()
Default c&#39;tor.
Definition: MarlinAidaTT.cc:37
void registerOptions()
Register the possible configuration options.
aidaTT::IPropagation * _propagation
Definition: MarlinAidaTT.h:115
static const unsigned usedEdx
Use multiple scattering in the track fits.
T endl(T...args)
aidaTT::IBField * _bfield
Definition: MarlinAidaTT.h:113
aidaTT::IFittingAlgorithm * _fitter
Definition: MarlinAidaTT.h:114
void init()
initialise track fitter system
Definition: MarlinAidaTT.cc:52
T end(T...args)
bool _useQMS
take multiple scattering into account during the fit
Definition: MarlinAidaTT.h:105
Interface for generic tracks in MarlinTrk.
Definition: IMarlinTrack.h:36
T str(T...args)
T make_pair(T...args)
const aidaTT::IGeometry * _geom
Definition: MarlinAidaTT.h:112
bool getOption(unsigned CFGOption)
Return the option&#39;s current value - false if option not defined.
friend class MarlinAidaTTTrack
Definition: MarlinAidaTT.h:47
SurfMap _surfMap
multi-map of surfaces
Definition: MarlinAidaTT.h:110
T insert(T...args)
T size(T...args)
std::string getOptions()
String with all configuration options and their current values.
STL class.
T begin(T...args)
Exception thrown in IMarlinTrk namespace (implemetations of IMarlinTrkSystem and IMarlinTrack).
MarlinTrk::IMarlinTrack * createTrack()
instantiate its implementation of the IMarlinTrack
static const unsigned useQMS
Use multiple scattering in the track fits.