Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-09 00:01:06

0001 #ifndef L1Trigger_L1TGlobal_TriggerMenu_h
0002 #define L1Trigger_L1TGlobal_TriggerMenu_h
0003 
0004 /**
0005  * \class TriggerMenu
0006  *
0007  *
0008  * Description: L1 trigger menu.
0009  *
0010  * Implementation:
0011  *    <TODO: enter implementation details>
0012  *
0013  * \author: Vasile Mihai Ghete - HEPHY Vienna
0014  *          Vladimir Rekovic - extend for overlap removal
0015  *          Elisa Fontanesi - extended for three-body correlation conditions
0016  *
0017  * $Date$
0018  * $Revision$
0019  *
0020  */
0021 
0022 // system include files
0023 #include <string>
0024 #include <vector>
0025 #include <map>
0026 
0027 #include <iosfwd>
0028 
0029 // user include files
0030 #include "L1Trigger/L1TGlobal/interface/TriggerMenuFwd.h"
0031 
0032 #include "L1Trigger/L1TGlobal/interface/GlobalScales.h"
0033 
0034 #include "L1Trigger/L1TGlobal/interface/MuonTemplate.h"
0035 #include "L1Trigger/L1TGlobal/interface/MuonShowerTemplate.h"
0036 #include "L1Trigger/L1TGlobal/interface/CaloTemplate.h"
0037 #include "L1Trigger/L1TGlobal/interface/EnergySumTemplate.h"
0038 #include "L1Trigger/L1TGlobal/interface/ExternalTemplate.h"
0039 #include "L1Trigger/L1TGlobal/interface/CorrelationTemplate.h"
0040 #include "L1Trigger/L1TGlobal/interface/CorrelationThreeBodyTemplate.h"
0041 #include "L1Trigger/L1TGlobal/interface/CorrelationWithOverlapRemovalTemplate.h"
0042 
0043 // forward declarations
0044 class GlobalCondition;
0045 class L1GtAlgorithm;
0046 class GlobalScales;
0047 
0048 // class declaration
0049 class TriggerMenu {
0050 public:
0051   // constructor
0052   TriggerMenu();
0053 
0054   TriggerMenu(const std::string&,
0055               const unsigned int numberConditionChips,
0056               const std::vector<std::vector<MuonTemplate> >&,
0057               const std::vector<std::vector<MuonShowerTemplate> >&,
0058               const std::vector<std::vector<CaloTemplate> >&,
0059               const std::vector<std::vector<EnergySumTemplate> >&,
0060               const std::vector<std::vector<ExternalTemplate> >&,
0061               const std::vector<std::vector<CorrelationTemplate> >&,
0062               const std::vector<std::vector<CorrelationThreeBodyTemplate> >&,
0063               const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&,
0064               const std::vector<std::vector<MuonTemplate> >&,
0065               const std::vector<std::vector<CaloTemplate> >&,
0066               const std::vector<std::vector<EnergySumTemplate> >&);
0067 
0068   // copy constructor
0069   TriggerMenu(const TriggerMenu&);
0070 
0071   // destructor
0072   virtual ~TriggerMenu();
0073 
0074   // assignment operator
0075   TriggerMenu& operator=(const TriggerMenu&);
0076 
0077 public:
0078   /// get / set / build the condition maps
0079   inline const std::vector<l1t::ConditionMap>& gtConditionMap() const { return m_conditionMap; }
0080 
0081   void setGtConditionMap(const std::vector<l1t::ConditionMap>&);
0082   void buildGtConditionMap();
0083 
0084   /// get / set the trigger menu names
0085   inline const std::string& gtTriggerMenuInterface() const { return m_triggerMenuInterface; }
0086 
0087   void setGtTriggerMenuInterface(const std::string&);
0088 
0089   //
0090   inline const std::string& gtTriggerMenuName() const { return m_triggerMenuName; }
0091 
0092   void setGtTriggerMenuName(const std::string&);
0093 
0094   //
0095   inline const unsigned long gtTriggerMenuUUID() const { return m_triggerMenuUUID; }
0096 
0097   void setGtTriggerMenuUUID(const unsigned long uuid);
0098 
0099   //
0100   inline const unsigned long gtTriggerMenuImplementation() const { return m_triggerMenuImplementation; }
0101 
0102   void setGtTriggerMenuImplementation(const unsigned long);
0103 
0104   /// menu associated scale key
0105   inline const std::string& gtScaleDbKey() const { return m_scaleDbKey; }
0106 
0107   void setGtScaleDbKey(const std::string&);
0108 
0109   /// get / set the vectors containing the conditions
0110   inline const std::vector<std::vector<MuonTemplate> >& vecMuonTemplate() const { return m_vecMuonTemplate; }
0111 
0112   void setVecMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
0113 
0114   //
0115   inline const std::vector<std::vector<MuonShowerTemplate> >& vecMuonShowerTemplate() const {
0116     return m_vecMuonShowerTemplate;
0117   }
0118 
0119   void setVecMuonShowerTemplate(const std::vector<std::vector<MuonShowerTemplate> >&);
0120 
0121   //
0122   inline const std::vector<std::vector<CaloTemplate> >& vecCaloTemplate() const { return m_vecCaloTemplate; }
0123 
0124   void setVecCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
0125 
0126   //
0127   inline const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTemplate() const {
0128     return m_vecEnergySumTemplate;
0129   }
0130 
0131   void setVecEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
0132 
0133   inline const std::vector<std::vector<ExternalTemplate> >& vecExternalTemplate() const {
0134     return m_vecExternalTemplate;
0135   }
0136 
0137   void setVecExternalTemplate(const std::vector<std::vector<ExternalTemplate> >&);
0138 
0139   //
0140   inline const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTemplate() const {
0141     return m_vecCorrelationTemplate;
0142   }
0143 
0144   void setVecCorrelationTemplate(const std::vector<std::vector<CorrelationTemplate> >&);
0145 
0146   //
0147   inline const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTemplate() const {
0148     return m_vecCorrelationThreeBodyTemplate;
0149   }
0150 
0151   void setVecCorrelationThreeBodyTemplate(const std::vector<std::vector<CorrelationThreeBodyTemplate> >&);
0152 
0153   //
0154   inline const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&
0155   vecCorrelationWithOverlapRemovalTemplate() const {
0156     return m_vecCorrelationWithOverlapRemovalTemplate;
0157   }
0158 
0159   void setVecCorrelationWithOverlapRemovalTemplate(
0160       const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&);
0161 
0162   //
0163   inline const std::vector<std::vector<MuonTemplate> >& corMuonTemplate() const { return m_corMuonTemplate; }
0164 
0165   void setCorMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
0166 
0167   //
0168   inline const std::vector<std::vector<CaloTemplate> >& corCaloTemplate() const { return m_corCaloTemplate; }
0169 
0170   void setCorCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
0171 
0172   // get / set the vectors containing the conditions for correlation templates
0173   //
0174   inline const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTemplate() const {
0175     return m_corEnergySumTemplate;
0176   }
0177 
0178   void setCorEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
0179 
0180   /// get / set the algorithm map (by name)
0181   inline const l1t::AlgorithmMap& gtAlgorithmMap() const { return m_algorithmMap; }
0182 
0183   void setGtAlgorithmMap(const l1t::AlgorithmMap&);
0184 
0185   /// get / set the algorithm map (by alias)
0186   inline const l1t::AlgorithmMap& gtAlgorithmAliasMap() const { return m_algorithmAliasMap; }
0187 
0188   void setGtAlgorithmAliasMap(const l1t::AlgorithmMap&);
0189 
0190   /// get the scales
0191   inline const l1t::GlobalScales& gtScales() const { return m_gtScales; }
0192 
0193   void setGtScales(const l1t::GlobalScales&);
0194 
0195   /*
0196     /// get / set the technical trigger map
0197     inline const l1t::AlgorithmMap& gtTechnicalTriggerMap() const {
0198         return m_technicalTriggerMap;
0199     }
0200 
0201 //    void setGtTechnicalTriggerMap(const l1t::AlgorithmMap&);
0202 */
0203   /// print the trigger menu
0204   /// allow various verbosity levels
0205   void print(std::ostream&, int&) const;
0206 
0207 public:
0208   /// get the result for algorithm with name algName
0209   /// use directly the format of decisionWord (no typedef)
0210   const bool gtAlgorithmResult(const std::string& algName, const std::vector<bool>& decWord) const;
0211 
0212 private:
0213   /// map containing the conditions (per condition chip) - transient
0214   std::vector<l1t::ConditionMap> m_conditionMap;
0215 
0216 private:
0217   /// menu names
0218   std::string m_triggerMenuInterface;
0219   std::string m_triggerMenuName;
0220   unsigned long m_triggerMenuImplementation;
0221 
0222   unsigned long m_triggerMenuUUID;
0223 
0224   /// menu associated scale key
0225   std::string m_scaleDbKey;
0226 
0227   /// vectors containing the conditions
0228   /// explicit, due to persistency...
0229   std::vector<std::vector<MuonTemplate> > m_vecMuonTemplate;
0230   std::vector<std::vector<MuonShowerTemplate> > m_vecMuonShowerTemplate;
0231   std::vector<std::vector<CaloTemplate> > m_vecCaloTemplate;
0232   std::vector<std::vector<EnergySumTemplate> > m_vecEnergySumTemplate;
0233 
0234   std::vector<std::vector<ExternalTemplate> > m_vecExternalTemplate;
0235 
0236   std::vector<std::vector<CorrelationTemplate> > m_vecCorrelationTemplate;
0237   std::vector<std::vector<CorrelationThreeBodyTemplate> > m_vecCorrelationThreeBodyTemplate;
0238   std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> > m_vecCorrelationWithOverlapRemovalTemplate;
0239   std::vector<std::vector<MuonTemplate> > m_corMuonTemplate;
0240   std::vector<std::vector<CaloTemplate> > m_corCaloTemplate;
0241   std::vector<std::vector<EnergySumTemplate> > m_corEnergySumTemplate;
0242 
0243   /// map containing the physics algorithms (by name)
0244   l1t::AlgorithmMap m_algorithmMap;
0245 
0246   /// map containing the physics algorithms (by alias)
0247   l1t::AlgorithmMap m_algorithmAliasMap;
0248 
0249   /// map containing the technical triggers
0250   //    l1t::AlgorithmMap m_technicalTriggerMap;
0251 
0252   // class containing the scales from the L1 Menu XML
0253   l1t::GlobalScales m_gtScales;
0254 };
0255 
0256 #endif /*L1Trigger_L1TGlobal_TriggerMenu_h*/