Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:30

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/EnergySumZdcTemplate.h"
0039 #include "L1Trigger/L1TGlobal/interface/AXOL1TLTemplate.h"
0040 #include "L1Trigger/L1TGlobal/interface/ExternalTemplate.h"
0041 #include "L1Trigger/L1TGlobal/interface/CorrelationTemplate.h"
0042 #include "L1Trigger/L1TGlobal/interface/CorrelationThreeBodyTemplate.h"
0043 #include "L1Trigger/L1TGlobal/interface/CorrelationWithOverlapRemovalTemplate.h"
0044 
0045 // forward declarations
0046 class GlobalCondition;
0047 class L1GtAlgorithm;
0048 class GlobalScales;
0049 
0050 // class declaration
0051 class TriggerMenu {
0052 public:
0053   // constructor
0054   TriggerMenu();
0055 
0056   TriggerMenu(const std::string&,
0057               const unsigned int numberConditionChips,
0058               const std::vector<std::vector<MuonTemplate> >&,
0059               const std::vector<std::vector<MuonShowerTemplate> >&,
0060               const std::vector<std::vector<CaloTemplate> >&,
0061               const std::vector<std::vector<EnergySumTemplate> >&,
0062               const std::vector<std::vector<EnergySumZdcTemplate> >&,
0063               const std::vector<std::vector<AXOL1TLTemplate> >&,
0064               const std::vector<std::vector<ExternalTemplate> >&,
0065               const std::vector<std::vector<CorrelationTemplate> >&,
0066               const std::vector<std::vector<CorrelationThreeBodyTemplate> >&,
0067               const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&,
0068               const std::vector<std::vector<MuonTemplate> >&,
0069               const std::vector<std::vector<CaloTemplate> >&,
0070               const std::vector<std::vector<EnergySumTemplate> >&);
0071 
0072   // copy constructor
0073   TriggerMenu(const TriggerMenu&);
0074 
0075   // destructor
0076   virtual ~TriggerMenu();
0077 
0078   // assignment operator
0079   TriggerMenu& operator=(const TriggerMenu&);
0080 
0081 public:
0082   /// get / set / build the condition maps
0083   inline const std::vector<l1t::ConditionMap>& gtConditionMap() const { return m_conditionMap; }
0084 
0085   void setGtConditionMap(const std::vector<l1t::ConditionMap>&);
0086   void buildGtConditionMap();
0087 
0088   /// get / set the trigger menu names
0089   inline const std::string& gtTriggerMenuInterface() const { return m_triggerMenuInterface; }
0090 
0091   void setGtTriggerMenuInterface(const std::string&);
0092 
0093   //
0094   inline const std::string& gtTriggerMenuName() const { return m_triggerMenuName; }
0095 
0096   void setGtTriggerMenuName(const std::string&);
0097 
0098   //
0099   inline const unsigned long gtTriggerMenuUUID() const { return m_triggerMenuUUID; }
0100 
0101   void setGtTriggerMenuUUID(const unsigned long uuid);
0102 
0103   //
0104   inline const unsigned long gtTriggerMenuImplementation() const { return m_triggerMenuImplementation; }
0105 
0106   void setGtTriggerMenuImplementation(const unsigned long);
0107 
0108   /// menu associated scale key
0109   inline const std::string& gtScaleDbKey() const { return m_scaleDbKey; }
0110 
0111   void setGtScaleDbKey(const std::string&);
0112 
0113   /// get / set the vectors containing the conditions
0114   inline const std::vector<std::vector<MuonTemplate> >& vecMuonTemplate() const { return m_vecMuonTemplate; }
0115 
0116   void setVecMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
0117 
0118   //
0119   inline const std::vector<std::vector<MuonShowerTemplate> >& vecMuonShowerTemplate() const {
0120     return m_vecMuonShowerTemplate;
0121   }
0122 
0123   void setVecMuonShowerTemplate(const std::vector<std::vector<MuonShowerTemplate> >&);
0124 
0125   //
0126   inline const std::vector<std::vector<CaloTemplate> >& vecCaloTemplate() const { return m_vecCaloTemplate; }
0127 
0128   void setVecCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
0129 
0130   //
0131   inline const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTemplate() const {
0132     return m_vecEnergySumTemplate;
0133   }
0134 
0135   void setVecEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
0136 
0137   //
0138   inline const std::vector<std::vector<EnergySumZdcTemplate> >& vecEnergySumZdcTemplate() const {
0139     return m_vecEnergySumZdcTemplate;
0140   }
0141 
0142   void setVecEnergySumZdcTemplate(const std::vector<std::vector<EnergySumZdcTemplate> >&);
0143 
0144   //
0145   inline const std::vector<std::vector<AXOL1TLTemplate> >& vecAXOL1TLTemplate() const { return m_vecAXOL1TLTemplate; }
0146 
0147   void setVecAXOL1TLTemplate(const std::vector<std::vector<AXOL1TLTemplate> >&);
0148 
0149   //
0150   inline const std::vector<std::vector<ExternalTemplate> >& vecExternalTemplate() const {
0151     return m_vecExternalTemplate;
0152   }
0153 
0154   void setVecExternalTemplate(const std::vector<std::vector<ExternalTemplate> >&);
0155 
0156   //
0157   inline const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTemplate() const {
0158     return m_vecCorrelationTemplate;
0159   }
0160 
0161   void setVecCorrelationTemplate(const std::vector<std::vector<CorrelationTemplate> >&);
0162 
0163   //
0164   inline const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTemplate() const {
0165     return m_vecCorrelationThreeBodyTemplate;
0166   }
0167 
0168   void setVecCorrelationThreeBodyTemplate(const std::vector<std::vector<CorrelationThreeBodyTemplate> >&);
0169 
0170   //
0171   inline const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&
0172   vecCorrelationWithOverlapRemovalTemplate() const {
0173     return m_vecCorrelationWithOverlapRemovalTemplate;
0174   }
0175 
0176   void setVecCorrelationWithOverlapRemovalTemplate(
0177       const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&);
0178 
0179   //
0180   inline const std::vector<std::vector<MuonTemplate> >& corMuonTemplate() const { return m_corMuonTemplate; }
0181 
0182   void setCorMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
0183 
0184   //
0185   inline const std::vector<std::vector<CaloTemplate> >& corCaloTemplate() const { return m_corCaloTemplate; }
0186 
0187   void setCorCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
0188 
0189   // get / set the vectors containing the conditions for correlation templates
0190   //
0191   inline const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTemplate() const {
0192     return m_corEnergySumTemplate;
0193   }
0194 
0195   void setCorEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
0196 
0197   /// get / set the algorithm map (by name)
0198   inline const l1t::AlgorithmMap& gtAlgorithmMap() const { return m_algorithmMap; }
0199 
0200   void setGtAlgorithmMap(const l1t::AlgorithmMap&);
0201 
0202   /// get / set the algorithm map (by alias)
0203   inline const l1t::AlgorithmMap& gtAlgorithmAliasMap() const { return m_algorithmAliasMap; }
0204 
0205   void setGtAlgorithmAliasMap(const l1t::AlgorithmMap&);
0206 
0207   /// get the scales
0208   inline const l1t::GlobalScales& gtScales() const { return m_gtScales; }
0209 
0210   void setGtScales(const l1t::GlobalScales&);
0211 
0212   /*
0213     /// get / set the technical trigger map
0214     inline const l1t::AlgorithmMap& gtTechnicalTriggerMap() const {
0215         return m_technicalTriggerMap;
0216     }
0217 
0218 //    void setGtTechnicalTriggerMap(const l1t::AlgorithmMap&);
0219 */
0220   /// print the trigger menu
0221   /// allow various verbosity levels
0222   void print(std::ostream&, int&) const;
0223 
0224 public:
0225   /// get the result for algorithm with name algName
0226   /// use directly the format of decisionWord (no typedef)
0227   const bool gtAlgorithmResult(const std::string& algName, const std::vector<bool>& decWord) const;
0228 
0229 private:
0230   /// map containing the conditions (per condition chip) - transient
0231   std::vector<l1t::ConditionMap> m_conditionMap;
0232 
0233 private:
0234   /// menu names
0235   std::string m_triggerMenuInterface;
0236   std::string m_triggerMenuName;
0237   unsigned long m_triggerMenuImplementation;
0238 
0239   unsigned long m_triggerMenuUUID;
0240 
0241   /// menu associated scale key
0242   std::string m_scaleDbKey;
0243 
0244   /// vectors containing the conditions
0245   /// explicit, due to persistency...
0246   std::vector<std::vector<MuonTemplate> > m_vecMuonTemplate;
0247   std::vector<std::vector<MuonShowerTemplate> > m_vecMuonShowerTemplate;
0248   std::vector<std::vector<CaloTemplate> > m_vecCaloTemplate;
0249   std::vector<std::vector<EnergySumTemplate> > m_vecEnergySumTemplate;
0250   std::vector<std::vector<EnergySumZdcTemplate> > m_vecEnergySumZdcTemplate;
0251   std::vector<std::vector<AXOL1TLTemplate> > m_vecAXOL1TLTemplate;
0252 
0253   std::vector<std::vector<ExternalTemplate> > m_vecExternalTemplate;
0254 
0255   std::vector<std::vector<CorrelationTemplate> > m_vecCorrelationTemplate;
0256   std::vector<std::vector<CorrelationThreeBodyTemplate> > m_vecCorrelationThreeBodyTemplate;
0257   std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> > m_vecCorrelationWithOverlapRemovalTemplate;
0258   std::vector<std::vector<MuonTemplate> > m_corMuonTemplate;
0259   std::vector<std::vector<CaloTemplate> > m_corCaloTemplate;
0260   std::vector<std::vector<EnergySumTemplate> > m_corEnergySumTemplate;
0261 
0262   /// map containing the physics algorithms (by name)
0263   l1t::AlgorithmMap m_algorithmMap;
0264 
0265   /// map containing the physics algorithms (by alias)
0266   l1t::AlgorithmMap m_algorithmAliasMap;
0267 
0268   /// map containing the technical triggers
0269   //    l1t::AlgorithmMap m_technicalTriggerMap;
0270 
0271   // class containing the scales from the L1 Menu XML
0272   l1t::GlobalScales m_gtScales;
0273 };
0274 
0275 #endif /*L1Trigger_L1TGlobal_TriggerMenu_h*/