1#include "GaudiKernel/IDataProviderSvc.h"
2#include "GaudiKernel/ISvcLocator.h"
3#include "GaudiKernel/MsgStream.h"
4#include "GaudiKernel/PropertyMgr.h"
5#include "GaudiKernel/SmartDataPtr.h"
7#include "KalFitAlg/KalFitTrack.h"
8#include "MdcGeomSvc/IMdcGeomSvc.h"
49 radius = _BesKalmanFitTubs[0].GetInnerRadius()/(cm);
50 thick = _BesKalmanFitTubs[0].GetOuterRadius()/(cm) -
51_BesKalmanFitTubs[0].GetInnerRadius()/(cm); length
52= 2.0*_BesKalmanFitTubs[0].GetZHalfLength()/(cm); z0 = 0.0; std::cout<<"innerwall: "<<"
53radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<std::endl; KalFitCylinder
54innerwallCylinder(&(_BesKalmanFitMaterials[1]), radius, thick, length , z0);
55 _BesKalmanFitWalls.push_back(innerwallCylinder);
59special radius = _BesKalmanFitTubs[2].GetOuterRadius()/(cm); thick =
60_BesKalmanFitTubs[0].GetInnerRadius()/(cm) - _BesKalmanFitTubs[2].GetOuterRadius()/(cm); length
61= 2.0*_BesKalmanFitTubs[0].GetZHalfLength()/(cm); z0 = 0.0; std::cout<<"outer air: "<<"
62radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<std::endl; KalFitCylinder
63outerAirCylinder(&(_BesKalmanFitMaterials[4]), radius, thick, length , z0);
64 _BesKalmanFitWalls.push_back(outerAirCylinder);
68 radius = _BesKalmanFitTubs[2].GetInnerRadius()/(cm);
69 thick = _BesKalmanFitTubs[2].GetOuterRadius()/(cm) -
70_BesKalmanFitTubs[2].GetInnerRadius()/(cm); length
71= 2.0*_BesKalmanFitTubs[2].GetZHalfLength()/(cm); z0 = 0.0; std::cout<<"outer Be: "<<"
72radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<std::endl; KalFitCylinder
73outerBeCylinder(&(_BesKalmanFitMaterials[2]), radius, thick, length , z0);
74 _BesKalmanFitWalls.push_back(outerBeCylinder);
78 radius = _BesKalmanFitTubs[3].GetInnerRadius()/(cm);
79 thick = _BesKalmanFitTubs[3].GetOuterRadius()/(cm) -
80_BesKalmanFitTubs[3].GetInnerRadius()/(cm); length
81= 2.0*_BesKalmanFitTubs[3].GetZHalfLength()/(cm); z0 = 0.0; std::cout<<"He gas: "<<"
82radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<std::endl; KalFitCylinder
83heCylinder(&(_BesKalmanFitMaterials[3]), radius, thick, length , z0);
84 _BesKalmanFitWalls.push_back(heCylinder);
88 radius = _BesKalmanFitTubs[4].GetInnerRadius()/(cm);
89 thick = _BesKalmanFitTubs[4].GetOuterRadius()/(cm) -
90_BesKalmanFitTubs[4].GetInnerRadius()/(cm); length
91= 2.0*_BesKalmanFitTubs[4].GetZHalfLength()/(cm); z0 = 0.0; std::cout<<"inner Be: "<<"
92radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<std::endl; KalFitCylinder
93innerBeCylinder(&(_BesKalmanFitMaterials[2]), radius, thick, length , z0);
94 _BesKalmanFitWalls.push_back(innerBeCylinder);
98 thick = _BesKalmanFitTubs[4].GetInnerRadius()/(cm);
99 length = 2.0*_BesKalmanFitTubs[4].GetZHalfLength()/(cm);
101 std::cout<<"inner air: "<<" radius: "<<radius<<" thick:"<<thick<<" length:
102"<<length<<std::endl; KalFitCylinder innerAirCylinder(&(_BesKalmanFitMaterials[4]), radius,
103thick, length , z0); _BesKalmanFitWalls.push_back(innerAirCylinder);
111 { std::cout <<
"ERROR OCCUR when dynamic_cast in KalFitAlg2.cxx ..!!" << std::endl; }
113 if (
debug_ == 4 ) { cout <<
"KalFitAlg:: MDC initialisation " << std::endl; }
122 if ( !Nwire || !Nlyr || !Nsup )
124 cout <<
".....MdcGeom Objects are missing !! " << std::endl;
133 if ( !_wire || !_layer || !_superLayer )
135 std::cerr <<
"KalFitAlg::Cannot allocate geometries" << std::endl;
136 std::cerr <<
"JOB will stop" << std::endl;
140 int superLayerID = 0;
142 int localLayerID = 0;
152 int NlocalWireID[43];
154 for ( wireID = 0; wireID <= Nwire; wireID++ )
157 if ( layer != layer_back )
161 ( wireID == Nwire ) ? NULL : mdcGeomSvc->
Layer( layerID )->
Sup();
162 if ( superLayer != superLayer_back )
164 superLayer_back = superLayer;
165 Nlayer[k] = localLayerID;
170 NlocalWireID[layerID] = localWireID;
185 superLayer_back = NULL;
186 for ( wireID = 0; wireID < Nwire; wireID++ )
189 if ( layer != layer_back )
193 ( wireID == Nwire ) ? NULL : mdcGeomSvc->
Layer( layerID + 1 )->
Sup();
194 if ( superLayer != superLayer_back )
196 superLayer_back = superLayer;
199 new ( _superLayer + superLayerID )
201 Nlayer[superLayerID + 1], superLayerID );
206 double slantWithSymbol = ( mdcGeomSvc->
Layer( layerID )->Slant() ) *
207 ( mdcGeomSvc->
Layer( layerID )->Sup()->Type() );
209 _superLayer[superLayerID], 0.1 * layer->
Radius(),
211 0.1 * ( -layer->
Length() / 2 ), layer->
Offset(), layerID, localLayerID++ );
216 const MdcGeoWire* wire = ( wireID == Nwire ) ? NULL : mdcGeomSvc->
Wire( wireID );
220 if ( superLayerID == 2 || superLayerID == 3 || superLayerID == 4 || superLayerID == 9 ||
223 new ( _wire + wireID )
224 KalFitWire( localID++, _layer[layerID], fwd, bck, _wire + Nwire, wire->
Id(), 0 );
228 new ( _wire + wireID )
229 KalFitWire( localID++, _layer[layerID], fwd, bck, _wire + Nwire, wire->
Id(), 1 );
236 if (
debug_ == 4 ) cout <<
"MDC geometry reading done" << std::endl;
242 MsgStream log(
msgSvc(), name() );
243 StatusCode sc = service(
"MdcCalibFunSvc", m_mdcCalibFunSvc_ );
244 if ( sc.isFailure() ) { log << MSG::FATAL <<
"Could not load MdcCalibFunSvc!" << endmsg; }
250 MsgStream log(
msgSvc(), name() );
251 StatusCode sc = service(
"MdcGeomSvc", imdcGeomSvc );
253 if ( sc.isFailure() ) { log << MSG::FATAL <<
"Could not load MdcGeomSvc!" << endmsg; }
254 imdcGeomSvc_ = imdcGeomSvc;
HepGeom::Point3D< double > HepPoint3D
virtual const int getLayerSize()=0
virtual const MdcGeoLayer *const Layer(unsigned id)=0
virtual const MdcGeoWire *const Wire(unsigned id)=0
virtual const int getWireSize()=0
virtual const int getSuperLayerSize()=0
void setCalibSvc_init(void)
initialize for the services
int debug_
Debug flag for the track finder part.
void setGeomSvc_init(void)
void set_Mdc(void)
Set up the wires, layers and superlayers...
static void setMdcCalibFunSvc(const IMdcCalibFunSvc *calibsvc)
static void setIMdcGeomSvc(IMdcGeomSvc *igeomsvc)
Description of a Wire class.
double Radius(void) const
double Length(void) const
MdcGeoSuper * Sup(void) const
double Offset(void) const
MdcGeoLayer * Lyr(void) const
HepPoint3D Forward(void) const
HepPoint3D Backward(void) const