CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HGCalCalibrationCell Class Reference

#include <HGCalCalibrationCell.h>

Public Member Functions

int findCell (int zside, int layer, int waferU, int waferV, int cellUV, const std::pair< double, double > &xy) const
 
 HGCalCalibrationCell (const HGCalDDDConstants *cons)
 
 HGCalCalibrationCell ()
 

Private Attributes

std::vector< int > cells_ [4]
 
const HGCalDDDConstantscons_
 
double radius_ [2]
 
std::unique_ptr< HGCalCellwafer_
 

Detailed Description

Definition at line 10 of file HGCalCalibrationCell.h.

Constructor & Destructor Documentation

◆ HGCalCalibrationCell() [1/2]

HGCalCalibrationCell::HGCalCalibrationCell ( const HGCalDDDConstants cons)

Definition at line 10 of file HGCalCalibrationCell.cc.

References HGCalParameters::calibCellFullHD_, HGCalParameters::calibCellFullLD_, HGCalParameters::calibCellPartHD_, HGCalParameters::calibCellPartLD_, HGCalParameters::calibCellRHD_, HGCalParameters::calibCellRLD_, cells_, cons_, mps_fire::end, HGCalDDDConstants::getParameter(), dqmdumpme::k, HGCalParameters::nCellsCoarse_, HGCalParameters::nCellsFine_, radius_, mathSSE::sqrt(), wafer_, and HGCalParameters::waferSize_.

10  : cons_(cons) {
11  wafer_ = std::make_unique<HGCalCell>(
13 
15  cells_[0].insert(
17  cells_[1].insert(
20  cells_[2].insert(
22  cells_[3].insert(
24  for (int k = 0; k < 2; ++k)
25  radius_[k] *= radius_[k];
26 
27 #ifdef EDM_ML_DEBUG
28  edm::LogVerbatim("HGCalGeom") << "HGCalCalibrationCell: " << cells_[0].size() << " HD calibration cells of radius "
29  << std::sqrt(radius_[0]);
30  for (unsigned int k = 0; k < cells_[0].size(); ++k)
31  edm::LogVerbatim("HGCalGeom") << " [" << k << "] " << cells_[0][k] << ":" << cells_[1][k];
32  edm::LogVerbatim("HGCalGeom") << "HGCalCalibrationCell: " << cells_[2].size() << " LD calibration cells of radius "
33  << std::sqrt(radius_[1]);
34  for (unsigned int k = 0; k < cells_[2].size(); ++k)
35  edm::LogVerbatim("HGCalGeom") << " [" << k << "] " << cells_[2][k] << ":" << cells_[3][k];
36 #endif
37 }
Log< level::Info, true > LogVerbatim
const HGCalParameters * getParameter() const
std::unique_ptr< HGCalCell > wafer_
T sqrt(T t)
Definition: SSEVec.h:19
std::vector< int > calibCellPartHD_
std::vector< int > calibCellFullHD_
const HGCalDDDConstants * cons_
std::vector< int > cells_[4]
std::vector< int > calibCellPartLD_
std::vector< int > calibCellFullLD_

◆ HGCalCalibrationCell() [2/2]

HGCalCalibrationCell::HGCalCalibrationCell ( )
inline

Definition at line 13 of file HGCalCalibrationCell.h.

13 {}

Member Function Documentation

◆ findCell()

int HGCalCalibrationCell::findCell ( int  zside,
int  layer,
int  waferU,
int  waferV,
int  cellUV,
const std::pair< double, double > &  xy 
) const

Definition at line 39 of file HGCalCalibrationCell.cc.

References HGCalCell::cellPlacementIndex(), cells_, cons_, mps_fire::end, spr::find(), info(), nano_mu_digi_cff::layer, HGCalDDDConstants::layerType(), convertSQLiteXML::ok, diffTwoXMLs::r2, radius_, wafer_, HGCalTypes::WaferCenterB, HGCalTypes::WaferFineThin, HGCalTypes::WaferFull, HGCalDDDConstants::waferInfo(), HGCalWaferIndex::waferU(), HGCalWaferIndex::waferV(), geometryCSVtoXML::xx, geometryCSVtoXML::xy, geometryCSVtoXML::yy, and ecaldqm::zside().

40  {
41  const auto& info = cons_->waferInfo(layer, waferU, waferV);
42  int ld = (info.type == HGCalTypes::WaferFineThin) ? 1 : 0;
43  int part = (info.part == HGCalTypes::WaferFull) ? 1 : 0;
44  int indx = 2 * ld + part;
45 #ifdef EDM_ML_DEBUG
46  std::ostringstream st1;
47  st1 << "HGCalCalibrationCell::findCell::input " << layer << ":" << waferU << ":" << waferV << ":" << cellUV << ":"
48  << xy.first << ":" << xy.second << " Type:Part " << info.type << ":" << info.part << ":" << ld << ":" << part
49  << ":" << indx;
50 #endif
51  bool ok = (std::find(cells_[indx].begin(), cells_[indx].end(), cellUV) != cells_[indx].end());
52  int retval(-1);
53  if (ok) {
54  int layertype = (cons_->layerType(layer) == HGCalTypes::WaferCenterB) ? 1 : 0;
55  int place = HGCalCell::cellPlacementIndex(zside, layertype, info.orient);
56  int cellU = (cellUV / 100) % 100;
57  int cellV = cellUV % 100;
58  auto xyc = wafer_->cellUV2XY1(cellU, cellV, place, (1 - ld));
59  double xx = xy.first - xyc.first;
60  double yy = xy.second - xyc.second;
61  double r2 = (xx * xx + yy * yy);
62  retval = (r2 > radius_[ld]) ? 0 : 1;
63 #ifdef EDM_ML_DEBUG
64  st1 << " layertype:place:cellU:cellV " << layertype << ":" << place << ":" << cellU << ":" << cellV << " xx "
65  << xy.first << ":" << xyc.first << ":" << xx << " yy " << xy.second << ":" << xyc.second << ":" << yy << " R2 "
66  << r2 << ":" << radius_[ld];
67 #endif
68  }
69 #ifdef EDM_ML_DEBUG
70  st1 << " Return Value " << ok << ":" << retval;
71  edm::LogVerbatim("HGCalGeom") << st1.str();
72 #endif
73  return retval;
74 }
Log< level::Info, true > LogVerbatim
static int32_t cellPlacementIndex(int32_t iz, int32_t frontBack, int32_t orient)
Definition: HGCalCell.cc:237
static const TGPicture * info(bool iBackgroundIsBlack)
int32_t waferU(const int32_t index)
HGCalParameters::waferInfo waferInfo(int lay, int waferU, int waferV) const
std::unique_ptr< HGCalCell > wafer_
int zside(DetId const &)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
static constexpr int32_t WaferFull
Definition: HGCalTypes.h:35
const HGCalDDDConstants * cons_
part
Definition: HCALResponse.h:20
int32_t waferV(const int32_t index)
std::vector< int > cells_[4]
static constexpr int32_t WaferFineThin
Definition: HGCalTypes.h:30
static constexpr int32_t WaferCenterB
Definition: HGCalTypes.h:26
int layerType(int lay) const

Member Data Documentation

◆ cells_

std::vector<int> HGCalCalibrationCell::cells_[4]
private

Definition at line 21 of file HGCalCalibrationCell.h.

Referenced by findCell(), and HGCalCalibrationCell().

◆ cons_

const HGCalDDDConstants* HGCalCalibrationCell::cons_
private

Definition at line 18 of file HGCalCalibrationCell.h.

Referenced by findCell(), and HGCalCalibrationCell().

◆ radius_

double HGCalCalibrationCell::radius_[2]
private

Definition at line 20 of file HGCalCalibrationCell.h.

Referenced by findCell(), and HGCalCalibrationCell().

◆ wafer_

std::unique_ptr<HGCalCell> HGCalCalibrationCell::wafer_
private

Definition at line 19 of file HGCalCalibrationCell.h.

Referenced by findCell(), and HGCalCalibrationCell().