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::OMTFConfigMaker ( OMTFConfiguration omtf_config)

Definition at line 13 of file OMTFConfigMaker.cc.

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 }

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

◆ ~OMTFConfigMaker()

OMTFConfigMaker::~OMTFConfigMaker ( )

Definition at line 22 of file OMTFConfigMaker.cc.

22 {}

Member Function Documentation

◆ fillCounts()

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

◆ fillInputRange() [1/2]

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.

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 }

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

Referenced by makeConnetionsMap().

◆ fillInputRange() [2/2]

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

Definition at line 104 of file OMTFConfigMaker.cc.

107  {
108  ++myOmtfConfig->getMeasurements4Dref()[iProcessor][iRegion][iRefLayer][iInput];
109 }

References OMTFConfiguration::getMeasurements4Dref(), and myOmtfConfig.

◆ fillPhiMaps()

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.

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 }

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

Referenced by makeConnetionsMap().

◆ makeConnetionsMap()

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.

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 }

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

Referenced by OMTFPatternMaker::analyze().

◆ printConnections()

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.

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 }

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

Referenced by OMTFPatternMaker::endJob().

◆ printPhiMap()

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

Print starting iPhi for each reference layer in each processor

Definition at line 48 of file OMTFConfigMaker.cc.

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 }

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

Referenced by OMTFPatternMaker::endJob().

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
OMTFConfiguration::getMeasurements4D
vector4D & getMeasurements4D()
Definition: OMTFConfiguration.h:122
OMTFConfiguration::nPhiBins
unsigned int nPhiBins() const
Definition: OMTFConfiguration.h:93
OMTFConfigMaker::fillPhiMaps
void fillPhiMaps(unsigned int iProcessor, const OMTFinput &aInput)
Definition: OMTFConfigMaker.cc:28
OMTFConfigMaker::maxRefPhi2D
std::vector< std::vector< int > > maxRefPhi2D
Definition: OMTFConfigMaker.h:56
OMTFConfigMaker::myOmtfConfig
OMTFConfiguration * myOmtfConfig
Definition: OMTFConfigMaker.h:58
OMTFConfiguration::getRegionNumberFromMap
unsigned int getRegionNumberFromMap(unsigned int iInput, unsigned int iRefLayer, int iPhi) const
Definition: OMTFConfiguration.cc:188
OMTFConfiguration::nLayers
unsigned int nLayers() const
Definition: OMTFConfiguration.h:87
OMTFConfiguration::getRefToLogicNumber
const std::vector< int > & getRefToLogicNumber() const
Definition: OMTFConfiguration.h:105
OMTFinput::vector1D
std::vector< int > vector1D
Definition: OMTFinput.h:13
createfilelist.int
int
Definition: createfilelist.py:10
OMTFConfigMaker::minRefPhi2D
std::vector< std::vector< int > > minRefPhi2D
Definition: OMTFConfigMaker.h:55
OMTFConfiguration::getMeasurements4Dref
vector4D & getMeasurements4Dref()
Definition: OMTFConfiguration.h:123
OMTFConfiguration::nRefLayers
unsigned int nRefLayers() const
Definition: OMTFConfiguration.h:89
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
OMTFConfiguration::nLogicRegions
unsigned int nLogicRegions() const
Definition: OMTFConfiguration.h:97
OMTFConfiguration::nInputs
unsigned int nInputs() const
Definition: OMTFConfiguration.h:98
OMTFinput::getLayerData
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:17
OMTFConfigMaker::fillInputRange
void fillInputRange(unsigned int iConfigMaker, unsigned int iCone, const OMTFinput &aInput)
Definition: OMTFConfigMaker.cc:94