Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

TkrHitValsTool Class Reference

calculates TkrHit values More...

Inheritance diagram for TkrHitValsTool:

Inheritance graph
[legend]
Collaboration diagram for TkrHitValsTool:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TkrHitValsTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~TkrHitValsTool ()
StatusCode initialize ()
StatusCode calculate ()
 calculate all values; implemented by each XxxValsTool


Private Attributes

int Tkr_Cnv_Lyr_Hits
int Tkr_numHitsOnTracks
int Tkr_numGhosts
int Tkr_numToT255s
int Tkr_numGhostsOnTracks
int Tkr_numToT255sOnTracks
int Tkr_numFlaggedTrackHits
int Tkr_numWideClusters
int Tkr_Max_controller_hits
int Tkr_Fst_Cnv_Lyr
int Tkr_NCnv_Lyrs_Hit
int Tkr_HitsPerLyr [_nLayers]
ITkrQueryClustersTool * m_clusTool

Detailed Description

calculates TkrHit values

Authors:
Bill Atwood, Leon Rochester

Definition at line 35 of file TkrHitValsTool.cxx.


Constructor & Destructor Documentation

TkrHitValsTool::TkrHitValsTool const std::string &  type,
const std::string &  name,
const IInterface *  parent
 

Definition at line 74 of file TkrHitValsTool.cxx.

00077                                : ValBase( type, name, parent )
00078 {    
00079     // Declare additional interface
00080     declareInterface<IValsTool>(this); 
00081 }

virtual TkrHitValsTool::~TkrHitValsTool  )  [inline, virtual]
 

Definition at line 43 of file TkrHitValsTool.cxx.

00043 { }


Member Function Documentation

StatusCode TkrHitValsTool::calculate  )  [virtual]
 

calculate all values; implemented by each XxxValsTool

Reimplemented from ValBase.

Definition at line 163 of file TkrHitValsTool.cxx.

References m_clusTool, ValBase::m_pEventSvc, Tkr_Cnv_Lyr_Hits, Tkr_Fst_Cnv_Lyr, Tkr_HitsPerLyr, Tkr_NCnv_Lyrs_Hit, Tkr_numFlaggedTrackHits, Tkr_numGhosts, Tkr_numGhostsOnTracks, Tkr_numHitsOnTracks, Tkr_numToT255s, Tkr_numToT255sOnTracks, and Tkr_numWideClusters.

00164 {
00165     StatusCode sc = StatusCode::SUCCESS;
00166 
00167     // Recover Track associated info. 
00168     SmartDataPtr<Event::TkrClusterCol>   
00169         pClusters(m_pEventSvc,EventModel::TkrRecon::TkrClusterCol);
00170     //Make sure we have valid cluster data
00171 
00172     if (!pClusters) return sc;
00173 
00174     int layerIdx;
00175     for(layerIdx=0;layerIdx<_nLayers;++layerIdx) {
00176         int hitCount = 
00177             m_clusTool->getClusters(idents::TkrId::eMeasureX,layerIdx).size()
00178             + m_clusTool->getClusters(idents::TkrId::eMeasureY,layerIdx).size();
00179 
00180         if (hitCount > 0)
00181         {
00182             Tkr_Fst_Cnv_Lyr    = layerIdx;
00183             Tkr_NCnv_Lyrs_Hit += 1;
00184         }
00185 
00186         Tkr_HitsPerLyr[layerIdx] = hitCount;
00187     }
00188 
00189     Tkr_Cnv_Lyr_Hits = pClusters->size();
00190 
00191     Event::TkrClusterColConItr iter = pClusters->begin();
00192     for(; iter!=pClusters->end();++iter) {
00193         bool isGhost;
00194         bool is255;
00195         Event::TkrCluster* clust = *iter;
00196         if(isGhost=clust->isSet(Event::TkrCluster::maskGHOST)) Tkr_numGhosts++;
00197         if(is255=clust->isSet(Event::TkrCluster::mask255))     Tkr_numToT255s++;
00198         bool onTrack = clust->hitFlagged();
00199         if(onTrack) {
00200             Tkr_numHitsOnTracks++;
00201             if(isGhost) Tkr_numGhostsOnTracks++;
00202             if(is255) Tkr_numToT255sOnTracks++;
00203             if(clust->isSet(Event::TkrCluster::maskSAMETRACK)) {
00204                 Tkr_numFlaggedTrackHits++;
00205             }
00206             if(clust->size()>4) Tkr_numWideClusters++;
00207         }
00208     }
00209     return sc;
00210 }

StatusCode TkrHitValsTool::initialize  )  [virtual]
 

Reimplemented from ValBase.

Definition at line 115 of file TkrHitValsTool.cxx.

References ValBase::addItem(), ValBase::initialize(), m_clusTool, Tkr_Cnv_Lyr_Hits, Tkr_Fst_Cnv_Lyr, Tkr_HitsPerLyr, Tkr_NCnv_Lyrs_Hit, Tkr_numFlaggedTrackHits, Tkr_numGhosts, Tkr_numGhostsOnTracks, Tkr_numHitsOnTracks, Tkr_numToT255s, Tkr_numToT255sOnTracks, Tkr_numWideClusters, and ValBase::zeroVals().

00116 {
00117     StatusCode sc = StatusCode::SUCCESS;
00118 
00119     MsgStream log(msgSvc(), name());
00120 
00121     if( ValBase::initialize().isFailure()) return StatusCode::FAILURE;
00122 
00123     // get the services
00124 
00125     if( serviceLocator() ) {
00126 
00127     } else {
00128         return StatusCode::FAILURE;
00129     }
00130 
00131     if ((sc = toolSvc()->retrieveTool("TkrQueryClustersTool", m_clusTool)).isFailure())
00132     {
00133         throw GaudiException("Service [TkrQueryClustersTool] not found", name(), sc);
00134     }
00135 
00136     // load up the map
00137 
00138     addItem("TkrNumHits",             &Tkr_Cnv_Lyr_Hits);       
00139     addItem("TkrNumHitsOnTracks",     &Tkr_numHitsOnTracks);
00140     addItem("TkrFirstLayer",          &Tkr_Fst_Cnv_Lyr);        
00141     addItem("TkrNumLayersHit",        &Tkr_NCnv_Lyrs_Hit);
00142     addItem("TkrNumGhosts",           &Tkr_numGhosts);
00143     addItem("TkrNumToT255s",          &Tkr_numToT255s);
00144     addItem("TkrNumGhostsOnTracks",   &Tkr_numGhostsOnTracks);
00145     addItem("TkrNumToT255sOnTracks",  &Tkr_numToT255sOnTracks);
00146     addItem("TkrNumFlaggedTrackHits", &Tkr_numFlaggedTrackHits);
00147     addItem("TkrNumWideClusters",     &Tkr_numWideClusters);
00148 
00149     int i;
00150     char buffer[20];
00151     for(i=0;i<_nLayers;++i) {
00152         // vars of form TkrHitsInLyrNN, NN = (00,17), for _nLayers==18
00153         sprintf(buffer, "TkrHitsInLyr%02i",i);
00154         addItem(buffer, &Tkr_HitsPerLyr[i]);
00155     }
00156 
00157     zeroVals();
00158 
00159     return sc;
00160 }


Member Data Documentation

ITkrQueryClustersTool* TkrHitValsTool::m_clusTool [private]
 

Definition at line 66 of file TkrHitValsTool.cxx.

Referenced by calculate(), and initialize().

int TkrHitValsTool::Tkr_Cnv_Lyr_Hits [private]
 

Definition at line 52 of file TkrHitValsTool.cxx.

Referenced by calculate(), and initialize().

int TkrHitValsTool::Tkr_Fst_Cnv_Lyr [private]
 

Definition at line 61 of file TkrHitValsTool.cxx.

Referenced by calculate(), and initialize().

int TkrHitValsTool::Tkr_HitsPerLyr[_nLayers] [private]
 

Definition at line 64 of file TkrHitValsTool.cxx.

Referenced by calculate(), and initialize().

int TkrHitValsTool::Tkr_Max_controller_hits [private]
 

Definition at line 60 of file TkrHitValsTool.cxx.

int TkrHitValsTool::Tkr_NCnv_Lyrs_Hit [private]
 

Definition at line 62 of file TkrHitValsTool.cxx.

Referenced by calculate(), and initialize().

int TkrHitValsTool::Tkr_numFlaggedTrackHits [private]
 

Definition at line 58 of file TkrHitValsTool.cxx.

Referenced by calculate(), and initialize().

int TkrHitValsTool::Tkr_numGhosts [private]
 

Definition at line 54 of file TkrHitValsTool.cxx.

Referenced by calculate(), and initialize().

int TkrHitValsTool::Tkr_numGhostsOnTracks [private]
 

Definition at line 56 of file TkrHitValsTool.cxx.

Referenced by calculate(), and initialize().

int TkrHitValsTool::Tkr_numHitsOnTracks [private]
 

Definition at line 53 of file TkrHitValsTool.cxx.

Referenced by calculate(), and initialize().

int TkrHitValsTool::Tkr_numToT255s [private]
 

Definition at line 55 of file TkrHitValsTool.cxx.

Referenced by calculate(), and initialize().

int TkrHitValsTool::Tkr_numToT255sOnTracks [private]
 

Definition at line 57 of file TkrHitValsTool.cxx.

Referenced by calculate(), and initialize().

int TkrHitValsTool::Tkr_numWideClusters [private]
 

Definition at line 59 of file TkrHitValsTool.cxx.

Referenced by calculate(), and initialize().


The documentation for this class was generated from the following file:
Generated on Mon Dec 1 20:09:11 2008 by doxygen 1.3.3