ATLAS Offline Software
Loading...
Searching...
No Matches
InDetBeamSpotFinder.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
12
13#include "EventInfo/EventInfo.h"
14#include "EventInfo/EventID.h"
15#include <algorithm>
16
17namespace{
18 //comparison of events for lumiBlock
19 auto lesserLumiBlock = [](const BeamSpot::Event & e1, const BeamSpot::Event & e2)->bool{
20 return (e1.lumiBlock<e2.lumiBlock);
21 };
22
23 //comparison of events for run number
24 auto lesserRunNumber = [](const BeamSpot::Event & e1, const BeamSpot::Event & e2)->bool{
25 return (e1.runNumber<e2.runNumber);
26 };
27
28}
29
30InDet::InDetBeamSpotFinder::InDetBeamSpotFinder(const std::string& name, ISvcLocator* pSvcLocator):
31 AthAlgorithm(name, pSvcLocator)
32{
33 declareProperty( "BeamSpotToolList" , m_beamSpotToolList );
34 declareProperty( "RunRange" , m_maxRunsPerFit = 0 );
35 declareProperty( "LumiRange" , m_maxLBsPerFit = 0 );
36 declareProperty( "EventRange" , m_maxEventsPerFit = 0);
37 declareProperty( "UseBCID" , m_BCIDsToAccept );
38 declareProperty( "UseFilledBCIDsOnly", m_useFilledBCIDsOnly = true );
39 declareProperty( "MinTracksPerVtx", m_minTrackNum = 5);
40 declareProperty( "MaxTracksPerVtx", m_maxTrackNum = 1000000);
41 declareProperty( "MinVtxNum" , m_minVertexNum = 100);
42 declareProperty( "MaxVtxChi2" , m_maxChi2Vertex = 10);
43 declareProperty( "MaxTransverseErr", m_maxTransverseError=1000000);
44 declareProperty( "MaxAbsCorrelXY", m_maxAbsCorrelXY=0.8);
45 declareProperty( "VertexTypes" , m_vertexTypeNames);
46 declareProperty( "MinVtxProb" , m_minVtxProb=0.001);
47 declareProperty( "GroupFitsBy" , m_fitSortingKey = "none");
48 declareProperty( "VertexNtuple" , m_writeVertexNtuple = true);
49 declareProperty( "WriteAllVertices" , m_writeAllVertices=false);
50 declareProperty( "VertexTreeName" , m_vertexTreeName = "Vertices");
51 declareProperty( "SecondsPerFit", m_secondsPerFit = 1);
52}
53
55 ATH_MSG_DEBUG( "in initialize()");
56 if ( m_beamSpotToolList.empty() ){
57 ATH_MSG_FATAL("FATAL ERROR: must provide at least one beamspot tool in beamSpotToolList");
58 return StatusCode::FAILURE;
59 }
60
61 ATH_CHECK( m_thistSvc.retrieve() );
62 ATH_CHECK( m_toolSvc.retrieve() );
63
65
66 ATH_CHECK( m_eventInfo.initialize() );
67 ATH_CHECK( m_vertexContainer.initialize() );
68
69 for ( unsigned int i = 0; i < m_beamSpotToolList.size(); i++){ ATH_CHECK( m_beamSpotToolList[i].retrieve() );}
73 return StatusCode::SUCCESS;
74}
75
79 if ( !passEventSelection( *eventInfo ) ) return StatusCode::SUCCESS;
80 BeamSpot::Event currentEvent = readEvent(*eventInfo, *vertexContainer);
81
82 m_eventList.push_back( currentEvent );
84 for( auto & thisVertex: currentEvent.vertices){
85 if( thisVertex.passed || m_writeAllVertices ){
86 writeToVertexTree( currentEvent, thisVertex );
87 }
88 }
89 }
90 return StatusCode::SUCCESS;
91}
92
94 ATH_MSG_DEBUG( "in finalize()" );
95 sortEvents();
97 return StatusCode::SUCCESS;
98}
99
101 BeamSpot::Event event;
102 BeamSpot::VrtHolder vertex;
103 event.pileup = ceil(eventInfo.actualInteractionsPerCrossing());
104 event.runNumber = eventInfo.runNumber();
105 event.lumiBlock = eventInfo.lumiBlock();
106 event.bcid = eventInfo.bcid();
107 event.eventTime = eventInfo.timeStamp();
108 event.eventTime_NS = eventInfo.timeStampNSOffset();
109 event.eventNumber = eventInfo.eventNumber();
110 const EventInfo* BSeventInfo;
111 //This is required for pseudo lumiblocks
112
114 {
115 if( evtStore()->retrieve(BSeventInfo) != StatusCode::SUCCESS){
116 ATH_MSG_ERROR("Cannot get event info.");
117 return event;
118 }
119
120 // Remove the redundent logic, event.lumiBlock != BSeventInfo->event_ID()->lumi_block()
121 event.lumiBlock = BSeventInfo->event_ID()->lumi_block();
122 };
123
124 for(const xAOD::Vertex* vtx:vertexContainer) {
125 if (vtx->vertexType() == xAOD::VxType::NoVtx) continue;
126 vertex.x = vtx->x();
127 vertex.y = vtx->y();
128 vertex.z = vtx->z();
129 vertex.vxx = vtx->covariancePosition()(0,0);
130 vertex.vxy = vtx->covariancePosition()(0,1);
131 vertex.vyy = vtx->covariancePosition()(1,1);
132 vertex.vzz = vtx->covariancePosition()(2,2);
133 vertex.vertexType = vtx->vertexType();
134 vertex.nTracks = vtx->nTrackParticles();
135 vertex.passed = passVertexSelection( vtx );
136 vertex.valid = vertex.passed;
137 //Remove vertices with wrong x-y correlation
138 if(vertex.vxy*vertex.vxy/vertex.vxx/vertex.vyy > 1.0 ||
139 vertex.vzz < 0. ||
140 vertex.vyy < 0. ||
141 vertex.vxx < 0.) {
142 ATH_MSG_DEBUG("Bad vertex: " << event.eventNumber << " " << vtx->vertexType() << " "
143 << vertex.x << " " << vertex.y << " " << vertex.z << " "
144 << vertex.vxx << " " << vertex.vyy << " " << vertex.vzz << " "
145 << vertex.nTracks << " " << vertex.vxy*vertex.vxy/vertex.vxx/vertex.vyy);
146 }
147 if(vertex.vxy*vertex.vxy/vertex.vxx/vertex.vyy > m_maxAbsCorrelXY*m_maxAbsCorrelXY ||
148 vertex.vzz < 0. ||
149 vertex.vyy < 0. ||
150 vertex.vxx < 0.) continue;
151 event.vertices.push_back( vertex );
152 }
153 return event;
154}
155
157 for( const auto & thisEvent: m_eventList){
158 BeamSpot::ID id;
159 id.runNumber( (m_maxRunsPerFit > 0) ? thisEvent.runNumber : 0 );
160 id.lumiBlock( (m_maxLBsPerFit > 0) ? thisEvent.lumiBlock : 0 );
161 id.pileup ( iequals(m_fitSortingKey,"pileup") ? thisEvent.pileup : 0 );
162 id.bcid ( iequals(m_fitSortingKey,"bcid" ) ? thisEvent.bcid : 0 );
163 id.timeStamp( iequals(m_fitSortingKey,"time" ) ? thisEvent.eventTime/m_secondsPerFit : 0 );
164 m_eventMap[id].push_back( thisEvent );
165 }
166 auto iter = m_eventMap.begin();
167 BeamSpot::ID lastID = iter->first;
168 BeamSpot::ID currentID = iter->first;
169 unsigned int nRuns = 0;
170 unsigned int nLBs = 0;
171 unsigned int nFits = 1;
172 m_sortedEventList.resize( nFits );
173
174 for( iter = m_eventMap.begin(); iter != m_eventMap.end(); ++iter){
175 currentID = iter->first;
176 if( iter == m_eventMap.begin() || currentID.runNumber() != lastID.runNumber() ){ nRuns++; }
177 if( iter == m_eventMap.begin() || currentID.lumiBlock() != lastID.lumiBlock() ){ nLBs++; }
178 if( currentID.timeStamp() != lastID.timeStamp() ||
179 currentID.pileup() != lastID.pileup()
180 || currentID.bcid() != lastID.bcid()
181 || ( m_maxRunsPerFit > 0 && nRuns > m_maxRunsPerFit )
182 || ( m_maxLBsPerFit > 0 && nLBs > m_maxLBsPerFit )){
183 ATH_MSG_INFO( "New Fit " << currentID.timeStamp() << "<--"<< lastID.timeStamp() << "\n\t"
184 << currentID.pileup() << " <-- " << lastID.pileup() << "\n\t"
185 << currentID.bcid() << " <-- " << lastID.bcid() << "\n\t"
186 << nRuns << " " << m_maxRunsPerFit << "\n\t"
187 << nLBs << " " << m_maxLBsPerFit );
188
189 nFits++;
190 m_sortedEventList.resize(nFits);
191 nRuns = 1; nLBs = 1;
192 }
193 for( unsigned int i = 0; i < iter->second.size(); i++){
194 if( m_sortedEventList.at(nFits-1).size() == m_maxEventsPerFit && m_maxEventsPerFit > 0 ){
195 nFits++;
196 m_sortedEventList.resize(nFits);
197 nRuns = 1; nLBs = 1;
198 }
199
200 m_sortedEventList.at(nFits-1).push_back( iter->second.at(i) );
201 }
202 lastID = iter->first;
203 }
204}
205
206//Convert the vector of strings to vector of vertex types.
208 if ( not m_vertexTypeNames.empty() ) {
209 for ( std::vector<std::string>::const_iterator it = m_vertexTypeNames.begin();
210 it != m_vertexTypeNames.end(); ++it) {
211 if ((*it) == "NoVtx") ;
212 else if ((*it) == "PriVtx") m_vertexTypes.push_back(xAOD::VxType::PriVtx);
213 else if ((*it) == "SecVtx") m_vertexTypes.push_back(xAOD::VxType::SecVtx);
214 else if ((*it) == "PileUp") m_vertexTypes.push_back(xAOD::VxType::PileUp);
215 else if ((*it) == "ConvVtx") m_vertexTypes.push_back(xAOD::VxType::ConvVtx);
216 else if ((*it) == "V0Vtx") m_vertexTypes.push_back(xAOD::VxType::V0Vtx);
217 else if ((*it) == "KinkVtx") m_vertexTypes.push_back(xAOD::VxType::KinkVtx);
218 else if ((*it) =="NotSpecified")m_vertexTypes.push_back(xAOD::VxType::NotSpecified) ;
219 }
220 ATH_MSG_INFO("Allowing " << m_vertexTypes.size() << " Vertex types" );
221 }
222 else {
223 ATH_MSG_DEBUG( "No selection based on vertexType will be done" );
224 }
225}
226
228 const int bcid = eventInfo.bcid();
231 if ( !bcData->isFilled(bcid) ) return false;
232 }
233 if( m_BCIDsToAccept.begin() != m_BCIDsToAccept.end() )
234 return ( std::find(m_BCIDsToAccept.begin(), m_BCIDsToAccept.end(), bcid) != m_BCIDsToAccept.end());
235 else
236 return true;
237}
238
240 if(!vtx) { return false; }
241 if(m_vertexTypes.end() == std::find( m_vertexTypes.begin(), m_vertexTypes.end(), vtx->vertexType() ) ) { return false; }
242 if(vtx->chiSquared()/vtx->numberDoF() > m_maxChi2Vertex) { return false; }
243 if(static_cast<int>(vtx->nTrackParticles()) < m_minTrackNum ){ return false; }
244 if(static_cast<int>(vtx->nTrackParticles()) > m_maxTrackNum ){ return false; }
245 if(TMath::Prob(vtx->chiSquared(), vtx->numberDoF()) < m_minVtxProb ) { return false; }
246 if(vtx->covariancePosition()(0,0) <= 0 || vtx->covariancePosition()(1,1) <= 0 || vtx->covariancePosition()(2,2) <= 0 ) { return false; }
247 double maxTransverseError2 = m_maxTransverseError * m_maxTransverseError;
248 if(vtx->covariancePosition()(0,0) > maxTransverseError2 || vtx->covariancePosition()(1,1) > maxTransverseError2) {return false;}
249 return true;
250}
251
253 const std::string inRootID = "/INDETBEAMSPOTFINDER/";
254 const std::string svrts = m_vertexTreeName;
255 m_root_vrt = new TTree(svrts.data(),"Vertices");
256 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");
257 return m_thistSvc->regTree(inRootID+svrts,m_root_vrt);
258}
259
262 std::vector<BeamSpot::VrtHolder> verticesToFit;
263
264 for( auto & eventList: m_sortedEventList){
265 verticesToFit.clear();
266 if(eventList.size() > 0) {
267 BeamSpot::Event ev = *eventList.begin();
268 ATH_MSG_INFO( "Event list size/LB/bcid: " << eventList.size() << " " << ev.lumiBlock << " " << ev.bcid);
269 }
270 for( const auto & thisEvent: eventList){
271 for( const auto & thisVertex: thisEvent.vertices){
272 if( thisVertex.passed ) {
273 verticesToFit.push_back( thisVertex );
274 }
275 }
276 }
277
278 for( unsigned int j = 0; j < m_beamSpotToolList.size(); j++){
279 IInDetBeamSpotTool * bs(nullptr);
280 bs = cloneTool(j);
281 if(!bs){ return StatusCode::FAILURE; }
282 if(not verticesToFit.empty()) { bsFitStatus = bs->fit(verticesToFit); }
283 else { bsFitStatus = IInDetBeamSpotTool::unsolved; }
284
285 m_BeamStatusCode.clearWord();
286 m_BeamStatusCode.setOnlineStatus(false);
287 m_BeamStatusCode.setAlgType( bs->getFitID() );
288 int fitStat;
289 if ( bsFitStatus == IInDetBeamSpotTool::successful)
290 fitStat = 3;
291 else if ( bsFitStatus == IInDetBeamSpotTool::problems)
292 fitStat = 1;
293 else if ( bsFitStatus == IInDetBeamSpotTool::failed || bsFitStatus == IInDetBeamSpotTool::unsolved)
294 fitStat = 0;
295 else
296 fitStat = 0;
297 m_BeamStatusCode.setFitStatus(fitStat);
298 if (bs->getParamMap()["sigmaX"] == 0 && bs->getParamMap()["sigmaY"] ==0 ) { m_BeamStatusCode.setFitWidth( false); }
299 else { m_BeamStatusCode.setFitWidth(true); }
300
301 if(not eventList.empty()) writeToBeamSpotTree( bs, eventList, verticesToFit );
302 }
303 }
304 return StatusCode::SUCCESS;
305}
306
308 const std::string inRootID = "/INDETBEAMSPOTFINDER/";
309 const std::string sbs = "BeamSpotNt";//m_root_beamspotName;
310 m_root_bs = new TTree(sbs.data(),"Beamspot Solutions");
311 m_root_bs->Branch("bcid", &m_beamSpotNtuple.bcid,"bcid/I");
312 m_root_bs->Branch("pileup", &m_beamSpotNtuple.pileup,"pileup/I");
313 m_root_bs->Branch("defectWord", &m_beamSpotNtuple.defectWord, "defectWord/I");
314 m_root_bs->Branch("fill", &m_beamSpotNtuple.fill, "fill/I");
315 m_root_bs->Branch("lbEnd", &m_beamSpotNtuple.lbEnd, "lbEnd/I");
316 m_root_bs->Branch("lbStart", &m_beamSpotNtuple.lbStart, "lbStart/I");
317 m_root_bs->Branch("nEvents", &m_beamSpotNtuple.nEvents, "nEvents/I");
318 m_root_bs->Branch("nValid", &m_beamSpotNtuple.nValid, "nValid/I");
319 m_root_bs->Branch("nVtxAll", &m_beamSpotNtuple.nVtxAll, "nVtxAll/I");
320 m_root_bs->Branch("nVtxPrim", &m_beamSpotNtuple.nVtxPrim, "nVtxPrim/I");
321 m_root_bs->Branch("separation", &m_beamSpotNtuple.separation, "separation/I");
322 m_root_bs->Branch("status", &m_beamSpotNtuple.status, "status/I");
323 m_root_bs->Branch("timeEnd", &m_beamSpotNtuple.timeEnd, "timeEnd/I");
324 m_root_bs->Branch("timeStart", &m_beamSpotNtuple.timeStart, "timeStart/I");
325 m_root_bs->Branch("run", &m_beamSpotNtuple.run, "run/I");
326 m_root_bs->Branch("runEnd", &m_beamSpotNtuple.runEnd, "runEnd/I");
327
328 for( auto &tool : m_beamSpotToolList ){
329 std::map<std::string,double> paramMap = tool->getParamMap();
330 std::map<std::string,double> covMap = tool->getCovMap();
331
332 std::string slashD = "/D";
333 std::string keySlashD;
334
335 //Loop over the parameters for a given fit tool, and create a branch for each if it doesn't exist
336 for( std::map<std::string,double>::iterator iter = paramMap.begin(); iter != paramMap.end(); ++iter){
337 std::string key = iter->first;
338 //double val = iter->second;
339 if( !(m_root_bs->GetBranch(key.c_str())) ){
340 m_beamSpotNtuple.paramMap[key] = 0;
341 keySlashD = key + slashD;
342 m_root_bs->Branch(key.c_str(), &m_beamSpotNtuple.paramMap[key], keySlashD.c_str());
343 }
344 }
345 //Loop over the covariance matrix for a given fit tool and create a branch for each element, if it doesn't already exist.
346 for( std::map<std::string,double>::iterator iter = covMap.begin(); iter != covMap.end(); ++iter){
347 const std::string & key = iter->first;
348 //double val = iter->second;
349 if( !(m_root_bs->GetBranch(key.c_str())) ){
350 m_beamSpotNtuple.covMap[key] = 0;
351 keySlashD = key + slashD;
352 m_root_bs->Branch( key.c_str(), &m_beamSpotNtuple.covMap[key], keySlashD.c_str());
353 }
354 }
355 }
356 return m_thistSvc->regTree(inRootID+sbs,m_root_bs);
357}
358
360 m_root_vtx.x = vtx.x;
361 m_root_vtx.y = vtx.y;
362 m_root_vtx.z = vtx.z;
363 m_root_vtx.vxx = vtx.vxx;
364 m_root_vtx.vxy = vtx.vxy;
365 m_root_vtx.vyy = vtx.vyy;
366 m_root_vtx.vzz = vtx.vzz;
367 m_root_vtx.vType = vtx.vertexType;
368 m_root_vtx.run = evt.runNumber;
369 m_root_vtx.lb = evt.lumiBlock;
370 m_root_vtx.bcid = evt.bcid;
371 m_root_vtx.pileup = evt.pileup;
372 m_root_vtx.nTracks = vtx.nTracks;
373 m_root_vtx.passed = vtx.passed;
374 m_root_vtx.valid = vtx.valid;
375 m_root_vtx.eventNumber = evt.eventNumber;
376 m_root_vtx.eventTime = evt.eventTime;
377 m_root_vtx.eventTime_NS = evt.eventTime_NS;
378 m_root_vrt->Fill();
379}
380
381bool InDet::InDetBeamSpotFinder::iequals(const std::string& a, const std::string& b)
382{
383 unsigned int sz = a.size();
384 if (b.size() != sz)
385 return false;
386 for (unsigned int i = 0; i < sz; ++i)
387 if (tolower(a[i]) != tolower(b[i]))
388 return false;
389 return true;
390}
391
392void InDet::InDetBeamSpotFinder::writeToBeamSpotTree(const IInDetBeamSpotTool *bs, std::vector<BeamSpot::Event> &eventList, std::vector<BeamSpot::VrtHolder> &vertexList){
393 m_beamSpotNtuple.pileup = iequals(m_fitSortingKey,"pileup") ? eventList.at(0).pileup : 0;
394 m_beamSpotNtuple.bcid = iequals(m_fitSortingKey,"bcid") ? eventList.at(0).bcid : 0;
395 m_beamSpotNtuple.defectWord = 0;
396 m_beamSpotNtuple.fill = 0;
397 m_beamSpotNtuple.lbEnd = max_lb( eventList );
398 m_beamSpotNtuple.lbStart = min_lb( eventList );
399 m_beamSpotNtuple.nEvents = eventList.size();
400 m_beamSpotNtuple.nValid = vertexList.size();
401 unsigned int nVtxAll = 0;
402 unsigned int nVtxPrim = 0;
403 auto isPrimaryVertex=[](const BeamSpot::VrtHolder & vertex){ return (vertex.vertexType == xAOD::VxType::PriVtx); };
404 for( const auto & thisEvent : eventList){
405 const auto & theseVertices=thisEvent.vertices;
406 nVtxAll += theseVertices.size();
407 nVtxPrim+= std::count_if(theseVertices.begin(), theseVertices.end(), isPrimaryVertex);
408 }
409 m_beamSpotNtuple.nVtxAll = nVtxAll;
410 m_beamSpotNtuple.nVtxPrim = nVtxPrim;
411 m_beamSpotNtuple.run = min_run( eventList );
412 m_beamSpotNtuple.status = m_BeamStatusCode.getWord();
413 m_beamSpotNtuple.separation = 0;
414 m_beamSpotNtuple.timeEnd = iequals(m_fitSortingKey,"time") ? eventList.back().eventTime : 0;
415 m_beamSpotNtuple.timeStart = iequals(m_fitSortingKey,"time") ? eventList.front().eventTime : 0;
416 m_beamSpotNtuple.runEnd = max_run( eventList );
417 const auto & bsToolParamMap = bs->getParamMap();
418 const auto & bsToolCovMap= bs->getCovMap();
419 for (auto & param:m_beamSpotNtuple.paramMap){
420 const std::string & key = param.first;
421 const auto & bsToolEquivalent =bsToolParamMap.find(key);
422 param.second = ( bsToolEquivalent == bsToolParamMap.end() ) ? 0 : bsToolEquivalent->second;
423 }
431 for (auto & covariance:m_beamSpotNtuple.covMap){
432 const std::string & key = covariance.first;
433 const auto & bsToolEquivalent = bsToolCovMap.find(key);
434 covariance.second = ( bsToolEquivalent == bsToolCovMap.end() ) ? 0 : bsToolEquivalent->second;
435 }
443 m_root_bs->Fill();
444}
445
451
452int InDet::InDetBeamSpotFinder::min_lb( std::vector<BeamSpot::Event> & eventList ){
453 const auto smallestLbEvent=std::min_element(eventList.begin(),eventList.end(), lesserLumiBlock);
454 return smallestLbEvent->lumiBlock;
455}
456
457int InDet::InDetBeamSpotFinder::max_lb( std::vector<BeamSpot::Event> & eventList ){
458 const auto largestLbEvent=std::max_element(eventList.begin(),eventList.end(), lesserLumiBlock);
459 return largestLbEvent->lumiBlock;
460}
461
462int InDet::InDetBeamSpotFinder::min_run( std::vector<BeamSpot::Event> & eventList ){
463 const auto smallestRunEvent=std::min_element(eventList.begin(),eventList.end(), lesserRunNumber);
464 return smallestRunEvent->runNumber;
465}
466
467int InDet::InDetBeamSpotFinder::max_run( std::vector<BeamSpot::Event> & eventList ){
468 const auto largestRunEvent=std::max_element(eventList.begin(),eventList.end(), lesserRunNumber);
469 return largestRunEvent->runNumber;
470}
471
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
void tolower(std::string &s)
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
static Double_t sz
static Double_t a
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
unsigned int pileup() const
Definition BeamSpotID.h:15
unsigned int lumiBlock() const
Definition BeamSpotID.h:14
unsigned int bcid() const
Definition BeamSpotID.h:16
unsigned long timeStamp() const
Definition BeamSpotID.h:17
unsigned int runNumber() const
Definition BeamSpotID.h:13
EventID * event_ID()
the unique identification of the event.
Abstract class for all beamspot determination algorithms.
FitStatus
Internally used enum for fit status.
virtual FitID getFitID() const =0
A unique ID for the specific fit type.
virtual FitStatus fit(std::vector< BeamSpot::VrtHolder > &)=0
Attempt a to find a solution of the beamspot.
virtual IInDetBeamSpotTool * Clone()=0
virtual std::map< std::string, double > getCovMap() const =0
virtual std::map< std::string, double > getParamMap() const =0
std::vector< BeamSpot::Event > m_eventList
virtual StatusCode finalize() override
std::map< BeamSpot::ID, std::vector< BeamSpot::Event > > m_eventMap
ServiceHandle< IToolSvc > m_toolSvc
void writeToBeamSpotTree(const IInDetBeamSpotTool *bs, std::vector< BeamSpot::Event > &, std::vector< BeamSpot::VrtHolder > &)
virtual StatusCode initialize() override
bool iequals(const std::string &, const std::string &)
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer
bool passVertexSelection(const xAOD::Vertex *)
std::vector< std::string > m_vertexTypeNames
int min_run(std::vector< BeamSpot::Event > &)
void writeToVertexTree(BeamSpot::Event &, BeamSpot::VrtHolder &)
std::vector< xAOD::VxType::VertexType > m_vertexTypes
ToolHandleArray< IInDetBeamSpotTool > m_beamSpotToolList
SG::ReadCondHandleKey< BunchCrossingCondData > m_bcDataKey
std::vector< std::vector< BeamSpot::Event > > m_sortedEventList
int max_run(std::vector< BeamSpot::Event > &)
BeamSpot::Event readEvent(const xAOD::EventInfo &, const xAOD::VertexContainer &)
virtual StatusCode execute() override
InDetBeamSpotFinder(const std::string &name, ISvcLocator *pSvcLocator)
ServiceHandle< ITHistSvc > m_thistSvc
int min_lb(std::vector< BeamSpot::Event > &)
std::vector< unsigned int > m_BCIDsToAccept
IInDetBeamSpotTool * cloneTool(int)
int max_lb(std::vector< BeamSpot::Event > &)
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
BeamSpotStatusCode m_BeamStatusCode
bool passEventSelection(const xAOD::EventInfo &)
beamSpotNtuple_struct m_beamSpotNtuple
uint32_t lumiBlock() const
The current event's luminosity block number.
bool eventType(EventType type) const
Check for one particular bitmask value.
uint32_t bcid() const
The bunch crossing ID of the event.
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
uint32_t timeStamp() const
POSIX time in seconds from 1970. January 1st.
@ IS_SIMULATION
true: simulation, false: data
uint32_t runNumber() const
The current event's run number.
uint32_t timeStampNSOffset() const
Nanosecond time offset wrt. the time stamp.
uint64_t eventNumber() const
The current event's event number.
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
float numberDoF() const
Returns the number of degrees of freedom of the vertex fit as float.
VxType::VertexType vertexType() const
The type of the vertex.
float chiSquared() const
Returns the of the vertex fit as float.
int ev
Definition globals.cxx:25
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
@ KinkVtx
Kink vertex.
@ PileUp
Pile-up vertex.
@ V0Vtx
Vertex from V0 decay.
@ ConvVtx
Conversion vertex.
@ NotSpecified
Default value, no explicit type set.
@ PriVtx
Primary vertex.
@ SecVtx
Secondary vertex.
@ NoVtx
Dummy vertex. TrackParticle was not used in vertex fit.
EventInfo_v1 EventInfo
Definition of the latest event info version.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
Vertex_v1 Vertex
Define the latest version of the vertex class.
std::vector< BeamSpot::VrtHolder > vertices
xAOD::VxType::VertexType vertexType