CMS 3D CMS Logo

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 &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 beginRun (edm::Run const &, edm::EventSetup const &)
 
void endJob ()
 
void endJob ()
 
 OMTFReconstruction (const edm::ParameterSet &, MuStubsInputTokens &muStubsInputTokens)
 
 OMTFReconstruction (const edm::ParameterSet &, edm::ConsumesCollector &&)
 
std::unique_ptr< l1t::RegionalMuonCandBxCollectionreconstruct (const edm::Event &, const edm::EventSetup &)
 
std::unique_ptr< l1t::RegionalMuonCandBxCollectionreconstruct (const edm::Event &, const edm::EventSetup &)
 
void setInputMaker (unique_ptr< OMTFinputMaker > inputMaker)
 
virtual ~OMTFReconstruction ()
 
 ~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< L1TMuonOverlapParamsRcdomtfParamsRecordWatcher
 
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< CSCCorrelatedLCTDigiCollectioncscDigis
 
edm::Handle< L1MuDTChambPhContainerdtPhDigis
 
edm::Handle< L1MuDTChambThContainerdtThDigis
 
bool dumpDetailedResultToXML
 
bool dumpResultToXML
 
edm::ESGetToken< L1TMuonOverlapParams, L1TMuonOverlapParamsRcdl1TMuonOverlapParamsToken_
 
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() [1/2]

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_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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
OMTFinputMaker m_InputMaker
OMTFConfigMaker * m_OMTFConfigMaker
edm::ParameterSet m_Config

◆ ~OMTFReconstruction() [1/2]

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() [2/2]

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().

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
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
bool exists(std::string const &parameterName) const
checks if a parameter exists
ParameterSet const & parameterSet(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
MuStubsInputTokens & muStubsInputTokens
unique_ptr< OMTFConfiguration > omtfConfig
OMTF objects.
edm::ParameterSet edmParameterSet
unique_ptr< IProcessorEmulator > omtfProc
OMTFConfigMaker * m_OMTFConfigMaker

◆ ~OMTFReconstruction() [2/2]

virtual OMTFReconstruction::~OMTFReconstruction ( )
virtual

Member Function Documentation

◆ addObservers()

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(), observers, omtfConfig, omtfProc, CSCSkim_cfi::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>(
203  edmParameterSet, omtfConfig.get(), magneticFieldEsToken, propagatorEsToken));
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
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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
unique_ptr< IProcessorEmulator > omtfProc

◆ beginJob() [1/2]

void OMTFReconstruction::beginJob ( )

◆ beginJob() [2/2]

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

◆ beginRun() [1/2]

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, options_cfi::eventSetup, Exception, edm::ParameterSet::exists(), edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), inputMaker, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, observers, omtfConfig, fakeOmtfParams_cff::omtfParams, omtfParamsRecordWatcher, omtfProc, fakeOmtfParams_cff::patternsXMLFile, fakeOmtfParams_cff::patternsXMLFiles, simOmtfDigis_cfi::processorType, XMLConfigReader::readPatterns(), writedatasetfile::run, and AlCaHLTBitMon_QueryRunRegistry::string.

66  {
67  const L1TMuonOverlapParams* omtfParams = nullptr;
68 
69  std::string processorType = "OMTFProcessor"; //GoldenPatternWithStat GoldenPattern
70  if (edmParameterSet.exists("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) {
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> >(
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,
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,
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
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::string fullPath() const
Definition: FileInPath.cc:161
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
omtfParams
OMTF ESProducer.
std::vector< std::shared_ptr< GoldenPattern > > readPatterns(const L1TMuonOverlapParams &aConfig)
unique_ptr< OMTFConfiguration > omtfConfig
OMTF objects.
edm::ParameterSet edmParameterSet
unique_ptr< IProcessorEmulator > omtfProc
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57

◆ beginRun() [2/2]

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, fileCollector2::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 
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.
void initialiseXMLDocument(const std::string &docName)
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
unsigned int fwVersion() const
unsigned int nPhiBins() const
omtfParams
OMTF ESProducer.
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

◆ endJob() [1/2]

void OMTFReconstruction::endJob ( )

◆ endJob() [2/2]

void OMTFReconstruction::endJob ( void  )

◆ getProcessorCandidates()

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(), nano_mu_digi_cff::bx, OMTFSorter< GoldenPatternType >::candidates(), cscDigis, dtPhDigis, dtThDigis, RemoveAddSevLevel::flag, OMTFinputMaker::getFlag(), input, m_GhostBuster, m_InputMaker, m_OMTF, m_Sorter, OMTFProcessor< GoldenPatternType >::processInput(), edm::Handle< T >::product(), BXVector< T >::push_back(), mysort::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.
T const * product() const
Definition: Handle.h:70
std::unique_ptr< IGhostBuster > m_GhostBuster
static std::string const input
Definition: EdmProvDump.cc:50
int getFlag() const
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)
edm::Handle< RPCDigiCollection > rpcDigis
void setFlag(int aFlag)
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
results
Definition: mysort.py:8
void sortRefHitResults(const std::vector< OMTFProcessor::resultsMap > &procResults, std::vector< AlgoMuon > &refHitCleanCands, int charge=0)
Definition: OMTFSorter.cc:131
edm::Handle< CSCCorrelatedLCTDigiCollection > cscDigis

◆ loadAndFilterDigis()

void OMTFReconstruction::loadAndFilterDigis ( const edm::Event iEvent)
private

Definition at line 123 of file OMTFReconstruction.cc.

References cscDigis, dtPhDigis, dtThDigis, edm::ParameterSet::getParameter(), iEvent, 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")) {
126  iEvent.getByLabel(m_Config.getParameter<edm::InputTag>("srcDTPh"), dtPhDigis);
127  iEvent.getByLabel(m_Config.getParameter<edm::InputTag>("srcDTTh"), dtThDigis);
128  }
129  if (!m_Config.getParameter<bool>("dropRPCPrimitives"))
130  iEvent.getByLabel(m_Config.getParameter<edm::InputTag>("srcRPC"), rpcDigis);
131  if (!m_Config.getParameter<bool>("dropCSCPrimitives"))
132  iEvent.getByLabel(m_Config.getParameter<edm::InputTag>("srcCSC"), cscDigis);
133 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
int iEvent
Definition: GenABIO.cc:224
edm::Handle< RPCDigiCollection > rpcDigis
edm::Handle< L1MuDTChambThContainer > dtThDigis
edm::Handle< L1MuDTChambPhContainer > dtPhDigis
edm::ParameterSet m_Config
edm::Handle< CSCCorrelatedLCTDigiCollection > cscDigis

◆ reconstruct() [1/2]

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, nano_mu_digi_cff::bx, bxMax, bxMin, HLT_2024v12_cff::candidates, dumpResultToXML, getProcessorCandidates(), iEvent, loadAndFilterDigis(), m_OMTFConfig, m_Writer, OMTFConfiguration::nProcessors(), l1t::omtf_neg, l1t::omtf_pos, and XMLConfigWriter::writeEventHeader().

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

96  {
98 
99  if (dumpResultToXML)
100  aTopElement = m_Writer->writeEventHeader(iEvent.id().event());
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 }
void getProcessorCandidates(unsigned int iProcessor, l1t::tftype mtfType, int bx, l1t::RegionalMuonCandBxCollection &myCandidates)
OMTFConfiguration * m_OMTFConfig
OMTF objects.
xercesc::DOMElement * aTopElement
void loadAndFilterDigis(const edm::Event &)
int iEvent
Definition: GenABIO.cc:224
XMLConfigWriter * m_Writer
Log< level::Info, false > LogInfo
xercesc::DOMElement * writeEventHeader(unsigned int eventId, unsigned int mixedEventId=0)
unsigned int nProcessors() const

◆ reconstruct() [2/2]

std::unique_ptr<l1t::RegionalMuonCandBxCollection> OMTFReconstruction::reconstruct ( const edm::Event ,
const edm::EventSetup  
)

◆ setInputMaker()

void OMTFReconstruction::setInputMaker ( unique_ptr< OMTFinputMaker inputMaker)
inline

Definition at line 56 of file OMTFReconstruction.h.

References inputMaker, and eostools::move().

56 { this->inputMaker = std::move(inputMaker); }
unique_ptr< OMTFinputMaker > inputMaker
def move(src, dest)
Definition: eostools.py:511

◆ writeResultToXML()

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, makeMuonMisalignmentScenario::endcap, AlgoMuon::getPt(), input, m_OMTFConfig, m_Sorter, m_Writer, OMTFConfiguration::nTestRefHits(), l1t::omtf_neg, l1t::omtf_pos, mysort::results, 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.
xercesc::DOMElement * aTopElement
xercesc::DOMElement * writeEventData(xercesc::DOMElement *aTopElement, const OmtfName &board, const OMTFinput &aInput)
static std::string const input
Definition: EdmProvDump.cc:50
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
unsigned int nTestRefHits() const
results
Definition: mysort.py:8
void writeAlgoMuon(xercesc::DOMElement *aTopElement, unsigned int iRefHit, const AlgoMuon &aMuon)
int getPt() const
Definition: AlgoMuon.h:41
void sortRefHitResults(const std::vector< OMTFProcessor::resultsMap > &procResults, std::vector< AlgoMuon > &refHitCleanCands, int charge=0)
Definition: OMTFSorter.cc:131

Member Data Documentation

◆ aTopElement

xercesc::DOMElement* OMTFReconstruction::aTopElement
private

Definition at line 84 of file OMTFReconstruction.h.

Referenced by reconstruct(), and writeResultToXML().

◆ bxMax

int OMTFReconstruction::bxMax
private

Definition at line 75 of file OMTFReconstruction.h.

Referenced by OMTFReconstruction(), and reconstruct().

◆ bxMin

int OMTFReconstruction::bxMin
private

Definition at line 75 of file OMTFReconstruction.h.

Referenced by OMTFReconstruction(), and reconstruct().

◆ cscDigis

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

Definition at line 56 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and loadAndFilterDigis().

◆ dtPhDigis

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

Definition at line 54 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and loadAndFilterDigis().

◆ dtThDigis

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

Definition at line 55 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and loadAndFilterDigis().

◆ dumpDetailedResultToXML

bool OMTFReconstruction::dumpDetailedResultToXML
private

Definition at line 74 of file OMTFReconstruction.h.

Referenced by OMTFReconstruction(), and writeResultToXML().

◆ dumpResultToXML

bool OMTFReconstruction::dumpResultToXML
private

◆ edmParameterSet

edm::ParameterSet OMTFReconstruction::edmParameterSet
protected

Definition at line 63 of file OMTFReconstruction.h.

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

◆ inputMaker

unique_ptr<OMTFinputMaker> OMTFReconstruction::inputMaker
protected

Definition at line 72 of file OMTFReconstruction.h.

Referenced by beginRun(), and setInputMaker().

◆ l1TMuonOverlapParamsToken_

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

Definition at line 59 of file OMTFReconstruction.h.

Referenced by beginRun().

◆ m_Config

edm::ParameterSet OMTFReconstruction::m_Config
private

Definition at line 52 of file OMTFReconstruction.h.

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

◆ m_GhostBuster

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

Definition at line 81 of file OMTFReconstruction.h.

Referenced by beginRun(), and getProcessorCandidates().

◆ m_InputMaker

OMTFinputMaker OMTFReconstruction::m_InputMaker
private

Definition at line 79 of file OMTFReconstruction.h.

Referenced by beginRun(), and getProcessorCandidates().

◆ m_OMTF

OMTFProcessor* OMTFReconstruction::m_OMTF
private

◆ m_OMTFConfig

OMTFConfiguration* OMTFReconstruction::m_OMTFConfig
private

OMTF objects.

Definition at line 78 of file OMTFReconstruction.h.

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

◆ m_OMTFConfigMaker

OMTFConfigMaker * OMTFReconstruction::m_OMTFConfigMaker
private

Definition at line 85 of file OMTFReconstruction.h.

◆ m_Sorter

OMTFSorter OMTFReconstruction::m_Sorter
private

Definition at line 80 of file OMTFReconstruction.h.

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

◆ m_Writer

XMLConfigWriter* OMTFReconstruction::m_Writer
private

◆ muStubsInputTokens

MuStubsInputTokens& OMTFReconstruction::muStubsInputTokens
protected

Definition at line 65 of file OMTFReconstruction.h.

◆ observers

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

Definition at line 78 of file OMTFReconstruction.h.

Referenced by addObservers(), and beginRun().

◆ omtfConfig

unique_ptr<OMTFConfiguration> OMTFReconstruction::omtfConfig
protected

OMTF objects.

Definition at line 70 of file OMTFReconstruction.h.

Referenced by addObservers(), and beginRun().

◆ omtfParamsRecordWatcher

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

Definition at line 80 of file OMTFReconstruction.h.

Referenced by beginRun().

◆ omtfProc

unique_ptr<IProcessorEmulator> OMTFReconstruction::omtfProc
protected

Definition at line 74 of file OMTFReconstruction.h.

Referenced by addObservers(), and beginRun().

◆ rpcDigis

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

Definition at line 57 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and loadAndFilterDigis().