ATLAS Offline Software
IDScanZFinder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // IdScan: IDScanZFinder
7 // ( see header-file for details )
8 // -------------------------------
9 // ATLAS Collaboration
11 
12 #include <cmath>
13 #include <vector>
14 
15 #include "IDScanZFinder.h"
16 #include "ZFinderConstants.h"
17 
21 
22 
23 using CLHEP::millimeter;
24 
25 
29 
30 IDScanZFinder::IDScanZFinder( const std::string& type, const std::string& name, const IInterface* parent) :
31  Run1::IDScanZFinderInternal<TrigSiSpacePoint>(type, name), AthAlgTool( type, name, parent ),
32  m_numberingTool("TrigL2LayerNumberTool")
33 {
34  declareInterface< ITrigRun1ZFinder >( this );
35 
36  declareProperty( "PhiBinSize", m_phiBinSize = 0.2 );
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 }
58 
59 
61 {
62  // NB: This should go into the InitializeInternal !!!!!!!!!
63  // NO internal settings should be changed in here, this should just
64  // be an athena wrapper !!!
65 
66  // phiBinSize is expected in degrees (~0.2); make sure it is > ZFinder_MinPhiSliceSize
67  //
68 
72  ATH_MSG_WARNING("Requested PhiBinSize of " << m_phiBinSize
73  << " degrees is smaller than the minimum allowed (" << ZFinder_MinPhiSliceSize
74  << " degrees). Set to the minimum value.");
75  // m_phiBinSize = ZFinder_MinPhiSliceSize;
76  }
77 
78  // NB: This should go into the InitializeInternal !!!!
79  if ( m_dphideta > 0 ){
80  ATH_MSG_WARNING("Requested DPhiDEta of " << m_dphideta
81  << " is positive. Setting to its negative!");
82  // m_dphideta *= -1.;
83  }
84 
85  ATH_CHECK( m_numberingTool.retrieve() );
86 
89  int offsetEndcapPixels = m_numberingTool->offsetEndcapPixels();
90  int maxSiliconLayerNum = m_numberingTool->maxSiliconLayerNum();
91  // int offsetBarrelSCT = m_numberingTool->offsetBarrelSCT();
92 
93 
94  // std::cout << "ZFinder::initialise() offset pixels " << offsetEndcapPixels
95  // << "\toffsetBarrelSCT " << offsetBarrelSCT
96  // << "\tmaxlayers " << maxSiliconLayerNum << std::endl;
97 
102  initializeInternal(maxSiliconLayerNum,offsetEndcapPixels-1);
103 
104  ATH_MSG_INFO("IDScanZFinder constructed: name() " << name() );
105  ATH_MSG_INFO("IDScanZFinderInternal version: " << getVersion() );
106  ATH_MSG_INFO("IDScanZFinder::PixOnly set to " << m_pixOnly );
107  ATH_MSG_INFO("IDScanZFinder::FullScanMode " << m_fullScanMode );
108  ATH_MSG_INFO("IDScanZFinder::PhiBinSize set to " << m_phiBinSize );
109  ATH_MSG_INFO("IDScanZFinder::# of peaks to consider: " << m_numberOfPeaks );
110  ATH_MSG_INFO("IDScanZFinder::z bin size " << m_minZBinSize );
111  ATH_MSG_INFO("IDScanZFinder::eta coeff " << m_zBinSizeEtaCoeff);
112 
113  ATH_MSG_INFO("IDScanZFinder::m_nFirstLayers = " << m_nFirstLayers );
114  ATH_MSG_INFO("IDScanZFinder::m_invPhiSliceSize = " << m_invPhiSliceSize );
115  ATH_MSG_INFO("IDScanZFinder::m_phiBinSize = " << m_phiBinSize );
116  ATH_MSG_INFO("IDScanZFinder::m_dphideta = " << m_dphideta );
117  ATH_MSG_INFO("IDScanZFinder::m_neighborMultiplier = " << m_neighborMultiplier);
118  ATH_MSG_INFO("IDScanZFinder::m_minZBinSize = " << m_minZBinSize );
119  ATH_MSG_INFO("IDScanZFinder::m_zBinSizeEtaCoeff = " << m_zBinSizeEtaCoeff);
120  ATH_MSG_INFO("IDScanZFinder::m_chargeAware = " << m_chargeAware );
121  ATH_MSG_INFO("IDScanZFinder::m_zHistoPerPhi = " << m_zHistoPerPhi );
122 
123  ATH_MSG_INFO("IDScanZFinder::m_nvrtxSeparation = " << m_nvrtxSeparation );
124  ATH_MSG_INFO("IDScanZFinder::m_vrtxDistCut = " << m_vrtxDistCut );
125  ATH_MSG_INFO("IDScanZFinder::m_vrtxMixing = " << m_vrtxMixing );
126  ATH_MSG_INFO("IDScanZFinder::m_preferCentralZ = " << m_preferCentralZ );
127 
128  ATH_MSG_INFO("IDScanZFinder::m_trustSPprovider = " << m_trustSPprovider );
129 
130  ATH_MSG_INFO("IDScanZFinder::m_tripletMode = " << m_tripletMode );
131 
132  ATH_MSG_INFO("IDScanZFinder::m_weigthThreshold = " << m_weightThreshold );
133 
134  return StatusCode::SUCCESS;
135 }
136 
137 
138 TrigVertexCollection* IDScanZFinder::findZ( const std::vector<const TrigSiSpacePoint *>& spVec, const IRoiDescriptor& roi)
139 {
140 
142 
143  std::vector<vertex>* vertices = findZInternal( spVec, roi);
144 
145  ATH_MSG_DEBUG("roi: " << roi);
146  ATH_MSG_DEBUG("m_NumPhiSlices: " << m_NumPhiSlices);
147 
148 
149  if ( GetInternalStatus()==-1 ) {
150  ATH_MSG_WARNING("phi of spacepoint out of range! phi=" << GetReturnValue());
151  ATH_MSG_WARNING("Exiting ZFinder...");
152 
153  }
154 
155  for ( unsigned int i=0 ; i<vertices->size() ; i++ ) {
156  output->push_back( new TrigVertex( (*vertices)[i]._z, (*vertices)[i]._weight, TrigVertex::NULLID ) );
157  }
158 
159  delete vertices;
160 
161  return output;
162 }
163 
Run1
USAGE: openCoraCool.exe "COOLONL_SCT/COMP200".
Definition: openCoraCool.cxx:57
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_preferCentralZ
bool m_preferCentralZ
Definition: IDScanZFinderInternal.h:140
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_zHistoPerPhi
bool m_zHistoPerPhi
Definition: IDScanZFinderInternal.h:121
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_nFirstLayers
int m_nFirstLayers
Definition: IDScanZFinderInternal.h:135
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_forcePhiBinSize
bool m_forcePhiBinSize
Definition: IDScanZFinderInternal.h:104
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TrigVertex::NULLID
@ NULLID
Definition: TrigVertex.h:31
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_neighborMultiplier
double m_neighborMultiplier
Definition: IDScanZFinderInternal.h:124
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_phiBinSize
double m_phiBinSize
Definition: IDScanZFinderInternal.h:103
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_fullScanMode
bool m_fullScanMode
Definition: IDScanZFinderInternal.h:146
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::getVersion
const std::string & getVersion() const
Definition: IDScanZFinderInternal.h:79
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_chargeAware
bool m_chargeAware
Definition: IDScanZFinderInternal.h:120
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_tripletDP
double m_tripletDP
Definition: IDScanZFinderInternal.h:152
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_numberOfPeaks
long m_numberOfPeaks
Definition: IDScanZFinderInternal.h:111
TrigSiSpacePoint.h
TrigSiSpacePoint
Definition: TrigSiSpacePoint.h:12
IDScanZFinder.h
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_tripletDK
double m_tripletDK
Definition: IDScanZFinderInternal.h:150
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_dphideta
double m_dphideta
Definition: IDScanZFinderInternal.h:123
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_invPhiSliceSize
double m_invPhiSliceSize
Definition: IDScanZFinderInternal.h:100
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_nvrtxSeparation
int m_nvrtxSeparation
Definition: IDScanZFinderInternal.h:139
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_zBinSizeEtaCoeff
double m_zBinSizeEtaCoeff
Definition: IDScanZFinderInternal.h:109
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_vrtxDistCut
double m_vrtxDistCut
Definition: IDScanZFinderInternal.h:137
IDScanZFinder::m_numberingTool
ToolHandle< ITrigL2LayerNumberTool > m_numberingTool
no private data members - all inherited from the IDScanZFinderInternal class NB: BE CAREFUL !...
Definition: IDScanZFinder.h:58
IDScanZFinder::initialize
virtual StatusCode initialize() override
Definition: IDScanZFinder.cxx:60
python.SystemOfUnits.millimeter
int millimeter
Definition: SystemOfUnits.py:53
lumiFormat.i
int i
Definition: lumiFormat.py:92
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_NumPhiSlices
long m_NumPhiSlices
Definition: IDScanZFinderInternal.h:101
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
IDScanZFinder::findZ
virtual TrigVertexCollection * findZ(const std::vector< const TrigSiSpacePoint * > &spVec, const IRoiDescriptor &roi) override
Definition: IDScanZFinder.cxx:138
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_vrtxMixing
double m_vrtxMixing
Definition: IDScanZFinderInternal.h:138
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
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::GetInternalStatus
int GetInternalStatus() const
Definition: IDScanZFinderInternal.h:81
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::initializeInternal
void initializeInternal(long maxLayers, long lastBarrel)
Definition: IDScanZFinderInternal.h:227
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_trustSPprovider
bool m_trustSPprovider
Definition: IDScanZFinderInternal.h:142
merge.output
output
Definition: merge.py:17
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_tripletDZ
double m_tripletDZ
Definition: IDScanZFinderInternal.h:149
ZFinder_MinPhiSliceSize
const double ZFinder_MinPhiSliceSize
Definition: ZFinderConstants.h:34
IDScanZFinder::IDScanZFinder
IDScanZFinder(const std::string &, const std::string &, const IInterface *)
Definition: IDScanZFinder.cxx:30
TrigVertexCollection
Definition: TrigVertexCollection.h:13
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_tripletMode
int m_tripletMode
Definition: IDScanZFinderInternal.h:148
TrigVertex.h
TrigVertex
Definition: TrigVertex.h:28
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_pixOnly
bool m_pixOnly
Definition: IDScanZFinderInternal.h:113
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ZFinderConstants.h
IRoiDescriptor.h
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_weightThreshold
double m_weightThreshold
to apply a hreshold to the found vertex candidates
Definition: IDScanZFinderInternal.h:156
AthAlgTool
Definition: AthAlgTool.h:26
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::m_minZBinSize
double m_minZBinSize
Definition: IDScanZFinderInternal.h:108
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::GetReturnValue
double GetReturnValue() const
Definition: IDScanZFinderInternal.h:88
Run1::IDScanZFinderInternal< TrigSiSpacePoint >::findZInternal
std::vector< vertex > * findZInternal(const std::vector< const TrigSiSpacePoint * > &spVec, const IRoiDescriptor &roi)
Definition: IDScanZFinderInternal.h:525