#include <MEChannel.h>
Public Member Functions | |
MEChannel * | d (unsigned ii) |
MEChannel * | getAncestor (int ig) |
MEChannel * | getChannel (int ix, int iy) |
MEChannel * | getChannel (int ig, int ix, int iy) |
MEChannel * | getDaughter (int ix, int iy, int ig) |
MEChannel * | getDescendant (int ig, int ii) |
MEChannel * | getFirstDescendant (int ig) |
bool | getListOfAncestors (std::vector< MEChannel * > &) |
bool | getListOfChannels (std::vector< MEChannel * > &) |
bool | getListOfDescendants (std::vector< MEChannel * > &) |
bool | getListOfDescendants (int ig, std::vector< MEChannel * > &) |
int | id () const |
int | ig () const |
int | ix () const |
int | iy () const |
MEChannel * | m () |
MEChannel (int ix, int iy, int ii, MEChannel *mother) | |
unsigned | n () const |
TString | oneLine (int ig) |
TString | oneLine () |
TString | oneWord () |
TString | oneWord (int ig) |
void | print (std::ostream &o, bool recursif=false) const |
virtual | ~MEChannel () |
Private Member Functions | |
MEChannel * | addDaughter (int ix, int iy, int ii) |
Private Attributes | |
std::vector< MEChannel * > | _d |
std::vector< int > | _id |
int | _ig |
int | _ix |
int | _iy |
MEChannel * | _m |
Definition at line 12 of file MEChannel.h.
MEChannel::MEChannel | ( | int | ix, |
int | iy, | ||
int | ii, | ||
MEChannel * | mother | ||
) |
Definition at line 12 of file MEChannel.cc.
References _id, _ig, _ix, _iy, _m, ix(), and iy().
Referenced by addDaughter().
MEChannel::~MEChannel | ( | ) | [virtual] |
Definition at line 33 of file MEChannel.cc.
References _d.
MEChannel * MEChannel::addDaughter | ( | int | ix, |
int | iy, | ||
int | ii | ||
) | [private] |
Definition at line 55 of file MEChannel.cc.
References _d, d(), and MEChannel().
Referenced by getDaughter().
MEChannel* MEChannel::d | ( | unsigned | ii | ) | [inline] |
Definition at line 25 of file MEChannel.h.
Referenced by addDaughter().
MEChannel * MEChannel::getAncestor | ( | int | ig | ) |
Definition at line 97 of file MEChannel.cc.
References _ig, getAncestor(), and m().
Referenced by getAncestor().
MEChannel * MEChannel::getChannel | ( | int | ig, |
int | ix, | ||
int | iy | ||
) |
Definition at line 159 of file MEChannel.cc.
References _ig, _m, getChannel(), and python::Node::leaf.
MEChannel * MEChannel::getChannel | ( | int | ix, |
int | iy | ||
) |
Definition at line 172 of file MEChannel.cc.
References _d, _ix, _iy, python::Node::leaf, and n().
Referenced by getChannel().
MEChannel * MEChannel::getDaughter | ( | int | ix, |
int | iy, | ||
int | ig | ||
) |
Definition at line 42 of file MEChannel.cc.
References _d, and addDaughter().
Referenced by ME::regTree().
MEChannel * MEChannel::getDescendant | ( | int | ig, |
int | ii | ||
) |
Definition at line 135 of file MEChannel.cc.
References getListOfDescendants(), id(), and python::Node::leaf.
Referenced by ME::lmrTree().
MEChannel * MEChannel::getFirstDescendant | ( | int | ig | ) |
Definition at line 150 of file MEChannel.cc.
References getListOfDescendants().
{ std::vector< MEChannel* > vec; bool OK = getListOfDescendants( ig, vec ); if( !OK ) return 0; return vec[0]; }
bool MEChannel::getListOfAncestors | ( | std::vector< MEChannel * > & | vec | ) |
Definition at line 85 of file MEChannel.cc.
References getListOfAncestors(), and m().
Referenced by getListOfAncestors().
{ MEChannel* mother = this->m(); if( mother!=0 ) { vec.push_back( mother ); mother->getListOfAncestors( vec ); } return true; }
bool MEChannel::getListOfChannels | ( | std::vector< MEChannel * > & | vec | ) |
Definition at line 69 of file MEChannel.cc.
References _d, n(), and convertSQLiteXML::ok.
Referenced by oneLine().
bool MEChannel::getListOfDescendants | ( | std::vector< MEChannel * > & | vec | ) |
Definition at line 112 of file MEChannel.cc.
Referenced by getDescendant(), getFirstDescendant(), and getListOfDescendants().
bool MEChannel::getListOfDescendants | ( | int | ig, |
std::vector< MEChannel * > & | vec | ||
) |
Definition at line 123 of file MEChannel.cc.
References _d, _ig, getListOfDescendants(), and n().
int MEChannel::id | ( | void | ) | const |
Definition at line 63 of file MEChannel.cc.
Referenced by getDescendant().
int MEChannel::ig | ( | ) | const [inline] |
int MEChannel::ix | ( | ) | const [inline] |
Definition at line 20 of file MEChannel.h.
References _ix.
Referenced by MEChannel(), oneLine(), and oneWord().
{ return _ix; }
int MEChannel::iy | ( | ) | const [inline] |
Definition at line 21 of file MEChannel.h.
References _iy.
Referenced by MEChannel(), oneLine(), and oneWord().
{ return _iy; }
MEChannel* MEChannel::m | ( | ) | [inline] |
Definition at line 24 of file MEChannel.h.
References _m.
Referenced by getAncestor(), and getListOfAncestors().
{ return _m; }
unsigned MEChannel::n | ( | ) | const [inline] |
Definition at line 26 of file MEChannel.h.
References _d.
Referenced by d(), getChannel(), getListOfChannels(), and getListOfDescendants().
{ return _d.size(); }
TString MEChannel::oneLine | ( | int | ig | ) |
Definition at line 219 of file MEChannel.cc.
References _id, _ig, ME::dccAndSide(), getListOfChannels(), ME::iCrystal, ME::iEBM, ME::iEBP, ME::iEcalRegion, ME::iLMModule, ME::iLMRegion, ME::iSector, ME::iSuperCrystal, ix(), iy(), MEEBGeom::localCoord(), nchan, dbtoconf::out, ME::region, and ME::smName().
{ assert( ig>=ME::iEcalRegion ); int reg_ = _id[ME::iEcalRegion]; TString out; if( ig<ME::iLMRegion ) { out += ME::region[reg_]; if( ig==ME::iSector ) out+="/S="; out+=_id[ME::iSector]; return out; } int lmr_ = _id[ME::iLMRegion]; std::pair<int,int> p_ = ME::dccAndSide( lmr_ ); out+= ME::granularity[ME::iLMRegion]; out+="=";out += lmr_; int dcc_=p_.first; int side_=p_.second; out+="(DCC="; out+=dcc_; out+=","; out+= ME::smName(lmr_); out+="/"; out+=side_; out+=")"; if( ig>=_ig ) ig=_ig; if( ig>=ME::iLMModule ) { int lmm_=_id[ME::iLMModule]; out+="/"; out+=ME::granularity[ME::iLMModule]; out+="="; out+=lmm_; if( ig>=ME::iSuperCrystal ) { int sc_=_id[ME::iSuperCrystal]; out+="/"; out+=ME::granularity[ME::iSuperCrystal]; out+="="; out+=sc_; if( ig>=ME::iCrystal ) { int c_=_id[ME::iCrystal]; out+="/"; out+=ME::granularity[ME::iCrystal]; out+="="; out+=c_; if( reg_==ME::iEBM || reg_==ME::iEBP ) { out += "/ieta="; out+=ix(); out += "/iphi="; out+=iy(); MEEBGeom::XYCoord ixy_ = MEEBGeom::localCoord( ix(), iy() ); out += "(ix="; out+=ixy_.first; out += "/iy="; out+=ixy_.second; out += ")"; } else { out += "/ix="; out+=ix(); out += "/iy="; out+=iy(); } } } } if( ig<ME::iCrystal ) { std::vector< MEChannel* > _channels; getListOfChannels( _channels ); int nchan = _channels.size(); if( nchan>1 ) { out += "("; out += nchan; out += "xTals)"; } } return out; }
TString MEChannel::oneLine | ( | ) | [inline] |
TString MEChannel::oneWord | ( | ) | [inline] |
TString MEChannel::oneWord | ( | int | ig | ) |
Definition at line 295 of file MEChannel.cc.
References _id, _ig, ME::iCrystal, ME::iEBM, ME::iEBP, ME::iEcalRegion, ME::iLMModule, ME::iLMRegion, ME::iSector, ME::iSuperCrystal, ix(), iy(), MEEBGeom::localCoord(), dbtoconf::out, and ME::region.
{ assert( ig>=ME::iEcalRegion ); int reg_ = _id[ME::iEcalRegion]; TString out; if( ig<ME::iLMRegion ) { out = "ECAL_"; out += ME::region[reg_]; if( ig==ME::iSector ) out+="_S"; out+=_id[ME::iSector]; return out; } int lmr_ = _id[ME::iLMRegion]; out+= ME::granularity[ME::iLMRegion]; out+=lmr_; if( ig>=_ig ) ig=_ig; if( ig>=ME::iLMModule ) { int lmm_=_id[ME::iLMModule]; out+="_"; out+=ME::granularity[ME::iLMModule]; out+=lmm_; if( ig>=ME::iSuperCrystal ) { int sc_=_id[ME::iSuperCrystal]; out+="_"; out+=ME::granularity[ME::iSuperCrystal]; out+=sc_; if( ig>=ME::iCrystal ) { int c_=_id[ME::iCrystal]; out+="_"; out+=ME::granularity[ME::iCrystal]; out+=c_; if( reg_==ME::iEBM || reg_==ME::iEBP ) { MEEBGeom::XYCoord ixy_ = MEEBGeom::localCoord( ix(), iy() ); out += "_"; out+=ixy_.first; out += "_"; out+=ixy_.second; } else { out += "_"; out+=ix(); out += "_"; out+=iy(); } } } } return out; }
void MEChannel::print | ( | std::ostream & | o, |
bool | recursif = false |
||
) | const |
std::vector< MEChannel* > MEChannel::_d [private] |
Definition at line 49 of file MEChannel.h.
Referenced by addDaughter(), d(), getChannel(), getDaughter(), getListOfChannels(), getListOfDescendants(), n(), and ~MEChannel().
std::vector< int > MEChannel::_id [private] |
Definition at line 59 of file MEChannel.h.
Referenced by id(), MEChannel(), oneLine(), and oneWord().
int MEChannel::_ig [private] |
Definition at line 52 of file MEChannel.h.
Referenced by getAncestor(), getChannel(), getListOfDescendants(), id(), ig(), MEChannel(), oneLine(), and oneWord().
int MEChannel::_ix [private] |
Definition at line 55 of file MEChannel.h.
Referenced by getChannel(), ix(), and MEChannel().
int MEChannel::_iy [private] |
Definition at line 56 of file MEChannel.h.
Referenced by getChannel(), iy(), and MEChannel().
MEChannel* MEChannel::_m [private] |
Definition at line 48 of file MEChannel.h.
Referenced by getChannel(), m(), and MEChannel().