36 return StatusCode::FAILURE;
49 return StatusCode::FAILURE;
57 return StatusCode::FAILURE;
63 return StatusCode::FAILURE;
71 return StatusCode::FAILURE;
80 return StatusCode::FAILURE;
90 return StatusCode::FAILURE;
98 return StatusCode::FAILURE;
106 msg(MSG::FATAL)<<
"AlignSolveLevel could be 1, 2 or 3"<<
endmsg;
107 return StatusCode::FAILURE;
112 std::ostream * out = &std::cout;
113 std::ofstream * ofile =
new std::ofstream(
m_logfileName.value().c_str());
114 if(!ofile->is_open()) {
115 msg(MSG::ERROR)<<
"Couldn't open logfile. Writing to standard output."<<
endmsg;
137 return StatusCode::SUCCESS;
158 ATH_MSG_DEBUG(
"read geometry, "<<NDoF<<
" alignment parameters");
167 if (
sc != StatusCode::SUCCESS) {
168 msg(MSG::FATAL)<<
"problem with alignTool->firstEventInitialize()"<<
endmsg;
169 return StatusCode::FAILURE;
177 return StatusCode::SUCCESS;
191 return StatusCode::SUCCESS;
194 msg(MSG::INFO)<<
"Only doing the solving. Aborting event processing after first event."<<
endmsg;
195 msg(MSG::INFO)<<
"Following ERROR message is not a problem..."<<
endmsg;
196 return StatusCode::FAILURE;
211 if (!originalTracks ||
sc.isFailure())
return sc;
213 if(originalTracks->
empty()) {
215 return StatusCode::SUCCESS;
226 if (!alignTracks || alignTracks->
empty()) {
227 ATH_MSG_DEBUG(
"processTrackCollection() returned empty Track collection.");
228 return StatusCode::SUCCESS;
236 for (
Track* trk : *alignTracks) {
243 msg(MSG::FATAL)<<
"Track is not an AlignTrack. PreProcessor returns TrackCollection but"
244 <<
"it has to be filled with AlignTracks. Otherwise the code doesn't work."<<
endmsg;
245 return StatusCode::FAILURE;
251 ATH_MSG_DEBUG(
"processAlignTrack() returned FALSE, Skipping the track.");
262 ATH_MSG_DEBUG(
"dressAlignTrack() returned FALSE, Skipping the track.");
280 for (
Track* trk : *alignTracks) {
287 msg(MSG::FATAL)<<
"Track is not an AlignTrack. PreProcessor returns TrackCollection but"
288 <<
"it has to be filled with AlignTracks. Otherwise the code doesn't work."<<
endmsg;
289 return StatusCode::FAILURE;
296 ATH_MSG_DEBUG(
"dressAlignTrack failed, Skipping the track.");
303 ATH_MSG_DEBUG(
"Vertex fit failed for this track. Skipping the track.");
309 bool success =
m_alignTool->accumulate(alignTrack);
313 ATH_MSG_DEBUG(
"accumulate() returned FALSE, Skipping the track.");
335 alignTracks =
nullptr;
340 return StatusCode::SUCCESS;
349 *
m_logStream<<
"*************************************************************"<<std::endl;
350 *
m_logStream<<
"****** Alignment Job summary ******"<<std::endl;
351 *
m_logStream<<
"*************************************************************"<<std::endl;
370 msg(MSG::ERROR)<<
"problem with alignTool fillNtuple()!"<<
endmsg;
371 return StatusCode::FAILURE;
375 msg(MSG::ERROR)<<
"problem with fillNtupleTool fillNtuple()!"<<
endmsg;
376 return StatusCode::FAILURE;
379 ATH_MSG_INFO(
"calling alignTrackPreProcessor->fillNtuple()");
381 msg(MSG::ERROR)<<
"problem with alignTrackPreProcessor fillNtuple()!"<<
endmsg;
382 return StatusCode::FAILURE;
385 ATH_MSG_INFO(
"calling trackCollectionProvider->fillNtuple()");
387 msg(MSG::ERROR)<<
"problem with trackCollectionProvider fillNtuple()!"<<
endmsg;
388 return StatusCode::FAILURE;
393 msg(MSG::WARNING)<<
"No tracks passed track selection. No solving."<<
endmsg;
394 return StatusCode::SUCCESS;
399 msg(MSG::FATAL)<<
"failure in ITrkAlignDBTool->preSolve()"<<
endmsg;
400 return StatusCode::FAILURE;
405 msg(MSG::FATAL)<<
"failure in IAlignTool->solve()"<<
endmsg;
406 return StatusCode::FAILURE;
409 ATH_MSG_INFO(
"calling trkAlignDBTool->writeAlignPar()");
412 return StatusCode::SUCCESS;
422 if(std::ofstream * ofs =
dynamic_cast<std::ofstream *
>(
m_logStream)) {
436 return StatusCode::SUCCESS;
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
ServiceHandle< StoreGateSvc > & evtStore()
size_type size() const noexcept
Returns the number of elements in the collection.
bool empty() const noexcept
Returns true if the collection is empty.
virtual StatusCode finalize()
finalize method
StringProperty m_filename
std::ostream * m_logStream
logfile output stream
virtual StatusCode initialize()
initialize method
virtual StatusCode start()
set up geometry and prepare the tools
virtual StatusCode stop()
processes information accumulated in execute method to determine alignment parameters
BooleanProperty m_writeLogfile
StringProperty m_filepath
ToolHandle< ITrackCollectionProvider > m_trackCollectionProvider
StringProperty m_alignTracksName
virtual StatusCode execute(const EventContext &ctx)
loops over tracks in event, and accumulates information necessary for alignmnet
int m_ntracksProc
number of tracks successfully processed
ToolHandle< IAlignTool > m_alignTool
Pointer to alignTool.
virtual ~AlignAlg()
destructor
int m_ntracksAccum
number of tracks successfully accumulated
int m_nevents
number of processed events
int m_ntracksSel
number of selected tracks
BooleanProperty m_writeNtuple
int m_ntracks
number of processed tracks
StringProperty m_logfileName
ToolHandle< IAlignTrackPreProcessor > m_alignTrackPreProcessor
Pointer to AlignTrackPreProcessor, used to select hits on tracks and/or tracks before passing to Alig...
BooleanProperty m_solveOnly
PublicToolHandle< IGeometryManagerTool > m_geometryManagerTool
Pointer to GeometryManagerTool, used to get lists of chambers for which alignment parameters will be ...
ToolHandle< IAlignTrackDresser > m_alignTrackDresser
Pointer to alignTrackDresser, used to add residuals, derivatives, etc.
ToolHandle< IFillNtupleTool > m_fillNtupleTool
Pointer to FillNtupleTool, used to write track information to ntuple.
int m_ntracksDress
number of tracks successfully dressed
TFile * m_ntuple
output ntuple
ToolHandle< ITrkAlignDBTool > m_trkAlignDBTool
Pointer to TrkAlignDBTool, used for reading/writing alignment parameters from/to the database.
ToolHandle< IAlignTrackCreator > m_alignTrackCreator
Pointer to alignTrackCreator, used to convert Trk::Track to vector of AlignTrack.
IntegerProperty m_alignSolveLevel
const AlignVertex * getVtx() const
set and get pointer to the associated vertex
const Amg::SymMatrixX * weightMatrix() const
Weight matrix is W from Si alignment (see Eqn.
@ Refitted
normally refitted, without adding any pseudo-measurement
AlignVertexType type() const
get and set the refit type
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > SymMatrixX
Ensure that the ATLAS eigen extensions are properly loaded.