CMS 3D CMS Logo

L1GtTriggerMenuXmlProducer.cc
Go to the documentation of this file.
1 
15 // this class header
17 
18 // system include files
19 #include <memory>
20 
21 // user include files
22 // base class
24 
27 
30 
33 
36 
38 
39 // forward declarations
40 
41 // constructor(s)
43  // tell the framework what data is being produced
45 
46  // now do what ever other initialization is needed
47 
48  // directory in /data/Luminosity for the trigger menu
49  std::string menuDir = parSet.getParameter<std::string>("TriggerMenuLuminosity");
50 
51  // def.xml file
52  std::string defXmlFileName = parSet.getParameter<std::string>("DefXmlFile");
53 
54  edm::FileInPath f1("L1TriggerConfig/L1GtConfigProducers/data/Luminosity/" + menuDir + "/" + defXmlFileName);
55 
56  m_defXmlFile = f1.fullPath();
57 
58  // vme.xml file
59  std::string vmeXmlFileName = parSet.getParameter<std::string>("VmeXmlFile");
60 
61  if (!vmeXmlFileName.empty()) {
62  edm::FileInPath f2("L1TriggerConfig/L1GtConfigProducers/data/Luminosity/" + menuDir + "/" + vmeXmlFileName);
63 
64  m_vmeXmlFile = f2.fullPath();
65  }
66 
67  edm::LogInfo("L1GtConfigProducers") << "\n\nL1 Trigger Menu: "
68  << "\n\n def.xml file: \n " << m_defXmlFile << "\n\n vme.xml file: \n "
69  << m_vmeXmlFile << "\n\n"
70  << std::endl;
71 }
72 
73 // destructor
75  // empty
76 }
77 
78 // member functions
79 
80 // method called to produce the data
81 std::unique_ptr<L1GtTriggerMenu> L1GtTriggerMenuXmlProducer::produceGtTriggerMenu(
82  const L1GtTriggerMenuRcd& l1MenuRecord) {
83  // get the parameters needed from other records
84  edm::ESHandle<L1GtStableParameters> stableParameters = l1MenuRecord.getHandle(m_getToken);
85 
86  unsigned int numberConditionChips = stableParameters->gtNumberConditionChips();
87  unsigned int pinsOnConditionChip = stableParameters->gtPinsOnConditionChip();
88  std::vector<int> orderConditionChip = stableParameters->gtOrderConditionChip();
89  unsigned int numberPhysTriggers = stableParameters->gtNumberPhysTriggers();
90  unsigned int numberTechTriggers = stableParameters->gtNumberTechnicalTriggers();
91  unsigned int numberL1JetCounts = stableParameters->gtNumberL1JetCounts();
92 
94 
95  gtXmlParser.setGtNumberConditionChips(numberConditionChips);
96  gtXmlParser.setGtPinsOnConditionChip(pinsOnConditionChip);
97  gtXmlParser.setGtOrderConditionChip(orderConditionChip);
98  gtXmlParser.setGtNumberPhysTriggers(numberPhysTriggers);
99  gtXmlParser.setGtNumberTechTriggers(numberTechTriggers);
100  gtXmlParser.setGtNumberL1JetCounts(numberL1JetCounts);
101 
102  gtXmlParser.parseXmlFile(m_defXmlFile, m_vmeXmlFile);
103 
104  // transfer the condition map and algorithm map from parser to L1GtTriggerMenu
105 
106  auto pL1GtTriggerMenu = std::make_unique<L1GtTriggerMenu>(gtXmlParser.gtTriggerMenuName(),
107  numberConditionChips,
108  gtXmlParser.vecMuonTemplate(),
109  gtXmlParser.vecCaloTemplate(),
110  gtXmlParser.vecEnergySumTemplate(),
111  gtXmlParser.vecJetCountsTemplate(),
112  gtXmlParser.vecCastorTemplate(),
113  gtXmlParser.vecHfBitCountsTemplate(),
114  gtXmlParser.vecHfRingEtSumsTemplate(),
115  gtXmlParser.vecBptxTemplate(),
116  gtXmlParser.vecExternalTemplate(),
117  gtXmlParser.vecCorrelationTemplate(),
118  gtXmlParser.corMuonTemplate(),
119  gtXmlParser.corCaloTemplate(),
120  gtXmlParser.corEnergySumTemplate());
121 
122  pL1GtTriggerMenu->setGtTriggerMenuInterface(gtXmlParser.gtTriggerMenuInterface());
123  pL1GtTriggerMenu->setGtTriggerMenuImplementation(gtXmlParser.gtTriggerMenuImplementation());
124  pL1GtTriggerMenu->setGtScaleDbKey(gtXmlParser.gtScaleDbKey());
125 
126  pL1GtTriggerMenu->setGtAlgorithmMap(gtXmlParser.gtAlgorithmMap());
127  pL1GtTriggerMenu->setGtAlgorithmAliasMap(gtXmlParser.gtAlgorithmAliasMap());
128  pL1GtTriggerMenu->setGtTechnicalTriggerMap(gtXmlParser.gtTechnicalTriggerMap());
129 
130  //LogDebug("L1GtConfigProducers")
131  //<< "\n\nReturning L1 Trigger Menu!"
132  //<< "\n\n"
133  //<< std::endl;
134 
135  return pL1GtTriggerMenu;
136 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const std::string & gtScaleDbKey() const
menu associated scale key
unsigned int gtNumberL1JetCounts() const
get / set the number of L1 jet counts received by GT
const std::string & gtTriggerMenuInterface() const
get / set the trigger menu names
void setGtPinsOnConditionChip(const unsigned int &)
const std::vector< std::vector< L1GtJetCountsTemplate > > & vecJetCountsTemplate() const
unsigned int gtNumberConditionChips() const
hardware stuff
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
void setGtNumberPhysTriggers(const unsigned int &)
const std::vector< std::vector< L1GtCastorTemplate > > & vecCastorTemplate() const
const AlgorithmMap & gtTechnicalTriggerMap() const
get / set the technical trigger map
std::string m_vmeXmlFile
XML file for Global Trigger VME configuration (vme.xml)
const std::vector< std::vector< L1GtCorrelationTemplate > > & vecCorrelationTemplate() const
const std::vector< std::vector< L1GtExternalTemplate > > & vecExternalTemplate() const
const std::vector< std::vector< L1GtMuonTemplate > > & corMuonTemplate() const
const std::vector< std::vector< L1GtCaloTemplate > > & vecCaloTemplate() const
void parseXmlFile(const std::string &defXmlFile, const std::string &vmeXmlFile)
parse def.xml and vme.xml files
ESHandle< ProductT > getHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
edm::ESGetToken< L1GtStableParameters, L1GtStableParametersRcd > m_getToken
Log< level::Info, false > LogInfo
void setGtNumberConditionChips(const unsigned int &)
unsigned int gtPinsOnConditionChip() const
get / set the number of pins on the GTL condition chips
const std::vector< std::vector< L1GtCaloTemplate > > & corCaloTemplate() const
const std::string & gtTriggerMenuName() const
const std::vector< std::vector< L1GtBptxTemplate > > & vecBptxTemplate() const
const std::string & gtTriggerMenuImplementation() const
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
L1GtTriggerMenuXmlProducer(const edm::ParameterSet &)
constructor
const std::vector< std::vector< L1GtEnergySumTemplate > > & vecEnergySumTemplate() const
const std::vector< std::vector< L1GtMuonTemplate > > & vecMuonTemplate() const
get / set the vectors containing the conditions
const std::vector< std::vector< L1GtHfRingEtSumsTemplate > > & vecHfRingEtSumsTemplate() const
void setGtNumberTechTriggers(const unsigned int &)
void setGtOrderConditionChip(const std::vector< int > &)
std::unique_ptr< L1GtTriggerMenu > produceGtTriggerMenu(const L1GtTriggerMenuRcd &)
public methods
std::string m_defXmlFile
XML file for Global Trigger menu (def.xml)
unsigned int gtNumberTechnicalTriggers() const
get / set the number of technical triggers
const std::vector< int > & gtOrderConditionChip() const
const std::vector< std::vector< L1GtHfBitCountsTemplate > > & vecHfBitCountsTemplate() const
~L1GtTriggerMenuXmlProducer() override
destructor
unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
const std::vector< std::vector< L1GtEnergySumTemplate > > & corEnergySumTemplate() const
void setGtNumberL1JetCounts(const unsigned int &)