CMS 3D CMS Logo

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

#include <OMTFConfigMaker.h>

Public Member Functions

void fillCounts (unsigned int iProcessor, const OMTFinput &aInput)
 
void fillPhiMaps (unsigned int iProcessor, const OMTFinput &aInput)
 
void makeConnetionsMap (unsigned int iProcessor, const OMTFinput &aInput)
 
 OMTFConfigMaker (OMTFConfiguration *omtf_config)
 
void printConnections (std::ostream &out, unsigned int iProcessor, unsigned int iCone)
 
void printPhiMap (std::ostream &out)
 
 ~OMTFConfigMaker ()
 

Private Member Functions

void fillInputRange (unsigned int iConfigMaker, unsigned int iCone, const OMTFinput &aInput)
 
void fillInputRange (unsigned int iConfigMaker, unsigned int iCone, unsigned int iRefLayer, unsigned int iInput)
 

Private Attributes

std::vector< std::vector< int > > maxRefPhi2D
 
std::vector< std::vector< int > > minRefPhi2D
 
OMTFConfigurationmyOmtfConfig
 

Detailed Description

Definition at line 17 of file OMTFConfigMaker.h.

Constructor & Destructor Documentation

OMTFConfigMaker::OMTFConfigMaker ( OMTFConfiguration omtf_config)

Definition at line 13 of file OMTFConfigMaker.cc.

References maxRefPhi2D, minRefPhi2D, myOmtfConfig, OMTFConfiguration::nLogicRegions(), OMTFConfiguration::nPhiBins(), and OMTFConfiguration::nRefLayers().

13  : myOmtfConfig(omtfConfig) {
14 
15  std::vector<int> refPhi1D(myOmtfConfig->nLogicRegions(),2*myOmtfConfig->nPhiBins());
16  minRefPhi2D.assign(myOmtfConfig->nRefLayers(),refPhi1D);
17 
18  refPhi1D = std::vector<int>(myOmtfConfig->nLogicRegions(),-2*myOmtfConfig->nPhiBins());
19  maxRefPhi2D.assign(myOmtfConfig->nRefLayers(),refPhi1D);
20 }
unsigned int nRefLayers() const
unsigned int nPhiBins() const
std::vector< std::vector< int > > minRefPhi2D
OMTFConfiguration * myOmtfConfig
unsigned int nLogicRegions() const
std::vector< std::vector< int > > maxRefPhi2D
OMTFConfigMaker::~OMTFConfigMaker ( )

Definition at line 23 of file OMTFConfigMaker.cc.

23 { }

Member Function Documentation

void OMTFConfigMaker::fillCounts ( unsigned int  iProcessor,
const OMTFinput aInput 
)

Fill counts in GoldenPattern pdf bins Normalised counts will make a pdf for given GP.

Definition at line 26 of file OMTFConfigMaker.cc.

27  {
28 
29 }
void OMTFConfigMaker::fillInputRange ( unsigned int  iConfigMaker,
unsigned int  iCone,
const OMTFinput aInput 
)
private

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

Definition at line 97 of file OMTFConfigMaker.cc.

References OMTFinput::getLayerData(), OMTFConfiguration::getMeasurements4D(), createfilelist::int, myOmtfConfig, OMTFConfiguration::nLayers(), and OMTFConfiguration::nPhiBins().

Referenced by makeConnetionsMap().

99  {
100 
101  for(unsigned int iLogicLayer=0;iLogicLayer<myOmtfConfig->nLayers();++iLogicLayer){
102  for(unsigned int iInput=0;iInput<14;++iInput){
103  bool isHit = aInput.getLayerData(iLogicLayer)[iInput]<(int)myOmtfConfig->nPhiBins();
104  myOmtfConfig->getMeasurements4D()[iProcessor][iRegion][iLogicLayer][iInput]+=isHit;
105  }
106  }
107 }
unsigned int nLayers() const
unsigned int nPhiBins() const
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:19
OMTFConfiguration * myOmtfConfig
vector4D & getMeasurements4D()
void OMTFConfigMaker::fillInputRange ( unsigned int  iConfigMaker,
unsigned int  iCone,
unsigned int  iRefLayer,
unsigned int  iInput 
)
private

Definition at line 110 of file OMTFConfigMaker.cc.

References OMTFConfiguration::getMeasurements4Dref(), and myOmtfConfig.

113  {
114 
115  ++myOmtfConfig->getMeasurements4Dref()[iProcessor][iRegion][iRefLayer][iInput];
116 
117 }
OMTFConfiguration * myOmtfConfig
vector4D & getMeasurements4Dref()
void OMTFConfigMaker::fillPhiMaps ( unsigned int  iProcessor,
const OMTFinput aInput 
)

Fill vector with minimal phi in each reference layer for given processor.

Definition at line 32 of file OMTFConfigMaker.cc.

References OMTFinput::getLayerData(), OMTFConfiguration::getRefToLogicNumber(), OMTFConfiguration::getRegionNumberFromMap(), maxRefPhi2D, minRefPhi2D, myOmtfConfig, OMTFConfiguration::nInputs(), OMTFConfiguration::nPhiBins(), and OMTFConfiguration::nRefLayers().

Referenced by makeConnetionsMap().

33  {
34 
36  for(unsigned int iRefLayer=0;iRefLayer<myOmtfConfig->nRefLayers();++iRefLayer){
37  const OMTFinput::vector1D & refLayerHits = aInput.getLayerData(myOmtfConfig->getRefToLogicNumber()[iRefLayer]);
38  if(!refLayerHits.size()) continue;
39  for(unsigned int iInput=0;iInput<myOmtfConfig->nInputs();++iInput){
40  int phiRef = refLayerHits[iInput];
41  unsigned int iRegion = myOmtfConfig->getRegionNumberFromMap(iInput,iRefLayer,phiRef);
42  if(phiRef>=(int)myOmtfConfig->nPhiBins()) continue;
43  if(phiRef<minRefPhi2D[iRefLayer][iRegion]) minRefPhi2D[iRefLayer][iRegion] = phiRef;
44  if(phiRef>maxRefPhi2D[iRefLayer][iRegion]) maxRefPhi2D[iRefLayer][iRegion] = phiRef;
45  }
46  }
47 }
unsigned int nRefLayers() const
unsigned int nPhiBins() const
std::vector< int > vector1D
Definition: OMTFinput.h:15
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:19
unsigned int getRegionNumberFromMap(unsigned int iInput, unsigned int iRefLayer, int iPhi) const
unsigned int nInputs() const
std::vector< std::vector< int > > minRefPhi2D
const std::vector< int > & getRefToLogicNumber() const
OMTFConfiguration * myOmtfConfig
std::vector< std::vector< int > > maxRefPhi2D
void OMTFConfigMaker::makeConnetionsMap ( unsigned int  iProcessor,
const OMTFinput aInput 
)

Fill histograms used for making the connections maps

Always use two hits from a single chamber. As we use single muons, the second hit has to be added by hand.

Definition at line 73 of file OMTFConfigMaker.cc.

References fillInputRange(), fillPhiMaps(), OMTFinput::getLayerData(), OMTFConfiguration::getRefToLogicNumber(), OMTFConfiguration::getRegionNumberFromMap(), myOmtfConfig, OMTFConfiguration::nLogicRegions(), and OMTFConfiguration::nRefLayers().

Referenced by OMTFPatternMaker::analyze().

74  {
75 
76  fillPhiMaps(iProcessor,aInput);
77 
78  for(unsigned int iRefLayer=0;iRefLayer<myOmtfConfig->nRefLayers();++iRefLayer){
79  const OMTFinput::vector1D & refLayerHits = aInput.getLayerData(myOmtfConfig->getRefToLogicNumber()[iRefLayer]);
80  if(!refLayerHits.size()) continue;
82  for(unsigned int iInput=0;iInput<refLayerHits.size();++iInput){
83  int phiRef = refLayerHits[iInput];
84  unsigned int iRegion = myOmtfConfig->getRegionNumberFromMap(iInput,iRefLayer,phiRef);
85  if(iRegion>=myOmtfConfig->nLogicRegions()) continue;
86  fillInputRange(iProcessor,iRegion,aInput);
87  fillInputRange(iProcessor,iRegion,iRefLayer,iInput);
91  if(iInput%2==0) fillInputRange(iProcessor,iRegion,iRefLayer,iInput+1);
92  }
93  }
94 }
unsigned int nRefLayers() const
void fillPhiMaps(unsigned int iProcessor, const OMTFinput &aInput)
std::vector< int > vector1D
Definition: OMTFinput.h:15
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:19
unsigned int getRegionNumberFromMap(unsigned int iInput, unsigned int iRefLayer, int iPhi) const
const std::vector< int > & getRefToLogicNumber() const
OMTFConfiguration * myOmtfConfig
unsigned int nLogicRegions() const
void fillInputRange(unsigned int iConfigMaker, unsigned int iCone, const OMTFinput &aInput)
void OMTFConfigMaker::printConnections ( std::ostream &  out,
unsigned int  iProcessor,
unsigned int  iCone 
)

Print connections map for given logic cone in given processro. Connection map shows counts on each input.

Definition at line 120 of file OMTFConfigMaker.cc.

References OMTFConfiguration::getMeasurements4Dref(), myOmtfConfig, OMTFConfiguration::nInputs(), and OMTFConfiguration::nLayers().

Referenced by OMTFPatternMaker::endJob().

122  {
123 
124  out<<"iProcessor: "<<iProcessor
125  <<" iRegion: "<<iRegion
126  <<std::endl;
127 
128  out<<"Ref hits"<<std::endl;
129  for(unsigned int iLogicLayer=0;iLogicLayer<myOmtfConfig->nLayers();++iLogicLayer){
130  out<<"Logic layer: "<<iLogicLayer<<" Hits: ";
131  for(unsigned int iInput=0;iInput<myOmtfConfig->nInputs();++iInput){
132  out<<myOmtfConfig->getMeasurements4Dref()[iProcessor][iRegion][iLogicLayer][iInput]<<"\t";
133  }
134  out<<std::endl;
135  }
136  /*
137  out<<"Measurement hits"<<std::endl;
138  for(unsigned int iLogicLayer=0;iLogicLayer<myOmtfConfig->nLayers();++iLogicLayer){
139  out<<"Logic layer: "<<iLogicLayer<<" Hits: ";
140  for(unsigned int iInput=0;iInput<14;++iInput){
141  out<<myOmtfConfig->getMeasurements4D()[iProcessor][iRegion][iLogicLayer][iInput]<<"\t";
142  }
143  out<<std::endl;
144  }
145  */
146  out<<std::endl;
147 }
unsigned int nLayers() const
unsigned int nInputs() const
OMTFConfiguration * myOmtfConfig
vector4D & getMeasurements4Dref()
void OMTFConfigMaker::printPhiMap ( std::ostream &  out)

Print starting iPhi for each reference layer in each processor

Definition at line 50 of file OMTFConfigMaker.cc.

References maxRefPhi2D, minRefPhi2D, myOmtfConfig, OMTFConfiguration::nLogicRegions(), and OMTFConfiguration::nRefLayers().

Referenced by OMTFPatternMaker::endJob().

50  {
51 
52  out<<"min Phi in each logicRegion (X) in each ref Layer (Y): "<<std::endl;
53  for(unsigned int iRefLayer=0;iRefLayer<myOmtfConfig->nRefLayers();++iRefLayer){
54  for(unsigned int iLogicRegion=0;iLogicRegion<myOmtfConfig->nLogicRegions();++iLogicRegion){
55  out<<" "<<minRefPhi2D[iRefLayer][iLogicRegion]<<"\t";
56  }
57  out<<std::endl;
58  }
59  out<<std::endl;
60 
61  out<<"max Phi in each logicRegion (X) in each ref Layer (Y): "<<std::endl;
62  for(unsigned int iRefLayer=0;iRefLayer<myOmtfConfig->nRefLayers();++iRefLayer){
63  for(unsigned int iLogicRegion=0;iLogicRegion<myOmtfConfig->nLogicRegions();++iLogicRegion){
64  out<<" "<<maxRefPhi2D[iRefLayer][iLogicRegion]<<"\t";
65  }
66  out<<std::endl;
67  }
68  out<<std::endl;
69 
70 }
unsigned int nRefLayers() const
std::vector< std::vector< int > > minRefPhi2D
OMTFConfiguration * myOmtfConfig
unsigned int nLogicRegions() const
std::vector< std::vector< int > > maxRefPhi2D

Member Data Documentation

std::vector<std::vector<int> > OMTFConfigMaker::maxRefPhi2D
private

Definition at line 69 of file OMTFConfigMaker.h.

Referenced by fillPhiMaps(), OMTFConfigMaker(), and printPhiMap().

std::vector<std::vector<int> > OMTFConfigMaker::minRefPhi2D
private

Map of phi starting and ending points for each logic region. First index: reference layer number Second index: logic region number

Definition at line 68 of file OMTFConfigMaker.h.

Referenced by fillPhiMaps(), OMTFConfigMaker(), and printPhiMap().

OMTFConfiguration* OMTFConfigMaker::myOmtfConfig
private