CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Public Attributes | Private Attributes
RBCChamberORLogic Class Reference

#include <RBCChamberORLogic.h>

Inheritance diagram for RBCChamberORLogic:
RBCLogic

Public Types

typedef std::map< std::string,
bool >::iterator 
itr2chambers
 
typedef std::vector
< std::string >::iterator 
itr2names
 

Public Member Functions

void copymap (const std::bitset< 15 > &)
 
void createmap (const std::bitset< 15 > &)
 
bool evaluateLayerOR (const char *, const char *)
 
std::bitset< 6 > * getlayersignal (int _idx)
 
void process (const RBCInput &, std::bitset< 2 > &)
 
 RBCChamberORLogic ()
 Standard constructor. More...
 
void reset ()
 
void setBoardSpecs (const RBCBoardSpecs::RBCBoardConfig &)
 
void setmaxlevel (int _mx)
 
virtual ~RBCChamberORLogic ()
 Destructor. More...
 
- Public Member Functions inherited from RBCLogic
virtual ~RBCLogic ()
 

Public Attributes

std::bitset< 6 > * m_layersignal
 
- Public Attributes inherited from RBCLogic
bool m_triggersignal
 

Private Attributes

std::map< std::string, bool > m_chamber
 
int m_maxcb
 
int m_maxlevel
 
std::vector< std::string > m_rbname
 

Detailed Description

This class works out the mapping of inputs to chambers and applies a Coincidence Logic. The criteria for coincidence is set by the parameter m_maxlevel.

Authors
Andres Osorio, Flavio Loddo, Marcello Maggi

email: aosor.nosp@m.io@u.nosp@m.niand.nosp@m.es.e.nosp@m.du.co

Date
2008-10-11

Definition at line 28 of file RBCChamberORLogic.h.

Member Typedef Documentation

typedef std::map<std::string,bool>::iterator RBCChamberORLogic::itr2chambers

Definition at line 42 of file RBCChamberORLogic.h.

typedef std::vector<std::string>::iterator RBCChamberORLogic::itr2names

Definition at line 39 of file RBCChamberORLogic.h.

Constructor & Destructor Documentation

RBCChamberORLogic::RBCChamberORLogic ( )

Standard constructor.

Definition at line 17 of file RBCChamberORLogic.cc.

References m_chamber, m_layersignal, m_maxcb, m_maxlevel, m_rbname, and AlCaHLTBitMon_QueryRunRegistry::string.

17  {
18 
19  m_rbname.push_back(std::string("RB1InFw"));
20  m_rbname.push_back(std::string("RB1OutFw"));
21  m_rbname.push_back(std::string("RB22Fw"));
22  m_rbname.push_back(std::string("RB23Fw"));
23  m_rbname.push_back(std::string("RB23M"));
24  m_rbname.push_back(std::string("RB3Fw"));
25  m_rbname.push_back(std::string("RB4Fw"));
26  m_rbname.push_back(std::string("RB1InBk"));
27  m_rbname.push_back(std::string("RB1OutBk"));
28  m_rbname.push_back(std::string("RB22Bk"));
29  m_rbname.push_back(std::string("RB23Bk"));
30  m_rbname.push_back(std::string("RB3Bk"));
31  m_rbname.push_back(std::string("RB4Bk"));
32 
33  itr2names itr = m_rbname.begin();
34 
35  while ( itr != m_rbname.end() )
36  {
37  m_chamber.insert( make_pair( (*itr) , 0 ) );
38  ++itr;
39  }
40 
41  m_maxcb = 13;
42  m_maxlevel = 3; // 1 <= m <= 6
43 
44  m_layersignal = new std::bitset<6>[2];
45  m_layersignal[0].reset();
46  m_layersignal[1].reset();
47 
48 }
std::vector< std::string >::iterator itr2names
std::map< std::string, bool > m_chamber
std::bitset< 6 > * m_layersignal
std::vector< std::string > m_rbname
RBCChamberORLogic::~RBCChamberORLogic ( )
virtual

Destructor.

Definition at line 53 of file RBCChamberORLogic.cc.

References m_layersignal.

53  {
54 
55  if ( m_layersignal ) delete[] m_layersignal;
56 
57 }
std::bitset< 6 > * m_layersignal

Member Function Documentation

void RBCChamberORLogic::copymap ( const std::bitset< 15 > &  _input)

Definition at line 146 of file RBCChamberORLogic.cc.

References m_chamber, and m_rbname.

Referenced by process().

147 {
148 
149  m_chamber[m_rbname[0]] = _input[0];
150  m_chamber[m_rbname[1]] = _input[1];
151  m_chamber[m_rbname[2]] = _input[2];
152  m_chamber[m_rbname[3]] = _input[3];
153  m_chamber[m_rbname[4]] = _input[4];
154  m_chamber[m_rbname[5]] = _input[5];
155  m_chamber[m_rbname[6]] = _input[6];
156  m_chamber[m_rbname[7]] = _input[7];
157  m_chamber[m_rbname[8]] = _input[8];
158  m_chamber[m_rbname[9]] = _input[9];
159  m_chamber[m_rbname[10]] = _input[10];
160  m_chamber[m_rbname[11]] = _input[11];
161  m_chamber[m_rbname[12]] = _input[12];
162 
163 }
std::map< std::string, bool > m_chamber
std::vector< std::string > m_rbname
void RBCChamberORLogic::createmap ( const std::bitset< 15 > &  _input)

Definition at line 165 of file RBCChamberORLogic.cc.

References m_chamber, and m_rbname.

Referenced by process().

166 {
167 
168  m_chamber[m_rbname[0]] = _input[3];
169  m_chamber[m_rbname[1]] = _input[4];
170  m_chamber[m_rbname[2]] = _input[5];
171  m_chamber[m_rbname[3]] = _input[8];
172  m_chamber[m_rbname[4]] = _input[7];
173  m_chamber[m_rbname[5]] = _input[11];
174  m_chamber[m_rbname[6]] = _input[12] || _input[14];
175  m_chamber[m_rbname[7]] = _input[0];
176  m_chamber[m_rbname[8]] = _input[1];
177  m_chamber[m_rbname[9]] = _input[2];
178  m_chamber[m_rbname[10]] = _input[6];
179  m_chamber[m_rbname[11]] = _input[9];
180  m_chamber[m_rbname[12]] = _input[10] || _input[13];
181 
182 }
std::map< std::string, bool > m_chamber
std::vector< std::string > m_rbname
bool RBCChamberORLogic::evaluateLayerOR ( const char *  _chA,
const char *  _chB 
)

Definition at line 203 of file RBCChamberORLogic.cc.

References gather_cfg::cout, m_chamber, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by process().

204 {
205 
206  itr2chambers ptr1 = m_chamber.find( std::string(_chA) );
207  itr2chambers ptr2 = m_chamber.find( std::string(_chB) );
208 
209  if ( ptr1 == m_chamber.end() || ptr2 == m_chamber.end() ) {
210  //handle error...
211  std::cout << "RBCChamberORLogic> Cannot find a chamber name" << '\n';
212  return false;
213  }
214 
215  return ( ptr1->second || ptr2->second );
216 
217 }
std::map< std::string, bool > m_chamber
std::map< std::string, bool >::iterator itr2chambers
tuple cout
Definition: gather_cfg.py:121
std::bitset<6>* RBCChamberORLogic::getlayersignal ( int  _idx)
inlinevirtual

Implements RBCLogic.

Definition at line 39 of file RBCChamberORLogic.h.

39 { return & m_layersignal[_idx]; };
std::bitset< 6 > * m_layersignal
void RBCChamberORLogic::process ( const RBCInput _input,
std::bitset< 2 > &  _decision 
)
virtual

Implements RBCLogic.

Definition at line 61 of file RBCChamberORLogic.cc.

References abs, copymap(), prof2calltree::count, createmap(), evaluateLayerOR(), RBCInput::input_sec, gen::k, m_layersignal, m_maxlevel, RBCInput::needmapping, reset(), ntuplemaker::status, and RBCInput::wheelId().

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

62 {
63 
64  bool status(false);
65  //std::cout << "RBCChamberORLogic> Working with chambers OR logic ..." << '\n';
66 
67  m_layersignal[0].reset();
68  m_layersignal[1].reset();
69 
70  for (int k=0; k < 2; ++k )
71  {
72 
73  if( _input.needmapping )
74  this->createmap( _input.input_sec[k] );
75  else
76  this->copymap ( _input.input_sec[k] );
77 
78  status = this->evaluateLayerOR( "RB1InFw" , "RB1InBk" );
79  m_layersignal[k].set( 0 , status);
80 
81  status = this->evaluateLayerOR( "RB1OutFw" , "RB1OutBk" );
82  m_layersignal[k].set( 1 , status);
83 
84  //... RB2
85  //... wheel -2,+2 RB2IN divided in 2 eta partitions, RB2OUT in 3 eta
86  //... wheel -1, 0, +1 RB2IN divided in 3 eta partitions, RB2OUT in 2 eta
87 
88  if ( abs( _input.wheelId() ) >= 2 ) {
89 
90  status = this->evaluateLayerOR( "RB22Fw" , "RB22Bk" );
91  m_layersignal[k].set( 2 , status);
92 
93  bool rb23FB = this->evaluateLayerOR( "RB23Fw" , "RB23Bk" );
94  bool rb23MF = this->evaluateLayerOR( "RB23Fw" , "RB23M" );
95  bool rb23MB = this->evaluateLayerOR( "RB23M" , "RB23Bk" );
96 
97  status = rb23FB || rb23MF || rb23MB;
98 
99  m_layersignal[k].set( 3 , status );
100 
101  } else {
102 
103  status = this->evaluateLayerOR( "RB22Fw" , "RB22Bk" );
104  m_layersignal[k].set( 3 , status);
105 
106  bool rb23FB = this->evaluateLayerOR( "RB23Fw" , "RB23Bk" );
107  bool rb23MF = this->evaluateLayerOR( "RB23Fw" , "RB23M" );
108  bool rb23MB = this->evaluateLayerOR( "RB23M" , "RB23Bk" );
109 
110  status = rb23FB || rb23MF || rb23MB;
111 
112  m_layersignal[k].set( 2 , status );
113 
114  }
115 
116  //.......
117 
118  status = this->evaluateLayerOR( "RB3Fw" , "RB3Bk" );
119  m_layersignal[k].set( 4 , status);
120 
121  status = this->evaluateLayerOR( "RB4Fw" , "RB4Bk" );
122  m_layersignal[k].set( 5 , status);
123 
124  reset();
125 
126  //... apply now majority level criteria:
127 
128  int _majority = int(m_layersignal[k].count());
129 
130  if ( _majority >= m_maxlevel) _decision[k] = true;
131  else _decision[k] = false;
132 
133  }
134 
135  //...all done!
136 
137 }
#define abs(x)
Definition: mlp_lapack.h:159
std::bitset< 6 > * m_layersignal
bool evaluateLayerOR(const char *, const char *)
void createmap(const std::bitset< 15 > &)
std::bitset< 15 > * input_sec
Definition: RBCInput.h:65
int k[5][pyjets_maxn]
bool needmapping
Definition: RBCInput.h:76
int wheelId() const
Definition: RBCInput.h:82
void copymap(const std::bitset< 15 > &)
tuple status
Definition: ntuplemaker.py:245
void RBCChamberORLogic::reset ( void  )

Definition at line 184 of file RBCChamberORLogic.cc.

References m_chamber, and m_rbname.

Referenced by process().

185 {
186 
187  //... Reset map for next sector analysis
188  m_chamber.clear();
189 
190  itr2names itr = m_rbname.begin();
191 
192  while ( itr != m_rbname.end() )
193  {
194  m_chamber.insert( make_pair( (*itr) , 0 ) );
195  ++itr;
196  }
197 
198  //m_layersignal[0].reset();
199  //m_layersignal[1].reset();
200 
201 }
std::vector< std::string >::iterator itr2names
std::map< std::string, bool > m_chamber
std::vector< std::string > m_rbname
void RBCChamberORLogic::setBoardSpecs ( const RBCBoardSpecs::RBCBoardConfig specs)
virtual

Implements RBCLogic.

Definition at line 139 of file RBCChamberORLogic.cc.

References m_maxlevel, and RBCBoardSpecs::RBCBoardConfig::m_MayorityLevel.

140 {
141 
142  m_maxlevel = specs.m_MayorityLevel;
143 
144 }
void RBCChamberORLogic::setmaxlevel ( int  _mx)
inline

Definition at line 52 of file RBCChamberORLogic.h.

References m_maxlevel.

52 { m_maxlevel = _mx;};

Member Data Documentation

std::map<std::string, bool> RBCChamberORLogic::m_chamber
private

Definition at line 62 of file RBCChamberORLogic.h.

Referenced by copymap(), createmap(), evaluateLayerOR(), RBCChamberORLogic(), and reset().

std::bitset<6>* RBCChamberORLogic::m_layersignal

Definition at line 52 of file RBCChamberORLogic.h.

Referenced by process(), RBCChamberORLogic(), and ~RBCChamberORLogic().

int RBCChamberORLogic::m_maxcb
private

Definition at line 64 of file RBCChamberORLogic.h.

Referenced by RBCChamberORLogic().

int RBCChamberORLogic::m_maxlevel
private

Definition at line 66 of file RBCChamberORLogic.h.

Referenced by process(), RBCChamberORLogic(), setBoardSpecs(), and setmaxlevel().

std::vector<std::string> RBCChamberORLogic::m_rbname
private

Definition at line 60 of file RBCChamberORLogic.h.

Referenced by copymap(), createmap(), RBCChamberORLogic(), and reset().