00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: TrkContextEv.cxx,v 1.2 2006/12/01 01:10:32 zhangy Exp $ 00004 // 00005 // Description: 00006 // 00007 // 00008 // Environment: 00009 // Software developed for the BaBar Detector at the SLAC B-Factory. 00010 // 00011 // Author(s): Steve Schaffner 00012 // 00013 //------------------------------------------------------------------------ 00014 00015 //#include "BaBar/BaBar.h" 00016 #include "TrkFitter/TrkContextEv.h" 00017 //#include "AbsEnv/AbsEnv.h" 00018 //#include "AbsEvent/AbsEvent.h" 00019 //#include "ProxyDict/Ifd.h" 00020 #include "TrkFitter/TrkIdManDefault.h" 00021 #include "TrkFitter/TrkIdManDumb.h" 00022 #include "TrkBase/TrkId.h" 00023 //#include "ErrLogger/ErrLog.h" 00024 //#include "TrkEnv/TrkEnv.h" 00025 //#include "AbsEnv/AbsEnv.h" 00026 #include "BField/BField.h" 00027 00028 //------------------------------------------------------------------------ 00029 TrkContextEv::TrkContextEv(const BField *bf) : 00030 TrkContext(bf) 00031 //------------------------------------------------------------------------ 00032 { 00033 TrkIdManager* manTmp; 00034 // if (anEvent == 0) { 00035 // manTmp = TrkIdManDumb::instance();//yzhang temp 00036 /* } 00037 else { 00038 // Default Id manager 00039 TrkIdManager* manDef = 00040 Ifd< TrkIdManager >::get( anEvent, IfdStrKey("Default") ); 00041 if (0 == manDef) { 00042 manDef = new TrkIdManDefault(1); 00043 IfdDataProxy<TrkIdManager>* theProxy = 00044 new IfdDataProxy<TrkIdManager>(manDef); 00045 if (!(Ifd<TrkIdManager>::put(anEvent,theProxy,IfdStrKey("Default")))){ 00046 ErrMsg(error) << "TrkContextEv: Oops - couldn't put TrkIdManager" 00047 << endmsg; 00048 } 00049 } 00050 manTmp = manDef; 00051 }*/ 00052 //yzhang 00053 TrkIdManDefault* manDef = new TrkIdManDefault(0); 00054 manTmp = dynamic_cast<TrkIdManager*> (manDef); 00055 //zhangy 00056 _idman = manTmp; 00057 } 00058 00059 //------------------------------------------------------------------------ 00060 TrkContextEv::~TrkContextEv() { 00061 //------------------------------------------------------------------------ 00062 delete _idman; 00063 } 00064 00065 00066 //------------------------------------------------------------------------ 00067 TrkId 00068 TrkContextEv::getId() const { 00069 //------------------------------------------------------------------------ 00070 return TrkId(idManager()); 00071 } 00072