CMS 3D CMS Logo

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

#include <OMTFProcessor.h>

Public Types

typedef std::map< Key, OMTFResultresultsMap
 

Public Member Functions

void averagePatterns (int charge)
 
bool configure (XMLConfigReader *aReader)
 Fill GP map with patterns from XML file. More...
 
bool configure (std::shared_ptr< L1TMuonOverlapParams > omtfParams)
 Fill GP map with patterns from CondFormats object. More...
 
void fillCounts (unsigned int iProcessor, const OMTFinput &aInput, const SimTrack *aSimMuon)
 
const std::map< Key,
GoldenPattern * > & 
getPatterns () const
 Return map of GoldenPatterns. More...
 
 OMTFProcessor (const edm::ParameterSet &cfg)
 
const std::vector
< OMTFProcessor::resultsMap > & 
processInput (unsigned int iProcessor, const OMTFinput &aInput)
 
OMTFinput shiftInput (unsigned int iProcessor, const OMTFinput &aInput)
 
 ~OMTFProcessor ()
 

Private Member Functions

bool addGP (GoldenPattern *aGP)
 
void fillInputRange (unsigned int iProcessor, unsigned int iCone, const OMTFinput &aInput)
 
void fillInputRange (unsigned int iProcessor, unsigned int iCone, unsigned int iRefLayer, unsigned int iHit)
 
void resetConfiguration ()
 Reset all configuration parameters. More...
 
OMTFinput::vector1D restrictInput (unsigned int iProcessor, unsigned int iCone, unsigned int iLayer, const OMTFinput::vector1D &layerHits)
 
void shiftGP (GoldenPattern *aGP, const GoldenPattern::vector2D &meanDistPhiNew, const GoldenPattern::vector2D &meanDistPhiOld)
 

Private Attributes

std::vector
< OMTFProcessor::resultsMap
myResults
 
std::map< Key, GoldenPattern * > theGPs
 Map holding Golden Patterns. More...
 

Detailed Description

Definition at line 20 of file OMTFProcessor.h.

Member Typedef Documentation

Definition at line 24 of file OMTFProcessor.h.

Constructor & Destructor Documentation

OMTFProcessor::OMTFProcessor ( const edm::ParameterSet cfg)

Definition at line 25 of file OMTFProcessor.cc.

References configure(), edm::ParameterSet::exists(), LaserDQM_cfg::fileNames, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), resetConfiguration(), and XMLConfigReader::setPatternsFile().

25  {
26 
27  if(theConfig.getParameter<bool>("configFromXML")){
28  if ( !theConfig.exists("patternsXMLFiles") ) return;
29  std::vector<std::string> fileNames;
30  for(auto it: theConfig.getParameter<std::vector<edm::ParameterSet> >("patternsXMLFiles")){
31  fileNames.push_back(it.getParameter<edm::FileInPath>("patternsXMLFile").fullPath());
32  }
33 
35  XMLConfigReader myReader;
36  for(auto it: fileNames){
37  myReader.setPatternsFile(it);
38  configure(&myReader);
39  }
40  }
41 }
bool configure(XMLConfigReader *aReader)
Fill GP map with patterns from XML file.
void setPatternsFile(const std::string &fName)
void resetConfiguration()
Reset all configuration parameters.
tuple fileNames
Definition: LaserDQM_cfg.py:34
std::string fullPath() const
Definition: FileInPath.cc:184
OMTFProcessor::~OMTFProcessor ( )

Definition at line 44 of file OMTFProcessor.cc.

References theGPs.

44  {
45 
46  for(auto it: theGPs) delete it.second;
47 
48 }
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:98

Member Function Documentation

bool OMTFProcessor::addGP ( GoldenPattern aGP)
private

Add GoldenPattern to pattern map. If GP key already exists in map, a new entry is ignored

Definition at line 130 of file OMTFProcessor.cc.

References Exception, GoldenPattern::key(), myResults, and theGPs.

Referenced by configure().

130  {
131 
132  if(theGPs.find(aGP->key())!=theGPs.end()){
133  throw cms::Exception("Corrupted Golden Patterns data")
134  <<"OMTFProcessor::addGP(...) "
135  <<" Reading two Golden Patterns with the same key: "
136  <<aGP->key()<<std::endl;
137  }
138  else theGPs[aGP->key()] = new GoldenPattern(*aGP);
139 
140  for(auto & itRegion: myResults) itRegion[aGP->key()] = OMTFResult();
141 
142  return true;
143 }
Key key() const
Definition: GoldenPattern.h:59
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:98
std::vector< OMTFProcessor::resultsMap > myResults
void OMTFProcessor::averagePatterns ( int  charge)

Average patterns. Use same meanDistPhi for two patterns neighboring in pt code. Averaging is made saparately fo each charge

Definition at line 146 of file OMTFProcessor.cc.

References GoldenPattern::getMeanDistPhi(), OMTFConfiguration::nLayers, OMTFConfiguration::nRefLayers, GoldenPattern::setMeanDistPhi(), shiftGP(), theGPs, and Key::thePtCode.

Referenced by L1TMuonOverlapTrackProducer::endJob().

146  {
147 
148  Key aKey(1, 4, charge);
149 
150  while(theGPs.find(aKey)!=theGPs.end()){
151 
152  GoldenPattern *aGP1 = theGPs.find(aKey)->second;
153  GoldenPattern *aGP2 = aGP1;
154  GoldenPattern *aGP3 = aGP1;
155  GoldenPattern *aGP4 = aGP1;
156 
157  ++aKey.thePtCode;
158  if(aKey.thePtCode<=31 && theGPs.find(aKey)!=theGPs.end()) aGP2 = theGPs.find(aKey)->second;
159 
160  if(aKey.thePtCode>19){
161  ++aKey.thePtCode;
162  if(aKey.thePtCode<=31 && theGPs.find(aKey)!=theGPs.end()) aGP3 = theGPs.find(aKey)->second;
163 
164  ++aKey.thePtCode;
165  if(aKey.thePtCode<=31 && theGPs.find(aKey)!=theGPs.end()) aGP4 = theGPs.find(aKey)->second;
166  }
167  else{
168  aGP3 = aGP1;
169  aGP4 = aGP2;
170  }
171  ++aKey.thePtCode;
172 
173 
174  GoldenPattern::vector2D meanDistPhi = aGP1->getMeanDistPhi();
175 
176  GoldenPattern::vector2D meanDistPhi1 = aGP1->getMeanDistPhi();
177  GoldenPattern::vector2D meanDistPhi2 = aGP2->getMeanDistPhi();
178  GoldenPattern::vector2D meanDistPhi3 = aGP3->getMeanDistPhi();
179  GoldenPattern::vector2D meanDistPhi4 = aGP4->getMeanDistPhi();
180  /*
181  std::cout<<"Key: "
182  <<aGP1->key()
183  <<" "<<aGP2->key()
184  <<" "<<aGP3->key()
185  <<" "<<aGP4->key()<<std::endl;
186  */
187  for(unsigned int iLayer=0;iLayer<OMTFConfiguration::nLayers;++iLayer){
188  for(unsigned int iRefLayer=0;iRefLayer<OMTFConfiguration::nRefLayers;++iRefLayer){
189  meanDistPhi[iLayer][iRefLayer]+=meanDistPhi2[iLayer][iRefLayer];
190  meanDistPhi[iLayer][iRefLayer]+=meanDistPhi3[iLayer][iRefLayer];
191  meanDistPhi[iLayer][iRefLayer]+=meanDistPhi4[iLayer][iRefLayer];
192  meanDistPhi[iLayer][iRefLayer]/=4;
193  /*
194  std::cout<<"Mean distPhi: "<<meanDistPhi[iLayer][iRefLayer]
195  <<" "<<meanDistPhi1[iLayer][iRefLayer]
196  <<" "<<meanDistPhi2[iLayer][iRefLayer]
197  <<" "<<meanDistPhi3[iLayer][iRefLayer]
198  <<" "<<meanDistPhi4[iLayer][iRefLayer]<<std::endl;
199  */
200  }
201  }
202 
203  aGP1->setMeanDistPhi(meanDistPhi);
204  aGP2->setMeanDistPhi(meanDistPhi);
205 
206 
207  shiftGP(aGP1,meanDistPhi, meanDistPhi1);
208  shiftGP(aGP2,meanDistPhi, meanDistPhi2);
209  if(aGP3!=aGP1 && aGP4!=aGP2){
210  aGP3->setMeanDistPhi(meanDistPhi);
211  aGP4->setMeanDistPhi(meanDistPhi);
212  shiftGP(aGP3,meanDistPhi, meanDistPhi3);
213  shiftGP(aGP4,meanDistPhi, meanDistPhi4);
214  }
215  }
216 
217 }
static unsigned int nLayers
const vector2D & getMeanDistPhi() const
Definition: GoldenPattern.h:63
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:98
std::vector< vector1D > vector2D
Definition: GoldenPattern.h:50
static unsigned int nRefLayers
void shiftGP(GoldenPattern *aGP, const GoldenPattern::vector2D &meanDistPhiNew, const GoldenPattern::vector2D &meanDistPhiOld)
void setMeanDistPhi(const vector2D &aMeanDistPhi)
Definition: GoldenPattern.h:61
bool OMTFProcessor::configure ( XMLConfigReader aReader)

Fill GP map with patterns from XML file.

Definition at line 58 of file OMTFProcessor.cc.

References addGP(), myResults, OMTFConfiguration::nTestRefHits, XMLConfigReader::readPatterns(), and resetConfiguration().

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

58  {
59 
61 
63 
64  const std::vector<GoldenPattern *> & aGPs = aReader->readPatterns();
65  for(auto it: aGPs){
66  if(!addGP(it)) return false;
67  }
68 
69  return true;
70 }
std::map< Key, OMTFResult > resultsMap
Definition: OMTFProcessor.h:24
bool addGP(GoldenPattern *aGP)
static unsigned int nTestRefHits
void resetConfiguration()
Reset all configuration parameters.
std::vector< GoldenPattern * > readPatterns()
std::vector< OMTFProcessor::resultsMap > myResults
bool OMTFProcessor::configure ( std::shared_ptr< L1TMuonOverlapParams omtfParams)

Fill GP map with patterns from CondFormats object.

Mean dist phi data

Pdf data

Definition at line 73 of file OMTFProcessor.cc.

References addGP(), l1t::LUT::data(), myResults, OMTFConfiguration::nGoldenPatterns, OMTFConfiguration::nLayers, OMTFConfiguration::nPdfAddrBits, l1t::LUT::nrBitsData(), OMTFConfiguration::nRefLayers, OMTFConfiguration::nTestRefHits, resetConfiguration(), GoldenPattern::setMeanDistPhi(), and GoldenPattern::setPdf().

73  {
74 
76 
78 
79  l1t::LUT* chargeLUT = omtfParams->chargeLUT();
80  l1t::LUT* etaLUT = omtfParams->etaLUT();
81  l1t::LUT* ptLUT = omtfParams->ptLUT();
82  l1t::LUT* pdfLUT = omtfParams->pdfLUT();
83  l1t::LUT* meanDistPhiLUT = omtfParams->meanDistPhiLUT();
84 
85  unsigned int nGPs = OMTFConfiguration::nGoldenPatterns;
86  unsigned int address = 0;
87  unsigned int iEta, iPt, iCharge;
88  for(unsigned int iGP=0;iGP<nGPs;++iGP){
89  address = iGP;
90  iEta = etaLUT->data(address);
91  iCharge = chargeLUT->data(address);
92  if(iCharge==0) iCharge = -1;//FIXME: Standarise to 0,1
93  iPt = ptLUT->data(address);
94 
100  for(unsigned int iLayer=0;iLayer<OMTFConfiguration::nLayers;++iLayer){
102  for(unsigned int iRefLayer=0;iRefLayer<OMTFConfiguration::nRefLayers;++iRefLayer){
103  address = iRefLayer + iLayer*OMTFConfiguration::nRefLayers + iGP*(OMTFConfiguration::nRefLayers*OMTFConfiguration::nLayers);
104  meanDistPhi1D[iRefLayer] = meanDistPhiLUT->data(address) - (1<<(meanDistPhiLUT->nrBitsData() -1));
105  }
106  meanDistPhi2D[iLayer] = meanDistPhi1D;
108  for(unsigned int iRefLayer=0;iRefLayer<OMTFConfiguration::nRefLayers;++iRefLayer){
109  pdf1D.assign(1<<OMTFConfiguration::nPdfAddrBits,0);
110  for(unsigned int iPdf=0;iPdf<(unsigned int)(1<<OMTFConfiguration::nPdfAddrBits);++iPdf){
111  address = iPdf + iRefLayer*(1<<OMTFConfiguration::nPdfAddrBits) +
112  iLayer*OMTFConfiguration::nRefLayers*(1<<OMTFConfiguration::nPdfAddrBits) +
113  iGP*OMTFConfiguration::nLayers*OMTFConfiguration::nRefLayers*(1<<OMTFConfiguration::nPdfAddrBits);
114  pdf1D[iPdf] = pdfLUT->data(address);
115  }
116  pdf2D[iRefLayer] = pdf1D;
117  }
118  pdf3D[iLayer] = pdf2D;
119  }
120  Key aKey(iEta,iPt,iCharge);
121  GoldenPattern *aGP = new GoldenPattern(aKey);
122  aGP->setMeanDistPhi(meanDistPhi2D);
123  aGP->setPdf(pdf3D);
124  addGP(aGP);
125  }
126  return true;
127 }
static unsigned int nLayers
std::vector< int > vector1D
Definition: GoldenPattern.h:49
std::map< Key, OMTFResult > resultsMap
Definition: OMTFProcessor.h:24
bool addGP(GoldenPattern *aGP)
static unsigned int nPdfAddrBits
unsigned int nrBitsData() const
Definition: LUT.h:51
std::vector< vector1D > vector2D
Definition: GoldenPattern.h:50
std::vector< vector2D > vector3D
Definition: GoldenPattern.h:51
void setPdf(const vector3D &aPdf)
Definition: GoldenPattern.h:67
static unsigned int nTestRefHits
void resetConfiguration()
Reset all configuration parameters.
Definition: LUT.h:29
static unsigned int nRefLayers
void setMeanDistPhi(const vector2D &aMeanDistPhi)
Definition: GoldenPattern.h:61
int data(unsigned int address) const
Definition: LUT.h:46
static unsigned int nGoldenPatterns
std::vector< OMTFProcessor::resultsMap > myResults
void OMTFProcessor::fillCounts ( unsigned int  iProcessor,
const OMTFinput aInput,
const SimTrack aSimMuon 
)

Fill counts for a GoldenPattern of this processor unit. Pattern key is selcted according to the SimTrack parameters.

Number of reference hits to be checked. Value read from XML configuration

Definition at line 346 of file OMTFProcessor.cc.

References funct::abs(), OMTFConfiguration::bendingLayers, KineDebug3::count(), OMTFinput::getLayerData(), OMTFinput::getRefHits(), RefHitDef::iInput, RPCConst::iptFromPt(), RefHitDef::iRefLayer, RefHitDef::iRegion, CoreSimTrack::momentum(), OMTFConfiguration::nLayers, OMTFConfiguration::nRefHits, OMTFConfiguration::refHitsDefs, OMTFConfiguration::refToLogicNumber, restrictInput(), theGPs, and CoreSimTrack::type().

348  {
349 
350  int theCharge = (abs(aSimMuon->type()) == 13) ? aSimMuon->type()/-13 : 0;
351  unsigned int iPt = RPCConst::iptFromPt(aSimMuon->momentum().pt());
352 
354  std::bitset<128> refHitsBits = aInput.getRefHits(iProcessor);
355  if(refHitsBits.none()) return;
356 
357  std::ostringstream myStr;
358  myStr<<"iProcessor: "<<iProcessor<<std::endl;
359  myStr<<"Input: ------------"<<std::endl;
360  myStr<<aInput<<std::endl;
361  edm::LogInfo("OMTF processor")<<myStr.str();
362 
363  for(unsigned int iLayer=0;iLayer<OMTFConfiguration::nLayers;++iLayer){
364  const OMTFinput::vector1D & layerHits = aInput.getLayerData(iLayer);
365  if(!layerHits.size()) continue;
368  for(unsigned int iRefHit=0;iRefHit<OMTFConfiguration::nRefHits;++iRefHit){
369  if(!refHitsBits[iRefHit]) continue;
370  const RefHitDef & aRefHitDef = OMTFConfiguration::refHitsDefs[iProcessor][iRefHit];
371  int phiRef = aInput.getLayerData(OMTFConfiguration::refToLogicNumber[aRefHitDef.iRefLayer])[aRefHitDef.iInput];
372  unsigned int iRegion = aRefHitDef.iRegion;
373  if(OMTFConfiguration::bendingLayers.count(iLayer)) phiRef = 0;
374  const OMTFinput::vector1D restrictedLayerHits = restrictInput(iProcessor, iRegion, iLayer,layerHits);
375  for(auto itGP: theGPs){
376  if(itGP.first.theCharge!=theCharge) continue;
377  if(itGP.first.thePtCode!=iPt) continue;
378  itGP.second->addCount(aRefHitDef.iRefLayer,iLayer,phiRef,restrictedLayerHits);
379  }
380  }
381  }
382 }
static unsigned int nLayers
unsigned int iInput
Hit input number within a cone.
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:98
std::vector< int > vector1D
Definition: OMTFinput.h:14
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::bitset< 128 > getRefHits(unsigned int iProcessor) const
Definition: OMTFinput.cc:26
static std::vector< int > refToLogicNumber
OMTFinput::vector1D restrictInput(unsigned int iProcessor, unsigned int iCone, unsigned int iLayer, const OMTFinput::vector1D &layerHits)
static unsigned int nRefHits
static std::set< int > bendingLayers
int type() const
particle type (HEP PDT convension)
Definition: CoreSimTrack.h:25
const math::XYZTLorentzVectorD & momentum() const
Definition: CoreSimTrack.h:22
unsigned int iRefLayer
Reference layer logic number (0-7)
unsigned int iRegion
Region number assigned to this referecne hit.
static int iptFromPt(const double pt)
Definition: RPCConst.cc:10
static std::vector< std::vector< RefHitDef > > refHitsDefs
void OMTFProcessor::fillInputRange ( unsigned int  iProcessor,
unsigned int  iCone,
const OMTFinput aInput 
)
private

Fill map of used inputs. FIXME: using hack from OMTFConfiguration

void OMTFProcessor::fillInputRange ( unsigned int  iProcessor,
unsigned int  iCone,
unsigned int  iRefLayer,
unsigned int  iHit 
)
private
const std::map< Key, GoldenPattern * > & OMTFProcessor::getPatterns ( ) const

Return map of GoldenPatterns.

Definition at line 245 of file OMTFProcessor.cc.

References theGPs.

Referenced by L1TMuonOverlapTrackProducer::endJob(), and L1TMuonOverlapTrackProducer::writeMergedGPs().

245 { return theGPs; }
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:98
const std::vector< OMTFProcessor::resultsMap > & OMTFProcessor::processInput ( unsigned int  iProcessor,
const OMTFinput aInput 
)

Process input data from a single event Input data is represented by hits in logic layers expressed in local coordinates Vector index: logic region number Map key: GoldenPattern key

Number of reference hits to be checked. Value read from XML configuration

Definition at line 248 of file OMTFProcessor.cc.

References OMTFConfiguration::bendingLayers, KineDebug3::count(), OMTFinput::getLayerData(), OMTFinput::getRefHits(), RefHitDef::iInput, RefHitDef::iRefLayer, RefHitDef::iRegion, myResults, OMTFConfiguration::nLayers, OMTFConfiguration::nRefHits, OMTFConfiguration::nTestRefHits, OMTFConfiguration::refHitsDefs, OMTFConfiguration::refToLogicNumber, restrictInput(), and theGPs.

Referenced by L1TMuonOverlapTrackProducer::produce().

249  {
250 
251  for(auto & itRegion: myResults) for(auto & itKey: itRegion) itKey.second.clear();
252 
255  std::bitset<128> refHitsBits = aInput.getRefHits(iProcessor);
256  if(refHitsBits.none()) return myResults;
257 
258  for(unsigned int iLayer=0;iLayer<OMTFConfiguration::nLayers;++iLayer){
259  const OMTFinput::vector1D & layerHits = aInput.getLayerData(iLayer);
260  if(!layerHits.size()) continue;
263  unsigned int nTestedRefHits = OMTFConfiguration::nTestRefHits;
264  for(unsigned int iRefHit=0;iRefHit<OMTFConfiguration::nRefHits;++iRefHit){
265  if(!refHitsBits[iRefHit]) continue;
266  if(nTestedRefHits--==0) break;
267  const RefHitDef & aRefHitDef = OMTFConfiguration::refHitsDefs[iProcessor][iRefHit];
268  int phiRef = aInput.getLayerData(OMTFConfiguration::refToLogicNumber[aRefHitDef.iRefLayer])[aRefHitDef.iInput];
269  int etaRef = aInput.getLayerData(OMTFConfiguration::refToLogicNumber[aRefHitDef.iRefLayer],true)[aRefHitDef.iInput];
270  unsigned int iRegion = aRefHitDef.iRegion;
271  if(OMTFConfiguration::bendingLayers.count(iLayer)) phiRef = 0;
272  const OMTFinput::vector1D restrictedLayerHits = restrictInput(iProcessor, iRegion, iLayer,layerHits);
273  for(auto itGP: theGPs){
274  GoldenPattern::layerResult aLayerResult = itGP.second->process1Layer1RefLayer(aRefHitDef.iRefLayer,iLayer,
275  phiRef,
276  restrictedLayerHits);
277 
278  int phiRefSt2 = itGP.second->propagateRefPhi(phiRef, etaRef, aRefHitDef.iRefLayer);
279  myResults[OMTFConfiguration::nTestRefHits-nTestedRefHits-1][itGP.second->key()].addResult(aRefHitDef.iRefLayer,iLayer,
280  aLayerResult.first,
281  phiRefSt2,etaRef);
282  }
283  }
284  }
287  for(auto & itRefHit: myResults) for(auto & itKey: itRefHit) itKey.second.finalise();
288 
289  //#ifndef NDEBUG
290  std::ostringstream myStr;
291  myStr<<"iProcessor: "<<iProcessor<<std::endl;
292  myStr<<"Input: ------------"<<std::endl;
293  myStr<<aInput<<std::endl;
294  /*
295  for(auto itRefHit: myResults){
296  myStr<<"--- Reference hit ---"<<std::endl;
297  for(auto itKey: itRefHit){
298  if(itKey.second.empty()) continue;
299  myStr<<itKey.first<<std::endl;
300  myStr<<itKey.second<<std::endl;
301  }
302  myStr<<"--------------------"<<std::endl;
303  }
304  */
305  //LogDebug("OMTF processor")<<myStr.str();
306  edm::LogInfo("OMTF processor")<<myStr.str();
307  //#endif
308 
309  return myResults;
310 }
static unsigned int nLayers
unsigned int iInput
Hit input number within a cone.
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:98
std::vector< int > vector1D
Definition: OMTFinput.h:14
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:18
static unsigned int nTestRefHits
std::bitset< 128 > getRefHits(unsigned int iProcessor) const
Definition: OMTFinput.cc:26
std::pair< int, bool > layerResult
Definition: GoldenPattern.h:52
static std::vector< int > refToLogicNumber
OMTFinput::vector1D restrictInput(unsigned int iProcessor, unsigned int iCone, unsigned int iLayer, const OMTFinput::vector1D &layerHits)
static unsigned int nRefHits
static std::set< int > bendingLayers
unsigned int iRefLayer
Reference layer logic number (0-7)
unsigned int iRegion
Region number assigned to this referecne hit.
std::vector< OMTFProcessor::resultsMap > myResults
static std::vector< std::vector< RefHitDef > > refHitsDefs
void OMTFProcessor::resetConfiguration ( )
private

Reset all configuration parameters.

Definition at line 51 of file OMTFProcessor.cc.

References myResults, and theGPs.

Referenced by configure(), and OMTFProcessor().

51  {
52 
53  myResults.clear();
54  theGPs.clear();
55 }
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:98
std::vector< OMTFProcessor::resultsMap > myResults
OMTFinput::vector1D OMTFProcessor::restrictInput ( unsigned int  iProcessor,
unsigned int  iCone,
unsigned int  iLayer,
const OMTFinput::vector1D layerHits 
)
private

Remove hits whis are outside input range for given processor and cone

Definition at line 328 of file OMTFProcessor.cc.

References OMTFConfiguration::connections, and OMTFConfiguration::nPhiBins.

Referenced by fillCounts(), and processInput().

331  {
332 
333  OMTFinput::vector1D myHits = layerHits;
334 
335  unsigned int iStart = OMTFConfiguration::connections[iProcessor][iRegion][iLayer].first;
336  unsigned int iEnd = iStart + OMTFConfiguration::connections[iProcessor][iRegion][iLayer].second -1;
337 
338  for(unsigned int iInput=0;iInput<14;++iInput){
339  if(iInput<iStart || iInput>iEnd) myHits[iInput] = OMTFConfiguration::nPhiBins;
340  }
341 
342  return myHits;
343 }
static vector3D_A connections
std::vector< int > vector1D
Definition: OMTFinput.h:14
static unsigned int nPhiBins
void OMTFProcessor::shiftGP ( GoldenPattern aGP,
const GoldenPattern::vector2D meanDistPhiNew,
const GoldenPattern::vector2D meanDistPhiOld 
)
private

Shift pdf indexes by differecne between averaged and original meanDistPhi

Shift pdfs by differecne between original menaDistPhi, and the averaged value

Definition at line 220 of file OMTFProcessor.cc.

References GoldenPattern::getPdf(), OMTFConfiguration::nLayers, OMTFConfiguration::nPdfAddrBits, OMTFConfiguration::nRefLayers, GoldenPattern::pdfValue(), and GoldenPattern::setPdf().

Referenced by averagePatterns().

222  {
223 
226  unsigned int nPdfBins = exp2(OMTFConfiguration::nPdfAddrBits);
227 
228  GoldenPattern::vector3D pdfAllRef = aGP->getPdf();
229 
230  int indexShift = 0;
231  for(unsigned int iLayer=0;iLayer<OMTFConfiguration::nLayers;++iLayer){
232  for(unsigned int iRefLayer=0;iRefLayer<OMTFConfiguration::nRefLayers;++iRefLayer){
233  indexShift = meanDistPhiOld[iLayer][iRefLayer] - meanDistPhiNew[iLayer][iRefLayer];
234  for(unsigned int iPdfBin=0;iPdfBin<nPdfBins;++iPdfBin) pdfAllRef[iLayer][iRefLayer][iPdfBin] = 0;
235  for(unsigned int iPdfBin=0;iPdfBin<nPdfBins;++iPdfBin){
236  if((int)(iPdfBin)+indexShift>=0 && iPdfBin+indexShift<nPdfBins)
237  pdfAllRef[iLayer][iRefLayer][iPdfBin+indexShift] = aGP->pdfValue(iLayer, iRefLayer, iPdfBin);
238  }
239  }
240  }
241  aGP->setPdf(pdfAllRef);
242 }
static unsigned int nLayers
static unsigned int nPdfAddrBits
std::vector< vector2D > vector3D
Definition: GoldenPattern.h:51
void setPdf(const vector3D &aPdf)
Definition: GoldenPattern.h:67
static unsigned int nRefLayers
int pdfValue(unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin) const
Definition: GoldenPattern.h:71
const vector3D & getPdf() const
Definition: GoldenPattern.h:65
OMTFinput OMTFProcessor::shiftInput ( unsigned int  iProcessor,
const OMTFinput aInput 
)

Shift phi values in input to fit the 11 bits range. For each processor the global phi beggining-511 is added, so it starts at -551

OMTFConfiguration::nPhiBins/2 to shift the minPhi to 0-nBins scale,

Definition at line 313 of file OMTFProcessor.cc.

References OMTFConfiguration::globalPhiStart(), OMTFConfiguration::nPhiBins, and OMTFinput::shiftMyPhi().

Referenced by L1TMuonOverlapTrackProducer::produce().

314  {
315 
316  int minPhi = OMTFConfiguration::globalPhiStart(iProcessor);
317 
319  if(minPhi<0) minPhi+=OMTFConfiguration::nPhiBins;
320 
321  OMTFinput myCopy = aInput;
322  myCopy.shiftMyPhi(minPhi);
323 
324  return myCopy;
325 }
void shiftMyPhi(int phiShift)
Apply shift to all data.
Definition: OMTFinput.cc:105
static int globalPhiStart(unsigned int iProcessor)
static unsigned int nPhiBins

Member Data Documentation

std::vector<OMTFProcessor::resultsMap> OMTFProcessor::myResults
private

Map holding results on current event data for each GP. Reference hit number is isued as a vector index.

Definition at line 103 of file OMTFProcessor.h.

Referenced by addGP(), configure(), processInput(), and resetConfiguration().

std::map<Key,GoldenPattern*> OMTFProcessor::theGPs
private

Map holding Golden Patterns.

Definition at line 98 of file OMTFProcessor.h.

Referenced by addGP(), averagePatterns(), fillCounts(), getPatterns(), processInput(), resetConfiguration(), and ~OMTFProcessor().