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 fillCounts (unsigned int iProcessor, const OMTFinput &aInput)
 
void fillPhiMaps (unsigned int iProcessor, const OMTFinput &aInput)
 
void fillPhiMaps (unsigned int iProcessor, const OMTFinput &aInput)
 
void makeConnetionsMap (unsigned int iProcessor, const OMTFinput &aInput)
 
void makeConnetionsMap (unsigned int iProcessor, const OMTFinput &aInput)
 
 OMTFConfigMaker (OMTFConfiguration *omtf_config)
 
 OMTFConfigMaker (OMTFConfiguration *omtf_config)
 
void printConnections (std::ostream &out, unsigned int iProcessor, unsigned int iCone)
 
void printConnections (std::ostream &out, unsigned int iProcessor, unsigned int iCone)
 
void printPhiMap (std::ostream &out)
 
void printPhiMap (std::ostream &out)
 
 ~OMTFConfigMaker ()
 
 ~OMTFConfigMaker ()
 

Private Member Functions

void fillInputRange (unsigned int iConfigMaker, unsigned int iCone, const OMTFinput &aInput)
 
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)
 
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() [1/2]

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 }
std::vector< std::vector< int > > maxRefPhi2D
OMTFConfiguration * myOmtfConfig
unsigned int nPhiBins() const
std::vector< std::vector< int > > minRefPhi2D
unsigned int nRefLayers() const
unsigned int nLogicRegions() const

◆ ~OMTFConfigMaker() [1/2]

OMTFConfigMaker::~OMTFConfigMaker ( )

Definition at line 22 of file OMTFConfigMaker.cc.

22 {}

◆ OMTFConfigMaker() [2/2]

OMTFConfigMaker::OMTFConfigMaker ( OMTFConfiguration omtf_config)

◆ ~OMTFConfigMaker() [2/2]

OMTFConfigMaker::~OMTFConfigMaker ( )

Member Function Documentation

◆ fillCounts() [1/2]

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 {}

◆ fillCounts() [2/2]

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

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

◆ fillInputRange() [1/4]

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 }
OMTFConfiguration * myOmtfConfig
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:17
unsigned int nPhiBins() const
unsigned int nLayers() const
vector4D & getMeasurements4D()

◆ fillInputRange() [2/4]

void OMTFConfigMaker::fillInputRange ( unsigned int  iConfigMaker,
unsigned int  iCone,
const OMTFinput aInput 
)
private

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

◆ fillInputRange() [3/4]

void OMTFConfigMaker::fillInputRange ( unsigned int  iConfigMaker,
unsigned int  iCone,
unsigned int  iRefLayer,
unsigned int  iInput 
)
private

◆ fillInputRange() [4/4]

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()

◆ fillPhiMaps() [1/2]

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 }
std::vector< std::vector< int > > maxRefPhi2D
OMTFConfiguration * myOmtfConfig
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 nPhiBins() const
unsigned int getRegionNumberFromMap(unsigned int iInput, unsigned int iRefLayer, int iPhi) const
const std::vector< int > & getRefToLogicNumber() const
std::vector< std::vector< int > > minRefPhi2D
unsigned int nRefLayers() const
unsigned int nInputs() const

◆ fillPhiMaps() [2/2]

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

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

◆ makeConnetionsMap() [1/2]

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

Fill histograms used for making the connections maps

◆ makeConnetionsMap() [2/2]

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 }
void fillPhiMaps(unsigned int iProcessor, const OMTFinput &aInput)
OMTFConfiguration * myOmtfConfig
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
unsigned int nRefLayers() const
void fillInputRange(unsigned int iConfigMaker, unsigned int iCone, const OMTFinput &aInput)
unsigned int nLogicRegions() const

◆ printConnections() [1/2]

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.

◆ printConnections() [2/2]

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(), OMTFConfiguration::nLayers(), and MillePedeFileConverter_cfg::out.

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 }
OMTFConfiguration * myOmtfConfig
unsigned int nLayers() const
unsigned int nInputs() const
vector4D & getMeasurements4Dref()

◆ printPhiMap() [1/2]

void OMTFConfigMaker::printPhiMap ( std::ostream &  out)

Print starting iPhi for each reference layer in each processor

◆ printPhiMap() [2/2]

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(), OMTFConfiguration::nRefLayers(), and MillePedeFileConverter_cfg::out.

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 }
std::vector< std::vector< int > > maxRefPhi2D
OMTFConfiguration * myOmtfConfig
std::vector< std::vector< int > > minRefPhi2D
unsigned int nRefLayers() const
unsigned int nLogicRegions() const

Member Data Documentation

◆ maxRefPhi2D

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

Definition at line 56 of file OMTFConfigMaker.h.

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

◆ minRefPhi2D

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().

◆ myOmtfConfig

OMTFConfiguration * OMTFConfigMaker::myOmtfConfig
private