CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
void setBoardSpecs (const TTUBoardSpecs::TTUBoardConfig &)
 
 TTUWedgeORLogic ()
 Standard constructor. More...
 
virtual ~TTUWedgeORLogic ()
 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 19 of file TTUWedgeORLogic.h.

Constructor & Destructor Documentation

TTUWedgeORLogic::TTUWedgeORLogic ( )

Standard constructor.

Definition at line 18 of file TTUWedgeORLogic.cc.

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

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

Destructor.

Definition at line 52 of file TTUWedgeORLogic.cc.

52 {}

Member Function Documentation

bool TTUWedgeORLogic::process ( const TTUInput inmap)
virtual

Implements TTULogic.

Definition at line 73 of file TTUWedgeORLogic.cc.

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

Referenced by ConfigBuilder.ConfigBuilder.PrintAllModules::leave().

74 {
75 
76  if( m_debug) std::cout << "TTUWedgeORLogic::process starts" << std::endl;
77 
78  m_triggersignal = false;
79 
80  // October 15 2009: A.Osorio
81  // In this context m_option is the Selected Wedge/Quadrant (1,2,3,4...)
82  // initially we had 4 quadrants
83  // 1=*2-3-4 ; 2=*4-5-6; 3=*8-9-10; 4=*10-11-12
84  // Now: we have 5 top sectors: 2,3,4,5,6 and 5 bottom quadrants +/-1 of the opposite sector
85 
86  int nhits(0);
87  int sector_indx(0);
88  int firstsector = m_option;
89 
90  m_maxsectors = m_wedgeSector[ firstsector ];
91 
92  for(int j = 0; j < m_maxsectors; ++j) {
93  sector_indx = (firstsector-1) + j;
94  if( sector_indx >= 12 ) sector_indx = 0;
95  nhits += inmap.input_sec[ sector_indx ].count();
96  }
97 
98  //...introduce force logic
99  bool use_forcing = false;
100 
101  if ( use_forcing ) {
102 
103  for(int j = 0; j < m_maxsectors; ++j) {
104 
105  sector_indx = (firstsector-1) + j;
106 
107  if( firstsector <= 6 ) { //...only top sectors
108 
109  bool hasLayer1 = inmap.input_sec[sector_indx][0]; //layer 1: RB1in
110 
111  if ( ! hasLayer1 ) {
112  m_triggersignal = false;
113  return true;
114  }
115 
116  }
117 
118  }
119 
120  }
121 
122 
123  int majority = m_wheelMajority[ inmap.m_wheelId ];
124 
125  if ( m_debug ) std::cout << "TTUWedgeORLogic::setBoardSpecs> configuration W: "
126  << inmap.m_wheelId << '\t' << "M: " << majority << '\n';
127 
128  if ( nhits >= majority) m_triggersignal = true;
129 
130  if( m_debug )
131  std::cout << "TTUWedgeORLogic wedge decision: "
132  << "wheel: " << inmap.m_wheelId << '\t'
133  << "quadrant: " << m_option << '\t'
134  << "fsector: " << firstsector << '\t'
135  << "nhits: " << nhits << '\t'
136  << "maj: " << majority << '\t'
137  << "Dec: " << m_triggersignal << std::endl;
138 
139  if( m_debug ) std::cout << "TTUWedgeORLogic>process ends" << std::endl;
140 
141  return true;
142 
143 }
int m_wheelId
Definition: TTUInput.h:55
std::map< int, int > m_wheelMajority
int j
Definition: DBlmapReader.cc:9
bool m_triggersignal
Definition: TTULogic.h:35
int m_option
Definition: TTULogic.h:31
std::map< int, int > m_wedgeSector
tuple cout
Definition: gather_cfg.py:121
std::bitset< 6 > * input_sec
Definition: TTUInput.h:59
void TTUWedgeORLogic::setBoardSpecs ( const TTUBoardSpecs::TTUBoardConfig boardspecs)
virtual

Implements TTULogic.

Definition at line 55 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().

56 {
57 
58  m_wheelMajority[ boardspecs.m_Wheel1Id ] = 3;
59 
60  if ( (boardspecs.m_MaxNumWheels > 1) && (boardspecs.m_Wheel2Id != 0) )
61  m_wheelMajority[ boardspecs.m_Wheel2Id ] = 3;
62 
63  if ( m_debug ) std::cout << "TTUWedgeORLogic::setBoardSpecs> intialization: "
64  << m_wheelMajority.size() << '\t'
65  << boardspecs.m_MaxNumWheels << '\t'
66  << boardspecs.m_Wheel1Id << '\t'
67  << boardspecs.m_Wheel2Id << '\t'
68  << m_wheelMajority[ boardspecs.m_Wheel1Id ] << '\t'
69  << m_wheelMajority[ boardspecs.m_Wheel2Id ] << '\n';
70 
71 }
std::map< int, int > m_wheelMajority
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

bool TTUWedgeORLogic::m_debug
private

Definition at line 34 of file TTUWedgeORLogic.h.

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

int TTUWedgeORLogic::m_maxsectors
private

Definition at line 36 of file TTUWedgeORLogic.h.

Referenced by process().

int TTUWedgeORLogic::m_maxwedges
private

Definition at line 38 of file TTUWedgeORLogic.h.

Referenced by TTUWedgeORLogic().

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

Definition at line 44 of file TTUWedgeORLogic.h.

Referenced by process(), and TTUWedgeORLogic().

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

Definition at line 40 of file TTUWedgeORLogic.h.

Referenced by process(), and setBoardSpecs().