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  std::vector<int> refPhi1D(myOmtfConfig->nLogicRegions(), 2 * myOmtfConfig->nPhiBins());
15  minRefPhi2D.assign(myOmtfConfig->nRefLayers(), refPhi1D);
16 
17  refPhi1D = std::vector<int>(myOmtfConfig->nLogicRegions(), -2 * myOmtfConfig->nPhiBins());
18  maxRefPhi2D.assign(myOmtfConfig->nRefLayers(), refPhi1D);
19 }
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 22 of file OMTFConfigMaker.cc.

22 {}

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 25 of file OMTFConfigMaker.cc.

25 {}
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 94 of file OMTFConfigMaker.cc.

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

Referenced by makeConnetionsMap().

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

Definition at line 104 of file OMTFConfigMaker.cc.

References OMTFConfiguration::getMeasurements4Dref(), and myOmtfConfig.

107  {
108  ++myOmtfConfig->getMeasurements4Dref()[iProcessor][iRegion][iRefLayer][iInput];
109 }
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 28 of file OMTFConfigMaker.cc.

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

Referenced by makeConnetionsMap().

28  {
30  for (unsigned int iRefLayer = 0; iRefLayer < myOmtfConfig->nRefLayers(); ++iRefLayer) {
31  const OMTFinput::vector1D& refLayerHits = aInput.getLayerData(myOmtfConfig->getRefToLogicNumber()[iRefLayer]);
32  if (refLayerHits.empty())
33  continue;
34  for (unsigned int iInput = 0; iInput < myOmtfConfig->nInputs(); ++iInput) {
35  int phiRef = refLayerHits[iInput];
36  unsigned int iRegion = myOmtfConfig->getRegionNumberFromMap(iInput, iRefLayer, phiRef);
37  if (phiRef >= (int)myOmtfConfig->nPhiBins())
38  continue;
39  if (phiRef < minRefPhi2D[iRefLayer][iRegion])
40  minRefPhi2D[iRefLayer][iRegion] = phiRef;
41  if (phiRef > maxRefPhi2D[iRefLayer][iRegion])
42  maxRefPhi2D[iRefLayer][iRegion] = phiRef;
43  }
44  }
45 }
unsigned int nRefLayers() const
unsigned int nPhiBins() const
std::vector< int > vector1D
Definition: OMTFinput.h:13
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:17
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 69 of file OMTFConfigMaker.cc.

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

Referenced by OMTFPatternMaker::analyze().

69  {
70  fillPhiMaps(iProcessor, aInput);
71 
72  for (unsigned int iRefLayer = 0; iRefLayer < myOmtfConfig->nRefLayers(); ++iRefLayer) {
73  const OMTFinput::vector1D& refLayerHits = aInput.getLayerData(myOmtfConfig->getRefToLogicNumber()[iRefLayer]);
74  if (refLayerHits.empty())
75  continue;
77  for (unsigned int iInput = 0; iInput < refLayerHits.size(); ++iInput) {
78  int phiRef = refLayerHits[iInput];
79  unsigned int iRegion = myOmtfConfig->getRegionNumberFromMap(iInput, iRefLayer, phiRef);
80  if (iRegion >= myOmtfConfig->nLogicRegions())
81  continue;
82  fillInputRange(iProcessor, iRegion, aInput);
83  fillInputRange(iProcessor, iRegion, iRefLayer, iInput);
87  if (iInput % 2 == 0)
88  fillInputRange(iProcessor, iRegion, iRefLayer, iInput + 1);
89  }
90  }
91 }
unsigned int nRefLayers() const
void fillPhiMaps(unsigned int iProcessor, const OMTFinput &aInput)
std::vector< int > vector1D
Definition: OMTFinput.h:13
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:17
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 112 of file OMTFConfigMaker.cc.

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

Referenced by OMTFPatternMaker::endJob().

112  {
113  out << "iProcessor: " << iProcessor << " iRegion: " << iRegion << std::endl;
114 
115  out << "Ref hits" << std::endl;
116  for (unsigned int iLogicLayer = 0; iLogicLayer < myOmtfConfig->nLayers(); ++iLogicLayer) {
117  out << "Logic layer: " << iLogicLayer << " Hits: ";
118  for (unsigned int iInput = 0; iInput < myOmtfConfig->nInputs(); ++iInput) {
119  out << myOmtfConfig->getMeasurements4Dref()[iProcessor][iRegion][iLogicLayer][iInput] << "\t";
120  }
121  out << std::endl;
122  }
123  /*
124  out<<"Measurement hits"<<std::endl;
125  for(unsigned int iLogicLayer=0;iLogicLayer<myOmtfConfig->nLayers();++iLogicLayer){
126  out<<"Logic layer: "<<iLogicLayer<<" Hits: ";
127  for(unsigned int iInput=0;iInput<14;++iInput){
128  out<<myOmtfConfig->getMeasurements4D()[iProcessor][iRegion][iLogicLayer][iInput]<<"\t";
129  }
130  out<<std::endl;
131  }
132  */
133  out << std::endl;
134 }
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 48 of file OMTFConfigMaker.cc.

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

Referenced by OMTFPatternMaker::endJob().

48  {
49  out << "min Phi in each logicRegion (X) in each ref Layer (Y): " << std::endl;
50  for (unsigned int iRefLayer = 0; iRefLayer < myOmtfConfig->nRefLayers(); ++iRefLayer) {
51  for (unsigned int iLogicRegion = 0; iLogicRegion < myOmtfConfig->nLogicRegions(); ++iLogicRegion) {
52  out << " " << minRefPhi2D[iRefLayer][iLogicRegion] << "\t";
53  }
54  out << std::endl;
55  }
56  out << std::endl;
57 
58  out << "max Phi in each logicRegion (X) in each ref Layer (Y): " << std::endl;
59  for (unsigned int iRefLayer = 0; iRefLayer < myOmtfConfig->nRefLayers(); ++iRefLayer) {
60  for (unsigned int iLogicRegion = 0; iLogicRegion < myOmtfConfig->nLogicRegions(); ++iLogicRegion) {
61  out << " " << maxRefPhi2D[iRefLayer][iLogicRegion] << "\t";
62  }
63  out << std::endl;
64  }
65  out << std::endl;
66 }
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 56 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 55 of file OMTFConfigMaker.h.

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

OMTFConfiguration* OMTFConfigMaker::myOmtfConfig
private