CMS 3D CMS Logo

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

#include <OMTFReconstruction.h>

Public Member Functions

void beginJob ()
 
void beginRun (edm::Run const &run, edm::EventSetup const &iSetup)
 
void endJob ()
 
 OMTFReconstruction ()
 
 OMTFReconstruction (const edm::ParameterSet &)
 
std::auto_ptr
< l1t::RegionalMuonCandBxCollection
reconstruct (const edm::Event &, const edm::EventSetup &)
 
 ~OMTFReconstruction ()
 

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, const OMTFinput &myInput, const std::vector< OMTFProcessor::resultsMap > &myResults)
 

Private Attributes

xercesc::DOMElement * aTopElement
 
edm::Handle
< CSCCorrelatedLCTDigiCollection
cscDigis
 
edm::Handle
< L1MuDTChambPhContainer
dtPhDigis
 
edm::Handle
< L1MuDTChambThContainer
dtThDigis
 
bool dumpDetailedResultToXML
 
bool dumpResultToXML
 
edm::ParameterSet m_Config
 
OMTFGhostBuster m_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 36 of file OMTFReconstruction.h.

Constructor & Destructor Documentation

OMTFReconstruction::OMTFReconstruction ( )

Definition at line 18 of file OMTFReconstruction.cc.

18  :
OMTFConfiguration * m_OMTFConfig
OMTF objects.
OMTFConfigMaker * m_OMTFConfigMaker
xercesc::DOMElement * aTopElement
OMTFProcessor * m_OMTF
XMLConfigWriter * m_Writer
OMTFReconstruction::OMTFReconstruction ( const edm::ParameterSet theConfig)

Definition at line 21 of file OMTFReconstruction.cc.

References dumpDetailedResultToXML, dumpResultToXML, edm::ParameterSet::exists(), MainPageGenerator::fName, edm::ParameterSet::getParameter(), XMLConfigWriter::initialiseXMLDocument(), m_Config, m_Writer, and AlCaHLTBitMon_QueryRunRegistry::string.

21  :
22  m_Config(theConfig), m_OMTFConfig(0), m_OMTF(0), aTopElement(0), m_OMTFConfigMaker(0), m_Writer(0) {
23 
24 
25  if(!m_Config.exists("omtf")){
26  edm::LogError("L1TMuonOverlapTrackProducer")<<"omtf configuration not found in cfg.py";
27  }
28 
29  dumpResultToXML = m_Config.getParameter<bool>("dumpResultToXML");
30  dumpDetailedResultToXML = m_Config.getParameter<bool>("dumpDetailedResultToXML");
31  m_Config.getParameter<std::string>("XMLDumpFileName");
32 
33  if(dumpResultToXML){
34  m_Writer = new XMLConfigWriter();
35  std::string fName = "OMTF";
37  }
38 }
T getParameter(std::string const &) const
OMTFConfiguration * m_OMTFConfig
OMTF objects.
OMTFConfigMaker * m_OMTFConfigMaker
void initialiseXMLDocument(const std::string &docName)
bool exists(std::string const &parameterName) const
checks if a parameter exists
xercesc::DOMElement * aTopElement
OMTFProcessor * m_OMTF
XMLConfigWriter * m_Writer
edm::ParameterSet m_Config
OMTFReconstruction::~OMTFReconstruction ( )

Definition at line 42 of file OMTFReconstruction.cc.

References m_OMTF, m_OMTFConfig, and m_Writer.

42  {
43 
44  delete m_OMTFConfig;
45  delete m_OMTF;
46 
47  if (m_Writer) delete m_Writer;
48 }
OMTFConfiguration * m_OMTFConfig
OMTF objects.
OMTFProcessor * m_OMTF
XMLConfigWriter * m_Writer

Member Function Documentation

void OMTFReconstruction::beginJob ( void  )

Definition at line 52 of file OMTFReconstruction.cc.

References edm::ParameterSet::exists(), edm::ParameterSet::getParameter(), m_Config, m_OMTF, and m_OMTFConfig.

Referenced by L1TMuonOverlapTrackProducer::beginJob().

52  {
53 
54  if(m_Config.exists("omtf")){
57  }
58 }
T getParameter(std::string const &) const
OMTFConfiguration * m_OMTFConfig
OMTF objects.
bool exists(std::string const &parameterName) const
checks if a parameter exists
OMTFProcessor * m_OMTF
edm::ParameterSet m_Config
void OMTFReconstruction::beginRun ( edm::Run const &  run,
edm::EventSetup const &  iSetup 
)

If configuration is read from XML do not look at the DB.

Definition at line 72 of file OMTFReconstruction.cc.

References OMTFProcessor::configure(), OMTFConfiguration::configure(), edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), edm::ParameterSet::getParameter(), m_Config, m_OMTF, m_OMTFConfig, and fakeOmtfParams_cff::omtfParams.

Referenced by L1TMuonOverlapTrackProducer::beginRun().

72  {
73 
75  if(m_Config.getParameter<edm::ParameterSet>("omtf").getParameter<bool>("configFromXML")) return;
76 
77  const L1TMuonOverlapParamsRcd& omtfParamsRcd = iSetup.get<L1TMuonOverlapParamsRcd>();
78 
79  edm::ESHandle<L1TMuonOverlapParams> omtfParamsHandle;
80  omtfParamsRcd.get(omtfParamsHandle);
81 
82  const L1TMuonOverlapParams* omtfParams = omtfParamsHandle.product();
83  if (!omtfParams) {
84  edm::LogError("L1TMuonOverlapTrackProducer") << "Could not retrieve parameters from Event Setup" << std::endl;
85  }
86 
87  m_OMTFConfig->configure(omtfParams);
88  m_OMTF->configure(omtfParams);
89 }
T getParameter(std::string const &) const
OMTFConfiguration * m_OMTFConfig
OMTF objects.
bool configure(XMLConfigReader *aReader)
Fill GP map with patterns from XML file.
OMTFProcessor * m_OMTF
void configure(XMLConfigReader *aReader)
tuple omtfParams
OMTF ESProducer.
void get(HolderT &iHolder) const
edm::ParameterSet m_Config
void OMTFReconstruction::endJob ( void  )
void OMTFReconstruction::getProcessorCandidates ( unsigned int  iProcessor,
l1t::tftype  mtfType,
int  bx,
l1t::RegionalMuonCandBxCollection myCandidates 
)
private

Definition at line 131 of file OMTFReconstruction.cc.

References OMTFinputMaker::buildInputForProcessor(), cscDigis, dtPhDigis, dtThDigis, input, m_GhostBuster, m_InputMaker, m_OMTF, m_Sorter, OMTFProcessor::processInput(), edm::Handle< T >::product(), mps_update::results, rpcDigis, OMTFGhostBuster::select(), OMTFSorter::sortProcessorAndFillCandidates(), OMTFSorter::sortRefHitResults(), and writeResultToXML().

Referenced by reconstruct().

132  {
133 
135  dtThDigis.product(),
136  cscDigis.product(),
137  rpcDigis.product(),
138  iProcessor, mtfType);
139 
140  const std::vector<OMTFProcessor::resultsMap> & results = m_OMTF->processInput(iProcessor,input);
141 
142  std::vector<AlgoMuon> algoCandidates;
143 
144  m_Sorter.sortRefHitResults(results, algoCandidates);
145  m_GhostBuster.select(algoCandidates);
146  m_Sorter.sortProcessorAndFillCandidates(iProcessor, mtfType, algoCandidates, OTFCandidates, bx);
147 
148  writeResultToXML(iProcessor, input, results);
149 }
void sortProcessorAndFillCandidates(unsigned int iProcessor, l1t::tftype mtfType, const std::vector< AlgoMuon > &algoCands, l1t::RegionalMuonCandBxCollection &sortedCands, int bx, int charge=0)
Definition: OMTFSorter.cc:244
void writeResultToXML(unsigned int iProcessor, const OMTFinput &myInput, const std::vector< OMTFProcessor::resultsMap > &myResults)
static std::string const input
Definition: EdmProvDump.cc:44
OMTFProcessor * m_OMTF
OMTFGhostBuster m_GhostBuster
tuple results
Definition: mps_update.py:44
edm::Handle< RPCDigiCollection > rpcDigis
T const * product() const
Definition: Handle.h:81
edm::Handle< L1MuDTChambThContainer > dtThDigis
void sortRefHitResults(const std::vector< OMTFProcessor::resultsMap > &procResults, std::vector< AlgoMuon > &refHitCleanCands, int charge=0)
Definition: OMTFSorter.cc:127
OMTFinputMaker m_InputMaker
edm::Handle< L1MuDTChambPhContainer > dtPhDigis
const std::vector< OMTFProcessor::resultsMap > & processInput(unsigned int iProcessor, const OMTFinput &aInput)
OMTFinput buildInputForProcessor(const L1MuDTChambPhContainer *dtPhDigis, const L1MuDTChambThContainer *dtThDigis, const CSCCorrelatedLCTDigiCollection *cscDigis, const RPCDigiCollection *rpcDigis, unsigned int iProcessor, l1t::tftype type=l1t::tftype::omtf_pos)
Method translating trigger digis into input matrix with global phi coordinates.
void select(std::vector< AlgoMuon > &refHitCands, int charge=0)
Definition: GhostBuster.cc:18
edm::Handle< CSCCorrelatedLCTDigiCollection > cscDigis
void OMTFReconstruction::loadAndFilterDigis ( const edm::Event iEvent)
private

Definition at line 117 of file OMTFReconstruction.cc.

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

Referenced by reconstruct().

117  {
118 
119  // Filter digis by dropping digis from selected (by cfg.py) subsystems
120  if(!m_Config.getParameter<bool>("dropDTPrimitives")){
123  }
124  if(!m_Config.getParameter<bool>("dropRPCPrimitives")) iEvent.getByLabel(m_Config.getParameter<edm::InputTag>("srcRPC"),rpcDigis);
125  if(!m_Config.getParameter<bool>("dropCSCPrimitives")) iEvent.getByLabel(m_Config.getParameter<edm::InputTag>("srcCSC"),cscDigis);
126 
127 }
T getParameter(std::string const &) const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:418
edm::Handle< RPCDigiCollection > rpcDigis
edm::Handle< L1MuDTChambThContainer > dtThDigis
edm::Handle< L1MuDTChambPhContainer > dtPhDigis
edm::ParameterSet m_Config
edm::Handle< CSCCorrelatedLCTDigiCollection > cscDigis
std::auto_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 93 of file OMTFReconstruction.cc.

References aTopElement, objects.IsoTrackAnalyzer::candidates, dumpResultToXML, edm::EventID::event(), getProcessorCandidates(), edm::EventBase::id(), OMTFinputMaker::initialize(), OMTFConfiguration::instance(), loadAndFilterDigis(), m_InputMaker, m_Writer, OMTFConfiguration::nProcessors, l1t::omtf_neg, l1t::omtf_pos, and XMLConfigWriter::writeEventHeader().

Referenced by L1TMuonOverlapTrackProducer::produce().

93  {
94 
95  m_InputMaker.initialize(evSetup); //FIXME shoun't it be in beginRun?
96 
97  loadAndFilterDigis(iEvent);
98 
100 
101  // NOTE: assuming all is for bx 0
102  int bx = 0;
103  std::auto_ptr<l1t::RegionalMuonCandBxCollection > candidates(new l1t::RegionalMuonCandBxCollection);
104 
106  for(unsigned int iProcessor=0; iProcessor<OMTFConfiguration::instance()->nProcessors; ++iProcessor)
108 
109  for(unsigned int iProcessor=0; iProcessor<OMTFConfiguration::instance()->nProcessors; ++iProcessor)
111 
112  return candidates;
113 }
EventNumber_t event() const
Definition: EventID.h:41
void getProcessorCandidates(unsigned int iProcessor, l1t::tftype mtfType, int bx, l1t::RegionalMuonCandBxCollection &myCandidates)
xercesc::DOMElement * aTopElement
unsigned int nProcessors
void initialize(const edm::EventSetup &es)
void loadAndFilterDigis(const edm::Event &)
XMLConfigWriter * m_Writer
OMTFinputMaker m_InputMaker
edm::EventID id() const
Definition: EventBase.h:59
xercesc::DOMElement * writeEventHeader(unsigned int eventId, unsigned int mixedEventId=0)
static const OMTFConfiguration * instance()
void OMTFReconstruction::writeResultToXML ( unsigned int  iProcessor,
const OMTFinput myInput,
const std::vector< OMTFProcessor::resultsMap > &  myResults 
)
private

Dump only regions, where a candidate was found

Definition at line 153 of file OMTFReconstruction.cc.

References aTopElement, dumpDetailedResultToXML, dumpResultToXML, AlgoMuon::getPt(), OMTFConfiguration::instance(), m_Sorter, m_Writer, OMTFConfiguration::nTestRefHits, OMTFSorter::sortRefHitResults(), XMLConfigWriter::writeCandidateData(), XMLConfigWriter::writeEventData(), and XMLConfigWriter::writeResultsData().

Referenced by getProcessorCandidates().

154  {
155 
156  //Write data to XML file
157  if(dumpResultToXML){
158  xercesc::DOMElement * aProcElement = m_Writer->writeEventData(aTopElement,iProcessor,input);
159  for(unsigned int iRefHit=0;iRefHit<OMTFConfiguration::instance()->nTestRefHits;++iRefHit){
161  AlgoMuon myCand = m_Sorter.sortRefHitResults(results[iRefHit],0);//charge=0 means ignore charge
162  if(myCand.getPt()) {
163  m_Writer->writeCandidateData(aProcElement,iRefHit,myCand);
165  for(auto & itKey: results[iRefHit])
166  m_Writer->writeResultsData(aProcElement, iRefHit, itKey.first,itKey.second);
167  }
168  }
169  }
170  }
171 }
xercesc::DOMElement * aTopElement
xercesc::DOMElement * writeEventData(xercesc::DOMElement *aTopElement, unsigned int iProcessor, const OMTFinput &aInput)
static std::string const input
Definition: EdmProvDump.cc:44
void writeResultsData(xercesc::DOMElement *aTopElement, unsigned int iRegion, const Key &aKey, const OMTFResult &aResult)
unsigned int nTestRefHits
tuple results
Definition: mps_update.py:44
XMLConfigWriter * m_Writer
void sortRefHitResults(const std::vector< OMTFProcessor::resultsMap > &procResults, std::vector< AlgoMuon > &refHitCleanCands, int charge=0)
Definition: OMTFSorter.cc:127
int getPt() const
Definition: AlgoMuon.h:24
static const OMTFConfiguration * instance()
void writeCandidateData(xercesc::DOMElement *aTopElement, unsigned int iRefHit, const AlgoMuon &aCand)

Member Data Documentation

xercesc::DOMElement* OMTFReconstruction::aTopElement
private

Definition at line 79 of file OMTFReconstruction.h.

Referenced by reconstruct(), and writeResultToXML().

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

Definition at line 58 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and loadAndFilterDigis().

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

Definition at line 56 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and loadAndFilterDigis().

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

Definition at line 57 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and loadAndFilterDigis().

bool OMTFReconstruction::dumpDetailedResultToXML
private

Definition at line 70 of file OMTFReconstruction.h.

Referenced by OMTFReconstruction(), and writeResultToXML().

bool OMTFReconstruction::dumpResultToXML
private

Definition at line 70 of file OMTFReconstruction.h.

Referenced by endJob(), OMTFReconstruction(), reconstruct(), and writeResultToXML().

edm::ParameterSet OMTFReconstruction::m_Config
private
OMTFGhostBuster OMTFReconstruction::m_GhostBuster
private

Definition at line 76 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates().

OMTFinputMaker OMTFReconstruction::m_InputMaker
private

Definition at line 74 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and reconstruct().

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

OMTF objects.

Definition at line 73 of file OMTFReconstruction.h.

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

OMTFConfigMaker* OMTFReconstruction::m_OMTFConfigMaker
private

Definition at line 80 of file OMTFReconstruction.h.

OMTFSorter OMTFReconstruction::m_Sorter
private

Definition at line 75 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and writeResultToXML().

XMLConfigWriter* OMTFReconstruction::m_Writer
private
edm::Handle<RPCDigiCollection> OMTFReconstruction::rpcDigis
private

Definition at line 59 of file OMTFReconstruction.h.

Referenced by getProcessorCandidates(), and loadAndFilterDigis().