Commit 03f8be33 authored by Stewart Martin-Haugh's avatar Stewart Martin-Haugh Committed by Graeme Stewart
Browse files

'Fix compilation warnings' (TrigInDetRecoTools-00-02-06)

	* Fix compilation warnings
	* tag TrigInDetRecoTools-00-02-06

2014-11-13 Stewart Martin-Haugh <smh -at- cern.ch>
	* Remove dependency on TrigInDetTrackUtils
	* tag TrigInDetRecoTools-00-02-05

2014-09-29 Stewart Martin-Haugh <smh -at- cern.ch>
	* Remove obsolete strategy BC
		* tag TrigInDetRecoTools-00-02-04
parent 67737dba
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef __TRIG_L2_PATT_RECO_STRATEGY_BC_H__
#define __TRIG_L2_PATT_RECO_STRATEGY_BC_H__
#include "GaudiKernel/IAlgTool.h"
#include "TrigSteeringEvent/Enums.h"
#include "TrigInDetToolInterfaces/ITrigL2LayerNumberTool.h"
#include "TrigInDetRecoTools/ITrigL2PattRecoStrategy.h"
#include "TrigInDetRecoTools/StrBTrack.h"
#include "GaudiKernel/AlgTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "GaudiKernel/ServiceHandle.h"
#include "TrigInDetEvent/STTrack.h"
#include "TrigInDetEvent/TrigInDetTrackCollection.h"
#include "TrigInDetEvent/TrigVertexCollection.h"
#include "TrkTrack/TrackCollection.h"
#include "TrigInDetEvent/TrigSiSpacePointCollection.h"
class TrigTimer;
class TrigSiSpacePoint;
class IRoiDescriptor;
class IRegSelSvc;
class ITrigInDetTrackFitter;
namespace InDet {
class ISiTrackMaker;
}
class TrigL2PattRecoStrategyBC: public AlgTool, virtual public ITrigL2PattRecoStrategy {
public:
TrigL2PattRecoStrategyBC(const std::string&, const std::string&, const IInterface* );
virtual ~TrigL2PattRecoStrategyBC();
virtual StatusCode initialize();
virtual StatusCode finalize();
HLT::ErrorCode findTracks(const std::vector<const TrigSiSpacePoint*>&, const IRoiDescriptor&, TrigInDetTrackCollection*);
HLT::ErrorCode findTracks(const std::vector<const TrigSiSpacePoint*>&, TrigInDetTrackCollection*);
HLT::ErrorCode findTracks(const std::vector<const TrigSiSpacePoint*>&, const IRoiDescriptor&, const TrigVertexCollection*, TrigInDetTrackCollection*);
HLT::ErrorCode findTracks(const std::vector<const TrigSiSpacePoint*>&, const TrigVertexCollection*, TrigInDetTrackCollection*);
inline double getTimingA() const {
return m_pattRecoTiming;
}
private:
bool m_useZvertexTool;
int m_nseeds; //!< Number seeds
int m_ntracks; //!< Number found tracks
int m_nfreeCut; // Min number free clusters
int m_nUsedLayers;
const TrigSiSpacePointContainer* m_sctOnlineSpacePointsContainer;
const TrigSiSpacePointContainer* m_pixelOnlineSpacePointsContainer;
void runCombinatorialTracking(const TrigInDetTrackCollection&, TrackCollection*);
double trackQuality(const Trk::Track*);
void filterSharedTracks(std::multimap<double,Trk::Track*>&);
StatusCode getIDCs();
StoreGateSvc* m_StoreGate;
double m_pattRecoTiming;
ServiceHandle<IRegSelSvc> m_regionSelector;
/************************************/
/** COMMON TOOLS ********************/
/************************************/
ToolHandle<ITrigL2LayerNumberTool> m_numberingTool;
ToolHandle< InDet::ISiTrackMaker > m_trackmaker; // Track maker
ToolHandle<ITrigInDetTrackFitter> m_trigInDetTrackFitter;
std::string m_sctOnlineSpacePointsName;
std::string m_pixelOnlineSpacePointsName;
void executeSeedRoads(float, float, float, float);
void executeSeedDataSorting(const std::vector<const TrigSiSpacePoint*>&);
HLT::ErrorCode executeSeedMaking();
HLT::ErrorCode executeSeedMakingVertex(std::vector<float>&);
void executeSeedFilter_Vertex();
void executeTripletDataSorting(const std::vector<const TrigSiSpacePoint*>&);
HLT::ErrorCode executeTripletMaking();
void executeTripletAmbiguity();
void executeTrackAmbiguity();
void executeTrackMaking(TrigInDetTrackCollection*);
void executeSetup();
void executeCleanup();
TrigInDetTrack* convertOutputTracks(Trk::Track*);
/************************************/
/** TRIPLET UTILITIES **************/
/************************************/
float tripletAmbiguityDistance(StrBTriplet* t1, StrBTriplet* t2);
float tripletAmbiguityDistance(StrBTrack* t1, StrBTrack* t2);
void tripletMergeAmbiguity(StrBTrack* t1, StrBTrack* t2);
/************************************/
/** TRACK UTILITIES *****************/
/************************************/
void trackFit(StrBTrack* t);
float trackAmbiguityFraction(StrBTrack* t1, StrBTrack* t2);
float trackAmbiguityDistance(StrBTrack* t1, StrBTrack* t2);
void trackMergeAmbiguity(StrBTrack* t1, StrBTrack* t2);
void trackRemoveAmbiguity(StrBTrack* t1, StrBTrack* t2);
void trackAmbiguityShared(StrBTrack* t1, StrBTrack* t2);
bool trackSort(StrBTrack* t1, StrBTrack* t2);
bool patternSort(StrBPattern* t1, StrBPattern* t2);
/************************************/
/** FITTING UTILITIES ***************/
/************************************/
bool fit(TrigInDetTrack* t);
void circlefitRPhi(TrigInDetTrack* t, float &xc, float &yc, float &rc, float &phic, float &q, float &pt);
void fitRZ(TrigInDetTrack* t, float &xc, float &yc, float &rc, float &phic, float &q, float &pt);
bool fitRPhi(TrigInDetTrack* t, float &xc, float &yc);
void shiftRPhi(TrigInDetTrack* t);
float m_roiEta;
float m_roiPhi;
float roiPhiMin, roiPhiMax, m_phiHalfWidth;
float roiEtaMin, roiEtaMax, m_etaHalfWidth;
/************************************/
/** LAYERS **************************/
/************************************/
float *m_geoR, *m_geoRmin, *m_geoRmax, *m_geoZ, *m_geoZmin, *m_geoZmax;
std::vector< std::list<int> > m_layerGroups;
std::set<int> m_mapSetLayersFailure;
std::set<int> m_mapSetLayersRemove;
std::set<int> m_mapSetPixelModulesNoisy;
std::set<int> m_mapSetSCTModulesNoisy;
std::vector< std::vector<const TrigSiSpacePoint*> > m_spSeed;
std::vector<const TrigSiSpacePoint*>* m_spTriplet;
unsigned int m_spTripletZ0Steps;
unsigned int m_spTripletEtaSteps;
bool m_detector_mask_not_checked;
bool m_hasPixelBarrel, m_hasPixelDisk, m_hasPixelBLayer;
bool m_hasSCTBarrelA, m_hasSCTEndcapA;
bool m_hasSCTBarrelC, m_hasSCTEndcapC;
int m_laySctB;
int m_layPixEC;
int m_laySctEC;
int m_layMax;
/************************************/
/** VERTEXING ***********************/
/************************************/
std::vector<float> m_preZv;
int m_vtxMaxBin;
int* m_vtxHisto;
std::vector<float> m_recZv;
TrigVertexCollection* m_vtxCollection;
/************************************/
/** TRACKS **************************/
/************************************/
static StrBTrk* m_trks;
unsigned int m_trks_num;
unsigned int m_trks_num_active;
static StrBTrack* m_full_trks;
unsigned int m_full_trks_num;
unsigned int m_full_trks_num_active;
/************************************/
/** EVENT ***************************/
/************************************/
float m_xc;
float m_yc;
std::vector<StrBRoad*> m_roads;
typedef std::vector<StrBRoad*>::iterator StrBRoadIterator;
/************************************/
/** HISTOGRAMS **********************/
/************************************/
std::vector<int> m_dataErrors;
std::vector<int> m_pixelDataErrors;
std::vector<int> m_sctDataErrors;
std::vector<int> m_trtDataErrors;
/************************************/
/** PROPERTIES **********************/
/************************************/
int m_mapLayerOneMultiplicity;
int m_mapLayerTwoMultiplicity;
std::vector<int> m_mapForcedInefficientLayers;
std::vector<int> m_mapForcedTurnedOffLayers;
float m_mapMaxLayerFailureFraction;
float m_mapMaxTotalFailureFraction;
bool m_newCuts;
bool m_newCutsRZ;
float m_recoPtMinSeedDiff;
float m_recoD0MaxSeedDiff;
float m_recoPtMinTripletDiff;
float m_recoD0MaxTripletDiff;
float m_recoPtMin;
float m_recoD0Max;
float m_recoTimingFactor;
float m_recoAlignmentScaling;
bool m_recoOutlierRemoval;
float m_recoOutlierRemovalCut;
int m_recoOutlierRemovalLayers;
float m_recoOutlierRemovalD0;
float m_recoOutlierRemovalPt;
int m_recoMaxSeeds;
int m_recoMaxTracks;
float m_recoZ0Bin;
float m_recoEtaBin;
int m_maxFoundTracks;
bool m_preVertexingEnable;
std::string m_preVertexingVtxName;
float m_preVertexingZCut;
float m_seedingPreCutRZ;
float m_seedingPreCutPhi;
float m_seedingPreCutRPhi;
float m_seedingCutRZ;
bool m_vertexingEnable;
float m_vertexingCutRZ;
float m_vertexingCutRPhi;
int m_vertexingMaxVertices;
float m_vertexingWindowSize;
int m_vertexingWindowSegments;
float m_extensionPreCutRZ;
float m_extensionPreCutPhi;
float m_extensionPreCutRPhi;
float m_extensionPreCutRPhiDiff;
float m_extensionCutRZPixel;
float m_extensionCutRZ;
float m_extensionCutRPhi;
int m_extensionCutSpacePoints;
int m_extensionCutSpacePointsMiss1;
int m_extensionCutSpacePointsMiss2;
bool m_extensionSolveTriplets;
float m_extensionSolveTripletsDRCut;
float m_extensionSolveTripletsPhiScale;
float m_extensionSolveTripletsEtaScale;
bool m_extensionSolveTracks;
bool m_extensionSolveV0Tracks;
float m_extensionSolveTracksDRCut;
float m_extensionSolveTracksPhiScale;
float m_extensionSolveTracksEtaScale;
bool m_extensionSolveShared;
int m_extensionMaxMissingLayers;
bool m_extensionRefit;
int m_extensionSpacePoints;
int m_extensionSpacePointsMiss1;
int m_extensionSpacePointsMiss2;
bool m_extensionTRTExtension;
int m_dynamic_extensionCutSpacePoints;
int m_dynamic_extensionSpacePoints;
bool m_debugTuning;
bool m_debugTuningGoodSeeds;
bool m_debugTuningBadSeeds;
bool m_debugTuningGoodTriplets;
bool m_debugTuningBadTriplets;
bool m_outputTrkEnable;
std::string m_outputTrkName;
bool m_outputHistoEnable;
std::string m_outputHistoDir;
int m_outputHistoName;
// dinamically modified properties
float m_dynamicalSeedingPreCutRZ;
float m_dynamicalSeedingPreCutPhi;
float m_dynamicalSeedingPreCutRPhi;
float m_dynamicalSeedingCutRZ;
float m_dynamicalExtensionPreCutRZ;
float m_dynamicalExtensionPreCutPhi;
float m_dynamicalExtensionPreCutRPhi;
float m_dynamicalExtensionPreCutRPhiDiff;
float m_dynamicalExtensionCutRZPixel;
float m_dynamicalExtensionCutRZ;
float m_dynamicalExtensionCutRPhi;
//tracking quantities to be monitored
int m_nSP;
int m_nTracks;
int m_nPixelSP;
int m_nSctSP;
int m_lastStep;
int m_nSeeds;
int m_nExtended;
std::string m_attachedFeatureName;
std::string m_outputCollectionSuffix;
std::vector<double> m_a0beam;
std::vector<double> m_trkdPhi0, m_trkdEta;
std::vector<double> m_pixResPhiBarrel;
std::vector<double> m_pixResEtaBarrel;
std::vector<double> m_pixPullPhiBarrel;
std::vector<double> m_pixPullEtaBarrel;
std::vector<double> m_sctResBarrel;
std::vector<double> m_sctPullBarrel;
std::vector<double> m_pixResPhiEC;
std::vector<double> m_pixResEtaEC;
std::vector<double> m_pixPullPhiEC;
std::vector<double> m_pixPullEtaEC;
std::vector<double> m_sctResEC;
std::vector<double> m_sctPullEC;
//timers
bool m_timers;
TrigTimer* m_timer[10];
};
#endif
......@@ -135,89 +135,6 @@ class SettingsForStrategyC(CommonSettings) :
self.db['nHolesMax'] = nholesmax
self.db['nHolesGapMax'] = nholesgapmax
class SettingsForStrategyBC(CommonSettings) :
def __init__(self):
CommonSettings.__init__(self)
# strategy-specific settings defined below
width = {}
usezvtool = {}
nclustersmin = {}
nholesmax = {}
nholesgapmax = {}
xi2max = {}
xi2maxnoadd = {}
nweightedclustersmin = {}
nlayersused = {}
seedsFilterLevel = {}
maxFoundTracks = {}
for i in self.allowedInstanceNames :
width[i] = 10.0
usezvtool[i] = True
nclustersmin[i] = 4
nholesmax[i] = 2
nholesgapmax[i] = 2
xi2max[i] = 15.0
xi2maxnoadd[i] = 15.0
nweightedclustersmin[i] = 8
nlayersused[i] = 100
seedsFilterLevel[i] = 2
maxFoundTracks[i] = 1
# customize setting here: for example width['Tau'] = 20.
usezvtool['Tau'] = False
width['eGamma'] = 20.0
nholesmax['eGamma'] = 2
nholesgapmax['eGamma'] = 2
xi2max['eGamma'] = 15.0
xi2maxnoadd['eGamma'] = 15.0
nweightedclustersmin['eGamma'] = 8
nlayersused['eGamma'] = 3
seedsFilterLevel['eGamma'] = 0
maxFoundTracks['eGamma'] = -1
#Copy custom eGamma settings
width['Jet'] = 20.0
nholesmax['Jet'] = 2
nholesgapmax['Jet'] = 2
xi2max['Jet'] = 15.0
xi2maxnoadd['Jet'] = 15.0
nweightedclustersmin['Jet'] = 8
nlayersused['Jet'] = 3
seedsFilterLevel['Jet'] = 0
maxFoundTracks['Jet'] = -1
#Copy custom eGamma settings
width['Tau'] = 20.0
nholesmax['Tau'] = 2
nholesgapmax['Tau'] = 2
xi2max['Tau'] = 15.0
xi2maxnoadd['Tau'] = 15.0
nweightedclustersmin['Tau'] = 8
nlayersused['Tau'] = 3
seedsFilterLevel['Tau'] = 0
maxFoundTracks['Tau'] = -1
# extend settings database
self.db['RoadWidth']=width
self.db['useZvertexTool'] = usezvtool
self.db['nClustersMin'] = nclustersmin
self.db['nHolesMax'] = nholesmax
self.db['nHolesGapMax'] = nholesgapmax
self.db['Xi2max'] = xi2max
self.db['Xi2maxNoAdd'] = xi2maxnoadd
self.db['nWeightedClustersMin'] = nweightedclustersmin
self.db['nUsedLayers'] = nlayersused
self.db['seedsFilterLevel'] = seedsFilterLevel
self.db['maxFoundTracks'] = maxFoundTracks
class SettingsForStrategyF(CommonSettings) :
def __init__(self):
CommonSettings.__init__(self)
......
......@@ -5,19 +5,17 @@ from TrigInDetRecoTools.TrigInDetRecoTools_ConfigB import FactoryForStrategyB
from TrigInDetRecoTools.TrigInDetRecoTools_ConfigC import FactoryForStrategyC
from TrigInDetRecoTools.TrigInDetRecoTools_ConfigF import FactoryForStrategyF
from TrigInDetRecoTools.TrigInDetRecoTools_ConfigA import FactoryForStrategyA
from TrigInDetRecoTools.TrigInDetRecoTools_ConfigBC import FactoryForStrategyBC
class TrigL2PattRecoStrategyFactory() :
__slots__=[]
def __init__(self, name = 'TrigL2PattRecoStrategyFactory') :
self.allowedStrNames = ['A', 'B', 'C', 'F', 'BC']
self.allowedStrNames = ['A', 'B', 'C', 'F']
self.commonSettings = CommonSettings()
self.factoryForStrB = FactoryForStrategyB()
self.factoryForStrC = FactoryForStrategyC()
self.factoryForStrF = FactoryForStrategyF()
self.factoryForStrA = FactoryForStrategyA()
self.factoryForStrBC = FactoryForStrategyBC()
def createStrategy(self, instName, strName, roiPhi=0.1, roiEta=0.1, ptCut = 2500.0) :
if strName in self.allowedStrNames :
if instName in self.commonSettings.allowedInstanceNames :
......@@ -38,10 +36,6 @@ class TrigL2PattRecoStrategyFactory() :
configuredStrF = self.factoryForStrF.createStrategy(instName)
return configuredStrF
if strName=='BC' :
configuredStrBC = self.factoryForStrBC.createStrategy(instName)
return configuredStrBC
else :
print "Instance "+instName+" of the Strategy"+strName+" is not supported !"
return None
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
from TrigInDetRecoTools.TrigInDetRecoToolsConf import TrigL2PattRecoStrategyBC
from TrigInDetRecoTools.ConfiguredSettings import SettingsForStrategyB
from TrigInDetRecoTools.ConfiguredSettings import SettingsForStrategyBC
from AthenaCommon.SystemOfUnits import *
from AthenaCommon.Logging import logging
log = logging.getLogger("FactoryForStrategyBC")
class FactoryForStrategyBC() :
__slots__=[]
def __init__(self, name = 'FactoryForStrategyBC') :
self.strategy = None
self.settings = SettingsForStrategyB()
self.settingsBC = SettingsForStrategyBC()
def createStrategy(self, instName) :
if instName in self.settings.allowedInstanceNames :
self.strategy = TrigL2PattRecoStrategyBC("StrategyBC_"+instName)
self.strategy.nUsedLayers = self.settingsBC[('nUsedLayers',instName)]
## Layer properties ##
self.strategy.Map_LayerOneMultiplicity = self.settings[('Map_LayerOneMultiplicity',instName)]
self.strategy.Map_LayerTwoMultiplicity = self.settings[('Map_LayerTwoMultiplicity',instName)]
self.strategy.Map_MaxLayerFailureFraction = 0.001
self.strategy.Map_MaxTotalFailureFraction = 0.00001
## New cut properties ##
self.strategy.Reco_NewCuts = False
self.strategy.Reco_NewCutsRZ = False
self.strategy.Reco_PtMinSeedDiff = 0.0
self.strategy.Reco_D0MaxSeedDiff = 2.0
self.strategy.Reco_PtMinTripletDiff = 0.0
self.strategy.Reco_D0MaxTripletDiff = 1.0
self.strategy.Reco_PtMin = self.settings[('pTmin',instName)]
self.strategy.Reco_D0Max = self.settings[('Reco_D0Max',instName)]
self.strategy.Reco_TimingFactor = 3.0
self.strategy.Reco_AlignmentScaling = 1.0
self.strategy.Reco_OutlierRemoval = False
self.strategy.Reco_OutlierRemovalCut = 0.9
self.strategy.Reco_OutlierRemovalLayers = 4
self.strategy.Reco_OutlierRemovalD0 = 0.005
self.strategy.Reco_OutlierRemovalPt = 40
self.strategy.Reco_MaxSeeds = 30000
self.strategy.Reco_MaxTracks = 3000
self.strategy.Reco_Z0Bin = 20
self.strategy.Reco_EtaBin = 0.1
self.strategy.maxFoundTracks = self.settingsBC[('maxFoundTracks',instName)]
## Preliminary vertexing properties ##
self.strategy.PreVertexing_Enable = False
self.strategy.PreVertexing_VtxName = "TrueTrigVertexColl"
self.strategy.PreVertexing_ZCut = 5
## Seeding properties ##
self.strategy.Seeding_PreCutRZ = 10000
self.strategy.Seeding_PreCutPhi = 3.15
self.strategy.Seeding_PreCutRPhi = 0.001
self.strategy.Seeding_CutRZ = 1.5
## Vertexing properties ##
self.strategy.Vertexing_Enable = self.settings[('Vertexing_Enable',instName)]
self.strategy.Vertexing_CutRZ = self.settings[('Vertexing_CutRZ',instName)]
self.strategy.Vertexing_CutRPhi = self.settings[('Vertexing_CutRPhi',instName)]
self.strategy.Vertexing_MaxVertices = 3
self.strategy.Vertexing_WindowSize = self.settings[('Vertexing_WindowSize',instName)]
self.strategy.Vertexing_WindowSegments = 4
## Extension properties ##
self.strategy.Extension_PreCutRZ = 10000
self.strategy.Extension_PreCutPhi = 3.15
self.strategy.Extension_PreCutRPhi = 0.0006
self.strategy.Extension_PreCutRPhiDiff = 0.0006
self.strategy.Extension_CutRZPixel = 0.8
self.strategy.Extension_CutRZ = 4.5
self.strategy.Extension_CutRPhi = 0.0035
self.strategy.Extension_CutSpacePoints = 4
self.strategy.Extension_CutSpacePointsMiss1 = 4
self.strategy.Extension_CutSpacePointsMiss2 = 4
self.strategy.Extension_SolveTriplets = True
self.strategy.Extension_SolveTripletsDRCut = 9.0
self.strategy.Extension_SolveTripletsPhiScale = 0.0006
self.strategy.Extension_SolveTripletsEtaScale = 0.0022
self.strategy.Extension_SolveTracks = True
self.strategy.Extension_SolveV0Tracks = True
self.strategy.Extension_SolveTracksDRCut = 9.0
self.strategy.Extension_SolveTracksPhiScale = 0.0006
self.strategy.Extension_SolveTracksEtaScale = 0.0022
self.strategy.Extension_SolveShared = True
self.strategy.Extension_MaxMissingLayers = 20
self.strategy.Extension_Refit = True
self.strategy.Extension_SpacePoints = self.settings[('Extension_SpacePoints',instName)]
self.strategy.Extension_SpacePointsMiss1 = self.settings[('Extension_SpacePointsMiss1',instName)]
self.strategy.Extension_SpacePointsMiss2 = self.settings[('Extension_SpacePointsMiss2',instName)]
self.strategy.Extension_TRTExtension = self.settings[('Extension_TRTExtension',instName)]
## Debug properties ##