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

mMuiEvalFramework Class Reference
[Analysis Modules]

Compares old MUI framework with new MUIOO framework. More...

#include <mMuiEvalFramework.h>

List of all members.

Public Methods

 mMuiEvalFramework ()
 ~mMuiEvalFramework ()
virtual PHBoolean event (PHCompositeNode *)

Private Methods

void set_interface_ptrs (PHCompositeNode *top_node)
void eval_unpacker ()
void eval_cluster ()
void eval_findroad ()
void print_raw (const DMUIRAW_ST *)
void print_cluster (const DMUICLUSTERS_ST *)
void print_road (const DMUIROADS_ST *)

Private Attributes

const mMuiEvalFrameworkPar_mod_par
const TMuiHitMapO_hit_map
dMuiRawWrapper * _hit_table
const TMuiClusterMapO_cluster_map
dMuiClustersWrapper * _cluster_table
const TMuiRoadMapO_road_map
dMuiRoadsWrapper * _road_table
PHTimeServer::timer _timer


Detailed Description

Compares old MUI framework with new MUIOO framework.

Evaluation module. Compares new framework output (MUIOO) with old framework (MUI)

Analysis Module Interface Specification

Object Description Privilege
const mMuiEvalFrameworkPar* Parameter Table immutable
const TMuiHitMapO* IOC immutable
const TMuiClusterMapO* IOC immutable
const TMuiRoadMapO* IOC immutable
dMuiRawWrapper Wrapped STAF table mutable
dMuiClustersWrapper Wrapped STAF table mutable
dMuiRoadsWrapper Wrapped STAF table mutable

Definition at line 70 of file mMuiEvalFramework.h.


Constructor & Destructor Documentation

mMuiEvalFramework  
 

Definition at line 32 of file mMuiEvalFramework.cxx.

References MUIOO::TRACE.

00032                                      : 
00033   _timer(PHTimeServer::get()->insert_new("mMuiEvalFramework") )
00034 {
00035   name = "mMuiEvalFramework";
00036   MUIOO::TRACE("initializing module " + std::string(name.getString()));  
00037 }

~mMuiEvalFramework  
 

Definition at line 40 of file mMuiEvalFramework.cxx.

00040 { }


Member Function Documentation

void eval_cluster   [private]
 

Definition at line 132 of file mMuiEvalFramework.cxx.

References _cluster_map, _cluster_table, TMuiClusterMapO::get, MUIOO::PRINT, and print_cluster.

Referenced by event.

00132                                     {
00133   
00134   // back in STAF-land
00135   //
00136   TABLE_HEAD_ST dMuiClusters_h = _cluster_table->TableHeader();
00137   DMUICLUSTERS_ST* dMuiClusters   = _cluster_table->TableData();
00138   
00139   int nmatch=0;
00140   const double max_diff_match = 10.; 
00141 
00142   for(int i=0; i<dMuiClusters_h.nok;i++){
00143 
00144     unsigned short arm = dMuiClusters[i].arm;
00145     unsigned short plane = dMuiClusters[i].plane;
00146     unsigned short panel = dMuiClusters[i].panel;
00147     unsigned short orient = dMuiClusters[i].orientation;
00148     
00149     float cpos_staf[3];
00150     for (int j = 0; j<3; j++) {
00151       cpos_staf[j] = dMuiClusters[i].CentroidPos[j];;
00152     }
00153 
00154     TMuiClusterMapO::const_iterator cluster_iter = _cluster_map->get(arm,
00155                                                                      plane,
00156                                                                      panel,
00157                                                                      orient);
00158     bool found_match = false;
00159     while(TMuiClusterMapO::const_pointer cluster_ptr = cluster_iter.next()){
00160       
00161       PHPoint cpos_oo = cluster_ptr->get()->get_centroidpos();
00162       double diffX = cpos_oo.getX() - cpos_staf[0];
00163       double diffY = cpos_oo.getY() - cpos_staf[1];
00164       double diffZ = cpos_oo.getZ() - cpos_staf[2];
00165       double diff = sqrt(diffX*diffX + diffY*diffY + diffZ*diffZ);
00166       if (diff < max_diff_match) {
00167         found_match = true;
00168       }
00169     }
00170     if(!found_match){
00171       MUIOO::PRINT(std::cout,"No matching cluster found");
00172       print_cluster(&dMuiClusters[i]);
00173       MUIOO::PRINT(std::cout,"**");
00174     }
00175     else {
00176       nmatch++;
00177     }
00178   }
00179   MUIOO::PRINT(std::cout,"Summary Comparison");
00180   std::cout << " ntot " << dMuiClusters_h.nok
00181             << " nmatch " << nmatch << std::endl;
00182   MUIOO::PRINT(std::cout,"**");
00183 }

void eval_findroad   [private]
 

Definition at line 186 of file mMuiEvalFramework.cxx.

Referenced by event.

00187 {
00188   // TBI
00189   return;
00190 }

void eval_unpacker   [private]
 

Definition at line 101 of file mMuiEvalFramework.cxx.

References _hit_map, _hit_table, TMuiHitMapO::get, and MUIOO::PRINT.

Referenced by event.

00102 {
00103   // back in STAF-land
00104   //
00105   TABLE_HEAD_ST dMuiRaw_h = _hit_table->TableHeader();
00106   DMUIRAW_ST* dMuiRaw   = _hit_table->TableData();
00107   
00108   MUIOO::PRINT(std::cout, "MUI unpack summary statistics");
00109   std::cout << "TMuiHitMapO: total hits = " << _hit_map->size() << std::endl;
00110   std::cout << "dMuiRaw: total hits = " << dMuiRaw_h.nok << std::endl;
00111   MUIOO::PRINT(std::cout, "**");
00112   
00113   for(int i=0;i<dMuiRaw_h.nok;i++){
00114     unsigned short arm = dMuiRaw[i].arm;
00115     unsigned short plane = dMuiRaw[i].plane;
00116     unsigned short panel = dMuiRaw[i].panel;
00117     unsigned short orientation = dMuiRaw[i].orientation;
00118     unsigned short twopack = dMuiRaw[i].twopack;
00119     TMuiHitMapO::const_iterator hit_iter = _hit_map->get(arm,
00120                                                          plane,
00121                                                          panel,
00122                                                          orientation,
00123                                                          twopack);
00124     bool found_match = false;
00125     if (hit_iter.count() == 0) found_match = true;
00126     if(!found_match){
00127       std::cout << "TMuiHitMapO/dMuiRaw mismatch" << std::endl;
00128     }
00129   }
00130 }

PHBoolean event PHCompositeNode *    [virtual]
 

Definition at line 45 of file mMuiEvalFramework.cxx.

References _mod_par, _timer, eval_cluster, eval_findroad, eval_unpacker, mMuiEvalFrameworkPar::get_eval_cluster, mMuiEvalFrameworkPar::get_eval_findroad, mMuiEvalFrameworkPar::get_eval_unpack, set_interface_ptrs, and MUIOO::TRACE.

00046 {
00047   _timer.get()->restart(); 
00048   
00049   try {
00050     
00051     set_interface_ptrs(top_node);
00052     if (_mod_par->get_eval_unpack()) eval_unpacker();
00053     if (_mod_par->get_eval_cluster()) eval_cluster();
00054     if (_mod_par->get_eval_findroad()) eval_findroad();
00055   } 
00056   catch (std::exception& e) {
00057     MUIOO::TRACE(e.what());
00058     return False;
00059   }
00060   
00061   // Timer
00062   _timer.get()->stop();
00063   _timer.get()->print(); 
00064   return True;
00065 }

void print_cluster const DMUICLUSTERS_ST *    [private]
 

Definition at line 200 of file mMuiEvalFramework.cxx.

References MUIOO::PRINT.

Referenced by eval_cluster.

00201 {
00202   MUIOO::PRINT(std::cout,"dMuiClusters");
00203   std::cout << " arm: " << clus_ptr->arm << std::endl;
00204   std::cout << " plane: " << clus_ptr->plane << std::endl;
00205   std::cout << " panel: " << clus_ptr->panel << std::endl;
00206   std::cout << " orientation: " << clus_ptr->orientation << std::endl;
00207   std::cout << " size: " << clus_ptr->size << std::endl;
00208   std::cout << " index: " << clus_ptr->dMuiClusterIndex << std::endl;
00209   MUIOO::PRINT(std::cout,"**");
00210 }

void print_raw const DMUIRAW_ST *    [private]
 

Definition at line 193 of file mMuiEvalFramework.cxx.

00194 {
00195   // TBI
00196   return;
00197 }

void print_road const DMUIROADS_ST *    [private]
 

Definition at line 213 of file mMuiEvalFramework.cxx.

00214 {
00215   // TBI
00216   return;
00217 }

void set_interface_ptrs PHCompositeNode *    top_node [private]
 

Definition at line 68 of file mMuiEvalFramework.cxx.

References _cluster_map, _cluster_table, _hit_map, _hit_table, _mod_par, _road_table, mMuiEvalFrameworkPar::get_eval_cluster, mMuiEvalFrameworkPar::get_eval_findroad, and mMuiEvalFrameworkPar::get_eval_unpack.

Referenced by event.

00068                                                               {  
00069   
00070   // module runtime parameters
00071   //
00072   _mod_par = TMutNode<mMuiEvalFrameworkPar>::find_node(top_node,"mMuiEvalFrameworkPar");
00073   
00074   // hit map pointer (IOC)
00075   //
00076   _hit_map = TMutNode<TMuiHitMapO>::find_node(top_node,"TMuiHitMapO");  
00077   
00078   // cluster map pointer (IOC)
00079   //
00080   _cluster_map = TMutNode<TMuiClusterMapO>::find_node(top_node,"TMuiClusterMapO");  
00081 
00082   // hit wrapped STAF table 
00083   //  
00084   if(_mod_par->get_eval_unpack()) {
00085     _hit_table = TMutNode<dMuiRawWrapper>::find_io_node(top_node,"dMuiRaw");
00086   }
00087   // cluster wrapped STAF table 
00088   //
00089   if(_mod_par->get_eval_cluster()){
00090     _cluster_table = TMutNode<dMuiClustersWrapper>::find_io_node(top_node,"dMuiClusters");
00091   }
00092   // cluster wrapped STAF table 
00093   //
00094   if(_mod_par->get_eval_findroad()){
00095     _road_table = TMutNode<dMuiRoadsWrapper>::find_io_node(top_node,"dMuiRoads");
00096   }
00097 } 


Member Data Documentation

const TMuiClusterMapO* _cluster_map [private]
 

Definition at line 96 of file mMuiEvalFramework.h.

Referenced by eval_cluster, and set_interface_ptrs.

dMuiClustersWrapper* _cluster_table [private]
 

Definition at line 97 of file mMuiEvalFramework.h.

Referenced by eval_cluster, and set_interface_ptrs.

const TMuiHitMapO* _hit_map [private]
 

Definition at line 94 of file mMuiEvalFramework.h.

Referenced by eval_unpacker, and set_interface_ptrs.

dMuiRawWrapper* _hit_table [private]
 

Definition at line 95 of file mMuiEvalFramework.h.

Referenced by eval_unpacker, and set_interface_ptrs.

const mMuiEvalFrameworkPar* _mod_par [private]
 

Definition at line 93 of file mMuiEvalFramework.h.

Referenced by event, and set_interface_ptrs.

const TMuiRoadMapO* _road_map [private]
 

Definition at line 98 of file mMuiEvalFramework.h.

dMuiRoadsWrapper* _road_table [private]
 

Definition at line 99 of file mMuiEvalFramework.h.

Referenced by set_interface_ptrs.

PHTimeServer::timer _timer [private]
 

Definition at line 103 of file mMuiEvalFramework.h.

Referenced by event.


The documentation for this class was generated from the following files:
MUIOO: PHENIX Muon Identifier Analysis Framework. Documentation by doxygen
Last modified: