|
ATLAS Offline Software
|
#include <FPGATrackSimFitConstantBank.h>
|
| FPGATrackSimFitConstantBank (FPGATrackSimPlaneMap const *pmap, int ncoords, std::string const &fname, bool isFirstStage, int missingPlane=-1) |
|
int | getBankID () const |
|
int | getNConstr () const |
|
int | getNCoords () const |
|
int | getNPars () const |
|
int | getNSectors () const |
|
int | getMissingPlane () const |
|
bool | getIsGood (sector_t sector) const |
|
float | getFitConst (int isec, int ipar) const |
|
float | getFitPar (int isec, int ipar, int icoord) const |
|
float | getKaverage (int isec, int iconstr) const |
|
float | getKernel (int isec, int iconstr, int icoord) const |
|
bool | linfit (sector_t sector, FPGATrackSimTrack &track, bool isSecondStage) const |
|
void | linfit_chisq (sector_t sector, FPGATrackSimTrack &trk) const |
|
void | linfit_pars_eval (sector_t sector, FPGATrackSimTrack &trk) const |
|
int | missing_point_guess (sector_t sector, FPGATrackSimTrack &track, bool isFirstStage, bool doExtrapolation) const |
|
void | invlinfit (sector_t sector, FPGATrackSimTrack &track, double const *constr) const |
| This method uses the track parameters and additional constraints to use the constants to calculate the corresponding hits. More...
|
|
void | setIdealCoordFit (bool v) |
|
bool | msgLvl (const MSG::Level lvl) const |
| Test the output level. More...
|
|
MsgStream & | msg () const |
| The standard message stream. More...
|
|
MsgStream & | msg (const MSG::Level lvl) const |
| The standard message stream. More...
|
|
void | setLevel (MSG::Level lvl) |
| Change the current logging level. More...
|
|
◆ FPGATrackSimFitConstantBank()
FPGATrackSimFitConstantBank::FPGATrackSimFitConstantBank |
( |
FPGATrackSimPlaneMap const * |
pmap, |
|
|
int |
ncoords, |
|
|
std::string const & |
fname, |
|
|
bool |
isFirstStage, |
|
|
int |
missingPlane = -1 |
|
) |
| |
Definition at line 22 of file FPGATrackSimFitConstantBank.cxx.
34 std::ifstream geocfile(
fname);
35 if (not geocfile.is_open()) {
49 if (
sizeof(
float) * CHAR_BIT != 32)
50 ATH_MSG_WARNING(
"Floating points on this computer are not 32 bit. This may cause a problem for the hardware agreement. Be careful!");
◆ calculateMajority()
void FPGATrackSimFitConstantBank::calculateMajority |
( |
| ) |
|
|
private |
◆ getBankID()
int FPGATrackSimFitConstantBank::getBankID |
( |
| ) |
const |
|
inline |
◆ getFitConst()
float FPGATrackSimFitConstantBank::getFitConst |
( |
int |
isec, |
|
|
int |
ipar |
|
) |
| const |
|
inline |
◆ getFitPar()
float FPGATrackSimFitConstantBank::getFitPar |
( |
int |
isec, |
|
|
int |
ipar, |
|
|
int |
icoord |
|
) |
| const |
|
inline |
◆ getIsGood()
bool FPGATrackSimFitConstantBank::getIsGood |
( |
sector_t |
sector | ) |
const |
|
inline |
◆ getKaverage()
float FPGATrackSimFitConstantBank::getKaverage |
( |
int |
isec, |
|
|
int |
iconstr |
|
) |
| const |
|
inline |
◆ getKernel()
float FPGATrackSimFitConstantBank::getKernel |
( |
int |
isec, |
|
|
int |
iconstr, |
|
|
int |
icoord |
|
) |
| const |
|
inline |
◆ getMissingPlane()
int FPGATrackSimFitConstantBank::getMissingPlane |
( |
| ) |
const |
|
inline |
◆ getNConstr()
int FPGATrackSimFitConstantBank::getNConstr |
( |
| ) |
const |
|
inline |
◆ getNCoords()
int FPGATrackSimFitConstantBank::getNCoords |
( |
| ) |
const |
|
inline |
◆ getNPars()
int FPGATrackSimFitConstantBank::getNPars |
( |
| ) |
const |
|
inline |
◆ getNSectors()
int FPGATrackSimFitConstantBank::getNSectors |
( |
| ) |
const |
|
inline |
◆ initMessaging()
void AthMessaging::initMessaging |
( |
| ) |
const |
|
privateinherited |
Initialize our message level and MessageSvc.
This method should only be called once.
Definition at line 39 of file AthMessaging.cxx.
◆ invlinfit()
This method uses the track parameters and additional constraints to use the constants to calculate the corresponding hits.
This method is the base of the patt-from-constant generation.
Definition at line 527 of file FPGATrackSimFitConstantBank.cxx.
572 track.setFPGATrackSimHit(plane, hit);
◆ linfit()
◆ linfit_chisq()
◆ linfit_pars_eval()
◆ missing_point_guess()
int FPGATrackSimFitConstantBank::missing_point_guess |
( |
sector_t |
sector, |
|
|
FPGATrackSimTrack & |
track, |
|
|
bool |
isFirstStage, |
|
|
bool |
doExtrapolation |
|
) |
| const |
Definition at line 326 of file FPGATrackSimFitConstantBank.cxx.
330 std::vector<int> missid;
334 std::vector<int> missing_planes;
337 coordsmask[j] = (
track.getHitMap()>>j) & 1;
338 if (!coordsmask[j]) {
340 if(missing_planes.size() == 0) {
341 missing_planes.push_back(plane);
344 for (
unsigned k = 0;
k < missing_planes.size();
k++) {
345 if(plane == missing_planes[
k])
break;
346 if(
k == missing_planes.size() - 1) missing_planes.push_back(plane);
354 if(!doExtrapolation){
356 if(missing_planes.size() > 1){
357 ATH_MSG_WARNING(
"missing_point_guess() Can only guess 1 layer in the first stage");
361 ATH_MSG_WARNING(
"missing_point_guess() Cannot guess more than two coordinates in the first stage");
366 if(missing_planes.size() > 2){
367 ATH_MSG_WARNING(
"missing_point_guess() Can only guess 2 layers in the second stage");
371 ATH_MSG_WARNING(
"missing_point_guess() Cannot guess more than four coordinates in the second stage");
377 Eigen::MatrixXd
coef(nmissing,nmissing);
378 Eigen::VectorXd
a(nmissing);
380 for (
int i=0;
i<nmissing; ++
i)
386 if (!coordsmask[
col])
continue;
396 for (
int j=0; j<nmissing; ++j)
403 if (
coef.determinant()==0)
return -1;
404 Eigen::VectorXd missing_hits =
coef.inverse()*
a;
406 for(
int m=0;
m<nmissing;
m++){
422 double target_r =
track.getIdealRadius(missedplane);
423 newhit.
setX(target_r*TMath::Cos(missing_hits[
m]));
424 newhit.
setY(target_r*TMath::Sin(missing_hits[
m]));
430 track.setFPGATrackSimHit(missedplane, newhit);
444 double target_r =
track.getIdealRadius(missedplane);
445 newhit.
setX(target_r*TMath::Cos(missing_hits[
m]));
446 newhit.
setY(target_r*TMath::Sin(missing_hits[
m]));
447 newhit.
setZ(missing_hits[
m+1]);
455 track.setFPGATrackSimHit(missedplane, newhit);
◆ msg() [1/2]
MsgStream & AthMessaging::msg |
( |
| ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 164 of file AthMessaging.h.
◆ msg() [2/2]
MsgStream & AthMessaging::msg |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
The standard message stream.
Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.
Definition at line 179 of file AthMessaging.h.
180 {
return msg() << lvl; }
◆ msgLvl()
bool AthMessaging::msgLvl |
( |
const MSG::Level |
lvl | ) |
const |
|
inlineinherited |
Test the output level.
- Parameters
-
lvl | The message level to test against |
- Returns
- boolean Indicating if messages at given level will be printed
- Return values
-
true | Messages at level "lvl" will be printed |
Definition at line 151 of file AthMessaging.h.
◆ prepareInvFitConstants()
void FPGATrackSimFitConstantBank::prepareInvFitConstants |
( |
| ) |
|
|
private |
Definition at line 210 of file FPGATrackSimFitConstantBank.cxx.
235 bool foundrow =
false;
236 bool foundcolumn =
false;
239 if (abs(thisMatrix(iy,ix)) >
MTX_TOLERANCE) foundcolumn =
true;
241 if (foundrow && foundcolumn)
m_WCs(isec,ix) = 0;
245 size_t nDimToUse = 0;
for (
int ix=0;ix!=
m_ncoords;++ix)
if(!
m_WCs(isec,ix)) ++nDimToUse;
247 Eigen::MatrixXf tempMatrix(nDimToUse, nDimToUse);
249 size_t counteri = 0, counterj = 0;
254 if (!
m_WCs(isec,j)) {
255 tempMatrix(counteri,counterj) = thisMatrix(
i,j);
264 Eigen::MatrixXf inverted = tempMatrix.inverse();
270 counteri = 0; counterj = 0;
275 if (!
m_WCs(isec,j)) {
276 fullInverted(
i,j) = inverted(counteri,counterj);
280 fullInverted(
i,j) = 0;
287 fullInverted(
i,j) = 0;
◆ readHeader()
void FPGATrackSimFitConstantBank::readHeader |
( |
std::ifstream & |
geocfile | ) |
|
|
private |
◆ readSectorInfo()
void FPGATrackSimFitConstantBank::readSectorInfo |
( |
std::ifstream & |
geocfile | ) |
|
|
private |
◆ setIdealCoordFit()
void FPGATrackSimFitConstantBank::setIdealCoordFit |
( |
bool |
v | ) |
|
|
inline |
◆ setLevel()
void AthMessaging::setLevel |
( |
MSG::Level |
lvl | ) |
|
|
inherited |
◆ ATLAS_THREAD_SAFE
std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT |
|
mutableprivateinherited |
◆ m_bankID
int FPGATrackSimFitConstantBank::m_bankID |
|
private |
◆ m_fit_const
vector2D<float> FPGATrackSimFitConstantBank::m_fit_const |
|
private |
◆ m_fit_pars
vector3D<float> FPGATrackSimFitConstantBank::m_fit_pars |
|
private |
◆ m_imsg
std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr } |
|
mutableprivateinherited |
◆ m_invfit_consts
std::vector<Eigen::MatrixXf, Eigen::aligned_allocator<Eigen::MatrixXf> > FPGATrackSimFitConstantBank::m_invfit_consts |
|
private |
◆ m_isIdealCoordFit
bool FPGATrackSimFitConstantBank::m_isIdealCoordFit |
|
private |
◆ m_kaverage
vector2D<float> FPGATrackSimFitConstantBank::m_kaverage |
|
private |
◆ m_kernel
vector3D<float> FPGATrackSimFitConstantBank::m_kernel |
|
private |
◆ m_lvl
std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL } |
|
mutableprivateinherited |
◆ m_maj_a
vector2D<float> FPGATrackSimFitConstantBank::m_maj_a |
|
private |
◆ m_maj_invkk
vector3D<float> FPGATrackSimFitConstantBank::m_maj_invkk |
|
private |
◆ m_maj_kk
vector3D<float> FPGATrackSimFitConstantBank::m_maj_kk |
|
private |
◆ m_missid
std::vector<int> FPGATrackSimFitConstantBank::m_missid |
|
private |
◆ m_missingPlane
int FPGATrackSimFitConstantBank::m_missingPlane |
|
private |
◆ m_msg_tls
boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls |
|
mutableprivateinherited |
MsgStream instance (a std::cout like with print-out levels)
Definition at line 132 of file AthMessaging.h.
◆ m_nconstr
int FPGATrackSimFitConstantBank::m_nconstr |
|
private |
◆ m_ncoords
int FPGATrackSimFitConstantBank::m_ncoords |
|
private |
◆ m_nm
std::string AthMessaging::m_nm |
|
privateinherited |
◆ m_npars
int FPGATrackSimFitConstantBank::m_npars = 0 |
|
private |
◆ m_npixcy
int FPGATrackSimFitConstantBank::m_npixcy |
|
private |
◆ m_nsectors
int FPGATrackSimFitConstantBank::m_nsectors |
|
private |
◆ m_pmap
◆ m_sector_good
std::vector<bool> FPGATrackSimFitConstantBank::m_sector_good |
|
private |
◆ m_WCs
vector2D<int> FPGATrackSimFitConstantBank::m_WCs |
|
private |
The documentation for this class was generated from the following files:
std::atomic< MSG::Level > m_lvl
Current logging level.
float getPhiCoord(int ilayer) const
void setSection(unsigned v)
bool getDoDeltaGPhis() const
void readSectorInfo(std::ifstream &geocfile)
vector3D< float > m_kernel
void setPhiCoord(float v)
void readHeader(std::ifstream &geocfile)
vector2D< float > m_maj_a
vector2D< float > m_fit_const
vector3D< float > m_fit_pars
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
IMessageSvc * getMessageSvc(bool quiet=false)
uint32_t getCoordLayer(uint32_t coord) const
uint32_t getDim(size_t logiLayer) const
void setPhi(float v, bool ForceRange=true)
void setDetType(SiliconTech detType)
AthMessaging()
Default constructor:
void resize(size_t x1, size_t x2, size_t x3, T const &t=T())
void linfit_chisq(sector_t sector, FPGATrackSimTrack &trk) const
SiliconTech getDetType(size_t logiLayer) const
void setEtaCoord(float v)
double chi2(TH1 *h0, TH1 *h1)
float getEtaCoord(int ilayer) const
MsgStream & msg() const
The standard message stream.
vector3D< float > m_maj_kk
std::vector< std::string > remainder(const std::vector< std::string > &v1, const std::vector< std::string > &v2)
list of entries in a vector that are not in another
void prepareInvFitConstants()
void linfit_pars_eval(sector_t sector, FPGATrackSimTrack &trk) const
int missing_point_guess(sector_t sector, FPGATrackSimTrack &track, bool isFirstStage, bool doExtrapolation) const
FPGATrackSimPlaneMap const * m_pmap
std::vector< Eigen::MatrixXf, Eigen::aligned_allocator< Eigen::MatrixXf > > m_invfit_consts
void setIdealCoordFit(bool v)
std::vector< bool > m_sector_good
void setLayer(unsigned v)
#define ATH_MSG_WARNING(x)
void resize(size_t x1, size_t x2, T const &t=T())
std::string m_nm
Message source name.
vector3D< float > m_maj_invkk
void initMessaging() const
Initialize our message level and MessageSvc.
vector2D< float > m_kaverage
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
void setHitType(HitType type)