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 27 of file RBCChamberORLogic.h.

Member Typedef Documentation

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

Definition at line 41 of file RBCChamberORLogic.h.

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

Definition at line 38 of file RBCChamberORLogic.h.

Constructor & Destructor Documentation

RBCChamberORLogic::RBCChamberORLogic ( )

Standard constructor.

Definition at line 16 of file RBCChamberORLogic.cc.

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

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

References m_layersignal.

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

Member Function Documentation

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

Definition at line 145 of file RBCChamberORLogic.cc.

References m_chamber, and m_rbname.

Referenced by process().

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

Definition at line 164 of file RBCChamberORLogic.cc.

References m_chamber, and m_rbname.

Referenced by process().

165 {
166 
167  m_chamber[m_rbname[0]] = _input[3];
168  m_chamber[m_rbname[1]] = _input[4];
169  m_chamber[m_rbname[2]] = _input[5];
170  m_chamber[m_rbname[3]] = _input[8];
171  m_chamber[m_rbname[4]] = _input[7];
172  m_chamber[m_rbname[5]] = _input[11];
173  m_chamber[m_rbname[6]] = _input[12] || _input[14];
174  m_chamber[m_rbname[7]] = _input[0];
175  m_chamber[m_rbname[8]] = _input[1];
176  m_chamber[m_rbname[9]] = _input[2];
177  m_chamber[m_rbname[10]] = _input[6];
178  m_chamber[m_rbname[11]] = _input[9];
179  m_chamber[m_rbname[12]] = _input[10] || _input[13];
180 
181 }
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 202 of file RBCChamberORLogic.cc.

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

Referenced by process().

203 {
204 
205  itr2chambers ptr1 = m_chamber.find( std::string(_chA) );
206  itr2chambers ptr2 = m_chamber.find( std::string(_chB) );
207 
208  if ( ptr1 == m_chamber.end() || ptr2 == m_chamber.end() ) {
209  //handle error...
210  std::cout << "RBCChamberORLogic> Cannot find a chamber name" << '\n';
211  return false;
212  }
213 
214  return ( ptr1->second || ptr2->second );
215 
216 }
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 38 of file RBCChamberORLogic.h.

38 { 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 60 of file RBCChamberORLogic.cc.

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

Referenced by ConfigBuilder.ConfigBuilder::__init__(), ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::anyOf(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), ConfigBuilder.ConfigBuilder::prepare(), ConfigBuilder.ConfigBuilder::prepare_ALCA(), ConfigBuilder.ConfigBuilder::prepare_DQM(), ConfigBuilder.ConfigBuilder::prepare_FASTSIM(), ConfigBuilder.ConfigBuilder::prepare_HARVESTING(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder::scheduleSequence().

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

Definition at line 183 of file RBCChamberORLogic.cc.

References m_chamber, and m_rbname.

Referenced by process().

184 {
185 
186  //... Reset map for next sector analysis
187  m_chamber.clear();
188 
189  itr2names itr = m_rbname.begin();
190 
191  while ( itr != m_rbname.end() )
192  {
193  m_chamber.insert( make_pair( (*itr) , 0 ) );
194  ++itr;
195  }
196 
197  //m_layersignal[0].reset();
198  //m_layersignal[1].reset();
199 
200 }
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 138 of file RBCChamberORLogic.cc.

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

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

Definition at line 51 of file RBCChamberORLogic.h.

References m_maxlevel.

51 { m_maxlevel = _mx;};

Member Data Documentation

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

Definition at line 61 of file RBCChamberORLogic.h.

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

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

Definition at line 51 of file RBCChamberORLogic.h.

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

int RBCChamberORLogic::m_maxcb
private

Definition at line 63 of file RBCChamberORLogic.h.

Referenced by RBCChamberORLogic().

int RBCChamberORLogic::m_maxlevel
private

Definition at line 65 of file RBCChamberORLogic.h.

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

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

Definition at line 59 of file RBCChamberORLogic.h.

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