Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:29

0001 #ifndef L1ExtraFromDigis_L1ExtraParticleMapProd_h
0002 #define L1ExtraFromDigis_L1ExtraParticleMapProd_h
0003 // -*- C++ -*-
0004 //
0005 // Package:     L1ExtraFromDigis
0006 // Class  :     L1ExtraParticleMapProd
0007 //
0008 /**\class L1ExtraParticleMapProd \file L1ExtraParticleMapProd.h
0009  L1Trigger/L1ExtraFromDigis/interface/L1ExtraParticleMapProd.h \author Werner
0010  Sun
0011 
0012  Description: producer of L1ParticleMap objects from GT emulator object maps.
0013 */
0014 //
0015 // Original Author:
0016 //         Created:  Tue Oct 17 00:14:00 EDT 2006
0017 //
0018 
0019 // system include files
0020 
0021 // user include files
0022 #include "FWCore/Framework/interface/EDProducer.h"
0023 #include "FWCore/Framework/interface/Event.h"
0024 #include "FWCore/Framework/interface/EventSetup.h"
0025 #include "FWCore/Framework/interface/Frameworkfwd.h"
0026 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0027 #include "FWCore/Utilities/interface/InputTag.h"
0028 
0029 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutRecord.h"
0030 #include "DataFormats/L1Trigger/interface/L1EmParticle.h"
0031 #include "DataFormats/L1Trigger/interface/L1EmParticleFwd.h"
0032 #include "DataFormats/L1Trigger/interface/L1JetParticle.h"
0033 #include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
0034 #include "DataFormats/L1Trigger/interface/L1MuonParticle.h"
0035 #include "DataFormats/L1Trigger/interface/L1ParticleMap.h"
0036 #include "DataFormats/L1Trigger/interface/L1ParticleMapFwd.h"
0037 
0038 // forward declarations
0039 
0040 class L1ExtraParticleMapProd : public edm::EDProducer {
0041 public:
0042   explicit L1ExtraParticleMapProd(const edm::ParameterSet &);
0043   ~L1ExtraParticleMapProd() override;
0044 
0045   void produce(edm::Event &, const edm::EventSetup &) override;
0046 
0047 private:
0048   // Adds Refs to the objects in handle to the outputRefs vector.
0049   template <class TCollection>
0050   void addToVectorRefs(const edm::Handle<TCollection> &handle,           // input
0051                        std::vector<edm::Ref<TCollection>> &vectorRefs);  // output
0052 
0053   template <class TCollection>
0054   void evaluateSingleObjectTrigger(const std::vector<edm::Ref<TCollection>> &inputRefs,  // input
0055                                    const double &etThreshold,                            // input
0056                                    bool &decision,                                       // output
0057                                    std::vector<edm::Ref<TCollection>> &outputRefs);      // output
0058 
0059   template <class TCollection>
0060   void evaluateDoubleSameObjectTrigger(const std::vector<edm::Ref<TCollection>> &inputRefs,  // input
0061                                        const double &etThreshold,                            // input
0062                                        bool &decision,                                       // output
0063                                        std::vector<edm::Ref<TCollection>> &outputRefs,       // output
0064                                        l1extra::L1ParticleMap::L1IndexComboVector &combos,   // output
0065                                        bool combinedWithGlobalObject = false);               // if true, add entry for
0066   // HT or MET to particle combos
0067 
0068   template <class TCollection>
0069   void evaluateTripleSameObjectTrigger(const std::vector<edm::Ref<TCollection>> &inputRefs,  // input
0070                                        const double &etThreshold,                            // input
0071                                        bool &decision,                                       // output
0072                                        std::vector<edm::Ref<TCollection>> &outputRefs,       // output
0073                                        l1extra::L1ParticleMap::L1IndexComboVector &combos);  // output
0074 
0075   template <class TCollection1, class TCollection2>
0076   void evaluateDoublePlusSingleObjectTrigger(const std::vector<edm::Ref<TCollection1>> &inputRefs1,  // input
0077                                              const std::vector<edm::Ref<TCollection2>> &inputRefs2,  // input
0078                                              const double &etThreshold1,                             // input
0079                                              const double &etThreshold2,                             // input
0080                                              bool &decision,                                         // output
0081                                              std::vector<edm::Ref<TCollection1>> &outputRefs1,       // output
0082                                              std::vector<edm::Ref<TCollection2>> &outputRefs2,       // output
0083                                              l1extra::L1ParticleMap::L1IndexComboVector &combos);    // output
0084 
0085   template <class TCollection>
0086   void evaluateQuadSameObjectTrigger(const std::vector<edm::Ref<TCollection>> &inputRefs,  // input
0087                                      const double &etThreshold,                            // input
0088                                      bool &decision,                                       // output
0089                                      std::vector<edm::Ref<TCollection>> &outputRefs,       // output
0090                                      l1extra::L1ParticleMap::L1IndexComboVector &combos);  // output
0091 
0092   template <class TCollection1, class TCollection2>
0093   void evaluateDoubleDifferentObjectTrigger(const std::vector<edm::Ref<TCollection1>> &inputRefs1,  // input
0094                                             const std::vector<edm::Ref<TCollection2>> &inputRefs2,  // input
0095                                             const double &etThreshold1,                             // input
0096                                             const double &etThreshold2,                             // input
0097                                             bool &decision,                                         // output
0098                                             std::vector<edm::Ref<TCollection1>> &outputRefs1,       // output
0099                                             std::vector<edm::Ref<TCollection2>> &outputRefs2,       // output
0100                                             l1extra::L1ParticleMap::L1IndexComboVector &combos);    // output
0101 
0102   template <class TCollection>
0103   void evaluateDoubleDifferentObjectSameTypeTrigger(const std::vector<edm::Ref<TCollection>> &inputRefs1,  // input
0104                                                     const std::vector<edm::Ref<TCollection>> &inputRefs2,  // input
0105                                                     const double &etThreshold1,                            // input
0106                                                     const double &etThreshold2,                            // input
0107                                                     bool &decision,                                        // output
0108                                                     std::vector<edm::Ref<TCollection>> &outputRefs,        // output
0109                                                     l1extra::L1ParticleMap::L1IndexComboVector &combos);   // output
0110 
0111   void evaluateDoubleDifferentCaloObjectTrigger(const l1extra::L1EmParticleVectorRef &inputRefs1,     // input
0112                                                 const l1extra::L1JetParticleVectorRef &inputRefs2,    // input
0113                                                 const double &etThreshold1,                           // input
0114                                                 const double &etThreshold2,                           // input
0115                                                 bool &decision,                                       // output
0116                                                 l1extra::L1EmParticleVectorRef &outputRefs1,          // output
0117                                                 l1extra::L1JetParticleVectorRef &outputRefs2,         // output
0118                                                 l1extra::L1ParticleMap::L1IndexComboVector &combos);  // output
0119 
0120   void evaluateJetGapJetTrigger(const l1extra::L1JetParticleVectorRef &inputRefs,     // input
0121                                 const double &etThreshold,                            // input
0122                                 bool &decision,                                       // output
0123                                 l1extra::L1JetParticleVectorRef &outputRefs,          // output
0124                                 l1extra::L1ParticleMap::L1IndexComboVector &combos);  // output
0125 
0126   void evaluateForwardRapidityGap(const l1extra::L1JetParticleVectorRef &inputRefs,  // input
0127                                   const double &etThreshold,                         // input
0128                                   bool &decision);                                   // output
0129 
0130   void evaluateDoubleExclusiveIsoEG(const l1extra::L1EmParticleVectorRef &inputRefs1,     // input
0131                                     const l1extra::L1JetParticleVectorRef &inputRefs2,    // input
0132                                     const double &etThreshold1,                           // input
0133                                     const double &etThreshold2,                           // input
0134                                     bool &decision,                                       // output
0135                                     l1extra::L1EmParticleVectorRef &outputRefs1,          // output
0136                                     l1extra::L1ParticleMap::L1IndexComboVector &combos);  // output
0137 
0138   // ----------member data ---------------------------
0139   edm::InputTag muonSource_;
0140   edm::InputTag isoEmSource_;
0141   edm::InputTag nonIsoEmSource_;
0142   edm::InputTag cenJetSource_;
0143   edm::InputTag forJetSource_;
0144   edm::InputTag tauJetSource_;
0145   edm::InputTag etMissSource_;
0146   edm::InputTag htMissSource_;
0147 
0148   double singleThresholds_[l1extra::L1ParticleMap::kNumOfL1TriggerTypes];
0149   int prescales_[l1extra::L1ParticleMap::kNumOfL1TriggerTypes];
0150   int prescaleCounters_[l1extra::L1ParticleMap::kNumOfL1TriggerTypes];
0151   std::pair<double, double> doubleThresholds_[l1extra::L1ParticleMap::kNumOfL1TriggerTypes];
0152 };
0153 
0154 #endif