ATLAS Offline Software
Classes | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
FPGATrackSimGenScanBinningBase Class Referenceabstract

#include <FPGATrackSimGenScanBinning.h>

Inheritance diagram for FPGATrackSimGenScanBinningBase:
Collaboration diagram for FPGATrackSimGenScanBinningBase:

Classes

struct  IdxSet
 
struct  ParSet
 

Public Member Functions

 DeclareInterfaceID (FPGATrackSimGenScanBinningBase, 2, 0)
 
virtual const std::string & parNames (unsigned i) const =0
 
virtual std::vector< unsigned > slicePars () const =0
 
virtual std::vector< unsigned > scanPars () const =0
 
virtual unsigned rowParIdx () const =0
 
virtual const ParSet trackParsToParSet (const FPGATrackSimTrackPars &pars) const =0
 
virtual const FPGATrackSimTrackPars parSetToTrackPars (const ParSet &parset) const =0
 
virtual double phiResidual (const ParSet &parset, FPGATrackSimHit const *hit, [[maybe_unused]] bool debug=false) const =0
 
virtual double etaResidual (const ParSet &parset, FPGATrackSimHit const *hit, [[maybe_unused]] bool debug=false) const =0
 
virtual double phiHistScale () const =0
 
virtual double etaHistScale () const =0
 
virtual bool hitInSlice (const IdxSet &idx, FPGATrackSimHit const *hit) const
 
virtual std::pair< unsigned, unsigned > idxsetToRowParBinRange (const IdxSet &idx, FPGATrackSimHit const *hit) const
 
std::vector< unsigned > sliceAndScanPars () const
 
double phiShift (const IdxSet &idx, FPGATrackSimHit const *hit, bool debug=false) const
 
double etaShift (const IdxSet &idx, FPGATrackSimHit const *hit, bool debug=false) const
 
virtual std::vector< unsigned > sliceBins () const
 
virtual std::vector< unsigned > scanBins () const
 
virtual std::vector< unsigned > sliceAndScanBins () const
 
virtual unsigned rowBin () const
 
virtual std::vector< unsigned > sliceIdx (const IdxSet &idx) const
 
virtual std::vector< unsigned > scanIdx (const IdxSet &idx) const
 
virtual std::vector< unsigned > sliceAndScanIdx (const IdxSet &idx) const
 
virtual unsigned rowIdx (const IdxSet &idx) const
 
double binCenter (unsigned par, unsigned bin) const
 
double binLowEdge (unsigned par, unsigned bin) const
 
double binHighEdge (unsigned par, unsigned bin) const
 
ParSet binLowEdge (const IdxSet &idx) const
 
ParSet binCenter (const IdxSet &idx) const
 
ParSet center () const
 
unsigned binIdx (unsigned par, double val) const
 
unsigned rowParBinIdx (double val) const
 
bool inRange (unsigned par, double val) const
 
bool inRange (const ParSet &pars) const
 
IdxSet binIdx (const ParSet &pars) const
 
const IdxSet parsToBin (FPGATrackSimTrackPars &pars) const
 
std::vector< unsigned > subVec (const std::vector< unsigned > &elems, const IdxSet &invec) const
 
StatusCode setIdxSubVec (IdxSet &idx, const std::vector< unsigned > &subvecelems, const std::vector< unsigned > &subvecidx) const
 
std::vector< ParSetmakeVariationSet (const std::vector< unsigned > &scanpars, const IdxSet &idx) const
 

Public Attributes

ParSet m_parMin
 
ParSet m_parMax
 
ParSet m_parStep
 
IdxSet m_parBins
 
const IdxSet m_invalidBin
 

Static Public Attributes

static constexpr unsigned NPars = 5
 

Private Member Functions

virtual double sliceVar ([[maybe_unused]] FPGATrackSimHit const *hit) const
 
virtual double sliceVarExpected ([[maybe_unused]] const ParSet &pars, [[maybe_unused]] FPGATrackSimHit const *hit) const
 
virtual double rowPar ([[maybe_unused]] const ParSet &pars, [[maybe_unused]] FPGATrackSimHit const *hit) const
 

Detailed Description

Definition at line 77 of file FPGATrackSimGenScanBinning.h.

Member Function Documentation

◆ binCenter() [1/2]

FPGATrackSimGenScanBinningBase::ParSet FPGATrackSimGenScanBinningBase::binCenter ( const IdxSet idx) const

Definition at line 67 of file FPGATrackSimGenScanBinning.cxx.

68 {
69  ParSet parset;
70  for (unsigned i = 0; i < NPars; i++)
71  {
72  parset[i] = binCenter(i, idx[i]);
73  }
74  return parset;
75 }

◆ binCenter() [2/2]

double FPGATrackSimGenScanBinningBase::binCenter ( unsigned  par,
unsigned  bin 
) const
inline

Definition at line 194 of file FPGATrackSimGenScanBinning.h.

194 { return m_parMin[par] + m_parStep[par] * (double(bin) + 0.5); }

◆ binHighEdge()

double FPGATrackSimGenScanBinningBase::binHighEdge ( unsigned  par,
unsigned  bin 
) const
inline

Definition at line 196 of file FPGATrackSimGenScanBinning.h.

196 { return m_parMin[par] + m_parStep[par] * (double(bin) + 1.0); }

◆ binIdx() [1/2]

FPGATrackSimGenScanBinningBase::IdxSet FPGATrackSimGenScanBinningBase::binIdx ( const ParSet pars) const

Definition at line 28 of file FPGATrackSimGenScanBinning.cxx.

29 {
30  IdxSet retv;
31  for (unsigned i = 0; i < NPars; i++)
32  {
33  retv[i] = binIdx(i, pars[i]);
34  }
35  return retv;
36 }

◆ binIdx() [2/2]

unsigned FPGATrackSimGenScanBinningBase::binIdx ( unsigned  par,
double  val 
) const
inline

Definition at line 204 of file FPGATrackSimGenScanBinning.h.

204 { return (val > m_parMin[par]) ? unsigned(floor((val - m_parMin[par]) / m_parStep[par])) : 0; }

◆ binLowEdge() [1/2]

FPGATrackSimGenScanBinningBase::ParSet FPGATrackSimGenScanBinningBase::binLowEdge ( const IdxSet idx) const

Definition at line 57 of file FPGATrackSimGenScanBinning.cxx.

58 {
59  ParSet parset;
60  for (unsigned i = 0; i < NPars; i++)
61  {
62  parset[i] = binLowEdge(i, idx[i]);
63  }
64  return parset;
65 }

◆ binLowEdge() [2/2]

double FPGATrackSimGenScanBinningBase::binLowEdge ( unsigned  par,
unsigned  bin 
) const
inline

Definition at line 195 of file FPGATrackSimGenScanBinning.h.

195 { return m_parMin[par] + m_parStep[par] * (double(bin)); }

◆ center()

FPGATrackSimGenScanBinningBase::ParSet FPGATrackSimGenScanBinningBase::center ( ) const

Definition at line 47 of file FPGATrackSimGenScanBinning.cxx.

48 {
49  ParSet parset;
50  for (unsigned i = 0; i < NPars; i++)
51  {
52  parset[i] = (m_parMin[i] + m_parMin[i]) / 2.0;
53  }
54  return parset;
55 }

◆ DeclareInterfaceID()

FPGATrackSimGenScanBinningBase::DeclareInterfaceID ( FPGATrackSimGenScanBinningBase  ,
,
 
)

◆ etaHistScale()

virtual double FPGATrackSimGenScanBinningBase::etaHistScale ( ) const
pure virtual

◆ etaResidual()

virtual double FPGATrackSimGenScanBinningBase::etaResidual ( const ParSet parset,
FPGATrackSimHit const hit,
[[maybe_unused] ] bool  debug = false 
) const
pure virtual

◆ etaShift()

double FPGATrackSimGenScanBinningBase::etaShift ( const IdxSet idx,
FPGATrackSimHit const hit,
bool  debug = false 
) const
inline

Definition at line 179 of file FPGATrackSimGenScanBinning.h.

179 { return etaResidual(binCenter(idx),hit,debug);}

◆ hitInSlice()

bool FPGATrackSimGenScanBinningBase::hitInSlice ( const IdxSet idx,
FPGATrackSimHit const hit 
) const
virtual

Definition at line 122 of file FPGATrackSimGenScanBinning.cxx.

123 {
124  // Get float values
125  double slicevarmin = std::numeric_limits<double>::max();
126  double slicevarmax = std::numeric_limits<double>::min();
127 
129 
130  for (auto &pars : variations)
131  {
132  double slicevarhit = sliceVarExpected(pars, hit);
133  slicevarmin = std::min(slicevarmin, slicevarhit);
134  slicevarmax = std::max(slicevarmax, slicevarhit);
135  }
136  double slicevar = sliceVar(hit);
137  return ( slicevar > slicevarmin) && (slicevar < slicevarmax);
138 }

◆ idxsetToRowParBinRange()

std::pair< unsigned, unsigned > FPGATrackSimGenScanBinningBase::idxsetToRowParBinRange ( const IdxSet idx,
FPGATrackSimHit const hit 
) const
virtual

Definition at line 142 of file FPGATrackSimGenScanBinning.cxx.

143 {
144  // Get float values
145  double rowparmin = std::numeric_limits<double>::max();
146  double rowparmax = std::numeric_limits<double>::min();
147 
149 
150  for (auto &pars : variations)
151  {
152  double rowparhit = rowPar(pars, hit);
153  rowparmin = std::min(rowparmin, rowparhit);
154  rowparmax = std::max(rowparmax, rowparhit);
155  }
156 
157  // only consider parameter bins in range
158  unsigned lowbin = std::max(rowParBinIdx(rowparmin), unsigned(0));
159  unsigned highbin = std::min(rowParBinIdx(rowparmax) + 1, m_parBins[rowParIdx()] );
160 
161  return {lowbin, highbin};
162 }

◆ inRange() [1/2]

bool FPGATrackSimGenScanBinningBase::inRange ( const ParSet pars) const

Definition at line 18 of file FPGATrackSimGenScanBinning.cxx.

19 {
20  for (unsigned i = 0; i < NPars; i++)
21  {
22  if (!inRange(i, pars[i]))
23  return false;
24  }
25  return true;
26 }

◆ inRange() [2/2]

bool FPGATrackSimGenScanBinningBase::inRange ( unsigned  par,
double  val 
) const
inline

Definition at line 208 of file FPGATrackSimGenScanBinning.h.

208 { return ((val < m_parMax[par]) && (val > m_parMin[par])); }

◆ makeVariationSet()

std::vector< FPGATrackSimGenScanBinningBase::ParSet > FPGATrackSimGenScanBinningBase::makeVariationSet ( const std::vector< unsigned > &  scanpars,
const IdxSet idx 
) const

Definition at line 104 of file FPGATrackSimGenScanBinning.cxx.

105 {
106  std::vector<ParSet> retv;
107  for (unsigned corners = 0; corners < unsigned((1 << scanpars.size())); corners++)
108  {
109  IdxSet newidx = idx;
110  int scanDimCnt = 0;
111  for (auto &par : scanpars)
112  {
113  newidx[par] = idx[par] + ((corners >> scanDimCnt) & 1);
114  scanDimCnt++;
115  }
116  retv.push_back(binLowEdge(newidx));
117  }
118  return retv;
119 }

◆ parNames()

virtual const std::string& FPGATrackSimGenScanBinningBase::parNames ( unsigned  i) const
pure virtual

◆ parSetToTrackPars()

virtual const FPGATrackSimTrackPars FPGATrackSimGenScanBinningBase::parSetToTrackPars ( const ParSet parset) const
pure virtual

◆ parsToBin()

const FPGATrackSimGenScanBinningBase::IdxSet FPGATrackSimGenScanBinningBase::parsToBin ( FPGATrackSimTrackPars pars) const

Definition at line 37 of file FPGATrackSimGenScanBinning.cxx.

38 {
39  ParSet parset = trackParsToParSet(pars);
40  if (inRange(parset))
41  {
42  return binIdx(parset);
43  }
44  return m_invalidBin;
45 }

◆ phiHistScale()

virtual double FPGATrackSimGenScanBinningBase::phiHistScale ( ) const
pure virtual

◆ phiResidual()

virtual double FPGATrackSimGenScanBinningBase::phiResidual ( const ParSet parset,
FPGATrackSimHit const hit,
[[maybe_unused] ] bool  debug = false 
) const
pure virtual

◆ phiShift()

double FPGATrackSimGenScanBinningBase::phiShift ( const IdxSet idx,
FPGATrackSimHit const hit,
bool  debug = false 
) const
inline

Definition at line 178 of file FPGATrackSimGenScanBinning.h.

178 { return phiResidual(binCenter(idx),hit,debug);}

◆ rowBin()

virtual unsigned FPGATrackSimGenScanBinningBase::rowBin ( ) const
inlinevirtual

Definition at line 185 of file FPGATrackSimGenScanBinning.h.

185 { return m_parBins[rowParIdx()]; }

◆ rowIdx()

virtual unsigned FPGATrackSimGenScanBinningBase::rowIdx ( const IdxSet idx) const
inlinevirtual

Definition at line 191 of file FPGATrackSimGenScanBinning.h.

191 { return idx[rowParIdx()]; }

◆ rowPar()

double FPGATrackSimGenScanBinningBase::rowPar ( [[maybe_unused] ] const ParSet pars,
[[maybe_unused] ] FPGATrackSimHit const hit 
) const
privatevirtual

Definition at line 167 of file FPGATrackSimGenScanBinning.cxx.

167 {return 0.0; };

◆ rowParBinIdx()

unsigned FPGATrackSimGenScanBinningBase::rowParBinIdx ( double  val) const
inline

Definition at line 205 of file FPGATrackSimGenScanBinning.h.

205 { return binIdx(rowParIdx(), val); }

◆ rowParIdx()

virtual unsigned FPGATrackSimGenScanBinningBase::rowParIdx ( ) const
pure virtual

◆ scanBins()

virtual std::vector<unsigned> FPGATrackSimGenScanBinningBase::scanBins ( ) const
inlinevirtual

Definition at line 183 of file FPGATrackSimGenScanBinning.h.

183 { return subVec(scanPars(), m_parBins); }

◆ scanIdx()

virtual std::vector<unsigned> FPGATrackSimGenScanBinningBase::scanIdx ( const IdxSet idx) const
inlinevirtual

Definition at line 189 of file FPGATrackSimGenScanBinning.h.

189 { return subVec(scanPars(), idx); }

◆ scanPars()

virtual std::vector<unsigned> FPGATrackSimGenScanBinningBase::scanPars ( ) const
pure virtual

◆ setIdxSubVec()

StatusCode FPGATrackSimGenScanBinningBase::setIdxSubVec ( IdxSet idx,
const std::vector< unsigned > &  subvecelems,
const std::vector< unsigned > &  subvecidx 
) const

Definition at line 87 of file FPGATrackSimGenScanBinning.cxx.

88 {
89  if (subvecelems.size()!=subvecidx.size()) {
90  return StatusCode::FAILURE;
91  }
92  for (unsigned i = 0; i < subvecelems.size(); i++)
93  {
94  if (subvecelems[i] >= idx.size()) {
95  return StatusCode::FAILURE;
96  }
97  idx[subvecelems[i]] = subvecidx[i];
98  }
99  return StatusCode::SUCCESS;
100 }

◆ sliceAndScanBins()

virtual std::vector<unsigned> FPGATrackSimGenScanBinningBase::sliceAndScanBins ( ) const
inlinevirtual

Definition at line 184 of file FPGATrackSimGenScanBinning.h.

184 { return subVec(sliceAndScanPars(), m_parBins); }

◆ sliceAndScanIdx()

virtual std::vector<unsigned> FPGATrackSimGenScanBinningBase::sliceAndScanIdx ( const IdxSet idx) const
inlinevirtual

Definition at line 190 of file FPGATrackSimGenScanBinning.h.

190 { return subVec(sliceAndScanPars(), idx); }

◆ sliceAndScanPars()

std::vector<unsigned> FPGATrackSimGenScanBinningBase::sliceAndScanPars ( ) const
inline

Definition at line 170 of file FPGATrackSimGenScanBinning.h.

170  {
171  std::vector<unsigned> retv = slicePars();
172  std::vector<unsigned> scan = scanPars();
173  retv.insert(retv.end(), scan.begin(), scan.end());
174  return retv;
175  };

◆ sliceBins()

virtual std::vector<unsigned> FPGATrackSimGenScanBinningBase::sliceBins ( ) const
inlinevirtual

Definition at line 182 of file FPGATrackSimGenScanBinning.h.

182 { return subVec(slicePars(), m_parBins); }

◆ sliceIdx()

virtual std::vector<unsigned> FPGATrackSimGenScanBinningBase::sliceIdx ( const IdxSet idx) const
inlinevirtual

Definition at line 188 of file FPGATrackSimGenScanBinning.h.

188 { return subVec(slicePars(), idx); }

◆ slicePars()

virtual std::vector<unsigned> FPGATrackSimGenScanBinningBase::slicePars ( ) const
pure virtual

◆ sliceVar()

double FPGATrackSimGenScanBinningBase::sliceVar ( [[maybe_unused] ] FPGATrackSimHit const hit) const
privatevirtual

Definition at line 165 of file FPGATrackSimGenScanBinning.cxx.

165 { return 0.0; };

◆ sliceVarExpected()

double FPGATrackSimGenScanBinningBase::sliceVarExpected ( [[maybe_unused] ] const ParSet pars,
[[maybe_unused] ] FPGATrackSimHit const hit 
) const
privatevirtual

Definition at line 166 of file FPGATrackSimGenScanBinning.cxx.

166 {return 0.0; };

◆ subVec()

std::vector< unsigned > FPGATrackSimGenScanBinningBase::subVec ( const std::vector< unsigned > &  elems,
const IdxSet invec 
) const

Definition at line 77 of file FPGATrackSimGenScanBinning.cxx.

78 {
79  std::vector<unsigned> retv;
80  for (auto elem : elems)
81  {
82  retv.push_back(invec[elem]);
83  }
84  return retv;
85 }

◆ trackParsToParSet()

virtual const ParSet FPGATrackSimGenScanBinningBase::trackParsToParSet ( const FPGATrackSimTrackPars pars) const
pure virtual

Member Data Documentation

◆ m_invalidBin

const IdxSet FPGATrackSimGenScanBinningBase::m_invalidBin

◆ m_parBins

IdxSet FPGATrackSimGenScanBinningBase::m_parBins

Definition at line 236 of file FPGATrackSimGenScanBinning.h.

◆ m_parMax

ParSet FPGATrackSimGenScanBinningBase::m_parMax

Definition at line 234 of file FPGATrackSimGenScanBinning.h.

◆ m_parMin

ParSet FPGATrackSimGenScanBinningBase::m_parMin

Definition at line 233 of file FPGATrackSimGenScanBinning.h.

◆ m_parStep

ParSet FPGATrackSimGenScanBinningBase::m_parStep

Definition at line 235 of file FPGATrackSimGenScanBinning.h.

◆ NPars

constexpr unsigned FPGATrackSimGenScanBinningBase::NPars = 5
staticconstexpr

Definition at line 232 of file FPGATrackSimGenScanBinning.h.


The documentation for this class was generated from the following files:
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
FPGATrackSimGenScanBinningBase::rowPar
virtual double rowPar([[maybe_unused]] const ParSet &pars, [[maybe_unused]] FPGATrackSimHit const *hit) const
Definition: FPGATrackSimGenScanBinning.cxx:167
yodamerge_tmp.variations
variations
Definition: yodamerge_tmp.py:257
FPGATrackSimGenScanBinningBase::inRange
bool inRange(unsigned par, double val) const
Definition: FPGATrackSimGenScanBinning.h:208
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
FPGATrackSimGenScanBinningBase::m_parBins
IdxSet m_parBins
Definition: FPGATrackSimGenScanBinning.h:236
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
bin
Definition: BinsDiffFromStripMedian.h:43
FPGATrackSimGenScanBinningBase::etaResidual
virtual double etaResidual(const ParSet &parset, FPGATrackSimHit const *hit, [[maybe_unused]] bool debug=false) const =0
FPGATrackSimGenScanBinningBase::binIdx
unsigned binIdx(unsigned par, double val) const
Definition: FPGATrackSimGenScanBinning.h:204
FPGATrackSimGenScanBinningBase::m_parMax
ParSet m_parMax
Definition: FPGATrackSimGenScanBinning.h:234
xAOD::unsigned
unsigned
Definition: RingSetConf_v1.cxx:662
FPGATrackSimGenScanBinningBase::trackParsToParSet
virtual const ParSet trackParsToParSet(const FPGATrackSimTrackPars &pars) const =0
FPGATrackSimGenScanBinningBase::sliceVar
virtual double sliceVar([[maybe_unused]] FPGATrackSimHit const *hit) const
Definition: FPGATrackSimGenScanBinning.cxx:165
FPGATrackSimGenScanBinningBase::m_invalidBin
const IdxSet m_invalidBin
Definition: FPGATrackSimGenScanBinning.h:239
FPGATrackSimGenScanBinningBase::rowParBinIdx
unsigned rowParBinIdx(double val) const
Definition: FPGATrackSimGenScanBinning.h:205
FPGATrackSimGenScanBinningBase::sliceAndScanPars
std::vector< unsigned > sliceAndScanPars() const
Definition: FPGATrackSimGenScanBinning.h:170
FPGATrackSimGenScanBinningBase::NPars
static constexpr unsigned NPars
Definition: FPGATrackSimGenScanBinning.h:232
FPGATrackSimGenScanBinningBase::scanPars
virtual std::vector< unsigned > scanPars() const =0
FPGATrackSimGenScanBinningBase::slicePars
virtual std::vector< unsigned > slicePars() const =0
FPGATrackSimGenScanBinningBase::phiResidual
virtual double phiResidual(const ParSet &parset, FPGATrackSimHit const *hit, [[maybe_unused]] bool debug=false) const =0
lumiFormat.i
int i
Definition: lumiFormat.py:85
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
FPGATrackSimGenScanBinningBase::m_parMin
ParSet m_parMin
Definition: FPGATrackSimGenScanBinning.h:233
scan
void scan(TDirectory *td=0, int depth=0)
Definition: listroot.cxx:440
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
FPGATrackSimGenScanBinningBase::binLowEdge
double binLowEdge(unsigned par, unsigned bin) const
Definition: FPGATrackSimGenScanBinning.h:195
FPGATrackSimGenScanBinningBase::rowParIdx
virtual unsigned rowParIdx() const =0
FPGATrackSimGenScanBinningBase::sliceVarExpected
virtual double sliceVarExpected([[maybe_unused]] const ParSet &pars, [[maybe_unused]] FPGATrackSimHit const *hit) const
Definition: FPGATrackSimGenScanBinning.cxx:166
FPGATrackSimGenScanBinningBase::makeVariationSet
std::vector< ParSet > makeVariationSet(const std::vector< unsigned > &scanpars, const IdxSet &idx) const
Definition: FPGATrackSimGenScanBinning.cxx:104
FPGATrackSimGenScanBinningBase::binCenter
double binCenter(unsigned par, unsigned bin) const
Definition: FPGATrackSimGenScanBinning.h:194
FPGATrackSimGenScanBinningBase::m_parStep
ParSet m_parStep
Definition: FPGATrackSimGenScanBinning.h:235
FPGATrackSimGenScanBinningBase::subVec
std::vector< unsigned > subVec(const std::vector< unsigned > &elems, const IdxSet &invec) const
Definition: FPGATrackSimGenScanBinning.cxx:77