CMS 3D CMS Logo

MEChannel.h
Go to the documentation of this file.
1 #ifndef MEChannel_hh
2 #define MEChannel_hh
3 
4 //
5 // Authors : Gautier Hamel de Monchenault and Julie Malcles, Saclay
6 //
7 // logical navigation in doubly linked list of channels
8 
9 #include <vector>
10 #include <TROOT.h>
11 
12 class MEChannel {
13 public:
14  MEChannel(int ix, int iy, int ii, MEChannel* mother);
15  virtual ~MEChannel();
16 
17  int id() const;
18  int ix() const { return _ix; }
19  int iy() const { return _iy; }
20 
21  MEChannel* getDaughter(int ix, int iy, int ig);
22  MEChannel* m() { return _m; }
23  MEChannel* d(unsigned ii) {
24  if (ii >= n())
25  return nullptr;
26  return _d[ii];
27  }
28  unsigned n() const { return _d.size(); }
29  int ig() const { return _ig; }
30 
31  bool getListOfChannels(std::vector<MEChannel*>&);
32  bool getListOfAncestors(std::vector<MEChannel*>&);
33  bool getListOfDescendants(std::vector<MEChannel*>&);
34  bool getListOfDescendants(int ig, std::vector<MEChannel*>&);
36  MEChannel* getDescendant(int ig, int ii);
37  MEChannel* getChannel(int ix, int iy);
38  MEChannel* getChannel(int ig, int ix, int iy);
39  MEChannel* getAncestor(int ig);
40 
41  void print(std::ostream& o, bool recursif = false) const;
42  TString oneLine(int ig);
43  TString oneLine() { return oneLine(_ig); }
44  TString oneWord(int ig);
45  TString oneWord() { return oneWord(_ig); }
46 
47 private:
48  // doubly-linked tree
50  std::vector<MEChannel*> _d;
51 
52  // granularity
53  int _ig;
54 
55  // (local) coordinates
56  int _ix;
57  int _iy;
58 
59  // defines a channel
60  std::vector<int> _id;
61 
62  MEChannel* addDaughter(int ix, int iy, int ii);
63 
64  // ClassDef(MEChannel,0) // MEChannel -- A channel or group of channels
65 };
66 
67 #endif
MEChannel::print
void print(std::ostream &o, bool recursif=false) const
Definition: MEChannel.cc:152
MEChannel::_id
std::vector< int > _id
Definition: MEChannel.h:60
MEChannel::~MEChannel
virtual ~MEChannel()
Definition: MEChannel.cc:27
MEChannel::getAncestor
MEChannel * getAncestor(int ig)
Definition: MEChannel.cc:71
MEChannel::iy
int iy() const
Definition: MEChannel.h:19
MEChannel::ig
int ig() const
Definition: MEChannel.h:29
MEChannel::getFirstDescendant
MEChannel * getFirstDescendant(int ig)
Definition: MEChannel.cc:117
MEChannel::getDaughter
MEChannel * getDaughter(int ix, int iy, int ig)
Definition: MEChannel.cc:33
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
MEChannel::getListOfAncestors
bool getListOfAncestors(std::vector< MEChannel * > &)
Definition: MEChannel.cc:62
MEChannel::_ix
int _ix
Definition: MEChannel.h:56
MEChannel::oneWord
TString oneWord()
Definition: MEChannel.h:45
MEChannel::getDescendant
MEChannel * getDescendant(int ig, int ii)
Definition: MEChannel.cc:103
MEChannel::m
MEChannel * m()
Definition: MEChannel.h:22
MEChannel::id
int id() const
Definition: MEChannel.cc:48
MEChannel::getListOfChannels
bool getListOfChannels(std::vector< MEChannel * > &)
Definition: MEChannel.cc:50
MEChannel::oneLine
TString oneLine()
Definition: MEChannel.h:43
MEChannel::_m
MEChannel * _m
Definition: MEChannel.h:49
MEChannel::addDaughter
MEChannel * addDaughter(int ix, int iy, int ii)
Definition: MEChannel.cc:42
MEChannel::_iy
int _iy
Definition: MEChannel.h:57
MEChannel::getListOfDescendants
bool getListOfDescendants(std::vector< MEChannel * > &)
Definition: MEChannel.cc:85
MEChannel::MEChannel
MEChannel(int ix, int iy, int ii, MEChannel *mother)
Definition: MEChannel.cc:12
MEChannel::_ig
int _ig
Definition: MEChannel.h:53
MEChannel::_d
std::vector< MEChannel * > _d
Definition: MEChannel.h:50
MEChannel::ix
int ix() const
Definition: MEChannel.h:18
MEChannel::d
MEChannel * d(unsigned ii)
Definition: MEChannel.h:23
cuy.ii
ii
Definition: cuy.py:589
MEChannel
Definition: MEChannel.h:12
MEChannel::n
unsigned n() const
Definition: MEChannel.h:28
MEChannel::getChannel
MEChannel * getChannel(int ix, int iy)
Definition: MEChannel.cc:136