#include <TrackNtupleMaker.h>
Collaboration diagram for Atlfast::TrackNtupleMaker:
Public Methods | |
TrackNtupleMaker (const std::string &name, ISvcLocator *pSvcLocator) | |
Constructor: A constructor of this form must be provided. | |
StatusCode | initialize () |
StatusCode | execute () |
StatusCode | finalize () |
Protected Attributes | |
NTuple::Item< long > | m_ntra |
NTuple::Array< long > | m_kpTruth |
NTuple::Array< long > | m_kfTruth |
NTuple::Array< long > | m_kpm1tra |
NTuple::Array< long > | m_kfm1tra |
NTuple::Array< long > | m_kpm2tra |
NTuple::Array< long > | m_kfm2tra |
NTuple::Array< long > | m_kpm3tra |
NTuple::Array< long > | m_kfm3tra |
NTuple::Array< long > | m_kpm4tra |
NTuple::Array< long > | m_kfm4tra |
NTuple::Array< long > | m_kpm5tra |
NTuple::Array< long > | m_kfm5tra |
NTuple::Array< long > | m_kpm6tra |
NTuple::Array< long > | m_kfm6tra |
NTuple::Array< float > | m_d0Track |
NTuple::Array< float > | m_z0Track |
NTuple::Array< float > | m_phiTrack |
NTuple::Array< float > | m_cotTrack |
NTuple::Array< float > | m_ptInvTrack |
NTuple::Array< float > | m_radiusTrack |
NTuple::Array< float > | m_curvTrack |
NTuple::Array< float > | m_d0Truth |
NTuple::Array< float > | m_z0Truth |
NTuple::Array< float > | m_phiTruth |
NTuple::Array< float > | m_cotTruth |
NTuple::Array< float > | m_ptInvTruth |
NTuple::Array< float > | m_radiusTruth |
NTuple::Array< float > | m_curvTruth |
NTuple::Array< float > | m_corr11tra |
NTuple::Array< float > | m_corr12tra |
NTuple::Array< float > | m_corr13tra |
NTuple::Array< float > | m_corr14tra |
NTuple::Array< float > | m_corr15tra |
NTuple::Array< float > | m_corr22tra |
NTuple::Array< float > | m_corr23tra |
NTuple::Array< float > | m_corr24tra |
NTuple::Array< float > | m_corr25tra |
NTuple::Array< float > | m_corr33tra |
NTuple::Array< float > | m_corr34tra |
NTuple::Array< float > | m_corr35tra |
NTuple::Array< float > | m_corr44tra |
NTuple::Array< float > | m_corr45tra |
NTuple::Array< float > | m_corr55tra |
NTuple::Tuple * | p_nt1 |
Private Attributes | |
long | m_nEvents |
TesIO * | m_tesIO |
std::string | m_trackLocation |
Static Private Attributes | |
const std::string | DEFAULT_trackLocation |
|
Constructor: A constructor of this form must be provided.
Definition at line 42 of file TrackNtupleMaker.cxx. References m_trackLocation.
00044 :Algorithm(name, pSvcLocator){ 00045 00046 m_trackLocation = "/Event/AtlfastTracks"; 00047 declareProperty( "TrackLocation", m_trackLocation ); 00048 } |
|
Definition at line 52 of file TrackNtupleMaker.cxx. References m_corr11tra, m_corr12tra, m_corr13tra, m_corr14tra, m_corr15tra, m_corr22tra, m_corr23tra, m_corr24tra, m_corr25tra, m_corr33tra, m_corr34tra, m_corr35tra, m_corr44tra, m_corr45tra, m_corr55tra, m_cotTrack, m_cotTruth, m_curvTrack, m_curvTruth, m_d0Track, m_d0Truth, m_kfTruth, m_kpTruth, m_nEvents, m_ntra, m_phiTrack, m_phiTruth, m_ptInvTrack, m_ptInvTruth, m_radiusTrack, m_radiusTruth, m_tesIO, m_trackLocation, m_z0Track, and m_z0Truth.
00052 { 00053 MsgStream log(msgSvc(), name()); 00054 log << MSG::DEBUG << "Initialising SNM" << endreq; 00055 StatusCode status; 00056 00057 m_nEvents = 0; 00058 00059 // 00060 log << MSG::DEBUG << "Ntuple call 52" << endreq; 00061 NTuple::Directory* col = 0; 00062 log << MSG::DEBUG << "About to open ntuple file" << endreq; 00063 NTupleFilePtr file2(ntupleSvc(), "/NTUPLES/FILE1"); 00064 if ( file2 ) { 00065 log << MSG::DEBUG << "Opened ntuple file" << endreq; 00066 if ( !(col=ntupleSvc()->createDirectory("/NTUPLES/FILE1/Atlfast")) ) { 00067 log << MSG::ERROR << "Cannot create directory /NTUPLES/FILE1/Atlfast" 00068 << endreq; 00069 return StatusCode::FAILURE; 00070 }else{ 00071 log << MSG::DEBUG << "Created ntuple directory" << endreq; 00072 } 00073 } 00074 else { 00075 log << MSG::ERROR << "Cannot access file /NTUPLES/FILE1" << endreq; 00076 return StatusCode::FAILURE; 00077 } 00078 // First: A column wise N tuple 00079 NTuplePtr nt1(ntupleSvc(), "/NTUPLES/FILE1/Atlfast/52"); 00080 if ( !nt1 ) { // Check if already booked 00081 nt1 = ntupleSvc()->book (col, 52, CLID_ColumnWiseTuple, "Tracks52"); 00082 if ( nt1 ) { 00083 log << MSG::DEBUG << "booked ntuple " << endreq; 00084 // Add an index column 00085 //tracks 00086 status = nt1->addItem ("PTRACKS/NTRA" , m_ntra, 0, 500 ); 00087 status = nt1->addItem ("PTRACKS/KPTRA" , m_ntra, m_kpTruth); 00088 status = nt1->addItem ("PTRACKS/KFTRA" , m_ntra, m_kfTruth); 00089 /* 00090 status = nt1->addItem ("PTRACKS/KPM1TRA" , m_ntra, m_kpm1tra); 00091 status = nt1->addItem ("PTRACKS/KFM1TRA" , m_ntra, m_kfm1tra); 00092 status = nt1->addItem ("PTRACKS/KPM2TRA" , m_ntra, m_kpm2tra); 00093 status = nt1->addItem ("PTRACKS/KFM2TRA" , m_ntra, m_kfm2tra); 00094 status = nt1->addItem ("PTRACKS/KPM3TRA" , m_ntra, m_kpm3tra); 00095 status = nt1->addItem ("PTRACKS/KFM3TRA" , m_ntra, m_kfm3tra); 00096 status = nt1->addItem ("PTRACKS/KPM4TRA" , m_ntra, m_kpm4tra); 00097 status = nt1->addItem ("PTRACKS/KFM4TRA" , m_ntra, m_kfm4tra); 00098 status = nt1->addItem ("PTRACKS/KPM5TRA" , m_ntra, m_kpm5tra); 00099 status = nt1->addItem ("PTRACKS/KFM5TRA" , m_ntra, m_kfm5tra); 00100 status = nt1->addItem ("PTRACKS/KPM6TRA" , m_ntra, m_kpm6tra); 00101 status = nt1->addItem ("PTRACKS/KFM6TRA" , m_ntra, m_kfm6tra); 00102 */ 00103 status = nt1->addItem ("PTRACKS/D0TRA " , m_ntra, m_d0Truth); 00104 status = nt1->addItem ("PTRACKS/Z0TRA " , m_ntra, m_z0Truth); 00105 status = nt1->addItem ("PTRACKS/PHITRA " , m_ntra, m_phiTruth); 00106 status = nt1->addItem ("PTRACKS/COTTRA " , m_ntra, m_cotTruth); 00107 status = nt1->addItem ("PTRACKS/PTINVTRA " , m_ntra, m_ptInvTruth); 00108 status = nt1->addItem ("PTRACKS/RADTRA " , m_ntra, m_radiusTruth); 00109 status = nt1->addItem ("PTRACKS/CURVTRA " , m_ntra, m_curvTruth); 00110 00111 status = nt1->addItem ("PTRACKS/D0TRACRU " , m_ntra, m_d0Track); 00112 status = nt1->addItem ("PTRACKS/Z0TRACRU " , m_ntra, m_z0Track); 00113 status = nt1->addItem ("PTRACKS/PHITRACRU " , m_ntra, m_phiTrack); 00114 status = nt1->addItem ("PTRACKS/COTTRACRU " , m_ntra, m_cotTrack); 00115 status = nt1->addItem ("PTRACKS/PTINVTRACRU " , m_ntra, m_ptInvTrack); 00116 status = nt1->addItem ("PTRACKS/RADTRACRU " , m_ntra, m_radiusTrack); 00117 status = nt1->addItem ("PTRACKS/CURVTRACRU " , m_ntra, m_curvTrack); 00118 00119 status = nt1->addItem ("PTRACKS/CORR11TRA " , m_ntra, m_corr11tra); 00120 status = nt1->addItem ("PTRACKS/CORR21TRA " , m_ntra, m_corr12tra); 00121 status = nt1->addItem ("PTRACKS/CORR31TRA " , m_ntra, m_corr13tra); 00122 status = nt1->addItem ("PTRACKS/CORR41TRA " , m_ntra, m_corr14tra); 00123 status = nt1->addItem ("PTRACKS/CORR51TRA " , m_ntra, m_corr15tra); 00124 status = nt1->addItem ("PTRACKS/CORR22TRA " , m_ntra, m_corr22tra); 00125 status = nt1->addItem ("PTRACKS/CORR23TRA " , m_ntra, m_corr23tra); 00126 status = nt1->addItem ("PTRACKS/CORR24TRA " , m_ntra, m_corr24tra); 00127 status = nt1->addItem ("PTRACKS/CORR25TRA " , m_ntra, m_corr25tra); 00128 status = nt1->addItem ("PTRACKS/CORR33TRA " , m_ntra, m_corr33tra); 00129 status = nt1->addItem ("PTRACKS/CORR34TRA " , m_ntra, m_corr34tra); 00130 status = nt1->addItem ("PTRACKS/CORR35TRA " , m_ntra, m_corr35tra); 00131 status = nt1->addItem ("PTRACKS/CORR44TRA " , m_ntra, m_corr44tra); 00132 status = nt1->addItem ("PTRACKS/CORR45TRA " , m_ntra, m_corr45tra); 00133 status = nt1->addItem ("PTRACKS/CORR55TRA " , m_ntra, m_corr55tra); 00134 } 00135 else { // did not manage to book the N tuple.... 00136 return StatusCode::FAILURE; 00137 } 00138 } 00139 00140 log<<MSG::DEBUG<<"returning with status"<< status<<endreq; 00141 m_tesIO = new TesIO(); 00142 00143 HeaderPrinter hp("Atlfast TrackNtupleMaker:", log); 00144 hp.add("Track Location ", m_trackLocation); 00145 hp.print(); 00146 00147 return StatusCode::SUCCESS; 00148 } |
|
Definition at line 151 of file TrackNtupleMaker.cxx. References m_corr11tra, m_corr12tra, m_corr13tra, m_corr14tra, m_corr15tra, m_corr22tra, m_corr23tra, m_corr24tra, m_corr25tra, m_corr33tra, m_corr34tra, m_corr35tra, m_corr44tra, m_corr45tra, m_corr55tra, m_cotTrack, m_cotTruth, m_curvTrack, m_curvTruth, m_d0Track, m_d0Truth, m_kfTruth, m_kpTruth, m_nEvents, m_ntra, m_phiTrack, m_phiTruth, m_ptInvTrack, m_ptInvTruth, m_radiusTrack, m_radiusTruth, m_tesIO, m_trackLocation, m_z0Track, and m_z0Truth.
00151 { 00152 // This just makes the code below a bit easier to read (and type) 00153 MsgStream log(msgSvc(), name()); 00154 00155 // Counter of events processed 00156 if( m_nEvents % 50 == 0) { 00157 log << MSG::INFO << " processing event number " 00158 << m_nEvents << endreq; 00159 } 00160 00161 m_nEvents++; 00162 00163 StatusCode status; 00164 00165 //------------------- 00166 // Retrieve Tracks 00167 //------------------- 00168 00169 std::vector<Track*> tr; 00170 if( !m_tesIO->copy<TrackCollection> (tr, m_trackLocation) ){ 00171 log <<MSG::DEBUG << "Could not find Tracks"<<endreq; 00172 } 00173 log << MSG::DEBUG << "Processing tracks" <<tr.size()<< endreq; 00174 00175 std::vector<Track*>::const_iterator itr = tr.begin(); 00176 00177 m_ntra = 0; 00178 for (;itr != tr.end(); ++itr ) { 00179 log<<MSG::DEBUG<< " dumping track: "<<m_ntra<<endreq; 00180 log<<MSG::DEBUG<<(*itr)<<endreq<<endreq; 00181 //get track info for four vector: 00182 const HepMC::GenParticle* particle = (*itr)->truth(); 00183 00184 m_kpTruth[m_ntra]= 0; 00185 m_kfTruth[m_ntra]= particle->pdg_id(); 00186 /* 00187 m_kpm1tra[m_ntra]= 0; 00188 m_kfm1tra[m_ntra]= 0; 00189 m_kpm2tra[m_ntra]= 0; 00190 m_kfm2tra[m_ntra]= 0; 00191 m_kpm3tra[m_ntra]= 0; 00192 m_kfm3tra[m_ntra]= 0; 00193 m_kpm4tra[m_ntra]= 0; 00194 m_kfm4tra[m_ntra]= 0; 00195 m_kpm5tra[m_ntra]= 0; 00196 m_kfm5tra[m_ntra]= 0; 00197 m_kpm6tra[m_ntra]= 0; 00198 m_kfm6tra[m_ntra]= 0; 00199 */ 00200 // 00201 TrackTrajectory truthTraj = (*itr)->truthTrajectory(); 00202 TrackTrajectory traj = (*itr)->trajectory(); 00203 TrackParameters truthParam = truthTraj.parameters(); 00204 TrackParameters smearParam = traj.parameters(); 00205 00206 m_d0Truth[m_ntra] = truthParam.impactParameter(); 00207 m_z0Truth[m_ntra] = truthParam.zPerigee(); 00208 m_phiTruth[m_ntra] = truthParam.phi(); 00209 m_cotTruth[m_ntra] = truthParam.cotTheta(); 00210 m_ptInvTruth[m_ntra] = truthParam.invPtCharge(); 00211 m_radiusTruth[m_ntra] = truthTraj.radius(); 00212 m_curvTruth[m_ntra] = truthTraj.curvature(); 00213 // 00214 m_d0Track[m_ntra] = smearParam.impactParameter(); 00215 m_z0Track[m_ntra] = smearParam.zPerigee(); 00216 m_phiTrack[m_ntra] = smearParam.phi(); 00217 m_cotTrack[m_ntra] = smearParam.cotTheta(); 00218 m_ptInvTrack[m_ntra] = smearParam.invPtCharge(); 00219 m_radiusTrack[m_ntra] = traj.radius(); 00220 m_curvTrack[m_ntra] = traj.curvature(); 00221 // 00222 m_corr11tra[m_ntra]= ( (*itr)->smearMatrix() )(1,1); 00223 m_corr12tra[m_ntra]= ( (*itr)->smearMatrix() )(1,2); 00224 m_corr13tra[m_ntra]= ( (*itr)->smearMatrix() )(1,3); 00225 m_corr14tra[m_ntra]= ( (*itr)->smearMatrix() )(1,4); 00226 m_corr15tra[m_ntra]= ( (*itr)->smearMatrix() )(1,5); 00227 m_corr22tra[m_ntra]= ( (*itr)->smearMatrix() )(2,2); 00228 m_corr23tra[m_ntra]= ( (*itr)->smearMatrix() )(2,3); 00229 m_corr24tra[m_ntra]= ( (*itr)->smearMatrix() )(2,4); 00230 m_corr25tra[m_ntra]= ( (*itr)->smearMatrix() )(2,5); 00231 m_corr33tra[m_ntra]= ( (*itr)->smearMatrix() )(3,3); 00232 m_corr34tra[m_ntra]= ( (*itr)->smearMatrix() )(3,4); 00233 m_corr35tra[m_ntra]= ( (*itr)->smearMatrix() )(3,5); 00234 m_corr44tra[m_ntra]= ( (*itr)->smearMatrix() )(4,4); 00235 m_corr45tra[m_ntra]= ( (*itr)->smearMatrix() )(4,5); 00236 m_corr55tra[m_ntra]= ( (*itr)->smearMatrix() )(5,5); 00237 00238 if ( ++m_ntra == m_ntra->range().distance() ) break; 00239 } 00240 00241 // Write out ntuple 00242 00243 log << MSG::DEBUG << "Writing ntuple part 52" << endreq; 00244 status = ntupleSvc()->writeRecord("/NTUPLES/FILE1/Atlfast/52"); 00245 if ( !status.isSuccess() ) log <<MSG::ERROR 00246 <<"Cannot fill id 52" 00247 <<endreq; 00248 log << MSG::DEBUG << "Done all the ntuple writing" << endreq; 00249 return StatusCode::SUCCESS; 00250 } |
|
Definition at line 253 of file TrackNtupleMaker.cxx. References m_nEvents.
00253 { 00254 00255 MsgStream log(msgSvc(), name()); 00256 log << MSG::DEBUG 00257 << " Number of events processed = " 00258 << m_nEvents << endreq; 00259 00260 return StatusCode::SUCCESS; 00261 } |
|
Definition at line 33 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 34 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 34 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 35 of file TrackNtupleMaker.h. |
|
Definition at line 35 of file TrackNtupleMaker.h. |
|
Definition at line 36 of file TrackNtupleMaker.h. |
|
Definition at line 36 of file TrackNtupleMaker.h. |
|
Definition at line 37 of file TrackNtupleMaker.h. |
|
Definition at line 37 of file TrackNtupleMaker.h. |
|
Definition at line 38 of file TrackNtupleMaker.h. |
|
Definition at line 38 of file TrackNtupleMaker.h. |
|
Definition at line 39 of file TrackNtupleMaker.h. |
|
Definition at line 39 of file TrackNtupleMaker.h. |
|
Definition at line 40 of file TrackNtupleMaker.h. |
|
Definition at line 40 of file TrackNtupleMaker.h. |
|
Definition at line 41 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 41 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 41 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 41 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 41 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 41 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 41 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 43 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 43 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 43 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 43 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 43 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 43 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 43 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 45 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 45 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 45 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 45 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 45 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 46 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 46 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 46 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 46 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 47 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 47 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 47 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 48 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 48 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 48 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 51 of file TrackNtupleMaker.h. |
|
Definition at line 62 of file TrackNtupleMaker.h. Referenced by execute(), finalize(), and initialize(). |
|
Definition at line 63 of file TrackNtupleMaker.h. Referenced by execute(), and initialize(). |
|
Definition at line 66 of file TrackNtupleMaker.h. Referenced by execute(), initialize(), and TrackNtupleMaker(). |
|
Definition at line 69 of file TrackNtupleMaker.h. |