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
l1t::GtBoard Class Reference

#include <GtBoard.h>

Public Member Functions

void fillAlgRecord (int iBxInEvent, std::auto_ptr< GlobalAlgBlkBxCollection > &uGtAlgRecord, cms_uint64_t orbNr, int bxNr)
 Fill the Daq Records. More...
 
void fillExtRecord (int iBxInEvent, std::auto_ptr< GlobalExtBlkBxCollection > &uGtExtRecord, cms_uint64_t orbNr, int bxNr)
 
const std::bitset
< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > & 
getAlgorithmOR () const
 return algorithm OR decision More...
 
const BXVector< const
l1t::L1Candidate * > * 
getCandL1EG () const
 pointer to EG data list More...
 
const BXVector< const
l1t::EtSum * > * 
getCandL1EtSum () const
 pointer to Tau data list More...
 
const BXVector< const
GlobalExtBlk * > * 
getCandL1External () const
 pointer to Tau data list More...
 
const BXVector< const
l1t::L1Candidate * > * 
getCandL1Jet () const
 pointer to Jet data list More...
 
const BXVector< const
l1t::Muon * > * 
getCandL1Mu () const
 return global muon trigger candidate More...
 
const BXVector< const
l1t::L1Candidate * > * 
getCandL1Tau () const
 pointer to Tau data list More...
 
const std::bitset
< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > & 
getDecisionWord () const
 return decision More...
 
 GtBoard ()
 
void init (const int numberPhysTriggers, const int nrL1Mu, const int nrL1EG, const int nrL1Tau, const int nrL1Jet, int bxFirst, int bxLast)
 initialize the class (mainly reserve) More...
 
void printGmtData (const int iBxInEvent) const
 print received Muon dataWord More...
 
void receiveCaloObjectData (edm::Event &, const edm::EDGetTokenT< BXVector< l1t::EGamma >> &, const edm::EDGetTokenT< BXVector< l1t::Tau >> &, const edm::EDGetTokenT< BXVector< l1t::Jet >> &, const edm::EDGetTokenT< BXVector< l1t::EtSum >> &, const bool receiveEG, const int nrL1EG, const bool receiveTau, const int nrL1Tau, const bool receiveJet, const int nrL1Jet, const bool receiveEtSums)
 receive data from Global Muon Trigger More...
 
void receiveExternalData (edm::Event &, const edm::EDGetTokenT< BXVector< GlobalExtBlk > > &, const bool receiveExt)
 
void receiveMuonObjectData (edm::Event &, const edm::EDGetTokenT< BXVector< l1t::Muon > > &, const bool receiveMu, const int nrL1Mu)
 
void reset ()
 clear uGT More...
 
void resetCalo ()
 
void resetExternal ()
 
void resetMu ()
 
void runFDL (edm::Event &iEvent, const int iBxInEvent, const int totalBxInEvent, const unsigned int numberPhysTriggers, const std::vector< int > &prescaleFactorsAlgoTrig, const std::vector< unsigned int > &triggerMaskAlgoTrig, const std::vector< unsigned int > &triggerMaskVetoAlgoTrig, const bool algorithmTriggersUnprescaled, const bool algorithmTriggersUnmasked)
 run the uGT FDL (Apply Prescales and Veto) More...
 
void runGTL (edm::Event &iEvent, const edm::EventSetup &evSetup, const TriggerMenu *m_l1GtMenu, const bool produceL1GtObjectMapRecord, const int iBxInEvent, std::auto_ptr< L1GlobalTriggerObjectMapRecord > &gtObjectMapRecord, const unsigned int numberPhysTriggers, const int nrL1Mu, const int nrL1EG, const int nrL1Tau, const int nrL1Jet, const int nrL1JetCounts)
 run the uGT GTL (Conditions and Algorithms) More...
 
void setBxFirst (int bx)
 
void setBxLast (int bx)
 
void setVerbosity (const int verbosity)
 
virtual ~GtBoard ()
 

Private Attributes

bool m_algFinalOr
 
bool m_algFinalOrPreVeto
 
bool m_algFinalOrVeto
 
bool m_algInitialOr
 
bool m_algPrescaledOr
 
unsigned int m_boardEventCount
 
int m_bxFirst_
 
int m_bxLast_
 
BXVector< const
l1t::L1Candidate * > * 
m_candL1EG
 
BXVector< const l1t::EtSum * > * m_candL1EtSum
 
BXVector< const GlobalExtBlk * > * m_candL1External
 
BXVector< const
l1t::L1Candidate * > * 
m_candL1Jet
 
BXVector< const l1t::Muon * > * m_candL1Mu
 
BXVector< const
l1t::L1Candidate * > * 
m_candL1Tau
 
std::vector
< AlgorithmEvaluation::ConditionEvaluationMap
m_conditionResultMaps
 
bool m_firstEv
 
bool m_firstEvLumiSegment
 
std::bitset
< L1GlobalTriggerReadoutSetup::NumberPhysTriggers
m_gtlAlgorithmOR
 
std::bitset
< L1GlobalTriggerReadoutSetup::NumberPhysTriggers
m_gtlDecisionWord
 
bool m_isDebugEnabled
 
const L1CaloGeometrym_l1CaloGeometry
 
unsigned long long m_l1CaloGeometryCacheID
 
const TriggerMenum_l1GtMenu
 
unsigned long long m_l1GtMenuCacheID
 
const L1MuTriggerScalesm_l1MuTriggerScales
 
unsigned long long m_l1MuTriggerScalesCacheID
 
std::vector< std::vector< int > > m_prescaleCounterAlgoTrig
 prescale counters: NumberPhysTriggers counters per bunch cross in event More...
 
GlobalAlgBlk m_uGtAlgBlk
 
int m_uGtBoardNumber
 
GlobalExtBlk m_uGtExtBlk
 
bool m_uGtFinalBoard
 
int m_verbosity
 verbosity level More...
 

Detailed Description

Definition at line 53 of file GtBoard.h.

Constructor & Destructor Documentation

GtBoard::GtBoard ( )

Definition at line 67 of file GtBoard.cc.

References m_boardEventCount, m_gtlAlgorithmOR, m_gtlDecisionWord, m_l1CaloGeometryCacheID, m_l1GtMenuCacheID, m_l1MuTriggerScalesCacheID, m_uGtAlgBlk, m_uGtBoardNumber, m_uGtExtBlk, m_uGtFinalBoard, GlobalExtBlk::reset(), and GlobalAlgBlk::reset().

67  :
74  m_firstEv(true),
77 {
78 
81 
82  m_gtlAlgorithmOR.reset();
83  m_gtlDecisionWord.reset();
84 
85  // initialize cached IDs
86  m_l1GtMenuCacheID = 0ULL;
89 
90  // Counter for number of events board sees
92 
93  // Need to expand use with more than one uGt GtBoard for now assume 1
94  m_uGtBoardNumber = 0;
95  m_uGtFinalBoard = true;
96 
97 /* Do we need this?
98  // pointer to conversion - actually done in the event loop (cached)
99  m_gtEtaPhiConversions = new L1GtEtaPhiConversions();
100  m_gtEtaPhiConversions->setVerbosity(m_verbosity);
101 */
102 
103 }
GlobalExtBlk m_uGtExtBlk
Definition: GtBoard.h:260
bool isDebugEnabled()
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
Definition: GtBoard.h:256
GlobalAlgBlk m_uGtAlgBlk
Definition: GtBoard.h:259
void reset()
reset the content of a GlobalExtBlk
Definition: GlobalExtBlk.cc:75
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GtBoard.h:241
bool m_firstEvLumiSegment
Definition: GtBoard.h:269
bool m_uGtFinalBoard
Definition: GtBoard.h:289
bool m_firstEv
Definition: GtBoard.h:268
unsigned int m_boardEventCount
Definition: GtBoard.h:285
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GtBoard.h:246
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
Definition: GtBoard.h:257
unsigned long long m_l1MuTriggerScalesCacheID
Definition: GtBoard.h:234
bool m_isDebugEnabled
Definition: GtBoard.h:275
void reset()
reset the content of a GlobalAlgBlk
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GtBoard.h:245
unsigned long long m_l1GtMenuCacheID
Definition: GtBoard.h:227
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GtBoard.h:242
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GtBoard.h:243
int m_uGtBoardNumber
Definition: GtBoard.h:288
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GtBoard.h:244
unsigned long long m_l1CaloGeometryCacheID
Definition: GtBoard.h:231
GtBoard::~GtBoard ( )
virtual

Definition at line 106 of file GtBoard.cc.

106  {
107 
108  //reset();
109  delete m_candL1Mu;
110  delete m_candL1EG;
111  delete m_candL1Tau;
112  delete m_candL1Jet;
113  delete m_candL1EtSum;
114  delete m_candL1External;
115 
116 // delete m_gtEtaPhiConversions;
117 
118 }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GtBoard.h:241
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GtBoard.h:246
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GtBoard.h:245
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GtBoard.h:242
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GtBoard.h:243
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GtBoard.h:244

Member Function Documentation

void GtBoard::fillAlgRecord ( int  iBxInEvent,
std::auto_ptr< GlobalAlgBlkBxCollection > &  uGtAlgRecord,
cms_uint64_t  orbNr,
int  bxNr 
)

Fill the Daq Records.

Definition at line 1030 of file GtBoard.cc.

References LogDebug.

Referenced by L1TGlobalProducer::produce().

1035 {
1036 
1037  if (m_verbosity) {
1038  LogDebug("l1t|Global")
1039  << "\n**** GtBoard fill DAQ Records for bx= " << iBxInEvent
1040  << std::endl;
1041 
1042  }
1043 
1044 // Set header information
1045  m_uGtAlgBlk.setOrbitNr((unsigned int)(orbNr & 0xFFFFFFFF));
1046  m_uGtAlgBlk.setbxNr((bxNr & 0xFFFF));
1047  m_uGtAlgBlk.setbxInEventNr((iBxInEvent & 0xF));
1048  m_uGtAlgBlk.setPreScColumn(0); //TO DO: get this and fill it in.
1049 
1053 
1054 
1055  uGtAlgRecord->push_back(iBxInEvent, m_uGtAlgBlk);
1056 
1057 }
#define LogDebug(id)
int m_verbosity
verbosity level
Definition: GtBoard.h:274
GlobalAlgBlk m_uGtAlgBlk
Definition: GtBoard.h:259
void setFinalORPreVeto(bool fOR)
Definition: GlobalAlgBlk.h:58
void setbxInEventNr(int bxNr)
Definition: GlobalAlgBlk.h:56
bool m_algFinalOrVeto
Definition: GtBoard.h:281
bool m_algFinalOr
Definition: GtBoard.h:280
void setFinalOR(bool fOR)
Definition: GlobalAlgBlk.h:59
void setFinalORVeto(bool fOR)
Definition: GlobalAlgBlk.h:57
void setbxNr(int bxNr)
Definition: GlobalAlgBlk.h:55
bool m_algFinalOrPreVeto
Definition: GtBoard.h:282
void setPreScColumn(int psC)
Definition: GlobalAlgBlk.h:60
void setOrbitNr(int orbNr)
set simple members
Definition: GlobalAlgBlk.h:54
void GtBoard::fillExtRecord ( int  iBxInEvent,
std::auto_ptr< GlobalExtBlkBxCollection > &  uGtExtRecord,
cms_uint64_t  orbNr,
int  bxNr 
)

Definition at line 1060 of file GtBoard.cc.

References LogDebug.

Referenced by L1TGlobalProducer::produce().

1065 {
1066 
1067  if (m_verbosity) {
1068  LogDebug("l1t|Global")
1069  << "\n**** Board fill DAQ Records for bx= " << iBxInEvent
1070  << std::endl;
1071 
1072  }
1073 // Set header information
1074 
1075 
1076  uGtExtRecord->push_back(iBxInEvent, m_uGtExtBlk);
1077 
1078 }
#define LogDebug(id)
GlobalExtBlk m_uGtExtBlk
Definition: GtBoard.h:260
int m_verbosity
verbosity level
Definition: GtBoard.h:274
const std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers>& l1t::GtBoard::getAlgorithmOR ( ) const
inline

return algorithm OR decision

Definition at line 144 of file GtBoard.h.

References m_gtlAlgorithmOR.

145  {
146  return m_gtlAlgorithmOR;
147  }
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
Definition: GtBoard.h:256
const BXVector<const l1t::L1Candidate*>* l1t::GtBoard::getCandL1EG ( ) const
inline

pointer to EG data list

Definition at line 156 of file GtBoard.h.

References m_candL1EG.

157  {
158  return m_candL1EG;
159  }
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GtBoard.h:242
const BXVector<const l1t::EtSum*>* l1t::GtBoard::getCandL1EtSum ( ) const
inline

pointer to Tau data list

Definition at line 175 of file GtBoard.h.

References m_candL1EtSum.

176  {
177  return m_candL1EtSum;
178  }
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GtBoard.h:245
const BXVector<const GlobalExtBlk*>* l1t::GtBoard::getCandL1External ( ) const
inline

pointer to Tau data list

Definition at line 181 of file GtBoard.h.

References m_candL1External.

182  {
183  return m_candL1External;
184  }
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GtBoard.h:246
const BXVector<const l1t::L1Candidate*>* l1t::GtBoard::getCandL1Jet ( ) const
inline

pointer to Jet data list

Definition at line 162 of file GtBoard.h.

References m_candL1Jet.

163  {
164  return m_candL1Jet;
165  }
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GtBoard.h:244
const BXVector<const l1t::Muon*>* l1t::GtBoard::getCandL1Mu ( ) const
inline

return global muon trigger candidate

Definition at line 150 of file GtBoard.h.

References m_candL1Mu.

151  {
152  return m_candL1Mu;
153  }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GtBoard.h:241
const BXVector<const l1t::L1Candidate*>* l1t::GtBoard::getCandL1Tau ( ) const
inline

pointer to Tau data list

Definition at line 169 of file GtBoard.h.

References m_candL1Tau.

170  {
171  return m_candL1Tau;
172  }
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GtBoard.h:243
const std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers>& l1t::GtBoard::getDecisionWord ( ) const
inline

return decision

Definition at line 138 of file GtBoard.h.

References m_gtlDecisionWord.

139  {
140  return m_gtlDecisionWord;
141  }
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
Definition: GtBoard.h:257
void GtBoard::init ( const int  numberPhysTriggers,
const int  nrL1Mu,
const int  nrL1EG,
const int  nrL1Tau,
const int  nrL1Jet,
int  bxFirst,
int  bxLast 
)

initialize the class (mainly reserve)

Definition at line 133 of file GtBoard.cc.

References LogDebug.

Referenced by L1TGlobalProducer::produce().

134  {
135 
136  setBxFirst(bxFirst);
137  setBxLast(bxLast);
138 
139  m_candL1Mu->setBXRange( m_bxFirst_, m_bxLast_ );
140  m_candL1EG->setBXRange( m_bxFirst_, m_bxLast_ );
141  m_candL1Tau->setBXRange( m_bxFirst_, m_bxLast_ );
142  m_candL1Jet->setBXRange( m_bxFirst_, m_bxLast_ );
143  m_candL1EtSum->setBXRange( m_bxFirst_, m_bxLast_ );
145 
146  m_uGtAlgBlk.reset();
147  m_uGtExtBlk.reset();
148 
149  LogDebug("l1t|Global") << "\t Initializing Board with bxFirst = " << m_bxFirst_ << ", bxLast = " << m_bxLast_ << std::endl;
150 
151  //m_candL1Mu->resizeAll(nrL1Mu);
152 
153  // FIXME move from bitset to std::vector<bool> to be able to use
154  // numberPhysTriggers from EventSetup
155 
156  //m_gtlAlgorithmOR.reserve(numberPhysTriggers);
157  //m_gtlAlgorithmOR.assign(numberPhysTriggers, false);
158 
159  //m_gtlDecisionWord.reserve(numberPhysTriggers);
160  //m_gtlDecisionWord.assign(numberPhysTriggers, false);
161 
162 }
#define LogDebug(id)
GlobalExtBlk m_uGtExtBlk
Definition: GtBoard.h:260
GlobalAlgBlk m_uGtAlgBlk
Definition: GtBoard.h:259
void reset()
reset the content of a GlobalExtBlk
Definition: GlobalExtBlk.cc:75
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GtBoard.h:241
int m_bxFirst_
Definition: GtBoard.h:253
void setBxLast(int bx)
Definition: GtBoard.cc:127
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GtBoard.h:246
void reset()
reset the content of a GlobalAlgBlk
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GtBoard.h:245
void setBxFirst(int bx)
Definition: GtBoard.cc:121
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GtBoard.h:242
int m_bxLast_
Definition: GtBoard.h:254
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GtBoard.h:243
void setBXRange(int bxFirst, int bxLast)
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GtBoard.h:244
void GtBoard::printGmtData ( const int  iBxInEvent) const

print received Muon dataWord

Definition at line 1130 of file GtBoard.cc.

References LogTrace.

1130  {
1131 
1132  LogTrace("l1t|Global")
1133  << "\nl1t::L1GlobalTrigger: GMT data received for BxInEvent = "
1134  << iBxInEvent << std::endl;
1135 
1136  int nrL1Mu = m_candL1Mu->size(iBxInEvent);
1137  LogTrace("l1t|Global")
1138  << "Number of GMT muons = " << nrL1Mu << "\n"
1139  << std::endl;
1140 /*
1141  for (std::vector<const L1MuGMTCand*>::const_iterator iter =
1142  m_candL1Mu->begin(); iter != m_candL1Mu->end(); iter++) {
1143 
1144  LogTrace("l1t|Global") << *(*iter) << std::endl;
1145 
1146  }
1147 */
1148  LogTrace("l1t|Global") << std::endl;
1149 
1150 }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GtBoard.h:241
#define LogTrace(id)
void GtBoard::receiveCaloObjectData ( edm::Event iEvent,
const edm::EDGetTokenT< BXVector< l1t::EGamma >> &  egInputToken,
const edm::EDGetTokenT< BXVector< l1t::Tau >> &  tauInputToken,
const edm::EDGetTokenT< BXVector< l1t::Jet >> &  jetInputToken,
const edm::EDGetTokenT< BXVector< l1t::EtSum >> &  sumInputToken,
const bool  receiveEG,
const int  nrL1EG,
const bool  receiveTau,
const int  nrL1Tau,
const bool  receiveJet,
const int  nrL1Jet,
const bool  receiveEtSums 
)

receive data from Global Muon Trigger

Definition at line 167 of file GtBoard.cc.

References edm::Event::getByToken(), i, edm::HandleBase::isValid(), metsig::jet, LogDebug, and metsig::tau.

Referenced by L1TGlobalProducer::produce().

175  {
176 
177  if (m_verbosity) {
178  LogDebug("l1t|Global")
179  << "\n**** Board receiving Calo Data "
180  //<< "\n from input tag " << caloInputTag << "\n"
181  << std::endl;
182 
183  }
184 
185  resetCalo();
186 
187  // get data from Calorimeter
188  if (receiveEG) {
190  iEvent.getByToken(egInputToken, egData);
191 
192  if (!egData.isValid()) {
193  if (m_verbosity) {
194  edm::LogWarning("l1t|Global")
195  << "\nWarning: BXVector<l1t::EGamma> with input tag "
196  //<< caloInputTag
197  << "\nrequested in configuration, but not found in the event.\n"
198  << std::endl;
199  }
200  } else {
201  // bx in EG data
202  for(int i = egData->getFirstBX(); i <= egData->getLastBX(); ++i) {
203 
204  // Prevent from pushing back bx that is outside of allowed range
205  if( i < m_bxFirst_ || i > m_bxLast_ ) continue;
206 
207  //Loop over EG in this bx
208  for(std::vector<l1t::EGamma>::const_iterator eg = egData->begin(i); eg != egData->end(i); ++eg) {
209 
210  (*m_candL1EG).push_back(i,&(*eg));
211  LogDebug("l1t|Global") << "EG Pt " << eg->hwPt() << " Eta " << eg->hwEta() << " Phi " << eg->hwPhi() << " Qual " << eg->hwQual() <<" Iso " << eg->hwIso() << std::endl;
212  } //end loop over EG in bx
213  } //end loop over bx
214 
215  } //end if over valid EG data
216 
217  } //end if ReveiveEG data
218 
219 
220  if (receiveTau) {
222  iEvent.getByToken(tauInputToken, tauData);
223 
224  if (!tauData.isValid()) {
225  if (m_verbosity) {
226  edm::LogWarning("l1t|Global")
227  << "\nWarning: BXVector<l1t::Tau> with input tag "
228  //<< caloInputTag
229  << "\nrequested in configuration, but not found in the event.\n"
230  << std::endl;
231  }
232  } else {
233  // bx in tau data
234  for(int i = tauData->getFirstBX(); i <= tauData->getLastBX(); ++i) {
235 
236  // Prevent from pushing back bx that is outside of allowed range
237  if( i < m_bxFirst_ || i > m_bxLast_ ) continue;
238 
239  //Loop over tau in this bx
240  for(std::vector<l1t::Tau>::const_iterator tau = tauData->begin(i); tau != tauData->end(i); ++tau) {
241 
242  (*m_candL1Tau).push_back(i,&(*tau));
243  LogDebug("l1t|Global") << "tau Pt " << tau->hwPt() << " Eta " << tau->hwEta() << " Phi " << tau->hwPhi() << " Qual " << tau->hwQual() <<" Iso " << tau->hwIso() << std::endl;
244  } //end loop over tau in bx
245  } //end loop over bx
246 
247  } //end if over valid tau data
248 
249  } //end if ReveiveTau data
250 
251 
252  if (receiveJet) {
254  iEvent.getByToken(jetInputToken, jetData);
255 
256  if (!jetData.isValid()) {
257  if (m_verbosity) {
258  edm::LogWarning("l1t|Global")
259  << "\nWarning: BXVector<l1t::Jet> with input tag "
260  //<< caloInputTag
261  << "\nrequested in configuration, but not found in the event.\n"
262  << std::endl;
263  }
264  } else {
265  // bx in jet data
266  for(int i = jetData->getFirstBX(); i <= jetData->getLastBX(); ++i) {
267 
268  // Prevent from pushing back bx that is outside of allowed range
269  if( i < m_bxFirst_ || i > m_bxLast_ ) continue;
270 
271  //Loop over jet in this bx
272  for(std::vector<l1t::Jet>::const_iterator jet = jetData->begin(i); jet != jetData->end(i); ++jet) {
273 
274  (*m_candL1Jet).push_back(i,&(*jet));
275  LogDebug("l1t|Global") << "Jet Pt " << jet->hwPt() << " Eta " << jet->hwEta() << " Phi " << jet->hwPhi() << " Qual " << jet->hwQual() <<" Iso " << jet->hwIso() << std::endl;
276  } //end loop over jet in bx
277  } //end loop over bx
278 
279  } //end if over valid jet data
280 
281  } //end if ReveiveJet data
282 
283 
284  if(receiveEtSums) {
286  iEvent.getByToken(sumInputToken, etSumData);
287 
288  if(!etSumData.isValid()) {
289  if (m_verbosity) {
290  edm::LogWarning("l1t|Global")
291  << "\nWarning: BXVector<l1t::EtSum> with input tag "
292  //<< caloInputTag
293  << "\nrequested in configuration, but not found in the event.\n"
294  << std::endl;
295  }
296  } else {
297 
298  for(int i = etSumData->getFirstBX(); i <= etSumData->getLastBX(); ++i) {
299 
300  // Prevent from pushing back bx that is outside of allowed range
301  if( i < m_bxFirst_ || i > m_bxLast_ ) continue;
302 
303  //Loop over jet in this bx
304  for(std::vector<l1t::EtSum>::const_iterator etsum = etSumData->begin(i); etsum != etSumData->end(i); ++etsum) {
305 
306  (*m_candL1EtSum).push_back(i,&(*etsum));
307 
308 /* In case we need to split these out
309  switch ( etsum->getType() ) {
310  case l1t::EtSum::EtSumType::kMissingEt:
311  (*m_candETM).push_back(i,&(*etsum));
312  LogDebug("l1t|Global") << "ETM: Pt " << etsum->hwPt() << " Phi " << etsum->hwPhi() << std::endl;
313  break;
314  case l1t::EtSum::EtSumType::kMissingHt:
315  (*m_candHTM.push_back(i,&(*etsum);
316  LogDebug("l1t|Global") << "HTM: Pt " << etsum->hwPt() << " Phi " << etsum->hwPhi() << std::endl;
317  break;
318  case l1t::EtSum::EtSumType::kTotalEt:
319  (*m_candETT.push_back(i,&(*etsum);
320  LogDebug("l1t|Global") << "ETT: Pt " << etsum->hwPt() << std::endl;
321  break;
322  case l1t::EtSum::EtSumType::kTotalHt:
323  (*m_candHTT.push_back(i,&(*etsum);
324  LogDebug("l1t|Global") << "HTT: Pt " << etsum->hwPt() << std::endl;
325  break;
326  }
327 */
328 
329  } //end loop over jet in bx
330  } //end loop over Bx
331 
332  }
333 
334 
335  }
336 
337 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
int m_verbosity
verbosity level
Definition: GtBoard.h:274
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
bool isValid() const
Definition: HandleBase.h:75
int m_bxLast_
Definition: GtBoard.h:254
void resetCalo()
Definition: GtBoard.cc:1107
void GtBoard::receiveExternalData ( edm::Event iEvent,
const edm::EDGetTokenT< BXVector< GlobalExtBlk > > &  extInputToken,
const bool  receiveExt 
)

Definition at line 394 of file GtBoard.cc.

References edm::Event::getByToken(), i, edm::HandleBase::isValid(), and LogDebug.

Referenced by L1TGlobalProducer::produce().

396  {
397 
398  if (m_verbosity) {
399  LogDebug("L1TGlobal")
400  << "\n**** GtBoard receiving external data = "
401  //<< "\n from input tag " << muInputTag << "\n"
402  << std::endl;
403  }
404 
405  resetExternal();
406 
407  // get data from Global Muon Trigger
408  if (receiveExt) {
410  iEvent.getByToken(extInputToken, extData);
411 
412  if (!extData.isValid()) {
413  if (m_verbosity) {
414  edm::LogWarning("L1TGlobal")
415  << "\nWarning: BXVector<GlobalExtBlk> with input tag "
416  //<< muInputTag
417  << "\nrequested in configuration, but not found in the event.\n"
418  << std::endl;
419  }
420  } else {
421  // bx in muon data
422  for(int i = extData->getFirstBX(); i <= extData->getLastBX(); ++i) {
423 
424  // Prevent from pushing back bx that is outside of allowed range
425  if( i < m_bxFirst_ || i > m_bxLast_ ) continue;
426 
427  //Loop over ext in this bx
428  for(std::vector<GlobalExtBlk>::const_iterator ext = extData->begin(i); ext != extData->end(i); ++ext) {
429 
430  (*m_candL1External).push_back(i,&(*ext));
431  } //end loop over ext in bx
432  } //end loop over bx
433 
434  } //end if over valid ext data
435 
436  } //end if ReveiveExt data
437 
438 }
#define LogDebug(id)
void resetExternal()
Definition: GtBoard.cc:1121
int i
Definition: DBlmapReader.cc:9
int m_verbosity
verbosity level
Definition: GtBoard.h:274
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
bool isValid() const
Definition: HandleBase.h:75
int m_bxLast_
Definition: GtBoard.h:254
void GtBoard::receiveMuonObjectData ( edm::Event iEvent,
const edm::EDGetTokenT< BXVector< l1t::Muon > > &  muInputToken,
const bool  receiveMu,
const int  nrL1Mu 
)

Definition at line 341 of file GtBoard.cc.

References edm::Event::getByToken(), i, edm::HandleBase::isValid(), LogDebug, and RPCpg::mu.

Referenced by L1TGlobalProducer::produce().

343  {
344 
345  if (m_verbosity) {
346  LogDebug("l1t|Global")
347  << "\n**** GtBoard receiving muon data = "
348  //<< "\n from input tag " << muInputTag << "\n"
349  << std::endl;
350  }
351 
352  resetMu();
353 
354  // get data from Global Muon Trigger
355  if (receiveMu) {
357  iEvent.getByToken(muInputToken, muonData);
358 
359  if (!muonData.isValid()) {
360  if (m_verbosity) {
361  edm::LogWarning("l1t|Global")
362  << "\nWarning: BXVector<l1t::Muon> with input tag "
363  //<< muInputTag
364  << "\nrequested in configuration, but not found in the event.\n"
365  << std::endl;
366  }
367  } else {
368  // bx in muon data
369  for(int i = muonData->getFirstBX(); i <= muonData->getLastBX(); ++i) {
370 
371  // Prevent from pushing back bx that is outside of allowed range
372  if( i < m_bxFirst_ || i > m_bxLast_ ) continue;
373 
374  //Loop over Muons in this bx
375  for(std::vector<l1t::Muon>::const_iterator mu = muonData->begin(i); mu != muonData->end(i); ++mu) {
376 
377  (*m_candL1Mu).push_back(i,&(*mu));
378  LogDebug("l1t|Global") << "Muon Pt " << mu->hwPt() << " Eta " << mu->hwEta() << " Phi " << mu->hwPhi() << " Qual " << mu->hwQual() <<" Iso " << mu->hwIso() << std::endl;
379  } //end loop over muons in bx
380  } //end loop over bx
381 
382  } //end if over valid muon data
383 
384  } //end if ReveiveMuon data
385 
386  if (m_verbosity && m_isDebugEnabled) {
387 // *** Needs fixing
388 // printGmtData(iBxInEvent);
389  }
390 
391 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
void resetMu()
Definition: GtBoard.cc:1099
int m_verbosity
verbosity level
Definition: GtBoard.h:274
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
bool m_isDebugEnabled
Definition: GtBoard.h:275
const int mu
Definition: Constants.h:22
bool isValid() const
Definition: HandleBase.h:75
int m_bxLast_
Definition: GtBoard.h:254
void GtBoard::reset ( void  )

clear uGT

Definition at line 1082 of file GtBoard.cc.

Referenced by L1TGlobalProducer::produce().

1082  {
1083 
1084  resetMu();
1085  resetCalo();
1086  resetExternal();
1087 
1088  m_uGtAlgBlk.reset();
1089  m_uGtExtBlk.reset();
1090 
1091  m_gtlDecisionWord.reset();
1092  m_gtlAlgorithmOR.reset();
1093 
1094 
1095 
1096 }
GlobalExtBlk m_uGtExtBlk
Definition: GtBoard.h:260
void resetExternal()
Definition: GtBoard.cc:1121
void resetMu()
Definition: GtBoard.cc:1099
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlAlgorithmOR
Definition: GtBoard.h:256
GlobalAlgBlk m_uGtAlgBlk
Definition: GtBoard.h:259
void reset()
reset the content of a GlobalExtBlk
Definition: GlobalExtBlk.cc:75
std::bitset< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > m_gtlDecisionWord
Definition: GtBoard.h:257
void reset()
reset the content of a GlobalAlgBlk
void resetCalo()
Definition: GtBoard.cc:1107
void GtBoard::resetCalo ( )

Definition at line 1107 of file GtBoard.cc.

1107  {
1108 
1109  m_candL1EG->clear();
1110  m_candL1Tau->clear();
1111  m_candL1Jet->clear();
1112  m_candL1EtSum->clear();
1113 
1114  m_candL1EG->setBXRange( m_bxFirst_, m_bxLast_ );
1115  m_candL1Tau->setBXRange( m_bxFirst_, m_bxLast_ );
1116  m_candL1Jet->setBXRange( m_bxFirst_, m_bxLast_ );
1117  m_candL1EtSum->setBXRange( m_bxFirst_, m_bxLast_ );
1118 
1119 }
int m_bxFirst_
Definition: GtBoard.h:253
BXVector< const l1t::EtSum * > * m_candL1EtSum
Definition: GtBoard.h:245
BXVector< const l1t::L1Candidate * > * m_candL1EG
Definition: GtBoard.h:242
int m_bxLast_
Definition: GtBoard.h:254
BXVector< const l1t::L1Candidate * > * m_candL1Tau
Definition: GtBoard.h:243
BXVector< const l1t::L1Candidate * > * m_candL1Jet
Definition: GtBoard.h:244
void GtBoard::resetExternal ( )

Definition at line 1121 of file GtBoard.cc.

1121  {
1122 
1125 
1126 }
int m_bxFirst_
Definition: GtBoard.h:253
BXVector< const GlobalExtBlk * > * m_candL1External
Definition: GtBoard.h:246
int m_bxLast_
Definition: GtBoard.h:254
void clear()
void setBXRange(int bxFirst, int bxLast)
void GtBoard::resetMu ( )

Definition at line 1099 of file GtBoard.cc.

1099  {
1100 
1101  m_candL1Mu->clear();
1102  m_candL1Mu->setBXRange( m_bxFirst_, m_bxLast_ );
1103 
1104 }
BXVector< const l1t::Muon * > * m_candL1Mu
Definition: GtBoard.h:241
int m_bxFirst_
Definition: GtBoard.h:253
int m_bxLast_
Definition: GtBoard.h:254
void GtBoard::runFDL ( edm::Event iEvent,
const int  iBxInEvent,
const int  totalBxInEvent,
const unsigned int  numberPhysTriggers,
const std::vector< int > &  prescaleFactorsAlgoTrig,
const std::vector< unsigned int > &  triggerMaskAlgoTrig,
const std::vector< unsigned int > &  triggerMaskVetoAlgoTrig,
const bool  algorithmTriggersUnprescaled,
const bool  algorithmTriggersUnmasked 
)

run the uGT FDL (Apply Prescales and Veto)

if we are masking.

Definition at line 896 of file GtBoard.cc.

References LogDebug.

Referenced by L1TGlobalProducer::produce().

904  {
905 
906 
907  if (m_verbosity) {
908  LogDebug("l1t|Global")
909  << "\n**** GtBoard apply Final Decision Logic "
910  << std::endl;
911 
912  }
913 
914 
915  // prescale counters are reset at the beginning of the luminosity segment
916  if( m_firstEv ){
917  // prescale counters: numberPhysTriggers counters per bunch cross
918  m_prescaleCounterAlgoTrig.reserve(numberPhysTriggers*totalBxInEvent);
919 
920  for( int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent ){
921  m_prescaleCounterAlgoTrig.push_back(prescaleFactorsAlgoTrig);
922  }
923  m_firstEv = false;
924  }
925 
926  // TODO FIXME find the beginning of the luminosity segment
927  if( m_firstEvLumiSegment ){
928 
930  for( int iBxInEvent = 0; iBxInEvent <= totalBxInEvent; ++iBxInEvent ){
931  m_prescaleCounterAlgoTrig.push_back(prescaleFactorsAlgoTrig);
932  }
933 
934  m_firstEvLumiSegment = false;
935  }
936 
937  // Copy Algorithm bits to Prescaled word
938  // Prescaling and Masking done below if requested.
940 
941 
942  // -------------------------------------------
943  // Apply Prescales or skip if turned off
944  // -------------------------------------------
945  if( !algorithmTriggersUnprescaled ){
946 
947  // iBxInEvent is ... -2 -1 0 1 2 ... while counters are 0 1 2 3 4 ...
948  int inBxInEvent = totalBxInEvent/2 + iBxInEvent;
949 
950  bool temp_algPrescaledOr = false;
951  for( unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit ){
952 
953  bool bitValue = m_uGtAlgBlk.getAlgoDecisionInitial( iBit );
954  if( bitValue ){
955  if( prescaleFactorsAlgoTrig.at(iBit) != 1 ){
956 
957  (m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit))--;
958  if( m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit) == 0 ){
959 
960  // bit already true in algoDecisionWord, just reset counter
961  m_prescaleCounterAlgoTrig.at(inBxInEvent).at(iBit) = prescaleFactorsAlgoTrig.at(iBit);
962  temp_algPrescaledOr = true;
963  }
964  else {
965 
966  // change bit to false in prescaled word and final decision word
968 
969  } //if Prescale counter reached zero
970  } //if prescale factor is not 1 (ie. no prescale)
971  else {
972 
973  temp_algPrescaledOr = true;
974  }
975  } //if algo bit is set true
976  } //loop over alg bits
977 
978  m_algPrescaledOr = temp_algPrescaledOr; //temp
979 
980  }
981  else {
982  // Since not Prescaling just take OR of Initial Work
984 
985  }//if we are going to apply prescales.
986 
987 
988  // Copy Algorithm bits fron Prescaled word to Final Word
989  // Masking done below if requested.
991 
992  if( !algorithmTriggersUnmasked ){
993 
994  bool temp_algFinalOr = false;
995  for( unsigned int iBit = 0; iBit < numberPhysTriggers; ++iBit ){
996 
997  bool bitValue = m_uGtAlgBlk.getAlgoDecisionPreScaled( iBit );
998 
999  if( bitValue ){
1000  bool isMasked = ( triggerMaskAlgoTrig.at(iBit) == 0 );
1001 
1002  bool passMask = ( bitValue && !isMasked );
1003 
1004  if( passMask ) temp_algFinalOr = true;
1005  else m_uGtAlgBlk.setAlgoDecisionFinal(iBit,false);
1006 
1007  // Check if veto mask is true, if it is, set the event veto flag.
1008  if ( triggerMaskVetoAlgoTrig.at(iBit) == 1 ) m_algFinalOrVeto = true;
1009 
1010  }
1011  }
1012 
1013  m_algFinalOrPreVeto = temp_algFinalOr;
1014 
1015  }
1016  else {
1017 
1019 
1020  }
1021 
1022 // Set FinalOR for this board
1024 
1025 
1026 
1027 }
#define LogDebug(id)
int m_verbosity
verbosity level
Definition: GtBoard.h:274
GlobalAlgBlk m_uGtAlgBlk
Definition: GtBoard.h:259
bool m_algFinalOrVeto
Definition: GtBoard.h:281
bool m_firstEvLumiSegment
Definition: GtBoard.h:269
bool m_firstEv
Definition: GtBoard.h:268
bool getAlgoDecisionInitial(unsigned int bit) const
Get decision bits.
bool m_algFinalOr
Definition: GtBoard.h:280
void setAlgoDecisionPreScaled(unsigned int bit, bool val)
void copyPrescaledToFinal()
Definition: GlobalAlgBlk.h:73
bool m_algInitialOr
Definition: GtBoard.h:278
std::vector< std::vector< int > > m_prescaleCounterAlgoTrig
prescale counters: NumberPhysTriggers counters per bunch cross in event
Definition: GtBoard.h:266
void copyInitialToPrescaled()
Copy vectors words.
Definition: GlobalAlgBlk.h:72
bool m_algPrescaledOr
Definition: GtBoard.h:279
bool m_algFinalOrPreVeto
Definition: GtBoard.h:282
void setAlgoDecisionFinal(unsigned int bit, bool val)
bool getAlgoDecisionPreScaled(unsigned int bit) const
void GtBoard::runGTL ( edm::Event iEvent,
const edm::EventSetup evSetup,
const TriggerMenu m_l1GtMenu,
const bool  produceL1GtObjectMapRecord,
const int  iBxInEvent,
std::auto_ptr< L1GlobalTriggerObjectMapRecord > &  gtObjectMapRecord,
const unsigned int  numberPhysTriggers,
const int  nrL1Mu,
const int  nrL1EG,
const int  nrL1Tau,
const int  nrL1Jet,
const int  nrL1JetCounts 
)

run the uGT GTL (Conditions and Algorithms)

DMP Start debugging here

Definition at line 442 of file GtBoard.cc.

References CorrelationTemplate::cond0Category(), CorrelationTemplate::cond0Index(), CorrelationTemplate::cond1Category(), CorrelationTemplate::cond1Index(), l1t::CondCalo, l1t::CondCorrelation, l1t::CondEnergySum, l1t::CondExternal, l1t::CondMuon, l1t::CondNull, TriggerMenu::corCaloTemplate(), TriggerMenu::corEnergySumTemplate(), TriggerMenu::corMuonTemplate(), l1t::AlgorithmEvaluation::evaluateAlgorithm(), l1t::ConditionEvaluation::evaluateConditionStoreResult(), newFWLiteAna::found, l1t::L1TGlobalScales::getScalesName(), l1t::AlgorithmEvaluation::gtAlgoCombinationVector(), l1t::AlgorithmEvaluation::gtAlgoResult(), TriggerMenu::gtAlgorithmMap(), TriggerMenu::gtConditionMap(), TriggerMenu::gtScales(), LogDebug, LogTrace, match(), l1t::AlgorithmEvaluation::operandTokenVector(), reco::print(), l1t::EnergySumCondition::print(), l1t::ExternalCondition::print(), l1t::MuCondition::print(), l1t::CaloCondition::print(), l1t::CorrCondition::print(), l1t::AlgorithmEvaluation::print(), L1GlobalTriggerObjectMap::print(), L1GlobalTriggerObjectMap::setAlgoBitNumber(), L1GlobalTriggerObjectMap::setAlgoGtlResult(), L1GlobalTriggerObjectMap::setAlgoName(), l1t::ConditionEvaluation::setVerbosity(), AlCaHLTBitMon_QueryRunRegistry::string, L1GlobalTriggerObjectMap::swapCombinationVector(), L1GlobalTriggerObjectMap::swapObjectTypeVector(), and L1GlobalTriggerObjectMap::swapOperandTokenVector().

Referenced by L1TGlobalProducer::produce().

452  {
453 
454  const std::vector<ConditionMap>& conditionMap = m_l1GtMenu->gtConditionMap();
455  const AlgorithmMap& algorithmMap = m_l1GtMenu->gtAlgorithmMap();
456  const L1TGlobalScales& gtScales = m_l1GtMenu->gtScales();
457  const std::string scaleSetName = gtScales.getScalesName();
458  LogDebug("L1TGlobal") << " L1 Menu Scales -- Set Name: " << scaleSetName << std::endl;
459 
460  // Reset AlgBlk for this bx
461  m_uGtAlgBlk.reset();
462  m_uGtExtBlk.reset();
463  m_algInitialOr=false;
464  m_algPrescaledOr=false;
465  m_algFinalOrPreVeto=false;
466  m_algFinalOr=false;
467  m_algFinalOrVeto=false;
468 
469 
470  const std::vector<std::vector<MuonTemplate> >& corrMuon =
471  m_l1GtMenu->corMuonTemplate();
472 
473  // Comment out for now
474  const std::vector<std::vector<CaloTemplate> >& corrCalo =
475  m_l1GtMenu->corCaloTemplate();
476 
477  const std::vector<std::vector<EnergySumTemplate> >& corrEnergySum =
478  m_l1GtMenu->corEnergySumTemplate();
479 
480  LogDebug("L1TGlobal") << "Size corrMuon " << corrMuon.size()
481  << "\nSize corrCalo " << corrCalo.size()
482  << "\nSize corrSums " << corrEnergySum.size() << std::endl;
483 
484 
485  // conversion needed for correlation conditions
486  // done in the condition loop when the first correlation template is in the menu
487  bool convertScale = false;
488 
489 /* BLW Comment out
490  // get / update the calorimeter geometry from the EventSetup
491  // local cache & check on cacheIdentifier
492  unsigned long long l1CaloGeometryCacheID =
493  evSetup.get<L1CaloGeometryRecord>().cacheIdentifier();
494 
495 
496  if (m_l1CaloGeometryCacheID != l1CaloGeometryCacheID) {
497 
498  edm::ESHandle<L1CaloGeometry> l1CaloGeometry;
499  evSetup.get<L1CaloGeometryRecord>().get(l1CaloGeometry) ;
500  m_l1CaloGeometry = l1CaloGeometry.product();
501 
502  m_l1CaloGeometryCacheID = l1CaloGeometryCacheID;
503  convertScale = true;
504 
505  }
506 
507  // get / update the eta and phi muon trigger scales from the EventSetup
508  // local cache & check on cacheIdentifier
509  unsigned long long l1MuTriggerScalesCacheID =
510  evSetup.get<L1MuTriggerScalesRcd>().cacheIdentifier();
511 
512  if (m_l1MuTriggerScalesCacheID != l1MuTriggerScalesCacheID) {
513 
514  edm::ESHandle< L1MuTriggerScales> l1MuTriggerScales;
515  evSetup.get< L1MuTriggerScalesRcd>().get(l1MuTriggerScales);
516  m_l1MuTriggerScales = l1MuTriggerScales.product();
517 
518  m_l1MuTriggerScalesCacheID = l1MuTriggerScalesCacheID;
519  convertScale = true;
520  }
521 */
522  if (convertScale) {
523 
524 /* Comment out for now
525  m_gtEtaPhiConversions->setVerbosity(m_verbosity);
526  m_gtEtaPhiConversions->convertL1Scales(m_l1CaloGeometry,
527  m_l1MuTriggerScales, ifCaloEtaNumberBits, ifMuEtaNumberBits);
528 
529  // print the conversions if DEBUG and verbosity enabled
530 
531  if (m_verbosity && m_isDebugEnabled) {
532  std::ostringstream myCout;
533  m_gtEtaPhiConversions->print(myCout);
534 
535  LogTrace("l1t|Global") << myCout.str() << std::endl;
536  }
537 
538  // set convertScale to false to avoid executing the conversion
539  // more than once - in case the scales change it will be set to true
540  // in the cache check
541 */
542  convertScale = false;
543  }
544 
545 
546  // loop over condition maps (one map per condition chip)
547  // then loop over conditions in the map
548  // save the results in temporary maps
549 
550  // never happens in production but at first event...
551  if (m_conditionResultMaps.size() != conditionMap.size()) {
552  m_conditionResultMaps.clear();
553  m_conditionResultMaps.resize(conditionMap.size());
554  }
555 
556  int iChip = -1;
557 
558  for (std::vector<ConditionMap>::const_iterator
559  itCondOnChip = conditionMap.begin(); itCondOnChip != conditionMap.end(); itCondOnChip++) {
560 
561  iChip++;
562 
563 // blw was this commented out before?
564  //AlgorithmEvaluation::ConditionEvaluationMap cMapResults;
565  // AlgorithmEvaluation::ConditionEvaluationMap cMapResults((*itCondOnChip).size()); // hash map
566 
568  m_conditionResultMaps[iChip];
569 
570 
571 
572  for (CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {
573 
574  // evaluate condition
575  switch ((itCond->second)->condCategory()) {
576  case CondMuon: {
577 
578  // BLW Not sure what to do with this for now
579  const int ifMuEtaNumberBits = 0;
580 
581  MuCondition* muCondition = new MuCondition(itCond->second, this,
582  nrL1Mu, ifMuEtaNumberBits);
583 
584  muCondition->setVerbosity(m_verbosity);
585  // BLW Comment out for now
586  // muCondition->setGtCorrParDeltaPhiNrBins(
587  // (m_gtEtaPhiConversions->gtObjectNrBinsPhi(Mu)) / 2
588  // + 1);
589  // BLW Need to pass the bx we are working on.
590  muCondition->evaluateConditionStoreResult(iBxInEvent);
591 
592  // BLW COmment out for now
593  cMapResults[itCond->first] = muCondition;
594 
595  if (m_verbosity && m_isDebugEnabled) {
596  std::ostringstream myCout;
597  muCondition->print(myCout);
598 
599  LogTrace("l1t|Global") << myCout.str() << std::endl;
600  }
601  //delete muCondition;
602 
603  }
604  break;
605  case CondCalo: {
606 
607  // BLW Not sure w hat to do with this for now
608  const int ifCaloEtaNumberBits = 0;
609 
610  CaloCondition* caloCondition = new CaloCondition(
611  itCond->second, this,
612  nrL1EG,
613  nrL1Jet,
614  nrL1Tau,
615  ifCaloEtaNumberBits);
616 
617  caloCondition->setVerbosity(m_verbosity);
618 
619  // BLW COmment out for Now
620  //caloCondition->setGtCorrParDeltaPhiNrBins(
621  // (m_gtEtaPhiConversions->gtObjectNrBinsPhi(
622  // ((itCond->second)->objectType())[0])) / 2
623  // + 1);
624  caloCondition->evaluateConditionStoreResult(iBxInEvent);
625 
626  // BLW Comment out for now
627  cMapResults[itCond->first] = caloCondition;
628 
629  if (m_verbosity && m_isDebugEnabled) {
630  std::ostringstream myCout;
631  caloCondition->print(myCout);
632 
633  LogTrace("l1t|Global") << myCout.str() << std::endl;
634  }
635  // delete caloCondition;
636 
637  }
638  break;
639  case CondEnergySum: {
640 
641  EnergySumCondition* eSumCondition = new EnergySumCondition(
642  itCond->second, this);
643 
644  eSumCondition->setVerbosity(m_verbosity);
645  eSumCondition->evaluateConditionStoreResult(iBxInEvent);
646 
647  cMapResults[itCond->first] = eSumCondition;
648 
649  if (m_verbosity && m_isDebugEnabled) {
650  std::ostringstream myCout;
651  eSumCondition->print(myCout);
652 
653  LogTrace("l1t|Global") << myCout.str() << std::endl;
654  }
655  // delete eSumCondition;
656 
657  }
658  break;
659 
660  case CondExternal: {
661 
662  ExternalCondition* extCondition = new ExternalCondition(
663  itCond->second, this);
664 
665  extCondition->setVerbosity(m_verbosity);
666  extCondition->evaluateConditionStoreResult(iBxInEvent);
667 
668  cMapResults[itCond->first] = extCondition;
669 
670  if (m_verbosity && m_isDebugEnabled) {
671  std::ostringstream myCout;
672  extCondition->print(myCout);
673 
674  LogTrace("l1t|Global") << myCout.str() << std::endl;
675  }
676  // delete extCondition;
677 
678 
679  }
680  break;
681  case CondCorrelation: {
682 
683 
684 
685 
686  // get first the sub-conditions
687  const CorrelationTemplate* corrTemplate =
688  static_cast<const CorrelationTemplate*>(itCond->second);
689  const GtConditionCategory cond0Categ = corrTemplate->cond0Category();
690  const GtConditionCategory cond1Categ = corrTemplate->cond1Category();
691  const int cond0Ind = corrTemplate->cond0Index();
692  const int cond1Ind = corrTemplate->cond1Index();
693 
694  const GtCondition* cond0Condition = 0;
695  const GtCondition* cond1Condition = 0;
696 
697  // maximum number of objects received for evaluation of l1t::Type1s condition
698  int cond0NrL1Objects = 0;
699  int cond1NrL1Objects = 0;
700  LogDebug("l1t|Global") << " cond0NrL1Objects" << cond0NrL1Objects << " cond1NrL1Objects " << cond1NrL1Objects << std::endl;
701 
702 
703 //BLW int cond0EtaBits = 0;
704 // int cond1EtaBits = 0;
705 
706  switch (cond0Categ) {
707  case CondMuon: {
708  cond0Condition = &((corrMuon[iChip])[cond0Ind]);
709 // cond0NrL1Objects = nrL1Mu;
710 //BLW cond0EtaBits = ifMuEtaNumberBits;
711  }
712  break;
713  case CondCalo: {
714  cond0Condition = &((corrCalo[iChip])[cond0Ind]);
715  }
716  break;
717  case CondEnergySum: {
718  cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
719 // cond0NrL1Objects = 1;
720  }
721  break;
722  default: {
723  // do nothing, should not arrive here
724  }
725  break;
726  }
727 
728  switch (cond1Categ) {
729  case CondMuon: {
730  cond1Condition = &((corrMuon[iChip])[cond1Ind]);
731 // cond1NrL1Objects = nrL1Mu;
732 //BLW cond1EtaBits = ifMuEtaNumberBits;
733  }
734  break;
735  case CondCalo: {
736  cond1Condition = &((corrCalo[iChip])[cond1Ind]);
737  }
738  break;
739  case CondEnergySum: {
740  cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
741 // cond1NrL1Objects = 1;
742  }
743  break;
744  default: {
745  // do nothing, should not arrive here
746  }
747  break;
748  }
749 
750  CorrCondition* correlationCond =
751  new CorrCondition(itCond->second, cond0Condition, cond1Condition, this);
752 
753  correlationCond->setVerbosity(m_verbosity);
754  correlationCond->evaluateConditionStoreResult(iBxInEvent);
755 
756  cMapResults[itCond->first] = correlationCond;
757 
758  if (m_verbosity && m_isDebugEnabled) {
759  std::ostringstream myCout;
760  correlationCond->print(myCout);
761 
762  LogTrace("l1t|Global") << myCout.str() << std::endl;
763  }
764 
765  // delete correlationCond;
766 
767 
768  }
769  break;
770  case CondNull: {
771 
772  // do nothing
773 
774  }
775  break;
776  default: {
777  // do nothing
778 
779  }
780  break;
781  }
782 
783  }
784 
785  }
786 
787  // loop over algorithm map
789  // empty vector for object maps - filled during loop
790  std::vector<L1GlobalTriggerObjectMap> objMapVec;
791  if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) objMapVec.reserve(numberPhysTriggers);
792 
793  for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {
794  AlgorithmEvaluation gtAlg(itAlgo->second);
795  gtAlg.evaluateAlgorithm((itAlgo->second).algoChipNumber(), m_conditionResultMaps);
796 
797  int algBitNumber = (itAlgo->second).algoBitNumber();
798  bool algResult = gtAlg.gtAlgoResult();
799 
800  LogDebug("l1t|Global") << " ===> for iBxInEvent = " << iBxInEvent << ":\t algBitName = " << itAlgo->first << ",\t algBitNumber = " << algBitNumber << ",\t algResult = " << algResult << std::endl;
801 
802  if (algResult) {
803 // m_gtlAlgorithmOR.set(algBitNumber);
804  m_uGtAlgBlk.setAlgoDecisionInitial(algBitNumber,algResult);
805  m_algInitialOr = true;
806  }
807 
808  if (m_verbosity && m_isDebugEnabled) {
809  std::ostringstream myCout;
810  ( itAlgo->second ).print(myCout);
811  gtAlg.print(myCout);
812 
813  LogTrace("l1t|Global") << myCout.str() << std::endl;
814  }
815 
816 
817  // object maps only for BxInEvent = 0
818  if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
819 
820  std::vector<ObjectTypeInCond> otypes;
821  for (auto iop = gtAlg.operandTokenVector().begin(); iop != gtAlg.operandTokenVector().end(); ++iop){
822  //cout << "INFO: operand name: " << iop->tokenName << "\n";
823  int myChip = -1;
824  int found =0;
825  ObjectTypeInCond otype;
826  for (auto imap = conditionMap.begin(); imap != conditionMap.end(); imap++) {
827  myChip++;
828  auto match = imap->find(iop->tokenName);
829 
830  if (match != imap->end()){
831  found = 1;
832  //cout << "DEBUG: found match for " << iop->tokenName << " at " << match->first << "\n";
833  otype = match->second->objectType();
834  for (auto itype = otype.begin(); itype != otype.end() ; itype++){
835  //cout << "type: " << *itype << "\n";
836  }
837  }
838  }
839  if (!found){
840  edm::LogWarning("l1t|Global") << "\n Failed to find match for operand token " << iop->tokenName << "\n";
841  } else {
842  otypes.push_back(otype);
843  }
844  }
845 
846  // set object map
848 
849  objMap.setAlgoName(itAlgo->first);
850  objMap.setAlgoBitNumber(algBitNumber);
851  objMap.setAlgoGtlResult(algResult);
852  objMap.swapOperandTokenVector(gtAlg.operandTokenVector());
853  objMap.swapCombinationVector(gtAlg.gtAlgoCombinationVector());
854  // gtAlg is empty now...
855  objMap.swapObjectTypeVector(otypes);
856 
857  if (m_verbosity && m_isDebugEnabled) {
858  std::ostringstream myCout1;
859  objMap.print(myCout1);
860 
861  LogTrace("l1t|Global") << myCout1.str() << std::endl;
862  }
863 
864  objMapVec.push_back(objMap);
865 
866  }
867 
868 
869  }
870 
871  // object maps only for BxInEvent = 0
872  if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
873  gtObjectMapRecord->swapGtObjectMap(objMapVec);
874  }
875 
876  // loop over condition maps (one map per condition chip)
877  // then loop over conditions in the map
878  // delete the conditions created with new, zero pointer, do not clear map, keep the vector as is...
879  for (std::vector<AlgorithmEvaluation::ConditionEvaluationMap>::iterator
880  itCondOnChip = m_conditionResultMaps.begin();
881  itCondOnChip != m_conditionResultMaps.end(); itCondOnChip++) {
882 
884  itCond = itCondOnChip->begin();
885  itCond != itCondOnChip->end(); itCond++) {
886 
887  delete itCond->second;
888  itCond->second = 0;
889  }
890  }
891 
892 }
#define LogDebug(id)
GlobalExtBlk m_uGtExtBlk
Definition: GtBoard.h:260
std::vector< AlgorithmEvaluation::ConditionEvaluationMap > m_conditionResultMaps
Definition: GtBoard.h:263
int m_verbosity
verbosity level
Definition: GtBoard.h:274
GlobalAlgBlk m_uGtAlgBlk
Definition: GtBoard.h:259
void reset()
reset the content of a GlobalExtBlk
Definition: GlobalExtBlk.cc:75
void swapCombinationVector(std::vector< CombinationsInCond > &combinationVectorValue)
void setAlgoDecisionInitial(unsigned int bit, bool val)
Set decision bits.
Definition: GlobalAlgBlk.cc:89
void setAlgoName(const std::string &algoNameValue)
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:10
ConditionMap::const_iterator CItCond
iterators through map containing the conditions
bool m_algFinalOrVeto
Definition: GtBoard.h:281
const l1t::GtConditionCategory cond0Category() const
get / set the category of the two sub-conditions
__gnu_cxx::hash_map< std::string, ConditionEvaluation * > ConditionEvaluationMap
copy constructor
const std::vector< std::vector< EnergySumTemplate > > & corEnergySumTemplate() const
Definition: TriggerMenu.h:172
void swapOperandTokenVector(std::vector< L1GtLogicParser::OperandToken > &operandTokenVectorValue)
ConditionEvaluationMap::iterator ItEvalMap
bool m_algFinalOr
Definition: GtBoard.h:280
const l1t::L1TGlobalScales & gtScales() const
get the scales
Definition: TriggerMenu.h:197
const std::vector< std::vector< CaloTemplate > > & corCaloTemplate() const
Definition: TriggerMenu.h:163
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
GtConditionCategory
condition categories
bool m_isDebugEnabled
Definition: GtBoard.h:275
const l1t::GtConditionCategory cond1Category() const
bool m_algInitialOr
Definition: GtBoard.h:278
void reset()
reset the content of a GlobalAlgBlk
void print(std::ostream &myCout) const
print the full object map
const int cond0Index() const
get / set the index of the two sub-conditions in the cor* vector from menu
const l1t::AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
Definition: TriggerMenu.h:182
const int cond1Index() const
const std::vector< l1t::ConditionMap > & gtConditionMap() const
get / set / build the condition maps
Definition: TriggerMenu.h:76
#define LogTrace(id)
std::vector< L1GtObject > ObjectTypeInCond
void setAlgoGtlResult(bool algoGtlResultValue)
bool m_algPrescaledOr
Definition: GtBoard.h:279
void setAlgoBitNumber(int algoBitNumberValue)
void swapObjectTypeVector(std::vector< ObjectTypeInCond > &objectTypeVectorValue)
bool m_algFinalOrPreVeto
Definition: GtBoard.h:282
const std::vector< std::vector< MuonTemplate > > & corMuonTemplate() const
Definition: TriggerMenu.h:156
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
void GtBoard::setBxFirst ( int  bx)

Definition at line 121 of file GtBoard.cc.

121  {
122 
123  m_bxFirst_ = bx;
124 
125 }
int m_bxFirst_
Definition: GtBoard.h:253
void GtBoard::setBxLast ( int  bx)

Definition at line 127 of file GtBoard.cc.

127  {
128 
129  m_bxLast_ = bx;
130 
131 }
int m_bxLast_
Definition: GtBoard.h:254
void l1t::GtBoard::setVerbosity ( const int  verbosity)
inline

Definition at line 217 of file GtBoard.h.

References m_verbosity, and HLT_FULL_cff::verbosity.

Referenced by L1TGlobalProducer::L1TGlobalProducer().

217  {
219  }
int m_verbosity
verbosity level
Definition: GtBoard.h:274

Member Data Documentation

bool l1t::GtBoard::m_algFinalOr
private

Definition at line 280 of file GtBoard.h.

bool l1t::GtBoard::m_algFinalOrPreVeto
private

Definition at line 282 of file GtBoard.h.

bool l1t::GtBoard::m_algFinalOrVeto
private

Definition at line 281 of file GtBoard.h.

bool l1t::GtBoard::m_algInitialOr
private

Definition at line 278 of file GtBoard.h.

bool l1t::GtBoard::m_algPrescaledOr
private

Definition at line 279 of file GtBoard.h.

unsigned int l1t::GtBoard::m_boardEventCount
private

Definition at line 285 of file GtBoard.h.

Referenced by GtBoard().

int l1t::GtBoard::m_bxFirst_
private

Definition at line 253 of file GtBoard.h.

int l1t::GtBoard::m_bxLast_
private

Definition at line 254 of file GtBoard.h.

BXVector<const l1t::L1Candidate*>* l1t::GtBoard::m_candL1EG
private

Definition at line 242 of file GtBoard.h.

Referenced by getCandL1EG().

BXVector<const l1t::EtSum*>* l1t::GtBoard::m_candL1EtSum
private

Definition at line 245 of file GtBoard.h.

Referenced by getCandL1EtSum().

BXVector<const GlobalExtBlk*>* l1t::GtBoard::m_candL1External
private

Definition at line 246 of file GtBoard.h.

Referenced by getCandL1External().

BXVector<const l1t::L1Candidate*>* l1t::GtBoard::m_candL1Jet
private

Definition at line 244 of file GtBoard.h.

Referenced by getCandL1Jet().

BXVector<const l1t::Muon*>* l1t::GtBoard::m_candL1Mu
private

Definition at line 241 of file GtBoard.h.

Referenced by getCandL1Mu().

BXVector<const l1t::L1Candidate*>* l1t::GtBoard::m_candL1Tau
private

Definition at line 243 of file GtBoard.h.

Referenced by getCandL1Tau().

std::vector<AlgorithmEvaluation::ConditionEvaluationMap> l1t::GtBoard::m_conditionResultMaps
private

Definition at line 263 of file GtBoard.h.

bool l1t::GtBoard::m_firstEv
private

Definition at line 268 of file GtBoard.h.

bool l1t::GtBoard::m_firstEvLumiSegment
private

Definition at line 269 of file GtBoard.h.

std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers> l1t::GtBoard::m_gtlAlgorithmOR
private

Definition at line 256 of file GtBoard.h.

Referenced by getAlgorithmOR(), and GtBoard().

std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers> l1t::GtBoard::m_gtlDecisionWord
private

Definition at line 257 of file GtBoard.h.

Referenced by getDecisionWord(), and GtBoard().

bool l1t::GtBoard::m_isDebugEnabled
private

Definition at line 275 of file GtBoard.h.

const L1CaloGeometry* l1t::GtBoard::m_l1CaloGeometry
private

Definition at line 230 of file GtBoard.h.

unsigned long long l1t::GtBoard::m_l1CaloGeometryCacheID
private

Definition at line 231 of file GtBoard.h.

Referenced by GtBoard().

const TriggerMenu* l1t::GtBoard::m_l1GtMenu
private

Definition at line 226 of file GtBoard.h.

unsigned long long l1t::GtBoard::m_l1GtMenuCacheID
private

Definition at line 227 of file GtBoard.h.

Referenced by GtBoard().

const L1MuTriggerScales* l1t::GtBoard::m_l1MuTriggerScales
private

Definition at line 233 of file GtBoard.h.

unsigned long long l1t::GtBoard::m_l1MuTriggerScalesCacheID
private

Definition at line 234 of file GtBoard.h.

Referenced by GtBoard().

std::vector<std::vector<int> > l1t::GtBoard::m_prescaleCounterAlgoTrig
private

prescale counters: NumberPhysTriggers counters per bunch cross in event

Definition at line 266 of file GtBoard.h.

GlobalAlgBlk l1t::GtBoard::m_uGtAlgBlk
private

Definition at line 259 of file GtBoard.h.

Referenced by GtBoard().

int l1t::GtBoard::m_uGtBoardNumber
private

Definition at line 288 of file GtBoard.h.

Referenced by GtBoard().

GlobalExtBlk l1t::GtBoard::m_uGtExtBlk
private

Definition at line 260 of file GtBoard.h.

Referenced by GtBoard().

bool l1t::GtBoard::m_uGtFinalBoard
private

Definition at line 289 of file GtBoard.h.

Referenced by GtBoard().

int l1t::GtBoard::m_verbosity
private

verbosity level

Definition at line 274 of file GtBoard.h.

Referenced by setVerbosity().