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 32 of file LMap.cc.

Constructor & Destructor Documentation

LMap::impl::impl ( )
inline

Definition at line 34 of file LMap.cc.

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

Definition at line 35 of file LMap.cc.

35 { }

Member Function Documentation

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

Definition at line 38 of file LMap.cc.

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

Definition at line 64 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, groupFilesInBlocks::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, AlCaHLTBitMon_QueryRunRegistry::string, and LMapRow::wedge.

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

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

Member Data Documentation

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

Definition at line 42 of file LMap.cc.

Referenced by read().

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

Definition at line 38 of file LMap.cc.

Referenced by read().