Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:54:34

0001 #ifndef GlobalTriggerAnalyzer_L1GtPatternGenerator_h
0002 #define GlobalTriggerAnalyzer_L1GtPatternGenerator_h
0003 
0004 /**
0005  * \class L1GtPatternGenerator
0006  * 
0007  * 
0008  * Description: A generator of pattern files for L1 GT hardware testing.
0009  *
0010  * Implementation:
0011  *    <TODO: enter implementation details>
0012  *   
0013  * \author: Thomas Themel - HEPHY Vienna
0014  * 
0015  *
0016  */
0017 
0018 // system include files
0019 #include <memory>
0020 #include <string>
0021 #include <fstream>
0022 
0023 // user include files
0024 #include "FWCore/Framework/interface/Frameworkfwd.h"
0025 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0026 
0027 #include "FWCore/Framework/interface/Event.h"
0028 #include "FWCore/Framework/interface/EventSetup.h"
0029 
0030 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0031 #include "FWCore/Utilities/interface/InputTag.h"
0032 
0033 // class declaration
0034 class L1GtPatternWriter;
0035 class L1GtPatternMap;
0036 
0037 class L1GtPatternGenerator : public edm::one::EDAnalyzer<> {
0038 public:
0039   explicit L1GtPatternGenerator(const edm::ParameterSet&);
0040   ~L1GtPatternGenerator() override;
0041 
0042 protected:
0043   void extractGlobalTriggerData(const edm::Event& iEvent, L1GtPatternMap& patterns);
0044 
0045 private:
0046   /// analyze
0047   void beginJob() override;
0048 
0049   /// analyze each event
0050   void analyze(const edm::Event&, const edm::EventSetup&) override;
0051 
0052   /// end of job
0053   void endJob() override;
0054 
0055   /** Post-processing for complex mapping of HF records to PSB values */
0056   void packHfRecords(const std::string& resultName, L1GtPatternMap& allPatterns);
0057 
0058   /** Post-processing for regional muon trigger inputs */
0059   static uint32_t packRegionalMuons(uint32_t rawValue);
0060 
0061   /** Post-processing for etMissing */
0062   static uint32_t packEtMiss(uint32_t rawValue);
0063 
0064 private:
0065   /// input tag for GCT data
0066   edm::InputTag m_gctTag;
0067 
0068   /// input tag for GMT data
0069   edm::InputTag m_gmtTag;
0070 
0071   /// input tag for GT data
0072   edm::InputTag m_gtTag;
0073 
0074   /// input tags for regional muon data
0075   edm::InputTag m_dtTag;
0076   edm::InputTag m_cscTag;
0077   edm::InputTag m_rpcbTag;
0078   edm::InputTag m_rpcfTag;
0079 
0080   /// an algorithm and a condition in that algorithm to test the object maps
0081   std::string m_destPath;
0082 
0083   /// output file name
0084   std::string m_fileName;
0085   std::ofstream m_fileStream;
0086 
0087   /// formatting instructions
0088 
0089   std::string m_header;
0090   std::string m_footer;
0091   std::vector<std::string> m_columnNames;
0092   std::vector<uint32_t> m_columnLengths;
0093   std::vector<int> m_bx;
0094   std::vector<uint32_t> m_columnDefaults;
0095   bool m_debug;
0096 
0097   std::unique_ptr<L1GtPatternWriter> m_writer;
0098 };
0099 
0100 #endif /*GlobalTriggerAnalyzer_L1GtPatternGenerator_h*/