|
ATLAS Offline Software
|
Go to the documentation of this file.
3 #ifndef FPGATrackSimGenScanBinning_H
4 #define FPGATrackSimGenScanBinning_H
61 #include "GaudiKernel/StatusCode.h"
63 #include <initializer_list>
93 if (
val.size() != 5) {
94 throw std::invalid_argument(
"Not enough parameters in ParSet initialization");
98 operator const std::vector<double>()
const {
return std::vector<double>(this->
begin(),this->
end());}
103 if (
val.size() != 5) {
104 throw std::invalid_argument(
"Not enough parameters in IdxSet initialization");
108 operator const std::vector<unsigned>()
const {
return std::vector<unsigned>(this->
begin(),this->
end());}
118 virtual const std::string &
125 virtual std::vector<unsigned>
scanPars()
const = 0;
171 std::vector<unsigned> retv =
slicePars();
173 retv.insert(retv.end(),
scan.begin(),
scan.end());
220 std::vector<unsigned>
subVec(
const std::vector<unsigned>& elems,
const IdxSet& invec)
const;
223 StatusCode setIdxSubVec(IdxSet &
idx,
const std::vector<unsigned>& subvecelems,
const std::vector<unsigned>& subvecidx)
const;
227 std::vector<ParSet>
makeVariationSet(
const std::vector<unsigned> &scanpars,
const IdxSet &
idx)
const;
232 static constexpr
unsigned NPars = 5;
286 declareInterface<FPGATrackSimGenScanBinningBase>(
this);
292 virtual unsigned rowParIdx()
const override {
return 4;}
294 virtual std::vector<unsigned>
slicePars()
const override {
return std::vector<unsigned>({0,1}); }
295 virtual std::vector<unsigned>
scanPars()
const override {
return std::vector<unsigned>({2,3}); }
362 :
z1(parset[0]),
z2(parset[1]),
phi1(parset[2]),
phi2(parset[3]),
xm(parset[4]) {}
371 std::pair<double, double>
getXY(
double r,
double phi)
const;
375 std::pair<double, double>
getRotationAngles(
const std::pair<double, double>& xy1,
const std::pair<double, double>& xy2)
const;
378 std::pair<double, double>
rotateXY(
const std::pair<double, double>& xy,
const std::pair<double, double>& ang)
const;
383 std::pair<double, double>
xy1p;
384 std::pair<double, double>
xy2p;
434 declareInterface<FPGATrackSimGenScanBinningBase>(
this);
440 return StatusCode::SUCCESS;
443 Gaudi::Property<double>
m_rin{
this,
"rin", {-1.0},
"Radius of inner layer for keylayer definition"};
444 Gaudi::Property<double>
m_rout{
this,
"rout", {-1.0},
"Radius of outer layer for keylayer definition"};
447 virtual unsigned rowParIdx()
const override {
return 4;}
448 virtual std::vector<unsigned>
slicePars()
const override {
return std::vector<unsigned>({0,1}); }
449 virtual std::vector<unsigned>
scanPars()
const override {
return std::vector<unsigned>({2,3}); }
455 return ParSet({keypars.
z1,keypars.
z2,keypars.
phi1,keypars.
phi2,keypars.
xm});
509 declareInterface<FPGATrackSimGenScanBinningBase>(
this);
515 return StatusCode::SUCCESS;
518 Gaudi::Property<double>
m_rin{
this,
"rin", {-1.0},
"Radius of inner layer for keylayer definition"};
519 Gaudi::Property<double>
m_rout{
this,
"rout", {-1.0},
"Radius of outer layer for keylayer definition"};
522 virtual unsigned rowParIdx()
const override {
return 4;}
523 virtual std::vector<unsigned>
slicePars()
const override {
return std::vector<unsigned>({2,3,4}); }
524 virtual std::vector<unsigned>
scanPars()
const override {
return std::vector<unsigned>({0,1}); }
530 return ParSet({keypars.
z1,keypars.
z2,keypars.
phi1,keypars.
phi2,keypars.
xm});
557 auto tmppars = keypars;
558 tmppars.xm = m_parStep[4] / 2.0;
560 return (std::abs(phiShift(
idx, hit)) <
xrange);
567 double lowz_in = binLowEdge(0,
idx[0]);
568 double highz_in = binHighEdge(0,
idx[0]);
569 double lowz_out = binLowEdge(1,
idx[1]);
570 double highz_out = binHighEdge(1,
idx[1]);
574 if (hit->getZ() < lowz_in + (lowz_out-lowz_in) * (hit->getR()-r1)/(r2-r1))
575 return std::pair<unsigned, unsigned>(0, 0);
577 if (hit->getZ() > highz_in + (highz_out-highz_in) * (hit->getR()-r1)/(r2-r1))
578 return std::pair<unsigned, unsigned>(0, 0);
580 return std::pair<unsigned, unsigned>(rowIdx(
idx), rowIdx(
idx) + 1);
589 #endif // FPGATrackSimGenScanBinning_H
void xrange(TH1 *h, bool symmetric)
static double phiFromPars(double r, const FPGATrackSimTrackPars &pars)
std::pair< double, double > xy1p
void setR1(const double r1)
virtual std::vector< unsigned > scanBins() const
virtual std::vector< unsigned > slicePars() const override
std::pair< double, double > rotateXY(const std::pair< double, double > &xy, const std::pair< double, double > &ang) const
double xmForHit(const KeyLyrPars &keypars, const FPGATrackSimHit *hit) const
FPGATrackSimGenScanPhiSlicedKeyLyrBinning(const std::string &algname, const std::string &name, const IInterface *ifc)
Scalar phi() const
phi method
StatusCode setIdxSubVec(IdxSet &idx, const std::vector< unsigned > &subvecelems, const std::vector< unsigned > &subvecidx) const
virtual double phiHistScale() const override
static constexpr double CurvatureConstant
virtual double rowPar([[maybe_unused]] const ParSet &pars, [[maybe_unused]] FPGATrackSimHit const *hit) const
virtual double etaResidual(const ParSet &parset, FPGATrackSimHit const *hit, [[maybe_unused]] bool debug=false) const override
std::pair< double, double > getXY(double r, double phi) const
bool inRange(unsigned par, double val) const
Scalar eta() const
pseudorapidity method
virtual std::pair< unsigned, unsigned > idxsetToRowParBinRange(const IdxSet &idx, [[maybe_unused]] FPGATrackSimHit const *hit) const override
void setR2(const double r2)
virtual double sliceVar(FPGATrackSimHit const *hit) const override
static double ThetaFromEta(double eta)
virtual double sliceVar(FPGATrackSimHit const *hit) const override
Scalar theta() const
theta method
FPGATrackSimGenScanKeyLyrHelper(double r1, double r2)
virtual std::vector< unsigned > sliceAndScanIdx(const IdxSet &idx) const
virtual bool hitInSlice(const IdxSet &idx, FPGATrackSimHit const *hit) const
virtual const ParSet trackParsToParSet(const FPGATrackSimTrackPars &pars) const override
FPGATrackSimTrackPars keyParsToTrackPars(const KeyLyrPars &keypars) const
virtual double etaHistScale() const override
virtual const std::string & parNames(unsigned i) const =0
virtual unsigned rowParIdx() const override
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
const std::vector< std::string > m_parNames
virtual StatusCode initialize() override
virtual double etaResidual(const ParSet &parset, FPGATrackSimHit const *hit, [[maybe_unused]] bool debug=false) const =0
unsigned binIdx(unsigned par, double val) const
virtual StatusCode initialize() override
virtual const std::string & parNames(unsigned i) const override
virtual double phiResidual(const ParSet &parset, FPGATrackSimHit const *hit, [[maybe_unused]] bool debug=false) const override
virtual std::pair< unsigned, unsigned > idxsetToRowParBinRange(const IdxSet &idx, FPGATrackSimHit const *hit) const
Gaudi::Property< double > m_rin
virtual double phiHistScale() const =0
virtual double rowPar(const ParSet &parset, FPGATrackSimHit const *hit) const override
virtual std::vector< unsigned > scanIdx(const IdxSet &idx) const
virtual double phiResidual(const ParSet &parset, FPGATrackSimHit const *hit, [[maybe_unused]] bool debug=false) const override
virtual const ParSet trackParsToParSet(const FPGATrackSimTrackPars &pars) const =0
std::pair< double, double > rotang
virtual double etaResidual(const ParSet &parset, FPGATrackSimHit const *hit, [[maybe_unused]] bool debug=false) const override
FPGATrackSimGenScanStdTrkBinning(const std::string &algname, const std::string &name, const IInterface *ifc)
virtual double phiHistScale() const override
virtual double sliceVar([[maybe_unused]] FPGATrackSimHit const *hit) const
virtual const std::string & parNames(unsigned i) const override
const IdxSet m_invalidBin
KeyLyrPars(const FPGATrackSimGenScanBinningBase::ParSet &parset)
unsigned rowParBinIdx(double val) const
std::vector< unsigned > sliceAndScanPars() const
virtual std::vector< unsigned > scanPars() const override
virtual double etaHistScale() const =0
static constexpr unsigned NPars
virtual std::vector< unsigned > sliceIdx(const IdxSet &idx) const
virtual double sliceVarExpected(const ParSet &pars, FPGATrackSimHit const *hit) const override
virtual std::vector< unsigned > scanPars() const =0
virtual std::vector< unsigned > slicePars() const =0
virtual double etaResidual(const ParSet &parset, FPGATrackSimHit const *hit, [[maybe_unused]] bool debug) const override
virtual double phiResidual(const ParSet &parset, FPGATrackSimHit const *hit, [[maybe_unused]] bool debug=false) const =0
IdxSet(const std::vector< unsigned > &val)
ParSet keyparsToParSet(const FPGATrackSimGenScanKeyLyrHelper::KeyLyrPars &keypars) const
Gaudi::Property< double > m_rout
virtual unsigned rowParIdx() const override
virtual std::vector< unsigned > scanPars() const override
::StatusCode StatusCode
StatusCode definition for legacy code.
FPGATrackSimGenScanKeyLyrHelper m_keylyrtool
virtual double phiResidual(const ParSet &parset, FPGATrackSimHit const *hit, [[maybe_unused]] bool debug) const override
std::pair< double, double > getRotatedHit(const std::pair< double, double > &rotang, const FPGATrackSimHit *hit) const
DeclareInterfaceID(FPGATrackSimGenScanBinningBase, 2, 0)
std::pair< double, double > xy2p
virtual unsigned rowIdx(const IdxSet &idx) const
virtual std::vector< unsigned > sliceAndScanBins() const
Gaudi::Property< double > m_rin
const std::vector< std::string > m_parNames
FPGATrackSimGenScanKeyLyrHelper()
virtual const FPGATrackSimTrackPars parSetToTrackPars(const ParSet &parset) const override
virtual StatusCode initialize() override
std::pair< double, double > getRotationAngles(const std::pair< double, double > &xy1, const std::pair< double, double > &xy2) const
const std::vector< std::string > m_parNames
FPGATrackSimGenScanKeyLyrHelper m_keylyrtool
virtual double etaHistScale() const override
virtual const FPGATrackSimTrackPars parSetToTrackPars(const ParSet &parset) const override
: FPGATrackSim-specific class to represent an hit in the detector.
static double parsToTrkPhi(const FPGATrackSimTrackPars &pars, FPGATrackSimHit const *hit)
rotatedConfig getRotatedConfig(const KeyLyrPars &keypars) const
virtual const ParSet trackParsToParSet(const FPGATrackSimTrackPars &pars) const override
double etaShift(const IdxSet &idx, FPGATrackSimHit const *hit, bool debug=false) const
double xExpected(const KeyLyrPars &keypars, const FPGATrackSimHit *hit) const
virtual unsigned rowBin() const
const IdxSet parsToBin(FPGATrackSimTrackPars &pars) const
virtual bool hitInSlice(const IdxSet &idx, FPGATrackSimHit const *hit) const override
FPGATrackSimGenScanKeyLyrBinning(const std::string &algname, const std::string &name, const IInterface *ifc)
virtual double sliceVarExpected(const ParSet &pars, FPGATrackSimHit const *hit) const override
virtual double phiHistScale() const override
void scan(TDirectory *td=0, int depth=0)
virtual std::vector< unsigned > scanPars() const override
Gaudi::Property< double > m_rout
virtual const FPGATrackSimTrackPars parSetToTrackPars(const ParSet &parset) const =0
double deltaX(const KeyLyrPars &keypars, const FPGATrackSimHit *hit) const
virtual const FPGATrackSimTrackPars parSetToTrackPars(const ParSet &parset) const override
double binLowEdge(unsigned par, unsigned bin) const
double zExpected(const KeyLyrPars &keypars, double r) const
virtual unsigned rowParIdx() const =0
virtual unsigned rowParIdx() const override
virtual double rowPar(const ParSet &pars, FPGATrackSimHit const *hit) const override
virtual double etaHistScale() const override
ParSet(const std::vector< double > &val)
virtual const ParSet trackParsToParSet(const FPGATrackSimTrackPars &pars) const override
double phiShift(const IdxSet &idx, FPGATrackSimHit const *hit, bool debug=false) const
virtual double sliceVarExpected([[maybe_unused]] const ParSet &pars, [[maybe_unused]] FPGATrackSimHit const *hit) const
KeyLyrPars trackParsToKeyPars(const FPGATrackSimTrackPars &pars) const
virtual const std::string & parNames(unsigned i) const override
std::vector< ParSet > makeVariationSet(const std::vector< unsigned > &scanpars, const IdxSet &idx) const
virtual std::vector< unsigned > slicePars() const override
virtual std::vector< unsigned > sliceBins() const
FPGATrackSimGenScanKeyLyrHelper::KeyLyrPars parSetToKeyPars(const ParSet &parset) const
double binCenter(unsigned par, unsigned bin) const
virtual std::vector< unsigned > slicePars() const override
ParSet keyparsToParSet(const FPGATrackSimGenScanKeyLyrHelper::KeyLyrPars &keypars) const
Structs that store the 5 track parameters.
static double EtaFromTheta(double theta)
double binHighEdge(unsigned par, unsigned bin) const
static double zFromPars(double r, const FPGATrackSimTrackPars &pars)
std::vector< unsigned > subVec(const std::vector< unsigned > &elems, const IdxSet &invec) const
FPGATrackSimGenScanKeyLyrHelper::KeyLyrPars parSetToKeyPars(const ParSet &parset) const