CMS 3D CMS Logo

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 (const OMTFConfiguration *omtfParams, const L1TMuonOverlapParams *omtfPatterns)
 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 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

const OMTFConfigurationmyOmtfConfig
 
std::vector< OMTFProcessor::resultsMapmyResults
 
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 ( )
inline

Definition at line 26 of file OMTFProcessor.h.

References ALCARECOTkAlJpsiMuMu_cff::charge.

26 {};
OMTFProcessor::~OMTFProcessor ( )

Definition at line 22 of file OMTFProcessor.cc.

References theGPs.

22  {
23 
24  for(auto it: theGPs) delete it.second;
25 
26 }
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:89

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

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

Referenced by configure().

98  {
99 
100  if(theGPs.find(aGP->key())!=theGPs.end()){
101  throw cms::Exception("Corrupted Golden Patterns data")
102  <<"OMTFProcessor::addGP(...) "
103  <<" Reading two Golden Patterns with the same key: "
104  <<aGP->key()<<std::endl;
105  }
106  else theGPs[aGP->key()] = new GoldenPattern(*aGP);
107 
108  for(auto & itRegion: myResults){
109  OMTFResult aResult;
110  aResult.configure(myOmtfConfig);
111  itRegion[aGP->key()] = aResult;
112  }
113 
114  return true;
115 }
Key key() const
Definition: GoldenPattern.h:58
const OMTFConfiguration * myOmtfConfig
Definition: OMTFProcessor.h:98
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:89
void configure(const OMTFConfiguration *omtfConfig)
Definition: OMTFResult.cc:10
std::vector< OMTFProcessor::resultsMap > myResults
Definition: OMTFProcessor.h:94
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 118 of file OMTFProcessor.cc.

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

Referenced by OMTFPatternMaker::endJob().

118  {
119 
120  Key aKey(0, 9, charge);
121 
122  while(theGPs.find(aKey)!=theGPs.end()){
123 
124  GoldenPattern *aGP1 = theGPs.find(aKey)->second;
125  GoldenPattern *aGP2 = aGP1;
126  GoldenPattern *aGP3 = aGP1;
127  GoldenPattern *aGP4 = aGP1;
128 
129  ++aKey.thePtCode;
130  while(theGPs.find(aKey)==theGPs.end() && aKey.thePtCode<=401) ++aKey.thePtCode;
131  if(aKey.thePtCode<=401 && theGPs.find(aKey)!=theGPs.end()) aGP2 = theGPs.find(aKey)->second;
132 
133  if(aKey.thePtCode>71){
134  ++aKey.thePtCode;
135  while(theGPs.find(aKey)==theGPs.end() && aKey.thePtCode<=401) ++aKey.thePtCode;
136  if(aKey.thePtCode<=401 && theGPs.find(aKey)!=theGPs.end()) aGP3 = theGPs.find(aKey)->second;
137 
138  ++aKey.thePtCode;
139  while(theGPs.find(aKey)==theGPs.end() && aKey.thePtCode<=401) ++aKey.thePtCode;
140  if(aKey.thePtCode<=401 && theGPs.find(aKey)!=theGPs.end()) aGP4 = theGPs.find(aKey)->second;
141  }
142  else{
143  aGP3 = aGP1;
144  aGP4 = aGP2;
145  }
146  //HACK. Have to clean this up.
148  ++aKey.thePtCode;
149  while(theGPs.find(aKey)==theGPs.end() && aKey.thePtCode<=401) ++aKey.thePtCode;
151 
152 
153  GoldenPattern::vector2D meanDistPhi = aGP1->getMeanDistPhi();
154 
155  GoldenPattern::vector2D meanDistPhi1 = aGP1->getMeanDistPhi();
156  GoldenPattern::vector2D meanDistPhi2 = aGP2->getMeanDistPhi();
157  GoldenPattern::vector2D meanDistPhi3 = aGP3->getMeanDistPhi();
158  GoldenPattern::vector2D meanDistPhi4 = aGP4->getMeanDistPhi();
159 
160  for(unsigned int iLayer=0;iLayer<myOmtfConfig->nLayers();++iLayer){
161  for(unsigned int iRefLayer=0;iRefLayer<myOmtfConfig->nRefLayers();++iRefLayer){
162  meanDistPhi[iLayer][iRefLayer]+=meanDistPhi2[iLayer][iRefLayer];
163  meanDistPhi[iLayer][iRefLayer]+=meanDistPhi3[iLayer][iRefLayer];
164  meanDistPhi[iLayer][iRefLayer]+=meanDistPhi4[iLayer][iRefLayer];
165  meanDistPhi[iLayer][iRefLayer]/=4;
166  }
167  }
168 
169  aGP1->setMeanDistPhi(meanDistPhi);
170  aGP2->setMeanDistPhi(meanDistPhi);
171 
172  shiftGP(aGP1,meanDistPhi, meanDistPhi1);
173  shiftGP(aGP2,meanDistPhi, meanDistPhi2);
174  if(aGP3!=aGP1 && aGP4!=aGP2){
175  aGP3->setMeanDistPhi(meanDistPhi);
176  aGP4->setMeanDistPhi(meanDistPhi);
177  shiftGP(aGP3,meanDistPhi, meanDistPhi3);
178  shiftGP(aGP4,meanDistPhi, meanDistPhi4);
179  }
180  }
181 }
unsigned int nRefLayers() const
const OMTFConfiguration * myOmtfConfig
Definition: OMTFProcessor.h:98
const vector2D & getMeanDistPhi() const
Definition: GoldenPattern.h:62
unsigned int nLayers() const
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:89
std::vector< vector1D > vector2D
Definition: GoldenPattern.h:49
void shiftGP(GoldenPattern *aGP, const GoldenPattern::vector2D &meanDistPhiNew, const GoldenPattern::vector2D &meanDistPhiOld)
void setMeanDistPhi(const vector2D &aMeanDistPhi)
Definition: GoldenPattern.h:60
bool OMTFProcessor::configure ( const OMTFConfiguration omtfParams,
const L1TMuonOverlapParams omtfPatterns 
)

Fill GP map with patterns from CondFormats object.

Mean dist phi data

Pdf data

Definition at line 37 of file OMTFProcessor.cc.

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

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

38  {
39 
41 
42  myOmtfConfig = omtfConfig;
43 
45 
46  const l1t::LUT* chargeLUT = omtfPatterns->chargeLUT();
47  const l1t::LUT* etaLUT = omtfPatterns->etaLUT();
48  const l1t::LUT* ptLUT = omtfPatterns->ptLUT();
49  const l1t::LUT* pdfLUT = omtfPatterns->pdfLUT();
50  const l1t::LUT* meanDistPhiLUT = omtfPatterns->meanDistPhiLUT();
51 
52  unsigned int nGPs = myOmtfConfig->nGoldenPatterns();
53  unsigned int address = 0;
54  unsigned int iEta, iPt;
55  int iCharge;
56  for(unsigned int iGP=0;iGP<nGPs;++iGP){
57  address = iGP;
58  iEta = etaLUT->data(address);
59  iCharge = chargeLUT->data(address)==0? -1:1;
60  iPt = ptLUT->data(address);
61 
67  for(unsigned int iLayer=0;iLayer<myOmtfConfig->nLayers();++iLayer){
69  for(unsigned int iRefLayer=0;iRefLayer<myOmtfConfig->nRefLayers();++iRefLayer){
70  address = iRefLayer + iLayer*myOmtfConfig->nRefLayers() + iGP*(myOmtfConfig->nRefLayers()*myOmtfConfig->nLayers());
71  meanDistPhi1D[iRefLayer] = meanDistPhiLUT->data(address) - (1<<(meanDistPhiLUT->nrBitsData() -1));
72  }
73  meanDistPhi2D[iLayer] = meanDistPhi1D;
75  for(unsigned int iRefLayer=0;iRefLayer<myOmtfConfig->nRefLayers();++iRefLayer){
76  pdf1D.assign(1<<myOmtfConfig->nPdfAddrBits(),0);
77  for(unsigned int iPdf=0;iPdf<(unsigned int)(1<<myOmtfConfig->nPdfAddrBits());++iPdf){
78  address = iPdf + iRefLayer*(1<<myOmtfConfig->nPdfAddrBits()) +
81  pdf1D[iPdf] = pdfLUT->data(address);
82  }
83  pdf2D[iRefLayer] = pdf1D;
84  }
85  pdf3D[iLayer] = pdf2D;
86  }
87  Key aKey(iEta,iPt,iCharge,iGP);
88 
89  GoldenPattern *aGP = new GoldenPattern(aKey, myOmtfConfig);
90  aGP->setMeanDistPhi(meanDistPhi2D);
91  aGP->setPdf(pdf3D);
92  addGP(aGP);
93  }
94  return true;
95 }
unsigned int nRefLayers() const
const OMTFConfiguration * myOmtfConfig
Definition: OMTFProcessor.h:98
std::vector< int > vector1D
Definition: GoldenPattern.h:48
unsigned int nLayers() const
std::map< Key, OMTFResult > resultsMap
Definition: OMTFProcessor.h:24
const l1t::LUT * chargeLUT() const
Golden Patterns definitions.
bool addGP(GoldenPattern *aGP)
unsigned int nrBitsData() const
Definition: LUT.h:51
std::vector< vector1D > vector2D
Definition: GoldenPattern.h:49
std::vector< vector2D > vector3D
Definition: GoldenPattern.h:50
void setPdf(const vector3D &aPdf)
Definition: GoldenPattern.h:66
unsigned int nPdfAddrBits() const
void resetConfiguration()
Reset all configuration parameters.
const l1t::LUT * etaLUT() const
unsigned int nGoldenPatterns() const
const l1t::LUT * pdfLUT() const
Definition: LUT.h:29
const l1t::LUT * ptLUT() const
void setMeanDistPhi(const vector2D &aMeanDistPhi)
Definition: GoldenPattern.h:60
int data(unsigned int address) const
Definition: LUT.h:46
const l1t::LUT * meanDistPhiLUT() const
std::vector< OMTFProcessor::resultsMap > myResults
Definition: OMTFProcessor.h:94
unsigned int nTestRefHits() const
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.

Definition at line 281 of file OMTFProcessor.cc.

References funct::abs(), OMTFConfiguration::getBendingLayers(), OMTFinput::getLayerData(), OMTFinput::getRefHits(), OMTFConfiguration::getRefHitsDefs(), OMTFConfiguration::getRefToLogicNumber(), RefHitDef::iInput, RPCConst::iptFromPt(), RefHitDef::iRefLayer, RefHitDef::iRegion, CoreSimTrack::momentum(), myOmtfConfig, OMTFConfiguration::nLayers(), OMTFConfiguration::nRefHits(), RPCConst::ptFromIpt(), restrictInput(), AlignmentTrackSelector_cfi::theCharge, theGPs, and CoreSimTrack::type().

Referenced by OMTFPatternMaker::analyze().

283  {
284 
285  int theCharge = (abs(aSimMuon->type()) == 13) ? aSimMuon->type()/-13 : 0;
286  unsigned int iPt = RPCConst::iptFromPt(aSimMuon->momentum().pt());
289  iPt+=1;
290  if(iPt>31) iPt=200*2+1;
291  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
293 
295  std::bitset<128> refHitsBits = aInput.getRefHits(iProcessor);
296  if(refHitsBits.none()) return;
297 
298  std::ostringstream myStr;
299  myStr<<"iProcessor: "<<iProcessor<<std::endl;
300  myStr<<"Input: ------------"<<std::endl;
301  myStr<<aInput<<std::endl;
302  edm::LogInfo("OMTF processor")<<myStr.str();
303 
304  for(unsigned int iLayer=0;iLayer<myOmtfConfig->nLayers();++iLayer){
305  const OMTFinput::vector1D & layerHits = aInput.getLayerData(iLayer);
306  if(!layerHits.size()) continue;
308  for(unsigned int iRefHit=0;iRefHit<myOmtfConfig->nRefHits();++iRefHit){
309  if(!refHitsBits[iRefHit]) continue;
310  const RefHitDef & aRefHitDef = myOmtfConfig->getRefHitsDefs()[iProcessor][iRefHit];
311  int phiRef = aInput.getLayerData(myOmtfConfig->getRefToLogicNumber()[aRefHitDef.iRefLayer])[aRefHitDef.iInput];
312  unsigned int iRegion = aRefHitDef.iRegion;
313  if(myOmtfConfig->getBendingLayers().count(iLayer)) phiRef = 0;
314  const OMTFinput::vector1D restrictedLayerHits = restrictInput(iProcessor, iRegion, iLayer,layerHits);
315  for(auto itGP: theGPs){
316  if(itGP.first.theCharge!=theCharge) continue;
317  if(itGP.first.thePtCode!=iPt) continue;
318  itGP.second->addCount(aRefHitDef.iRefLayer,iLayer,phiRef,restrictedLayerHits);
319  }
320  }
321  }
322 }
const std::set< int > & getBendingLayers() const
unsigned int nRefHits() const
const OMTFConfiguration * myOmtfConfig
Definition: OMTFProcessor.h:98
unsigned int nLayers() const
unsigned int iInput
Hit input number within a cone.
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:89
std::vector< int > vector1D
Definition: OMTFinput.h:15
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:19
const std::vector< std::vector< RefHitDef > > & getRefHitsDefs() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::bitset< 128 > getRefHits(unsigned int iProcessor) const
Definition: OMTFinput.cc:27
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)
const std::vector< int > & getRefToLogicNumber() const
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
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 208 of file OMTFProcessor.cc.

References theGPs.

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

208 { return theGPs; }
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:89
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.

Definition at line 211 of file OMTFProcessor.cc.

References OMTFConfiguration::getBendingLayers(), OMTFinput::getLayerData(), OMTFinput::getRefHits(), OMTFConfiguration::getRefHitsDefs(), OMTFConfiguration::getRefToLogicNumber(), RefHitDef::iInput, RefHitDef::iRefLayer, RefHitDef::iRegion, myOmtfConfig, myResults, OMTFConfiguration::nLayers(), OMTFConfiguration::nRefHits(), OMTFConfiguration::nTestRefHits(), restrictInput(), and theGPs.

Referenced by OMTFReconstruction::getProcessorCandidates().

212  {
213 
214  for(auto & itRegion: myResults) for(auto & itKey: itRegion) itKey.second.clear();
215 
218  std::bitset<128> refHitsBits = aInput.getRefHits(iProcessor);
219  if(refHitsBits.none()) return myResults;
220 
221  for(unsigned int iLayer=0;iLayer<myOmtfConfig->nLayers();++iLayer){
222  const OMTFinput::vector1D & layerHits = aInput.getLayerData(iLayer);
223  if(!layerHits.size()) continue;
225  unsigned int nTestedRefHits = myOmtfConfig->nTestRefHits();
226  for(unsigned int iRefHit=0;iRefHit<myOmtfConfig->nRefHits();++iRefHit){
227  if(!refHitsBits[iRefHit]) continue;
228  if(nTestedRefHits--==0) break;
229  const RefHitDef & aRefHitDef = myOmtfConfig->getRefHitsDefs()[iProcessor][iRefHit];
230 
231  int phiRef = aInput.getLayerData(myOmtfConfig->getRefToLogicNumber()[aRefHitDef.iRefLayer])[aRefHitDef.iInput];
232  int etaRef = aInput.getLayerData(myOmtfConfig->getRefToLogicNumber()[aRefHitDef.iRefLayer],true)[aRefHitDef.iInput];
233  unsigned int iRegion = aRefHitDef.iRegion;
234 
235  if(myOmtfConfig->getBendingLayers().count(iLayer)) phiRef = 0;
236  const OMTFinput::vector1D restrictedLayerHits = restrictInput(iProcessor, iRegion, iLayer,layerHits);
237  for(auto itGP: theGPs){
238  GoldenPattern::layerResult aLayerResult = itGP.second->process1Layer1RefLayer(aRefHitDef.iRefLayer,iLayer,
239  phiRef,
240  restrictedLayerHits);
241  int phiRefSt2 = itGP.second->propagateRefPhi(phiRef, etaRef, aRefHitDef.iRefLayer);
242  myResults[myOmtfConfig->nTestRefHits()-nTestedRefHits-1][itGP.second->key()].setRefPhiRHits(aRefHitDef.iRefLayer, phiRef);
243  myResults[myOmtfConfig->nTestRefHits()-nTestedRefHits-1][itGP.second->key()].addResult(aRefHitDef.iRefLayer,iLayer,
244  aLayerResult.first,
245  phiRefSt2,etaRef);
246  }
247  }
248  }
251  for(auto & itRefHit: myResults) for(auto & itKey: itRefHit) itKey.second.finalise();
252 
253  std::ostringstream myStr;
254  myStr<<"iProcessor: "<<iProcessor<<std::endl;
255  myStr<<"Input: ------------"<<std::endl;
256  myStr<<aInput<<std::endl;
257  edm::LogInfo("OMTF processor")<<myStr.str();
258 
259 
260  return myResults;
261 }
const std::set< int > & getBendingLayers() const
unsigned int nRefHits() const
const OMTFConfiguration * myOmtfConfig
Definition: OMTFProcessor.h:98
unsigned int nLayers() const
unsigned int iInput
Hit input number within a cone.
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:89
std::vector< int > vector1D
Definition: OMTFinput.h:15
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:19
const std::vector< std::vector< RefHitDef > > & getRefHitsDefs() const
std::bitset< 128 > getRefHits(unsigned int iProcessor) const
Definition: OMTFinput.cc:27
std::pair< int, bool > layerResult
Definition: GoldenPattern.h:51
OMTFinput::vector1D restrictInput(unsigned int iProcessor, unsigned int iCone, unsigned int iLayer, const OMTFinput::vector1D &layerHits)
const std::vector< int > & getRefToLogicNumber() const
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:94
unsigned int nTestRefHits() const
void OMTFProcessor::resetConfiguration ( )
private

Reset all configuration parameters.

Definition at line 29 of file OMTFProcessor.cc.

References myResults, and theGPs.

Referenced by configure().

29  {
30 
31  myResults.clear();
32  for(auto it: theGPs) delete it.second;
33  theGPs.clear();
34 }
std::map< Key, GoldenPattern * > theGPs
Map holding Golden Patterns.
Definition: OMTFProcessor.h:89
std::vector< OMTFProcessor::resultsMap > myResults
Definition: OMTFProcessor.h:94
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 264 of file OMTFProcessor.cc.

References OMTFConfiguration::getConnections(), myOmtfConfig, and OMTFConfiguration::nPhiBins().

Referenced by fillCounts(), and processInput().

267  {
268 
269  OMTFinput::vector1D myHits = layerHits;
270 
271  unsigned int iStart = myOmtfConfig->getConnections()[iProcessor][iRegion][iLayer].first;
272  unsigned int iEnd = iStart + myOmtfConfig->getConnections()[iProcessor][iRegion][iLayer].second -1;
273 
274  for(unsigned int iInput=0;iInput<14;++iInput){
275  if(iInput<iStart || iInput>iEnd) myHits[iInput] = myOmtfConfig->nPhiBins();
276  }
277  return myHits;
278 }
const OMTFConfiguration * myOmtfConfig
Definition: OMTFProcessor.h:98
unsigned int nPhiBins() const
std::vector< int > vector1D
Definition: OMTFinput.h:15
const vector3D_pair & getConnections() const
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 184 of file OMTFProcessor.cc.

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

Referenced by averagePatterns().

186  {
187 
190  unsigned int nPdfBins = exp2(myOmtfConfig->nPdfAddrBits());
191  GoldenPattern::vector3D pdfAllRef = aGP->getPdf();
192 
193  int indexShift = 0;
194  for(unsigned int iLayer=0;iLayer<myOmtfConfig->nLayers();++iLayer){
195  for(unsigned int iRefLayer=0;iRefLayer<myOmtfConfig->nRefLayers();++iRefLayer){
196  indexShift = meanDistPhiOld[iLayer][iRefLayer] - meanDistPhiNew[iLayer][iRefLayer];
197  for(unsigned int iPdfBin=0;iPdfBin<nPdfBins;++iPdfBin) pdfAllRef[iLayer][iRefLayer][iPdfBin] = 0;
198  for(unsigned int iPdfBin=0;iPdfBin<nPdfBins;++iPdfBin){
199  if((int)(iPdfBin)+indexShift>=0 && iPdfBin+indexShift<nPdfBins)
200  pdfAllRef[iLayer][iRefLayer][iPdfBin+indexShift] = aGP->pdfValue(iLayer, iRefLayer, iPdfBin);
201  }
202  }
203  }
204  aGP->setPdf(pdfAllRef);
205 }
unsigned int nRefLayers() const
const OMTFConfiguration * myOmtfConfig
Definition: OMTFProcessor.h:98
unsigned int nLayers() const
std::vector< vector2D > vector3D
Definition: GoldenPattern.h:50
void setPdf(const vector3D &aPdf)
Definition: GoldenPattern.h:66
unsigned int nPdfAddrBits() const
int pdfValue(unsigned int iLayer, unsigned int iRefLayer, unsigned int iBin) const
Definition: GoldenPattern.h:70
const vector3D & getPdf() const
Definition: GoldenPattern.h:64

Member Data Documentation

const OMTFConfiguration* OMTFProcessor::myOmtfConfig
private

Configuration of the algorithm. This object does not contain the patterns data.

Definition at line 98 of file OMTFProcessor.h.

Referenced by addGP(), averagePatterns(), configure(), fillCounts(), processInput(), restrictInput(), and shiftGP().

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 94 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 89 of file OMTFProcessor.h.

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