CMS 3D CMS Logo

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

#include <HGCSiliconDetIdToROC.h>

Public Member Functions

int getROCNumber (HFNoseDetId const &id) const
 
int getROCNumber (HFNoseTriggerDetId const &id) const
 
int getROCNumber (HGCalTriggerDetId const &id) const
 
int getROCNumber (HGCSiliconDetId const &id) const
 
int getROCNumber (int triggerCellU, int triggerCellV, int type) const
 
std::vector< std::pair< int, int > > getTriggerId (int roc, int type) const
 
 HGCSiliconDetIdToROC ()
 
void print () const
 

Private Attributes

std::map< int, std::vector< std::pair< int, int > > > triggerIdFromROC_
 
std::map< std::pair< int, int >, int > triggerIdToROC_
 

Detailed Description

Definition at line 14 of file HGCSiliconDetIdToROC.h.

Constructor & Destructor Documentation

◆ HGCSiliconDetIdToROC()

HGCSiliconDetIdToROC::HGCSiliconDetIdToROC ( )

This translated TriggerDetId to ROC and viceversa for HGCSilicon

Definition at line 3 of file HGCSiliconDetIdToROC.cc.

3  {
4  const int rocMax(6), cellRows(4), cellColumn(2);
5  const int type[rocMax] = {0, 0, 1, 1, 2, 2};
6  const int start1[rocMax][cellColumn] = {{3, 2}, {1, 0}, {1, 2}, {3, 4}, {7, 6}, {5, 4}};
7  const int start2[rocMax] = {0, 0, 0, 1, 4, 4};
8 
9  // key = ROC #; value = vector of trigger cell U.V
10  for (int roc = 0; roc < rocMax; ++roc) {
11  std::vector<std::pair<int, int> > cells;
12  if (type[roc] == 1) {
13  for (int i1 = 0; i1 < cellColumn; ++i1) {
14  int u = start1[roc][i1];
15  int v = start2[roc] + u / 2;
16  for (int i2 = 0; i2 < cellRows; ++i2) {
17  cells.emplace_back(u, v);
18  ++u;
19  }
20  }
21  } else if (type[roc] == 2) {
22  for (int i1 = 0; i1 < cellColumn; ++i1) {
23  int v = start2[roc];
24  int u = start1[roc][i1];
25  for (int i2 = 0; i2 < cellRows; ++i2) {
26  cells.emplace_back(u, v);
27  ++v;
28  }
29  }
30  } else {
31  for (int i1 = 0; i1 < cellColumn; ++i1) {
32  int u = start2[roc];
33  int v = start1[roc][i1];
34  for (int i2 = 0; i2 < cellRows; ++i2) {
35  cells.emplace_back(u, v);
36  ++u;
37  ++v;
38  }
39  }
40  }
42  }
43 
44  // key = trigger cell U,V; value = roc #
45  for (auto const& itr : triggerIdFromROC_) {
46  for (auto cell : itr.second)
47  triggerIdToROC_[cell] = itr.first;
48  }
49 }

References postprocess-scan-build::cells, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, PixelMapPlotter::roc, triggerIdFromROC_, triggerIdToROC_, and findQualityFiles::v.

Member Function Documentation

◆ getROCNumber() [1/5]

int HGCSiliconDetIdToROC::getROCNumber ( HFNoseDetId const &  id) const
inline

Definition at line 25 of file HGCSiliconDetIdToROC.h.

25  {
26  return getROCNumber(id.triggerCellU(), id.triggerCellV(), id.type());
27  }

References getROCNumber().

◆ getROCNumber() [2/5]

int HGCSiliconDetIdToROC::getROCNumber ( HFNoseTriggerDetId const &  id) const
inline

Definition at line 28 of file HGCSiliconDetIdToROC.h.

28  {
29  return getROCNumber(id.triggerCellU(), id.triggerCellV(), id.type());
30  }

References getROCNumber().

◆ getROCNumber() [3/5]

int HGCSiliconDetIdToROC::getROCNumber ( HGCalTriggerDetId const &  id) const
inline

Definition at line 19 of file HGCSiliconDetIdToROC.h.

19  {
20  return getROCNumber(id.triggerCellU(), id.triggerCellV(), id.type());
21  }

Referenced by HGCalCoarseTriggerCellMapping::getCoarseTriggerCellId(), and getROCNumber().

◆ getROCNumber() [4/5]

int HGCSiliconDetIdToROC::getROCNumber ( HGCSiliconDetId const &  id) const
inline

Definition at line 22 of file HGCSiliconDetIdToROC.h.

22  {
23  return getROCNumber(id.triggerCellU(), id.triggerCellV(), id.type());
24  }

References getROCNumber().

◆ getROCNumber() [5/5]

int HGCSiliconDetIdToROC::getROCNumber ( int  triggerCellU,
int  triggerCellV,
int  type 
) const

Definition at line 51 of file HGCSiliconDetIdToROC.cc.

51  {
52  auto itr = triggerIdToROC_.find(std::make_pair(triggerCellU, triggerCellV));
53  int roc = ((itr == triggerIdToROC_.end()) ? -1 : ((type == 0) ? itr->second : (1 + itr->second) / 2));
54  return roc;
55 }

References PixelMapPlotter::roc, and triggerIdToROC_.

◆ getTriggerId()

std::vector< std::pair< int, int > > HGCSiliconDetIdToROC::getTriggerId ( int  roc,
int  type 
) const

Definition at line 57 of file HGCSiliconDetIdToROC.cc.

57  {
58  std::vector<std::pair<int, int> > list;
59  if (type == 0) {
60  auto itr = triggerIdFromROC_.find(roc);
61  return ((itr == triggerIdFromROC_.end()) ? list : itr->second);
62  } else {
63  for (int k = 0; k < 2; ++k) {
64  int rocx = 2 * roc + k - 1;
65  auto itr = triggerIdFromROC_.find(rocx);
66  if (itr != triggerIdFromROC_.end()) {
67  for (auto cell : itr->second)
68  list.emplace_back(cell);
69  }
70  }
71  return list;
72  }
73 }

References dqmdumpme::k, PixelMapPlotter::roc, and triggerIdFromROC_.

Referenced by HGCalTriggerGeometryV9Imp2::getOrderedTriggerCellsFromModule(), and HGCalTriggerGeometryV9Imp2::getTriggerCellsFromModule().

◆ print()

void HGCSiliconDetIdToROC::print ( void  ) const

Definition at line 75 of file HGCSiliconDetIdToROC.cc.

75  {
76  for (auto const& itr : triggerIdFromROC_) {
77  std::cout << "ROC " << itr.first << " with " << (itr.second).size() << " trigger cells:";
78  for (auto cell : itr.second)
79  std::cout << " (" << cell.first << "," << cell.second << ")";
80  std::cout << std::endl;
81  }
82  for (auto const& itr : triggerIdToROC_)
83  std::cout << "Trigger cell (" << (itr.first).first << "," << (itr.first).second << ") : ROC " << itr.second
84  << std::endl;
85 }

References gather_cfg::cout, dqmdumpme::first, findQualityFiles::size, triggerIdFromROC_, and triggerIdToROC_.

Member Data Documentation

◆ triggerIdFromROC_

std::map<int, std::vector<std::pair<int, int> > > HGCSiliconDetIdToROC::triggerIdFromROC_
private

Definition at line 37 of file HGCSiliconDetIdToROC.h.

Referenced by getTriggerId(), HGCSiliconDetIdToROC(), and print().

◆ triggerIdToROC_

std::map<std::pair<int, int>, int> HGCSiliconDetIdToROC::triggerIdToROC_
private

Definition at line 36 of file HGCSiliconDetIdToROC.h.

Referenced by getROCNumber(), HGCSiliconDetIdToROC(), and print().

HGCSiliconDetIdToROC::getROCNumber
int getROCNumber(HGCalTriggerDetId const &id) const
Definition: HGCSiliconDetIdToROC.h:19
testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
gather_cfg.cout
cout
Definition: gather_cfg.py:144
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
findQualityFiles.v
v
Definition: findQualityFiles.py:179
dqmdumpme.first
first
Definition: dqmdumpme.py:55
HGCSiliconDetIdToROC::triggerIdToROC_
std::map< std::pair< int, int >, int > triggerIdToROC_
Definition: HGCSiliconDetIdToROC.h:36
dqmdumpme.k
k
Definition: dqmdumpme.py:60
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:39
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:29
postprocess-scan-build.cells
cells
Definition: postprocess-scan-build.py:13
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
HGCSiliconDetIdToROC::triggerIdFromROC_
std::map< int, std::vector< std::pair< int, int > > > triggerIdFromROC_
Definition: HGCSiliconDetIdToROC.h:37
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443