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 18 of file TTUWedgeORLogic.h.

Constructor & Destructor Documentation

TTUWedgeORLogic::TTUWedgeORLogic ( )

Standard constructor.

Definition at line 17 of file TTUWedgeORLogic.cc.

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

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

Destructor.

Definition at line 51 of file TTUWedgeORLogic.cc.

51 {}

Member Function Documentation

bool TTUWedgeORLogic::process ( const TTUInput inmap)
virtual

Implements TTULogic.

Definition at line 72 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, m_wheelMajority, and nhits.

Referenced by ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_PATFILTER(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder::scheduleSequence().

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

Implements TTULogic.

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

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

Member Data Documentation

bool TTUWedgeORLogic::m_debug
private

Definition at line 33 of file TTUWedgeORLogic.h.

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

int TTUWedgeORLogic::m_maxsectors
private

Definition at line 35 of file TTUWedgeORLogic.h.

Referenced by process().

int TTUWedgeORLogic::m_maxwedges
private

Definition at line 37 of file TTUWedgeORLogic.h.

Referenced by TTUWedgeORLogic().

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

Definition at line 43 of file TTUWedgeORLogic.h.

Referenced by process(), and TTUWedgeORLogic().

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

Definition at line 39 of file TTUWedgeORLogic.h.

Referenced by process(), and setBoardSpecs().