ATLAS Offline Software
TrigZFinder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
5 // IdScan: TrigZFinder
6 // ( see header-file for details )
7 // -------------------------------
8 // ATLAS Collaboration
10 
11 #include <cmath>
12 #include <vector>
13 
14 #include "TrigZFinder.h"
15 #include "ZFinderConstants.h"
16 
20 
21 
25 
26 TrigZFinder::TrigZFinder( const std::string& type, const std::string& name, const IInterface* parent) :
28  m_numberingTool("TrigL2LayerNumberTool")
29 {
30  declareInterface< ITrigZFinder >( this );
31 
32  // std::cout << "ZFinder::ZFinder() " << name << " " << type << "\tm_nFirstLayers " << m_nFirstLayers << std::endl;
33  // std::cout << "ZFinder::ZFinder() version " << name << " " << type << "\tTrigZFinder-00-00-62"<< std::endl;
34 
35  declareProperty( "PhiBinSize", m_phiBinSize = 0.2 );
36  declareProperty( "ForcePhiBinSize", m_forcePhiBinSize = false );
37  declareProperty( "UseOnlyPixels", m_pixOnly = false );
38  declareProperty( "MinZBinSize", m_minZBinSize = 0.2 );
39  declareProperty( "nFirstLayers", m_nFirstLayers = 3 );
40  declareProperty( "ZBinSizeEtaCoeff", m_zBinSizeEtaCoeff = 0.1 );
41  declareProperty( "DPhiDEta", m_dphideta = -0.02 );
42  declareProperty( "NeighborMultiplier", m_neighborMultiplier = 1.);
43  declareProperty( "NumberOfPeaks", m_numberOfPeaks = 1 );
44  declareProperty( "ChargeAware", m_chargeAware = false );
45  declareProperty( "ZHistoPerPhi", m_zHistoPerPhi = false );
46  declareProperty( "VrtxDistCut", m_vrtxDistCut = 0. );
47  declareProperty( "nVrtxSeparation", m_nvrtxSeparation = 0 );
48  declareProperty( "VrtxMixing", m_vrtxMixing = 0. );
49  declareProperty( "PreferCentralZ", m_preferCentralZ = true );
50  declareProperty( "TrustSPProvider", m_trustSPprovider = true );
51  declareProperty( "FullScanMode", m_fullScanMode = false );
52  declareProperty( "TripletMode", m_tripletMode = 0 );
53  declareProperty( "TripletDZ", m_tripletDZ = 25. );
54  declareProperty( "TripletDK", m_tripletDK = 0.005 );
55  declareProperty( "TripletDP", m_tripletDP = 0.05 );
56  declareProperty( "WeightThreshold", m_weightThreshold = 0 );
57  declareProperty( "MaxLayer", m_maxLayer = 32 );
58  declareProperty( "MinVtxSignificance", m_minVtxSignificance = 0 );
59  declareProperty( "Percentile", m_percentile = 1 );
60 
61 
62  declareProperty( "LayerNumberTool", m_numberingTool);
63 
64  // std::cout << "ZFinder::ZFinder() " << name << " " << type << "\tm_nFirstLayers " << m_nFirstLayers << std::endl;
65 
66 }
67 
68 
70 {
71  // NB: This should go into the InitializeInternal !!!!!!!!!
72  // NO internal settings should be changed in here, this should just
73  // be an athena wrapper !!!
74 
75  // phiBinSize is expected in degrees (~0.2); make sure it is > ZFinder_MinPhiSliceSize
76  //
77 
81  ATH_MSG_WARNING("Requested PhiBinSize of " << m_phiBinSize
82  << " degrees is smaller than the minimum allowed (" << ZFinder_MinPhiSliceSize
83  << " degrees). Set to the minimum value.");
84  // m_phiBinSize = ZFinder_MinPhiSliceSize;
85  }
86 
87  // NB: This should go into the InitializeInternal !!!!
88  if ( m_dphideta > 0 ){
89  ATH_MSG_WARNING("Requested DPhiDEta of " << m_dphideta
90  << " is positive. Setting to its negative!");
91  // m_dphideta *= -1.;
92  }
93 
94  ATH_CHECK(m_numberingTool.retrieve());
95 
98  int offsetEndcapPixels = m_numberingTool->offsetEndcapPixels();
99  int maxSiliconLayerNum = m_numberingTool->maxSiliconLayerNum();
100  // int offsetBarrelSCT = m_numberingTool->offsetBarrelSCT();
101 
102 
103  // std::cout << "ZFinder::initialise() offset pixels " << offsetEndcapPixels
104  // << "\toffsetBarrelSCT " << offsetBarrelSCT
105  // << "\tmaxlayers " << maxSiliconLayerNum << std::endl;
106 
111 
112  initializeInternal(maxSiliconLayerNum,offsetEndcapPixels-1);
113 
114  ATH_MSG_INFO("TrigZFinder constructed: name() " << name() );
115  ATH_MSG_INFO("TrigZFinder::PixOnly set to " << m_pixOnly );
116  ATH_MSG_INFO("TrigZFinder::FullScanMode " << m_fullScanMode );
117  ATH_MSG_INFO("TrigZFinder::PhiBinSize set to " << m_phiBinSize );
118  ATH_MSG_INFO("TrigZFinder::# of peaks to consider: " << m_numberOfPeaks );
119  ATH_MSG_INFO("TrigZFinder::z bin size " << m_minZBinSize );
120  ATH_MSG_INFO("TrigZFinder::eta coeff " << m_zBinSizeEtaCoeff);
121 
122  ATH_MSG_INFO("TrigZFinder::m_nFirstLayers = " << m_nFirstLayers );
123  ATH_MSG_INFO("TrigZFinder::m_invPhiSliceSize = " << m_invPhiSliceSize );
124  ATH_MSG_INFO("TrigZFinder::m_phiBinSize = " << m_phiBinSize );
125  ATH_MSG_INFO("TrigZFinder::m_dphideta = " << m_dphideta );
126  ATH_MSG_INFO("TrigZFinder::m_neighborMultiplier = " << m_neighborMultiplier);
127  ATH_MSG_INFO("TrigZFinder::m_minZBinSize = " << m_minZBinSize );
128  ATH_MSG_INFO("TrigZFinder::m_zBinSizeEtaCoeff = " << m_zBinSizeEtaCoeff);
129  ATH_MSG_INFO("TrigZFinder::m_chargeAware = " << m_chargeAware );
130  ATH_MSG_INFO("TrigZFinder::m_zHistoPerPhi = " << m_zHistoPerPhi );
131 
132  ATH_MSG_INFO("TrigZFinder::m_nvrtxSeparation = " << m_nvrtxSeparation );
133  ATH_MSG_INFO("TrigZFinder::m_vrtxDistCut = " << m_vrtxDistCut );
134  ATH_MSG_INFO("TrigZFinder::m_vrtxMixing = " << m_vrtxMixing );
135  ATH_MSG_INFO("TrigZFinder::m_preferCentralZ = " << m_preferCentralZ );
136 
137  ATH_MSG_INFO("TrigZFinder::m_trustSPprovider = " << m_trustSPprovider );
138 
139  ATH_MSG_INFO("TrigZFinder::m_tripletMode = " << m_tripletMode );
140 
141  ATH_MSG_INFO("TrigZFinder::m_maxLayer = " << m_maxLayer );
142 
143  ATH_MSG_INFO("TrigZFinder::m_minVtxSignificance = " << m_minVtxSignificance );
144 
145  if ( m_minVtxSignificance>0 ) {
146  ATH_MSG_INFO("TrigZFinder::m_percentile = " << m_percentile );
147  }
148 
149  ATH_MSG_INFO("TrigZFinder::m_weigthThreshold = " << m_weightThreshold );
150 
151  ATH_MSG_INFO("TrigZFinder::m_tripletDZ = " << m_tripletDZ );
152  ATH_MSG_INFO("TrigZFinder::m_tripletDK = " << m_tripletDK );
153  ATH_MSG_INFO("TrigZFinder::m_tripletDP = " << m_tripletDP );
154 
155  return StatusCode::SUCCESS;
156 }
157 
158 
159 
160 
161 TrigVertexCollection* TrigZFinder::findZ( const std::vector<TrigSiSpacePointBase>& spVec, const IRoiDescriptor& roi) const
162 {
163 
165 
166  std::vector<vertex>* vertices = findZInternal( spVec, roi );
167 
168  ATH_MSG_DEBUG( "findZ() roi: " << roi );
169 
170  for ( unsigned int i=0 ; i<vertices->size() ; i++ ) {
171  auto vtx = new TrigVertex((*vertices)[i]._z, (*vertices)[i]._weight, TrigVertex::NULLID);
172  output->push_back(vtx);
173  }
174 
175  delete vertices;
176 
177  return output;
178 }
179 
TrigZFinderInternal::m_tripletDP
double m_tripletDP
Definition: TrigZFinderInternal.h:134
TrigZFinderInternal::m_numberOfPeaks
long m_numberOfPeaks
Definition: TrigZFinderInternal.h:100
TrigZFinderInternal::m_pixOnly
bool m_pixOnly
Definition: TrigZFinderInternal.h:102
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TrigZFinderInternal::m_zBinSizeEtaCoeff
double m_zBinSizeEtaCoeff
Definition: TrigZFinderInternal.h:98
TrigVertex::NULLID
@ NULLID
Definition: TrigVertex.h:31
TrigZFinderInternal::m_trustSPprovider
bool m_trustSPprovider
Definition: TrigZFinderInternal.h:124
TrigZFinderInternal::m_preferCentralZ
bool m_preferCentralZ
Definition: TrigZFinderInternal.h:122
TrigZFinder::initialize
virtual StatusCode initialize() override
Definition: TrigZFinder.cxx:69
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TrigZFinderInternal
Definition: TrigZFinderInternal.h:34
TrigZFinderInternal::m_phiBinSize
double m_phiBinSize
Definition: TrigZFinderInternal.h:93
TrigZFinderInternal::m_chargeAware
bool m_chargeAware
Definition: TrigZFinderInternal.h:108
TrigZFinder
Definition: TrigZFinder.h:41
TrigZFinderInternal::m_vrtxDistCut
double m_vrtxDistCut
Definition: TrigZFinderInternal.h:119
TrigZFinderInternal::findZInternal
std::vector< vertex > * findZInternal(const std::vector< TrigSiSpacePointBase > &spVec, const IRoiDescriptor &roi) const
Definition: TrigZFinderInternal.cxx:378
TrigZFinderInternal::m_maxLayer
int m_maxLayer
Definition: TrigZFinderInternal.h:136
TrigZFinder::m_numberingTool
ToolHandle< ITrigL2LayerNumberTool > m_numberingTool
no private data members - all inherited from the TrigZFinderInternal class NB: BE CAREFUL !...
Definition: TrigZFinder.h:58
TrigZFinderInternal::m_weightThreshold
double m_weightThreshold
to apply a threshold to the found vertex candidates
Definition: TrigZFinderInternal.h:144
TrigZFinderInternal::m_fullScanMode
bool m_fullScanMode
Definition: TrigZFinderInternal.h:128
TrigZFinderInternal::m_zHistoPerPhi
bool m_zHistoPerPhi
Definition: TrigZFinderInternal.h:109
TrigZFinderInternal::m_nFirstLayers
int m_nFirstLayers
Definition: TrigZFinderInternal.h:117
TrigZFinder::findZ
virtual TrigVertexCollection * findZ(const std::vector< TrigSiSpacePointBase > &spVec, const IRoiDescriptor &roi) const override
Definition: TrigZFinder.cxx:161
TrigZFinderInternal::m_vrtxMixing
double m_vrtxMixing
Definition: TrigZFinderInternal.h:120
TrigZFinderInternal::m_neighborMultiplier
double m_neighborMultiplier
Definition: TrigZFinderInternal.h:112
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigZFinderInternal::m_invPhiSliceSize
double m_invPhiSliceSize
Definition: TrigZFinderInternal.h:90
TrigSiSpacePointBase.h
TrigZFinder::TrigZFinder
TrigZFinder(const std::string &, const std::string &, const IInterface *)
Definition: TrigZFinder.cxx:26
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigVertexCollection
Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Old Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Current Athena::TPCnvVers::Old TrigVertexCollection
Definition: TrigInDetEventTPCnv.cxx:236
TrigZFinderInternal::m_tripletMode
int m_tripletMode
Definition: TrigZFinderInternal.h:130
TrigZFinderInternal::m_nvrtxSeparation
int m_nvrtxSeparation
Definition: TrigZFinderInternal.h:121
TrigZFinderInternal::initializeInternal
void initializeInternal(long maxLayers, long lastBarrel)
Definition: TrigZFinderInternal.cxx:58
TrigZFinderInternal::m_forcePhiBinSize
bool m_forcePhiBinSize
Definition: TrigZFinderInternal.h:94
merge.output
output
Definition: merge.py:17
TrigZFinderInternal::m_minVtxSignificance
double m_minVtxSignificance
Definition: TrigZFinderInternal.h:138
TrigZFinder.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ZFinder_MinPhiSliceSize
const double ZFinder_MinPhiSliceSize
Definition: ZFinderConstants.h:34
TrigVertexCollection
Definition: TrigVertexCollection.h:13
TrigZFinderInternal::m_tripletDZ
double m_tripletDZ
Definition: TrigZFinderInternal.h:131
TrigVertex.h
TrigZFinderInternal::m_percentile
double m_percentile
Definition: TrigZFinderInternal.h:139
TrigVertex
Definition: TrigVertex.h:28
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TrigZFinderInternal::m_dphideta
double m_dphideta
Definition: TrigZFinderInternal.h:111
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ZFinderConstants.h
IRoiDescriptor.h
AthAlgTool
Definition: AthAlgTool.h:26
TrigZFinderInternal::m_tripletDK
double m_tripletDK
Definition: TrigZFinderInternal.h:132
TrigZFinderInternal::m_minZBinSize
double m_minZBinSize
Definition: TrigZFinderInternal.h:97