CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1ParticleMap.h
Go to the documentation of this file.
1 #ifndef L1Trigger_L1ParticleMap_h
2 #define L1Trigger_L1ParticleMap_h
3 // -*- C++ -*-
4 //
5 // Package: L1Trigger
6 // Class : L1ParticleMap
7 //
12 //
13 // Original Author: Werner Sun
14 // Created: Fri Jul 14 19:46:30 EDT 2006
15 // Revision 1.28 2007/08/08 03:49:03 wsun
16 // Diffractive trigger threshold update from X. Rouby.
17 //
18 // Revision 1.27 2007/08/07 01:18:15 wsun
19 // Added JetMET calibration triggers from Len.
20 //
21 // Revision 1.26 2007/07/31 15:20:14 ratnik
22 // QA campaign: include cleanup based on CMSSW_1_7_X_2007-07-30-1600 includechecker results.
23 //
24 // Revision 1.25 2007/07/14 19:03:25 wsun
25 // Added diffractive triggers from X. Rouby and S. Ovyn.
26 //
27 // Revision 1.24 2007/06/16 16:50:03 wsun
28 // Added SingleTauJet35 and DoubleTauJet35 for 131HLT6.
29 //
30 // Revision 1.23 2007/06/15 19:27:31 wsun
31 // New L1 trigger table for 131HLT6.
32 //
33 // Revision 1.22 2007/06/03 00:06:30 wsun
34 // Revision of L1 trigger table for 131HLT5.
35 //
36 // Revision 1.21 2007/06/01 02:57:11 wsun
37 // New L1 trigger table for 131HLT5.
38 //
39 // Revision 1.20 2007/05/23 05:09:09 wsun
40 // L1 trigger table for 131HLT4.
41 //
42 // Revision 1.19 2007/05/15 14:52:40 wsun
43 // A_Mu3_IsoEG15 -> A_Mu7_IsoEG10
44 //
45 // Revision 1.18 2007/05/11 04:59:32 wsun
46 // Retweaked trigger table.
47 //
48 // Revision 1.17 2007/04/30 21:00:39 wsun
49 // QuadJet50 -> QuadJet20
50 //
51 // Revision 1.16 2007/04/23 18:33:31 wsun
52 // Another iteration of the L1 trigger table.
53 //
54 // Revision 1.15 2007/04/22 22:35:47 wsun
55 // Updated L1 trigger table yet again.
56 //
57 // Revision 1.14 2007/04/16 21:15:46 wsun
58 // Tweaks to trigger table for 131HLT.
59 //
60 // Revision 1.13 2007/04/13 17:50:46 wsun
61 // New trigger table for HLT exercise.
62 //
63 // Revision 1.12 2007/04/02 08:03:13 wsun
64 // Updated Doxygen documentation.
65 //
66 // Revision 1.11 2006/08/31 10:23:32 wsun
67 // Added MinBias trigger.
68 //
69 // Revision 1.10 2006/08/28 03:10:40 wsun
70 // Revamped L1ParticleMap to handle OR triggers.
71 //
72 // Revision 1.9 2006/08/23 23:09:04 wsun
73 // Separated iso/non-iso EM triggers and RefVectors.
74 //
75 // Revision 1.8 2006/08/10 18:47:41 wsun
76 // Removed L1PhysObjectBase; particle classes now derived from LeafCandidate.
77 //
78 // Revision 1.7 2006/08/06 15:32:26 wsun
79 // Added comment.
80 //
81 // Revision 1.6 2006/08/04 03:30:47 wsun
82 // Separated tau/jet bookkeeping, added static function objectTypeIsGlobal().
83 //
84 // Revision 1.5 2006/08/02 20:48:55 wsun
85 // Added more trigger lines, added mapping for global objects.
86 //
87 // Revision 1.4 2006/08/02 14:21:33 wsun
88 // Added trigger name dictionary, moved particle type enum to L1ParticleMap.
89 //
90 // Revision 1.3 2006/07/26 20:41:30 wsun
91 // Added implementation of L1ParticleMap.
92 //
93 // Revision 1.2 2006/07/26 00:05:39 wsun
94 // Structural mods for HLT use.
95 //
96 // Revision 1.1 2006/07/17 20:35:19 wsun
97 // First draft.
98 //
99 //
100 
101 // system include files
102 #include <string>
103 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
104 #include <atomic>
105 #endif
106 // user include files
112 
113 // forward declarations
114 
115 namespace l1extra {
116 
118  {
119 
120  public:
122  {
123  kEM, // = isolated or non-isolated
124  kJet, // = central, forward, or tau
130  } ;
131 
132  // For now, use trigger menu from PTDR:
133  // http://monicava.web.cern.ch/monicava/hlt_rates.htm#l1bits
134 
135  // RelaxedEM = isolated OR non-isolated
136  // Jet = central OR forward OR tau
137 
139  {
264  } ;
265 
266  typedef std::vector< unsigned int > L1IndexCombo ;
267  typedef std::vector< L1IndexCombo > L1IndexComboVector ;
268  typedef std::vector< L1ObjectType > L1ObjectTypeVector ;
269 
270  L1ParticleMap();
273  bool triggerDecision,
285  ) ;
286  L1ParticleMap( const L1ParticleMap&);
288 
289  virtual ~L1ParticleMap();
290 
291  void swap(L1ParticleMap&);
292  // ---------- const member functions ---------------------
294  { return triggerType_ ; }
295 
296  const std::string& triggerName() const
297  { return triggerName( triggerType_ ) ; }
298 
299  bool triggerDecision() const
300  { return triggerDecision_ ; }
301 
302  // Indices of object types (see the above enum), that participated
303  // in this trigger. The order of these type indices corresponds to
304  // the particles listed in each L1IndexCombo.
306  { return objectTypes_ ; }
307 
308  // Number of objects that participated in this trigger.
309  int numOfObjects() const
310  { return objectTypes_.size() ; }
311 
313  { return emParticles_ ; }
314 
316  { return jetParticles_ ; }
317 
319  { return muonParticles_ ; }
320 
322  { return etMissParticle_ ; }
323 
324  // If there are zero or one non-global objects, then there is no need
325  // to store the object combinations. In this case, the stored
326  // vector m_objectCombinations will be empty, and it will be
327  // filled upon request at analysis time.
328  const L1IndexComboVector& indexCombos() const ;
329 
330  // These functions retrieve the object corresponding to a
331  // particular entry in a given combination. The pointer is null
332  // if an error occurs (e.g. the particle requested does not match
333  // the type of the function).
335  int aIndexInCombo, const L1IndexCombo& aCombo ) const ;
336 
338  int aIndexInCombo, const L1IndexCombo& aCombo ) const ;
339 
341  int aIndexInCombo, const L1IndexCombo& aCombo ) const ;
342 
344  int aIndexInCombo, const L1IndexCombo& aCombo ) const ;
345 
346  // This function just returns the single global object.
348  int aIndexInCombo, const L1IndexCombo& aCombo ) const ;
349 
350  // For a given particle combination, convert all the particles to
351  // reco::LeafCandidate pointers.
352  std::vector< const reco::LeafCandidate* > candidateCombo(
353  const L1IndexCombo& aCombo ) const ;
354 
355  // ---------- static member functions --------------------
356  static const std::string& triggerName( L1TriggerType type ) ;
357  static L1TriggerType triggerType( const std::string& name ) ;
358  static bool objectTypeIsGlobal( L1ObjectType type ) ;
359 
360  // ---------- member functions ---------------------------
361 
362  private:
363  // L1ParticleMap(const L1ParticleMap&); // stop default
364 
365  // const L1ParticleMap& operator=(const L1ParticleMap&); // stop default
366 
367  void setIndexCombos() const;
368  // ---------- member data --------------------------------
369 
370  // Index into trigger menu.
372 
374 #if !defined(__CINT__) && !defined(__MAKECINT__) && !defined(__REFLEX__)
375  mutable std::atomic<char> indexCombosState_;
376 #else
377  mutable char indexCombosState_;
378 #endif
379  // Vector of length numOfObjects() that gives the
380  // type of each trigger object.
382 
383  // Lists of particles that fired this trigger, perhaps in combination
384  // with another particle.
388 
389  // Global (event-wide) objects. The Ref is null if the object
390  // was not used in this trigger.
392 
393  // Object combinations that fired this trigger. The inner
394  // vector< int > has length numOfObjects() and contains
395  // references to the elements in emParticles_, jetParticles_, and
396  // muonParticles_ for a successful combination. A dummy index is
397  // entered for each global object in the trigger. The object type
398  // of each entry is given by objectTypes_.
399  //
400  // This data member is mutable because if #particles = 1, then this
401  // vector is empty and is filled on request.
402  mutable L1IndexComboVector indexCombos_ ; //CMS thread safe via indexCombosState_
403 
404  // Static array of trigger names.
406  };
407 
408 }
409 
410 #endif
std::vector< L1EmParticleRef > L1EmParticleVectorRef
type
Definition: HCALResponse.h:21
std::atomic< char > indexCombosState_
void swap(L1ParticleMap &)
std::vector< L1JetParticleRef > L1JetParticleVectorRef
const L1EtMissParticleRefProd & etMissParticle() const
const std::string & triggerName() const
const L1JetParticle * jetParticleInCombo(int aIndexInCombo, const L1IndexCombo &aCombo) const
L1IndexComboVector indexCombos_
const L1MuonParticleVectorRef & muonParticles() const
const L1EtMissParticle * etMissParticleInCombo(int aIndexInCombo, const L1IndexCombo &aCombo) const
int numOfObjects() const
L1ParticleMap & operator=(const L1ParticleMap &)
static const std::string triggerNames_[kNumOfL1TriggerTypes]
std::vector< unsigned int > L1IndexCombo
bool triggerDecision() const
const L1MuonParticle * muonParticleInCombo(int aIndexInCombo, const L1IndexCombo &aCombo) const
std::vector< L1IndexCombo > L1IndexComboVector
const L1EmParticleVectorRef & emParticles() const
L1EtMissParticleRefProd etMissParticle_
const L1EmParticle * emParticleInCombo(int aIndexInCombo, const L1IndexCombo &aCombo) const
const L1JetParticleVectorRef & jetParticles() const
void setIndexCombos() const
std::vector< const reco::LeafCandidate * > candidateCombo(const L1IndexCombo &aCombo) const
L1EmParticleVectorRef emParticles_
L1MuonParticleVectorRef muonParticles_
static bool objectTypeIsGlobal(L1ObjectType type)
L1TriggerType triggerType() const
const reco::LeafCandidate * candidateInCombo(int aIndexInCombo, const L1IndexCombo &aCombo) const
const L1IndexComboVector & indexCombos() const
std::vector< L1ObjectType > L1ObjectTypeVector
edm::RefProd< L1EtMissParticle > L1EtMissParticleRefProd
std::vector< L1MuonParticleRef > L1MuonParticleVectorRef
L1JetParticleVectorRef jetParticles_
L1ObjectTypeVector objectTypes_
L1TriggerType triggerType_
const L1ObjectTypeVector & objectTypes() const