CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
AlignPCLThresholdsHG Class Reference

#include <AlignPCLThresholdsHG.h>

Inheritance diagram for AlignPCLThresholdsHG:
AlignPCLThresholds

Public Types

enum  FloatParamIndex {
  FRACTION_CUT_X = 0, FRACTION_CUT_Y = 1, FRACTION_CUT_Z = 2, FRACTION_CUT_TX = 3,
  FRACTION_CUT_TY = 4, FRACTION_CUT_TZ = 5, FSIZE = 6
}
 
enum  IntParamIndex { ISIZE = 0 }
 
typedef std::unordered_map< std::string, std::vector< float > > param_map
 
enum  StringParamIndex { SSIZE = 0 }
 
- Public Types inherited from AlignPCLThresholds
enum  coordType {
  X, Y, Z, theta_X,
  theta_Y, theta_Z, extra_DOF, endOfTypes
}
 
typedef std::map< std::string, AlignPCLThresholdthreshold_map
 

Public Member Functions

 AlignPCLThresholdsHG ()
 
const param_mapgetFloatMap () const
 
const std::vector< float > & getFloatVec (const std::string &AlignableId) const
 
float getFractionCut (const std::string &AlignableId, const coordType &type) const
 
std::array< float, 6 > getFractionCut (const std::string &AlignableId) const
 
const bool hasFloatMap (const std::string &AlignableId) const
 
const int payloadVersion () const
 
void printAll () const
 
void setFloatMap (const param_map &floatMap)
 
void setFractionCut (const std::string &AlignableId, const coordType &type, const float &cut)
 
 ~AlignPCLThresholdsHG () override=default
 
- Public Member Functions inherited from AlignPCLThresholds
 AlignPCLThresholds ()
 
std::vector< std::string > getAlignableList () const
 
AlignPCLThreshold getAlignPCLThreshold (const std::string &AlignableId) const
 
AlignPCLThresholdgetAlignPCLThreshold (const std::string &AlignableId)
 
float getCut (const std::string &AlignableId, const coordType &type) const
 
std::array< float, 6 > getCut (const std::string &AlignableId) const
 
std::array< float, 4 > getExtraDOFCutsForAlignable (const std::string &AlignableId, const unsigned int i) const
 
std::string getExtraDOFLabelForAlignable (const std::string &AlignableId, const unsigned int i) const
 
float getMaxErrorCut (const std::string &AlignableId, const coordType &type) const
 
std::array< float, 6 > getMaxErrorCut (const std::string &AlignableId) const
 
float getMaxMoveCut (const std::string &AlignableId, const coordType &type) const
 
std::array< float, 6 > getMaxMoveCut (const std::string &AlignableId) const
 
const int & getNrecords () const
 
float getSigCut (const std::string &AlignableId, const coordType &type) const
 
std::array< float, 6 > getSigCut (const std::string &AlignableId) const
 
const threshold_mapgetThreshold_Map () const
 
void printAll () const
 
void setAlignPCLThreshold (const std::string &AlignableId, const AlignPCLThreshold &Threshold)
 
void setAlignPCLThresholds (const int &Nrecords, const threshold_map &Thresholds)
 
void setNRecords (const int &Nrecords)
 
double size () const
 
virtual ~AlignPCLThresholds ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Private Attributes

param_map floatMap_
 
std::unordered_map< std::string, std::vector< int > > intMap_
 
std::unordered_map< std::string, std::vector< std::string > > stringMap_
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Additional Inherited Members

- Protected Attributes inherited from AlignPCLThresholds
int m_nrecords
 
threshold_map m_thresholds
 

Detailed Description

Definition at line 11 of file AlignPCLThresholdsHG.h.

Member Typedef Documentation

◆ param_map

typedef std::unordered_map<std::string, std::vector<float> > AlignPCLThresholdsHG::param_map

Definition at line 13 of file AlignPCLThresholdsHG.h.

Member Enumeration Documentation

◆ FloatParamIndex

◆ IntParamIndex

Enumerator
ISIZE 

Definition at line 26 of file AlignPCLThresholdsHG.h.

◆ StringParamIndex

Enumerator
SSIZE 

Definition at line 27 of file AlignPCLThresholdsHG.h.

Constructor & Destructor Documentation

◆ AlignPCLThresholdsHG()

AlignPCLThresholdsHG::AlignPCLThresholdsHG ( )
inline

Definition at line 14 of file AlignPCLThresholdsHG.h.

14 {}

◆ ~AlignPCLThresholdsHG()

AlignPCLThresholdsHG::~AlignPCLThresholdsHG ( )
overridedefault

Member Function Documentation

◆ getFloatMap()

const param_map& AlignPCLThresholdsHG::getFloatMap ( ) const
inline

Definition at line 32 of file AlignPCLThresholdsHG.h.

References floatMap_.

32 { return floatMap_; }

◆ getFloatVec()

const std::vector< float > & AlignPCLThresholdsHG::getFloatVec ( const std::string &  AlignableId) const

Definition at line 32 of file AlignPCLThresholdsHG.cc.

References Exception, floatMap_, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

Referenced by getFractionCut().

32  {
33  const auto &it = floatMap_.find(AlignableId);
34 
35  if (it != floatMap_.end()) {
36  return it->second;
37  } else {
38  throw cms::Exception("AlignPCLThresholdsHG") << "No float vector defined for Alignable id " << AlignableId << "\n";
39  }
40 }

◆ getFractionCut() [1/2]

float AlignPCLThresholdsHG::getFractionCut ( const std::string &  AlignableId,
const coordType type 
) const

Definition at line 80 of file AlignPCLThresholdsHG.cc.

References Exception, FRACTION_CUT_TX, FRACTION_CUT_TY, FRACTION_CUT_TZ, FRACTION_CUT_X, FRACTION_CUT_Y, FRACTION_CUT_Z, getFloatVec(), AlignPCLThresholdsHGImpl::getParam(), AlignPCLThresholds::theta_X, AlignPCLThresholds::theta_Y, AlignPCLThresholds::theta_Z, AlignPCLThresholds::X, AlignPCLThresholds::Y, and AlignPCLThresholds::Z.

Referenced by printAll().

80  {
81  const std::vector<float> vec = getFloatVec(AlignableId);
82  switch (type) {
83  case X:
85  case Y:
87  case Z:
89  case theta_X:
91  case theta_Y:
93  case theta_Z:
95  default:
96  throw cms::Exception("AlignPCLThresholdsHG")
97  << "Requested fraction threshold for undefined coordinate" << type << "\n";
98  }
99 }
const std::vector< float > & getFloatVec(const std::string &AlignableId) const
const T & getParam(const std::vector< T > &params, size_t index)

◆ getFractionCut() [2/2]

std::array< float, 6 > AlignPCLThresholdsHG::getFractionCut ( const std::string &  AlignableId) const

◆ hasFloatMap()

const bool AlignPCLThresholdsHG::hasFloatMap ( const std::string &  AlignableId) const

Definition at line 102 of file AlignPCLThresholdsHG.cc.

References floatMap_, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

102  {
103  const auto &it = floatMap_.find(AlignableId);
104  return (it != floatMap_.end());
105 }

◆ payloadVersion()

const int AlignPCLThresholdsHG::payloadVersion ( ) const

Definition at line 108 of file AlignPCLThresholdsHG.cc.

References Exception, FSIZE, ISIZE, and SSIZE.

108  {
109  switch (static_cast<int>(FSIZE) + static_cast<int>(ISIZE) + static_cast<int>(SSIZE)) {
110  case 6:
111  return 1;
112  default:
113  throw cms::Exception("AlignPCLThresholdsHG")
114  << "Payload version with parameter size equal to "
115  << static_cast<int>(FSIZE) + static_cast<int>(ISIZE) + static_cast<int>(SSIZE) << " is not defined.\n";
116  }
117 }

◆ printAll()

void AlignPCLThresholdsHG::printAll ( ) const

Definition at line 120 of file AlignPCLThresholdsHG.cc.

References floatMap_, AlignPCLThresholds::getExtraDOFCutsForAlignable(), AlignPCLThresholds::getExtraDOFLabelForAlignable(), getFractionCut(), AlignPCLThresholds::getNrecords(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmiolumiharvest::j, AlignPCLThresholds::m_thresholds, MillePedeFileConverter_cfg::out, contentValuesCheck::ss, AlignPCLThresholds::theta_X, AlignPCLThresholds::theta_Y, AlignPCLThresholds::theta_Z, AlignPCLThresholds::X, AlignPCLThresholds::Y, and AlignPCLThresholds::Z.

120  {
121  edm::LogVerbatim out("AlignPCLThresholdsHG");
122 
123  out << "AlignPCLThresholdsHG::printAll()\n";
124  out << "============================================================================================================="
125  "======\n";
126  out << "N records cut: " << this->getNrecords() << "\n";
127  for (auto it = m_thresholds.begin(); it != m_thresholds.end(); ++it) {
128  out << "==========================================================================================================="
129  "========\n";
130 
131  std::stringstream ss;
132 
133  ss << "key : " << it->first << " \n"
134  << "- Xcut : " << std::setw(4) << (it->second).getXcut() << std::setw(5) << " um"
135  << "| sigXcut : " << std::setw(4) << (it->second).getSigXcut() << std::setw(1) << " "
136  << "| maxMoveXcut : " << std::setw(4) << (it->second).getMaxMoveXcut() << std::setw(5) << " um"
137  << "| ErrorXcut : " << std::setw(4) << (it->second).getErrorXcut() << std::setw(5) << " um";
138 
139  if (floatMap_.find(it->first) != floatMap_.end()) {
140  ss << "| X_fractionCut : " << std::setw(4) << getFractionCut(it->first, X) << std::setw(5) << "\n";
141  } else {
142  ss << "\n";
143  }
144 
145  ss << "- thetaXcut : " << std::setw(4) << (it->second).getThetaXcut() << std::setw(5) << " urad"
146  << "| sigThetaXcut : " << std::setw(4) << (it->second).getSigThetaXcut() << std::setw(1) << " "
147  << "| maxMoveThetaXcut : " << std::setw(4) << (it->second).getMaxMoveThetaXcut() << std::setw(5) << " urad"
148  << "| ErrorThetaXcut : " << std::setw(4) << (it->second).getErrorThetaXcut() << std::setw(5) << " urad";
149 
150  if (floatMap_.find(it->first) != floatMap_.end()) {
151  ss << "| thetaX_fractionCut : " << std::setw(4) << getFractionCut(it->first, theta_X) << std::setw(5) << "\n";
152  } else {
153  ss << "\n";
154  }
155 
156  ss << "- Ycut : " << std::setw(4) << (it->second).getYcut() << std::setw(5) << " um"
157  << "| sigYcut : " << std::setw(4) << (it->second).getSigXcut() << std::setw(1) << " "
158  << "| maxMoveYcut : " << std::setw(4) << (it->second).getMaxMoveYcut() << std::setw(5) << " um"
159  << "| ErrorYcut : " << std::setw(4) << (it->second).getErrorYcut() << std::setw(5) << " um";
160 
161  if (floatMap_.find(it->first) != floatMap_.end()) {
162  ss << "| Y_fractionCut : " << std::setw(4) << getFractionCut(it->first, Y) << std::setw(5) << "\n";
163  } else {
164  ss << "\n";
165  }
166 
167  ss << "- thetaYcut : " << std::setw(4) << (it->second).getThetaYcut() << std::setw(5) << " urad"
168  << "| sigThetaYcut : " << std::setw(4) << (it->second).getSigThetaYcut() << std::setw(1) << " "
169  << "| maxMoveThetaYcut : " << std::setw(4) << (it->second).getMaxMoveThetaYcut() << std::setw(5) << " urad"
170  << "| ErrorThetaYcut : " << std::setw(4) << (it->second).getErrorThetaYcut() << std::setw(5) << " urad";
171 
172  if (floatMap_.find(it->first) != floatMap_.end()) {
173  ss << "| thetaY_fractionCut : " << std::setw(4) << getFractionCut(it->first, theta_Y) << std::setw(5) << "\n";
174  } else {
175  ss << "\n";
176  }
177 
178  ss << "- Zcut : " << std::setw(4) << (it->second).getZcut() << std::setw(5) << " um"
179  << "| sigZcut : " << std::setw(4) << (it->second).getSigZcut() << std::setw(1) << " "
180  << "| maxMoveZcut : " << std::setw(4) << (it->second).getMaxMoveZcut() << std::setw(5) << " um"
181  << "| ErrorZcut : " << std::setw(4) << (it->second).getErrorZcut() << std::setw(5) << " um";
182 
183  if (floatMap_.find(it->first) != floatMap_.end()) {
184  ss << "| Z_fractionCut : " << std::setw(4) << getFractionCut(it->first, Z) << std::setw(5) << "\n";
185  } else {
186  ss << "\n";
187  }
188 
189  ss << "- thetaZcut : " << std::setw(4) << (it->second).getThetaZcut() << std::setw(5) << " urad"
190  << "| sigThetaZcut : " << std::setw(4) << (it->second).getSigThetaZcut() << std::setw(1) << " "
191  << "| maxMoveThetaZcut : " << std::setw(4) << (it->second).getMaxMoveThetaZcut() << std::setw(5) << " urad"
192  << "| ErrorThetaZcut : " << std::setw(4) << (it->second).getErrorThetaZcut() << std::setw(5) << " urad";
193 
194  if (floatMap_.find(it->first) != floatMap_.end()) {
195  ss << "| thetaZ_fractionCut : " << std::setw(4) << getFractionCut(it->first, theta_Z) << std::setw(5) << "\n";
196  } else {
197  ss << "\n";
198  }
199 
200  out << ss.str() << std::endl;
201 
202  if ((it->second).hasExtraDOF()) {
203  for (unsigned int j = 0; j < (it->second).extraDOFSize(); j++) {
204  std::array<float, 4> extraDOFCuts = getExtraDOFCutsForAlignable(it->first, j);
205 
206  out << "Extra DOF " << j << " with label: " << getExtraDOFLabelForAlignable(it->first, j);
207  out << "- cut : " << std::setw(4) << extraDOFCuts.at(0) << std::setw(5) << " "
208  << "| sigCut : " << std::setw(4) << extraDOFCuts.at(1) << std::setw(1) << " "
209  << "| maxMoveCut : " << std::setw(4) << extraDOFCuts.at(2) << std::setw(5) << " "
210  << "| maxErrorCut : " << std::setw(4) << extraDOFCuts.at(3) << std::setw(5) << " ";
211  }
212  }
213  }
214 }
std::string getExtraDOFLabelForAlignable(const std::string &AlignableId, const unsigned int i) const
const int & getNrecords() const
std::array< float, 4 > getExtraDOFCutsForAlignable(const std::string &AlignableId, const unsigned int i) const
threshold_map m_thresholds
float getFractionCut(const std::string &AlignableId, const coordType &type) const

◆ serialize()

template<class Archive >
void AlignPCLThresholdsHG::serialize ( Archive &  ar,
const unsigned int  version 
)
private

◆ setFloatMap()

void AlignPCLThresholdsHG::setFloatMap ( const param_map floatMap)

Definition at line 27 of file AlignPCLThresholdsHG.cc.

References floatMap_.

27  {
28  floatMap_ = floatMap;
29 }

◆ setFractionCut()

void AlignPCLThresholdsHG::setFractionCut ( const std::string &  AlignableId,
const coordType type,
const float &  cut 
)

Definition at line 43 of file AlignPCLThresholdsHG.cc.

References TkAlMuonSelectors_cfi::cut, Exception, floatMap_, FRACTION_CUT_TX, FRACTION_CUT_TY, FRACTION_CUT_TZ, FRACTION_CUT_X, FRACTION_CUT_Y, FRACTION_CUT_Z, FSIZE, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, AlignPCLThresholdsHGImpl::setParam(), AlignPCLThresholds::theta_X, AlignPCLThresholds::theta_Y, AlignPCLThresholds::theta_Z, AlignPCLThresholds::X, AlignPCLThresholds::Y, and AlignPCLThresholds::Z.

Referenced by AlignPCLThresholdsWriter< T >::storeHGthresholds().

43  {
44  // Set entry in map if not yet available
45  const auto &it = floatMap_.find(AlignableId);
46  if (it == floatMap_.end())
47  floatMap_[AlignableId] = std::vector<float>(FSIZE, -1.);
48 
49  switch (type) {
50  case X:
52  case Y:
54  case Z:
56  case theta_X:
58  case theta_Y:
60  case theta_Z:
62  default:
63  throw cms::Exception("AlignPCLThresholdsHG")
64  << "Requested setting fraction threshold for undefined coordinate" << type << "\n";
65  }
66 }
void setParam(std::vector< T > &params, size_t index, const T &value)

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 52 of file AlignPCLThresholdsHG.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 52 of file AlignPCLThresholdsHG.h.

Member Data Documentation

◆ floatMap_

param_map AlignPCLThresholdsHG::floatMap_
private

◆ intMap_

std::unordered_map<std::string, std::vector<int> > AlignPCLThresholdsHG::intMap_
private

Definition at line 49 of file AlignPCLThresholdsHG.h.

◆ stringMap_

std::unordered_map<std::string, std::vector<std::string> > AlignPCLThresholdsHG::stringMap_
private

Definition at line 50 of file AlignPCLThresholdsHG.h.