CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/DataFormats/L1Trigger/interface/L1ParticleMap.h

Go to the documentation of this file.
00001 #ifndef L1Trigger_L1ParticleMap_h
00002 #define L1Trigger_L1ParticleMap_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     L1Trigger
00006 // Class  :     L1ParticleMap
00007 // 
00012 //
00013 // Original Author:  Werner Sun
00014 //         Created:  Fri Jul 14 19:46:30 EDT 2006
00015 // $Id: L1ParticleMap.h,v 1.29 2007/09/27 22:31:18 ratnik Exp $
00016 // $Log: L1ParticleMap.h,v $
00017 // Revision 1.29  2007/09/27 22:31:18  ratnik
00018 // QA campaign: merge includechecker changes back into the head, corresponding fixes being done in dependent packages
00019 //
00020 // Revision 1.28  2007/08/08 03:49:03  wsun
00021 // Diffractive trigger threshold update from X. Rouby.
00022 //
00023 // Revision 1.27  2007/08/07 01:18:15  wsun
00024 // Added JetMET calibration triggers from Len.
00025 //
00026 // Revision 1.26  2007/07/31 15:20:14  ratnik
00027 // QA campaign: include cleanup based on CMSSW_1_7_X_2007-07-30-1600 includechecker results.
00028 //
00029 // Revision 1.25  2007/07/14 19:03:25  wsun
00030 // Added diffractive triggers from X. Rouby and S. Ovyn.
00031 //
00032 // Revision 1.24  2007/06/16 16:50:03  wsun
00033 // Added SingleTauJet35 and DoubleTauJet35 for 131HLT6.
00034 //
00035 // Revision 1.23  2007/06/15 19:27:31  wsun
00036 // New L1 trigger table for 131HLT6.
00037 //
00038 // Revision 1.22  2007/06/03 00:06:30  wsun
00039 // Revision of L1 trigger table for 131HLT5.
00040 //
00041 // Revision 1.21  2007/06/01 02:57:11  wsun
00042 // New L1 trigger table for 131HLT5.
00043 //
00044 // Revision 1.20  2007/05/23 05:09:09  wsun
00045 // L1 trigger table for 131HLT4.
00046 //
00047 // Revision 1.19  2007/05/15 14:52:40  wsun
00048 // A_Mu3_IsoEG15 -> A_Mu7_IsoEG10
00049 //
00050 // Revision 1.18  2007/05/11 04:59:32  wsun
00051 // Retweaked trigger table.
00052 //
00053 // Revision 1.17  2007/04/30 21:00:39  wsun
00054 // QuadJet50 -> QuadJet20
00055 //
00056 // Revision 1.16  2007/04/23 18:33:31  wsun
00057 // Another iteration of the L1 trigger table.
00058 //
00059 // Revision 1.15  2007/04/22 22:35:47  wsun
00060 // Updated L1 trigger table yet again.
00061 //
00062 // Revision 1.14  2007/04/16 21:15:46  wsun
00063 // Tweaks to trigger table for 131HLT.
00064 //
00065 // Revision 1.13  2007/04/13 17:50:46  wsun
00066 // New trigger table for HLT exercise.
00067 //
00068 // Revision 1.12  2007/04/02 08:03:13  wsun
00069 // Updated Doxygen documentation.
00070 //
00071 // Revision 1.11  2006/08/31 10:23:32  wsun
00072 // Added MinBias trigger.
00073 //
00074 // Revision 1.10  2006/08/28 03:10:40  wsun
00075 // Revamped L1ParticleMap to handle OR triggers.
00076 //
00077 // Revision 1.9  2006/08/23 23:09:04  wsun
00078 // Separated iso/non-iso EM triggers and RefVectors.
00079 //
00080 // Revision 1.8  2006/08/10 18:47:41  wsun
00081 // Removed L1PhysObjectBase; particle classes now derived from LeafCandidate.
00082 //
00083 // Revision 1.7  2006/08/06 15:32:26  wsun
00084 // Added comment.
00085 //
00086 // Revision 1.6  2006/08/04 03:30:47  wsun
00087 // Separated tau/jet bookkeeping, added static function objectTypeIsGlobal().
00088 //
00089 // Revision 1.5  2006/08/02 20:48:55  wsun
00090 // Added more trigger lines, added mapping for global objects.
00091 //
00092 // Revision 1.4  2006/08/02 14:21:33  wsun
00093 // Added trigger name dictionary, moved particle type enum to L1ParticleMap.
00094 //
00095 // Revision 1.3  2006/07/26 20:41:30  wsun
00096 // Added implementation of L1ParticleMap.
00097 //
00098 // Revision 1.2  2006/07/26 00:05:39  wsun
00099 // Structural mods for HLT use.
00100 //
00101 // Revision 1.1  2006/07/17 20:35:19  wsun
00102 // First draft.
00103 //
00104 //
00105 
00106 // system include files
00107 #include <string>
00108 
00109 // user include files
00110 #include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h" 
00111 #include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h" 
00112 #include "DataFormats/L1Trigger/interface/L1MuonParticleFwd.h" 
00113 #include "DataFormats/L1Trigger/interface/L1EtMissParticle.h"
00114 #include "DataFormats/L1Trigger/interface/L1EtMissParticleFwd.h" 
00115 
00116 // forward declarations
00117 
00118 namespace l1extra {
00119 
00120    class L1ParticleMap
00121    {
00122 
00123       public:
00124          enum L1ObjectType
00125          {
00126             kEM,   // = isolated or non-isolated
00127             kJet,  // = central, forward, or tau
00128             kMuon,
00129             kEtMiss,
00130             kEtTotal,
00131             kEtHad,
00132             kNumOfL1ObjectTypes
00133          } ;
00134 
00135          // For now, use trigger menu from PTDR:
00136          // http://monicava.web.cern.ch/monicava/hlt_rates.htm#l1bits
00137 
00138          // RelaxedEM = isolated OR non-isolated
00139          // Jet = central OR forward OR tau
00140 
00141          enum L1TriggerType
00142          {
00143             kSingleMu3,
00144             kSingleMu5,
00145             kSingleMu7,
00146             kSingleMu10,
00147             kSingleMu14,
00148             kSingleMu20,
00149             kSingleMu25,
00150             kSingleIsoEG5,
00151             kSingleIsoEG8,
00152             kSingleIsoEG10,
00153             kSingleIsoEG12,
00154             kSingleIsoEG15,
00155             kSingleIsoEG20,
00156             kSingleIsoEG25,
00157             kSingleEG5,
00158             kSingleEG8,
00159             kSingleEG10,
00160             kSingleEG12,
00161             kSingleEG15,
00162             kSingleEG20,
00163             kSingleEG25,
00164             kSingleJet15,
00165             kSingleJet20,
00166             kSingleJet30,
00167             kSingleJet50,
00168             kSingleJet70,
00169             kSingleJet100,
00170             kSingleJet150,
00171             kSingleJet200,
00172             kSingleTauJet10,
00173             kSingleTauJet20,
00174             kSingleTauJet30,
00175             kSingleTauJet35,
00176             kSingleTauJet40,
00177             kSingleTauJet60,
00178             kSingleTauJet80,
00179             kSingleTauJet100,
00180             kHTT100,
00181             kHTT200,
00182             kHTT250,
00183             kHTT300,
00184             kHTT400,
00185             kHTT500,
00186             kETM10,
00187             kETM15,
00188             kETM20,
00189             kETM30,
00190             kETM40,
00191             kETM50,
00192             kETM60,
00193             kETT60,
00194             kDoubleMu3,
00195             kDoubleIsoEG8,
00196             kDoubleIsoEG10,
00197             kDoubleEG5,
00198             kDoubleEG10,
00199             kDoubleEG15,
00200             kDoubleJet70,
00201             kDoubleJet100,
00202             kDoubleTauJet20,
00203             kDoubleTauJet30,
00204             kDoubleTauJet35,
00205             kDoubleTauJet40,
00206             kMu3_IsoEG5,
00207             kMu5_IsoEG10,
00208             kMu3_EG12,
00209             kMu3_Jet15,
00210             kMu5_Jet15,
00211             kMu3_Jet70,
00212             kMu5_Jet20,
00213             kMu5_TauJet20,
00214             kMu5_TauJet30,
00215             kIsoEG10_EG10,
00216             kIsoEG10_Jet15,
00217             kIsoEG10_Jet20,
00218             kIsoEG10_Jet30,
00219             kIsoEG10_Jet70,
00220             kIsoEG10_TauJet20,
00221             kIsoEG10_TauJet30,
00222             kEG10_Jet15,
00223             kEG12_Jet20,
00224             kEG12_Jet70,
00225             kEG12_TauJet40,
00226             kJet70_TauJet40,
00227             kMu3_HTT200,
00228             kIsoEG10_HTT200,
00229             kEG12_HTT200,
00230             kJet70_HTT200,
00231             kTauJet40_HTT200,
00232             kMu3_ETM30,
00233             kIsoEG10_ETM30,
00234             kEG12_ETM30,
00235             kJet70_ETM40,
00236             kTauJet20_ETM20,
00237             kTauJet30_ETM30,
00238             kTauJet30_ETM40,
00239             kHTT100_ETM30,
00240             kTripleMu3,
00241             kTripleIsoEG5,
00242             kTripleEG10,
00243             kTripleJet50,
00244             kTripleTauJet40,
00245             kDoubleMu3_IsoEG5,
00246             kDoubleMu3_EG10,
00247             kDoubleIsoEG5_Mu3,
00248             kDoubleEG10_Mu3,
00249             kDoubleMu3_HTT200,
00250             kDoubleIsoEG5_HTT200,
00251             kDoubleEG10_HTT200,
00252             kDoubleJet50_HTT200,
00253             kDoubleTauJet40_HTT200,
00254             kDoubleMu3_ETM20,
00255             kDoubleIsoEG5_ETM20,
00256             kDoubleEG10_ETM20,
00257             kDoubleJet50_ETM20,
00258             kDoubleTauJet40_ETM20,
00259             kQuadJet30,
00260             kExclusiveDoubleIsoEG4,
00261             kExclusiveDoubleJet60,
00262             kExclusiveJet25_Gap_Jet25,
00263             kIsoEG10_Jet20_ForJet10,
00264             kMinBias_HTT10,
00265             kZeroBias,
00266             kNumOfL1TriggerTypes
00267          } ;
00268 
00269          typedef std::vector< unsigned int > L1IndexCombo ;
00270          typedef std::vector< L1IndexCombo > L1IndexComboVector ;
00271          typedef std::vector< L1ObjectType > L1ObjectTypeVector ;
00272 
00273          L1ParticleMap();
00274          L1ParticleMap(
00275             L1TriggerType triggerType,
00276             bool triggerDecision,
00277             const L1ObjectTypeVector& objectTypes,
00278             const L1EmParticleVectorRef& emParticles =
00279             L1EmParticleVectorRef(),
00280             const L1JetParticleVectorRef& jetParticles =
00281             L1JetParticleVectorRef(),
00282             const L1MuonParticleVectorRef& muonParticles =
00283                L1MuonParticleVectorRef(),
00284             const L1EtMissParticleRefProd& etMissParticle =
00285                L1EtMissParticleRefProd(),
00286             const L1IndexComboVector& indexCombos =
00287                L1IndexComboVector()
00288             ) ;
00289 
00290          virtual ~L1ParticleMap();
00291 
00292          // ---------- const member functions ---------------------
00293          L1TriggerType triggerType() const
00294          { return triggerType_ ; }
00295 
00296          const std::string& triggerName() const
00297          { return triggerName( triggerType_ ) ; }
00298 
00299          bool triggerDecision() const
00300          { return triggerDecision_ ; }
00301 
00302          // Indices of object types (see the above enum), that participated
00303          // in this trigger.  The order of these type indices corresponds to
00304          // the particles listed in each L1IndexCombo.
00305          const L1ObjectTypeVector& objectTypes() const
00306          { return objectTypes_ ; }
00307 
00308          // Number of objects that participated in this trigger.
00309          int numOfObjects() const
00310          { return objectTypes_.size() ; }
00311 
00312          const L1EmParticleVectorRef& emParticles() const
00313          { return emParticles_ ; }
00314 
00315          const L1JetParticleVectorRef& jetParticles() const
00316          { return jetParticles_ ; }
00317 
00318          const L1MuonParticleVectorRef& muonParticles() const
00319          { return muonParticles_ ; }
00320 
00321          const L1EtMissParticleRefProd& etMissParticle() const
00322          { return etMissParticle_ ; }
00323 
00324          // If there are zero or one non-global objects, then there is no need
00325          // to store the object combinations.  In this case, the stored
00326          // vector m_objectCombinations will be empty, and it will be
00327          // filled upon request at analysis time.
00328          const L1IndexComboVector& indexCombos() const ;
00329 
00330          // These functions retrieve the object corresponding to a
00331          // particular entry in a given combination.  The pointer is null
00332          // if an error occurs (e.g. the particle requested does not match
00333          // the type of the function).
00334          const reco::LeafCandidate* candidateInCombo(
00335             int aIndexInCombo, const L1IndexCombo& aCombo ) const ;
00336 
00337          const L1EmParticle* emParticleInCombo(
00338             int aIndexInCombo, const L1IndexCombo& aCombo ) const ;
00339 
00340          const L1JetParticle* jetParticleInCombo(
00341             int aIndexInCombo, const L1IndexCombo& aCombo ) const ;
00342 
00343          const L1MuonParticle* muonParticleInCombo(
00344             int aIndexInCombo, const L1IndexCombo& aCombo ) const ;
00345 
00346          // This function just returns the single global object.
00347          const L1EtMissParticle* etMissParticleInCombo(
00348             int aIndexInCombo, const L1IndexCombo& aCombo ) const ;
00349 
00350          // For a given particle combination, convert all the particles to
00351          // reco::LeafCandidate pointers.
00352          std::vector< const reco::LeafCandidate* > candidateCombo(
00353             const L1IndexCombo& aCombo ) const ;
00354 
00355          // ---------- static member functions --------------------
00356          static const std::string& triggerName( L1TriggerType type ) ;
00357          static L1TriggerType triggerType( const std::string& name ) ;
00358          static bool objectTypeIsGlobal( L1ObjectType type ) ;
00359 
00360          // ---------- member functions ---------------------------
00361 
00362       private:
00363          // L1ParticleMap(const L1ParticleMap&); // stop default
00364 
00365          // const L1ParticleMap& operator=(const L1ParticleMap&); // stop default
00366 
00367          // ---------- member data --------------------------------
00368 
00369          // Index into trigger menu.
00370          L1TriggerType triggerType_ ;
00371 
00372          bool triggerDecision_ ;
00373 
00374          // Vector of length numOfObjects() that gives the
00375          // type of each trigger object.
00376          L1ObjectTypeVector objectTypes_ ;
00377 
00378          // Lists of particles that fired this trigger, perhaps in combination
00379          // with another particle.
00380          L1EmParticleVectorRef emParticles_ ;
00381          L1JetParticleVectorRef jetParticles_ ;
00382          L1MuonParticleVectorRef muonParticles_ ;
00383 
00384          // Global (event-wide) objects.  The Ref is null if the object
00385          // was not used in this trigger.
00386          L1EtMissParticleRefProd etMissParticle_ ;
00387 
00388          // Object combinations that fired this trigger.  The inner
00389          // vector< int > has length numOfObjects() and contains
00390          // references to the elements in emParticles_, jetParticles_, and
00391          // muonParticles_ for a successful combination.  A dummy index is
00392          // entered for each global object in the trigger.  The object type
00393          // of each entry is given by objectTypes_.
00394          //
00395          // This data member is mutable because if #particles = 1, then this
00396          // vector is empty and is filled on request.
00397          mutable L1IndexComboVector indexCombos_ ;
00398 
00399          // Static array of trigger names.
00400          static std::string triggerNames_[ kNumOfL1TriggerTypes ] ;
00401    };
00402 
00403 }
00404 
00405 #endif