00001 // $Id: StMagFMaker.cxx,v 1.16 2010/09/01 20:21:21 fisyak Exp $ 00002 // $Log: StMagFMaker.cxx,v $ 00003 // Revision 1.16 2010/09/01 20:21:21 fisyak 00004 // remove dependence on St_geant_Maker 00005 // 00006 // Revision 1.15 2009/11/10 20:50:46 fisyak 00007 // Switch to TChair 00008 // 00009 // Revision 1.14 2007/03/21 17:12:58 fisyak 00010 // Zero Field is 1G 00011 // 00012 // Revision 1.13 2005/08/29 22:54:26 fisyak 00013 // switch to StarMagField 00014 // 00015 // Revision 1.12 2003/09/02 17:58:40 perev 00016 // gcc 3.2 updates + WarnOff 00017 // 00018 // Revision 1.11 2001/08/08 23:28:39 fisyak 00019 // Fit Reverse Field option 00020 // 00021 // Revision 1.10 2001/07/14 21:18:18 fisyak 00022 // Set scale=2.e-5 for FieldOff 00023 // 00024 // Revision 1.9 2001/05/29 21:59:41 fisyak 00025 // Add StMagF class for back compartibility 00026 // 00027 // Revision 1.8 2001/05/23 22:52:08 fisyak 00028 // Fix bug with scale factor 00029 // 00030 // Revision 1.7 2001/05/21 21:40:36 fisyak 00031 // Merge geant and production mag. fields 00032 // 00033 // Revision 1.6 2001/05/17 20:38:26 fisyak 00034 // Move check for mag. scale factor into InitRun 00035 // 00036 // Revision 1.5 2000/06/26 22:11:52 fisyak 00037 // remove params 00038 // 00039 // Revision 1.4 2000/06/19 12:49:36 fisyak 00040 // Resolve ambiguity between geometry/agufld and StMagF agufld by renaming agufld => lovefield 00041 // 00042 // Revision 1.3 2000/03/15 21:49:59 fisyak 00043 // Change to RunLog 00044 // 00045 // Revision 1.2 2000/01/07 00:42:33 fisyak 00046 // merge Make with Init 00047 // 00048 // Revision 1.1 2000/01/04 20:44:40 fisyak 00049 // Add StMagFMaker 00050 // 00052 // // 00053 // StMagFMaker class for Makers // 00054 // // 00055 // This commented block at the top of the source file is considered as // 00056 // this class description to be present on the this class Web page. // 00057 // see: begin_html <A HREF="http://root.cern.ch/root/Documentation.html"> ROOT HTML documentation </A> end_html // 00058 // // 00059 // Submit any problem with this code via begin_html <A HREF="http://www.star.bnl.gov/STARAFS/comp/sofi/bugs/send-pr.html"><B><I>"STAR Problem Report Form"</I></B></A> end_html // 00060 // // 00062 #include <assert.h> 00063 #include <Stiostream.h> 00064 #include "StMagFMaker.h" 00065 #include "StDetectorDbMaker/St_MagFactorC.h" 00066 #include "StMessMgr.h" 00067 #include "StMagF.h" 00068 #include "StarMagField.h" 00069 #include "StarCallf77.h" 00070 #if 0 00071 #define agdetpnew F77_NAME(agdetpnew,AGDETPNEW) 00072 #define agdetpadd F77_NAME(agdetpadd,AGDETPADD) 00073 #define mfldgeo F77_NAME(mfldgeo,MFLDGEO) 00074 R__EXTERN "C" { 00075 void type_of_call agdetpnew (DEFCHARD DEFCHARL); 00076 void type_of_call agdetpadd (DEFCHARD, Float_t*, Int_t* DEFCHARL); 00077 void type_of_call mfldgeo(); 00078 } 00079 #endif 00080 ClassImp(StMagFMaker) 00081 ClassImp(StMagF) 00082 00083 //_____________________________________________________________________________ 00084 StMagFMaker::~StMagFMaker(){} 00085 //_____________________________________________________________________________ 00086 Int_t StMagFMaker::InitRun(Int_t RunNo){ 00087 if (StarMagField::Instance() && StarMagField::Instance()->IsLocked()) { 00088 // Passive mode, do not change scale factor 00089 gMessMgr->Info() << "StMagFMaker::InitRun passive mode. Don't update Mag.Field from DB" << endm; 00090 return kStOK; 00091 } 00092 Float_t fScale = St_MagFactorC::instance()->ScaleFactor(); 00093 if (TMath::Abs(fScale) < 1e-3) fScale = 1e-3; 00094 gMessMgr->Info() << "StMagFMaker::InitRun active mode "; 00095 if (! StarMagField::Instance()) { 00096 new StarMagField ( StarMagField::kMapped, fScale); 00097 gMessMgr->Info() << "Initialize STAR magnetic field with scale factor " << fScale << endm; 00098 } 00099 else if (StarMagField::Instance()) { 00100 StarMagField::Instance()->SetFactor(fScale); 00101 gMessMgr->Info() << "Reset STAR magnetic field with scale factor " << fScale << endm; 00102 } 00103 return kStOK; 00104 } 00105 //_____________________________________________________________________________ 00106 00107 00108 00109 00110 00111 00112 00113 00114 00115
1.5.9