CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
l1extra::L1ParticleMap Class Reference

#include <L1ParticleMap.h>

Public Types

typedef std::vector< unsigned int > L1IndexCombo
 
typedef std::vector< L1IndexComboL1IndexComboVector
 
enum  L1ObjectType {
  kEM, kJet, kMuon, kEtMiss,
  kEtTotal, kEtHad, kNumOfL1ObjectTypes
}
 
typedef std::vector< L1ObjectTypeL1ObjectTypeVector
 
enum  L1TriggerType {
  kSingleMu3, kSingleMu5, kSingleMu7, kSingleMu10,
  kSingleMu14, kSingleMu20, kSingleMu25, kSingleIsoEG5,
  kSingleIsoEG8, kSingleIsoEG10, kSingleIsoEG12, kSingleIsoEG15,
  kSingleIsoEG20, kSingleIsoEG25, kSingleEG5, kSingleEG8,
  kSingleEG10, kSingleEG12, kSingleEG15, kSingleEG20,
  kSingleEG25, kSingleJet15, kSingleJet20, kSingleJet30,
  kSingleJet50, kSingleJet70, kSingleJet100, kSingleJet150,
  kSingleJet200, kSingleTauJet10, kSingleTauJet20, kSingleTauJet30,
  kSingleTauJet35, kSingleTauJet40, kSingleTauJet60, kSingleTauJet80,
  kSingleTauJet100, kHTT100, kHTT200, kHTT250,
  kHTT300, kHTT400, kHTT500, kETM10,
  kETM15, kETM20, kETM30, kETM40,
  kETM50, kETM60, kETT60, kDoubleMu3,
  kDoubleIsoEG8, kDoubleIsoEG10, kDoubleEG5, kDoubleEG10,
  kDoubleEG15, kDoubleJet70, kDoubleJet100, kDoubleTauJet20,
  kDoubleTauJet30, kDoubleTauJet35, kDoubleTauJet40, kMu3_IsoEG5,
  kMu5_IsoEG10, kMu3_EG12, kMu3_Jet15, kMu5_Jet15,
  kMu3_Jet70, kMu5_Jet20, kMu5_TauJet20, kMu5_TauJet30,
  kIsoEG10_EG10, kIsoEG10_Jet15, kIsoEG10_Jet20, kIsoEG10_Jet30,
  kIsoEG10_Jet70, kIsoEG10_TauJet20, kIsoEG10_TauJet30, kEG10_Jet15,
  kEG12_Jet20, kEG12_Jet70, kEG12_TauJet40, kJet70_TauJet40,
  kMu3_HTT200, kIsoEG10_HTT200, kEG12_HTT200, kJet70_HTT200,
  kTauJet40_HTT200, kMu3_ETM30, kIsoEG10_ETM30, kEG12_ETM30,
  kJet70_ETM40, kTauJet20_ETM20, kTauJet30_ETM30, kTauJet30_ETM40,
  kHTT100_ETM30, kTripleMu3, kTripleIsoEG5, kTripleEG10,
  kTripleJet50, kTripleTauJet40, kDoubleMu3_IsoEG5, kDoubleMu3_EG10,
  kDoubleIsoEG5_Mu3, kDoubleEG10_Mu3, kDoubleMu3_HTT200, kDoubleIsoEG5_HTT200,
  kDoubleEG10_HTT200, kDoubleJet50_HTT200, kDoubleTauJet40_HTT200, kDoubleMu3_ETM20,
  kDoubleIsoEG5_ETM20, kDoubleEG10_ETM20, kDoubleJet50_ETM20, kDoubleTauJet40_ETM20,
  kQuadJet30, kExclusiveDoubleIsoEG4, kExclusiveDoubleJet60, kExclusiveJet25_Gap_Jet25,
  kIsoEG10_Jet20_ForJet10, kMinBias_HTT10, kZeroBias, kNumOfL1TriggerTypes
}
 

Public Member Functions

std::vector< const reco::LeafCandidate * > candidateCombo (const L1IndexCombo &aCombo) const
 
const reco::LeafCandidatecandidateInCombo (int aIndexInCombo, const L1IndexCombo &aCombo) const
 
const L1EmParticleemParticleInCombo (int aIndexInCombo, const L1IndexCombo &aCombo) const
 
const L1EmParticleVectorRefemParticles () const
 
const L1EtMissParticleRefProdetMissParticle () const
 
const L1EtMissParticleetMissParticleInCombo (int aIndexInCombo, const L1IndexCombo &aCombo) const
 
const L1IndexComboVectorindexCombos () const
 
const L1JetParticlejetParticleInCombo (int aIndexInCombo, const L1IndexCombo &aCombo) const
 
const L1JetParticleVectorRefjetParticles () const
 
 L1ParticleMap ()
 
 L1ParticleMap (L1TriggerType triggerType, bool triggerDecision, const L1ObjectTypeVector &objectTypes, const L1EmParticleVectorRef &emParticles=L1EmParticleVectorRef(), const L1JetParticleVectorRef &jetParticles=L1JetParticleVectorRef(), const L1MuonParticleVectorRef &muonParticles=L1MuonParticleVectorRef(), const L1EtMissParticleRefProd &etMissParticle=L1EtMissParticleRefProd(), const L1IndexComboVector &indexCombos=L1IndexComboVector())
 
 L1ParticleMap (const L1ParticleMap &)
 
const L1MuonParticlemuonParticleInCombo (int aIndexInCombo, const L1IndexCombo &aCombo) const
 
const L1MuonParticleVectorRefmuonParticles () const
 
int numOfObjects () const
 
const L1ObjectTypeVectorobjectTypes () const
 
L1ParticleMapoperator= (const L1ParticleMap &)
 
void swap (L1ParticleMap &)
 
bool triggerDecision () const
 
const std::string & triggerName () const
 
L1TriggerType triggerType () const
 
virtual ~L1ParticleMap ()
 

Static Public Member Functions

static bool objectTypeIsGlobal (L1ObjectType type)
 
static const std::string & triggerName (L1TriggerType type)
 
static L1TriggerType triggerType (const std::string &name)
 

Private Member Functions

void setIndexCombos () const
 

Private Attributes

L1EmParticleVectorRef emParticles_
 
L1EtMissParticleRefProd etMissParticle_
 
L1IndexComboVector indexCombos_
 
std::atomic< char > indexCombosState_
 
L1JetParticleVectorRef jetParticles_
 
L1MuonParticleVectorRef muonParticles_
 
L1ObjectTypeVector objectTypes_
 
bool triggerDecision_
 
L1TriggerType triggerType_
 

Static Private Attributes

static const std::string triggerNames_ [kNumOfL1TriggerTypes]
 

Detailed Description

Definition at line 117 of file L1ParticleMap.h.

Member Typedef Documentation

typedef std::vector< unsigned int > l1extra::L1ParticleMap::L1IndexCombo

Definition at line 266 of file L1ParticleMap.h.

Definition at line 267 of file L1ParticleMap.h.

Definition at line 268 of file L1ParticleMap.h.

Member Enumeration Documentation

Enumerator
kEM 
kJet 
kMuon 
kEtMiss 
kEtTotal 
kEtHad 
kNumOfL1ObjectTypes 

Definition at line 121 of file L1ParticleMap.h.

Enumerator
kSingleMu3 
kSingleMu5 
kSingleMu7 
kSingleMu10 
kSingleMu14 
kSingleMu20 
kSingleMu25 
kSingleIsoEG5 
kSingleIsoEG8 
kSingleIsoEG10 
kSingleIsoEG12 
kSingleIsoEG15 
kSingleIsoEG20 
kSingleIsoEG25 
kSingleEG5 
kSingleEG8 
kSingleEG10 
kSingleEG12 
kSingleEG15 
kSingleEG20 
kSingleEG25 
kSingleJet15 
kSingleJet20 
kSingleJet30 
kSingleJet50 
kSingleJet70 
kSingleJet100 
kSingleJet150 
kSingleJet200 
kSingleTauJet10 
kSingleTauJet20 
kSingleTauJet30 
kSingleTauJet35 
kSingleTauJet40 
kSingleTauJet60 
kSingleTauJet80 
kSingleTauJet100 
kHTT100 
kHTT200 
kHTT250 
kHTT300 
kHTT400 
kHTT500 
kETM10 
kETM15 
kETM20 
kETM30 
kETM40 
kETM50 
kETM60 
kETT60 
kDoubleMu3 
kDoubleIsoEG8 
kDoubleIsoEG10 
kDoubleEG5 
kDoubleEG10 
kDoubleEG15 
kDoubleJet70 
kDoubleJet100 
kDoubleTauJet20 
kDoubleTauJet30 
kDoubleTauJet35 
kDoubleTauJet40 
kMu3_IsoEG5 
kMu5_IsoEG10 
kMu3_EG12 
kMu3_Jet15 
kMu5_Jet15 
kMu3_Jet70 
kMu5_Jet20 
kMu5_TauJet20 
kMu5_TauJet30 
kIsoEG10_EG10 
kIsoEG10_Jet15 
kIsoEG10_Jet20 
kIsoEG10_Jet30 
kIsoEG10_Jet70 
kIsoEG10_TauJet20 
kIsoEG10_TauJet30 
kEG10_Jet15 
kEG12_Jet20 
kEG12_Jet70 
kEG12_TauJet40 
kJet70_TauJet40 
kMu3_HTT200 
kIsoEG10_HTT200 
kEG12_HTT200 
kJet70_HTT200 
kTauJet40_HTT200 
kMu3_ETM30 
kIsoEG10_ETM30 
kEG12_ETM30 
kJet70_ETM40 
kTauJet20_ETM20 
kTauJet30_ETM30 
kTauJet30_ETM40 
kHTT100_ETM30 
kTripleMu3 
kTripleIsoEG5 
kTripleEG10 
kTripleJet50 
kTripleTauJet40 
kDoubleMu3_IsoEG5 
kDoubleMu3_EG10 
kDoubleIsoEG5_Mu3 
kDoubleEG10_Mu3 
kDoubleMu3_HTT200 
kDoubleIsoEG5_HTT200 
kDoubleEG10_HTT200 
kDoubleJet50_HTT200 
kDoubleTauJet40_HTT200 
kDoubleMu3_ETM20 
kDoubleIsoEG5_ETM20 
kDoubleEG10_ETM20 
kDoubleJet50_ETM20 
kDoubleTauJet40_ETM20 
kQuadJet30 
kExclusiveDoubleIsoEG4 
kExclusiveDoubleJet60 
kExclusiveJet25_Gap_Jet25 
kIsoEG10_Jet20_ForJet10 
kMinBias_HTT10 
kZeroBias 
kNumOfL1TriggerTypes 

Definition at line 138 of file L1ParticleMap.h.

139  {
140  kSingleMu3,
141  kSingleMu5,
142  kSingleMu7,
143  kSingleMu10,
144  kSingleMu14,
145  kSingleMu20,
146  kSingleMu25,
154  kSingleEG5,
155  kSingleEG8,
156  kSingleEG10,
157  kSingleEG12,
158  kSingleEG15,
159  kSingleEG20,
160  kSingleEG25,
161  kSingleJet15,
162  kSingleJet20,
163  kSingleJet30,
164  kSingleJet50,
165  kSingleJet70,
177  kHTT100,
178  kHTT200,
179  kHTT250,
180  kHTT300,
181  kHTT400,
182  kHTT500,
183  kETM10,
184  kETM15,
185  kETM20,
186  kETM30,
187  kETM40,
188  kETM50,
189  kETM60,
190  kETT60,
191  kDoubleMu3,
194  kDoubleEG5,
195  kDoubleEG10,
196  kDoubleEG15,
197  kDoubleJet70,
203  kMu3_IsoEG5,
204  kMu5_IsoEG10,
205  kMu3_EG12,
206  kMu3_Jet15,
207  kMu5_Jet15,
208  kMu3_Jet70,
209  kMu5_Jet20,
219  kEG10_Jet15,
220  kEG12_Jet20,
221  kEG12_Jet70,
224  kMu3_HTT200,
226  kEG12_HTT200,
229  kMu3_ETM30,
231  kEG12_ETM30,
232  kJet70_ETM40,
237  kTripleMu3,
239  kTripleEG10,
240  kTripleJet50,
256  kQuadJet30,
262  kZeroBias,
264  } ;

Constructor & Destructor Documentation

L1ParticleMap::L1ParticleMap ( )

Definition at line 172 of file L1ParticleMap.cc.

173 {
174 }
L1ParticleMap::L1ParticleMap ( L1TriggerType  triggerType,
bool  triggerDecision,
const L1ObjectTypeVector objectTypes,
const L1EmParticleVectorRef emParticles = L1EmParticleVectorRef(),
const L1JetParticleVectorRef jetParticles = L1JetParticleVectorRef(),
const L1MuonParticleVectorRef muonParticles = L1MuonParticleVectorRef(),
const L1EtMissParticleRefProd etMissParticle = L1EtMissParticleRefProd(),
const L1IndexComboVector indexCombos = L1IndexComboVector() 
)

Definition at line 176 of file L1ParticleMap.cc.

References emParticles(), emParticles_, etMissParticle(), etMissParticle_, indexCombos(), indexCombos_, jetParticles(), jetParticles_, kSet, muonParticles(), muonParticles_, objectTypes(), and objectTypes_.

187  indexCombosState_{static_cast<char>(!indexCombos.empty()? kSet:IndexComboStates::kUnset)},
192  etMissParticle_( etMissParticle ),
194 {
195 }
std::atomic< char > indexCombosState_
L1IndexComboVector indexCombos_
const L1MuonParticleVectorRef & muonParticles() const
const char * kSet
bool triggerDecision() const
const L1EmParticleVectorRef & emParticles() const
L1EtMissParticleRefProd etMissParticle_
const L1JetParticleVectorRef & jetParticles() const
L1EmParticleVectorRef emParticles_
L1MuonParticleVectorRef muonParticles_
L1TriggerType triggerType() const
const L1IndexComboVector & indexCombos() const
L1JetParticleVectorRef jetParticles_
L1ObjectTypeVector objectTypes_
L1TriggerType triggerType_
const L1ObjectTypeVector & objectTypes() const
L1ParticleMap::L1ParticleMap ( const L1ParticleMap rhs)

Definition at line 197 of file L1ParticleMap.cc.

References indexCombos_, indexCombosState_, and kSet.

197  :
200  indexCombosState_(IndexComboStates::kUnset),
206  indexCombos_()
207 {
208  // do actual copying here;
209  if(rhs.indexCombosState_.load(std::memory_order_acquire) == kSet) {
211  indexCombosState_.store(kSet,std::memory_order_release);
212  }
213 }
std::atomic< char > indexCombosState_
L1IndexComboVector indexCombos_
const char * kSet
L1EtMissParticleRefProd etMissParticle_
L1EmParticleVectorRef emParticles_
L1MuonParticleVectorRef muonParticles_
L1JetParticleVectorRef jetParticles_
L1ObjectTypeVector objectTypes_
L1TriggerType triggerType_
L1ParticleMap::~L1ParticleMap ( )
virtual

Definition at line 215 of file L1ParticleMap.cc.

216 {
217 }

Member Function Documentation

std::vector< const reco::LeafCandidate * > L1ParticleMap::candidateCombo ( const L1IndexCombo aCombo) const

Definition at line 446 of file L1ParticleMap.cc.

References candidateInCombo(), mps_fire::i, numOfObjects(), AlCaHLTBitMon_QueryRunRegistry::string, and tmp.

Referenced by etMissParticle().

447 {
448  std::vector< const reco::LeafCandidate* > tmp ;
449 
450  for( int i = 0 ; i < numOfObjects() ; ++i )
451  {
452  tmp.push_back( candidateInCombo( i, aCombo ) ) ;
453  }
454 
455  return tmp ;
456 }
int numOfObjects() const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
const reco::LeafCandidate * candidateInCombo(int aIndexInCombo, const L1IndexCombo &aCombo) const
const reco::LeafCandidate * L1ParticleMap::candidateInCombo ( int  aIndexInCombo,
const L1IndexCombo aCombo 
) const

Definition at line 346 of file L1ParticleMap.cc.

References emParticles_, etMissParticle_, edm::RefProd< C >::get(), jetParticles_, kEM, kEtHad, kEtMiss, kEtTotal, kJet, kMuon, muonParticles_, nullptr, and objectTypes_.

Referenced by candidateCombo(), and etMissParticle().

348 {
349  L1ObjectType type = objectTypes_[ aIndexInCombo ] ;
350  int particleInList = aCombo[ aIndexInCombo ] ;
351 
352  if( type == kEM )
353  {
354  return dynamic_cast< const reco::LeafCandidate* >(
355  emParticles_[ particleInList ].get() ) ;
356  }
357  else if( type == kJet )
358  {
359  return dynamic_cast< const reco::LeafCandidate* >(
360  jetParticles_[ particleInList ].get() ) ;
361  }
362  else if( type == kMuon )
363  {
364  return dynamic_cast< const reco::LeafCandidate* >(
365  muonParticles_[ particleInList ].get() ) ;
366  }
367  else if( type == kEtMiss || type == kEtTotal || type == kEtHad )
368  {
369  return dynamic_cast< const reco::LeafCandidate* >(
370  etMissParticle_.get() ) ;
371  }
372  else
373  {
374  return nullptr ;
375  }
376 }
type
Definition: HCALResponse.h:21
#define nullptr
L1EtMissParticleRefProd etMissParticle_
L1EmParticleVectorRef emParticles_
L1MuonParticleVectorRef muonParticles_
product_type const * get() const
Definition: RefProd.h:113
L1JetParticleVectorRef jetParticles_
L1ObjectTypeVector objectTypes_
const L1EmParticle * L1ParticleMap::emParticleInCombo ( int  aIndexInCombo,
const L1IndexCombo aCombo 
) const

Definition at line 379 of file L1ParticleMap.cc.

References emParticles_, kEM, nullptr, and objectTypes_.

Referenced by etMissParticle().

381 {
382  L1ObjectType type = objectTypes_[ aIndexInCombo ] ;
383  int particleInList = aCombo[ aIndexInCombo ] ;
384 
385  if( type == kEM )
386  {
387  return emParticles_[ particleInList ].get() ;
388  }
389  else
390  {
391  return nullptr ;
392  }
393 }
type
Definition: HCALResponse.h:21
#define nullptr
L1EmParticleVectorRef emParticles_
L1ObjectTypeVector objectTypes_
const L1EmParticleVectorRef& l1extra::L1ParticleMap::emParticles ( ) const
inline

Definition at line 312 of file L1ParticleMap.h.

References emParticles_.

Referenced by L1ParticleMap().

313  { return emParticles_ ; }
L1EmParticleVectorRef emParticles_
const L1EtMissParticleRefProd& l1extra::L1ParticleMap::etMissParticle ( ) const
inline
const L1EtMissParticle * L1ParticleMap::etMissParticleInCombo ( int  aIndexInCombo,
const L1IndexCombo aCombo 
) const

Definition at line 430 of file L1ParticleMap.cc.

References etMissParticle_, edm::RefProd< C >::get(), kEtHad, kEtMiss, kEtTotal, nullptr, and objectTypes_.

Referenced by etMissParticle().

432 {
433  L1ObjectType type = objectTypes_[ aIndexInCombo ] ;
434 
435  if( type == kEtMiss || type == kEtTotal || type == kEtHad )
436  {
437  return etMissParticle_.get() ;
438  }
439  else
440  {
441  return nullptr ;
442  }
443 }
type
Definition: HCALResponse.h:21
#define nullptr
L1EtMissParticleRefProd etMissParticle_
product_type const * get() const
Definition: RefProd.h:113
L1ObjectTypeVector objectTypes_
const L1ParticleMap::L1IndexComboVector & L1ParticleMap::indexCombos ( ) const

Definition at line 252 of file L1ParticleMap.cc.

References indexCombos_, indexCombosState_, kSet, and setIndexCombos().

Referenced by etMissParticle(), and L1ParticleMap().

253 {
254  if(kSet != indexCombosState_.load(std::memory_order_acquire)) {
255  setIndexCombos();
256  }
257  return indexCombos_ ;
258 }
std::atomic< char > indexCombosState_
L1IndexComboVector indexCombos_
const char * kSet
void setIndexCombos() const
const L1JetParticle * L1ParticleMap::jetParticleInCombo ( int  aIndexInCombo,
const L1IndexCombo aCombo 
) const

Definition at line 396 of file L1ParticleMap.cc.

References jetParticles_, kJet, nullptr, and objectTypes_.

Referenced by etMissParticle().

398 {
399  L1ObjectType type = objectTypes_[ aIndexInCombo ] ;
400  int particleInList = aCombo[ aIndexInCombo ] ;
401 
402  if( type == kJet )
403  {
404  return jetParticles_[ particleInList ].get() ;
405  }
406  else
407  {
408  return nullptr ;
409  }
410 }
type
Definition: HCALResponse.h:21
#define nullptr
L1JetParticleVectorRef jetParticles_
L1ObjectTypeVector objectTypes_
const L1JetParticleVectorRef& l1extra::L1ParticleMap::jetParticles ( ) const
inline

Definition at line 315 of file L1ParticleMap.h.

References jetParticles_.

Referenced by L1ParticleMap().

316  { return jetParticles_ ; }
L1JetParticleVectorRef jetParticles_
const L1MuonParticle * L1ParticleMap::muonParticleInCombo ( int  aIndexInCombo,
const L1IndexCombo aCombo 
) const

Definition at line 413 of file L1ParticleMap.cc.

References kMuon, muonParticles_, nullptr, and objectTypes_.

Referenced by etMissParticle().

415 {
416  L1ObjectType type = objectTypes_[ aIndexInCombo ] ;
417  int particleInList = aCombo[ aIndexInCombo ] ;
418 
419  if( type == kMuon )
420  {
421  return muonParticles_[ particleInList ].get() ;
422  }
423  else
424  {
425  return nullptr ;
426  }
427 }
type
Definition: HCALResponse.h:21
#define nullptr
L1MuonParticleVectorRef muonParticles_
L1ObjectTypeVector objectTypes_
const L1MuonParticleVectorRef& l1extra::L1ParticleMap::muonParticles ( ) const
inline

Definition at line 318 of file L1ParticleMap.h.

References muonParticles_.

Referenced by L1ParticleMap().

319  { return muonParticles_ ; }
L1MuonParticleVectorRef muonParticles_
int l1extra::L1ParticleMap::numOfObjects ( ) const
inline

Definition at line 309 of file L1ParticleMap.h.

References objectTypes_.

Referenced by candidateCombo(), and setIndexCombos().

310  { return objectTypes_.size() ; }
L1ObjectTypeVector objectTypes_
bool L1ParticleMap::objectTypeIsGlobal ( L1ObjectType  type)
static
const L1ObjectTypeVector& l1extra::L1ParticleMap::objectTypes ( ) const
inline

Definition at line 305 of file L1ParticleMap.h.

References objectTypes_.

Referenced by L1ParticleMap().

306  { return objectTypes_ ; }
L1ObjectTypeVector objectTypes_
L1ParticleMap & L1ParticleMap::operator= ( const L1ParticleMap rhs)

Definition at line 222 of file L1ParticleMap.cc.

References swap(), and groupFilesInBlocks::temp.

223 {
224  //An exception safe implementation is
225  L1ParticleMap temp(rhs);
226  swap(temp);
227 
228  return *this;
229 }
void swap(L1ParticleMap &)
void L1ParticleMap::setIndexCombos ( ) const
private

Definition at line 261 of file L1ParticleMap.cc.

References emParticles_, mps_fire::i, indexCombos_, indexCombosState_, jetParticles_, kEM, kJet, kMuon, kNumOfL1ObjectTypes, kSet, muonParticles_, numOfObjects(), objectTypeIsGlobal(), and objectTypes_.

Referenced by etMissParticle(), and indexCombos().

261  {
262  // Determine the number of non-global objects. There should be 0 or 1.
263  int numNonGlobal = 0 ;
264  L1ObjectType nonGlobalType = kNumOfL1ObjectTypes ;
265  int nonGlobalIndex = -1 ;
266 
267  L1IndexComboVector tempIndexCombos;
268  for( int i = 0 ; i < numOfObjects() ; ++i )
269  {
270  if( !objectTypeIsGlobal( objectTypes_[ i ] ) )
271  {
272  ++numNonGlobal ;
273  nonGlobalType = objectTypes_[ i ] ;
274  nonGlobalIndex = i ;
275  }
276  }
277 
278  if( numNonGlobal == 0 )
279  {
280  // Dummy entry for each object type.
281  L1IndexCombo tmpCombo ;
282  tmpCombo.reserve(numOfObjects());
283  for( int i = 0 ; i < numOfObjects() ; ++i )
284  {
285  tmpCombo.push_back( 0 ) ;
286  }
287 
288  tempIndexCombos.push_back( tmpCombo ) ;
289  }
290  else if( numNonGlobal == 1 )
291  {
292  int nParticles = 0 ;
293 
294  if( nonGlobalType == kEM )
295  {
296  nParticles = emParticles_.size() ;
297  }
298  else if( nonGlobalType == kJet )
299  {
300  nParticles = jetParticles_.size() ;
301  }
302  else if( nonGlobalType == kMuon )
303  {
304  nParticles = muonParticles_.size() ;
305  }
306 
307  tempIndexCombos.reserve(nParticles);
308  for( int i = 0 ; i < nParticles ; ++i )
309  {
310  L1IndexCombo tmpCombo ;
311  tmpCombo.reserve(numOfObjects());
312  for( int j = 0 ; j < numOfObjects() ; ++j )
313  {
314  if( j == nonGlobalIndex )
315  {
316  tmpCombo.push_back( i ) ;
317  }
318  else
319  {
320  tmpCombo.push_back( 0 ) ;
321  }
322  }
323 
324  tempIndexCombos.push_back( tmpCombo ) ;
325  }
326  }
327  char expected = IndexComboStates::kUnset;
328  if(indexCombosState_.compare_exchange_strong(expected,kSetting,std::memory_order_acq_rel)) {
329  //If this was read from an old file, it is possible that indexCombos_ is already set.
330  // This is the only safe place to check since we know no other thread can be attempting
331  // to change this value.
332  if(indexCombos_.empty()) {
333  indexCombos_.swap(tempIndexCombos);
334  }
335  indexCombosState_.store(kSet, std::memory_order_release);
336  } else {
337  //have to wait
338  while(kSet != indexCombosState_.load(std::memory_order_acquire)) {
339  hardware_pause();
340  }
341  }
342 }
std::atomic< char > indexCombosState_
L1IndexComboVector indexCombos_
const char * kSet
int numOfObjects() const
std::vector< unsigned int > L1IndexCombo
std::vector< L1IndexCombo > L1IndexComboVector
L1EmParticleVectorRef emParticles_
L1MuonParticleVectorRef muonParticles_
static bool objectTypeIsGlobal(L1ObjectType type)
L1JetParticleVectorRef jetParticles_
L1ObjectTypeVector objectTypes_
void L1ParticleMap::swap ( L1ParticleMap rhs)

Definition at line 235 of file L1ParticleMap.cc.

References emParticles_, etMissParticle_, indexCombos_, indexCombosState_, jetParticles_, muonParticles_, objectTypes_, std::swap(), triggerDecision_, and triggerType_.

Referenced by operator=().

235  {
238  indexCombosState_.store(rhs.indexCombosState_.exchange(indexCombosState_.load(std::memory_order_acquire),std::memory_order_acq_rel),std::memory_order_release);
245 }
std::atomic< char > indexCombosState_
L1IndexComboVector indexCombos_
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
L1EtMissParticleRefProd etMissParticle_
L1EmParticleVectorRef emParticles_
L1MuonParticleVectorRef muonParticles_
L1JetParticleVectorRef jetParticles_
L1ObjectTypeVector objectTypes_
L1TriggerType triggerType_
bool l1extra::L1ParticleMap::triggerDecision ( ) const
inline

Definition at line 299 of file L1ParticleMap.h.

References triggerDecision_.

300  { return triggerDecision_ ; }
const std::string& l1extra::L1ParticleMap::triggerName ( ) const
inline

Definition at line 296 of file L1ParticleMap.h.

References triggerType_.

Referenced by etMissParticle().

297  { return triggerName( triggerType_ ) ; }
const std::string & triggerName() const
L1TriggerType triggerType_
const std::string & L1ParticleMap::triggerName ( L1TriggerType  type)
static

Definition at line 462 of file L1ParticleMap.cc.

References triggerNames_.

463 {
464  return triggerNames_[ type ] ;
465 }
type
Definition: HCALResponse.h:21
static const std::string triggerNames_[kNumOfL1TriggerTypes]
L1TriggerType l1extra::L1ParticleMap::triggerType ( ) const
inline

Definition at line 293 of file L1ParticleMap.h.

References triggerType_.

Referenced by etMissParticle().

294  { return triggerType_ ; }
L1TriggerType triggerType_
L1ParticleMap::L1TriggerType L1ParticleMap::triggerType ( const std::string &  name)
static

Definition at line 468 of file L1ParticleMap.cc.

References mps_fire::i, kNumOfL1TriggerTypes, and triggerNames_.

469 {
470  for( int i = 0 ; i < kNumOfL1TriggerTypes ; ++i )
471  {
472  if( triggerNames_[ i ] == name )
473  {
474  return ( L1TriggerType ) i ;
475  }
476  }
477 
478  return kNumOfL1TriggerTypes ;
479 }
static const std::string triggerNames_[kNumOfL1TriggerTypes]

Member Data Documentation

L1EmParticleVectorRef l1extra::L1ParticleMap::emParticles_
private
L1EtMissParticleRefProd l1extra::L1ParticleMap::etMissParticle_
private
L1IndexComboVector l1extra::L1ParticleMap::indexCombos_
mutableprivate

Definition at line 402 of file L1ParticleMap.h.

Referenced by indexCombos(), L1ParticleMap(), setIndexCombos(), and swap().

std::atomic<char> l1extra::L1ParticleMap::indexCombosState_
mutableprivate

Definition at line 375 of file L1ParticleMap.h.

Referenced by indexCombos(), L1ParticleMap(), setIndexCombos(), and swap().

L1JetParticleVectorRef l1extra::L1ParticleMap::jetParticles_
private
L1MuonParticleVectorRef l1extra::L1ParticleMap::muonParticles_
private
L1ObjectTypeVector l1extra::L1ParticleMap::objectTypes_
private
bool l1extra::L1ParticleMap::triggerDecision_
private

Definition at line 373 of file L1ParticleMap.h.

Referenced by swap(), and triggerDecision().

const std::string L1ParticleMap::triggerNames_
staticprivate

Definition at line 405 of file L1ParticleMap.h.

Referenced by triggerName(), and triggerType().

L1TriggerType l1extra::L1ParticleMap::triggerType_
private

Definition at line 371 of file L1ParticleMap.h.

Referenced by swap(), triggerName(), and triggerType().