#include <Track2TrFitTrackCnv.h>
Public Member Functions | |
Track2TrFitTrackCnv (const std::string &name, ISvcLocator *pSvcLocator) | |
Standard constructor. | |
virtual | ~Track2TrFitTrackCnv () |
Destructor. | |
virtual StatusCode | initialize () |
Algorithm initialization. | |
virtual StatusCode | execute () |
Algorithm execution. | |
virtual StatusCode | finalize () |
Algorithm finalization. | |
Private Attributes | |
std::string | m_inputTrackName |
Path of the input ("Track") tracks. | |
std::string | m_outputTrackName |
Path of the output ("TrFitTrack") tracks. | |
DeVelo * | m_veloDet |
Pointer to the Velo detector element. | |
DeSTDetector * | m_itTrackerDet |
Pointer to the ST detector element. | |
DeOTDetector * | m_otTrackerDet |
Pointer to the OT detector element. |
Definition at line 21 of file Track2TrFitTrackCnv.h.
|
Standard constructor.
Definition at line 36 of file Track2TrFitTrackCnv.cpp. References m_inputTrackName, and m_outputTrackName. 00038 : GaudiAlgorithm ( name , pSvcLocator ) 00039 , m_inputTrackName ( TrackLocation::Default ) 00040 , m_outputTrackName ( TrFitTrackLocation::Default ) 00041 , m_veloDet(0) 00042 , m_itTrackerDet(0) 00043 , m_otTrackerDet(0) 00044 { 00045 declareProperty( "InputTracks", m_inputTrackName ); 00046 declareProperty( "OutputTracks", m_outputTrackName ); 00047 }
|
|
Destructor.
Definition at line 52 of file Track2TrFitTrackCnv.cpp. 00052 {};
|
|
Algorithm execution.
Definition at line 82 of file Track2TrFitTrackCnv.cpp. References State::checkType(), State::covariance(), str::lhcbIDs(), m_inputTrackName, m_itTrackerDet, m_otTrackerDet, m_outputTrackName, m_veloDet, State::qOverP(), State::state(), State::tx(), State::ty(), State::x(), State::y(), and State::z(). 00082 { 00083 00084 debug() << "==> Execute" << endreq; 00085 00086 // retrieve the Tracks container 00087 Tracks* inTra = get<Tracks>( m_inputTrackName ); 00088 debug() << "- # Tracks = " << inTra -> size() << endreq; 00089 00090 // create and register the TrFitTracks container 00091 TrFitTracks* outTra = new TrFitTracks(); 00092 StatusCode sc = put( outTra, m_outputTrackName ); 00093 00094 Tracks::const_iterator itSto; 00095 std::vector<LHCbID>::const_iterator itID; 00096 00097 TrFitTrack* trFit; 00098 00099 debug() << "Processing Tracks ... " << endreq; 00100 00101 for ( itSto = inTra->begin(); inTra->end() != itSto ; ++itSto) { 00102 // create the TrFitTrack 00103 trFit = new TrFitTrack(); 00104 outTra -> insert( trFit, (*itSto)->key() ); // Same key, for associators 00105 00106 // debugging Track ... 00107 debug() 00108 << "- Track with key # " << (*itSto) -> key() << endreq 00109 << " * charge = " << (*itSto) -> charge() << endreq 00110 << " * is Valid = " << (*itSto) -> checkFlag( Track::Valid ) << endreq 00111 << " * is Unique = " << (*itSto) -> checkFlag( Track::Unique ) << endreq 00112 << " * is Long = " << (*itSto) -> checkType( Track::Long ) << endreq 00113 << " * is Upstream = " << (*itSto) -> checkType( Track::Upstream ) << endreq 00114 << " * is Downstream = " << (*itSto) -> checkType( Track::Downstream ) << endreq 00115 << " * is Velo = " << (*itSto) -> checkType( Track::Velo ) << endreq 00116 << " * is Backward = " << (*itSto) -> checkType( Track::Backward ) << endreq 00117 << " * is Ttrack = " << (*itSto) -> checkType( Track::Ttrack ) << endreq 00118 << " * # LHCbIDs = " << (*itSto) -> lhcbIDs().size() << endreq; 00119 00120 // set the properties of TrFitTrack 00121 trFit -> setCharge( (*itSto)->charge() ); 00122 trFit -> setErrorFlag( (bool) !((*itSto)->checkFlag(Track::Valid)) ); 00123 trFit -> setUnique( (bool) ((*itSto)->checkFlag(Track::Unique)) ); 00124 00125 if ( (*itSto)->checkType( Track::Long ) ) trFit -> setForward(true); // could also be match! 00126 else if ( (*itSto)->checkType( Track::Upstream ) ) trFit -> setVeloTT( true ); 00127 else if ( (*itSto)->checkType( Track::Downstream ) ) trFit -> setFollow( true ); // could also be ksTrack 00128 else if ( (*itSto)->checkType( Track::Velo ) ) trFit -> setVelo( true ); 00129 else if ( (*itSto)->checkType( Track::Backward ) ) trFit -> setVeloBack( true ); 00130 else if ( (*itSto)->checkType( Track::Ttrack ) ) trFit -> setSeed( true); 00131 00132 // look at the "physics state" 00133 State& pstate = (*itSto) -> physicsState(); 00134 if ( pstate.checkType( State::HasMomentum ) ) { 00135 TrStateP* trStaP = new TrStateP( pstate.z(), pstate.state(), pstate.covariance() ); 00136 // put the created TrStateP in TrFitTrack 00137 trFit -> addState( trStaP ); 00138 debug() << " -> stored physics state at z = " << pstate.z() << " as TrStateP" << endreq 00139 << " - (x,y,z) = (" << pstate.x() << ", " 00140 << pstate.y() << ", " 00141 << pstate.z() << ")" << endreq 00142 << " - tx, ty, Q/P = " << pstate.tx() << ", " 00143 << pstate.ty() << ", " 00144 << pstate.qOverP() << endreq; 00145 } 00146 else { 00147 verbose() << " -> no physics state stored!" << endreq; 00148 } 00149 00150 // loop over the LHCbIDs 00151 const std::vector<LHCbID> trStoID = (*itSto) -> lhcbIDs(); 00152 for ( itID = trStoID.begin(); itID != trStoID.end(); ++itID) { 00153 // continue according to type ... 00154 if ( (*itID).isOT() ) { 00155 OTChannelID otChID = (*itID).otID(); 00156 OTTimes* otTimes = get<OTTimes>( OTTimeLocation::Default ); 00157 OTTimes::const_iterator itOTTime; 00158 for ( itOTTime=otTimes->begin() ; otTimes->end()!= itOTTime ; ++itOTTime ) { 00159 if ( otChID == (*itOTTime)->channel() ) { 00160 // create OTClusterOnTrack 00161 int driftAmbiguity = 0; 00162 //driftAmbiguity stored in the LHCbID in the 00163 // spareBits: 11 / 10 for ambiguity = +1 / -1 00164 if ( (*itID).spareBits() == 2 ) { driftAmbiguity = -1; } 00165 else if ( (*itID).spareBits() == 3 ) { driftAmbiguity = 1; } 00166 OTClusterOnTrack* otCluOnT = 00167 new OTClusterOnTrack( (*itOTTime), driftAmbiguity, m_otTrackerDet ); 00168 // add OTClusterOnTrack to the TrFitTrack 00169 trFit -> addMeasurement( otCluOnT ); 00170 debug() << " * LHCbID = " << (*itID).lhcbID() 00171 << " (detectorType / spareBits = " 00172 << (*itID).detectorType() << " / " 00173 << (*itID).spareBits() << ")" << endreq 00174 << " -> stored OTClusterOnTrack at z = " 00175 << otCluOnT -> z() 00176 << " , channelID = " 00177 << (*itOTTime) -> channel().channelID() 00178 << " , ambiguity = " << otCluOnT -> ambiguity() << endreq; 00179 } 00180 } 00181 } 00182 else if ( (*itID).isST() ) { 00183 ITChannelID itChID = (*itID).stID(); 00184 ITClusters* itClus = get<ITClusters>( ITClusterLocation::Default ); 00185 ITClusters::const_iterator itITClu; 00186 for ( itITClu=itClus->begin() ; itClus->end()!= itITClu ; ++itITClu ) { 00187 if ( itChID == (*itITClu)->channelID() ) { 00188 // create ITClusterOnTrack 00189 ITClusterOnTrack* itCluOnT = 00190 new ITClusterOnTrack( (*itITClu), m_itTrackerDet ); 00191 // add ITClusterOnTrack to the TrFitTrack 00192 trFit -> addMeasurement( itCluOnT ); 00193 debug() << " * LHCbID = " << (*itID).lhcbID() 00194 << " (detectorType / spareBits = " 00195 << (*itID).detectorType() << " / " 00196 << (*itID).spareBits() << ")" << endreq 00197 << " -> stored ITClusterOnTrack at z = " 00198 << itCluOnT -> z() 00199 << " , channelID = " 00200 << (*itITClu) -> channelID().channelID() << endreq; 00201 } 00202 } 00203 } 00204 else if ( (*itID).isVelo() ) { 00205 VeloChannelID veloChID = (*itID).veloID(); 00206 VeloClusters* veloClus = get<VeloClusters>( VeloClusterLocation::Default ); 00207 VeloClusters::const_iterator itVeloClu; 00208 for ( itVeloClu=veloClus->begin() ; veloClus->end()!= itVeloClu ; ++itVeloClu ) { 00209 if ( veloChID.channelID() == (*itVeloClu)->channelID(0).channelID() ) { 00210 debug() << " -> VeloChannelID of type R/Phi = " 00211 << m_veloDet->isRSensor( (*itVeloClu)->sensor() ) << "/" 00212 << m_veloDet->isPhiSensor( (*itVeloClu)->sensor() ) << endreq 00213 << "sensor # from velocluster = " 00214 << (*itVeloClu)->sensor() << endreq 00215 << "VChID, sensor, veloChannelID.type = " 00216 << veloChID<< " , " << veloChID.sensor() << " , " 00217 << veloChID.type() << endreq; 00218 //if ( veloChID.isRType() ) { 00219 if ( m_veloDet->isRSensor( (*itVeloClu)->sensor() ) ) { 00220 debug() 00221 << " -> stored as type R(sensorType=1), VChID, veloChannelID.type = " 00222 << veloChID << " , " << veloChID.type() << endreq; 00223 // create VeloRClusterOnTrack 00224 VeloRClusterOnTrack* veloRCluOnT = 00225 new VeloRClusterOnTrack( (*itVeloClu), m_veloDet ); 00226 // add VeloRClusterOnTrack to the TrFitTrack 00227 trFit -> addMeasurement( veloRCluOnT ); 00228 } 00229 else { 00230 debug() 00231 << " -> stored as type Phi(sensorType=2), veloChannelID.type = " 00232 << veloChID.type() << endreq; 00233 // create VeloPhiClusterOnTrack 00234 VeloPhiClusterOnTrack* veloPhiCluOnT = 00235 new VeloPhiClusterOnTrack( (*itVeloClu), m_veloDet ); 00236 // add VeloPhiClusterOnTrack to the TrFitTrack 00237 trFit -> addMeasurement( veloPhiCluOnT ); 00238 } 00239 } 00240 } 00241 } 00242 } 00243 // debugging TrFitTrack ... 00244 debug() 00245 << " -> TrFitTrack stored with key # " << trFit -> key() << endreq 00246 << " * # states = " << trFit -> nStates() << endreq 00247 << " * # measurements = " << trFit -> nMeasurements() << endreq 00248 << " - # IT = " 00249 << trFit -> nMeasurements( TrMeasurement::kITClusterOnTrack ) << endreq 00250 << " - # OT = " 00251 << trFit -> nMeasurements( TrMeasurement::kOTClusterOnTrack ) << endreq 00252 << " - # VeloR = " 00253 << trFit -> nMeasurements( TrMeasurement::kVeloRClusterOnTrack ) << endreq 00254 << " - # VeloPhi = " 00255 << trFit -> nMeasurements( TrMeasurement::kVeloPhiClusterOnTrack ) << endreq 00256 << " * charge = " << trFit -> charge() << endreq 00257 << " * error flag = " << trFit -> errorFlag() << endreq 00258 << " * is Unique = " << trFit -> unique() << endreq 00259 << " * is Long = " << trFit -> isLong() << endreq 00260 << " * is Upstream = " << trFit -> isUpstream() << endreq 00261 << " * is Downstream = " << trFit -> isDownstream() << endreq 00262 << " * is Velotrack = " << trFit -> isVelotrack() << endreq 00263 << " * is Backward = " << trFit -> isBackward() << endreq 00264 << " * is Ttrack = " << trFit -> isTtrack() << endreq 00265 << " * velo = " << trFit -> velo() << endreq 00266 << " * seed = " << trFit -> seed() << endreq 00267 << " * match = " << trFit -> match() << endreq 00268 << " * forward = " << trFit -> forward() << endreq 00269 << " * follow = " << trFit -> follow() << endreq 00270 << " * veloTT = " << trFit -> veloTT() << endreq 00271 << " * veloBack = " << trFit -> veloBack() << endreq 00272 << " * ksTrack = " << trFit -> ksTrack() << endreq; 00273 } 00274 // summary of stored information 00275 //debug() << "-> stored " << outTra -> size() << " TrFitTracks " << endreq; 00276 00277 return StatusCode::SUCCESS; 00278 }
|
|
Algorithm finalization.
Definition at line 283 of file Track2TrFitTrackCnv.cpp. 00284 { 00285 debug() << "==> Finalize" << endreq; 00286 00287 //if( m_associator ) toolSvc()->releaseTool( m_associator ); 00288 00289 // Force the finalization of the base class 00290 //----------------------------------------- 00291 return GaudiAlgorithm::finalize(); 00292 }
|
|
Algorithm initialization.
Definition at line 57 of file Track2TrFitTrackCnv.cpp. References m_itTrackerDet, m_otTrackerDet, and m_veloDet. 00058 { 00059 // Force the initialization of the base class 00060 //------------------------------------------- 00061 StatusCode sc = GaudiAlgorithm::initialize() ; 00062 if ( sc.isFailure() ) 00063 return Error( "Base class \"GaudiAlgorithm\" was not initialized properly!" ); 00064 00065 debug() << "==> Initialize" << endreq; 00066 00067 // Retrieve the Velo Geometry 00068 m_veloDet = getDet<DeVelo>( "/dd/Structure/LHCb/Velo" ); 00069 00070 // Retrieve the ST Geometry 00071 m_itTrackerDet = getDet<DeSTDetector>( DeSTDetectorLocation::Default ); 00072 00073 // Retrieve the OT Geometry 00074 m_otTrackerDet = getDet<DeOTDetector>( "/dd/Structure/LHCb/OT" ); 00075 00076 return StatusCode::SUCCESS; 00077 }
|
|
Path of the input ("Track") tracks.
Definition at line 37 of file Track2TrFitTrackCnv.h. Referenced by execute(), and Track2TrFitTrackCnv(). |
|
Pointer to the ST detector element.
Definition at line 42 of file Track2TrFitTrackCnv.h. Referenced by execute(), and initialize(). |
|
Pointer to the OT detector element.
Definition at line 43 of file Track2TrFitTrackCnv.h. Referenced by execute(), and initialize(). |
|
Path of the output ("TrFitTrack") tracks.
Definition at line 38 of file Track2TrFitTrackCnv.h. Referenced by execute(), and Track2TrFitTrackCnv(). |
|
Pointer to the Velo detector element.
Definition at line 41 of file Track2TrFitTrackCnv.h. Referenced by execute(), and initialize(). |