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

TowerBoundaries.cxx

Go to the documentation of this file.
00001 // $Id: TowerBoundaries.cxx,v 1.1.1.1 1999/12/28 01:36:03 burnett Exp $
00002 // 
00003 //  Original author: Sawyer Gillespie
00004 //                   hgillesp@u.washington.edu
00005 //
00006 
00007 #include "reconstruction/TowerBoundaries.h"    // include class declaration
00008 #include "reconstruction/GlastFit.h"
00009 #include "reconstruction/GlastRecon.h"
00010 #include "reconstruction/LbldData.h"
00011 #include "reconstruction/TrackerRecon.h"
00012 #include "instrument/Glast.h"
00013 
00014 // implementation of the TowerBoundaries class
00015 
00016 TowerBoundaries::TowerBoundaries (GlastRecon* r)
00017 : ReconAnalysis (r)
00018 {
00019 }
00020 
00021 TowerBoundaries::~TowerBoundaries ()
00022 {
00023 }
00024 
00025 void    TowerBoundaries::setUpData ()
00026 {
00027     i_Tower_Bnd = data()->addElement("Conv_Twr_Dist");
00028     i_Fit_xv = data()->addElement("Fit_xV");
00029     i_Fit_yv = data()->addElement("Fit_yV");
00030 }
00031 
00032 void    TowerBoundaries::compute ()
00033 {
00034     // get the TrackerRecon object which has reconstructed the
00035     // data within the silicon tracker
00036     TrackerRecon*   tr = recon()->getTracker();
00037     
00038     // declare local variables
00039 
00040     // get the gamma-ray fit from TrackerRecon
00041     GFgamma*    gamma = tr->gammaFit ();
00042 
00043     // get the instrument parameters from TrackerRecon
00044     const TrackerRecon::Parameters& s_parms = tr->params ();
00045 
00046     // get the vertex of the gamma conversion?
00047     Point vertex = gamma->getFirstHit();
00048     float x_ist = vertex.x();
00049     float y_ist = vertex.y();
00050 
00051     // compute the results    
00052     float num_2 = Glast::xNum/2.; 
00053     float x_twr_bnd = fmod((x_ist + s_parms.tower_width*num_2), s_parms.tower_width);
00054     x_twr_bnd = x_twr_bnd - s_parms.tower_width*.5;
00055     float y_twr_bnd = fmod((y_ist + s_parms.tower_width*num_2), s_parms.tower_width);
00056     y_twr_bnd = y_twr_bnd - s_parms.tower_width*.5;
00057     
00058     x_twr_bnd = fabs(x_twr_bnd);
00059     y_twr_bnd = fabs(y_twr_bnd);
00060     float twr_bnd   = (x_twr_bnd > y_twr_bnd) ? x_twr_bnd : y_twr_bnd;
00061     
00062     // set the state of this object to reflect the results of the
00063     // computation
00064     ReconAnalysis::result (new Result(twr_bnd, x_twr_bnd, y_twr_bnd));
00065 
00066     // add the data to the list of archival data elements.
00067     tr->data.addData(i_Tower_Bnd, twr_bnd);
00068     tr->data.addData(i_Fit_xv, x_twr_bnd);
00069     tr->data.addData(i_Fit_yv, y_twr_bnd);
00070 }

Generated at Wed Nov 21 12:20:45 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000