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;
185 const EventContext& ctx = Gaudi::Hive::currentContext();
192 return StatusCode::SUCCESS;
195 msg(MSG::INFO)<<
"Only doing the solving. Aborting event processing after first event."<<
endmsg;
196 msg(MSG::INFO)<<
"Following ERROR message is not a problem..."<<
endmsg;
197 return StatusCode::FAILURE;
212 if (!originalTracks ||
sc.isFailure())
return sc;
214 if(originalTracks->
empty()) {
216 return StatusCode::SUCCESS;
227 if (!alignTracks || alignTracks->
empty()) {
228 ATH_MSG_DEBUG(
"processTrackCollection() returned empty Track collection.");
229 return StatusCode::SUCCESS;
237 for (
Track* trk : *alignTracks) {
244 msg(MSG::FATAL)<<
"Track is not an AlignTrack. PreProcessor returns TrackCollection but"
245 <<
"it has to be filled with AlignTracks. Otherwise the code doesn't work."<<
endmsg;
246 return StatusCode::FAILURE;
252 ATH_MSG_DEBUG(
"processAlignTrack() returned FALSE, Skipping the track.");
263 ATH_MSG_DEBUG(
"dressAlignTrack() returned FALSE, Skipping the track.");
281 for (
Track* trk : *alignTracks) {
288 msg(MSG::FATAL)<<
"Track is not an AlignTrack. PreProcessor returns TrackCollection but"
289 <<
"it has to be filled with AlignTracks. Otherwise the code doesn't work."<<
endmsg;
290 return StatusCode::FAILURE;
297 ATH_MSG_DEBUG(
"dressAlignTrack failed, Skipping the track.");
304 ATH_MSG_DEBUG(
"Vertex fit failed for this track. Skipping the track.");
310 bool success =
m_alignTool->accumulate(alignTrack);
314 ATH_MSG_DEBUG(
"accumulate() returned FALSE, Skipping the track.");
336 alignTracks =
nullptr;
341 return StatusCode::SUCCESS;
350 *
m_logStream<<
"*************************************************************"<<std::endl;
351 *
m_logStream<<
"****** Alignment Job summary ******"<<std::endl;
352 *
m_logStream<<
"*************************************************************"<<std::endl;
371 msg(MSG::ERROR)<<
"problem with alignTool fillNtuple()!"<<
endmsg;
372 return StatusCode::FAILURE;
376 msg(MSG::ERROR)<<
"problem with fillNtupleTool fillNtuple()!"<<
endmsg;
377 return StatusCode::FAILURE;
380 ATH_MSG_INFO(
"calling alignTrackPreProcessor->fillNtuple()");
382 msg(MSG::ERROR)<<
"problem with alignTrackPreProcessor fillNtuple()!"<<
endmsg;
383 return StatusCode::FAILURE;
386 ATH_MSG_INFO(
"calling trackCollectionProvider->fillNtuple()");
388 msg(MSG::ERROR)<<
"problem with trackCollectionProvider fillNtuple()!"<<
endmsg;
389 return StatusCode::FAILURE;
394 msg(MSG::WARNING)<<
"No tracks passed track selection. No solving."<<
endmsg;
395 return StatusCode::SUCCESS;
400 msg(MSG::FATAL)<<
"failure in ITrkAlignDBTool->preSolve()"<<
endmsg;
401 return StatusCode::FAILURE;
406 msg(MSG::FATAL)<<
"failure in IAlignTool->solve()"<<
endmsg;
407 return StatusCode::FAILURE;
410 ATH_MSG_INFO(
"calling trkAlignDBTool->writeAlignPar()");
413 return StatusCode::SUCCESS;
423 if(std::ofstream * ofs =
dynamic_cast<std::ofstream *
>(
m_logStream)) {
437 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
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
virtual StatusCode execute()
loops over tracks in event, and accumulates information necessary for alignmnet
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.