CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
OMTFReconstruction Class Reference

#include <OMTFReconstruction.h>

Public Member Functions

virtual void addObservers (const MuonGeometryTokens &muonGeometryTokens, const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > &magneticFieldEsToken, const edm::ESGetToken< Propagator, TrackingComponentsRecord > &propagatorEsToken)
 
void beginJob ()
 
void beginJob ()
 
void beginRun (edm::Run const &, edm::EventSetup const &)
 
void beginRun (edm::Run const &run, edm::EventSetup const &iSetup, edm::ESGetToken< L1TMuonOverlapParams, L1TMuonOverlapParamsRcd > &omtfParamsEsToken, const MuonGeometryTokens &muonGeometryTokens, const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > &magneticFieldEsToken, const edm::ESGetToken< Propagator, TrackingComponentsRecord > &propagatorEsToken)
 
void endJob ()
 
void endJob ()
 
 OMTFReconstruction (const edm::ParameterSet &, MuStubsInputTokens &muStubsInputTokens)
 
 OMTFReconstruction (const edm::ParameterSet &, edm::ConsumesCollector &&)
 
std::unique_ptr
< l1t::RegionalMuonCandBxCollection
reconstruct (const edm::Event &, const edm::EventSetup &)
 
std::unique_ptr
< l1t::RegionalMuonCandBxCollection
reconstruct (const edm::Event &, const edm::EventSetup &)
 
void setInputMaker (unique_ptr< OMTFinputMaker > inputMaker)
 
 ~OMTFReconstruction ()
 
virtual ~OMTFReconstruction ()
 

Protected Attributes

edm::ParameterSet edmParameterSet
 
unique_ptr< OMTFinputMakerinputMaker
 
MuStubsInputTokensmuStubsInputTokens
 
std::vector< std::unique_ptr
< IOMTFEmulationObserver > > 
observers
 
unique_ptr< OMTFConfigurationomtfConfig
 OMTF objects. More...
 
edm::ESWatcher
< L1TMuonOverlapParamsRcd
omtfParamsRecordWatcher
 
unique_ptr< IProcessorEmulatoromtfProc
 

Private Member Functions

void getProcessorCandidates (unsigned int iProcessor, l1t::tftype mtfType, int bx, l1t::RegionalMuonCandBxCollection &myCandidates)
 
void loadAndFilterDigis (const edm::Event &)
 
void writeResultToXML (unsigned int iProcessor, l1t::tftype mtfType, const OMTFinput &myInput, const std::vector< OMTFProcessor::resultsMap > &myResults, const std::vector< l1t::RegionalMuonCand > &candMuons)
 

Private Attributes

xercesc::DOMElement * aTopElement
 
int bxMax
 
int bxMin
 
edm::Handle
< CSCCorrelatedLCTDigiCollection
cscDigis
 
edm::Handle
< L1MuDTChambPhContainer
dtPhDigis
 
edm::Handle
< L1MuDTChambThContainer
dtThDigis
 
bool dumpDetailedResultToXML
 
bool dumpResultToXML
 
edm::ESGetToken
< L1TMuonOverlapParams,
L1TMuonOverlapParamsRcd
l1TMuonOverlapParamsToken_
 
edm::ParameterSet m_Config
 
std::unique_ptr< IGhostBusterm_GhostBuster
 
OMTFinputMaker m_InputMaker
 
OMTFProcessorm_OMTF
 
OMTFConfigurationm_OMTFConfig
 OMTF objects. More...
 
OMTFConfigMakerm_OMTFConfigMaker
 
OMTFSorter m_Sorter
 
XMLConfigWriterm_Writer
 
edm::Handle< RPCDigiCollectionrpcDigis
 

Detailed Description

Definition at line 37 of file OMTFReconstruction.h.

Constructor & Destructor Documentation

OMTFReconstruction::OMTFReconstruction ( const edm::ParameterSet theConfig,
edm::ConsumesCollector &&  iC 
)

Definition at line 21 of file OMTFReconstruction.cc.

References bxMax, bxMin, dumpDetailedResultToXML, dumpResultToXML, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), and m_Config.

22  : m_Config(theConfig),
25  m_OMTFConfig(nullptr),
26  m_InputMaker(iC, false),
27  m_OMTF(nullptr),
28  aTopElement(nullptr),
29  m_OMTFConfigMaker(nullptr),
30  m_Writer(nullptr) {
31  dumpResultToXML = m_Config.getParameter<bool>("dumpResultToXML");
32  dumpDetailedResultToXML = m_Config.getParameter<bool>("dumpDetailedResultToXML");
33  //m_Config.getParameter<std::string>("XMLDumpFileName");
34  bxMin = m_Config.exists("bxMin") ? m_Config.getParameter<int>("bxMin") : 0;
35  bxMax = m_Config.exists("bxMax") ? m_Config.getParameter<int>("bxMax") : 0;
36 }
edm::ESGetToken< L1TMuonOverlapParams, L1TMuonOverlapParamsRcd > l1TMuonOverlapParamsToken_
OMTFConfiguration * m_OMTFConfig
OMTF objects.
bool exists(std::string const &parameterName) const
checks if a parameter exists
xercesc::DOMElement * aTopElement
OMTFProcessor * m_OMTF
XMLConfigWriter * m_Writer
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
OMTFinputMaker m_InputMaker
OMTFConfigMaker * m_OMTFConfigMaker
edm::ParameterSet m_Config
OMTFReconstruction::~OMTFReconstruction ( )

Definition at line 39 of file OMTFReconstruction.cc.

References m_OMTF, m_OMTFConfig, and m_Writer.

39  {
40  delete m_OMTFConfig;
41  delete m_OMTF;
42 
43  if (m_Writer)
44  delete m_Writer;
45 }
OMTFConfiguration * m_OMTFConfig
OMTF objects.
OMTFProcessor * m_OMTF
XMLConfigWriter * m_Writer
OMTFReconstruction::OMTFReconstruction ( const edm::ParameterSet parameterSet,
MuStubsInputTokens muStubsInputTokens 
)

Definition at line 29 of file OMTFReconstruction.cc.

References bxMax, bxMin, edmParameterSet, edm::ParameterSet::exists(), and edm::ParameterSet::getParameter().

30  : edmParameterSet(parameterSet),
31  muStubsInputTokens(muStubsInputTokens),
33  omtfProc(nullptr),
34  m_OMTFConfigMaker(nullptr) {
35  bxMin = edmParameterSet.exists("bxMin") ? edmParameterSet.getParameter<int>("bxMin") : 0;
36  bxMax = edmParameterSet.exists("bxMax") ? edmParameterSet.getParameter<int>("bxMax") : 0;
37 
38  edm::LogVerbatim("OMTFReconstruction") << "running emulation for the bxMin " << bxMin << " - bxMax " << bxMax
39  << std::endl;
40 }
Log< level::Info, true > LogVerbatim
bool exists(std::string const &parameterName) const
checks if a parameter exists
MuStubsInputTokens & muStubsInputTokens
unique_ptr< OMTFConfiguration > omtfConfig
OMTF objects.
edm::ParameterSet edmParameterSet
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
unique_ptr< IProcessorEmulator > omtfProc
OMTFConfigMaker * m_OMTFConfigMaker
virtual OMTFReconstruction::~OMTFReconstruction ( )
virtual

Member Function Documentation

void OMTFReconstruction::addObservers ( const MuonGeometryTokens muonGeometryTokens,
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > &  magneticFieldEsToken,
const edm::ESGetToken< Propagator, TrackingComponentsRecord > &  propagatorEsToken 
)
virtual

Definition at line 182 of file OMTFReconstruction.cc.

References edmParameterSet, edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), magneticFieldEsToken(), omtfConfig, omtfProc, propagatorEsToken(), dtT0Analyzer_cfg::rootFileName, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by beginRun().

185  {
186  if (!observers.empty()) //assuring it is done only at the first run
187  return;
188 
189  edm::LogVerbatim("OMTFReconstruction") << "OMTFReconstruction::addObservers " << std::endl;
190 
191  //omtfConfig is created at constructor, and is not re-created at the the start of the run, so this is OK
192  if (edmParameterSet.exists("dumpResultToXML")) {
193  if (edmParameterSet.getParameter<bool>("dumpResultToXML"))
194  observers.emplace_back(std::make_unique<XMLEventWriter>(
195  omtfConfig.get(), edmParameterSet.getParameter<std::string>("XMLDumpFileName")));
196  }
197 
198  CandidateSimMuonMatcher* candidateSimMuonMatcher = nullptr;
199 
200  if (edmParameterSet.exists("candidateSimMuonMatcher")) {
201  if (edmParameterSet.getParameter<bool>("candidateSimMuonMatcher")) {
202  observers.emplace_back(std::make_unique<CandidateSimMuonMatcher>(
204  candidateSimMuonMatcher = static_cast<CandidateSimMuonMatcher*>(observers.back().get());
205  }
206  }
207 
208  auto omtfProcGoldenPat = dynamic_cast<OMTFProcessor<GoldenPattern>*>(omtfProc.get());
209  if (omtfProcGoldenPat) {
210  if (edmParameterSet.exists("eventCaptureDebug"))
211  if (edmParameterSet.getParameter<bool>("eventCaptureDebug")) {
212  observers.emplace_back(std::make_unique<EventCapture>(
213  edmParameterSet, omtfConfig.get(), candidateSimMuonMatcher, muonGeometryTokens
214  //&(omtfProcGoldenPat->getPatterns() ),
215  //watch out, will crash if the proc is re-constructed from the DB after L1TMuonOverlapParamsRcd change
216  ));
217  }
218 
219  if (edmParameterSet.exists("dumpHitsToROOT") && edmParameterSet.getParameter<bool>("dumpHitsToROOT")) {
221  observers.emplace_back(std::make_unique<DataROOTDumper2>(edmParameterSet, omtfConfig.get(), rootFileName));
222  }
223  }
224 }
Log< level::Info, true > LogVerbatim
bool exists(std::string const &parameterName) const
checks if a parameter exists
std::vector< std::unique_ptr< IOMTFEmulationObserver > > observers
unique_ptr< OMTFConfiguration > omtfConfig
OMTF objects.
edm::ParameterSet edmParameterSet
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
unique_ptr< IProcessorEmulator > omtfProc
propagatorEsToken(esConsumes< Propagator, TrackingComponentsRecord, edm::Transition::BeginRun >(edm::ESInputTag("","SteppingHelixPropagatorAlong")))
magneticFieldEsToken(esConsumes< MagneticField, IdealMagneticFieldRecord, edm::Transition::BeginRun >())
void OMTFReconstruction::beginJob ( )
void OMTFReconstruction::beginJob ( void  )

Definition at line 49 of file OMTFReconstruction.cc.

References m_OMTF, and m_OMTFConfig.

Referenced by L1TMuonOverlapPhase1TrackProducer::beginJob(), and L1TMuonOverlapTrackProducer::beginJob().

49  {
51  m_OMTF = new OMTFProcessor();
52 }
OMTFConfiguration * m_OMTFConfig
OMTF objects.
OMTFProcessor * m_OMTF
void OMTFReconstruction::beginRun ( edm::Run const &  run,
edm::EventSetup const &  iSetup,
edm::ESGetToken< L1TMuonOverlapParams, L1TMuonOverlapParamsRcd > &  omtfParamsEsToken,
const MuonGeometryTokens muonGeometryTokens,
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > &  magneticFieldEsToken,
const edm::ESGetToken< Propagator, TrackingComponentsRecord > &  propagatorEsToken 
)

Definition at line 61 of file OMTFReconstruction.cc.

References addObservers(), edm::ESWatcher< T >::check(), edmParameterSet, Exception, edm::ParameterSet::exists(), edm::FileInPath::fullPath(), edm::EventSetup::getData(), edm::ParameterSet::getParameter(), edm::RunBase::id(), inputMaker, omtfConfig, fakeOmtfParams_cff::omtfParams, omtfParamsRecordWatcher, omtfProc, XMLConfigReader::readPatterns(), and AlCaHLTBitMon_QueryRunRegistry::string.

66  {
67  const L1TMuonOverlapParams* omtfParams = nullptr;
68 
69  std::string processorType = "OMTFProcessor"; //GoldenPatternWithStat GoldenPattern
70  if (edmParameterSet.exists("processorType")) {
71  processorType = edmParameterSet.getParameter<std::string>("processorType");
72  }
73 
74  bool buildPatternsFromXml = (edmParameterSet.exists("patternsXMLFile") || edmParameterSet.exists("patternsXMLFiles"));
75 
76  edm::LogVerbatim("OMTFReconstruction") << "OMTFReconstruction::beginRun " << run.id()
77  << " buildPatternsFromXml: " << buildPatternsFromXml << std::endl;
78 
79  //if the buildPatternsFromXml == false - we are making the omtfConfig and omtfProc for every run,
80  //as the configuration my change between the runs,
81  //if buildPatternsFromXml == true - we assume the the entire configuration comes from phyton,
82  //so we do it only for the first run
83  if (omtfProc == nullptr || buildPatternsFromXml == false) {
84  if (omtfParamsRecordWatcher.check(eventSetup)) {
85  edm::LogVerbatim("OMTFReconstruction") << "retrieving omtfParams from EventSetup" << std::endl;
86 
87  omtfParams = &(eventSetup.getData(omtfParamsEsToken));
88  if (!omtfParams) {
89  edm::LogError("OMTFReconstruction") << "Could not retrieve parameters from Event Setup" << std::endl;
90  }
91  omtfConfig->configure(omtfParams);
92 
93  //the parameters can be overwritten from the python config
94  omtfConfig->configureFromEdmParameterSet(edmParameterSet);
95 
96  inputMaker->initialize(edmParameterSet, eventSetup, muonGeometryTokens);
97 
98  //patterns from the edm::EventSetup are reloaded every beginRun
99  if (buildPatternsFromXml == false) {
100  edm::LogVerbatim("OMTFReconstruction") << "getting patterns from EventSetup" << std::endl;
101  if (processorType == "OMTFProcessor") {
102  omtfProc = std::make_unique<OMTFProcessor<GoldenPattern> >(
103  omtfConfig.get(), edmParameterSet, eventSetup, omtfParams);
104  omtfProc->printInfo();
105  }
106  }
107  }
108  }
109 
110  //if we read the patterns directly from the xml, we do it only once, at the beginning of the first run, not every run
111  if (omtfProc == nullptr && buildPatternsFromXml) {
112  std::vector<std::string> patternsXMLFiles;
113 
114  if (edmParameterSet.exists("patternsXMLFile")) {
115  patternsXMLFiles.push_back(edmParameterSet.getParameter<edm::FileInPath>("patternsXMLFile").fullPath());
116  } else if (edmParameterSet.exists("patternsXMLFiles")) {
117  for (const auto& it : edmParameterSet.getParameter<std::vector<edm::ParameterSet> >("patternsXMLFiles")) {
118  patternsXMLFiles.push_back(it.getParameter<edm::FileInPath>("patternsXMLFile").fullPath());
119  }
120  }
121 
122  for (auto& patternsXMLFile : patternsXMLFiles)
123  edm::LogVerbatim("OMTFReconstruction") << "reading patterns from " << patternsXMLFile << std::endl;
124 
125  XMLConfigReader xmlReader;
126 
127  std::string patternType = "GoldenPattern"; //GoldenPatternWithStat GoldenPattern
128  if (edmParameterSet.exists("patternType")) {
129  patternType = edmParameterSet.getParameter<std::string>("patternType");
130  }
131 
132  if (patternType == "GoldenPattern") {
133  if (processorType == "OMTFProcessor") {
134  if (omtfParams) {
135  omtfProc = std::make_unique<OMTFProcessor<GoldenPattern> >(
136  omtfConfig.get(),
138  eventSetup,
139  xmlReader.readPatterns<GoldenPattern>(*omtfParams, patternsXMLFiles, false));
140  } else { //in principle should not happen
141  throw cms::Exception("OMTFReconstruction::beginRun: omtfParams is nullptr");
142  }
143  }
144 
145  edm::LogVerbatim("OMTFReconstruction") << "OMTFProcessor constructed. processorType " << processorType
146  << ". GoldenPattern type: " << patternType << std::endl;
147  } else if (patternType == "GoldenPatternWithStat") {
148  //pattern generation is only possible if the processor is constructed only once per job
149  //PatternGenerator modifies the patterns!!!
150  if (processorType == "OMTFProcessor") {
151  if (omtfParams) {
152  omtfProc = std::make_unique<OMTFProcessor<GoldenPatternWithStat> >(
153  omtfConfig.get(),
155  eventSetup,
156  xmlReader.readPatterns<GoldenPatternWithStat>(*omtfParams, patternsXMLFiles, false));
157  } else { //in principle should not happen
158  throw cms::Exception("OMTFReconstruction::beginRun: omtfParams is nullptr");
159  }
160  auto omtfProcGoldenPat = dynamic_cast<OMTFProcessor<GoldenPatternWithStat>*>(omtfProc.get());
161 
162  if (edmParameterSet.exists("generatePatterns") && edmParameterSet.getParameter<bool>("generatePatterns")) {
163  observers.emplace_back(
164  std::make_unique<PatternGenerator>(edmParameterSet, omtfConfig.get(), omtfProcGoldenPat->getPatterns()));
165  edm::LogVerbatim("OMTFReconstruction") << "generatePatterns: true " << std::endl;
166  }
167  }
168  } else {
169  throw cms::Exception("OMTFReconstruction::beginRun: unknown GoldenPattern type: " + patternType);
170  }
171 
172  omtfProc->printInfo();
173  }
174 
175  addObservers(muonGeometryTokens, magneticFieldEsToken, propagatorEsToken);
176 
177  for (auto& obs : observers) {
178  obs->beginRun(eventSetup);
179  }
180 }
Log< level::Info, true > LogVerbatim
tuple omtfParams
OMTF ESProducer.
bool exists(std::string const &parameterName) const
checks if a parameter exists
virtual void addObservers(const MuonGeometryTokens &muonGeometryTokens, const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > &magneticFieldEsToken, const edm::ESGetToken< Propagator, TrackingComponentsRecord > &propagatorEsToken)
edm::ESWatcher< L1TMuonOverlapParamsRcd > omtfParamsRecordWatcher
Log< level::Error, false > LogError
unique_ptr< OMTFinputMaker > inputMaker
std::vector< std::unique_ptr< IOMTFEmulationObserver > > observers
std::vector< std::shared_ptr< GoldenPattern > > readPatterns(const L1TMuonOverlapParams &aConfig)
unique_ptr< OMTFConfiguration > omtfConfig
OMTF objects.
edm::ParameterSet edmParameterSet
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
unique_ptr< IProcessorEmulator > omtfProc
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
std::string fullPath() const
Definition: FileInPath.cc:161
void OMTFReconstruction::beginRun ( edm::Run const &  ,
edm::EventSetup const &  iSetup 
)

Definition at line 63 of file OMTFReconstruction.cc.

References OMTFProcessor< GoldenPatternType >::configure(), OMTFConfiguration::configure(), dumpResultToXML, isotrackTrainRegressor::fName, OMTFConfiguration::fwVersion(), edm::EventSetup::getData(), XMLConfigWriter::initialiseXMLDocument(), OMTFSorter< GoldenPatternType >::initialize(), OMTFinputMaker::initialize(), l1TMuonOverlapParamsToken_, m_GhostBuster, m_InputMaker, m_OMTF, m_OMTFConfig, m_Sorter, m_Writer, OMTFConfiguration::nPhiBins(), fakeOmtfParams_cff::omtfParams, OMTFSorter< GoldenPatternType >::setNphiBins(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by L1TMuonOverlapPhase1TrackProducer::beginRun(), and L1TMuonOverlapTrackProducer::beginRun().

63  {
65 
66  if (!omtfParams) {
67  edm::LogError("L1TMuonOverlapTrackProducer") << "Could not retrieve parameters from Event Setup" << std::endl;
68  }
69 
70  m_OMTFConfig->configure(omtfParams);
71  m_OMTF->configure(m_OMTFConfig, omtfParams);
72  //m_GhostBuster.setNphiBins(m_OMTFConfig->nPhiBins());
73 
74  if (m_OMTFConfig->fwVersion() >= 5) {
75  // if(m_Config.exists("ghostBusterType") ) {
76  // if(m_Config.getParameter<std::string>("ghostBusterType") == "GhostBusterPreferRefDt")
77  m_GhostBuster = std::make_unique<GhostBusterPreferRefDt>(m_OMTFConfig);
78  } else {
79  m_GhostBuster = std::make_unique<GhostBuster>();
80  }
81 
84 
86 
87  if (dumpResultToXML) {
89  std::string fName = "OMTF";
91  }
92 }
edm::ESGetToken< L1TMuonOverlapParams, L1TMuonOverlapParamsRcd > l1TMuonOverlapParamsToken_
OMTFConfiguration * m_OMTFConfig
OMTF objects.
unsigned int fwVersion() const
tuple omtfParams
OMTF ESProducer.
void initialiseXMLDocument(const std::string &docName)
unsigned int nPhiBins() const
void initialize(const edm::EventSetup &, const OMTFConfiguration *)
Log< level::Error, false > LogError
std::unique_ptr< IGhostBuster > m_GhostBuster
void setNphiBins(unsigned int phiBins)
Definition: OMTFSorter.h:20
OMTFProcessor * m_OMTF
XMLConfigWriter * m_Writer
void configure(const L1TMuonOverlapParams *omtfParams)
OMTFinputMaker m_InputMaker
bool configure(const OMTFConfiguration *omtfParams, const L1TMuonOverlapParams *omtfPatterns)
Fill GP map with patterns from CondFormats object.
void initialize(const OMTFConfiguration *cfg)
Definition: OMTFSorter.h:19
void OMTFReconstruction::endJob ( void  )
void OMTFReconstruction::endJob ( )
void OMTFReconstruction::getProcessorCandidates ( unsigned int  iProcessor,
l1t::tftype  mtfType,
int  bx,
l1t::RegionalMuonCandBxCollection myCandidates 
)
private

Definition at line 137 of file OMTFReconstruction.cc.

References OMTFinputMaker::buildInputForProcessor(), makePileupJSON::bx, OMTFSorter< GoldenPatternType >::candidates(), cscDigis, dtPhDigis, dtThDigis, OMTFinputMaker::getFlag(), input, m_GhostBuster, m_InputMaker, m_OMTF, m_Sorter, OMTFProcessor< GoldenPatternType >::processInput(), edm::Handle< T >::product(), BXVector< T >::push_back(), bookConverter::results, rpcDigis, OMTFinputMaker::setFlag(), OMTFSorter< GoldenPatternType >::sortRefHitResults(), and writeResultToXML().

Referenced by reconstruct().

140  {
143  dtPhDigis.product(), dtThDigis.product(), cscDigis.product(), rpcDigis.product(), iProcessor, mtfType, bx);
144  int flag = m_InputMaker.getFlag();
145 
146  const std::vector<OMTFProcessor::resultsMap>& results = m_OMTF->processInput(iProcessor, input);
147 
148  std::vector<AlgoMuon> algoCandidates;
149 
150  m_Sorter.sortRefHitResults(results, algoCandidates);
151 
152  // perform GB
153  std::vector<AlgoMuon> gbCandidates = m_GhostBuster->select(algoCandidates);
154 
155  // fill RegionalMuonCand colleciton
156  std::vector<l1t::RegionalMuonCand> candMuons = m_Sorter.candidates(iProcessor, mtfType, gbCandidates);
157 
158  //fill outgoing collection
159  for (auto& candMuon : candMuons) {
160  candMuon.setHwQual(candMuon.hwQual() | flag); //FIXME temporary debug fix
161  omtfCandidates.push_back(bx, candMuon);
162  }
163 
164  //dump to XML
165  if (bx == 0)
166  writeResultToXML(iProcessor, mtfType, input, results, candMuons);
167 }
OMTFinput buildInputForProcessor(const L1MuDTChambPhContainer *dtPhDigis, const L1MuDTChambThContainer *dtThDigis, const CSCCorrelatedLCTDigiCollection *cscDigis, const RPCDigiCollection *rpcDigis, unsigned int iProcessor, l1t::tftype type=l1t::tftype::omtf_pos, int bx=0)
Method translating trigger digis into input matrix with global phi coordinates.
dictionary results
std::unique_ptr< IGhostBuster > m_GhostBuster
static std::string const input
Definition: EdmProvDump.cc:47
OMTFProcessor * m_OMTF
void writeResultToXML(unsigned int iProcessor, l1t::tftype mtfType, const OMTFinput &myInput, const std::vector< OMTFProcessor::resultsMap > &myResults, const std::vector< l1t::RegionalMuonCand > &candMuons)
const std::vector< OMTFProcessor::resultsMap > & processInput(unsigned int iProcessor, const OMTFinput &aInput)
int getFlag() const
edm::Handle< RPCDigiCollection > rpcDigis
void setFlag(int aFlag)
T const * product() const
Definition: Handle.h:70
std::vector< l1t::RegionalMuonCand > candidates(unsigned int iProcessor, l1t::tftype mtfType, const std::vector< AlgoMuon > &algoCands)
Definition: OMTFSorter.cc:157
edm::Handle< L1MuDTChambThContainer > dtThDigis
OMTFinputMaker m_InputMaker
edm::Handle< L1MuDTChambPhContainer > dtPhDigis
void sortRefHitResults(const std::vector< OMTFProcessor::resultsMap > &procResults, std::vector< AlgoMuon > &refHitCleanCands, int charge=0)
Definition: OMTFSorter.cc:131
edm::Handle< CSCCorrelatedLCTDigiCollection > cscDigis
void OMTFReconstruction::loadAndFilterDigis ( const edm::Event iEvent)
private

Definition at line 123 of file OMTFReconstruction.cc.

References cscDigis, dtPhDigis, dtThDigis, edm::Event::getByLabel(), edm::ParameterSet::getParameter(), m_Config, and rpcDigis.

Referenced by reconstruct().

123  {
124  // Filter digis by dropping digis from selected (by cfg.py) subsystems
125  if (!m_Config.getParameter<bool>("dropDTPrimitives")) {
128  }
129  if (!m_Config.getParameter<bool>("dropRPCPrimitives"))
131  if (!m_Config.getParameter<bool>("dropCSCPrimitives"))
133 }
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:500
edm::Handle< RPCDigiCollection > rpcDigis
edm::Handle< L1MuDTChambThContainer > dtThDigis
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::Handle< L1MuDTChambPhContainer > dtPhDigis
edm::ParameterSet m_Config
edm::Handle< CSCCorrelatedLCTDigiCollection > cscDigis
std::unique_ptr< l1t::RegionalMuonCandBxCollection > OMTFReconstruction::reconstruct ( const edm::Event iEvent,
const edm::EventSetup evSetup 
)

The order is important: first put omtf_pos candidates, then omtf_neg.

Definition at line 95 of file OMTFReconstruction.cc.

References aTopElement, makePileupJSON::bx, bxMax, bxMin, HLT_FULL_cff::candidates, dumpResultToXML, edm::EventID::event(), getProcessorCandidates(), edm::EventBase::id(), loadAndFilterDigis(), m_OMTFConfig, m_Writer, OMTFConfiguration::nProcessors(), l1t::omtf_neg, l1t::omtf_pos, and XMLConfigWriter::writeEventHeader().

Referenced by L1TMuonOverlapPhase1TrackProducer::produce(), and L1TMuonOverlapTrackProducer::produce().

96  {
97  loadAndFilterDigis(iEvent);
98 
99  if (dumpResultToXML)
101 
102  std::unique_ptr<l1t::RegionalMuonCandBxCollection> candidates(new l1t::RegionalMuonCandBxCollection);
103  candidates->setBXRange(bxMin, bxMax);
104 
106  for (int bx = bxMin; bx <= bxMax; bx++) {
107  for (unsigned int iProcessor = 0; iProcessor < m_OMTFConfig->nProcessors(); ++iProcessor)
109 
110  for (unsigned int iProcessor = 0; iProcessor < m_OMTFConfig->nProcessors(); ++iProcessor)
112 
113  edm::LogInfo("OMTFReconstruction") << "OMTF: Number of candidates in BX=" << bx << ": " << candidates->size(bx)
114  << std::endl;
115  ;
116  }
117 
118  return candidates;
119 }
EventNumber_t event() const
Definition: EventID.h:40
void getProcessorCandidates(unsigned int iProcessor, l1t::tftype mtfType, int bx, l1t::RegionalMuonCandBxCollection &myCandidates)
OMTFConfiguration * m_OMTFConfig
OMTF objects.
xercesc::DOMElement * aTopElement
unsigned int nProcessors() const
void loadAndFilterDigis(const edm::Event &)
XMLConfigWriter * m_Writer
Log< level::Info, false > LogInfo
edm::EventID id() const
Definition: EventBase.h:59
xercesc::DOMElement * writeEventHeader(unsigned int eventId, unsigned int mixedEventId=0)
std::unique_ptr<l1t::RegionalMuonCandBxCollection> OMTFReconstruction::reconstruct ( const edm::Event ,
const edm::EventSetup  
)
void OMTFReconstruction::setInputMaker ( unique_ptr< OMTFinputMaker inputMaker)
inline

Definition at line 57 of file OMTFReconstruction.h.

References eostools::move().

57 { this->inputMaker = std::move(inputMaker); }
unique_ptr< OMTFinputMaker > inputMaker
def move
Definition: eostools.py:511
void OMTFReconstruction::writeResultToXML ( unsigned int  iProcessor,
l1t::tftype  mtfType,
const OMTFinput myInput,
const std::vector< OMTFProcessor::resultsMap > &  myResults,
const std::vector< l1t::RegionalMuonCand > &  candMuons 
)
private

Dump only regions, where a candidate was found

Definition at line 170 of file OMTFReconstruction.cc.

References aTopElement, dumpDetailedResultToXML, dumpResultToXML, Reference_intrackfit_cff::endcap, AlgoMuon::getPt(), m_OMTFConfig, m_Sorter, m_Writer, OMTFConfiguration::nTestRefHits(), l1t::omtf_neg, l1t::omtf_pos, OMTFSorter< GoldenPatternType >::sortRefHitResults(), XMLConfigWriter::writeAlgoMuon(), XMLConfigWriter::writeCandMuon(), XMLConfigWriter::writeEventData(), and XMLConfigWriter::writeResultsData().

Referenced by getProcessorCandidates().

174  {
175  int endcap = (mtfType == l1t::omtf_neg) ? -1 : ((mtfType == l1t::omtf_pos) ? +1 : 0);
176  OmtfName board(iProcessor, endcap);
177 
178  //Write data to XML file
179  if (dumpResultToXML) {
180  xercesc::DOMElement* aProcElement = m_Writer->writeEventData(aTopElement, board, input);
181  for (unsigned int iRefHit = 0; iRefHit < m_OMTFConfig->nTestRefHits(); ++iRefHit) {
183  AlgoMuon algoMuon = m_Sorter.sortRefHitResults(results[iRefHit], 0); //charge=0 means ignore charge
184  if (algoMuon.getPt()) {
185  m_Writer->writeAlgoMuon(aProcElement, iRefHit, algoMuon);
187  for (auto& itKey : results[iRefHit])
188  m_Writer->writeResultsData(aProcElement, iRefHit, itKey.first, itKey.second);
189  }
190  }
191  }
192  for (auto& candMuon : candMuons)
193  m_Writer->writeCandMuon(aProcElement, candMuon);
194  }
195 }
OMTFConfiguration * m_OMTFConfig
OMTF objects.
dictionary results
xercesc::DOMElement * aTopElement
xercesc::DOMElement * writeEventData(xercesc::DOMElement *aTopElement, const OmtfName &board, const OMTFinput &aInput)
static std::string const input
Definition: EdmProvDump.cc:47
void writeResultsData(xercesc::DOMElement *aTopElement, unsigned int iRegion, const Key &aKey, const OMTFResult &aResult)
void writeCandMuon(xercesc::DOMElement *aTopElement, const l1t::RegionalMuonCand &aCand)
XMLConfigWriter * m_Writer
int getPt() const
Definition: AlgoMuon.h:41
void writeAlgoMuon(xercesc::DOMElement *aTopElement, unsigned int iRefHit, const AlgoMuon &aMuon)
void sortRefHitResults(const std::vector< OMTFProcessor::resultsMap > &procResults, std::vector< AlgoMuon > &refHitCleanCands, int charge=0)
Definition: OMTFSorter.cc:131
unsigned int nTestRefHits() const

Member Data Documentation

xercesc::DOMElement* OMTFReconstruction::aTopElement
private

Definition at line 84 of file OMTFReconstruction.h.

Referenced by reconstruct(), and writeResultToXML().

int OMTFReconstruction::bxMax
private

Definition at line 75 of file OMTFReconstruction.h.

Referenced by OMTFReconstruction(), and reconstruct().

int OMTFReconstruction::bxMin
private

Definition at line 75 of file OMTFReconstruction.h.

Referenced by OMTFReconstruction(), and reconstruct().

edm::Handle<CSCCorrelatedLCTDigiCollection> OMTFReconstruction::cscDigis
private

Definition at line 56 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and loadAndFilterDigis().

edm::Handle<L1MuDTChambPhContainer> OMTFReconstruction::dtPhDigis
private

Definition at line 54 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and loadAndFilterDigis().

edm::Handle<L1MuDTChambThContainer> OMTFReconstruction::dtThDigis
private

Definition at line 55 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and loadAndFilterDigis().

bool OMTFReconstruction::dumpDetailedResultToXML
private

Definition at line 74 of file OMTFReconstruction.h.

Referenced by OMTFReconstruction(), and writeResultToXML().

bool OMTFReconstruction::dumpResultToXML
private
edm::ParameterSet OMTFReconstruction::edmParameterSet
protected

Definition at line 64 of file OMTFReconstruction.h.

Referenced by addObservers(), beginRun(), and OMTFReconstruction().

unique_ptr<OMTFinputMaker> OMTFReconstruction::inputMaker
protected

Definition at line 73 of file OMTFReconstruction.h.

Referenced by beginRun().

edm::ESGetToken<L1TMuonOverlapParams, L1TMuonOverlapParamsRcd> OMTFReconstruction::l1TMuonOverlapParamsToken_
private

Definition at line 59 of file OMTFReconstruction.h.

Referenced by beginRun().

edm::ParameterSet OMTFReconstruction::m_Config
private

Definition at line 52 of file OMTFReconstruction.h.

Referenced by endJob(), loadAndFilterDigis(), and OMTFReconstruction().

std::unique_ptr<IGhostBuster> OMTFReconstruction::m_GhostBuster
private

Definition at line 81 of file OMTFReconstruction.h.

Referenced by beginRun(), and getProcessorCandidates().

OMTFinputMaker OMTFReconstruction::m_InputMaker
private

Definition at line 79 of file OMTFReconstruction.h.

Referenced by beginRun(), and getProcessorCandidates().

OMTFProcessor* OMTFReconstruction::m_OMTF
private
OMTFConfiguration* OMTFReconstruction::m_OMTFConfig
private

OMTF objects.

Definition at line 78 of file OMTFReconstruction.h.

Referenced by beginJob(), beginRun(), reconstruct(), writeResultToXML(), and ~OMTFReconstruction().

OMTFConfigMaker * OMTFReconstruction::m_OMTFConfigMaker
private

Definition at line 85 of file OMTFReconstruction.h.

OMTFSorter OMTFReconstruction::m_Sorter
private

Definition at line 80 of file OMTFReconstruction.h.

Referenced by beginRun(), getProcessorCandidates(), and writeResultToXML().

XMLConfigWriter* OMTFReconstruction::m_Writer
private
MuStubsInputTokens& OMTFReconstruction::muStubsInputTokens
protected

Definition at line 66 of file OMTFReconstruction.h.

std::vector<std::unique_ptr<IOMTFEmulationObserver> > OMTFReconstruction::observers
protected

Definition at line 79 of file OMTFReconstruction.h.

unique_ptr<OMTFConfiguration> OMTFReconstruction::omtfConfig
protected

OMTF objects.

Definition at line 71 of file OMTFReconstruction.h.

Referenced by addObservers(), and beginRun().

edm::ESWatcher<L1TMuonOverlapParamsRcd> OMTFReconstruction::omtfParamsRecordWatcher
protected

Definition at line 81 of file OMTFReconstruction.h.

Referenced by beginRun().

unique_ptr<IProcessorEmulator> OMTFReconstruction::omtfProc
protected

Definition at line 75 of file OMTFReconstruction.h.

Referenced by addObservers(), and beginRun().

edm::Handle<RPCDigiCollection> OMTFReconstruction::rpcDigis
private

Definition at line 57 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and loadAndFilterDigis().