CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
OMTFPatternMaker Class Reference

#include <OMTFPatternMaker.h>

Inheritance diagram for OMTFPatternMaker:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void beginRun (edm::Run const &run, edm::EventSetup const &iSetup) override
 
void endJob () override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
 OMTFPatternMaker (const edm::ParameterSet &cfg)
 
 ~OMTFPatternMaker () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

const SimTrackfindSimMuon (const edm::Event &ev, const SimTrack *previous=nullptr)
 
void writeMergedGPs ()
 

Private Attributes

xercesc::DOMElement * aTopElement
 
edm::ESGetToken< L1TMuonOverlapParams, L1TMuonOverlapParamsRcdesTokenParams_
 
edm::InputTag g4SimTrackSrc
 
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectioninputTokenCSC
 
edm::EDGetTokenT< L1MuDTChambPhContainerinputTokenDTPh
 
edm::EDGetTokenT< L1MuDTChambThContainerinputTokenDTTh
 
edm::EDGetTokenT< RPCDigiCollectioninputTokenRPC
 
edm::EDGetTokenT< edm::SimTrackContainerinputTokenSimHit
 
bool makeConnectionsMaps
 
bool makeGoldenPatterns
 
bool mergeXMLFiles
 
OMTFinputMakermyInputMaker
 
OMTFProcessormyOMTF
 
OMTFConfigurationmyOMTFConfig
 OMTF objects. More...
 
OMTFConfigMakermyOMTFConfigMaker
 
XMLConfigWritermyWriter
 
unsigned int nPdfAddrBits
 Original pdf width. read from configuration. More...
 
edm::ParameterSet theConfig
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 39 of file OMTFPatternMaker.h.

Constructor & Destructor Documentation

◆ OMTFPatternMaker()

OMTFPatternMaker::OMTFPatternMaker ( const edm::ParameterSet cfg)

Definition at line 21 of file OMTFPatternMaker.cc.

References edm::EDConsumerBase::consumesCollector(), edm::ParameterSet::getParameter(), inputTokenCSC, inputTokenDTPh, inputTokenDTTh, inputTokenRPC, inputTokenSimHit, makeConnectionsMaps, makeGoldenPatterns, mergeXMLFiles, myInputMaker, myOMTFConfig, and theConfig.

22  : theConfig(cfg),
23  g4SimTrackSrc(cfg.getParameter<edm::InputTag>("g4SimTrackSrc")),
24  esTokenParams_(esConsumes<edm::Transition::BeginRun>()) {
25  inputTokenDTPh = consumes<L1MuDTChambPhContainer>(theConfig.getParameter<edm::InputTag>("srcDTPh"));
26  inputTokenDTTh = consumes<L1MuDTChambThContainer>(theConfig.getParameter<edm::InputTag>("srcDTTh"));
27  inputTokenCSC = consumes<CSCCorrelatedLCTDigiCollection>(theConfig.getParameter<edm::InputTag>("srcCSC"));
28  inputTokenRPC = consumes<RPCDigiCollection>(theConfig.getParameter<edm::InputTag>("srcRPC"));
29  inputTokenSimHit = consumes<edm::SimTrackContainer>(theConfig.getParameter<edm::InputTag>("g4SimTrackSrc"));
30 
32  myInputMaker = new OMTFinputMaker(consumesColl);
33 
34  makeGoldenPatterns = theConfig.getParameter<bool>("makeGoldenPatterns");
35  makeConnectionsMaps = theConfig.getParameter<bool>("makeConnectionsMaps");
36  mergeXMLFiles = theConfig.getParameter<bool>("mergeXMLFiles");
37 
38  myOMTFConfig = nullptr;
39 }
edm::EDGetTokenT< edm::SimTrackContainer > inputTokenSimHit
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
OMTFConfiguration * myOMTFConfig
OMTF objects.
edm::EDGetTokenT< L1MuDTChambPhContainer > inputTokenDTPh
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > inputTokenCSC
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::InputTag g4SimTrackSrc
edm::ESGetToken< L1TMuonOverlapParams, L1TMuonOverlapParamsRcd > esTokenParams_
edm::EDGetTokenT< RPCDigiCollection > inputTokenRPC
edm::EDGetTokenT< L1MuDTChambThContainer > inputTokenDTTh
OMTFinputMaker * myInputMaker
edm::ParameterSet theConfig

◆ ~OMTFPatternMaker()

OMTFPatternMaker::~OMTFPatternMaker ( )
override

Definition at line 42 of file OMTFPatternMaker.cc.

References myOMTF, myOMTFConfig, and myOMTFConfigMaker.

42  {
43  delete myOMTFConfig;
44  delete myOMTFConfigMaker;
45  delete myOMTF;
46 }
OMTFConfiguration * myOMTFConfig
OMTF objects.
OMTFConfigMaker * myOMTFConfigMaker
OMTFProcessor * myOMTF

Member Function Documentation

◆ analyze()

void OMTFPatternMaker::analyze ( const edm::Event iEvent,
const edm::EventSetup evSetup 
)
overridevirtual

Get the simulated muon parameters

Filter digis by dropping digis from selected (by cfg.py) subsystems

Loop over all processors, each covering 60 deg in phi

Input data with phi ranges shifted for each processor, so it fits 11 bits range

Connections maps are made by hand. makeConnetionsMap method provides tables for checking their consistency.

Implements edm::one::EDAnalyzerBase.

Definition at line 243 of file OMTFPatternMaker.cc.

References OMTFinputMaker::buildInputForProcessor(), OMTFProcessor< GoldenPatternType >::fillCounts(), findSimMuon(), edm::ParameterSet::getParameter(), iEvent, OMTFinputMaker::initialize(), inputTokenCSC, inputTokenDTPh, inputTokenDTTh, inputTokenRPC, makeConnectionsMaps, OMTFConfigMaker::makeConnetionsMap(), makeGoldenPatterns, mergeXMLFiles, myInputMaker, myOMTF, myOMTFConfig, myOMTFConfigMaker, l1t::omtf_pos, edm::Handle< T >::product(), and theConfig.

243  {
244  if (mergeXMLFiles)
245  return;
246 
248  const SimTrack* aSimMuon = findSimMuon(iEvent);
249  if (!aSimMuon) {
250  edm::LogError("OMTFPatternMaker") << "No SimMuon found in the event!";
251  return;
252  }
253 
255 
260 
262  if (!theConfig.getParameter<bool>("dropDTPrimitives")) {
263  iEvent.getByToken(inputTokenDTPh, dtPhDigis);
264  iEvent.getByToken(inputTokenDTTh, dtThDigis);
265  }
266  if (!theConfig.getParameter<bool>("dropRPCPrimitives"))
267  iEvent.getByToken(inputTokenRPC, rpcDigis);
268  if (!theConfig.getParameter<bool>("dropCSCPrimitives"))
269  iEvent.getByToken(inputTokenCSC, cscDigis);
270 
271  //l1t::tftype mtfType = l1t::tftype::bmtf;
273  //l1t::tftype mtfType = l1t::tftype::emtf_pos;
274 
276  for (unsigned int iProcessor = 0; iProcessor < 6; ++iProcessor) {
279  dtPhDigis.product(), dtThDigis.product(), cscDigis.product(), rpcDigis.product(), iProcessor, mtfType);
280 
284  myOMTFConfigMaker->makeConnetionsMap(iProcessor, myInput);
285 
286  if (makeGoldenPatterns)
287  myOMTF->fillCounts(iProcessor, myInput, aSimMuon);
288  }
289 }
void fillCounts(unsigned int iProcessor, const OMTFinput &aInput, const SimTrack *aSimMuon)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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.
OMTFConfiguration * myOMTFConfig
OMTF objects.
T const * product() const
Definition: Handle.h:70
void makeConnetionsMap(unsigned int iProcessor, const OMTFinput &aInput)
edm::EDGetTokenT< L1MuDTChambPhContainer > inputTokenDTPh
void initialize(const edm::EventSetup &, const OMTFConfiguration *)
Log< level::Error, false > LogError
OMTFConfigMaker * myOMTFConfigMaker
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > inputTokenCSC
OMTFProcessor * myOMTF
edm::EDGetTokenT< RPCDigiCollection > inputTokenRPC
const SimTrack * findSimMuon(const edm::Event &ev, const SimTrack *previous=nullptr)
edm::EDGetTokenT< L1MuDTChambThContainer > inputTokenDTTh
OMTFinputMaker * myInputMaker
edm::ParameterSet theConfig

◆ beginJob()

void OMTFPatternMaker::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 85 of file OMTFPatternMaker.cc.

References myOMTF, and myOMTFConfig.

85  {
87  myOMTF = new OMTFProcessor();
88 }
OMTFConfiguration * myOMTFConfig
OMTF objects.
OMTFProcessor * myOMTF

◆ beginRun()

void OMTFPatternMaker::beginRun ( edm::Run const &  run,
edm::EventSetup const &  iSetup 
)
override

Initialise XML writer with default pdf.

For making the patterns use extended pdf width in phi, as pdf are later shifted by the mean value For low pt muons non shifted pdfs would go out of the default pdf range.
Clear existing GoldenPatterns

Definition at line 49 of file OMTFPatternMaker.cc.

References OMTFProcessor< GoldenPatternType >::configure(), OMTFConfiguration::configure(), esTokenParams_, L1TMuonOverlapParams::GENERAL_ADDRBITS, L1TMuonOverlapParams::generalParams(), edm::EventSetup::getData(), OMTFProcessor< GoldenPatternType >::getPatterns(), mergeXMLFiles, myOMTF, myOMTFConfig, myOMTFConfigMaker, myWriter, nPdfAddrBits, fakeOmtfParams_cff::omtfParams, and L1TMuonOverlapParams::setGeneralParams().

49  {
50  const L1TMuonOverlapParams* omtfParams = &iSetup.getData(esTokenParams_);
51 
52  if (!omtfParams) {
53  edm::LogError("L1TMuonOverlapTrackProducer") << "Could not retrieve parameters from Event Setup" << std::endl;
54  }
55 
58 
61  L1TMuonOverlapParams omtfParamsMutable = *omtfParams;
62  std::vector<int> generalParams = *omtfParamsMutable.generalParams();
63  nPdfAddrBits = omtfParams->nPdfAddrBits();
64 
65  if (!mergeXMLFiles)
67  omtfParamsMutable.setGeneralParams(generalParams);
68 
69  myOMTFConfig->configure(&omtfParamsMutable);
72 
74  if (!mergeXMLFiles) {
75  const std::map<Key, GoldenPattern*>& theGPs = myOMTF->getPatterns();
76  for (auto itGP : theGPs)
77  itGP.second->reset();
78  }
79 }
const std::vector< int > * generalParams() const
General definitions.
OMTFConfiguration * myOMTFConfig
OMTF objects.
Log< level::Error, false > LogError
const std::map< Key, GoldenPattern * > & getPatterns() const
Return map of GoldenPatterns.
OMTFConfigMaker * myOMTFConfigMaker
omtfParams
OMTF ESProducer.
void setGeneralParams(const std::vector< int > &paramsVec)
XMLConfigWriter * myWriter
OMTFProcessor * myOMTF
void configure(const L1TMuonOverlapParams *omtfParams)
bool configure(const OMTFConfiguration *omtfParams, const L1TMuonOverlapParams *omtfPatterns)
Fill GP map with patterns from CondFormats object.
edm::ESGetToken< L1TMuonOverlapParams, L1TMuonOverlapParamsRcd > esTokenParams_
unsigned int nPdfAddrBits
Original pdf width. read from configuration.

◆ endJob()

void OMTFPatternMaker::endJob ( void  )
overridevirtual

Put back default value of the pdf width.

Order important: printPhiMap updates global vector in OMTFConfiguration

Write GPs merged by 4 above iPt=71, and by 2 below// /////////////////////////////////////////////////// 4x merging

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 91 of file OMTFPatternMaker.cc.

References OMTFProcessor< GoldenPatternType >::averagePatterns(), OMTFConfiguration::configure(), gather_cfg::cout, XMLConfigWriter::finaliseXMLDocument(), fileCollector2::fName, L1TMuonOverlapParams::GENERAL_ADDRBITS, L1TMuonOverlapParams::generalParams(), OMTFConfiguration::getMeasurements4D(), edm::ParameterSet::getParameter(), OMTFProcessor< GoldenPatternType >::getPatterns(), OMTFConfiguration::getRawParams(), XMLConfigWriter::initialiseXMLDocument(), makeConnectionsMaps, makeGoldenPatterns, mergeXMLFiles, myOMTF, myOMTFConfig, myOMTFConfigMaker, myWriter, nPdfAddrBits, OMTFConfigMaker::printConnections(), OMTFConfigMaker::printPhiMap(), RPCConst::ptFromIpt(), GoldenPattern::reset(), L1TMuonOverlapParams::setGeneralParams(), AlCaHLTBitMon_QueryRunRegistry::string, theConfig, XMLConfigWriter::writeConnectionsData(), XMLConfigWriter::writeGPData(), and writeMergedGPs().

91  {
94  const std::map<Key, GoldenPattern*>& myGPmap = myOMTF->getPatterns();
95  for (auto itGP : myGPmap) {
96  if (!itGP.second->hasCounts())
97  continue;
98  itGP.second->normalise(nPdfAddrBits);
99  }
100 
101  GoldenPattern dummyGP(Key(0, 0, 0), myOMTFConfig);
102  dummyGP.reset();
103 
105  L1TMuonOverlapParams omtfParamsMutable = *myOMTFConfig->getRawParams();
106  std::vector<int> generalParams = *omtfParamsMutable.generalParams();
108  omtfParamsMutable.setGeneralParams(generalParams);
109  myOMTFConfig->configure(&omtfParamsMutable);
110 
111  for (auto itGP : myGPmap) {
113  unsigned int iPt = theConfig.getParameter<int>("ptCode") + 1;
114  if (iPt > 31)
115  iPt = 200 * 2 + 1;
116  else
117  iPt = RPCConst::ptFromIpt(iPt) * 2.0 +
118  1; //MicroGMT has 0.5 GeV step size, with lower bin edge (uGMT_pt_code - 1)*step_size
120  if (itGP.first.thePtCode == iPt && itGP.first.theCharge == theConfig.getParameter<int>("charge")) {
121  std::cout << *itGP.second << std::endl;
122  myWriter->writeGPData(*itGP.second, dummyGP, dummyGP, dummyGP);
123  }
124  }
125  std::string fName = "GPs.xml";
127  }
128 
131  std::string fName = "Connections.xml";
132  unsigned int iProcessor = 0;
143  }
144 
145  if (mergeXMLFiles) {
147  dummy->reset();
148 
149  std::string fName = "OMTF";
151  const std::map<Key, GoldenPattern*>& myGPmap = myOMTF->getPatterns();
152  for (auto itGP : myGPmap) {
153  myWriter->writeGPData(*itGP.second, *dummy, *dummy, *dummy);
154  }
155  fName = "GPs.xml";
160  fName = "OMTF";
162  myOMTF->averagePatterns(-1);
164  writeMergedGPs();
165  fName = "GPs_4x.xml";
167  }
168 }
void writeConnectionsData(const std::vector< std::vector< OMTFConfiguration::vector2D > > &measurements4D)
const std::vector< int > * generalParams() const
General definitions.
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
OMTFConfiguration * myOMTFConfig
OMTF objects.
void initialiseXMLDocument(const std::string &docName)
void averagePatterns(int charge)
const std::map< Key, GoldenPattern * > & getPatterns() const
Return map of GoldenPatterns.
OMTFConfigMaker * myOMTFConfigMaker
void printConnections(std::ostream &out, unsigned int iProcessor, unsigned int iCone)
void setGeneralParams(const std::vector< int > &paramsVec)
XMLConfigWriter * myWriter
OMTFProcessor * myOMTF
static double ptFromIpt(const int ipt)
Definition: RPCConst.cc:29
void configure(const L1TMuonOverlapParams *omtfParams)
void printPhiMap(std::ostream &out)
void finaliseXMLDocument(const std::string &fName)
unsigned int nPdfAddrBits
Original pdf width. read from configuration.
void writeGPData(const GoldenPattern &aGP)
edm::ParameterSet theConfig
vector4D & getMeasurements4D()
const L1TMuonOverlapParams * getRawParams() const

◆ endRun()

void OMTFPatternMaker::endRun ( edm::Run const &  ,
edm::EventSetup const &   
)
override

Definition at line 82 of file OMTFPatternMaker.cc.

82 {}

◆ findSimMuon()

const SimTrack * OMTFPatternMaker::findSimMuon ( const edm::Event ev,
const SimTrack previous = nullptr 
)
private

Definition at line 292 of file OMTFPatternMaker.cc.

References electronAnalyzer_cfi::DeltaR, makeMEIFBenchmarkPlots::ev, inputTokenSimHit, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, CoreSimTrack::momentum(), callgraph::previous, mps_fire::result, and CoreSimTrack::type().

Referenced by analyze().

292  {
293  const SimTrack* result = nullptr;
295  ev.getByToken(inputTokenSimHit, simTks);
296 
297  for (std::vector<SimTrack>::const_iterator it = simTks->begin(); it < simTks->end(); it++) {
298  const SimTrack& aTrack = *it;
299  if (!(aTrack.type() == 13 || aTrack.type() == -13))
300  continue;
301  if (previous && ROOT::Math::VectorUtil::DeltaR(aTrack.momentum(), previous->momentum()) < 0.07)
302  continue;
303  if (!result || aTrack.momentum().pt() > result->momentum().pt())
304  result = &aTrack;
305  }
306  return result;
307 }
edm::EDGetTokenT< edm::SimTrackContainer > inputTokenSimHit
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:19
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:22

◆ writeMergedGPs()

void OMTFPatternMaker::writeMergedGPs ( )
private

Write the opposite charge.

Definition at line 171 of file OMTFPatternMaker.cc.

References OMTFProcessor< GoldenPatternType >::getPatterns(), ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::if(), GoldenPattern::key(), myOMTF, myOMTFConfig, myWriter, Key::theCharge, Key::thePtCode, and XMLConfigWriter::writeGPData().

Referenced by endJob().

171  {
172  const std::map<Key, GoldenPattern*>& myGPmap = myOMTF->getPatterns();
173 
175  dummy->reset();
176 
177  unsigned int iPtMin = 9;
178  Key aKey = Key(0, iPtMin, 1);
179  while (myGPmap.find(aKey) != myGPmap.end()) {
180  GoldenPattern* aGP1 = myGPmap.find(aKey)->second;
181  GoldenPattern* aGP2 = dummy;
182  GoldenPattern* aGP3 = dummy;
183  GoldenPattern* aGP4 = dummy;
184 
185  ++aKey.thePtCode;
186  while (myGPmap.find(aKey) == myGPmap.end() && aKey.thePtCode <= 401)
187  ++aKey.thePtCode;
188  if (aKey.thePtCode <= 401 && myGPmap.find(aKey) != myGPmap.end())
189  aGP2 = myGPmap.find(aKey)->second;
190 
191  if (aKey.thePtCode > 71) {
192  ++aKey.thePtCode;
193  while (myGPmap.find(aKey) == myGPmap.end() && aKey.thePtCode <= 401)
194  ++aKey.thePtCode;
195  if (aKey.thePtCode <= 401 && myGPmap.find(aKey) != myGPmap.end())
196  aGP3 = myGPmap.find(aKey)->second;
197 
198  ++aKey.thePtCode;
199  while (myGPmap.find(aKey) == myGPmap.end() && aKey.thePtCode <= 401)
200  ++aKey.thePtCode;
201  if (aKey.thePtCode <= 401 && myGPmap.find(aKey) != myGPmap.end())
202  aGP4 = myGPmap.find(aKey)->second;
203  }
204  ++aKey.thePtCode;
205  while (myGPmap.find(aKey) == myGPmap.end() && aKey.thePtCode <= 401)
206  ++aKey.thePtCode;
207  myWriter->writeGPData(*aGP1, *aGP2, *aGP3, *aGP4);
208 
210  Key aTmpKey = aGP1->key();
211  aTmpKey.theCharge = -1;
212  if (myGPmap.find(aTmpKey) != myGPmap.end())
213  aGP1 = myGPmap.find(aTmpKey)->second;
214  else
215  aGP1 = dummy;
216 
217  aTmpKey = aGP2->key();
218  aTmpKey.theCharge = -1;
219  if (myGPmap.find(aTmpKey) != myGPmap.end())
220  aGP2 = myGPmap.find(aTmpKey)->second;
221  else
222  aGP2 = dummy;
223 
224  aTmpKey = aGP3->key();
225  aTmpKey.theCharge = -1;
226  if (myGPmap.find(aTmpKey) != myGPmap.end())
227  aGP3 = myGPmap.find(aTmpKey)->second;
228  else
229  aGP3 = dummy;
230 
231  aTmpKey = aGP4->key();
232  aTmpKey.theCharge = -1;
233  if (myGPmap.find(aTmpKey) != myGPmap.end())
234  aGP4 = myGPmap.find(aTmpKey)->second;
235  else
236  aGP4 = dummy;
237 
238  myWriter->writeGPData(*aGP1, *aGP2, *aGP3, *aGP4);
239  }
240 }
OMTFConfiguration * myOMTFConfig
OMTF objects.
int theCharge
Definition: GoldenPattern.h:36
const std::map< Key, GoldenPattern * > & getPatterns() const
Return map of GoldenPatterns.
unsigned int thePtCode
Definition: GoldenPattern.h:35
Key key() const
Definition: GoldenPattern.h:56
XMLConfigWriter * myWriter
OMTFProcessor * myOMTF
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
void writeGPData(const GoldenPattern &aGP)

Member Data Documentation

◆ aTopElement

xercesc::DOMElement* OMTFPatternMaker::aTopElement
private

Definition at line 81 of file OMTFPatternMaker.h.

◆ esTokenParams_

edm::ESGetToken<L1TMuonOverlapParams, L1TMuonOverlapParamsRcd> OMTFPatternMaker::esTokenParams_
private

Definition at line 67 of file OMTFPatternMaker.h.

Referenced by beginRun().

◆ g4SimTrackSrc

edm::InputTag OMTFPatternMaker::g4SimTrackSrc
private

Definition at line 59 of file OMTFPatternMaker.h.

◆ inputTokenCSC

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> OMTFPatternMaker::inputTokenCSC
private

Definition at line 63 of file OMTFPatternMaker.h.

Referenced by analyze(), and OMTFPatternMaker().

◆ inputTokenDTPh

edm::EDGetTokenT<L1MuDTChambPhContainer> OMTFPatternMaker::inputTokenDTPh
private

Definition at line 61 of file OMTFPatternMaker.h.

Referenced by analyze(), and OMTFPatternMaker().

◆ inputTokenDTTh

edm::EDGetTokenT<L1MuDTChambThContainer> OMTFPatternMaker::inputTokenDTTh
private

Definition at line 62 of file OMTFPatternMaker.h.

Referenced by analyze(), and OMTFPatternMaker().

◆ inputTokenRPC

edm::EDGetTokenT<RPCDigiCollection> OMTFPatternMaker::inputTokenRPC
private

Definition at line 64 of file OMTFPatternMaker.h.

Referenced by analyze(), and OMTFPatternMaker().

◆ inputTokenSimHit

edm::EDGetTokenT<edm::SimTrackContainer> OMTFPatternMaker::inputTokenSimHit
private

Definition at line 65 of file OMTFPatternMaker.h.

Referenced by findSimMuon(), and OMTFPatternMaker().

◆ makeConnectionsMaps

bool OMTFPatternMaker::makeConnectionsMaps
private

Definition at line 71 of file OMTFPatternMaker.h.

Referenced by analyze(), endJob(), and OMTFPatternMaker().

◆ makeGoldenPatterns

bool OMTFPatternMaker::makeGoldenPatterns
private

Definition at line 71 of file OMTFPatternMaker.h.

Referenced by analyze(), endJob(), and OMTFPatternMaker().

◆ mergeXMLFiles

bool OMTFPatternMaker::mergeXMLFiles
private

Definition at line 71 of file OMTFPatternMaker.h.

Referenced by analyze(), beginRun(), endJob(), and OMTFPatternMaker().

◆ myInputMaker

OMTFinputMaker* OMTFPatternMaker::myInputMaker
private

Definition at line 78 of file OMTFPatternMaker.h.

Referenced by analyze(), and OMTFPatternMaker().

◆ myOMTF

OMTFProcessor* OMTFPatternMaker::myOMTF
private

◆ myOMTFConfig

OMTFConfiguration* OMTFPatternMaker::myOMTFConfig
private

OMTF objects.

Definition at line 77 of file OMTFPatternMaker.h.

Referenced by analyze(), beginJob(), beginRun(), endJob(), OMTFPatternMaker(), writeMergedGPs(), and ~OMTFPatternMaker().

◆ myOMTFConfigMaker

OMTFConfigMaker* OMTFPatternMaker::myOMTFConfigMaker
private

Definition at line 82 of file OMTFPatternMaker.h.

Referenced by analyze(), beginRun(), endJob(), and ~OMTFPatternMaker().

◆ myWriter

XMLConfigWriter* OMTFPatternMaker::myWriter
private

Definition at line 83 of file OMTFPatternMaker.h.

Referenced by beginRun(), endJob(), and writeMergedGPs().

◆ nPdfAddrBits

unsigned int OMTFPatternMaker::nPdfAddrBits
private

Original pdf width. read from configuration.

Definition at line 74 of file OMTFPatternMaker.h.

Referenced by beginRun(), and endJob().

◆ theConfig

edm::ParameterSet OMTFPatternMaker::theConfig
private

Definition at line 58 of file OMTFPatternMaker.h.

Referenced by analyze(), endJob(), and OMTFPatternMaker().