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 Attributes
LMap::impl Class Reference

Public Member Functions

std::map< int, LMapRow > & get_map (void)
 
 impl ()
 
int read (std::string accessor, std::string type)
 
 ~impl ()
 

Private Attributes

std::map< int, LMapRow_lmap
 
std::vector< LMapRow_table
 

Detailed Description

Definition at line 33 of file LMap.cc.

Constructor & Destructor Documentation

LMap::impl::impl ( )
inline

Definition at line 35 of file LMap.cc.

35 { }
LMap::impl::~impl ( )
inline

Definition at line 36 of file LMap.cc.

36 { }

Member Function Documentation

std::map<int,LMapRow>& LMap::impl::get_map ( void  )
inline

Definition at line 39 of file LMap.cc.

39 { return _lmap; };
std::map< int, LMapRow > _lmap
Definition: LMap.cc:43
int LMap::impl::read ( std::string  accessor,
std::string  type 
)

Definition at line 65 of file LMap.cc.

References _lmap, _table, LMapRow::adc, prof2calltree::count, gather_cfg::cout, LMapRow::crate, LMapRow::dcc, LMapRow::dcc_sl, LMapRow::depth, LMapRow::det, LMapRow::dphi, LMapRow::eta, LMapRow::fedid, LMapRow::fi_ch, HcalBarrel, HcalEndcap, HcalForward, HcalOther, HcalOuter, LMapRow::htr, LMapRow::htr_fi, recoMuon::in, beamvalidation::lines, LMapRow::phi, LMapRow::pixel, LMapRow::qie, DetId::rawId(), LMapRow::rctcar, LMapRow::rctcon, LMapRow::rctcra, LMapRow::rm, LMapRow::rm_fi, LMapRow::side, LMapRow::slb, LMapRow::spigo, and LMapRow::wedge.

Referenced by python.Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::goto(), and python.Vispa.Plugins.EdmBrowser.EdmDataAccessor.EdmDataAccessor::setFilterBranches().

66 {
67 
69 
70  std::string _row;
71  ifstream inFile( map_file . c_str(), std::ios::in );
72  if (!inFile)
73  {
74  std::cout << "Unable to open file with the logical map: " << map_file << std::endl;
75  }
76  else
77  {
78  std::cout << "File with the logical map opened successfully: " << map_file << std::endl;
79  std::cout << "Type: " << type << std::endl;
80  }
81  while ( getline( inFile, _row ) > 0 )
82  {
83  LMapRow aRow;
84  char det[32];
85  char rbx[32];
86  char fpga[32];
87  char slbin[32];
88  char slbin2[32];
89  char slnam[32];
90  char rctnam[32];
91 
92  const char * let_code = "Z";
93 
94  int _read = 0;
95  if ( type == "HBEF" )
96  {
97  const char * _format = " %d %d %d %d %d %s %s %d %d %d %d %d %d %d %d %d %s %d %d %d %d %d %s %s %s %d %d %d %s %d";
98  _read = sscanf( _row . c_str(), _format,
99  &(aRow.side),
100  &(aRow.eta), &(aRow.phi), &(aRow.dphi), &(aRow.depth),
101  det,
102  rbx,
103  &(aRow.wedge), &(aRow.rm), &(aRow.pixel), &(aRow.qie), &(aRow.adc), &(aRow.rm_fi), &(aRow.fi_ch),
104  &(aRow.crate), &(aRow.htr),
105  fpga,
106  &(aRow.htr_fi),
107  &(aRow.dcc_sl), &(aRow.spigo), &(aRow.dcc), &(aRow.slb),
108  slbin, slbin2, slnam,
109  &(aRow.rctcra), &(aRow.rctcar), &(aRow.rctcon),
110  rctnam,
111  &(aRow.fedid) );
112  }
113  else if ( type == "HO" )
114  {
115  const char * _format = " %d %d %d %d %d %s %s %d %d %d %d %d %d %d %s %d %d %s %d %d %d %d %d";
116  _read = sscanf( _row . c_str(), _format,
117  &(aRow.side),
118  &(aRow.eta), &(aRow.phi), &(aRow.dphi), &(aRow.depth),
119  det,
120  rbx,
121  &(aRow.wedge), &(aRow.rm), &(aRow.pixel), &(aRow.qie), &(aRow.adc), &(aRow.rm_fi), &(aRow.fi_ch),
122  &let_code,
123  &(aRow.crate), &(aRow.htr),
124  fpga,
125  &(aRow.htr_fi),
126  &(aRow.dcc_sl), &(aRow.spigo), &(aRow.dcc), &(aRow.slb) );
127  //slbin, slbin2, slnam,
128  //&(aRow.rctcra), &(aRow.rctcar), &(aRow.rctcon),
129  //rctnam,
130  //&(aRow.fedid) );
131  }
132  if ( _read >= 23 )
133  {
134  lines . count();
135 
136  std::string _det(det);
137  if ( _det.find("HB") != std::string::npos ) aRow . det = HcalBarrel;
138  else if ( _det.find("HE") != std::string::npos ) aRow . det = HcalEndcap;
139  else if ( _det.find("HF") != std::string::npos ) aRow . det = HcalForward;
140  else if ( _det.find("HO") != std::string::npos ) aRow . det = HcalOuter;
141  else aRow . det = HcalOther;
142 
143  aRow . rbx .append( rbx );
144  aRow . fpga .append( fpga );
145  aRow . slbin .append( slbin );
146  aRow . slbin2 .append( slbin2 );
147  aRow . slnam .append( slnam );
148  aRow . rctnam .append( rctnam );
149  aRow . let_code .append( let_code );
150 
151  _table . push_back( aRow );
152 
153  HcalDetId _hdid(aRow.det, aRow.side*aRow.eta, aRow.phi, aRow.depth);
154 
155  _lmap[_hdid.rawId()] = aRow;
156 
157  }
158  }
159  inFile.close();
160  std::cout << "LMap: " << lines . getCount() << " lines read" << std::endl;
161 
162  return 0;
163 }
type
Definition: HCALResponse.h:22
int rctcra
Definition: LMap.h:52
int dphi
Definition: LMap.h:42
int phi
Definition: LMap.h:42
int pixel
Definition: LMap.h:46
int qie
Definition: LMap.h:46
int fedid
Definition: LMap.h:54
int slb
Definition: LMap.h:50
int htr
Definition: LMap.h:47
int depth
Definition: LMap.h:42
int spigo
Definition: LMap.h:50
std::map< int, LMapRow > _lmap
Definition: LMap.cc:43
int dcc_sl
Definition: LMap.h:50
int fi_ch
Definition: LMap.h:46
int adc
Definition: LMap.h:46
int crate
Definition: LMap.h:47
int side
Definition: LMap.h:39
int rm_fi
Definition: LMap.h:46
int dcc
Definition: LMap.h:50
int wedge
Definition: LMap.h:46
int rctcon
Definition: LMap.h:52
int rctcar
Definition: LMap.h:52
tuple cout
Definition: gather_cfg.py:41
int htr_fi
Definition: LMap.h:49
HcalSubdetector det
Definition: LMap.h:44
Definition: LMap.h:35
int eta
Definition: LMap.h:42
std::vector< LMapRow > _table
Definition: LMap.cc:39
int rm
Definition: LMap.h:46

Member Data Documentation

std::map<int,LMapRow> LMap::impl::_lmap
private

Definition at line 43 of file LMap.cc.

Referenced by read().

std::vector<LMapRow> LMap::impl::_table
private

Definition at line 39 of file LMap.cc.

Referenced by read().