1#include "KalFitAlg/KalFitAlg.h"
2#include "KalFitAlg/KalFitTrack.h"
3#include "GaudiKernel/MsgStream.h"
4#include "GaudiKernel/AlgFactory.h"
5#include "GaudiKernel/ISvcLocator.h"
6#include "GaudiKernel/SmartDataPtr.h"
7#include "GaudiKernel/IDataProviderSvc.h"
8#include "GaudiKernel/PropertyMgr.h"
9#include "MdcGeomSvc/IMdcGeomSvc.h"
53 radius = _BesKalmanFitTubs[0].GetInnerRadius()/(cm);
54 thick = _BesKalmanFitTubs[0].GetOuterRadius()/(cm) - _BesKalmanFitTubs[0].GetInnerRadius()/(cm);
55 length = 2.0*_BesKalmanFitTubs[0].GetZHalfLength()/(cm);
57 std::cout<<"innerwall: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<std::endl;
58 KalFitCylinder innerwallCylinder(&(_BesKalmanFitMaterials[1]), radius, thick, length , z0);
59 _BesKalmanFitWalls.push_back(innerwallCylinder);
63 radius = _BesKalmanFitTubs[2].GetOuterRadius()/(cm);
64 thick = _BesKalmanFitTubs[0].GetInnerRadius()/(cm) - _BesKalmanFitTubs[2].GetOuterRadius()/(cm);
65 length = 2.0*_BesKalmanFitTubs[0].GetZHalfLength()/(cm);
67 std::cout<<"outer air: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<std::endl;
68 KalFitCylinder outerAirCylinder(&(_BesKalmanFitMaterials[4]), radius, thick, length , z0);
69 _BesKalmanFitWalls.push_back(outerAirCylinder);
73 radius = _BesKalmanFitTubs[2].GetInnerRadius()/(cm);
74 thick = _BesKalmanFitTubs[2].GetOuterRadius()/(cm) - _BesKalmanFitTubs[2].GetInnerRadius()/(cm);
75 length = 2.0*_BesKalmanFitTubs[2].GetZHalfLength()/(cm);
77 std::cout<<"outer Be: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<std::endl;
78 KalFitCylinder outerBeCylinder(&(_BesKalmanFitMaterials[2]), radius, thick, length , z0);
79 _BesKalmanFitWalls.push_back(outerBeCylinder);
83 radius = _BesKalmanFitTubs[3].GetInnerRadius()/(cm);
84 thick = _BesKalmanFitTubs[3].GetOuterRadius()/(cm) - _BesKalmanFitTubs[3].GetInnerRadius()/(cm);
85 length = 2.0*_BesKalmanFitTubs[3].GetZHalfLength()/(cm);
87 std::cout<<"He gas: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<std::endl;
88 KalFitCylinder heCylinder(&(_BesKalmanFitMaterials[3]), radius, thick, length , z0);
89 _BesKalmanFitWalls.push_back(heCylinder);
93 radius = _BesKalmanFitTubs[4].GetInnerRadius()/(cm);
94 thick = _BesKalmanFitTubs[4].GetOuterRadius()/(cm) - _BesKalmanFitTubs[4].GetInnerRadius()/(cm);
95 length = 2.0*_BesKalmanFitTubs[4].GetZHalfLength()/(cm);
97 std::cout<<"inner Be: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<std::endl;
98 KalFitCylinder innerBeCylinder(&(_BesKalmanFitMaterials[2]), radius, thick, length , z0);
99 _BesKalmanFitWalls.push_back(innerBeCylinder);
103 thick = _BesKalmanFitTubs[4].GetInnerRadius()/(cm);
104 length = 2.0*_BesKalmanFitTubs[4].GetZHalfLength()/(cm);
106 std::cout<<"inner air: "<<" radius: "<<radius<<" thick:"<<thick<<" length: "<<length<<std::endl;
107 KalFitCylinder innerAirCylinder(&(_BesKalmanFitMaterials[4]), radius, thick, length , z0);
108 _BesKalmanFitWalls.push_back(innerAirCylinder);
118 std::cout<<
"ERROR OCCUR when dynamic_cast in KalFitAlg2.cxx ..!!"<<std::endl;
122 cout <<
"KalFitAlg:: MDC initialisation " << std::endl;
132 if (!Nwire || !Nlyr || !Nsup){
133 cout <<
".....MdcGeom Objects are missing !! " << std::endl;
144 if (!_wire || !_layer || !_superLayer){
145 std::cerr <<
"KalFitAlg::Cannot allocate geometries" << std::endl;
146 std::cerr <<
"JOB will stop" << std::endl;
150 int superLayerID = 0;
152 int localLayerID = 0;
162 int NlocalWireID[43];
164 for (wireID = 0;wireID <= Nwire; wireID++) {
166 if (layer != layer_back) {
169 if (superLayer != superLayer_back) {
170 superLayer_back = superLayer;
171 Nlayer[k] = localLayerID;
176 NlocalWireID[layerID] = localWireID;
191 superLayer_back = NULL;
192 for (wireID = 0;wireID < Nwire; wireID++) {
194 NULL : mdcGeomSvc->
Wire(wireID)->
Lyr();
195 if (layer != layer_back){
198 NULL : mdcGeomSvc->
Layer(layerID+1)->
Sup();
199 if (superLayer != superLayer_back){
200 superLayer_back = superLayer;
204 Nlocal[superLayerID+1],
206 Nlayer[superLayerID+1],
212 double slantWithSymbol = (mdcGeomSvc->
Layer(layerID)->
Slant())
218 layerID, localLayerID++ );
223 const MdcGeoWire * wire = (wireID==Nwire) ? NULL : mdcGeomSvc->
Wire(wireID);
227 if (superLayerID == 2 || superLayerID == 3 ||
228 superLayerID == 4 || superLayerID == 9 ||
229 superLayerID == 10) {
230 new(_wire+wireID)
KalFitWire(localID++,_layer[layerID],
231 fwd,bck, _wire+Nwire,wire->
Id(),0);
234 new(_wire+wireID)
KalFitWire(localID++,_layer[layerID],
235 fwd,bck, _wire+Nwire,wire->
Id(),1);
242 if (
debug_ == 4) cout <<
"MDC geometry reading done" << std::endl;
250 MsgStream log(
msgSvc(), name());
251 StatusCode sc = service (
"MdcCalibFunSvc", imdcCalibSvc);
253 if ( sc.isFailure() ){
254 log << MSG::FATAL <<
"Could not load MdcCalibFunSvc!" << endreq;
262 MsgStream log(
msgSvc(), name());
263 StatusCode sc = service (
"MdcGeomSvc", imdcGeomSvc);
265 if ( sc.isFailure() ){
266 log << MSG::FATAL <<
"Could not load MdcGeomSvc!" << endreq;
268 imdcGeomSvc_ = imdcGeomSvc;
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 MdcCalibFunSvc *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
const MdcGeoWire *const Wire(unsigned id)
const int getSuperLayerSize()
const MdcGeoLayer *const Layer(unsigned id)