Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-12 04:16:39

0001 /**
0002  * BoardDataWriter for input/output patterns of upstream objects.
0003  **/
0004 
0005 #include "FWCore/Framework/interface/Frameworkfwd.h"
0006 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0007 
0008 #include "FWCore/Framework/interface/Event.h"
0009 #include "FWCore/Framework/interface/MakerMacros.h"
0010 
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 #include "FWCore/ParameterSet/interface/allowedValues.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0014 #include "FWCore/Utilities/interface/InputTag.h"
0015 
0016 #include "L1Trigger/DemonstratorTools/interface/BoardDataWriter.h"
0017 #include "L1Trigger/DemonstratorTools/interface/utilities.h"
0018 #include "L1Trigger/DemonstratorTools/interface/codecs/etsums.h"
0019 #include "L1Trigger/DemonstratorTools/interface/codecs/htsums.h"
0020 
0021 #include "FWCore/Utilities/interface/EDGetToken.h"
0022 
0023 #include "DataFormats/L1Trigger/interface/TkJetWord.h"
0024 #include "DataFormats/L1Trigger/interface/VertexWord.h"
0025 
0026 #include "DataFormats/L1TMuonPhase2/interface/SAMuon.h"
0027 #include "DataFormats/L1TMuonPhase2/interface/TrackerMuon.h"
0028 
0029 #include "DataFormats/L1TParticleFlow/interface/PFJet.h"
0030 #include "DataFormats/L1TCorrelator/interface/TkEmFwd.h"
0031 #include "DataFormats/L1TCorrelator/interface/TkEm.h"
0032 #include "DataFormats/L1TCorrelator/interface/TkElectronFwd.h"
0033 #include "DataFormats/L1TCorrelator/interface/TkElectron.h"
0034 #include "DataFormats/L1TParticleFlow/interface/PFTau.h"
0035 
0036 #include "DataFormats/L1Trigger/interface/EtSum.h"
0037 #include "DataFormats/L1Trigger/interface/P2GTCandidate.h"
0038 
0039 #include <vector>
0040 #include <algorithm>
0041 #include <string>
0042 #include <type_traits>
0043 #include <optional>
0044 #include <array>
0045 #include <unordered_map>
0046 
0047 using namespace l1t;
0048 
0049 class L1GTObjectBoardWriter : public edm::one::EDAnalyzer<> {
0050 public:
0051   explicit L1GTObjectBoardWriter(const edm::ParameterSet&);
0052 
0053   static void fillDescriptions(edm::ConfigurationDescriptions&);
0054 
0055 private:
0056   void analyze(const edm::Event&, const edm::EventSetup&) override;
0057   void endJob() override;
0058 
0059   enum BufferType { INPUT, OUTPUT };
0060 
0061   const BufferType bufferFileType_;
0062   unsigned int eventCounter_;
0063   unsigned int maxEvents_;
0064   std::unordered_map<std::string, std::size_t> numChannels_;
0065   demo::BoardDataWriter boardDataWriter_;
0066 
0067   // From upstream
0068   const edm::EDGetTokenT<TkJetWordCollection> gttPromptJetToken_;
0069   const edm::EDGetTokenT<TkJetWordCollection> gttDisplacedJetToken_;
0070   const edm::EDGetTokenT<std::vector<EtSum>> gttPromptHtSumToken_;
0071   const edm::EDGetTokenT<std::vector<EtSum>> gttDisplacedHtSumToken_;
0072   const edm::EDGetTokenT<std::vector<EtSum>> gttEtSumToken_;
0073   const edm::EDGetTokenT<VertexWordCollection> gttPrimaryVertexToken_;
0074 
0075   const edm::EDGetTokenT<SAMuonCollection> gmtSaPromptMuonToken_;
0076   const edm::EDGetTokenT<SAMuonCollection> gmtSaDisplacedMuonToken_;
0077   const edm::EDGetTokenT<TrackerMuonCollection> gmtTkMuonToken_;
0078 
0079   const edm::EDGetTokenT<PFJetCollection> cl2JetSC4Token_;
0080   const edm::EDGetTokenT<PFJetCollection> cl2JetSC8Token_;
0081   const edm::EDGetTokenT<TkEmCollection> cl2PhotonToken_;
0082   const edm::EDGetTokenT<TkElectronCollection> cl2ElectronToken_;
0083   const edm::EDGetTokenT<PFTauCollection> cl2TauToken_;
0084   const edm::EDGetTokenT<std::vector<EtSum>> cl2EtSumToken_;
0085   const edm::EDGetTokenT<std::vector<EtSum>> cl2HtSumToken_;
0086 };
0087 
0088 template <typename T1, typename T2>
0089 static std::vector<T1> vconvert(std::vector<T2> ivec) {
0090   return std::vector<T1>(ivec.begin(), ivec.end());
0091 }
0092 
0093 static constexpr std::array<const char*, 27> AVAILABLE_COLLECTIONS{{"GTTPromptJets",
0094                                                                     "GTTDisplacedJets",
0095                                                                     "GTTPromptHtSum",
0096                                                                     "GTTDisplacedHtSum",
0097                                                                     "GTTEtSum",
0098                                                                     "GTTHadronicTaus",
0099                                                                     "CL2JetsSC4",
0100                                                                     "CL2JetsSC8",
0101                                                                     "CL2Taus",
0102                                                                     "CL2HtSum",
0103                                                                     "CL2EtSum",
0104                                                                     "GCTNonIsoEg",
0105                                                                     "GCTIsoEg",
0106                                                                     "GCTJets",
0107                                                                     "GCTTaus",
0108                                                                     "GCTHtSum",
0109                                                                     "GCTEtSum",
0110                                                                     "GMTSaPromptMuons",
0111                                                                     "GMTSaDisplacedMuons",
0112                                                                     "GMTTkMuons",
0113                                                                     "GMTTopo",
0114                                                                     "CL2Electrons",
0115                                                                     "CL2Photons",
0116                                                                     "GTTPhiCandidates",
0117                                                                     "GTTRhoCandidates",
0118                                                                     "GTTBsCandidates",
0119                                                                     "GTTPrimaryVert"}};
0120 
0121 L1GTObjectBoardWriter::L1GTObjectBoardWriter(const edm::ParameterSet& config)
0122     : bufferFileType_(config.getUntrackedParameter<std::string>("bufferFileType") == "input" ? INPUT : OUTPUT),
0123       eventCounter_(0),
0124       maxEvents_(config.getUntrackedParameter<unsigned int>("maxEvents")),
0125       numChannels_(),
0126       boardDataWriter_(
0127           demo::parseFileFormat(config.getUntrackedParameter<std::string>("patternFormat")),
0128           config.getUntrackedParameter<std::string>("filename"),
0129           config.getUntrackedParameter<std::string>("fileExtension"),
0130           9,
0131           1,
0132           config.getUntrackedParameter<unsigned int>("maxFrames"),
0133           [&]() {
0134             if (bufferFileType_ == INPUT) {
0135               const edm::ParameterSet& iChannels = config.getUntrackedParameterSet("InputChannels");
0136               demo::BoardDataWriter::ChannelMap_t channelMap;
0137 
0138               channelMap.insert(
0139                   {{"GCT", 1},
0140                    {{6, 0},
0141                     vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("GCT_1"))}});
0142               channelMap.insert(
0143                   {{"GMT", 1},
0144                    {{18, 0},
0145                     vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("GMT_1"))}});
0146               channelMap.insert(
0147                   {{"GTT", 1},
0148                    {{6, 0},
0149                     vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("GTT_1"))}});
0150               channelMap.insert(
0151                   {{"GTT", 2},
0152                    {{6, 0},
0153                     vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("GTT_2"))}});
0154               channelMap.insert(
0155                   {{"GTT", 3},
0156                    {{6, 0},
0157                     vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("GTT_3"))}});
0158               channelMap.insert(
0159                   {{"GTT", 4},
0160                    {{6, 0},
0161                     vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("GTT_4"))}});
0162               channelMap.insert(
0163                   {{"CL2", 1},
0164                    {{6, 0},
0165                     vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("CL2_1"))}});
0166               channelMap.insert(
0167                   {{"CL2", 2},
0168                    {{6, 0},
0169                     vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("CL2_2"))}});
0170               channelMap.insert(
0171                   {{"CL2", 3},
0172                    {{6, 0},
0173                     vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("CL2_3"))}});
0174 
0175               return channelMap;
0176             } else {
0177               const edm::ParameterSet& oChannels = config.getUntrackedParameterSet("OutputChannels");
0178               demo::BoardDataWriter::ChannelMap_t channelMap;
0179               for (const char* name : AVAILABLE_COLLECTIONS) {
0180                 std::vector<unsigned int> channels = oChannels.getUntrackedParameter<std::vector<unsigned int>>(name);
0181                 for (std::size_t i = 0; i < channels.size(); i++) {
0182                   channelMap.insert({{name, i}, {{1, 0}, {channels.at(i)}}});
0183                 }
0184                 numChannels_.insert({name, channels.size()});
0185               }
0186               return channelMap;
0187             }
0188           }()),
0189       gttPromptJetToken_(consumes<TkJetWordCollection>(config.getUntrackedParameter<edm::InputTag>("GTTPromptJets"))),
0190       gttDisplacedJetToken_(
0191           consumes<TkJetWordCollection>(config.getUntrackedParameter<edm::InputTag>("GTTDisplacedJets"))),
0192       gttPromptHtSumToken_(consumes<std::vector<EtSum>>(config.getUntrackedParameter<edm::InputTag>("GTTPromptHtSum"))),
0193       gttDisplacedHtSumToken_(
0194           consumes<std::vector<EtSum>>(config.getUntrackedParameter<edm::InputTag>("GTTDisplacedHtSum"))),
0195       gttEtSumToken_(consumes<std::vector<EtSum>>(config.getUntrackedParameter<edm::InputTag>("GTTEtSum"))),
0196       gttPrimaryVertexToken_(
0197           consumes<VertexWordCollection>(config.getUntrackedParameter<edm::InputTag>("GTTPrimaryVert"))),
0198       gmtSaPromptMuonToken_(
0199           consumes<SAMuonCollection>(config.getUntrackedParameter<edm::InputTag>("GMTSaPromptMuons"))),
0200       gmtSaDisplacedMuonToken_(
0201           consumes<SAMuonCollection>(config.getUntrackedParameter<edm::InputTag>("GMTSaDisplacedMuons"))),
0202       gmtTkMuonToken_(consumes<TrackerMuonCollection>(config.getUntrackedParameter<edm::InputTag>("GMTTkMuons"))),
0203       cl2JetSC4Token_(consumes<PFJetCollection>(config.getUntrackedParameter<edm::InputTag>("CL2JetsSC4"))),
0204       cl2JetSC8Token_(consumes<PFJetCollection>(config.getUntrackedParameter<edm::InputTag>("CL2JetsSC8"))),
0205       cl2PhotonToken_(consumes<TkEmCollection>(config.getUntrackedParameter<edm::InputTag>("CL2Photons"))),
0206       cl2ElectronToken_(consumes<TkElectronCollection>(config.getUntrackedParameter<edm::InputTag>("CL2Electrons"))),
0207       cl2TauToken_(consumes<PFTauCollection>(config.getUntrackedParameter<edm::InputTag>("CL2Taus"))),
0208       cl2EtSumToken_(consumes<std::vector<EtSum>>(config.getUntrackedParameter<edm::InputTag>("CL2EtSum"))),
0209       cl2HtSumToken_(consumes<std::vector<EtSum>>(config.getUntrackedParameter<edm::InputTag>("CL2HtSum"))) {}
0210 
0211 template <typename T, P2GTCandidate::ObjectType type = P2GTCandidate::Undefined>
0212 static std::vector<ap_uint<64>> packCollection(const std::vector<T>& collection) {
0213   std::vector<ap_uint<64>> packed;
0214   std::optional<ap_uint<64>> next_packed;
0215 
0216   for (std::size_t idx = 0; idx < collection.size() && idx < 12; idx++) {
0217     const T& obj = collection[idx];
0218     if constexpr (std::is_same_v<T, TkJetWord>) {
0219       ap_uint<128> word = obj.tkJetWord();
0220       packed.emplace_back(word(63, 0));
0221       packed.emplace_back(word(127, 64));
0222     } else if constexpr (std::is_same_v<T, EtSum>) {
0223       if constexpr (type == P2GTCandidate::GTTEtSum) {
0224         packed.emplace_back(l1t::demo::codecs::encodeEtSum(obj));
0225       } else if constexpr (type == P2GTCandidate::GTTPromptHtSum || type == P2GTCandidate::GTTDisplacedHtSum) {
0226         packed.emplace_back(l1t::demo::codecs::encodeHtSum(obj));
0227       } else if constexpr (type == P2GTCandidate::CL2EtSum) {
0228         l1gt::Sum sum{true /* valid */, obj.pt(), obj.phi() / l1gt::Scales::ETAPHI_LSB, 0 /* scalar sum */};
0229         packed.emplace_back(sum.pack_ap());
0230       } else if constexpr (type == P2GTCandidate::CL2HtSum) {
0231         // Make interfaces great again!
0232         const EtSum& ht = collection[0];
0233         const EtSum& mht = collection[1];
0234 
0235         l1gt::Sum sum{true /* valid */, mht.pt(), mht.phi() / l1gt::Scales::ETAPHI_LSB, ht.pt()};
0236         packed.emplace_back(sum.pack_ap());
0237       }
0238       break;
0239     } else if constexpr (std::is_same_v<T, VertexWord>) {
0240       packed.emplace_back(obj.vertexWord());
0241     } else if constexpr (std::is_same_v<T, SAMuon>) {
0242       packed.emplace_back(obj.word());
0243     } else if constexpr (std::is_same_v<T, TrackerMuon>) {
0244       std::array<uint64_t, 2> word = obj.word();
0245       if (next_packed.has_value()) {
0246         packed.emplace_back(word[1] << 32 | next_packed.value());
0247         next_packed.reset();
0248       } else {
0249         next_packed = word[1];
0250       }
0251 
0252       packed.emplace_back(word[0]);
0253     } else if constexpr (std::is_same_v<T, PFJet>) {
0254       packed.emplace_back(obj.encodedJet()[0]);
0255       packed.emplace_back(obj.encodedJet()[1]);
0256     } else if constexpr (std::is_same_v<T, TkEm> || std::is_same_v<T, TkElectron>) {
0257       ap_uint<96> word = obj.template egBinaryWord<96>();
0258       if (next_packed.has_value()) {
0259         packed.emplace_back(word(95, 64) << 32 | next_packed.value());
0260         next_packed.reset();
0261       } else {
0262         next_packed = word(95, 64);
0263       }
0264 
0265       packed.emplace_back(word(63, 0));
0266     } else if constexpr (std::is_same_v<T, PFTau>) {
0267       std::array<uint64_t, 2> word = obj.encodedTau();
0268       if (next_packed.has_value()) {
0269         packed.emplace_back(word[1] << 32 | next_packed.value());
0270         next_packed.reset();
0271       } else {
0272         next_packed = word[1];
0273       }
0274 
0275       packed.emplace_back(word[0]);
0276     }
0277   }
0278 
0279   // Filling up remaining words with 0
0280   if constexpr (std::is_same_v<T, TkJetWord> || std::is_same_v<T, PFJet>) {
0281     while (packed.size() < 24) {
0282       packed.emplace_back(0);
0283     }
0284   } else if constexpr (std::is_same_v<T, TrackerMuon> || std::is_same_v<T, TkEm> || std::is_same_v<T, TkElectron> ||
0285                        std::is_same_v<T, PFTau>) {
0286     while (packed.size() < 18) {
0287       if (next_packed) {
0288         packed.emplace_back(next_packed.value());
0289         next_packed.reset();
0290       } else {
0291         packed.emplace_back(0);
0292       }
0293     }
0294   } else if constexpr (std::is_same_v<T, SAMuon> || std::is_same_v<T, VertexWord>) {
0295     while (packed.size() < 12) {
0296       packed.emplace_back(0);
0297     }
0298   } else if constexpr (std::is_same_v<T, EtSum>) {
0299     if (packed.size() < 1) {
0300       packed.emplace_back(0);
0301     }
0302   }
0303 
0304   return packed;
0305 }
0306 
0307 template <typename T>
0308 static std::vector<T> operator+(std::vector<T>&& lhs, std::vector<T>&& rhs) {
0309   std::vector<T> concat;
0310   concat.reserve(lhs.size() + rhs.size());
0311   std::move(lhs.begin(), lhs.end(), std::back_inserter(concat));
0312   std::move(rhs.begin(), rhs.end(), std::back_inserter(concat));
0313   return concat;
0314 }
0315 
0316 void L1GTObjectBoardWriter::analyze(const edm::Event& event, const edm::EventSetup&) {
0317   const TkJetWordCollection& gttPromptJets = event.get(gttPromptJetToken_);
0318   const TkJetWordCollection& gttDisplacedJets = event.get(gttDisplacedJetToken_);
0319   const std::vector<EtSum>& gttPromptHtSum = event.get(gttPromptHtSumToken_);
0320   const std::vector<EtSum>& gttDisplacedHtSum = event.get(gttDisplacedHtSumToken_);
0321   const std::vector<EtSum>& gttEtSum = event.get(gttEtSumToken_);
0322   const VertexWordCollection& gttPrimaryVertices = event.get(gttPrimaryVertexToken_);
0323   const SAMuonCollection& gmtSaPromptMuons = event.get(gmtSaPromptMuonToken_);
0324   const SAMuonCollection& gmtSaDisplacedMuons = event.get(gmtSaDisplacedMuonToken_);
0325   const TrackerMuonCollection& gmtTkMuons = event.get(gmtTkMuonToken_);
0326   const PFJetCollection& cl2JetsSC4 = event.get(cl2JetSC4Token_);
0327   const PFJetCollection& cl2JetsSC8 = event.get(cl2JetSC8Token_);
0328   const TkEmCollection& cl2Photons = event.get(cl2PhotonToken_);
0329   const TkElectronCollection& cl2Electrons = event.get(cl2ElectronToken_);
0330   const PFTauCollection& cl2Taus = event.get(cl2TauToken_);
0331   const std::vector<EtSum>& cl2EtSum = event.get(cl2EtSumToken_);
0332   const std::vector<EtSum>& cl2HtSum = event.get(cl2HtSumToken_);
0333 
0334   if (bufferFileType_ == INPUT) {
0335     boardDataWriter_.addEvent(
0336         demo::EventData{{{{"GTT", 1},
0337                           packCollection(gttPromptJets) + packCollection(gttDisplacedJets) +
0338                               packCollection<EtSum, P2GTCandidate::GTTPromptHtSum>(gttPromptHtSum) +
0339                               packCollection<EtSum, P2GTCandidate::GTTDisplacedHtSum>(gttDisplacedHtSum) +
0340                               packCollection<EtSum, P2GTCandidate::GTTEtSum>(gttEtSum)},
0341                          {{"GTT", 2}, std::vector<ap_uint<64>>(18, 0)},
0342                          {{"CL2", 1},
0343                           packCollection(cl2JetsSC4) + packCollection<EtSum, P2GTCandidate::CL2HtSum>(cl2HtSum) +
0344                               packCollection<EtSum, P2GTCandidate::CL2EtSum>(cl2EtSum) + packCollection(cl2JetsSC8)},
0345                          {{"CL2", 2}, packCollection(cl2Taus)},
0346                          {{"GCT", 1}, std::vector<ap_uint<64>>(50, 0)},
0347                          {{"GMT", 1},
0348                           packCollection(gmtSaPromptMuons) + packCollection(gmtSaDisplacedMuons) +
0349                               packCollection(gmtTkMuons) + std::vector<ap_uint<64>>(12, 0)},
0350                          {{"CL2", 3}, packCollection(cl2Electrons) + packCollection(cl2Photons)},
0351                          {{"GTT", 3}, std::vector<ap_uint<64>>(39, 0)},
0352                          {{"GTT", 4}, std::vector<ap_uint<64>>(36, 0) + packCollection(gttPrimaryVertices)}}});
0353   } else {
0354     std::map<demo::LinkId, std::vector<ap_uint<64>>> eventData;
0355 
0356     for (const char* name : AVAILABLE_COLLECTIONS) {
0357       std::vector<ap_uint<64>> data;
0358 
0359       if (std::string("GTTPromptJets") == name) {
0360         data = packCollection(gttPromptJets);
0361       } else if (std::string("GTTDisplacedJets") == name) {
0362         data = packCollection(gttDisplacedJets);
0363       } else if (std::string("GTTPromptHtSum") == name) {
0364         data = packCollection<EtSum, P2GTCandidate::GTTPromptHtSum>(gttPromptHtSum);
0365       } else if (std::string("GTTDisplacedHtSum") == name) {
0366         data = packCollection<EtSum, P2GTCandidate::GTTDisplacedHtSum>(gttDisplacedHtSum);
0367       } else if (std::string("GTTEtSum") == name) {
0368         data = packCollection<EtSum, P2GTCandidate::GTTEtSum>(gttEtSum);
0369       } else if (std::string("GTTPrimaryVert") == name) {
0370         data = packCollection(gttPrimaryVertices);
0371       } else if (std::string("GMTSaPromptMuons") == name) {
0372         data = packCollection(gmtSaPromptMuons);
0373       } else if (std::string("GMTSaDisplacedMuons") == name) {
0374         data = packCollection(gmtSaDisplacedMuons);
0375       } else if (std::string("GMTTkMuons") == name) {
0376         data = packCollection(gmtTkMuons);
0377       } else if (std::string("CL2JetsSC4") == name) {
0378         data = packCollection(cl2JetsSC4);
0379       } else if (std::string("CL2JetsSC8") == name) {
0380         data = packCollection(cl2JetsSC8);
0381       } else if (std::string("CL2Photons") == name) {
0382         data = packCollection(cl2Photons);
0383       } else if (std::string("CL2Electrons") == name) {
0384         data = packCollection(cl2Electrons);
0385       } else if (std::string("CL2Taus") == name) {
0386         data = packCollection(cl2Taus);
0387       } else if (std::string("CL2EtSum") == name) {
0388         data = packCollection<EtSum, P2GTCandidate::CL2EtSum>(cl2EtSum);
0389       } else if (std::string("CL2HtSum") == name) {
0390         data = packCollection<EtSum, P2GTCandidate::CL2HtSum>(cl2HtSum);
0391       }
0392 
0393       for (std::size_t i = 0; i < numChannels_.at(name); i++) {
0394         for (std::size_t j = i; j < data.size(); j += numChannels_.at(name)) {
0395           eventData[{name, i}].push_back(data[j]);
0396         }
0397 
0398         while (eventData[{name, i}].size() < 9) {
0399           eventData[{name, i}].push_back(0);
0400         }
0401       }
0402     }
0403 
0404     boardDataWriter_.addEvent(eventData);
0405   }
0406 
0407   eventCounter_++;
0408 
0409   if (maxEvents_ != 0 && eventCounter_ == maxEvents_) {
0410     boardDataWriter_.flush();
0411     eventCounter_ = 0;
0412   }
0413 }
0414 
0415 void L1GTObjectBoardWriter::endJob() { boardDataWriter_.flush(); }
0416 
0417 void L1GTObjectBoardWriter::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0418   edm::ParameterSetDescription desc;
0419   desc.addUntracked<std::string>("filename");
0420   desc.addUntracked<std::string>("fileExtension", "txt");
0421   desc.addUntracked<unsigned int>("maxFrames", 1024);
0422   desc.addUntracked<unsigned int>("maxEvents", 0);
0423   desc.addUntracked<std::string>("patternFormat", "EMPv2");
0424   desc.ifValue(edm::ParameterDescription<std::string>("bufferFileType", "input", false),
0425                edm::allowedValues<std::string>("input", "output"));
0426 
0427   desc.addUntracked<edm::InputTag>("GTTPromptJets");
0428   desc.addUntracked<edm::InputTag>("GTTDisplacedJets");
0429   desc.addUntracked<edm::InputTag>("GTTPromptHtSum");
0430   desc.addUntracked<edm::InputTag>("GTTDisplacedHtSum");
0431   desc.addUntracked<edm::InputTag>("GTTEtSum");
0432   desc.addUntracked<edm::InputTag>("GTTPrimaryVert");
0433 
0434   desc.addUntracked<edm::InputTag>("GMTSaPromptMuons");
0435   desc.addUntracked<edm::InputTag>("GMTSaDisplacedMuons");
0436   desc.addUntracked<edm::InputTag>("GMTTkMuons");
0437 
0438   desc.addUntracked<edm::InputTag>("CL2JetsSC4");
0439   desc.addUntracked<edm::InputTag>("CL2JetsSC8");
0440   desc.addUntracked<edm::InputTag>("CL2Photons");
0441   desc.addUntracked<edm::InputTag>("CL2Electrons");
0442   desc.addUntracked<edm::InputTag>("CL2Taus");
0443   desc.addUntracked<edm::InputTag>("CL2EtSum");
0444   desc.addUntracked<edm::InputTag>("CL2HtSum");
0445 
0446   edm::ParameterSetDescription inputChannelDesc;
0447   inputChannelDesc.addUntracked<std::vector<unsigned int>>("GCT_1");
0448   inputChannelDesc.addUntracked<std::vector<unsigned int>>("GMT_1");
0449   inputChannelDesc.addUntracked<std::vector<unsigned int>>("GTT_1");
0450   inputChannelDesc.addUntracked<std::vector<unsigned int>>("GTT_2");
0451   inputChannelDesc.addUntracked<std::vector<unsigned int>>("GTT_3");
0452   inputChannelDesc.addUntracked<std::vector<unsigned int>>("GTT_4");
0453   inputChannelDesc.addUntracked<std::vector<unsigned int>>("CL2_1");
0454   inputChannelDesc.addUntracked<std::vector<unsigned int>>("CL2_2");
0455   inputChannelDesc.addUntracked<std::vector<unsigned int>>("CL2_3");
0456 
0457   desc.addOptionalUntracked<edm::ParameterSetDescription>("InputChannels", inputChannelDesc);
0458 
0459   edm::ParameterSetDescription outputChannelDesc;
0460   for (const char* name : AVAILABLE_COLLECTIONS) {
0461     outputChannelDesc.addUntracked<std::vector<unsigned int>>(name);
0462   }
0463 
0464   desc.addOptionalUntracked<edm::ParameterSetDescription>("OutputChannels", outputChannelDesc);
0465 
0466   descriptions.addDefault(desc);
0467 }
0468 
0469 DEFINE_FWK_MODULE(L1GTObjectBoardWriter);