CMS 3D CMS Logo

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

#include <interface/TTUWedgeORLogic.h>

Inheritance diagram for TTUWedgeORLogic:
TTULogic

Public Member Functions

bool process (const TTUInput &) override
 
void setBoardSpecs (const TTUBoardSpecs::TTUBoardConfig &) override
 
 TTUWedgeORLogic ()
 Standard constructor. More...
 
 ~TTUWedgeORLogic () override
 Destructor. More...
 
- Public Member Functions inherited from TTULogic
virtual void setOption (int option)
 
virtual ~TTULogic ()
 

Private Attributes

bool m_debug
 
int m_maxsectors
 
int m_maxwedges
 
std::map< int, int > m_wedgeSector
 
std::map< int, int > m_wheelMajority
 

Additional Inherited Members

- Public Attributes inherited from TTULogic
int m_option
 
bool m_triggersignal
 

Detailed Description

Author
Andres Felipe Osorio Oliveros
Date
2009-08-09

Definition at line 18 of file TTUWedgeORLogic.h.

Constructor & Destructor Documentation

TTUWedgeORLogic::TTUWedgeORLogic ( )

Standard constructor.

Definition at line 15 of file TTUWedgeORLogic.cc.

References m_debug, m_maxwedges, TTULogic::m_option, TTULogic::m_triggersignal, and m_wedgeSector.

15  {
16  m_triggersignal = false;
17 
18  //m_maxsectors = 3; //this is the size of the wedge
19 
20  //the key is the starting sector: sec 2 -> quadrant 7,8,9 and so on
21 
22  m_wedgeSector[2] = 1; //this is the size of the wedge: sec 2
23  m_wedgeSector[3] = 1; //this is the size of the wedge: sec 3
24  m_wedgeSector[4] = 1; //this is the size of the wedge: sec 4
25  m_wedgeSector[5] = 1; //this is the size of the wedge: sec 5
26  m_wedgeSector[6] = 1; //this is the size of the wedge: sec 6
27  m_wedgeSector[7] = 3; //this is the size of the wedge: bottom quadrant 1
28  m_wedgeSector[8] = 3; //this is the size of the wedge: bottom quadrant 2
29  m_wedgeSector[9] = 3; //this is the size of the wedge: bottom quadrant 3
30  m_wedgeSector[10] = 3; //this is the size of the wedge: bottom quadrant 4
31  m_wedgeSector[11] = 3; //this is the size of the wedge: bottom quadrant 5
32 
33  //m_wedgeSector.push_back(2); //this is the starting sector for each wedge
34  //m_wedgeSector.push_back(4);
35  //m_wedgeSector.push_back(8);
36  //m_wedgeSector.push_back(10);
37 
38  m_maxwedges = m_wedgeSector.size();
39 
40  m_option = 0;
41 
42  m_debug = false;
43 }
std::map< int, int > m_wedgeSector
bool m_triggersignal
Definition: TTULogic.h:30
int m_option
Definition: TTULogic.h:26
TTUWedgeORLogic::~TTUWedgeORLogic ( )
override

Destructor.

Definition at line 47 of file TTUWedgeORLogic.cc.

47 {}

Member Function Documentation

bool TTUWedgeORLogic::process ( const TTUInput inmap)
overridevirtual

Implements TTULogic.

Definition at line 62 of file TTUWedgeORLogic.cc.

References gather_cfg::cout, TTUInput::input_sec, dqmiolumiharvest::j, m_debug, m_maxsectors, TTULogic::m_option, TTULogic::m_triggersignal, m_wedgeSector, TTUInput::m_wheelId, m_wheelMajority, and nhits.

62  {
63  if (m_debug)
64  std::cout << "TTUWedgeORLogic::process starts" << std::endl;
65 
66  m_triggersignal = false;
67 
68  // October 15 2009: A.Osorio
69  // In this context m_option is the Selected Wedge/Quadrant (1,2,3,4...)
70  // initially we had 4 quadrants
71  // 1=*2-3-4 ; 2=*4-5-6; 3=*8-9-10; 4=*10-11-12
72  // Now: we have 5 top sectors: 2,3,4,5,6 and 5 bottom quadrants +/-1 of the opposite sector
73 
74  int nhits(0);
75  int sector_indx(0);
76  int firstsector = m_option;
77 
78  m_maxsectors = m_wedgeSector[firstsector];
79 
80  for (int j = 0; j < m_maxsectors; ++j) {
81  sector_indx = (firstsector - 1) + j;
82  if (sector_indx >= 12)
83  sector_indx = 0;
84  nhits += inmap.input_sec[sector_indx].count();
85  }
86 
87  //...introduce force logic
88  bool use_forcing = false;
89 
90  if (use_forcing) {
91  for (int j = 0; j < m_maxsectors; ++j) {
92  sector_indx = (firstsector - 1) + j;
93 
94  if (firstsector <= 6) { //...only top sectors
95 
96  bool hasLayer1 = inmap.input_sec[sector_indx][0]; //layer 1: RB1in
97 
98  if (!hasLayer1) {
99  m_triggersignal = false;
100  return true;
101  }
102  }
103  }
104  }
105 
106  int majority = m_wheelMajority[inmap.m_wheelId];
107 
108  if (m_debug)
109  std::cout << "TTUWedgeORLogic::setBoardSpecs> configuration W: " << inmap.m_wheelId << '\t' << "M: " << majority
110  << '\n';
111 
112  if (nhits >= majority)
113  m_triggersignal = true;
114 
115  if (m_debug)
116  std::cout << "TTUWedgeORLogic wedge decision: "
117  << "wheel: " << inmap.m_wheelId << '\t' << "quadrant: " << m_option << '\t' << "fsector: " << firstsector
118  << '\t' << "nhits: " << nhits << '\t' << "maj: " << majority << '\t' << "Dec: " << m_triggersignal
119  << std::endl;
120 
121  if (m_debug)
122  std::cout << "TTUWedgeORLogic>process ends" << std::endl;
123 
124  return true;
125 }
std::map< int, int > m_wedgeSector
int m_wheelId
Definition: TTUInput.h:32
std::array< std::bitset< 6 >, 12 > input_sec
Definition: TTUInput.h:36
bool m_triggersignal
Definition: TTULogic.h:30
int m_option
Definition: TTULogic.h:26
std::map< int, int > m_wheelMajority
void TTUWedgeORLogic::setBoardSpecs ( const TTUBoardSpecs::TTUBoardConfig boardspecs)
overridevirtual

Implements TTULogic.

Definition at line 50 of file TTUWedgeORLogic.cc.

References gather_cfg::cout, m_debug, TTUBoardSpecs::TTUBoardConfig::m_MaxNumWheels, TTUBoardSpecs::TTUBoardConfig::m_Wheel1Id, TTUBoardSpecs::TTUBoardConfig::m_Wheel2Id, and m_wheelMajority.

Referenced by TTUPointingLogic::setBoardSpecs().

50  {
51  m_wheelMajority[boardspecs.m_Wheel1Id] = 3;
52 
53  if ((boardspecs.m_MaxNumWheels > 1) && (boardspecs.m_Wheel2Id != 0))
54  m_wheelMajority[boardspecs.m_Wheel2Id] = 3;
55 
56  if (m_debug)
57  std::cout << "TTUWedgeORLogic::setBoardSpecs> intialization: " << m_wheelMajority.size() << '\t'
58  << boardspecs.m_MaxNumWheels << '\t' << boardspecs.m_Wheel1Id << '\t' << boardspecs.m_Wheel2Id << '\t'
59  << m_wheelMajority[boardspecs.m_Wheel1Id] << '\t' << m_wheelMajority[boardspecs.m_Wheel2Id] << '\n';
60 }
std::map< int, int > m_wheelMajority

Member Data Documentation

bool TTUWedgeORLogic::m_debug
private

Definition at line 31 of file TTUWedgeORLogic.h.

Referenced by process(), setBoardSpecs(), and TTUWedgeORLogic().

int TTUWedgeORLogic::m_maxsectors
private

Definition at line 33 of file TTUWedgeORLogic.h.

Referenced by process().

int TTUWedgeORLogic::m_maxwedges
private

Definition at line 35 of file TTUWedgeORLogic.h.

Referenced by TTUWedgeORLogic().

std::map<int, int> TTUWedgeORLogic::m_wedgeSector
private

Definition at line 41 of file TTUWedgeORLogic.h.

Referenced by process(), and TTUWedgeORLogic().

std::map<int, int> TTUWedgeORLogic::m_wheelMajority
private

Definition at line 37 of file TTUWedgeORLogic.h.

Referenced by process(), and setBoardSpecs().