18 #include "Math/VectorUtil.h"
24 g4SimTrackSrc(cfg.getParameter<edm::
InputTag>(
"g4SimTrackSrc")){
56 omtfParamsRcd.
get(omtfParamsHandle);
61 edm::LogError(
"L1TMuonOverlapTrackProducer") <<
"Could not retrieve parameters from Event Setup" << std::endl;
77 for(
auto itGP: theGPs) itGP.second->reset();
96 for(
auto itGP: myGPmap){
97 if(!itGP.second->hasCounts())
continue;
98 itGP.second->normalise();
103 for(
auto itGP: myGPmap){
106 if(iPt>31) iPt = 200*2+1;
109 if(itGP.first.thePtCode==iPt &&
121 unsigned int iProcessor = 0;
142 for(
auto itGP: myGPmap){
155 fName =
"GPs_4x.xml";
168 unsigned int iPtMin = 9;
169 Key aKey =
Key(0, iPtMin,-1);
170 while(myGPmap.find(aKey)!=myGPmap.end()){
179 if(aKey.
thePtCode<=401 && myGPmap.find(aKey)!=myGPmap.end()) aGP2 = myGPmap.find(aKey)->second;
184 if(aKey.
thePtCode<=401 && myGPmap.find(aKey)!=myGPmap.end()) aGP3 = myGPmap.find(aKey)->second;
188 if(aKey.
thePtCode<=401 && myGPmap.find(aKey)!=myGPmap.end()) aGP4 = myGPmap.find(aKey)->second;
195 Key aTmpKey = aGP1->
key();
197 if(myGPmap.find(aTmpKey)!=myGPmap.end()) aGP1 = myGPmap.find(aTmpKey)->second;
200 aTmpKey = aGP2->
key();
202 if(myGPmap.find(aTmpKey)!=myGPmap.end()) aGP2 = myGPmap.find(aTmpKey)->second;
205 aTmpKey = aGP3->
key();
207 if(myGPmap.find(aTmpKey)!=myGPmap.end()) aGP3 = myGPmap.find(aTmpKey)->second;
210 aTmpKey = aGP4->
key();
212 if(myGPmap.find(aTmpKey)!=myGPmap.end()) aGP4 = myGPmap.find(aTmpKey)->second;
227 edm::LogError(
"OMTFPatternMaker")<<
"No SimMuon found in the event!";
251 for(
unsigned int iProcessor=0;iProcessor<6;++iProcessor){
277 for (std::vector<SimTrack>::const_iterator it=simTks->begin(); it< simTks->end(); it++) {
279 if ( !(aTrack.
type() == 13 || aTrack.
type() == -13) )
continue;
281 if ( !result || aTrack.
momentum().pt() > result->
momentum().pt()) result = &aTrack;
void writeConnectionsData(const std::vector< std::vector< OMTFConfiguration::vector2D > > &measurements4D)
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::SimTrackContainer > inputTokenSimHit
void fillCounts(unsigned int iProcessor, const OMTFinput &aInput, const SimTrack *aSimMuon)
void averagePatterns(int charge)
bool configure(const OMTFConfiguration *omtfParams, const L1TMuonOverlapParams *omtfPatterns)
Fill GP map with patterns from CondFormats object.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
OMTFConfiguration * myOMTFConfig
OMTF objects.
#define DEFINE_FWK_MODULE(type)
void initialiseXMLDocument(const std::string &docName)
void makeConnetionsMap(unsigned int iProcessor, const OMTFinput &aInput)
OMTFPatternMaker(const edm::ParameterSet &cfg)
edm::EDGetTokenT< L1MuDTChambPhContainer > inputTokenDTPh
OMTFConfigMaker * myOMTFConfigMaker
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > inputTokenCSC
void printConnections(std::ostream &out, unsigned int iProcessor, unsigned int iCone)
tuple omtfParams
OMTF ESProducer.
void get(HolderT &iHolder) const
const SimTrack * findSimMuon(const edm::Event &ev, const edm::EventSetup &es, const SimTrack *previous=0)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
XMLConfigWriter * myWriter
static double ptFromIpt(const int ipt)
void configure(const L1TMuonOverlapParams *omtfParams)
void reset()
Reset contents of all data vectors, keeping the vectors size.
T const * product() const
void printPhiMap(std::ostream &out)
virtual ~OMTFPatternMaker()
int type() const
particle type (HEP PDT convension)
const math::XYZTLorentzVectorD & momentum() const
void finaliseXMLDocument(const std::string &fName)
virtual void beginRun(edm::Run const &run, edm::EventSetup const &iSetup)
edm::EDGetTokenT< RPCDigiCollection > inputTokenRPC
const std::map< Key, GoldenPattern * > & getPatterns() const
Return map of GoldenPatterns.
void writeGPData(const GoldenPattern &aGP)
edm::EDGetTokenT< L1MuDTChambThContainer > inputTokenDTTh
OMTFinputMaker * myInputMaker
edm::ParameterSet theConfig
vector4D & getMeasurements4D()