00001 #include <iostream> 00002 #include <string> 00003 00004 #include "BField/BField.h" 00005 #include "CandFitTrackSR/BFieldSR.h" 00006 #include "Conventions/Detector.h" 00007 #include "Validity/VldContext.h" 00008 #include "MessageService/MsgService.h" 00009 #include <cassert> 00010 00011 //______________________________________________________________________ 00012 CVSID("$Id: BFieldSR.cxx,v 1.8 2007/11/11 08:44:45 rhatcher Exp $"); 00013 00014 //------------------------------------------------------------------ 00015 BFieldSR::BFieldSR(const VldContext *vldc) 00016 { 00017 00018 bf = 0; 00019 switch (vldc->GetDetector()) { 00020 case Detector::kFar: 00021 bf = new BField(*vldc); 00022 break; 00023 case Detector::kNear: 00024 bf = new BField(*vldc); 00025 break; 00026 default: 00027 MSG("CandFitTrackSR",Msg::kWarning) 00028 << "BFieldSR does not exist for " 00029 << Detector::AsString(vldc->GetDetector()) 00030 << " detector " << endl; 00031 } 00032 } 00033 00034 BFieldSR::~BFieldSR() 00035 { 00036 if (bf) { 00037 delete bf; 00038 } 00039 } 00040 00041 TVector3 BFieldSR::GetBField(TVector3 &xyz) 00042 { 00043 if (bf) 00044 return bf->GetBField(xyz); 00045 else 00046 return TVector3(0.,0.,0.); 00047 }
1.3.9.1