Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

mMuiBLTEmulator.h

Go to the documentation of this file.
00001 #ifndef __MMUIBLTEMULATOR_HH__
00002 #define __MMUIBLTEMULATOR_HH__
00003 
00004 #include<PHModule.h>
00005 #include<PHTimer.h>
00006 #include<TMuiPseudoBLTMapO.h>
00007 #include<TMuiHitMapO.h>
00008 #include<mMuiBLTEmulatorPar.h>
00009 #include<MUIOO.h>
00010 #include "PHIODataNode.h"
00011 #include "PHNodeIterator.h"
00012 #include "PHTypedNodeIterator.h"
00013 #include "Event.h"
00014 
00051 class mMuiBLTEmulator : public PHModule
00052 {
00053  public: 
00054   
00055   enum
00056   {
00057     max_arm =2,
00058     max_quad = 4,
00059     max_plane = 4,
00060     max_orientation = 2,
00061     
00062     DEEP_ROAD = 2,
00063     SHALLOW_ROAD = 1,
00064     
00065     DEEP_DEEP = 16,
00066     DEEP_SHALLOW = 8,
00067     SINGLE_DEEP = 4,
00068     SHALLOW_SHALLOW = 2,
00069     SINGLE_SHALLOW = 1,
00070 
00071     mlu_address_max = 4096,
00072     max_fem = 2,
00073     word_per_fem = 120
00074   };
00075 
00076   mMuiBLTEmulator(); 
00077 
00078   ~mMuiBLTEmulator(); 
00079 
00080   virtual PHBoolean event(PHCompositeNode*);
00081 
00082   // called only at the first event
00083   //
00084   void initialize(int runno);
00085 
00086   // read MLU data from a text file
00087   //
00088   bool read_mlu_data(int* mlu_data_d, char* mlu_data_file);
00089 
00090 
00091 
00092  private:  
00093   
00094   // fill "word" array from MuID packet
00095   //
00096   void get_raw_data();
00097   // fill "word' array from hit map.
00098   //
00099   void get_hits();
00100   // convert "word" array into pseudo-trigger output of each ROC
00101   //
00102   void raw_to_trigpattern();
00103   // return BLT trigger bits.
00104   //
00105   int decision_event(int arm);
00106   // "Decision MLU" emulator
00107   //
00108   int decision_mlu(int arm);
00109   // make Deep or Shallow decision on one quadrant.
00110   //
00111   int quad_fire(int* quad_trig_pattern, int* mlu_data);
00112   // set up interface pointer
00113   //
00114   void set_interface_ptrs(PHCompositeNode* top_node);
00115   // fill pseudo-BLT map.
00116   //
00117   void fill_map();
00118   // get not used palne 
00119   //
00120   int get_non_used_plane() { return _non_used_plane;}
00121   // set not used palne 
00122   //
00123   void set_non_used_plane(int plane ) { _non_used_plane = plane;}
00124 
00125   // Cross check from hit objects.
00126   //
00127   void check_blt();
00128   // dump reco blt from TMuiHitMapO
00129   //
00130   void dump_reco_blt(int arm);
00131   
00132   // 
00133 #ifndef __CINT__
00134   // decide 2D trigger from TMuiHitO.
00135   //
00136   bool is_reco_2D(int arm);
00137   // decide 1D1S trigger from TMuiHitO.
00138   //
00139   bool is_reco_1D1S(int arm);
00140   // decide 1D trigger from TMuiHitO.
00141   //
00142   bool is_reco_1D(int arm, int quad);
00143   // decide 1S trigger from TMuiHitO.
00144   //
00145   bool is_reco_1S(int arm, int quad);
00146 
00147 
00148 #endif
00149   // decide which quadrant the TMuiHitO is in.
00150   //
00151   int  get_quad(float x, float y, float z);
00152 
00153 
00154 
00155   // Interface pointers
00156   //
00157   const mMuiBLTEmulatorPar* _mod_par;           
00158   TMuiHitMapO* _hit_map;
00159   TMuiPseudoBLTMapO* _blt_map;
00160   Event* _event;                             // external interface
00161   // MLU data file for shallow roads
00162 
00163   long word[max_arm][max_fem][word_per_fem];
00164   // MLU data for shallow roads
00165   int mlu_data_s[mlu_address_max];
00166   // MLU data for deep roads
00167   int mlu_data_d[mlu_address_max];
00168   // This plane is excluded from the trigger decision
00169   int _non_used_plane;
00170   // bit pattern of pseudo-trigger output for each plane of each quadrant
00171   int trig_pattern[max_arm][max_quad][max_plane];
00172   // trigger state for each quadrant (Deep or shallow)
00173   int trig_accept[max_arm][max_quad];
00174   
00175   // flag for initialization.
00176   //
00177   int init_done;
00178   
00179   // Timer
00180   //
00181   PHTimer _timer;
00182 };
00183 
00184 #endif /* __MMUIBLTEMULATOR_HH__ */
00185 
00186 
00187 
00188 
00189 
00190 
00191 
00192 
00193 
00194 
00195 
00196 
00197 
00198 
00199 
00200 
00201 
00202 
00203 
00204 
00205 
00206 

MUIOO: PHENIX Muon Identifier Analysis Framework. Documentation by doxygen
Last modified: