Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:46

0001 #ifndef MEChannel_hh
0002 #define MEChannel_hh
0003 
0004 //

0005 // Authors  : Gautier Hamel de Monchenault and Julie Malcles, Saclay

0006 //

0007 // logical navigation in doubly linked list of channels

0008 
0009 #include <vector>
0010 #include <TROOT.h>
0011 
0012 class MEChannel {
0013 public:
0014   MEChannel(int ix, int iy, int ii, MEChannel* mother);
0015   virtual ~MEChannel();
0016 
0017   int id() const;
0018   int ix() const { return _ix; }
0019   int iy() const { return _iy; }
0020 
0021   MEChannel* getDaughter(int ix, int iy, int ig);
0022   MEChannel* m() { return _m; }
0023   MEChannel* d(unsigned ii) {
0024     if (ii >= n())
0025       return nullptr;
0026     return _d[ii];
0027   }
0028   unsigned n() const { return _d.size(); }
0029   int ig() const { return _ig; }
0030 
0031   bool getListOfChannels(std::vector<MEChannel*>&);
0032   bool getListOfAncestors(std::vector<MEChannel*>&);
0033   bool getListOfDescendants(std::vector<MEChannel*>&);
0034   bool getListOfDescendants(int ig, std::vector<MEChannel*>&);
0035   MEChannel* getFirstDescendant(int ig);
0036   MEChannel* getDescendant(int ig, int ii);
0037   MEChannel* getChannel(int ix, int iy);
0038   MEChannel* getChannel(int ig, int ix, int iy);
0039   MEChannel* getAncestor(int ig);
0040 
0041   void print(std::ostream& o, bool recursif = false) const;
0042   TString oneLine(int ig);
0043   TString oneLine() { return oneLine(_ig); }
0044   TString oneWord(int ig);
0045   TString oneWord() { return oneWord(_ig); }
0046 
0047 private:
0048   // doubly-linked tree

0049   MEChannel* _m;
0050   std::vector<MEChannel*> _d;
0051 
0052   // granularity

0053   int _ig;
0054 
0055   // (local) coordinates

0056   int _ix;
0057   int _iy;
0058 
0059   // defines a channel

0060   std::vector<int> _id;
0061 
0062   MEChannel* addDaughter(int ix, int iy, int ii);
0063 
0064   //  ClassDef(MEChannel,0) // MEChannel -- A channel or group of channels

0065 };
0066 
0067 #endif