Atlfast::Sector Class Reference

#include <MuonSpectrometer.h>

Collaboration diagram for Atlfast::Sector:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Sector (DOMNode *boundaries, DOMNode *sector)
 ~Sector ()
void combine (Sector &otherSec, double thispt, double nextpt)
double calculateResolution (const HepLorentzVector &avec)
void dump (std::string indent)
std::string getSectorType ()

Private Attributes

std::string m_sectorType
double m_phimin
double m_phimax
std::vector< PhiBinm_phis

Detailed Description

Definition at line 54 of file MuonSpectrometer.h.


Constructor & Destructor Documentation

Atlfast::Sector::Sector ( DOMNode *  boundaries,
DOMNode *  sector 
)

Definition at line 219 of file MuonSpectrometer.cxx.

00219                                                     :m_phimin(0.){
00220 
00221     m_sectorType = "Unknown";
00222     
00223     getFirstValue(sector, "sectortype", m_sectorType);
00224     
00225     std::vector<DOMNode*> phis = getAllChildTagsByName(sector, "phibinres");
00226     SpectrometerComponentInstantiator<PhiBin> instantiator(boundaries);
00227     m_phis = std::for_each(phis.begin(),
00228                            phis.end(),
00229                            instantiator).objects();
00230     
00231     DOMNode* phiInfoNode =  getFirstChildTagByName(boundaries, "phiinfo");
00232     getFirstValue(phiInfoNode, "phifirst", m_phimin);
00233     getFirstValue(phiInfoNode, "philast", m_phimax);
00234     
00235     // Calculate phi info once here and give it to the PhiBins
00236     
00237     int phipoints = m_phis.size();
00238     double deltaphi = (m_phimax-m_phimin)/(phipoints-1);
00239 
00240 
00241     std::vector<PhiBin>::iterator itr = m_phis.begin();
00242     for(;itr != m_phis.end(); ++itr){
00243       (*itr).setPhiStuff(m_phimin, m_phimax, deltaphi, phipoints);
00244     }
00245     
00246   }

Atlfast::Sector::~Sector (  ) 

Definition at line 248 of file MuonSpectrometer.cxx.

00248                  {
00249     m_phis.clear();
00250   }


Member Function Documentation

void Atlfast::Sector::combine ( Sector otherSec,
double  thispt,
double  nextpt 
)

Definition at line 252 of file MuonSpectrometer.cxx.

00252                                                                     {
00253     
00254     std::vector<PhiBin>::iterator thisPhiItr = m_phis.begin();
00255     std::vector<PhiBin>::iterator otherPhiItr = otherSec.m_phis.begin();
00256     for(;thisPhiItr != m_phis.end(); ++thisPhiItr, ++otherPhiItr){
00257       (*thisPhiItr).combine(*otherPhiItr, thispt, nextpt);
00258     }
00259   }

double Atlfast::Sector::calculateResolution ( const HepLorentzVector &  avec  ) 

Definition at line 261 of file MuonSpectrometer.cxx.

00261                                                                 {
00262 
00263     // check for appropriate PhiBin
00264     // First calculate the local phi (zeroed at the sector phimin)
00265     
00266     double localphi = avec.phi();
00267     while (localphi < 0.) localphi += 2.*M_PI;
00268     double global_phi = localphi;
00269     double sectorsize = m_phimax - m_phimin;
00270     while (localphi > sectorsize ) localphi -= sectorsize;
00271     if ( global_phi >= 3.926990815 && global_phi < 4.712388978 )
00272       localphi = sectorsize - localphi;
00273     
00274     IsCorrectPhiBin icpb(localphi);
00275     std::vector<PhiBin>::iterator pbitr = find_if(m_phis.begin(),
00276                                                   m_phis.end(),
00277                                                   icpb);
00278     if ( pbitr == m_phis.end() ){
00279       // Could not find correct PhiBin, returning resolution of 1.0
00280       return 1.;
00281     }
00282     
00283     return (*pbitr).calculateResolution(avec);    
00284     
00285   }

void Atlfast::Sector::dump ( std::string  indent  ) 

Definition at line 287 of file MuonSpectrometer.cxx.

00287                                    {
00288     indent += "  ";
00289     std::cout<<indent<<"Dump for Sector:\n";
00290     std::cout<<indent<<"m_sectorType "<<m_sectorType<<std::endl;
00291     std::cout<<indent<<"m_phimin     "<<m_phimin<<std::endl;
00292     std::for_each(m_phis.begin(), m_phis.end(), AddToDump(indent));
00293   }

std::string Atlfast::Sector::getSectorType (  )  [inline]

Definition at line 61 of file MuonSpectrometer.h.

00061 {return m_sectorType;}


Member Data Documentation

std::string Atlfast::Sector::m_sectorType [private]

Definition at line 63 of file MuonSpectrometer.h.

double Atlfast::Sector::m_phimin [private]

Definition at line 64 of file MuonSpectrometer.h.

double Atlfast::Sector::m_phimax [private]

Definition at line 65 of file MuonSpectrometer.h.

std::vector<PhiBin> Atlfast::Sector::m_phis [private]

Definition at line 66 of file MuonSpectrometer.h.


The documentation for this class was generated from the following files:
Generated on Mon Sep 24 14:19:41 2007 for AtlfastAlgs by  doxygen 1.5.1