Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:19

0001 /**
0002  * \class L1GtStableParametersTrivialProducer
0003  * 
0004  * 
0005  * Description: ESProducer for L1 GT parameters.  
0006  *
0007  * Implementation:
0008  *    <TODO: enter implementation details>
0009  *   
0010  * \author: Vasile Mihai Ghete - HEPHY Vienna
0011  * 
0012  *
0013  */
0014 
0015 // this class header
0016 #include "L1TriggerConfig/L1GtConfigProducers/interface/L1GtStableParametersTrivialProducer.h"
0017 
0018 // system include files
0019 #include <memory>
0020 #include <vector>
0021 
0022 // user include files
0023 //   base class
0024 #include "FWCore/Framework/interface/ESProducer.h"
0025 
0026 #include "FWCore/Framework/interface/ModuleFactory.h"
0027 #include "FWCore/Framework/interface/ESHandle.h"
0028 
0029 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0030 #include "FWCore/MessageLogger/interface/MessageDrop.h"
0031 
0032 #include "CondFormats/DataRecord/interface/L1GtStableParametersRcd.h"
0033 
0034 // forward declarations
0035 
0036 // constructor(s)
0037 L1GtStableParametersTrivialProducer::L1GtStableParametersTrivialProducer(const edm::ParameterSet& parSet) {
0038   // tell the framework what data is being produced
0039   setWhatProduced(this, &L1GtStableParametersTrivialProducer::produceGtStableParameters);
0040 
0041   // now do what ever other initialization is needed
0042 
0043   // trigger decision
0044 
0045   // number of physics trigger algorithms
0046   m_numberPhysTriggers = parSet.getParameter<unsigned int>("NumberPhysTriggers");
0047 
0048   // additional number of physics trigger algorithms
0049   m_numberPhysTriggersExtended = parSet.getParameter<unsigned int>("NumberPhysTriggersExtended");
0050 
0051   // number of technical triggers
0052   m_numberTechnicalTriggers = parSet.getParameter<unsigned int>("NumberTechnicalTriggers");
0053 
0054   // trigger objects
0055 
0056   // muons
0057   m_numberL1Mu = parSet.getParameter<unsigned int>("NumberL1Mu");
0058 
0059   // e/gamma and isolated e/gamma objects
0060   m_numberL1NoIsoEG = parSet.getParameter<unsigned int>("NumberL1NoIsoEG");
0061   m_numberL1IsoEG = parSet.getParameter<unsigned int>("NumberL1IsoEG");
0062 
0063   // central, forward and tau jets
0064   m_numberL1CenJet = parSet.getParameter<unsigned int>("NumberL1CenJet");
0065   m_numberL1ForJet = parSet.getParameter<unsigned int>("NumberL1ForJet");
0066   m_numberL1TauJet = parSet.getParameter<unsigned int>("NumberL1TauJet");
0067 
0068   // jet counts
0069   m_numberL1JetCounts = parSet.getParameter<unsigned int>("NumberL1JetCounts");
0070 
0071   // hardware
0072 
0073   // number of maximum chips defined in the xml file
0074   m_numberConditionChips = parSet.getParameter<unsigned int>("NumberConditionChips");
0075 
0076   // number of pins on the GTL condition chips
0077   m_pinsOnConditionChip = parSet.getParameter<unsigned int>("PinsOnConditionChip");
0078 
0079   // correspondence "condition chip - GTL algorithm word" in the hardware
0080   // e.g.: chip 2: 0 - 95;  chip 1: 96 - 128 (191)
0081   m_orderConditionChip = parSet.getParameter<std::vector<int> >("OrderConditionChip");
0082 
0083   // number of PSB boards in GT
0084   m_numberPsbBoards = parSet.getParameter<int>("NumberPsbBoards");
0085 
0086   /// number of bits for eta of calorimeter objects
0087   m_ifCaloEtaNumberBits = parSet.getParameter<unsigned int>("IfCaloEtaNumberBits");
0088 
0089   /// number of bits for eta of calorimeter objects
0090   m_ifMuEtaNumberBits = parSet.getParameter<unsigned int>("IfMuEtaNumberBits");
0091 
0092   // GT DAQ record organized in words of WordLength bits
0093   m_wordLength = parSet.getParameter<int>("WordLength");
0094 
0095   // one unit in the word is UnitLength bits
0096   m_unitLength = parSet.getParameter<int>("UnitLength");
0097 }
0098 
0099 // destructor
0100 L1GtStableParametersTrivialProducer::~L1GtStableParametersTrivialProducer() {
0101   // empty
0102 }
0103 
0104 // member functions
0105 
0106 // method called to produce the data
0107 std::unique_ptr<L1GtStableParameters> L1GtStableParametersTrivialProducer::produceGtStableParameters(
0108     const L1GtStableParametersRcd& iRecord) {
0109   auto pL1GtStableParameters = std::make_unique<L1GtStableParameters>();
0110 
0111   // set the number of physics trigger algorithms
0112   pL1GtStableParameters->setGtNumberPhysTriggers(m_numberPhysTriggers);
0113 
0114   // set the additional number of physics trigger algorithms
0115   pL1GtStableParameters->setGtNumberPhysTriggersExtended(m_numberPhysTriggersExtended);
0116 
0117   // set the number of technical triggers
0118   pL1GtStableParameters->setGtNumberTechnicalTriggers(m_numberTechnicalTriggers);
0119 
0120   // set the number of L1 muons received by GT
0121   pL1GtStableParameters->setGtNumberL1Mu(m_numberL1Mu);
0122 
0123   //  set the number of L1 e/gamma objects received by GT
0124   pL1GtStableParameters->setGtNumberL1NoIsoEG(m_numberL1NoIsoEG);
0125 
0126   //  set the number of L1 isolated e/gamma objects received by GT
0127   pL1GtStableParameters->setGtNumberL1IsoEG(m_numberL1IsoEG);
0128 
0129   // set the number of L1 central jets received by GT
0130   pL1GtStableParameters->setGtNumberL1CenJet(m_numberL1CenJet);
0131 
0132   // set the number of L1 forward jets received by GT
0133   pL1GtStableParameters->setGtNumberL1ForJet(m_numberL1ForJet);
0134 
0135   // set the number of L1 tau jets received by GT
0136   pL1GtStableParameters->setGtNumberL1TauJet(m_numberL1TauJet);
0137 
0138   // set the number of L1 jet counts received by GT
0139   pL1GtStableParameters->setGtNumberL1JetCounts(m_numberL1JetCounts);
0140 
0141   // hardware stuff
0142 
0143   // set the number of condition chips in GTL
0144   pL1GtStableParameters->setGtNumberConditionChips(m_numberConditionChips);
0145 
0146   // set the number of pins on the GTL condition chips
0147   pL1GtStableParameters->setGtPinsOnConditionChip(m_pinsOnConditionChip);
0148 
0149   // set the correspondence "condition chip - GTL algorithm word"
0150   // in the hardware
0151   pL1GtStableParameters->setGtOrderConditionChip(m_orderConditionChip);
0152 
0153   // set the number of PSB boards in GT
0154   pL1GtStableParameters->setGtNumberPsbBoards(m_numberPsbBoards);
0155 
0156   //   set the number of bits for eta of calorimeter objects
0157   pL1GtStableParameters->setGtIfCaloEtaNumberBits(m_ifCaloEtaNumberBits);
0158 
0159   //   set the number of bits for eta of muon objects
0160   pL1GtStableParameters->setGtIfMuEtaNumberBits(m_ifMuEtaNumberBits);
0161 
0162   // set WordLength
0163   pL1GtStableParameters->setGtWordLength(m_wordLength);
0164 
0165   // set one UnitLength
0166   pL1GtStableParameters->setGtUnitLength(m_unitLength);
0167 
0168   //
0169   //
0170   return pL1GtStableParameters;
0171 }