Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

TrackAcceptance Class Reference

#include <TrackTools/TrackAcceptance.h>

Inheritance diagram for TrackAcceptance:

ITrackReconstructible List of all members.

Public Types

typedef IAssociator< MCParticle,
MCHit > 
MCHitAsct
 Typedefs.
typedef IAssociator< MCParticle,
MCVeloHit > 
MCVeloHitAsct

Public Member Functions

 TrackAcceptance (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor.
virtual ~TrackAcceptance ()
 destructor
virtual StatusCode initialize ()
 Tool initialization.
virtual bool hasVelo (MCParticle *mcPart)
virtual bool hasTT (MCParticle *mcPart)
virtual bool hasSeed (MCParticle *mcPart)
virtual bool hasVeloAndSeed (MCParticle *mcPart)

Private Attributes

DeVelo * m_velo
 Velo Detector information.
STDetectionStation * m_TT1Station
 Pointer to TT Station 1.
STDetectionStation * m_TT2Station
 Pointer to TT Station 2.
STDetectionStation * m_IT1Station
 Pointer to IT Station 1.
STDetectionStation * m_IT2Station
 Pointer to IT Station 2.
STDetectionStation * m_IT3Station
 Pointer to IT Station 3.
DeOTStation * m_OT1Station
 Pointer to OT Station 1.
DeOTStation * m_OT2Station
 Pointer to OT Station 2.
DeOTStation * m_OT3Station
 Pointer to OT Station 3.
MCVeloHitAsctm_p2VeloHitAsct
 Pointer to MCParticle 2 VeloMCHit Asct.
MCHitAsctm_p2ITHitAsct
 Pointer to MCParticle 2 IT MCHit Asct.
MCHitAsctm_p2OTHitAsct
 Pointer to MCParticle 2 OT MCHit Asct.
std::string m_p2VeloHitAsctName
 name of the MCParticle 2 VeloMCHit Asct.
std::string m_p2ITHitAsctName
 name of the MCParticle 2 IT MCHit Asct.
std::string m_p2OTHitAsctName
 name of the MCParticle 2 OT MCHit Asct.
int m_minNVeloRHits
 Minimum number of r velo hits.
int m_minNVeloPhiHits
 Minimum number of phi velo hits.
int m_minNTTHits
 Minimum number of TT hits.
int m_minNT1Hits
 Minimum number of T1 hits.
int m_minNT2Hits
 Minimum number of T2 hits.
int m_minNT3Hits
 Minimum number of T3 hits.

Detailed Description

TrackAcceptance is a ITrackReconstructible tool. It can be used to ask whether a MCParticle is in the tracking-acceptance. An MCParticle is in the acceptance when it has left more than a certain amount of MCHits in a part of the tracking system. These cuts can be set with job-options. The default cuts are:

Author:
Jeroen van Tilburg
Date:
2003-07-04

Definition at line 43 of file TrackAcceptance.h.


Member Typedef Documentation

typedef IAssociator<MCParticle, MCHit> TrackAcceptance::MCHitAsct
 

Typedefs.

Definition at line 47 of file TrackAcceptance.h.

typedef IAssociator<MCParticle, MCVeloHit> TrackAcceptance::MCVeloHitAsct
 

Definition at line 48 of file TrackAcceptance.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 32 of file TrackAcceptance.cpp.

References m_minNT1Hits, m_minNT2Hits, m_minNT3Hits, m_minNTTHits, m_minNVeloPhiHits, m_minNVeloRHits, m_p2ITHitAsctName, m_p2OTHitAsctName, and m_p2VeloHitAsctName.

00035   : GaudiTool( type, name, parent )
00036   , m_velo(0)
00037   , m_TT1Station(0)
00038   , m_TT2Station(0)
00039   , m_IT1Station(0)
00040   , m_IT2Station(0)
00041   , m_IT3Station(0)
00042   , m_OT1Station(0)
00043   , m_OT2Station(0)
00044   , m_OT3Station(0)
00045   , m_p2VeloHitAsct(0)
00046   , m_p2ITHitAsct(0)
00047   , m_p2OTHitAsct(0)
00048 {  
00049   // interfaces
00050   declareInterface<ITrackReconstructible>(this);
00051 
00052   // declare properties
00053   declareProperty( "MCP2VeloMCHitAscName",
00054                    m_p2VeloHitAsctName = "MCP2VeloMCHitAsc");
00055   declareProperty( "MCP2ITMCHitAscName", m_p2ITHitAsctName = "MCP2ITMCHitAsc");
00056   declareProperty( "MCP2OTMCHitAscName", m_p2OTHitAsctName = "MCP2OTMCHitAsc");
00057   declareProperty( "minNVeloRHits", m_minNVeloRHits = 3);
00058   declareProperty( "minNVeloPhiHits", m_minNVeloPhiHits = 3);
00059   declareProperty( "minNTTHits", m_minNTTHits = 1);
00060   declareProperty( "minNT1Hits", m_minNT1Hits = 1);
00061   declareProperty( "minNT2Hits", m_minNT2Hits = 1);
00062   declareProperty( "minNT3Hits", m_minNT3Hits = 1);
00063 }

TrackAcceptance::~TrackAcceptance  )  [virtual]
 

destructor

Definition at line 68 of file TrackAcceptance.cpp.

00068 {};


Member Function Documentation

bool TrackAcceptance::hasSeed MCParticle *  mcPart  )  [virtual]
 

This method checks if the MCParticle is in the T-station acceptance.

Returns:
bool is true if MCParticle is in acceptance
Parameters:
mcPart pointer to the MCParticle

Implements ITrackReconstructible.

Definition at line 206 of file TrackAcceptance.cpp.

References m_IT1Station, m_IT2Station, m_IT3Station, m_minNT1Hits, m_minNT2Hits, m_minNT3Hits, m_OT1Station, m_OT2Station, m_OT3Station, m_p2ITHitAsct, and m_p2OTHitAsct.

Referenced by hasVeloAndSeed().

00207 {  
00208   int nOT1Hits = 0;
00209   int nOT2Hits = 0;
00210   int nOT3Hits = 0;
00211   int nIT1Hits = 0;
00212   int nIT2Hits = 0;
00213   int nIT3Hits = 0;
00214 
00215   // loop over associated OT MCHit s and count # hits
00216   MCHitAsct::ToRange mcOTHitsRange = m_p2OTHitAsct->rangeFrom(mcPart);
00217   MCHitAsct::ToIterator ot;
00218   for ( ot = mcOTHitsRange.begin(); ot != mcOTHitsRange.end(); ++ot) { 
00219     // retrieve MCHit
00220     MCHit* mcHit = ot -> to();
00221     if (!mcHit) {
00222       error() << "Failed retrieving OT MCHit " << endreq;
00223     }
00224     else {
00225       // calculate center point
00226       HepPoint3D midPoint = (mcHit->entry() + mcHit->exit())/2.0;
00227     
00228       // OT1 MCHit?
00229       if ( m_OT1Station -> isInside( midPoint ) ) {
00230         ++nOT1Hits;
00231       }
00232     
00233       // OT2 MCHit?
00234       if ( m_OT2Station -> isInside( midPoint ) ) {
00235         ++nOT2Hits;
00236       }
00237     
00238       // OT3 MCHit?
00239       if ( m_OT3Station -> isInside( midPoint ) ) {
00240         ++nOT3Hits;
00241       }
00242     }
00243   }
00244 
00245   // loop over associated IT MCHit s and count # hits in T1-T3
00246   MCHitAsct::ToRange mcITHitsRange = m_p2ITHitAsct->rangeFrom(mcPart);
00247   MCHitAsct::ToIterator it;
00248   for ( it = mcITHitsRange.begin(); it != mcITHitsRange.end(); ++it) { 
00249     // retrieve MCHit
00250     MCHit* mcHit = it->to();
00251     if (!mcHit) {
00252       error() << "Failed retrieving IT MCHit " << endreq;
00253     }
00254     else {
00255       // calculate center point
00256       HepPoint3D midPoint = (mcHit->entry() + mcHit->exit())/2.0;
00257 
00258       // IT1 MCHit?
00259       if ( m_IT1Station->isInside(midPoint.z()) ) {
00260         ++nIT1Hits;
00261       }
00262     
00263       // IT2 MCHit?
00264       if ( m_IT2Station->isInside(midPoint.z()) ) {
00265         ++nIT2Hits;
00266       }
00267     
00268       // IT3 MCHit?
00269       if ( m_IT3Station->isInside(midPoint.z()) ) {
00270         ++nIT3Hits;
00271       }
00272     }
00273   }
00274 
00275   // judge if MCParticle satisfies SEED track acceptance criteria
00276   bool isSeedTrack = false;
00277   if (((nOT1Hits + nIT1Hits) >= m_minNT1Hits) &&
00278       ((nOT2Hits + nIT2Hits) >= m_minNT2Hits) &&
00279       ((nOT3Hits + nIT3Hits) >= m_minNT3Hits)) {
00280     isSeedTrack = true;
00281   }
00282   return isSeedTrack;
00283 }

bool TrackAcceptance::hasTT MCParticle *  mcPart  )  [virtual]
 

This method checks if the MCParticle is in the TT acceptance.

Returns:
bool is true if MCParticle is in acceptance
Parameters:
mcPart pointer to the MCParticle

Implements ITrackReconstructible.

Definition at line 168 of file TrackAcceptance.cpp.

References m_minNTTHits, m_p2ITHitAsct, m_TT1Station, and m_TT2Station.

00169 {  
00170   int nTTHits = 0;
00171 
00172   // loop over associated IT MCHits and count # TT hits
00173   MCHitAsct::ToRange mcITHitsRange = m_p2ITHitAsct->rangeFrom(mcPart);
00174   MCHitAsct::ToIterator it;
00175   for ( it = mcITHitsRange.begin(); it != mcITHitsRange.end(); ++it) { 
00176     // retrieve MCHit
00177     MCHit* mcHit = it -> to();
00178     if ( !mcHit ) {
00179       error() << "Failed retrieving TT MCHit" << endmsg;
00180     }
00181     else {
00182       // calculate center point
00183       HepPoint3D midPoint = (mcHit->entry() + mcHit->exit())/2.0;
00184 
00185       // TT1 MCHit?
00186       if ( m_TT1Station -> isInside( midPoint.z() ) ) {
00187         ++nTTHits;
00188       }
00189       // TT2 MCHit?
00190       if ( m_TT2Station -> isInside( midPoint.z() ) ) {
00191         ++nTTHits;
00192       }
00193     }
00194   }
00195   // judge if MCParticle satisfies TT1 track acceptance criteria
00196   bool isTTTrack = false;
00197   if (nTTHits >= m_minNTTHits) {
00198     isTTTrack = true;
00199   }
00200   return isTTTrack;
00201 }

bool TrackAcceptance::hasVelo MCParticle *  mcPart  )  [virtual]
 

This method checks if the MCParticle is in the Velo acceptance.

Returns:
bool is true if MCParticle is in acceptance
Parameters:
mcPart pointer to the MCParticle

Implements ITrackReconstructible.

Definition at line 129 of file TrackAcceptance.cpp.

References m_minNVeloPhiHits, m_minNVeloRHits, m_p2VeloHitAsct, and m_velo.

00130 {
00131   int nVeloRHits   = 0;
00132   int nVeloPhiHits = 0;
00133   
00134   // loop over associated Velo MCHits and count # hits
00135   MCVeloHitAsct::ToRange mcVeloHitsRange = m_p2VeloHitAsct->rangeFrom(mcPart);
00136   MCVeloHitAsct::ToIterator it;
00137   for ( it = mcVeloHitsRange.begin(); it != mcVeloHitsRange.end(); ++it) { 
00138     // retrieve MCHit
00139     MCVeloHit* mcVeloHit = it->to();
00140     if ( !mcVeloHit ) {
00141       error() << "Failed retrieving Velo MCHit." << endreq;
00142     }
00143     else {
00144       // R or Phi sensor?
00145       // calculate center point
00146       HepPoint3D midPoint = (mcVeloHit->entry() + mcVeloHit->exit())/2.0;
00147       int staNr = m_velo -> sensorNumber( midPoint );   
00148       if ( m_velo -> isRSensor( staNr ) ) {
00149         ++nVeloRHits;
00150       }
00151       else {
00152         ++nVeloPhiHits;
00153       }
00154     }
00155   }
00156 
00157   // judge if MCParticle satisfies VELO track acceptance criteria
00158   bool isVeloTrack = false;
00159   if ((nVeloRHits >= m_minNVeloRHits) && (nVeloPhiHits >= m_minNVeloPhiHits)) {
00160     isVeloTrack = true;
00161   }
00162   return isVeloTrack;
00163 }

bool TrackAcceptance::hasVeloAndSeed MCParticle *  mcPart  )  [virtual]
 

This method checks if the MCParticle is in the long track acceptance.

Returns:
bool is true if MCParticle is in acceptance
Parameters:
mcPart pointer to the MCParticle

Implements ITrackReconstructible.

Definition at line 288 of file TrackAcceptance.cpp.

References hasSeed().

00289 {  
00290   return ( this->hasVelo(mcPart) && this->hasSeed(mcPart) );
00291 }

StatusCode TrackAcceptance::initialize  )  [virtual]
 

Tool initialization.

Geometry information

Definition at line 73 of file TrackAcceptance.cpp.

References m_IT1Station, m_IT2Station, m_IT3Station, m_OT1Station, m_OT2Station, m_OT3Station, m_p2ITHitAsct, m_p2ITHitAsctName, m_p2OTHitAsct, m_p2OTHitAsctName, m_p2VeloHitAsct, m_p2VeloHitAsctName, m_TT1Station, m_TT2Station, and m_velo.

00074 {
00075   StatusCode sc;
00076 
00078   debug() << " start reading geometry ..." << endreq;
00079 
00080   DeOTDetector* otDet = getDet<DeOTDetector>( DeOTDetectorLocation::Default );
00081 
00082   DeSTDetector* stDet = getDet<DeSTDetector>( DeSTDetectorLocation::Default );
00083 
00084   m_velo = getDet<DeVelo>( "/dd/Structure/LHCb/Velo" );
00085 
00086   // get pointers to the stations
00087   m_TT1Station = stDet -> station( 1 );
00088   m_TT2Station = stDet -> station( 2 );
00089   m_IT1Station = stDet -> station( 3 );
00090   m_IT2Station = stDet -> station( 4 );
00091   m_IT3Station = stDet -> station( 5 );
00092   m_OT1Station = otDet -> station( 1 );
00093   m_OT2Station = otDet -> station( 2 );
00094   m_OT3Station = otDet -> station( 3 );
00095 
00096   // Retrieve MCParticle 2 Velo MCHit associator
00097   std::string ascVeloType = "Associator<MCParticle,MCVeloHit>";
00098   sc = toolSvc()->retrieveTool(ascVeloType, 
00099                                m_p2VeloHitAsctName, m_p2VeloHitAsct);
00100   if ( sc.isFailure() ) { 
00101     error() << "Unable to retrieve Velo MCHit Associator " 
00102             << m_p2VeloHitAsctName << endreq;
00103     return sc;
00104   }
00105 
00106   // Retrieve MCParticle 2 OT MCHit associator
00107   std::string ascType = "Associator<MCParticle,MCHit>";
00108   sc = toolSvc()->retrieveTool(ascType, m_p2OTHitAsctName, m_p2OTHitAsct);
00109   if ( sc.isFailure() ) { 
00110     error() << "Unable to retrieve OT MCHit Associator " 
00111             << m_p2OTHitAsctName << endreq;
00112     return sc;
00113   }
00114 
00115   // Retrieve MCParticle 2 IT MCHit associator
00116   sc = toolSvc()->retrieveTool(ascType, m_p2ITHitAsctName, m_p2ITHitAsct);
00117   if ( sc.isFailure() ) { 
00118     error() << "Unable to retrieve IT MCHit Associator " 
00119             << m_p2ITHitAsctName << endreq;
00120     return sc;
00121   }
00122 
00123   return StatusCode::SUCCESS;
00124 }


Member Data Documentation

STDetectionStation* TrackAcceptance::m_IT1Station [private]
 

Pointer to IT Station 1.

Definition at line 93 of file TrackAcceptance.h.

Referenced by hasSeed(), and initialize().

STDetectionStation* TrackAcceptance::m_IT2Station [private]
 

Pointer to IT Station 2.

Definition at line 94 of file TrackAcceptance.h.

Referenced by hasSeed(), and initialize().

STDetectionStation* TrackAcceptance::m_IT3Station [private]
 

Pointer to IT Station 3.

Definition at line 95 of file TrackAcceptance.h.

Referenced by hasSeed(), and initialize().

int TrackAcceptance::m_minNT1Hits [private]
 

Minimum number of T1 hits.

Definition at line 114 of file TrackAcceptance.h.

Referenced by hasSeed(), and TrackAcceptance().

int TrackAcceptance::m_minNT2Hits [private]
 

Minimum number of T2 hits.

Definition at line 115 of file TrackAcceptance.h.

Referenced by hasSeed(), and TrackAcceptance().

int TrackAcceptance::m_minNT3Hits [private]
 

Minimum number of T3 hits.

Definition at line 116 of file TrackAcceptance.h.

Referenced by hasSeed(), and TrackAcceptance().

int TrackAcceptance::m_minNTTHits [private]
 

Minimum number of TT hits.

Definition at line 113 of file TrackAcceptance.h.

Referenced by hasTT(), and TrackAcceptance().

int TrackAcceptance::m_minNVeloPhiHits [private]
 

Minimum number of phi velo hits.

Definition at line 112 of file TrackAcceptance.h.

Referenced by hasVelo(), and TrackAcceptance().

int TrackAcceptance::m_minNVeloRHits [private]
 

Minimum number of r velo hits.

Definition at line 111 of file TrackAcceptance.h.

Referenced by hasVelo(), and TrackAcceptance().

DeOTStation* TrackAcceptance::m_OT1Station [private]
 

Pointer to OT Station 1.

Definition at line 98 of file TrackAcceptance.h.

Referenced by hasSeed(), and initialize().

DeOTStation* TrackAcceptance::m_OT2Station [private]
 

Pointer to OT Station 2.

Definition at line 99 of file TrackAcceptance.h.

Referenced by hasSeed(), and initialize().

DeOTStation* TrackAcceptance::m_OT3Station [private]
 

Pointer to OT Station 3.

Definition at line 100 of file TrackAcceptance.h.

Referenced by hasSeed(), and initialize().

MCHitAsct* TrackAcceptance::m_p2ITHitAsct [private]
 

Pointer to MCParticle 2 IT MCHit Asct.

Definition at line 104 of file TrackAcceptance.h.

Referenced by hasSeed(), hasTT(), and initialize().

std::string TrackAcceptance::m_p2ITHitAsctName [private]
 

name of the MCParticle 2 IT MCHit Asct.

Definition at line 109 of file TrackAcceptance.h.

Referenced by initialize(), and TrackAcceptance().

MCHitAsct* TrackAcceptance::m_p2OTHitAsct [private]
 

Pointer to MCParticle 2 OT MCHit Asct.

Definition at line 105 of file TrackAcceptance.h.

Referenced by hasSeed(), and initialize().

std::string TrackAcceptance::m_p2OTHitAsctName [private]
 

name of the MCParticle 2 OT MCHit Asct.

Definition at line 110 of file TrackAcceptance.h.

Referenced by initialize(), and TrackAcceptance().

MCVeloHitAsct* TrackAcceptance::m_p2VeloHitAsct [private]
 

Pointer to MCParticle 2 VeloMCHit Asct.

Definition at line 103 of file TrackAcceptance.h.

Referenced by hasVelo(), and initialize().

std::string TrackAcceptance::m_p2VeloHitAsctName [private]
 

name of the MCParticle 2 VeloMCHit Asct.

Definition at line 108 of file TrackAcceptance.h.

Referenced by initialize(), and TrackAcceptance().

STDetectionStation* TrackAcceptance::m_TT1Station [private]
 

Pointer to TT Station 1.

Definition at line 91 of file TrackAcceptance.h.

Referenced by hasTT(), and initialize().

STDetectionStation* TrackAcceptance::m_TT2Station [private]
 

Pointer to TT Station 2.

Definition at line 92 of file TrackAcceptance.h.

Referenced by hasTT(), and initialize().

DeVelo* TrackAcceptance::m_velo [private]
 

Velo Detector information.

Definition at line 88 of file TrackAcceptance.h.

Referenced by hasVelo(), and initialize().


The documentation for this class was generated from the following files:
Generated on Wed May 4 11:52:40 2005 for New Track Event Model by doxygen 1.4.1