CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/CalibCalorimetry/EcalLaserAnalyzer/interface/MEChannel.h

Go to the documentation of this file.
00001 #ifndef MEChannel_hh
00002 #define MEChannel_hh
00003 
00004 //
00005 // Authors  : Gautier Hamel de Monchenault and Julie Malcles, Saclay 
00006 //
00007 // logical navigation in doubly linked list of channels
00008 
00009 #include <vector>
00010 #include <TROOT.h>
00011 
00012 class MEChannel
00013 {
00014 public:
00015 
00016   MEChannel( int ix, int iy, int ii, MEChannel* mother );
00017   virtual  ~MEChannel();
00018   
00019   int id()       const;
00020   int ix() const { return _ix; }
00021   int iy() const { return _iy; }
00022   
00023   MEChannel* getDaughter( int ix, int iy, int ig );
00024   MEChannel* m() { return _m; }
00025   MEChannel* d( unsigned ii ) { if( ii>=n() ) return 0; return _d[ii]; }
00026   unsigned n() const { return _d.size(); }
00027   int ig() const { return _ig; }
00028   
00029   bool getListOfChannels(            std::vector< MEChannel* >& );
00030   bool getListOfAncestors(           std::vector< MEChannel* >& );
00031   bool getListOfDescendants(         std::vector< MEChannel* >& );
00032   bool getListOfDescendants( int ig, std::vector< MEChannel* >& );
00033   MEChannel* getFirstDescendant( int ig );
00034   MEChannel* getDescendant( int ig, int ii );
00035   MEChannel* getChannel(          int ix, int iy );
00036   MEChannel* getChannel(  int ig, int ix, int iy );
00037   MEChannel* getAncestor( int ig );
00038   
00039   void print(std::ostream& o, bool recursif=false ) const;
00040   TString oneLine( int ig );
00041   TString oneLine() { return oneLine( _ig ); }
00042   TString oneWord( int ig );
00043   TString oneWord() { return oneWord( _ig ); }
00044  
00045 private:
00046   
00047   // doubly-linked tree
00048   MEChannel* _m;
00049   std::vector< MEChannel* > _d;
00050   
00051   // granularity
00052   int _ig;
00053   
00054   // (local) coordinates
00055   int _ix;
00056   int _iy;
00057   
00058   // defines a channel
00059   std::vector< int > _id;
00060   
00061   MEChannel* addDaughter( int ix, int iy, int ii );
00062   
00063   //  ClassDef(MEChannel,0) // MEChannel -- A channel or group of channels  
00064 };
00065 
00066 #endif
00067