#include <TrackMCTools/TrackAcceptance.h>
Inheritance diagram for TrackAcceptance:
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. | |
MCVeloHitAsct * | m_p2VeloHitAsct |
Pointer to MCParticle 2 VeloMCHit Asct. | |
MCHitAsct * | m_p2ITHitAsct |
Pointer to MCParticle 2 IT MCHit Asct. | |
MCHitAsct * | m_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. |
Definition at line 43 of file TrackAcceptance.h.
|
Typedefs.
Definition at line 47 of file TrackAcceptance.h. |
|
Definition at line 48 of file TrackAcceptance.h. |
|
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 }
|
|
destructor
Definition at line 68 of file TrackAcceptance.cpp. 00068 {};
|
|
This method checks if the MCParticle is in the T-station acceptance.
Implements ITrackReconstructible. Definition at line 207 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(). 00208 { 00209 int nOT1Hits = 0; 00210 int nOT2Hits = 0; 00211 int nOT3Hits = 0; 00212 int nIT1Hits = 0; 00213 int nIT2Hits = 0; 00214 int nIT3Hits = 0; 00215 00216 // loop over associated OT MCHit s and count # hits 00217 MCHitAsct::ToRange mcOTHitsRange = m_p2OTHitAsct->rangeFrom(mcPart); 00218 MCHitAsct::ToIterator ot; 00219 for ( ot = mcOTHitsRange.begin(); ot != mcOTHitsRange.end(); ++ot) { 00220 // retrieve MCHit 00221 MCHit* mcHit = ot -> to(); 00222 if (!mcHit) { 00223 error() << "Failed retrieving OT MCHit " << endreq; 00224 } 00225 else { 00226 // calculate center point 00227 HepPoint3D midPoint = (mcHit->entry() + mcHit->exit())/2.0; 00228 00229 // OT1 MCHit? 00230 if ( m_OT1Station -> isInside( midPoint ) ) { 00231 ++nOT1Hits; 00232 } 00233 00234 // OT2 MCHit? 00235 if ( m_OT2Station -> isInside( midPoint ) ) { 00236 ++nOT2Hits; 00237 } 00238 00239 // OT3 MCHit? 00240 if ( m_OT3Station -> isInside( midPoint ) ) { 00241 ++nOT3Hits; 00242 } 00243 } 00244 } 00245 00246 // loop over associated IT MCHit s and count # hits in T1-T3 00247 MCHitAsct::ToRange mcITHitsRange = m_p2ITHitAsct->rangeFrom(mcPart); 00248 MCHitAsct::ToIterator it; 00249 for ( it = mcITHitsRange.begin(); it != mcITHitsRange.end(); ++it) { 00250 // retrieve MCHit 00251 MCHit* mcHit = it->to(); 00252 if (!mcHit) { 00253 error() << "Failed retrieving IT MCHit " << endreq; 00254 } 00255 else { 00256 // calculate center point 00257 HepPoint3D midPoint = (mcHit->entry() + mcHit->exit())/2.0; 00258 00259 // IT1 MCHit? 00260 if ( m_IT1Station->isInside(midPoint.z()) ) { 00261 ++nIT1Hits; 00262 } 00263 00264 // IT2 MCHit? 00265 if ( m_IT2Station->isInside(midPoint.z()) ) { 00266 ++nIT2Hits; 00267 } 00268 00269 // IT3 MCHit? 00270 if ( m_IT3Station->isInside(midPoint.z()) ) { 00271 ++nIT3Hits; 00272 } 00273 } 00274 } 00275 00276 // judge if MCParticle satisfies SEED track acceptance criteria 00277 bool isSeedTrack = false; 00278 if (((nOT1Hits + nIT1Hits) >= m_minNT1Hits) && 00279 ((nOT2Hits + nIT2Hits) >= m_minNT2Hits) && 00280 ((nOT3Hits + nIT3Hits) >= m_minNT3Hits)) { 00281 isSeedTrack = true; 00282 } 00283 return isSeedTrack; 00284 }
|
|
This method checks if the MCParticle is in the TT acceptance.
Implements ITrackReconstructible. Definition at line 169 of file TrackAcceptance.cpp. References m_minNTTHits, m_p2ITHitAsct, m_TT1Station, and m_TT2Station. 00170 { 00171 int nTTHits = 0; 00172 00173 // loop over associated IT MCHits and count # TT hits 00174 MCHitAsct::ToRange mcITHitsRange = m_p2ITHitAsct->rangeFrom(mcPart); 00175 MCHitAsct::ToIterator it; 00176 for ( it = mcITHitsRange.begin(); it != mcITHitsRange.end(); ++it) { 00177 // retrieve MCHit 00178 MCHit* mcHit = it -> to(); 00179 if ( !mcHit ) { 00180 error() << "Failed retrieving TT MCHit" << endmsg; 00181 } 00182 else { 00183 // calculate center point 00184 HepPoint3D midPoint = (mcHit->entry() + mcHit->exit())/2.0; 00185 00186 // TT1 MCHit? 00187 if ( m_TT1Station -> isInside( midPoint.z() ) ) { 00188 ++nTTHits; 00189 } 00190 // TT2 MCHit? 00191 if ( m_TT2Station -> isInside( midPoint.z() ) ) { 00192 ++nTTHits; 00193 } 00194 } 00195 } 00196 // judge if MCParticle satisfies TT1 track acceptance criteria 00197 bool isTTTrack = false; 00198 if (nTTHits >= m_minNTTHits) { 00199 isTTTrack = true; 00200 } 00201 return isTTTrack; 00202 }
|
|
This method checks if the MCParticle is in the Velo acceptance.
Implements ITrackReconstructible. Definition at line 130 of file TrackAcceptance.cpp. References m_minNVeloPhiHits, m_minNVeloRHits, m_p2VeloHitAsct, and m_velo. 00131 { 00132 int nVeloRHits = 0; 00133 int nVeloPhiHits = 0; 00134 00135 // loop over associated Velo MCHits and count # hits 00136 MCVeloHitAsct::ToRange mcVeloHitsRange = m_p2VeloHitAsct->rangeFrom(mcPart); 00137 MCVeloHitAsct::ToIterator it; 00138 for ( it = mcVeloHitsRange.begin(); it != mcVeloHitsRange.end(); ++it) { 00139 // retrieve MCHit 00140 MCVeloHit* mcVeloHit = it->to(); 00141 if ( !mcVeloHit ) { 00142 error() << "Failed retrieving Velo MCHit." << endreq; 00143 } 00144 else { 00145 // R or Phi sensor? 00146 // calculate center point 00147 HepPoint3D midPoint = (mcVeloHit->entry() + mcVeloHit->exit())/2.0; 00148 int staNr = m_velo -> sensorNumber( midPoint ); 00149 if ( m_velo -> isRSensor( staNr ) ) { 00150 ++nVeloRHits; 00151 } 00152 else { 00153 ++nVeloPhiHits; 00154 } 00155 } 00156 } 00157 00158 // judge if MCParticle satisfies VELO track acceptance criteria 00159 bool isVeloTrack = false; 00160 if ((nVeloRHits >= m_minNVeloRHits) && (nVeloPhiHits >= m_minNVeloPhiHits)) { 00161 isVeloTrack = true; 00162 } 00163 return isVeloTrack; 00164 }
|
|
This method checks if the MCParticle is in the long track acceptance.
Implements ITrackReconstructible. Definition at line 289 of file TrackAcceptance.cpp. References hasSeed(). 00290 { 00291 return ( this->hasVelo(mcPart) && this->hasSeed(mcPart) ); 00292 }
|
|
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 = GaudiTool::initialize(); // must be executed first 00076 if ( sc.isFailure() ) return sc; 00077 00079 debug() << " start reading geometry ..." << endreq; 00080 00081 DeOTDetector* otDet = getDet<DeOTDetector>( DeOTDetectorLocation::Default ); 00082 00083 DeSTDetector* stDet = getDet<DeSTDetector>( DeSTDetectorLocation::Default ); 00084 00085 m_velo = getDet<DeVelo>( "/dd/Structure/LHCb/Velo" ); 00086 00087 // get pointers to the stations 00088 m_TT1Station = stDet -> station( 1 ); 00089 m_TT2Station = stDet -> station( 2 ); 00090 m_IT1Station = stDet -> station( 3 ); 00091 m_IT2Station = stDet -> station( 4 ); 00092 m_IT3Station = stDet -> station( 5 ); 00093 m_OT1Station = otDet -> station( 1 ); 00094 m_OT2Station = otDet -> station( 2 ); 00095 m_OT3Station = otDet -> station( 3 ); 00096 00097 // Retrieve MCParticle 2 Velo MCHit associator 00098 std::string ascVeloType = "Associator<MCParticle,MCVeloHit>"; 00099 sc = toolSvc()->retrieveTool(ascVeloType, 00100 m_p2VeloHitAsctName, m_p2VeloHitAsct); 00101 if ( sc.isFailure() ) { 00102 error() << "Unable to retrieve Velo MCHit Associator " 00103 << m_p2VeloHitAsctName << endreq; 00104 return sc; 00105 } 00106 00107 // Retrieve MCParticle 2 OT MCHit associator 00108 std::string ascType = "Associator<MCParticle,MCHit>"; 00109 sc = toolSvc()->retrieveTool(ascType, m_p2OTHitAsctName, m_p2OTHitAsct); 00110 if ( sc.isFailure() ) { 00111 error() << "Unable to retrieve OT MCHit Associator " 00112 << m_p2OTHitAsctName << endreq; 00113 return sc; 00114 } 00115 00116 // Retrieve MCParticle 2 IT MCHit associator 00117 sc = toolSvc()->retrieveTool(ascType, m_p2ITHitAsctName, m_p2ITHitAsct); 00118 if ( sc.isFailure() ) { 00119 error() << "Unable to retrieve IT MCHit Associator " 00120 << m_p2ITHitAsctName << endreq; 00121 return sc; 00122 } 00123 00124 return StatusCode::SUCCESS; 00125 }
|
|
Pointer to IT Station 1.
Definition at line 93 of file TrackAcceptance.h. Referenced by hasSeed(), and initialize(). |
|
Pointer to IT Station 2.
Definition at line 94 of file TrackAcceptance.h. Referenced by hasSeed(), and initialize(). |
|
Pointer to IT Station 3.
Definition at line 95 of file TrackAcceptance.h. Referenced by hasSeed(), and initialize(). |
|
Minimum number of T1 hits.
Definition at line 114 of file TrackAcceptance.h. Referenced by hasSeed(), and TrackAcceptance(). |
|
Minimum number of T2 hits.
Definition at line 115 of file TrackAcceptance.h. Referenced by hasSeed(), and TrackAcceptance(). |
|
Minimum number of T3 hits.
Definition at line 116 of file TrackAcceptance.h. Referenced by hasSeed(), and TrackAcceptance(). |
|
Minimum number of TT hits.
Definition at line 113 of file TrackAcceptance.h. Referenced by hasTT(), and TrackAcceptance(). |
|
Minimum number of phi velo hits.
Definition at line 112 of file TrackAcceptance.h. Referenced by hasVelo(), and TrackAcceptance(). |
|
Minimum number of r velo hits.
Definition at line 111 of file TrackAcceptance.h. Referenced by hasVelo(), and TrackAcceptance(). |
|
Pointer to OT Station 1.
Definition at line 98 of file TrackAcceptance.h. Referenced by hasSeed(), and initialize(). |
|
Pointer to OT Station 2.
Definition at line 99 of file TrackAcceptance.h. Referenced by hasSeed(), and initialize(). |
|
Pointer to OT Station 3.
Definition at line 100 of file TrackAcceptance.h. Referenced by hasSeed(), and initialize(). |
|
Pointer to MCParticle 2 IT MCHit Asct.
Definition at line 104 of file TrackAcceptance.h. Referenced by hasSeed(), hasTT(), and initialize(). |
|
name of the MCParticle 2 IT MCHit Asct.
Definition at line 109 of file TrackAcceptance.h. Referenced by initialize(), and TrackAcceptance(). |
|
Pointer to MCParticle 2 OT MCHit Asct.
Definition at line 105 of file TrackAcceptance.h. Referenced by hasSeed(), and initialize(). |
|
name of the MCParticle 2 OT MCHit Asct.
Definition at line 110 of file TrackAcceptance.h. Referenced by initialize(), and TrackAcceptance(). |
|
Pointer to MCParticle 2 VeloMCHit Asct.
Definition at line 103 of file TrackAcceptance.h. Referenced by hasVelo(), and initialize(). |
|
name of the MCParticle 2 VeloMCHit Asct.
Definition at line 108 of file TrackAcceptance.h. Referenced by initialize(), and TrackAcceptance(). |
|
Pointer to TT Station 1.
Definition at line 91 of file TrackAcceptance.h. Referenced by hasTT(), and initialize(). |
|
Pointer to TT Station 2.
Definition at line 92 of file TrackAcceptance.h. Referenced by hasTT(), and initialize(). |
|
Velo Detector information.
Definition at line 88 of file TrackAcceptance.h. Referenced by hasVelo(), and initialize(). |