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 (const 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, OMTFConfiguration *omtf_config)
 
const std::vector
< OMTFProcessor::resultsMap > & 
processInput (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

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

Detailed Description

Definition at line 21 of file OMTFProcessor.h.

Member Typedef Documentation

Definition at line 25 of file OMTFProcessor.h.

Constructor & Destructor Documentation

OMTFProcessor::OMTFProcessor ( const edm::ParameterSet cfg,
OMTFConfiguration omtf_config 
)

Definition at line 23 of file OMTFProcessor.cc.

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

23  : m_omtf_config(omtf_config) {
24 
25  if(theConfig.getParameter<bool>("configFromXML")){
26  if ( !theConfig.exists("patternsXMLFiles") ) return;
27  std::vector<std::string> fileNames;
28  for(auto it: theConfig.getParameter<std::vector<edm::ParameterSet> >("patternsXMLFiles")){
29  fileNames.push_back(it.getParameter<edm::FileInPath>("patternsXMLFile").fullPath());
30  }
33  for(auto it: fileNames){
34  myReader.setPatternsFile(it);
35  configure(&myReader);
36  }
37  }
38 }
bool configure(XMLConfigReader *aReader)
Fill GP map with patterns from XML file.
OMTFConfiguration * m_omtf_config
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 41 of file OMTFProcessor.cc.

References theGPs.

41  {
42 
43  for(auto it: theGPs) delete it.second;
44 
45 }
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:93

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 126 of file OMTFProcessor.cc.

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

Referenced by configure().

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

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

Previously pt codes were going by steps of 1, now this is not the case

Definition at line 142 of file OMTFProcessor.cc.

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

Referenced by OMTFPatternMaker::endJob().

142  {
143 
144  Key aKey(0, 9, charge);
145 
146  while(theGPs.find(aKey)!=theGPs.end()){
147 
148  GoldenPattern *aGP1 = theGPs.find(aKey)->second;
149  GoldenPattern *aGP2 = aGP1;
150  GoldenPattern *aGP3 = aGP1;
151  GoldenPattern *aGP4 = aGP1;
152 
153  ++aKey.thePtCode;
154  while(theGPs.find(aKey)==theGPs.end() && aKey.thePtCode<=401) ++aKey.thePtCode;
155  if(aKey.thePtCode<=401 && theGPs.find(aKey)!=theGPs.end()) aGP2 = theGPs.find(aKey)->second;
156 
157  if(aKey.thePtCode>71){
158  ++aKey.thePtCode;
159  while(theGPs.find(aKey)==theGPs.end() && aKey.thePtCode<=401) ++aKey.thePtCode;
160  if(aKey.thePtCode<=401 && theGPs.find(aKey)!=theGPs.end()) aGP3 = theGPs.find(aKey)->second;
161 
162  ++aKey.thePtCode;
163  while(theGPs.find(aKey)==theGPs.end() && aKey.thePtCode<=401) ++aKey.thePtCode;
164  if(aKey.thePtCode<=401 && theGPs.find(aKey)!=theGPs.end()) aGP4 = theGPs.find(aKey)->second;
165  }
166  else{
167  aGP3 = aGP1;
168  aGP4 = aGP2;
169  }
170  //HACK. Have to clean this up.
172  ++aKey.thePtCode;
173  while(theGPs.find(aKey)==theGPs.end() && aKey.thePtCode<=401) ++aKey.thePtCode;
175 
176 
177  GoldenPattern::vector2D meanDistPhi = aGP1->getMeanDistPhi();
178 
179  GoldenPattern::vector2D meanDistPhi1 = aGP1->getMeanDistPhi();
180  GoldenPattern::vector2D meanDistPhi2 = aGP2->getMeanDistPhi();
181  GoldenPattern::vector2D meanDistPhi3 = aGP3->getMeanDistPhi();
182  GoldenPattern::vector2D meanDistPhi4 = aGP4->getMeanDistPhi();
183 
184  for(unsigned int iLayer=0;iLayer<OMTFConfiguration::instance()->nLayers;++iLayer){
185  for(unsigned int iRefLayer=0;iRefLayer<OMTFConfiguration::instance()->nRefLayers;++iRefLayer){
186  meanDistPhi[iLayer][iRefLayer]+=meanDistPhi2[iLayer][iRefLayer];
187  meanDistPhi[iLayer][iRefLayer]+=meanDistPhi3[iLayer][iRefLayer];
188  meanDistPhi[iLayer][iRefLayer]+=meanDistPhi4[iLayer][iRefLayer];
189  meanDistPhi[iLayer][iRefLayer]/=4;
190  }
191  }
192 
193  aGP1->setMeanDistPhi(meanDistPhi);
194  aGP2->setMeanDistPhi(meanDistPhi);
195 
196 
197  shiftGP(aGP1,meanDistPhi, meanDistPhi1);
198  shiftGP(aGP2,meanDistPhi, meanDistPhi2);
199  if(aGP3!=aGP1 && aGP4!=aGP2){
200  aGP3->setMeanDistPhi(meanDistPhi);
201  aGP4->setMeanDistPhi(meanDistPhi);
202  shiftGP(aGP3,meanDistPhi, meanDistPhi3);
203  shiftGP(aGP4,meanDistPhi, meanDistPhi4);
204  }
205  }
206 
207 }
unsigned int nLayers
const vector2D & getMeanDistPhi() const
Definition: GoldenPattern.h:63
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:93
std::vector< vector1D > vector2D
Definition: GoldenPattern.h:50
unsigned int nRefLayers
void shiftGP(GoldenPattern *aGP, const GoldenPattern::vector2D &meanDistPhiNew, const GoldenPattern::vector2D &meanDistPhiOld)
void setMeanDistPhi(const vector2D &aMeanDistPhi)
Definition: GoldenPattern.h:61
static const OMTFConfiguration * instance()
bool OMTFProcessor::configure ( XMLConfigReader aReader)

Fill GP map with patterns from XML file.

Definition at line 55 of file OMTFProcessor.cc.

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

Referenced by OMTFPatternMaker::beginRun(), OMTFReconstruction::beginRun(), and OMTFProcessor().

55  {
56 
58 
60 
61  const std::vector<GoldenPattern *> & aGPs = aReader->readPatterns();
62  for(auto it: aGPs){
63  if(!addGP(it)) return false;
64  }
65 
66  return true;
67 }
std::map< Key, OMTFResult > resultsMap
Definition: OMTFProcessor.h:25
bool addGP(GoldenPattern *aGP)
void resetConfiguration()
Reset all configuration parameters.
std::vector< GoldenPattern * > readPatterns()
std::vector< OMTFProcessor::resultsMap > myResults
Definition: OMTFProcessor.h:98
static const OMTFConfiguration * instance()
bool OMTFProcessor::configure ( const L1TMuonOverlapParams omtfParams)

Fill GP map with patterns from CondFormats object.

Mean dist phi data

Pdf data

Definition at line 70 of file OMTFProcessor.cc.

References addGP(), L1TMuonOverlapParams::chargeLUT(), l1t::LUT::data(), L1TMuonOverlapParams::etaLUT(), OMTFConfiguration::instance(), L1TMuonOverlapParams::meanDistPhiLUT(), myResults, OMTFConfiguration::nGoldenPatterns, OMTFConfiguration::nLayers, OMTFConfiguration::nPdfAddrBits, l1t::LUT::nrBitsData(), OMTFConfiguration::nRefLayers, L1TMuonOverlapParams::pdfLUT(), L1TMuonOverlapParams::ptLUT(), resetConfiguration(), GoldenPattern::setMeanDistPhi(), and GoldenPattern::setPdf().

70  {
71 
73 
75 
76  const l1t::LUT* chargeLUT = omtfParams->chargeLUT();
77  const l1t::LUT* etaLUT = omtfParams->etaLUT();
78  const l1t::LUT* ptLUT = omtfParams->ptLUT();
79  const l1t::LUT* pdfLUT = omtfParams->pdfLUT();
80  const l1t::LUT* meanDistPhiLUT = omtfParams->meanDistPhiLUT();
81 
82  unsigned int nGPs = OMTFConfiguration::instance()->nGoldenPatterns;
83  unsigned int address = 0;
84  unsigned int iEta, iPt, iCharge;
85  for(unsigned int iGP=0;iGP<nGPs;++iGP){
86  address = iGP;
87  iEta = etaLUT->data(address);
88  iCharge = chargeLUT->data(address)==0? -1:1;
89  iPt = ptLUT->data(address);
90  GoldenPattern::vector2D meanDistPhi2D(OMTFConfiguration::instance()->nLayers);
91  GoldenPattern::vector1D pdf1D(exp2(OMTFConfiguration::instance()->nPdfAddrBits));
95  for(unsigned int iLayer=0;iLayer<OMTFConfiguration::instance()->nLayers;++iLayer){
96  GoldenPattern::vector1D meanDistPhi1D(OMTFConfiguration::instance()->nRefLayers);
97  for(unsigned int iRefLayer=0;iRefLayer<OMTFConfiguration::instance()->nRefLayers;++iRefLayer){
99  meanDistPhi1D[iRefLayer] = meanDistPhiLUT->data(address) - (1<<(meanDistPhiLUT->nrBitsData() -1));
100  }
101  meanDistPhi2D[iLayer] = meanDistPhi1D;
103  for(unsigned int iRefLayer=0;iRefLayer<OMTFConfiguration::instance()->nRefLayers;++iRefLayer){
104  pdf1D.assign(1<<OMTFConfiguration::instance()->nPdfAddrBits,0);
105  for(unsigned int iPdf=0;iPdf<(unsigned int)(1<<OMTFConfiguration::instance()->nPdfAddrBits);++iPdf){
106  address = iPdf + iRefLayer*(1<<OMTFConfiguration::instance()->nPdfAddrBits) +
109  pdf1D[iPdf] = pdfLUT->data(address);
110  }
111  pdf2D[iRefLayer] = pdf1D;
112  }
113  pdf3D[iLayer] = pdf2D;
114  }
115  Key aKey(iEta,iPt,iCharge);
116 
117  GoldenPattern *aGP = new GoldenPattern(aKey);
118  aGP->setMeanDistPhi(meanDistPhi2D);
119  aGP->setPdf(pdf3D);
120  addGP(aGP);
121  }
122  return true;
123 }
unsigned int nLayers
std::vector< int > vector1D
Definition: GoldenPattern.h:49
std::map< Key, OMTFResult > resultsMap
Definition: OMTFProcessor.h:25
const l1t::LUT * chargeLUT() const
Golden Patterns definitions.
bool addGP(GoldenPattern *aGP)
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
void resetConfiguration()
Reset all configuration parameters.
const l1t::LUT * etaLUT() const
const l1t::LUT * pdfLUT() const
Definition: LUT.h:29
unsigned int nRefLayers
const l1t::LUT * ptLUT() const
void setMeanDistPhi(const vector2D &aMeanDistPhi)
Definition: GoldenPattern.h:61
int data(unsigned int address) const
Definition: LUT.h:46
unsigned int nGoldenPatterns
const l1t::LUT * meanDistPhiLUT() const
std::vector< OMTFProcessor::resultsMap > myResults
Definition: OMTFProcessor.h:98
static const OMTFConfiguration * instance()
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.

Stupid conersion. Have to go through PAC pt scale, as we later shift resulting pt code by +1

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

Definition at line 313 of file OMTFProcessor.cc.

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

Referenced by OMTFPatternMaker::analyze().

315  {
316 
317  int theCharge = abs(aSimMuon->type()) == 13 ? -1 : 1;
318  unsigned int iPt = RPCConst::iptFromPt(aSimMuon->momentum().pt());
321  iPt+=1;
322  if(iPt>31) iPt=200*2+1;
323  else iPt = RPCConst::ptFromIpt(iPt)*2.0+1;//MicroGMT has 0.5 GeV step size, with lower bin edge (uGMT_pt_code - 1)*step_size
325 
327  std::bitset<128> refHitsBits = aInput.getRefHits(iProcessor);
328  if(refHitsBits.none()) return;
329 
330  std::ostringstream myStr;
331  myStr<<"iProcessor: "<<iProcessor<<std::endl;
332  myStr<<"Input: ------------"<<std::endl;
333  myStr<<aInput<<std::endl;
334  edm::LogInfo("OMTF processor")<<myStr.str();
335 
336  for(unsigned int iLayer=0;iLayer<OMTFConfiguration::instance()->nLayers;++iLayer){
337  const OMTFinput::vector1D & layerHits = aInput.getLayerData(iLayer);
338  if(!layerHits.size()) continue;
341  for(unsigned int iRefHit=0;iRefHit<OMTFConfiguration::instance()->nRefHits;++iRefHit){
342  if(!refHitsBits[iRefHit]) continue;
343  const RefHitDef & aRefHitDef = OMTFConfiguration::instance()->refHitsDefs[iProcessor][iRefHit];
344  int phiRef = aInput.getLayerData(OMTFConfiguration::instance()->refToLogicNumber[aRefHitDef.iRefLayer])[aRefHitDef.iInput];
345  unsigned int iRegion = aRefHitDef.iRegion;
346  if(OMTFConfiguration::instance()->bendingLayers.count(iLayer)) phiRef = 0;
347  const OMTFinput::vector1D restrictedLayerHits = restrictInput(iProcessor, iRegion, iLayer,layerHits);
348  for(auto itGP: theGPs){
349  if(itGP.first.theCharge!=theCharge) continue;
350  if(itGP.first.thePtCode!=iPt) continue;
351  itGP.second->addCount(aRefHitDef.iRefLayer,iLayer,phiRef,restrictedLayerHits);
352  }
353  }
354  }
355 }
unsigned int nLayers
unsigned int iInput
Hit input number within a cone.
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:93
std::vector< int > vector1D
Definition: OMTFinput.h:14
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:18
std::vector< std::vector< RefHitDef > > refHitsDefs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::bitset< 128 > getRefHits(unsigned int iProcessor) const
Definition: OMTFinput.cc:26
static double ptFromIpt(const int ipt)
Definition: RPCConst.cc:28
OMTFinput::vector1D restrictInput(unsigned int iProcessor, unsigned int iCone, unsigned int iLayer, const OMTFinput::vector1D &layerHits)
unsigned int nRefHits
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 const OMTFConfiguration * instance()
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 235 of file OMTFProcessor.cc.

References theGPs.

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

235 { return theGPs; }
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:93
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 238 of file OMTFProcessor.cc.

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

Referenced by OMTFReconstruction::getProcessorCandidates().

239  {
240 
241  for(auto & itRegion: myResults) for(auto & itKey: itRegion) itKey.second.clear();
242 
245  std::bitset<128> refHitsBits = aInput.getRefHits(iProcessor);
246  if(refHitsBits.none()) return myResults;
247 
248  for(unsigned int iLayer=0;iLayer<OMTFConfiguration::instance()->nLayers;++iLayer){
249  const OMTFinput::vector1D & layerHits = aInput.getLayerData(iLayer);
250  if(!layerHits.size()) continue;
253  unsigned int nTestedRefHits = OMTFConfiguration::instance()->nTestRefHits;
254  for(unsigned int iRefHit=0;iRefHit<OMTFConfiguration::instance()->nRefHits;++iRefHit){
255  if(!refHitsBits[iRefHit]) continue;
256  if(nTestedRefHits--==0) break;
257  const RefHitDef & aRefHitDef = OMTFConfiguration::instance()->refHitsDefs[iProcessor][iRefHit];
258 
259  int phiRef = aInput.getLayerData(OMTFConfiguration::instance()->refToLogicNumber[aRefHitDef.iRefLayer])[aRefHitDef.iInput];
260  int etaRef = aInput.getLayerData(OMTFConfiguration::instance()->refToLogicNumber[aRefHitDef.iRefLayer],true)[aRefHitDef.iInput];
261  unsigned int iRegion = aRefHitDef.iRegion;
262 
263  if(OMTFConfiguration::instance()->bendingLayers.count(iLayer)) phiRef = 0;
264  const OMTFinput::vector1D restrictedLayerHits = restrictInput(iProcessor, iRegion, iLayer,layerHits);
265  for(auto itGP: theGPs){
266  GoldenPattern::layerResult aLayerResult = itGP.second->process1Layer1RefLayer(aRefHitDef.iRefLayer,iLayer,
267  phiRef,
268  restrictedLayerHits);
269 
270  // if(itGP.second->pdfValue(1,0,0))
271  // std::cout << itGP.second->pdfValue(1,0,0) << std::endl;
272 
273  int phiRefSt2 = itGP.second->propagateRefPhi(phiRef, etaRef, aRefHitDef.iRefLayer);
274  myResults[OMTFConfiguration::instance()->nTestRefHits-nTestedRefHits-1][itGP.second->key()].setRefPhiRHits(aRefHitDef.iRefLayer, phiRef);
275  myResults[OMTFConfiguration::instance()->nTestRefHits-nTestedRefHits-1][itGP.second->key()].addResult(aRefHitDef.iRefLayer,iLayer,
276  aLayerResult.first,
277  phiRefSt2,etaRef);
278  }
279  }
280  }
283  for(auto & itRefHit: myResults) for(auto & itKey: itRefHit) itKey.second.finalise();
284 
285  std::ostringstream myStr;
286  myStr<<"iProcessor: "<<iProcessor<<std::endl;
287  myStr<<"Input: ------------"<<std::endl;
288  myStr<<aInput<<std::endl;
289  edm::LogInfo("OMTF processor")<<myStr.str();
290 
291  return myResults;
292 }
unsigned int nLayers
unsigned int iInput
Hit input number within a cone.
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:93
std::vector< int > vector1D
Definition: OMTFinput.h:14
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:18
unsigned int nTestRefHits
std::vector< std::vector< RefHitDef > > refHitsDefs
std::bitset< 128 > getRefHits(unsigned int iProcessor) const
Definition: OMTFinput.cc:26
std::pair< int, bool > layerResult
Definition: GoldenPattern.h:52
OMTFinput::vector1D restrictInput(unsigned int iProcessor, unsigned int iCone, unsigned int iLayer, const OMTFinput::vector1D &layerHits)
unsigned int nRefHits
unsigned int iRefLayer
Reference layer logic number (0-7)
unsigned int iRegion
Region number assigned to this referecne hit.
std::vector< OMTFProcessor::resultsMap > myResults
Definition: OMTFProcessor.h:98
static const OMTFConfiguration * instance()
void OMTFProcessor::resetConfiguration ( )
private

Reset all configuration parameters.

Definition at line 48 of file OMTFProcessor.cc.

References myResults, and theGPs.

Referenced by configure(), and OMTFProcessor().

48  {
49 
50  myResults.clear();
51  theGPs.clear();
52 }
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:93
std::vector< OMTFProcessor::resultsMap > myResults
Definition: OMTFProcessor.h:98
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 295 of file OMTFProcessor.cc.

References OMTFConfiguration::connections, OMTFConfiguration::instance(), and OMTFConfiguration::nPhiBins.

Referenced by fillCounts(), and processInput().

298  {
299 
300  OMTFinput::vector1D myHits = layerHits;
301 
302  unsigned int iStart = OMTFConfiguration::instance()->connections[iProcessor][iRegion][iLayer].first;
303  unsigned int iEnd = iStart + OMTFConfiguration::instance()->connections[iProcessor][iRegion][iLayer].second -1;
304 
305  for(unsigned int iInput=0;iInput<14;++iInput){
306  if(iInput<iStart || iInput>iEnd) myHits[iInput] = OMTFConfiguration::instance()->nPhiBins;
307  }
308 
309  return myHits;
310 }
std::vector< int > vector1D
Definition: OMTFinput.h:14
unsigned int nPhiBins
static const OMTFConfiguration * instance()
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 210 of file OMTFProcessor.cc.

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

Referenced by averagePatterns().

212  {
213 
216  unsigned int nPdfBins = exp2(OMTFConfiguration::instance()->nPdfAddrBits);
217 
218  GoldenPattern::vector3D pdfAllRef = aGP->getPdf();
219 
220  int indexShift = 0;
221  for(unsigned int iLayer=0;iLayer<OMTFConfiguration::instance()->nLayers;++iLayer){
222  for(unsigned int iRefLayer=0;iRefLayer<OMTFConfiguration::instance()->nRefLayers;++iRefLayer){
223  indexShift = meanDistPhiOld[iLayer][iRefLayer] - meanDistPhiNew[iLayer][iRefLayer];
224  for(unsigned int iPdfBin=0;iPdfBin<nPdfBins;++iPdfBin) pdfAllRef[iLayer][iRefLayer][iPdfBin] = 0;
225  for(unsigned int iPdfBin=0;iPdfBin<nPdfBins;++iPdfBin){
226  if((int)(iPdfBin)+indexShift>=0 && iPdfBin+indexShift<nPdfBins)
227  pdfAllRef[iLayer][iRefLayer][iPdfBin+indexShift] = aGP->pdfValue(iLayer, iRefLayer, iPdfBin);
228  }
229  }
230  }
231  aGP->setPdf(pdfAllRef);
232 }
unsigned int nLayers
std::vector< vector2D > vector3D
Definition: GoldenPattern.h:51
void setPdf(const vector3D &aPdf)
Definition: GoldenPattern.h:67
unsigned int nRefLayers
int pdfValue(unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin) const
Definition: GoldenPattern.h:71
static const OMTFConfiguration * instance()
const vector3D & getPdf() const
Definition: GoldenPattern.h:65

Member Data Documentation

OMTFConfiguration* OMTFProcessor::m_omtf_config
private

Definition at line 100 of file OMTFProcessor.h.

Referenced by OMTFProcessor().

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 98 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 93 of file OMTFProcessor.h.

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