ATLAS Offline Software
InDetBeamSpotFinder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "InDetBeamSpotFinder.h"
7 #include "InDetBeamSpotVertex.h"
8 #include "InDetBeamSpotRooFit.h"
9 #include "GaudiKernel/ITHistSvc.h"
10 #include "VxVertex/VxCandidate.h"
13 
14 #include "EventInfo/EventInfo.h"
15 #include "EventInfo/EventID.h"
16 #include <algorithm>
17 
18 namespace{
19  //comparison of events for lumiBlock
20  auto lesserLumiBlock = [](const BeamSpot::Event & e1, const BeamSpot::Event & e2)->bool{
21  return (e1.lumiBlock<e2.lumiBlock);
22  };
23 
24  //comparison of events for run number
25  auto lesserRunNumber = [](const BeamSpot::Event & e1, const BeamSpot::Event & e2)->bool{
26  return (e1.runNumber<e2.runNumber);
27  };
28 
29 }
30 
31 InDet::InDetBeamSpotFinder::InDetBeamSpotFinder(const std::string& name, ISvcLocator* pSvcLocator):
32  AthAlgorithm(name, pSvcLocator),
33  m_toolSvc("ToolSvc",name)
34 {
35  declareProperty( "ToolSvc", m_toolSvc );
36  declareProperty( "BeamSpotToolList" , m_beamSpotToolList );
37  declareProperty( "RunRange" , m_maxRunsPerFit = 0 );
38  declareProperty( "LumiRange" , m_maxLBsPerFit = 0 );
39  declareProperty( "EventRange" , m_maxEventsPerFit = 0);
40  declareProperty( "UseBCID" , m_BCIDsToAccept );
41  declareProperty( "UseFilledBCIDsOnly", m_useFilledBCIDsOnly = true );
42  declareProperty( "MinTracksPerVtx", m_minTrackNum = 5);
43  declareProperty( "MaxTracksPerVtx", m_maxTrackNum = 1000000);
44  declareProperty( "MinVtxNum" , m_minVertexNum = 100);
45  declareProperty( "MaxVtxChi2" , m_maxChi2Vertex = 10);
46  declareProperty( "MaxTransverseErr", m_maxTransverseError=1000000);
47  declareProperty( "MaxAbsCorrelXY", m_maxAbsCorrelXY=0.8);
48  declareProperty( "VertexTypes" , m_vertexTypeNames);
49  declareProperty( "MinVtxProb" , m_minVtxProb=0.001);
50  declareProperty( "GroupFitsBy" , m_fitSortingKey = "none");
51  declareProperty( "VertexNtuple" , m_writeVertexNtuple = true);
52  declareProperty( "WriteAllVertices" , m_writeAllVertices=false);
53  declareProperty( "VertexTreeName" , m_vertexTreeName = "Vertices");
54  declareProperty( "SecondsPerFit", m_secondsPerFit = 1);
55 }
56 
58  ATH_MSG_DEBUG( "in initialize()");
59  if ( m_beamSpotToolList.empty() ){
60  ATH_MSG_FATAL("FATAL ERROR: must provide at least one beamspot tool in beamSpotToolList");
61  return StatusCode::FAILURE;
62  }
63 
64  ATH_CHECK( service("THistSvc",m_thistSvc) );
65  ATH_CHECK( m_toolSvc.retrieve() );
66 
68 
70  ATH_CHECK( m_vertexContainer.initialize() );
71 
72  for ( unsigned int i = 0; i < m_beamSpotToolList.size(); i++){ ATH_CHECK( m_beamSpotToolList[i].retrieve() );}
76  return StatusCode::SUCCESS;
77 }
78 
82  if ( !passEventSelection( *eventInfo ) ) return StatusCode::SUCCESS;
83  BeamSpot::Event currentEvent = readEvent(*eventInfo, *vertexContainer);
84 
85  m_eventList.push_back( currentEvent );
86  if( m_writeVertexNtuple ){
87  for( auto & thisVertex: currentEvent.vertices){
88  if( thisVertex.passed || m_writeAllVertices ){
89  writeToVertexTree( currentEvent, thisVertex );
90  }
91  }
92  }
93  return StatusCode::SUCCESS;
94 }
95 
97  ATH_MSG_DEBUG( "in finalize()" );
98  sortEvents();
100  return StatusCode::SUCCESS;
101 }
102 
106  event.pileup = ceil(eventInfo.actualInteractionsPerCrossing());
107  event.runNumber = eventInfo.runNumber();
108  event.lumiBlock = eventInfo.lumiBlock();
109  event.bcid = eventInfo.bcid();
110  event.eventTime = eventInfo.timeStamp();
111  event.eventTime_NS = eventInfo.timeStampNSOffset();
112  event.eventNumber = eventInfo.eventNumber();
113  const EventInfo* BSeventInfo;
114  //This is required for pseudo lumiblocks
115 
116  if( evtStore()->retrieve(BSeventInfo) != StatusCode::SUCCESS){
117  ATH_MSG_ERROR("Cannot get event info.");
118  return event;
119  }
120  if (event.lumiBlock != BSeventInfo->event_ID()->lumi_block())
121  {
122  event.lumiBlock = BSeventInfo->event_ID()->lumi_block();
123  }
124 
125  for(const xAOD::Vertex* vtx:vertexContainer) {
126  if (vtx->vertexType() == xAOD::VxType::NoVtx) continue;
127  vertex.x = vtx->x();
128  vertex.y = vtx->y();
129  vertex.z = vtx->z();
130  vertex.vxx = vtx->covariancePosition()(0,0);
131  vertex.vxy = vtx->covariancePosition()(0,1);
132  vertex.vyy = vtx->covariancePosition()(1,1);
133  vertex.vzz = vtx->covariancePosition()(2,2);
134  vertex.vertexType = vtx->vertexType();
135  vertex.nTracks = vtx->nTrackParticles();
136  vertex.passed = passVertexSelection( vtx );
137  vertex.valid = vertex.passed;
138  //Remove vertices with wrong x-y correlation
139  if(vertex.vxy*vertex.vxy/vertex.vxx/vertex.vyy > 1.0 ||
140  vertex.vzz < 0. ||
141  vertex.vyy < 0. ||
142  vertex.vxx < 0.) {
143  ATH_MSG_DEBUG("Bad vertex: " << event.eventNumber << " " << vtx->vertexType() << " "
144  << vertex.x << " " << vertex.y << " " << vertex.z << " "
145  << vertex.vxx << " " << vertex.vyy << " " << vertex.vzz << " "
146  << vertex.nTracks << " " << vertex.vxy*vertex.vxy/vertex.vxx/vertex.vyy);
147  }
149  vertex.vzz < 0. ||
150  vertex.vyy < 0. ||
151  vertex.vxx < 0.) continue;
152  event.vertices.push_back( vertex );
153  }
154  return event;
155 }
156 
158  for( const auto & thisEvent: m_eventList){
160  id.runNumber( (m_maxRunsPerFit > 0) ? thisEvent.runNumber : 0 );
161  id.lumiBlock( (m_maxLBsPerFit > 0) ? thisEvent.lumiBlock : 0 );
162  id.pileup ( iequals(m_fitSortingKey,"pileup") ? thisEvent.pileup : 0 );
163  id.bcid ( iequals(m_fitSortingKey,"bcid" ) ? thisEvent.bcid : 0 );
164  id.timeStamp( iequals(m_fitSortingKey,"time" ) ? thisEvent.eventTime/m_secondsPerFit : 0 );
165  m_eventMap[id].push_back( thisEvent );
166  }
167  auto iter = m_eventMap.begin();
168  BeamSpot::ID lastID = iter->first;
169  BeamSpot::ID currentID = iter->first;
170  unsigned int nRuns = 0;
171  unsigned int nLBs = 0;
172  unsigned int nFits = 1;
173  m_sortedEventList.resize( nFits );
174 
175  for( iter = m_eventMap.begin(); iter != m_eventMap.end(); ++iter){
176  currentID = iter->first;
177  if( iter == m_eventMap.begin() || currentID.runNumber() != lastID.runNumber() ){ nRuns++; }
178  if( iter == m_eventMap.begin() || currentID.lumiBlock() != lastID.lumiBlock() ){ nLBs++; }
179  if( currentID.timeStamp() != lastID.timeStamp() ||
180  currentID.pileup() != lastID.pileup()
181  || currentID.bcid() != lastID.bcid()
182  || ( m_maxRunsPerFit > 0 && nRuns > m_maxRunsPerFit )
183  || ( m_maxLBsPerFit > 0 && nLBs > m_maxLBsPerFit )){
184  ATH_MSG_INFO( "New Fit " << currentID.timeStamp() << "<--"<< lastID.timeStamp() << "\n\t"
185  << currentID.pileup() << " <-- " << lastID.pileup() << "\n\t"
186  << currentID.bcid() << " <-- " << lastID.bcid() << "\n\t"
187  << nRuns << " " << m_maxRunsPerFit << "\n\t"
188  << nLBs << " " << m_maxLBsPerFit );
189 
190  nFits++;
191  m_sortedEventList.resize(nFits);
192  nRuns = 1; nLBs = 1;
193  }
194  for( unsigned int i = 0; i < iter->second.size(); i++){
195  if( m_sortedEventList.at(nFits-1).size() == m_maxEventsPerFit && m_maxEventsPerFit > 0 ){
196  nFits++;
197  m_sortedEventList.resize(nFits);
198  nRuns = 1; nLBs = 1;
199  }
200 
201  m_sortedEventList.at(nFits-1).push_back( iter->second.at(i) );
202  }
203  lastID = iter->first;
204  }
205 }
206 
207 //Convert the vector of strings to vector of vertex types.
209  if ( not m_vertexTypeNames.empty() ) {
210  for ( std::vector<std::string>::const_iterator it = m_vertexTypeNames.begin();
211  it != m_vertexTypeNames.end(); ++it) {
212  if ((*it) == "NoVtx") ;
213  else if ((*it) == "PriVtx") m_vertexTypes.push_back(xAOD::VxType::PriVtx);
214  else if ((*it) == "SecVtx") m_vertexTypes.push_back(xAOD::VxType::SecVtx);
215  else if ((*it) == "PileUp") m_vertexTypes.push_back(xAOD::VxType::PileUp);
216  else if ((*it) == "ConvVtx") m_vertexTypes.push_back(xAOD::VxType::ConvVtx);
217  else if ((*it) == "V0Vtx") m_vertexTypes.push_back(xAOD::VxType::V0Vtx);
218  else if ((*it) == "KinkVtx") m_vertexTypes.push_back(xAOD::VxType::KinkVtx);
219  else if ((*it) =="NotSpecified")m_vertexTypes.push_back(xAOD::VxType::NotSpecified) ;
220  }
221  ATH_MSG_INFO("Allowing " << m_vertexTypes.size() << " Vertex types" );
222  }
223  else {
224  ATH_MSG_DEBUG( "No selection based on vertexType will be done" );
225  }
226 }
227 
229  const int bcid = eventInfo.bcid();
230  if ( m_useFilledBCIDsOnly) {
232  if ( !bcData->isFilled(bcid) ) return false;
233  }
234  if( m_BCIDsToAccept.begin() != m_BCIDsToAccept.end() )
235  return ( std::find(m_BCIDsToAccept.begin(), m_BCIDsToAccept.end(), bcid) != m_BCIDsToAccept.end());
236  else
237  return true;
238 }
239 
241  if(!vtx) { return false; }
242  if(m_vertexTypes.end() == std::find( m_vertexTypes.begin(), m_vertexTypes.end(), vtx->vertexType() ) ) { return false; }
243  if(vtx->chiSquared()/vtx->numberDoF() > m_maxChi2Vertex) { return false; }
244  if(static_cast<int>(vtx->nTrackParticles()) < m_minTrackNum ){ return false; }
245  if(static_cast<int>(vtx->nTrackParticles()) > m_maxTrackNum ){ return false; }
246  if(TMath::Prob(vtx->chiSquared(), vtx->numberDoF()) < m_minVtxProb ) { return false; }
247  if(vtx->covariancePosition()(0,0) <= 0 || vtx->covariancePosition()(1,1) <= 0 || vtx->covariancePosition()(2,2) <= 0 ) { return false; }
248  double maxTransverseError2 = m_maxTransverseError * m_maxTransverseError;
249  if(vtx->covariancePosition()(0,0) > maxTransverseError2 || vtx->covariancePosition()(1,1) > maxTransverseError2) {return false;}
250  return true;
251 }
252 
254  const std::string inRootID = "/INDETBEAMSPOTFINDER/";
255  const std::string svrts = m_vertexTreeName;
256  m_root_vrt = new TTree(svrts.data(),"Vertices");
257  m_root_vrt->Branch("vrt",&m_root_vtx,"x/D:y:z:vxx:vxy:vyy:vzz:vType/i:run:lb:bcid:pileup:nTracks:eventNumber/l:eventTime:eventTime_NS:passed/O:valid");
258  return m_thistSvc->regTree(inRootID+svrts,m_root_vrt);
259 }
260 
262  IInDetBeamSpotTool::FitStatus bsFitStatus;
263  std::vector<BeamSpot::VrtHolder> verticesToFit;
264 
265  for( auto & eventList: m_sortedEventList){
266  verticesToFit.clear();
267  for( const auto & thisEvent: eventList){
268  for( const auto & thisVertex: thisEvent.vertices){
269  if( thisVertex.passed ) {
270  verticesToFit.push_back( thisVertex );
271  }
272  }
273  }
274 
275  for( unsigned int j = 0; j < m_beamSpotToolList.size(); j++){
276  IInDetBeamSpotTool * bs(nullptr);
277  bs = cloneTool(j);
278  if(!bs){ return StatusCode::FAILURE; }
279  if(not verticesToFit.empty()) { bsFitStatus = bs->fit(verticesToFit); }
280  else { bsFitStatus = IInDetBeamSpotTool::unsolved; }
281 
285  int fitStat;
286  if ( bsFitStatus == IInDetBeamSpotTool::successful)
287  fitStat = 3;
288  else if ( bsFitStatus == IInDetBeamSpotTool::problems)
289  fitStat = 1;
290  else if ( bsFitStatus == IInDetBeamSpotTool::failed || bsFitStatus == IInDetBeamSpotTool::unsolved)
291  fitStat = 0;
292  else
293  fitStat = 0;
295  if (bs->getParamMap()["sigmaX"] == 0 && bs->getParamMap()["sigmaY"] ==0 ) { m_BeamStatusCode.setFitWidth( false); }
296  else { m_BeamStatusCode.setFitWidth(true); }
297 
298  if(not eventList.empty()) writeToBeamSpotTree( bs, eventList, verticesToFit );
299  }
300  }
301  return StatusCode::SUCCESS;
302 }
303 
305  const std::string inRootID = "/INDETBEAMSPOTFINDER/";
306  const std::string sbs = "BeamSpotNt";//m_root_beamspotName;
307  m_root_bs = new TTree(sbs.data(),"Beamspot Solutions");
308  m_root_bs->Branch("bcid", &m_beamSpotNtuple.bcid,"bcid/I");
309  m_root_bs->Branch("pileup", &m_beamSpotNtuple.pileup,"pileup/I");
310  m_root_bs->Branch("defectWord", &m_beamSpotNtuple.defectWord, "defectWord/I");
311  m_root_bs->Branch("fill", &m_beamSpotNtuple.fill, "fill/I");
312  m_root_bs->Branch("lbEnd", &m_beamSpotNtuple.lbEnd, "lbEnd/I");
313  m_root_bs->Branch("lbStart", &m_beamSpotNtuple.lbStart, "lbStart/I");
314  m_root_bs->Branch("nEvents", &m_beamSpotNtuple.nEvents, "nEvents/I");
315  m_root_bs->Branch("nValid", &m_beamSpotNtuple.nValid, "nValid/I");
316  m_root_bs->Branch("nVtxAll", &m_beamSpotNtuple.nVtxAll, "nVtxAll/I");
317  m_root_bs->Branch("nVtxPrim", &m_beamSpotNtuple.nVtxPrim, "nVtxPrim/I");
318  m_root_bs->Branch("separation", &m_beamSpotNtuple.separation, "separation/I");
319  m_root_bs->Branch("status", &m_beamSpotNtuple.status, "status/I");
320  m_root_bs->Branch("timeEnd", &m_beamSpotNtuple.timeEnd, "timeEnd/I");
321  m_root_bs->Branch("timeStart", &m_beamSpotNtuple.timeStart, "timeStart/I");
322  m_root_bs->Branch("run", &m_beamSpotNtuple.run, "run/I");
323  m_root_bs->Branch("runEnd", &m_beamSpotNtuple.runEnd, "runEnd/I");
324 
325  for( auto &tool : m_beamSpotToolList ){
326  std::map<std::string,double> paramMap = tool->getParamMap();
327  std::map<std::string,double> covMap = tool->getCovMap();
328 
329  std::string slashD = "/D";
330  std::string keySlashD;
331 
332  //Loop over the parameters for a given fit tool, and create a branch for each if it doesn't exist
333  for( std::map<std::string,double>::iterator iter = paramMap.begin(); iter != paramMap.end(); ++iter){
334  std::string key = iter->first;
335  //double val = iter->second;
336  if( !(m_root_bs->GetBranch(key.c_str())) ){
338  keySlashD = key + slashD;
339  m_root_bs->Branch(key.c_str(), &m_beamSpotNtuple.paramMap[key], keySlashD.c_str());
340  }
341  }
342  //Loop over the covariance matrix for a given fit tool and create a branch for each element, if it doesn't already exist.
343  for( std::map<std::string,double>::iterator iter = covMap.begin(); iter != covMap.end(); ++iter){
344  const std::string & key = iter->first;
345  //double val = iter->second;
346  if( !(m_root_bs->GetBranch(key.c_str())) ){
348  keySlashD = key + slashD;
349  m_root_bs->Branch( key.c_str(), &m_beamSpotNtuple.covMap[key], keySlashD.c_str());
350  }
351  }
352  }
353  return m_thistSvc->regTree(inRootID+sbs,m_root_bs);
354 }
355 
357  m_root_vtx.x = vtx.x;
358  m_root_vtx.y = vtx.y;
359  m_root_vtx.z = vtx.z;
360  m_root_vtx.vxx = vtx.vxx;
361  m_root_vtx.vxy = vtx.vxy;
362  m_root_vtx.vyy = vtx.vyy;
363  m_root_vtx.vzz = vtx.vzz;
365  m_root_vtx.run = evt.runNumber;
366  m_root_vtx.lb = evt.lumiBlock;
367  m_root_vtx.bcid = evt.bcid;
368  m_root_vtx.pileup = evt.pileup;
369  m_root_vtx.nTracks = vtx.nTracks;
370  m_root_vtx.passed = vtx.passed;
371  m_root_vtx.valid = vtx.valid;
372  m_root_vtx.eventNumber = evt.eventNumber;
373  m_root_vtx.eventTime = evt.eventTime;
374  m_root_vtx.eventTime_NS = evt.eventTime_NS;
375  m_root_vrt->Fill();
376 }
377 
378 bool InDet::InDetBeamSpotFinder::iequals(const std::string& a, const std::string& b)
379 {
380  unsigned int sz = a.size();
381  if (b.size() != sz)
382  return false;
383  for (unsigned int i = 0; i < sz; ++i)
384  if (tolower(a[i]) != tolower(b[i]))
385  return false;
386  return true;
387 }
388 
389 void InDet::InDetBeamSpotFinder::writeToBeamSpotTree(const IInDetBeamSpotTool *bs, std::vector<BeamSpot::Event> &eventList, std::vector<BeamSpot::VrtHolder> &vertexList){
390  m_beamSpotNtuple.pileup = iequals(m_fitSortingKey,"pileup") ? eventList.at(0).pileup : 0;
391  m_beamSpotNtuple.bcid = iequals(m_fitSortingKey,"bcid") ? eventList.at(0).bcid : 0;
397  m_beamSpotNtuple.nValid = vertexList.size();
398  unsigned int nVtxAll = 0;
399  unsigned int nVtxPrim = 0;
400  auto isPrimaryVertex=[](const BeamSpot::VrtHolder & vertex){ return (vertex.vertexType == xAOD::VxType::PriVtx); };
401  for( const auto & thisEvent : eventList){
402  const auto & theseVertices=thisEvent.vertices;
403  nVtxAll += theseVertices.size();
404  nVtxPrim+= std::count_if(theseVertices.begin(), theseVertices.end(), isPrimaryVertex);
405  }
406  m_beamSpotNtuple.nVtxAll = nVtxAll;
407  m_beamSpotNtuple.nVtxPrim = nVtxPrim;
411  m_beamSpotNtuple.timeEnd = iequals(m_fitSortingKey,"time") ? eventList.back().eventTime : 0;
412  m_beamSpotNtuple.timeStart = iequals(m_fitSortingKey,"time") ? eventList.front().eventTime : 0;
414  const auto & bsToolParamMap = bs->getParamMap();
415  const auto & bsToolCovMap= bs->getCovMap();
416  for (auto & param:m_beamSpotNtuple.paramMap){
417  const std::string & key = param.first;
418  const auto & bsToolEquivalent =bsToolParamMap.find(key);
419  param.second = ( bsToolEquivalent == bsToolParamMap.end() ) ? 0 : bsToolEquivalent->second;
420  }
428  for (auto & covariance:m_beamSpotNtuple.covMap){
429  const std::string & key = covariance.first;
430  const auto & bsToolEquivalent = bsToolCovMap.find(key);
431  covariance.second = ( bsToolEquivalent == bsToolCovMap.end() ) ? 0 : bsToolEquivalent->second;
432  }
440  m_root_bs->Fill();
441 }
442 
445  IInDetBeamSpotTool * temp = orig->Clone();
446  return temp;
447 }
448 
449 int InDet::InDetBeamSpotFinder::min_lb( std::vector<BeamSpot::Event> & eventList ){
450  const auto smallestLbEvent=std::min_element(eventList.begin(),eventList.end(), lesserLumiBlock);
451  return smallestLbEvent->lumiBlock;
452 }
453 
454 int InDet::InDetBeamSpotFinder::max_lb( std::vector<BeamSpot::Event> & eventList ){
455  const auto largestLbEvent=std::max_element(eventList.begin(),eventList.end(), lesserLumiBlock);
456  return largestLbEvent->lumiBlock;
457 }
458 
459 int InDet::InDetBeamSpotFinder::min_run( std::vector<BeamSpot::Event> & eventList ){
460  const auto smallestRunEvent=std::min_element(eventList.begin(),eventList.end(), lesserRunNumber);
461  return smallestRunEvent->runNumber;
462 }
463 
464 int InDet::InDetBeamSpotFinder::max_run( std::vector<BeamSpot::Event> & eventList ){
465  const auto largestRunEvent=std::max_element(eventList.begin(),eventList.end(), lesserRunNumber);
466  return largestRunEvent->runNumber;
467 }
468 
InDet::InDetBeamSpotFinder::m_writeVertexNtuple
bool m_writeVertexNtuple
Definition: InDetBeamSpotFinder.h:67
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::lbStart
int lbStart
Definition: InDetBeamSpotFinder.h:75
InDet::InDetBeamSpotFinder::m_vertexTypes
std::vector< xAOD::VxType::VertexType > m_vertexTypes
Definition: InDetBeamSpotFinder.h:126
InDet::InDetBeamSpotFinder::convertVtxTypeNames
void convertVtxTypeNames()
Definition: InDetBeamSpotFinder.cxx:208
InDet::InDetBeamSpotFinder::cloneTool
IInDetBeamSpotTool * cloneTool(int)
Definition: InDetBeamSpotFinder.cxx:443
InDet::InDetBeamSpotFinder::vertexNtuple_struct::eventNumber
unsigned long long eventNumber
Definition: InDetBeamSpotFinder.h:86
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
InDet::InDetBeamSpotFinder::vertexNtuple_struct::run
unsigned int run
Definition: InDetBeamSpotFinder.h:85
InDetBeamSpotFinder.h
fitman.sz
sz
Definition: fitman.py:527
BeamSpot::VrtHolder::vxy
double vxy
Definition: IInDetBeamSpotTool.h:25
xAOD::Vertex_v1::nTrackParticles
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Definition: Vertex_v1.cxx:270
InDet::InDetBeamSpotFinder::m_BCIDsToAccept
std::vector< unsigned int > m_BCIDsToAccept
Definition: InDetBeamSpotFinder.h:65
InDet::InDetBeamSpotFinder::initialize
virtual StatusCode initialize() override
Definition: InDetBeamSpotFinder.cxx:57
InDet::InDetBeamSpotFinder::min_run
int min_run(std::vector< BeamSpot::Event > &)
Definition: InDetBeamSpotFinder.cxx:459
InDet::InDetBeamSpotFinder::vertexNtuple_struct::vxx
double vxx
Definition: InDetBeamSpotFinder.h:83
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
InDet::InDetBeamSpotFinder::max_lb
int max_lb(std::vector< BeamSpot::Event > &)
Definition: InDetBeamSpotFinder.cxx:454
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
InDet::InDetBeamSpotFinder::m_useFilledBCIDsOnly
bool m_useFilledBCIDsOnly
Definition: InDetBeamSpotFinder.h:133
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
InDet::InDetBeamSpotFinder::m_vertexContainer
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer
Definition: InDetBeamSpotFinder.h:58
egammaEnergyPositionAllSamples::e1
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
InDet::BeamSpotStatusCode::setAlgType
void setAlgType(int type)
Definition: BeamSpotStatusCode.h:45
xAOD::VxType::V0Vtx
@ V0Vtx
Vertex from V0 decay.
Definition: TrackingPrimitives.h:575
InDet::InDetBeamSpotFinder::m_maxLBsPerFit
unsigned int m_maxLBsPerFit
Definition: InDetBeamSpotFinder.h:63
InDet::InDetBeamSpotFinder::passEventSelection
bool passEventSelection(const xAOD::EventInfo &)
Definition: InDetBeamSpotFinder.cxx:228
InDet::BeamSpotStatusCode::clearWord
void clearWord()
Definition: BeamSpotStatusCode.h:57
skel.it
it
Definition: skel.GENtoEVGEN.py:423
IInDetBeamSpotTool.h
InDet::InDetBeamSpotFinder::m_thistSvc
ITHistSvc * m_thistSvc
Definition: InDetBeamSpotFinder.h:70
InDet::InDetBeamSpotFinder::vertexNtuple_struct::pileup
unsigned int pileup
Definition: InDetBeamSpotFinder.h:85
BeamSpot::Event::vertices
std::vector< BeamSpot::VrtHolder > vertices
Definition: IInDetBeamSpotTool.h:36
InDet::BeamSpotStatusCode::getWord
int getWord() const
Definition: BeamSpotStatusCode.h:59
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
InDet::InDetBeamSpotFinder::m_bcDataKey
SG::ReadCondHandleKey< BunchCrossingCondData > m_bcDataKey
Definition: InDetBeamSpotFinder.h:53
InDet::InDetBeamSpotFinder::vertexNtuple_struct::vzz
double vzz
Definition: InDetBeamSpotFinder.h:83
InDet::IInDetBeamSpotTool::getFitID
virtual FitID getFitID() const =0
A unique ID for the specific fit type.
xAOD::EventInfo_v1::timeStampNSOffset
uint32_t timeStampNSOffset() const
Nanosecond time offset wrt. the time stamp.
InDet::InDetBeamSpotFinder::m_maxEventsPerFit
unsigned int m_maxEventsPerFit
Definition: InDetBeamSpotFinder.h:62
InDet::InDetBeamSpotFinder::vertexNtuple_struct::z
double z
Definition: InDetBeamSpotFinder.h:83
InDet::InDetBeamSpotFinder::m_eventInfo
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Definition: InDetBeamSpotFinder.h:56
xAOD::Vertex_v1::vertexType
VxType::VertexType vertexType() const
The type of the vertex.
xAOD::VxType::NoVtx
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
Definition: TrackingPrimitives.h:570
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
InDet::InDetBeamSpotFinder::m_writeAllVertices
bool m_writeAllVertices
Definition: InDetBeamSpotFinder.h:136
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
InDet::InDetBeamSpotFinder::finalize
virtual StatusCode finalize() override
Definition: InDetBeamSpotFinder.cxx:96
InDet::InDetBeamSpotFinder::sortEvents
void sortEvents()
Definition: InDetBeamSpotFinder.cxx:157
EventID.h
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
BeamSpot::VrtHolder::passed
bool passed
Definition: IInDetBeamSpotTool.h:28
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::timeEnd
int timeEnd
Definition: InDetBeamSpotFinder.h:77
InDet::IInDetBeamSpotTool::successful
@ successful
Definition: IInDetBeamSpotTool.h:49
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
InDet::BeamSpotStatusCode::setFitStatus
void setFitStatus(int status)
Definition: BeamSpotStatusCode.h:38
BeamSpot::VrtHolder::valid
bool valid
Definition: IInDetBeamSpotTool.h:28
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
BeamSpot::VrtHolder::vzz
double vzz
Definition: IInDetBeamSpotTool.h:25
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::runEnd
int runEnd
Definition: InDetBeamSpotFinder.h:77
BeamSpot::VrtHolder::z
double z
Definition: IInDetBeamSpotTool.h:24
lumiFormat.i
int i
Definition: lumiFormat.py:92
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::nVtxAll
int nVtxAll
Definition: InDetBeamSpotFinder.h:76
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::nEvents
int nEvents
Definition: InDetBeamSpotFinder.h:76
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::covMap
std::map< std::string, double > covMap
Definition: InDetBeamSpotFinder.h:79
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::VxType::SecVtx
@ SecVtx
Secondary vertex.
Definition: TrackingPrimitives.h:572
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
InDet::InDetBeamSpotFinder::vertexNtuple_struct::lb
unsigned int lb
Definition: InDetBeamSpotFinder.h:85
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::paramMap
std::map< std::string, double > paramMap
Definition: InDetBeamSpotFinder.h:78
BeamSpot::VrtHolder::y
double y
Definition: IInDetBeamSpotTool.h:24
BeamSpot::ID::lumiBlock
unsigned int lumiBlock() const
Definition: BeamSpotID.h:14
InDet::IInDetBeamSpotTool::problems
@ problems
Definition: IInDetBeamSpotTool.h:49
BeamSpot::ID::timeStamp
unsigned long timeStamp() const
Definition: BeamSpotID.h:17
EventInfo::event_ID
EventID * event_ID()
the unique identification of the event.
Definition: EventInfo/EventInfo/EventInfo.h:210
tolower
void tolower(std::string &s)
Definition: AthenaSummarySvc.cxx:113
InDet::IInDetBeamSpotTool::FitStatus
FitStatus
Internally used enum for fit status.
Definition: IInDetBeamSpotTool.h:49
InDet::InDetBeamSpotFinder::vertexNtuple_struct::passed
bool passed
Definition: InDetBeamSpotFinder.h:87
InDet::InDetBeamSpotFinder::min_lb
int min_lb(std::vector< BeamSpot::Event > &)
Definition: InDetBeamSpotFinder.cxx:449
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:571
InDet::InDetBeamSpotFinder::m_root_bs
TTree * m_root_bs
Definition: InDetBeamSpotFinder.h:71
InDet::InDetBeamSpotFinder::setupBeamSpotTree
StatusCode setupBeamSpotTree()
Definition: InDetBeamSpotFinder.cxx:304
InDetBeamSpotVertex.h
compileRPVLLRates.eventList
list eventList
Definition: compileRPVLLRates.py:147
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::run
int run
Definition: InDetBeamSpotFinder.h:77
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::fill
int fill
Definition: InDetBeamSpotFinder.h:75
InDet::InDetBeamSpotFinder::m_maxChi2Vertex
double m_maxChi2Vertex
Definition: InDetBeamSpotFinder.h:119
InDet::InDetBeamSpotFinder::m_eventList
std::vector< BeamSpot::Event > m_eventList
Definition: InDetBeamSpotFinder.h:95
BeamSpot::ID::bcid
unsigned int bcid() const
Definition: BeamSpotID.h:16
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
InDet::InDetBeamSpotFinder::m_root_vtx
vertexNtuple_struct m_root_vtx
Definition: InDetBeamSpotFinder.h:91
BeamSpot::VrtHolder::vertexType
xAOD::VxType::VertexType vertexType
Definition: IInDetBeamSpotTool.h:26
BeamSpot::VrtHolder::vyy
double vyy
Definition: IInDetBeamSpotTool.h:25
xAOD::VxType::KinkVtx
@ KinkVtx
Kink vertex.
Definition: TrackingPrimitives.h:576
InDet::InDetBeamSpotFinder::m_vertexTreeName
std::string m_vertexTreeName
Definition: InDetBeamSpotFinder.h:94
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
InDet::IInDetBeamSpotTool::unsolved
@ unsolved
Definition: IInDetBeamSpotTool.h:49
InDet::InDetBeamSpotFinder::passVertexSelection
bool passVertexSelection(const xAOD::Vertex *)
Definition: InDetBeamSpotFinder.cxx:240
InDet::InDetBeamSpotFinder::vertexNtuple_struct::bcid
unsigned int bcid
Definition: InDetBeamSpotFinder.h:85
InDet::InDetBeamSpotFinder::performFits
StatusCode performFits()
Definition: InDetBeamSpotFinder.cxx:261
InDet::InDetBeamSpotFinder::writeToVertexTree
void writeToVertexTree(BeamSpot::Event &, BeamSpot::VrtHolder &)
Definition: InDetBeamSpotFinder.cxx:356
InDet::IInDetBeamSpotTool::failed
@ failed
Definition: IInDetBeamSpotTool.h:49
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
InDet::InDetBeamSpotFinder::m_sortedEventList
std::vector< std::vector< BeamSpot::Event > > m_sortedEventList
Definition: InDetBeamSpotFinder.h:97
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::defectWord
int defectWord
Definition: InDetBeamSpotFinder.h:75
xAOD::EventInfo_v1::lumiBlock
uint32_t lumiBlock() const
The current event's luminosity block number.
InDet::InDetBeamSpotFinder::vertexNtuple_struct::y
double y
Definition: InDetBeamSpotFinder.h:83
AthAlgorithm
Definition: AthAlgorithm.h:47
InDet::InDetBeamSpotFinder::m_beamSpotNtuple
beamSpotNtuple_struct m_beamSpotNtuple
Definition: InDetBeamSpotFinder.h:90
BeamSpot::ID
Definition: BeamSpotID.h:10
InDet::InDetBeamSpotFinder::m_maxRunsPerFit
unsigned int m_maxRunsPerFit
Definition: InDetBeamSpotFinder.h:61
BeamSpot::ID::runNumber
unsigned int runNumber() const
Definition: BeamSpotID.h:13
InDet::InDetBeamSpotFinder::readEvent
BeamSpot::Event readEvent(const xAOD::EventInfo &, const xAOD::VertexContainer &)
Definition: InDetBeamSpotFinder.cxx:103
VxCandidate.h
InDet::InDetBeamSpotFinder::writeToBeamSpotTree
void writeToBeamSpotTree(const IInDetBeamSpotTool *bs, std::vector< BeamSpot::Event > &, std::vector< BeamSpot::VrtHolder > &)
Definition: InDetBeamSpotFinder.cxx:389
InDet::InDetBeamSpotFinder::vertexNtuple_struct::vxy
double vxy
Definition: InDetBeamSpotFinder.h:83
InDet::InDetBeamSpotFinder::m_fitSortingKey
std::string m_fitSortingKey
Definition: InDetBeamSpotFinder.h:134
xAOD::VxType::PileUp
@ PileUp
Pile-up vertex.
Definition: TrackingPrimitives.h:573
InDet::InDetBeamSpotFinder::m_eventMap
std::map< BeamSpot::ID, std::vector< BeamSpot::Event > > m_eventMap
Definition: InDetBeamSpotFinder.h:96
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::lbEnd
int lbEnd
Definition: InDetBeamSpotFinder.h:75
BeamSpot::VrtHolder::vxx
double vxx
Definition: IInDetBeamSpotTool.h:25
InDet::IInDetBeamSpotTool::getCovMap
virtual std::map< std::string, double > getCovMap() const =0
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
InDet::BeamSpotStatusCode::setFitWidth
void setFitWidth(bool fitWidth)
Definition: BeamSpotStatusCode.h:52
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
EventInfo
This class provides general information about an event. Event information is provided by the accessor...
Definition: EventInfo/EventInfo/EventInfo.h:42
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
InDet::IInDetBeamSpotTool::getParamMap
virtual std::map< std::string, double > getParamMap() const =0
InDet::IInDetBeamSpotTool::Clone
virtual IInDetBeamSpotTool * Clone()=0
xAOD::EventInfo_v1
Class describing the basic event information.
Definition: EventInfo_v1.h:43
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::nVtxPrim
int nVtxPrim
Definition: InDetBeamSpotFinder.h:76
InDet::InDetBeamSpotFinder::InDetBeamSpotFinder
InDetBeamSpotFinder(const std::string &name, ISvcLocator *pSvcLocator)
Definition: InDetBeamSpotFinder.cxx:31
xAOD::Vertex_v1::numberDoF
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
TrackParticle.h
InDet::InDetBeamSpotFinder::m_root_vrt
TTree * m_root_vrt
Definition: InDetBeamSpotFinder.h:72
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::nValid
int nValid
Definition: InDetBeamSpotFinder.h:76
InDet::InDetBeamSpotFinder::m_maxTrackNum
int m_maxTrackNum
Definition: InDetBeamSpotFinder.h:118
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
InDet::InDetBeamSpotFinder::vertexNtuple_struct::nTracks
unsigned int nTracks
Definition: InDetBeamSpotFinder.h:85
VertexContainer.h
InDet::InDetBeamSpotFinder::m_maxAbsCorrelXY
double m_maxAbsCorrelXY
Definition: InDetBeamSpotFinder.h:121
a
TList * a
Definition: liststreamerinfos.cxx:10
BeamSpot::Event
Definition: IInDetBeamSpotTool.h:33
xAOD::Vertex_v1::chiSquared
float chiSquared() const
Returns the of the vertex fit as float.
InDetBeamSpotRooFit.h
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
InDet::InDetBeamSpotFinder::vertexNtuple_struct::x
double x
Definition: InDetBeamSpotFinder.h:83
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
InDet::IInDetBeamSpotTool::fit
virtual FitStatus fit(std::vector< BeamSpot::VrtHolder > &)=0
Attempt a to find a solution of the beamspot.
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::status
int status
Definition: InDetBeamSpotFinder.h:77
InDet::InDetBeamSpotFinder::m_beamSpotToolList
ToolHandleArray< IInDetBeamSpotTool > m_beamSpotToolList
Definition: InDetBeamSpotFinder.h:50
InDet::IInDetBeamSpotTool
Definition: IInDetBeamSpotTool.h:45
InDet::BeamSpotStatusCode::setOnlineStatus
void setOnlineStatus(bool isOnline)
Definition: BeamSpotStatusCode.h:31
InDet::InDetBeamSpotFinder::m_minVertexNum
unsigned int m_minVertexNum
Definition: InDetBeamSpotFinder.h:123
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::timeStart
int timeStart
Definition: InDetBeamSpotFinder.h:77
InDet::InDetBeamSpotFinder::execute
virtual StatusCode execute() override
Definition: InDetBeamSpotFinder.cxx:79
xAOD::EventInfo_v1::timeStamp
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
InDet::InDetBeamSpotFinder::max_run
int max_run(std::vector< BeamSpot::Event > &)
Definition: InDetBeamSpotFinder.cxx:464
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::bcid
int bcid
Definition: InDetBeamSpotFinder.h:75
InDet::InDetBeamSpotFinder::vertexNtuple_struct::eventTime
unsigned long long eventTime
Definition: InDetBeamSpotFinder.h:86
BeamSpot::VrtHolder::x
double x
Definition: IInDetBeamSpotTool.h:24
InDet::InDetBeamSpotFinder::setupVertexTree
StatusCode setupVertexTree()
Definition: InDetBeamSpotFinder.cxx:253
BeamSpot::VrtHolder
Definition: IInDetBeamSpotTool.h:22
InDet::InDetBeamSpotFinder::vertexNtuple_struct::eventTime_NS
unsigned long long eventTime_NS
Definition: InDetBeamSpotFinder.h:86
InDet::InDetBeamSpotFinder::vertexNtuple_struct::vyy
double vyy
Definition: InDetBeamSpotFinder.h:83
xAOD::VxType::ConvVtx
@ ConvVtx
Conversion vertex.
Definition: TrackingPrimitives.h:574
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::separation
int separation
Definition: InDetBeamSpotFinder.h:77
InDet::InDetBeamSpotFinder::m_toolSvc
ServiceHandle< IToolSvc > m_toolSvc
Definition: InDetBeamSpotFinder.h:49
InDet::InDetBeamSpotFinder::vertexNtuple_struct::vType
xAOD::VxType::VertexType vType
Definition: InDetBeamSpotFinder.h:84
InDet::InDetBeamSpotFinder::vertexNtuple_struct::valid
bool valid
Definition: InDetBeamSpotFinder.h:87
xAOD::EventInfo_v1::bcid
uint32_t bcid() const
The bunch crossing ID of the event.
InDet::InDetBeamSpotFinder::m_minTrackNum
int m_minTrackNum
Definition: InDetBeamSpotFinder.h:117
InDet::InDetBeamSpotFinder::m_minVtxProb
double m_minVtxProb
Definition: InDetBeamSpotFinder.h:122
BeamSpot::VrtHolder::nTracks
unsigned int nTracks
Definition: IInDetBeamSpotTool.h:27
BeamSpot::ID::pileup
unsigned int pileup() const
Definition: BeamSpotID.h:15
xAOD::VxType::NotSpecified
@ NotSpecified
Default value, no explicit type set.
Definition: TrackingPrimitives.h:577
InDet::InDetBeamSpotFinder::beamSpotNtuple_struct::pileup
int pileup
Definition: InDetBeamSpotFinder.h:75
InDet::InDetBeamSpotFinder::m_BeamStatusCode
BeamSpotStatusCode m_BeamStatusCode
Definition: InDetBeamSpotFinder.h:92
InDet::InDetBeamSpotFinder::m_secondsPerFit
unsigned long m_secondsPerFit
Definition: InDetBeamSpotFinder.h:140
InDet::InDetBeamSpotFinder::m_vertexTypeNames
std::vector< std::string > m_vertexTypeNames
Definition: InDetBeamSpotFinder.h:125
BunchCrossingCondData::isFilled
bool isFilled(const bcid_type bcid) const
The simplest query: Is the bunch crossing filled or not?
Definition: BunchCrossingCondData.h:339
InDet::InDetBeamSpotFinder::m_maxTransverseError
double m_maxTransverseError
Definition: InDetBeamSpotFinder.h:120
xAOD::EventInfo_v1::actualInteractionsPerCrossing
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
Definition: EventInfo_v1.cxx:380
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
InDet::InDetBeamSpotFinder::iequals
bool iequals(const std::string &, const std::string &)
Definition: InDetBeamSpotFinder.cxx:378