CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 (const edm::ParameterSet &cfg, 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

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

Detailed Description

Definition at line 17 of file OMTFConfigMaker.h.

Constructor & Destructor Documentation

OMTFConfigMaker::OMTFConfigMaker ( const edm::ParameterSet cfg,
OMTFConfiguration omtf_config 
)

Definition at line 13 of file OMTFConfigMaker.cc.

References OMTFConfiguration::instance(), maxRefPhi2D, minRefPhi2D, OMTFConfiguration::nLogicRegions, ecaldqm::binning::nPhiBins, and OMTFConfiguration::nPhiBins.

13  : m_omtf_config(omtf_config) {
14 
15  std::vector<int> refPhi1D(OMTFConfiguration::instance()->nLogicRegions,2*OMTFConfiguration::instance()->nPhiBins);
16  minRefPhi2D.assign(OMTFConfiguration::instance()->nRefLayers,refPhi1D);
17 
19  maxRefPhi2D.assign(OMTFConfiguration::instance()->nRefLayers,refPhi1D);
20 
21 }
unsigned int nLogicRegions
unsigned int nPhiBins
std::vector< std::vector< int > > minRefPhi2D
OMTFConfiguration * m_omtf_config
static const OMTFConfiguration * instance()
std::vector< std::vector< int > > maxRefPhi2D
OMTFConfigMaker::~OMTFConfigMaker ( )

Definition at line 24 of file OMTFConfigMaker.cc.

24 { }

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

28  {
29 
30 }
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 98 of file OMTFConfigMaker.cc.

References OMTFinput::getLayerData(), OMTFConfiguration::instance(), m_omtf_config, OMTFConfiguration::measurements4D, OMTFConfiguration::nLayers, and OMTFConfiguration::nPhiBins.

Referenced by makeConnetionsMap().

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

Definition at line 112 of file OMTFConfigMaker.cc.

References m_omtf_config, and OMTFConfiguration::measurements4Dref.

115  {
116 
117  ++m_omtf_config->measurements4Dref[iProcessor][iRegion][iRefLayer][iInput];
118 
119 }
OMTFConfiguration * m_omtf_config
void OMTFConfigMaker::fillPhiMaps ( unsigned int  iProcessor,
const OMTFinput aInput 
)

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

Definition at line 33 of file OMTFConfigMaker.cc.

References OMTFinput::getLayerData(), OMTFConfiguration::getRegionNumberFromMap(), OMTFConfiguration::instance(), maxRefPhi2D, minRefPhi2D, OMTFConfiguration::nInputs, ecaldqm::binning::nPhiBins, and OMTFConfiguration::nRefLayers.

Referenced by makeConnetionsMap().

34  {
35 
37  for(unsigned int iRefLayer=0;iRefLayer<OMTFConfiguration::instance()->nRefLayers;++iRefLayer){
38  const OMTFinput::vector1D & refLayerHits = aInput.getLayerData(OMTFConfiguration::instance()->refToLogicNumber[iRefLayer]);
39  if(!refLayerHits.size()) continue;
40  for(unsigned int iInput=0;iInput<OMTFConfiguration::instance()->nInputs;++iInput){
41  int phiRef = refLayerHits[iInput];
42  unsigned int iRegion = OMTFConfiguration::instance()->getRegionNumberFromMap(iInput,iRefLayer,phiRef);
43  if(phiRef>=(int)OMTFConfiguration::instance()->nPhiBins) continue;
44  if(phiRef<minRefPhi2D[iRefLayer][iRegion]) minRefPhi2D[iRefLayer][iRegion] = phiRef;
45  if(phiRef>maxRefPhi2D[iRefLayer][iRegion]) maxRefPhi2D[iRefLayer][iRegion] = phiRef;
46  }
47  }
48 }
unsigned int nInputs
std::vector< int > vector1D
Definition: OMTFinput.h:14
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:18
unsigned int getRegionNumberFromMap(unsigned int iInput, unsigned int iRefLayer, int iPhi) const
std::vector< std::vector< int > > minRefPhi2D
unsigned int nRefLayers
static const OMTFConfiguration * instance()
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 74 of file OMTFConfigMaker.cc.

References fillInputRange(), fillPhiMaps(), OMTFinput::getLayerData(), OMTFConfiguration::getRegionNumberFromMap(), OMTFConfiguration::instance(), and OMTFConfiguration::nRefLayers.

Referenced by OMTFPatternMaker::analyze().

75  {
76 
77  fillPhiMaps(iProcessor,aInput);
78 
79  for(unsigned int iRefLayer=0;iRefLayer<OMTFConfiguration::instance()->nRefLayers;++iRefLayer){
80  const OMTFinput::vector1D & refLayerHits = aInput.getLayerData(OMTFConfiguration::instance()->refToLogicNumber[iRefLayer]);
81  if(!refLayerHits.size()) continue;
83  for(unsigned int iInput=0;iInput<refLayerHits.size();++iInput){
84  int phiRef = refLayerHits[iInput];
85  unsigned int iRegion = OMTFConfiguration::instance()->getRegionNumberFromMap(iInput,iRefLayer,phiRef);
86  if(iRegion>=OMTFConfiguration::instance()->nLogicRegions) continue;
87  fillInputRange(iProcessor,iRegion,aInput);
88  fillInputRange(iProcessor,iRegion,iRefLayer,iInput);
92  if(iInput%2==0) fillInputRange(iProcessor,iRegion,iRefLayer,iInput+1);
93  }
94  }
95 }
void fillPhiMaps(unsigned int iProcessor, const OMTFinput &aInput)
std::vector< int > vector1D
Definition: OMTFinput.h:14
const OMTFinput::vector1D & getLayerData(unsigned int iLayer, bool giveEta=false) const
Definition: OMTFinput.cc:18
unsigned int getRegionNumberFromMap(unsigned int iInput, unsigned int iRefLayer, int iPhi) const
unsigned int nRefLayers
void fillInputRange(unsigned int iConfigMaker, unsigned int iCone, const OMTFinput &aInput)
static const OMTFConfiguration * instance()
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 122 of file OMTFConfigMaker.cc.

References OMTFConfiguration::instance(), OMTFConfiguration::measurements4Dref, and OMTFConfiguration::nLayers.

Referenced by OMTFPatternMaker::endJob().

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

Print starting iPhi for each reference layer in each processor

Definition at line 51 of file OMTFConfigMaker.cc.

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

Referenced by OMTFPatternMaker::endJob().

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

Member Data Documentation

OMTFConfiguration* OMTFConfigMaker::m_omtf_config
private

Definition at line 71 of file OMTFConfigMaker.h.

Referenced by fillInputRange().

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