CMS 3D CMS Logo

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

#include <HGCSiliconDetIdToROC.h>

Public Member Functions

int getROCNumber (HGCalTriggerDetId 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 11 of file HGCSiliconDetIdToROC.h.

Constructor & Destructor Documentation

HGCSiliconDetIdToROC::HGCSiliconDetIdToROC ( )

This translated TriggerDetId to ROC and viceversa for HGCSilicon

Definition at line 3 of file HGCSiliconDetIdToROC.cc.

References postprocess-scan-build::cells, triggerIdFromROC_, triggerIdToROC_, and findQualityFiles::v.

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; ++v;
37  }
38  }
39  }
40  triggerIdFromROC_[roc+1] = cells;
41  }
42 
43  // key = trigger cell U,V; value = roc #
44  for (auto const & itr : triggerIdFromROC_) {
45  for (auto cell : itr.second)
46  triggerIdToROC_[cell] = itr.first;
47  }
48 }
type
Definition: HCALResponse.h:21
std::map< int, std::vector< std::pair< int, int > > > triggerIdFromROC_
std::map< std::pair< int, int >, int > triggerIdToROC_

Member Function Documentation

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

Definition at line 18 of file HGCSiliconDetIdToROC.h.

References getTriggerId(), and print().

18  {
19  return getROCNumber(id.triggerCellU(),id.triggerCellV(),id.type());
20  }
type
Definition: HCALResponse.h:21
int getROCNumber(HGCalTriggerDetId const &id) const
int HGCSiliconDetIdToROC::getROCNumber ( int  triggerCellU,
int  triggerCellV,
int  type 
) const

Definition at line 50 of file HGCSiliconDetIdToROC.cc.

References triggerIdToROC_.

51  {
52  auto itr = triggerIdToROC_.find(std::make_pair(triggerCellU,triggerCellV));
53  int roc = ((itr == triggerIdToROC_.end()) ? -1 :
54  ((type == 0) ? itr->second : (1+itr->second)/2));
55  return roc;
56 }
type
Definition: HCALResponse.h:21
std::map< std::pair< int, int >, int > triggerIdToROC_
std::vector< std::pair< int, int > > HGCSiliconDetIdToROC::getTriggerId ( int  roc,
int  type 
) const

Definition at line 58 of file HGCSiliconDetIdToROC.cc.

References gen::k, list(), and triggerIdFromROC_.

Referenced by getROCNumber().

58  {
59 
60  std::vector<std::pair<int,int> > list;
61  if (type == 0) {
62  auto itr = triggerIdFromROC_.find(roc);
63  return ((itr == triggerIdFromROC_.end()) ? list : itr->second);
64  } else {
65  for (int k=0; k<2; ++k) {
66  int rocx = 2*roc + k - 1;
67  auto itr = triggerIdFromROC_.find(rocx);
68  if (itr != triggerIdFromROC_.end()) {
69  for (auto cell : itr->second)
70  list.emplace_back(cell);
71  }
72  }
73  return list;
74  }
75 }
type
Definition: HCALResponse.h:21
std::map< int, std::vector< std::pair< int, int > > > triggerIdFromROC_
int k[5][pyjets_maxn]
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
void HGCSiliconDetIdToROC::print ( void  ) const

Definition at line 77 of file HGCSiliconDetIdToROC.cc.

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

Referenced by getROCNumber().

77  {
78 
79  for (auto const & itr : triggerIdFromROC_) {
80  std::cout << "ROC " << itr.first << " with " << (itr.second).size()
81  << " trigger cells:";
82  for (auto cell : itr.second)
83  std::cout << " (" << cell.first << "," << cell.second << ")";
84  std::cout << std::endl;
85  }
86  for (auto const & itr : triggerIdToROC_)
87  std::cout << "Trigger cell (" << (itr.first).first << ","
88  << (itr.first).second << ") : ROC " << itr.second <<std::endl;
89 }
size
Write out results.
std::map< int, std::vector< std::pair< int, int > > > triggerIdFromROC_
std::map< std::pair< int, int >, int > triggerIdToROC_

Member Data Documentation

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

Definition at line 28 of file HGCSiliconDetIdToROC.h.

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

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

Definition at line 27 of file HGCSiliconDetIdToROC.h.

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