42 int _current_size =
size();
44 std::ifstream inFile( filename . c_str(),
std::ios::in );
46 std::cout <<
"Unable to open file with the logical map: " << filename << std::endl;
49 std::cout <<
"File with the logical map opened successfully: " << filename << std::endl;
51 while ( getline( inFile, _row ) > 0 ){
53 int _num, _side, _eta, _phi, _dphi, _depth;
57 const char * _format =
"%d %d %d %d %d %d %s";
58 _read = sscanf( _row . c_str(), _format,
59 &_num, &_side, &_eta, &_phi, &_dphi, &_depth,
67 if ( subdet.find(
"HB")!=std::string::npos ) _det =
HcalBarrel;
68 else if ( subdet.find(
"HE")!=std::string::npos ) _det =
HcalEndcap;
69 else if ( subdet.find(
"HO")!=std::string::npos ) _det =
HcalOuter;
70 else if ( subdet.find(
"HF")!=std::string::npos ) _det =
HcalForward;
73 HcalDetId _detid(_det, _side*_eta, _phi, _depth);
81 std::cout <<
"Logical map file: " << lines . getCount() <<
" lines read" << std::endl;
82 std::cout <<
"Logical map file: " <<
size() - _current_size <<
" lines added to the list" << std::endl;
int initHBEFListFromLmapAscii(void)
HcalSubdetector subdet() const
get the subdetector
std::vector< HcalGenericDetId > channel_list
int depth() const
get the tower depth
int addListFromLmapAscii(std::string filename)
int init(const std::vector< HcalGenericDetId > &map)
int ieta() const
get the cell ieta
int iphi() const
get the cell iphi
HcalGenericDetId getHcalGenericDetId(void)
virtual ~HcalChannelIterator()
std::vector< HcalGenericDetId >::const_iterator const_iterator
int clearChannelList(void)
HcalSubdetector getHcalSubdetector(void)