#include <BdlTool.h>
Inheritance diagram for BdlTool:
Public Member Functions | |
| BdlTool (const std::string &type, const std::string &name, const IInterface *parent) | |
| Standard Constructor. | |
| virtual | ~BdlTool () |
| Standard Destructor. | |
| StatusCode | initialize () |
| Initialize. | |
| StatusCode | finalize () |
| Finalize(). | |
| double | bdlIntegral (double ySlopeVelo, double zOrigin, double zVelo) |
| Actual operator function. | |
| double | zBdlMiddle (double ySlopeVelo, double zOrigin, double zVelo) |
| INTupleSvc * | ntupleSvc () const |
| INTupleSvc * | evtColSvc () const |
| IDataProviderSvc * | detSvc () const |
| IDataProviderSvc * | evtSvc () const |
| IIncidentSvc * | incSvc () const |
| IChronoStatSvc * | chronoSvc () const |
| IHistogramSvc * | histoSvc () const |
| IAlgContextSvc * | contextSvc () const |
| DataObject * | put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const |
| DataObject * | put (DataObject *object, const std::string &address, const bool useRootInTES=true) const |
| Gaudi::Utils::GetData< TYPE >::return_type | get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
| Gaudi::Utils::GetData< TYPE >::return_type | get (const std::string &location, const bool useRootInTES=true) const |
| TYPE * | getDet (IDataProviderSvc *svc, const std::string &location) const |
| TYPE * | getDet (const std::string &location) const |
| bool | exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
| bool | exist (const std::string &location, const bool useRootInTES=true) const |
| bool | existDet (IDataProviderSvc *svc, const std::string &location) const |
| bool | existDet (const std::string &location) const |
| TYPE * | getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
| TYPE * | getOrCreate (const std::string &location, const bool useRootInTES=true) const |
| TOOL * | tool (const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const |
| TOOL * | tool (const std::string &type, const IInterface *parent=0, bool create=true) const |
| SERVICE * | svc (const std::string &name, const bool create=true) const |
| IUpdateManagerSvc * | updMgrSvc () const |
| IDataProviderSvc * | fastContainersSvc () const |
| StatusCode | Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const |
| StatusCode | Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const |
| StatusCode | Print (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const |
| StatusCode | Assert (const bool ok, const std::string &message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
| StatusCode | Assert (const bool ok, const char *message, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
| StatusCode | Exception (const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
| StatusCode | Exception (const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
| StatusCode | Exception (const std::string &msg="no message", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
| MsgStream & | msgStream (const MSG::Level level) const |
| MsgStream & | always () const |
| MsgStream & | fatal () const |
| MsgStream & | err () const |
| MsgStream & | error () const |
| MsgStream & | warning () const |
| MsgStream & | info () const |
| MsgStream & | debug () const |
| MsgStream & | verbose () const |
| MsgStream & | msg () const |
| const Statistics & | counters () const |
| StatEntity & | counter (const std::string &tag) const |
| MSG::Level | msgLevel () const |
| bool | msgLevel (const MSG::Level level) const |
| void | resetMsgStream () const |
| bool | typePrint () const |
| bool | propsPrint () const |
| bool | statPrint () const |
| bool | errorsPrint () const |
| long | printStat (const MSG::Level level=MSG::ALWAYS) const |
| long | printErrors (const MSG::Level level=MSG::ALWAYS) const |
| long | printProps (const MSG::Level level=MSG::ALWAYS) const |
| void | registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=NULL) |
| void | registerCondition (const std::string &condition, CondType *&condPtrDest, StatusCode(CallerClass::*mf)()=NULL) |
| void | registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL) |
| void | registerCondition (TargetClass *condition, StatusCode(CallerClass::*mf)()=NULL) |
| StatusCode | runUpdate () |
| TransientFastContainer< T > * | getFastContainer (const std::string &location, typename TransientFastContainer< T >::size_type initial=0) |
| StatusCode | release (const IInterface *interface) const |
| virtual unsigned long | release () |
| const std::string & | context () const |
| const std::string & | rootInTES () const |
| double | globalTimeOffset () const |
| virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvUnknown) |
| virtual unsigned long | addRef () |
| virtual const std::string & | name () const |
| virtual const std::string & | type () const |
| virtual const IInterface * | parent () const |
| virtual StatusCode | configure () |
| virtual StatusCode | start () |
| virtual StatusCode | stop () |
| virtual StatusCode | terminate () |
| virtual StatusCode | reinitialize () |
| virtual StatusCode | restart () |
| virtual Gaudi::StateMachine::State | FSMState () const |
| virtual Gaudi::StateMachine::State | targetFSMState () const |
| virtual StatusCode | sysInitialize () |
| virtual StatusCode | sysStart () |
| virtual StatusCode | sysStop () |
| virtual StatusCode | sysFinalize () |
| virtual StatusCode | sysReinitialize () |
| virtual StatusCode | sysRestart () |
| virtual StatusCode | setProperty (const Property &p) |
| virtual StatusCode | setProperty (const std::string &s) |
| virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
| StatusCode | setProperty (const std::string &name, const TYPE &value) |
| virtual StatusCode | getProperty (Property *p) const |
| virtual const Property & | getProperty (const std::string &name) const |
| virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
| virtual const std::vector< Property * > & | getProperties () const |
| PropertyMgr * | getPropertyMgr () |
| ISvcLocator * | serviceLocator () const |
| ISvcLocator * | svcLoc () const |
| IMessageSvc * | msgSvc () const |
| IToolSvc * | toolSvc () const |
| StatusCode | setProperties () |
| StatusCode | service (const std::string &name, T *&svc, bool createIf=true) const |
| StatusCode | service (const std::string &type, const std::string &name, T *&svc) const |
| void | declInterface (const InterfaceID &, void *) |
| Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
| Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const |
| IAuditorSvc * | auditorSvc () const |
| IMonitorSvc * | monitorSvc () const |
| void | declareInfo (const std::string &name, const T &var, const std::string &desc) const |
| void | declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const |
Static Public Member Functions | |
| static const InterfaceID & | interfaceID () |
| static const InterfaceID & | interfaceID () |
| static const InterfaceID & | interfaceID () |
Public Attributes | |
| SUCCESS | |
| NO_INTERFACE | |
| VERSMISMATCH | |
| LAST_ERROR | |
Protected Types | |
| typedef std::map< std::string, StatEntity > | Statistics |
| typedef std::map< std::string, unsigned int > | Counter |
| typedef std::vector< IAlgTool * > | AlgTools |
| typedef std::pair< IInterface *, std::string > | ServiceEntry |
| typedef std::vector< ServiceEntry > | Services |
Protected Member Functions | |
| void | f_bdl (double slopeY, double zOrigin, double zStart, double zStop) |
| StatusCode | releaseTool (const IAlgTool *tool) const |
| StatusCode | releaseSvc (const IInterface *svc) const |
| int | outputLevel () const |
| virtual unsigned long | refCount () const |
| IntegerProperty & | outputLevelProperty () |
| void | initOutputLevel (Property &prop) |
Static Protected Attributes | |
| static const bool | IgnoreRootInTES |
| static const bool | UseRootInTES |
Private Attributes | |
| double | m_BdlTrack |
| double | m_zHalfBdlTrack |
| std::vector< double > | m_bdlTmp |
| std::vector< double > | m_zTmp |
| IMagneticFieldSvc * | m_magFieldSvc |
| pointer to mag field service | |
| LutForBdlFunction * | m_lutBdl |
| LutForBdlFunction * | m_lutZHalfBdl |
| double | m_zCenterTT |
Definition at line 22 of file BdlTool.h.
| BdlTool::BdlTool | ( | const std::string & | type, | |
| const std::string & | name, | |||
| const IInterface * | parent | |||
| ) |
Standard Constructor.
Definition at line 24 of file BdlTool.cpp.
00027 : GaudiTool( type, name, parent ), 00028 m_magFieldSvc(0) 00029 { 00030 declareInterface<IBdlTool>(this); 00031 00032 declareProperty( "zCenterTT", m_zCenterTT = 247.*Gaudi::Units::cm ); 00033 00034 }
| BdlTool::~BdlTool | ( | ) | [virtual] |
| StatusCode BdlTool::initialize | ( | ) | [virtual] |
Initialize.
Reimplemented from GaudiTool.
Definition at line 38 of file BdlTool.cpp.
00038 { 00039 StatusCode sc = GaudiTool::initialize(); // must be executed first 00040 if ( sc.isFailure() ) return sc; // error printed already by GaudiAlgorithm 00041 00042 debug() << "==> Initialize" << endmsg; 00043 00044 // retrieve pointer to magnetic field service 00045 m_magFieldSvc = svc<IMagneticFieldSvc>( "MagneticFieldSvc", true ); 00046 00047 info() << "Start generation of L1 LUT tables" << endreq; 00048 // prepare table with Bdl integrations 00049 int nVarLut = 3; 00050 // Bdl integral depends on 3 track parameters 00051 // slopeY - y slope of the track 00052 // zOrigin - z of track intersection with z axis (in YZ projection) 00053 // zVeloEnd - z of the track at which slopeY is given 00054 // 00055 // slopeY zOrigin zVeloEnd 00056 int nBinVar[3] = { 30, 10, 10 }; 00057 double leftVar[3] = { -0.3, -250.*Gaudi::Units::mm, 0.*Gaudi::Units::mm}; 00058 double rightVar[3] = { 0.3, 250.*Gaudi::Units::mm, 800.*Gaudi::Units::mm}; 00059 m_lutBdl = new LutForBdlFunction(nVarLut, nBinVar, leftVar, rightVar); 00060 m_lutZHalfBdl = new LutForBdlFunction(nVarLut, nBinVar, leftVar, rightVar); 00061 00062 double lutVar[3]; 00063 m_lutBdl->resetIndexVector(); 00064 m_lutZHalfBdl->resetIndexVector(); 00065 int iover = 0; 00066 while(!iover) { 00067 m_lutBdl->getVariableVector(lutVar); 00068 double slopeY = lutVar[0]; 00069 double zOrigin = lutVar[1]; 00070 double zEndVelo = lutVar[2]; 00071 f_bdl(slopeY, zOrigin, zEndVelo, m_zCenterTT); 00072 m_lutBdl->fillTable(m_BdlTrack); 00073 m_lutZHalfBdl->fillTable(m_zHalfBdlTrack); 00074 iover = m_lutBdl->incrementIndexVector(); 00075 iover = m_lutZHalfBdl->incrementIndexVector(); 00076 } 00077 00078 info() << "Generation of L1 LUT tables finished" << endreq; 00079 00080 return StatusCode::SUCCESS; 00081 }
| StatusCode BdlTool::finalize | ( | ) | [virtual] |
Finalize().
Reimplemented from GaudiTool.
Definition at line 90 of file BdlTool.cpp.
00090 { 00091 delete m_lutBdl; 00092 delete m_lutZHalfBdl; 00093 return GaudiTool::finalize(); 00094 };
| double BdlTool::bdlIntegral | ( | double | ySlopeVelo, | |
| double | zOrigin, | |||
| double | zVelo | |||
| ) |
Actual operator function.
Definition at line 96 of file BdlTool.cpp.
00096 { 00097 00098 double var[3]; 00099 var[0] = ySlopeVelo; 00100 var[1] = zOrigin; 00101 var[2] = zVelo; 00102 return m_lutBdl->getInterpolatedValueFromTable(var); 00103 }
| double BdlTool::zBdlMiddle | ( | double | ySlopeVelo, | |
| double | zOrigin, | |||
| double | zVelo | |||
| ) |
Definition at line 105 of file BdlTool.cpp.
00105 { 00106 00107 double var[3]; 00108 var[0] = ySlopeVelo; 00109 var[1] = zOrigin; 00110 var[2] = zVelo; 00111 return m_lutZHalfBdl->getInterpolatedValueFromTable(var); 00112 }
| void BdlTool::f_bdl | ( | double | slopeY, | |
| double | zOrigin, | |||
| double | zStart, | |||
| double | zStop | |||
| ) | [protected] |
Definition at line 116 of file BdlTool.cpp.
00117 { 00118 00119 m_BdlTrack=0.0; 00120 m_zHalfBdlTrack=0.0; 00121 00122 if(zStart>zStop) return; 00123 00124 double Bdl=0.0; 00125 double zHalfBdl=0.0; 00126 00127 // vectors to calculate z of half Bdl 00128 m_bdlTmp.clear(); 00129 m_zTmp.clear(); 00130 00131 // prepare m_zBdlHalf; 00132 Gaudi::XYZPoint aPoint(0.,0.,0.); 00133 Gaudi::XYZVector bField; 00134 00135 int np = 500; 00136 double dz = (zStop - zStart)/np; 00137 double dy = dz*slopeY; 00138 00139 aPoint.SetX( 0.0 ); 00140 00141 double z = zStart+dz/2.; 00142 double y = slopeY*(zStart-zOrigin); 00143 00144 double bdl = 0.; 00145 00146 while( z<zStop ) { 00147 00148 aPoint.SetY( y ); 00149 aPoint.SetZ( z ); 00150 00151 m_magFieldSvc->fieldVector( aPoint, bField ); 00152 bdl += dy*bField.z() - dz*bField.y(); 00153 if(z>100.*Gaudi::Units::cm) { 00154 m_bdlTmp.push_back(bdl); 00155 m_zTmp.push_back(z); 00156 } 00157 z += dz; 00158 y += dy; 00159 } 00160 00161 Bdl=bdl; 00162 double bdlhalf = fabs(Bdl)/2.; 00163 00164 for(unsigned int i=5; i<m_bdlTmp.size()-5; i++) { 00165 if(fabs(m_bdlTmp[i])>bdlhalf) { 00166 double zrat = (Bdl/2.-m_bdlTmp[i-1])/(m_bdlTmp[i]-m_bdlTmp[i-1]); 00167 zHalfBdl = m_zTmp[i-1]+dz*zrat; 00168 break; 00169 } 00170 } 00171 00172 m_BdlTrack = Bdl; 00173 m_zHalfBdlTrack = zHalfBdl; 00174 00175 }
double BdlTool::m_BdlTrack [private] |
double BdlTool::m_zHalfBdlTrack [private] |
std::vector<double> BdlTool::m_bdlTmp [private] |
std::vector<double> BdlTool::m_zTmp [private] |
IMagneticFieldSvc* BdlTool::m_magFieldSvc [private] |
LutForBdlFunction* BdlTool::m_lutBdl [private] |
LutForBdlFunction* BdlTool::m_lutZHalfBdl [private] |
double BdlTool::m_zCenterTT [private] |
1.4.7