Skip to content
Snippets Groups Projects
Commit dbc2e2ac authored by Sergi Rodriguez Bosca's avatar Sergi Rodriguez Bosca Committed by Melissa Yexley
Browse files

updating python config and used classes

parent fb7edc31
No related branches found
No related tags found
No related merge requests found
......@@ -22,6 +22,8 @@
#include "TRT_ConditionsData/StrawT0MultChanContainer.h"
#include "CxxUtils/checker_macros.h"
#include "TRT_CalibTools/IFillAlignTrkInfo.h"
namespace TRT{
class TrackInfo;
......@@ -31,7 +33,6 @@ namespace Trk{
class ITrackSelectorTool;
class ITrackFitter;
}
class IFillAlignTrkInfo;
class IAccumulator;
class IFitTool;
......@@ -78,7 +79,7 @@ public:
private:
// Tools for the algorithm
ToolHandleArray<IFillAlignTrkInfo> m_TrackInfoTools ;
ToolHandleArray<IFillAlignTrkInfo> m_TrackInfoTools {this, "AlignTrkTools", {}, ""};
PublicToolHandleArray<ITRTCalibrator> m_TRTCalibTools {this, "TRTCalibrator", {}, ""};
ToolHandleArray<IFitTool> m_FitTools;
ToolHandle<Trk::ITrackFitter> m_trackFitter;
......
......@@ -37,11 +37,10 @@ def FillAlignTRTHitsCfg(flags,name='FillAlignTRTHits',**kwargs) :
AlignTRTHits.minTimebinsOverThreshold = 0
from TRT_ConditionsServices.TRT_ConditionsServicesConfig import TRT_CalDbToolCfg
AlignTRTHits.TRTCalDbTool = acc.popToolsAndMerge(TRT_CalDbToolCfg(flags))
from TRT_ConditionsServices.TRT_ConditionsServicesConfig import TRT_StrawStatusSummaryToolCfg
from TRT_ConditionsServices.TRT_ConditionsServicesConfig import TRT_CalDbToolCfg, TRT_StrawStatusSummaryToolCfg, TRT_StrawNeighbourSvcCfg
AlignTRTHits.TRTCalDbTool = acc.popToolsAndMerge(TRT_CalDbToolCfg(flags))
AlignTRTHits.TRTStrawSummaryTool = acc.popToolsAndMerge(TRT_StrawStatusSummaryToolCfg(flags))
AlignTRTHits.NeighbourSvc = acc.popToolsAndMerge(TRT_StrawNeighbourSvcCfg(flags))
acc.setPrivateTools(AlignTRTHits)
......
......@@ -27,7 +27,7 @@
TRTCalibrationMgr::TRTCalibrationMgr(const std::string& name, ISvcLocator* pSvcLocator) :
AthAlgorithm (name, pSvcLocator),
m_TrackInfoTools(),
// m_TrackInfoTools(),
m_FitTools(),
m_trackFitter("Trk::KalmanFitter/TrkKalmanFitter"),
m_trackSelector("InDet::InDetTrackSelectorTool/InDetTrackSelectorTool"),
......@@ -36,12 +36,12 @@ TRTCalibrationMgr::TRTCalibrationMgr(const std::string& name, ISvcLocator* pSvcL
m_par_rtcontainerkey("/TRT/Calib/RT"),
m_par_t0containerkey("/TRT/Calib/T0")
{
m_TrackInfoTools.push_back("FillAlignTrkInfo");
// m_TrackInfoTools.push_back("FillAlignTrkInfo");
m_TRTCalibTools.push_back("TRTCalibrator");
m_FitTools.push_back("FitTool");
// declare algorithm parameters
declareProperty("StreamTool", m_streamer);
declareProperty("AlignTrkTools",m_TrackInfoTools);
// declareProperty("AlignTrkTools",m_TrackInfoTools);
declareProperty("FitTools",m_FitTools);
declareProperty("Max_ntrk",m_max_ntrk);
declareProperty("TrackFitter", m_trackFitter);
......
......@@ -41,8 +41,8 @@ FillAlignTRTHits::FillAlignTRTHits(const std::string& type, const std::string& n
AthAlgTool(type, name, parent),
m_DetID(nullptr), m_TRTID(nullptr),
// m_trtcaldbTool("ITRT_CalDbTool", this),
m_neighbourSvc("ITRT_StrawNeighbourSvc", name),
m_TRTStrawSummaryTool("InDetTRTStrawStatusSummaryTool",this),
// m_neighbourSvc("ITRT_StrawNeighbourSvc", name),
// m_TRTStrawSummaryTool("InDetTRTStrawStatusSummaryTool",this),
m_updator(nullptr),
m_maxDistance(2.8),
m_maxTimeResidual(150),
......@@ -56,13 +56,13 @@ FillAlignTRTHits::FillAlignTRTHits(const std::string& type, const std::string& n
{
declareInterface<IFillAlignTrkInfo>(this);
// declareProperty("TRTCalDbTool",m_trtcaldbTool);
declareProperty("NeighbourSvc",m_neighbourSvc);
// declareProperty("NeighbourSvc",m_neighbourSvc);
declareProperty("maxDistance",m_maxDistance) ;
declareProperty("maxTimeResidual",m_maxTimeResidual) ;
declareProperty("minTimebinsOverThreshold",m_minTimebinsOverThreshold) ;
declareProperty("maxTrackChisquarePerDof",m_maxTrackChisquarePerDof) ;
declareProperty("DoMCCosmicTimeShift",m_DoMCCosmicTimeShift);
declareProperty("TRTStrawSummaryTool", m_TRTStrawSummaryTool);
// declareProperty("TRTStrawSummaryTool", m_TRTStrawSummaryTool);
}
StatusCode FillAlignTRTHits::initialize(){
......@@ -75,6 +75,8 @@ StatusCode FillAlignTRTHits::initialize(){
msg(MSG::FATAL) << "Problem retrieving TRTID helper" << endmsg;
return StatusCode::FAILURE;
}
std::cout<< m_trtcaldbTool<< std::endl;
if(m_trtcaldbTool.retrieve().isFailure()) {
msg(MSG::FATAL) << "Could not get TRT_CalDbTool !" << endmsg;
return StatusCode::FAILURE;
......
......@@ -62,11 +62,11 @@ private:
const AtlasDetectorID* m_DetID;
const TRT_ID* m_TRTID;
ToolHandle< ITRT_DriftFunctionTool > m_driftFunctionTool{this, "TRTDriftFunctionTool", "TRT_DriftFunctionTool", "Drift function tool name"};
ToolHandle<Trk::IUpdator> m_updatorHandle{this, "UpdatorTool", "Trk::KalmanUpdator/TrkKalmanUpdator", "Measurement updator to calculate unbiased track states"};
ToolHandle<ITRT_CalDbTool> m_trtcaldbTool {this, "TRTCalDbTool", "ITRT_CalDbTool", "Access to the folder of the calibration constants"};
ServiceHandle<ITRT_StrawNeighbourSvc> m_neighbourSvc ;
ToolHandle<ITRT_StrawStatusSummaryTool> m_TRTStrawSummaryTool; //!< The ConditionsSummaryTool
ToolHandle< ITRT_DriftFunctionTool > m_driftFunctionTool {this, "TRTDriftFunctionTool", "TRT_DriftFunctionTool", "Drift function tool name"};
ToolHandle<Trk::IUpdator> m_updatorHandle {this, "UpdatorTool" , "Trk::KalmanUpdator/TrkKalmanUpdator", "Measurement updator to calculate unbiased track states"};
ToolHandle<ITRT_CalDbTool> m_trtcaldbTool {this, "TRTCalDbTool", "CalDbTool", "Access to the folder of the calibration constants"};
ServiceHandle<ITRT_StrawNeighbourSvc> m_neighbourSvc {this, "NeighbourSvc", "NeighbourSvc", ""};
ToolHandle<ITRT_StrawStatusSummaryTool> m_TRTStrawSummaryTool {this, "TRTStrawSummaryTool", "TRTStrawSummary", ""};
Trk::IUpdator* m_updator; //!< updator for unbiased states
......
......@@ -6,6 +6,26 @@ from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
@AccumulatorCache
def TRT_CalDbToolCfg(flags, name="TRT_CalDbTool"):
"""Return a ComponentAccumulator for TRT_CalDbTool"""
from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
acc = ComponentAccumulator()
acc.merge(addFoldersSplitOnline(flags, "TRT", "/TRT/Onl/Calib/RT", "/TRT/Calib/RT",
className="TRTCond::RtRelationMultChanContainer"))
acc.merge(addFoldersSplitOnline(flags, "TRT", "/TRT/Onl/Calib/T0", "/TRT/Calib/T0",
className='TRTCond::StrawT0MultChanContainer'))
acc.merge(addFoldersSplitOnline(flags, "TRT", "/TRT/Onl/Calib/errors2d", "/TRT/Calib/errors2d",
className="TRTCond::RtRelationMultChanContainer"))
acc.merge(addFoldersSplitOnline(flags, "TRT", "/TRT/Onl/Calib/slopes", "/TRT/Calib/slopes",
className='TRTCond::RtRelationMultChanContainer'))
tool = CompFactory.TRT_CalDbTool(name)
acc.setPrivateTools(tool)
return acc
def TRT_StrawStatusSummaryToolCfg(flags, name="TRT_StrawStatusSummaryTool", forceLegacyAccess=False, **kwargs):
"""Return a ComponentAccumulator for TRT_StrawStatusSummaryTool"""
acc = ComponentAccumulator()
......@@ -19,32 +39,22 @@ def TRT_StrawStatusSummaryToolCfg(flags, name="TRT_StrawStatusSummaryTool", forc
from TRT_ConditionsAlgs.TRT_ConditionsAlgsConfig import TRTStrawStatusCondAlgCfg
acc.merge(TRTStrawStatusCondAlgCfg(flags))
StrawStatusSummaryTool = CompFactory.TRT_StrawStatusSummaryTool(name, **kwargs)
tool = CompFactory.TRT_StrawStatusSummaryTool(name)
StrawStatusSummaryTool.isGEANT4 = flags.GeoModel.Align.LegacyConditionsAccess or forceLegacyAccess
tool.isGEANT4 = flags.GeoModel.Align.LegacyConditionsAccess or forceLegacyAccess
acc.setPrivateTools(StrawStatusSummaryTool)
acc.setPrivateTools(tool)
return acc
def TRT_CalDbToolCfg(flags, name="TRT_CalDbTool"):
"""Return a ComponentAccumulator for TRT_CalDbTool"""
from IOVDbSvc.IOVDbSvcConfig import addFoldersSplitOnline
def TRT_StrawNeighbourSvcCfg(flags, name="TRT_StrawNeighbourSvc"):
acc = ComponentAccumulator()
acc.merge(addFoldersSplitOnline(flags, "TRT", "/TRT/Onl/Calib/RT", "/TRT/Calib/RT",
className="TRTCond::RtRelationMultChanContainer"))
acc.merge(addFoldersSplitOnline(flags, "TRT", "/TRT/Onl/Calib/T0", "/TRT/Calib/T0",
className='TRTCond::StrawT0MultChanContainer'))
acc.merge(addFoldersSplitOnline(flags, "TRT", "/TRT/Onl/Calib/errors2d", "/TRT/Calib/errors2d",
className="TRTCond::RtRelationMultChanContainer"))
acc.merge(addFoldersSplitOnline(flags, "TRT", "/TRT/Onl/Calib/slopes", "/TRT/Calib/slopes",
className='TRTCond::RtRelationMultChanContainer'))
svc = CompFactory.TRT_StrawNeighbourSvc(name)
tool = CompFactory.TRT_CalDbTool(name)
acc.setPrivateTools(tool)
acc.addService(svc)
return acc
def TRT_MCCalDbToolCfg(flags, name="TRT_CalDbTool2", **kwargs):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment