ATLAS Offline Software
MSConstraintTracksProvider.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
13 
14 #include "muonEvent/Muon.h"
18 #include "Particle/TrackParticle.h"
19 
20 
21 #include "TTree.h"
22 #include "TFile.h"
23 
24 
25 namespace Trk {
26 
27  //________________________________________________________________________
29  const std::string& name,
30  const IInterface* parent)
31 
33  , m_trackFitter("Trk::GlobalChi2Fitter/InDetTrackFitter")
34  , m_inputMuonCollection("MuidMuonCollection")
35  , m_inputTracksCollection("Tracks")
36  , m_nCBMuonsFromSG(0)
37  , m_nCBMuonsHasEXandID(0)
38  , m_nCBMuonsPassSelection(0)
39  , m_nCBMuonsFailedRefit(0)
40  , m_nCBMuonsSucRefit(0)
41  , m_ntuple(nullptr)
42  , m_tree(nullptr)
43  , m_run{}
44  , m_event{}
45  , m_pID{}
46  , m_pMS{}
47  , m_ptID{}
48  , m_ptMS{}
49  , m_charge{}
50  , m_combinedEta{}
51  , m_IDEta{}
52  , m_combinedPhi{}
53  , m_IDPhi{}
54  , m_pID_constrained{}
55  , m_ptID_constrained{}
56  , m_IDEta_constrained{}
57  , m_IDPhi_constrained{}
58  , m_charge_constrained{}
59  , m_eBLhits{}
60  , m_nBLhits{}
61  , m_nPIXDS{}
62  , m_nSCTDS{}
63  , m_nPIXH{}
64  , m_nSCTH{}
65  , m_nPIXHits{}
66  , m_nSCTHits{}
67  , m_nTRTHits{}
68  , m_sectors{}
69  , m_phiLayers{}
70  , m_stationLayers{}
71  , m_sectorNum{}
72  , m_phiLayerNum{}
73  , m_stationLayerNum{}
74  {
75 
76  declareInterface<ITrackCollectionProvider>(this);
77 
78  declareProperty("TrackFitter", m_trackFitter );
79  declareProperty("InputMuonCollection", m_inputMuonCollection );
80  declareProperty("InputTracksCollection", m_inputTracksCollection );
81  declareProperty("RunOutlierRemoval", m_runOutlierRemoval = true );
82  declareProperty("MaxRetrievalErrors", m_maxRetrievalErrors = 10 );
83  declareProperty("UseMSConstraintTrkOnly", m_useMSConstraintTrkOnly = true );
84  declareProperty("DoTree", m_doTree = true );
85  declareProperty("MinPt", m_minPt = 15.0 );
86  declareProperty("MinPIXHits", m_minPIXHits = 1 );
87  declareProperty("MinSCTHits", m_minSCTHits = 6 );
88  declareProperty("MinTRTHits", m_minTRTHits = 0 );
89  declareProperty("MaxIDd0", m_maxIDd0 = 500. );
90  declareProperty("MaxIDz0", m_maxIDz0 = 500. );
91  declareProperty("MinIDPt", m_minIDPt = 10 );
92  declareProperty("MDTHits", m_minMDTHits = 15 );
93  declareProperty("MinRPCPhiHits", m_minRPCPhiHits = 0 );
94  declareProperty("MinTGCPhiHits", m_minTGCPhiHits = 0 );
95  declareProperty("MaxMSd0", m_maxMSd0 = 500. );
96  declareProperty("MaxMSz0", m_maxMSz0 = 500. );
97  declareProperty("MinMSPt", m_minMSPt = 0 );
98  declareProperty("MaxNumberOfSectors", m_maxNumberOfSectors = 1 );
99  declareProperty("MinNumberOfPhiLayers", m_minNumberOfPhiLayers = 2 );
100  declareProperty("MinStationLayers", m_minStationLayers = 3 );
101 
102  }
103 
104  //________________________________________________________________________
106  = default;
107 
108  //________________________________________________________________________
110  {
111  // configure main track fitter
112  ATH_CHECK(m_trackFitter.retrieve());
113  ATH_MSG_DEBUG("Retrieved " << m_trackFitter);
114  ATH_CHECK(m_muonHitSummaryTool.retrieve());
115  //
116  bookNtuple();
117  return StatusCode::SUCCESS;
118  }
119 
120 
121 
122 
124  m_ntuple = ntuple;
125  bookNtuple();
126  }
127 
128 
129 
130 
132 
133  ATH_MSG_DEBUG("in MSConstraintTracksProvider::bookNtuple");
134 
135  if (m_doTree && !m_tree && m_ntuple) {
136  m_ntuple->cd();
137  m_tree = new TTree("MSMomentumConstraint","MSMomentumConstraint");
138 
139  ATH_MSG_DEBUG(" Start book Ntuple");
140 
141  m_tree->Branch("run", &m_run, "run/I" );
142  m_tree->Branch("event", &m_event, "event/I" );
143  m_tree->Branch("pID", &m_pID, "pID/D" );
144  m_tree->Branch("pMS", &m_pMS, "pMS/D" );
145  m_tree->Branch("ptID", &m_ptID, "ptID/D" );
146  m_tree->Branch("ptMS", &m_ptMS, "ptMS/D" );
147  m_tree->Branch("charge", &m_charge, "charge/D" );
148 
149  m_tree->Branch("combinedEta", &m_combinedEta, "combinedEta/D" );
150  m_tree->Branch("IDEta", &m_IDEta, "IDEta/D" );
151  m_tree->Branch("combinedPhi", &m_combinedPhi, "combinedPhi/D" );
152  m_tree->Branch("IDPhi", &m_IDPhi, "IDPhi/D" );
153 
154  m_tree->Branch("pID_constrained", &m_pID_constrained, "pID_constrained/D" );
155  m_tree->Branch("ptID_constrained", &m_ptID_constrained, "ptID_constrained/D" );
156  m_tree->Branch("IDEta_constrained", &m_IDEta_constrained, "IDEta_constrained/D" );
157  m_tree->Branch("IDPhi_constrained", &m_IDPhi_constrained, "IDPhi_constrained/D" );
158  m_tree->Branch("charge_constrained", &m_charge_constrained, "charge_constrained/D" );
159 
160 
161  m_tree->Branch("eBLhits", &m_eBLhits, "eBLhits/I" );
162  m_tree->Branch("nBLhits", &m_nBLhits, "nBLhits/I" );
163 
164  m_tree->Branch("nPIXDS", &m_nPIXDS, "nPIXDS/I" );
165  m_tree->Branch("nSCTDS", &m_nSCTDS, "nSCTDS/I" );
166 
167  m_tree->Branch("nPIXH", &m_nPIXH, "nPIXH/I" );
168  m_tree->Branch("nSCTH", &m_nSCTH, "nSCTH/I" );
169 
170  m_tree->Branch("nPIXHits", &m_nPIXHits, "nPIXHits/I" );
171  m_tree->Branch("nSCTHits", &m_nSCTHits, "nSCTHits/I" );
172  m_tree->Branch("nTRTHits", &m_nTRTHits, "nTRTHits/I" );
173 
174  m_tree->Branch("sectors", &m_sectors, "sectors/I" );
175  m_tree->Branch("phiLayers", &m_phiLayers, "phiLayers/I" );
176  m_tree->Branch("stationLayers", &m_stationLayers, "stationLayers/I" );
177 
178  m_tree->Branch("sectorNum", &m_sectorNum, "sectorNum/I" );
179  m_tree->Branch("phiLayerNum", &m_phiLayerNum, "phiLayerNum/I" );
180  m_tree->Branch("stationLayerNum", &m_stationLayerNum, "stationLayerNum/I" );
181 
182  }
183 
184  ATH_MSG_DEBUG("done with bookNtuple");
185 
186  return true;
187 
188 }
189 
190 
191 
193 
194  m_run = -999;
195  m_event = -999;
196  m_pID = -999.;
197  m_pMS = -999.;
198  m_ptID = -999.;
199  m_ptMS = -999.;
200  m_charge = -999.;
201 
202  m_combinedEta = -999.;
203  m_IDEta = -999.;
204  m_combinedPhi = -999.;
205  m_IDPhi = -999.;
206 
207  m_pID_constrained = -999.;
208  m_ptID_constrained = -999.;
209  m_IDEta_constrained = -999.;
210  m_IDPhi_constrained = -999.;
211  m_charge_constrained = -999.;
212 
213 
214  m_eBLhits = -999;
215  m_nBLhits = -999;
216  m_nPIXDS = -999,
217  m_nSCTDS = -999,
218 
219  m_nPIXH = -999;
220  m_nSCTH = -999;
221 
222 
223  m_nPIXHits = -999;
224  m_nSCTHits = -999;
225  m_nTRTHits = -999;
226 
227  m_sectors = -999;
228  m_phiLayers = -999;
229  m_stationLayers = -999;
230 
231  m_sectorNum = -999;
232  m_phiLayerNum = -999;
233  m_stationLayerNum = -999;
234 
235  }
236 
237 
238 
240  {
241  ATH_MSG_DEBUG("writing tree");
242  int success=1;
243  if (m_tree) {
244  m_ntuple->cd();
245  success = m_tree->Write();
246  }
247  return success>0 ? StatusCode::SUCCESS : StatusCode::FAILURE;
248  }
249 
250 
251 
252  //________________________________________________________________________
254  {
255  return StatusCode::SUCCESS;
256  }
257 
258 
260 
261  const Trk::Perigee* IDTrkMeasuredPerigee = dynamic_cast<const Trk::Perigee*>(& (it->inDetTrackParticle()->definingParameters()));
262  if(!IDTrkMeasuredPerigee){
263  ATH_MSG_DEBUG("NO inDetTrackParticle or no IDTrkMeasuredPerigee");
264  return false;
265  }
266 
267  const Trk::Perigee* METrkMeasuredPerigee = dynamic_cast<const Trk::Perigee*>(&(it->muonExtrapolatedTrackParticle()->definingParameters()));
268  if(!METrkMeasuredPerigee){
269  ATH_MSG_DEBUG("NO muonExtrapolatedTrackParticle or no METrkMeasuredPerigee");
270  return false;
271  }
272 
273  const double pt = fabs(it->pt())/1000.;
274  const double eta = fabs(it->eta());
275  ATH_MSG_DEBUG(" the combined pt : "<< pt );
276 
277  if ( pt < m_minPt ||
278  eta > 2.7 ||
279  (eta > 0.8 && eta < 1.2) ){
280  ATH_MSG_DEBUG(" this combinedMuon not pass basic pt and eta cuts --- pt: "<< pt << " eta: " << eta);
281  return false;
282  }
283 
284  const int nPixHits = it->numberOfPixelHits();
285  const int nSCTHits = it->numberOfSCTHits();
286  const int nTRTHits = it->numberOfTRTHits();
287 
288  // Do you need fit quality cuts???
289  // const Trk::FitQuality* idfq = idtrk->fitQuality();
290  // const double chisqID = idfq->chiSquared();
291  // const int ndofID = idfq->numberDoF();
292 
293 
294  const double idQoverPatIP = IDTrkMeasuredPerigee->parameters()[Trk::qOverP] * 1000.;
295  const double idz0atIP = IDTrkMeasuredPerigee->parameters()[Trk::z0];
296  const double idd0atIP = IDTrkMeasuredPerigee->parameters()[Trk::d0];
297  double ptIDatIP = 0.;
298  if ( idQoverPatIP != 0 ) ptIDatIP = fabs(1.0/idQoverPatIP)*sin(IDTrkMeasuredPerigee->parameters()[Trk::theta]);
299 
300  ATH_MSG_DEBUG( " ID pt : "<< ptIDatIP );
301 
302 
303  if( nPixHits < m_minPIXHits ||
306  idd0atIP > m_maxIDd0 ||
307  idz0atIP > m_maxIDz0 ||
308  ptIDatIP < m_minIDPt ) {
309  ATH_MSG_DEBUG("this combined muon not pass ID cuts --- nPixHits: " << nPixHits << " nSCTHits: " << nSCTHits <<
310  "nTRTHits: " << nTRTHits << " idd0atIP: " << idd0atIP << " idz0atIP: " << idz0atIP <<" ptIDatIP: " << ptIDatIP );
311  return false;
312  }
313 
314 
315 
316  const int nMDTHits = it->numberOfMDTHits();
317  const int nRPCPhiHits = it->numberOfRPCPhiHits();
318  const int nTGCPhiHits = it->numberOfTGCPhiHits();
319 
320  const double msQoverPatIP = METrkMeasuredPerigee->parameters()[Trk::qOverP] * 1000.;
321  const double msz0atIP = METrkMeasuredPerigee->parameters()[Trk::z0];
322  const double msd0atIP = METrkMeasuredPerigee->parameters()[Trk::d0];
323 
324  double ptMSatIP = 0.;
325  if ( msQoverPatIP != 0 ) ptMSatIP = fabs(1.0/msQoverPatIP)*sin(METrkMeasuredPerigee->parameters()[Trk::theta]);
326 
327  ATH_MSG_DEBUG( " ME pt : "<< ptMSatIP);
328 
329 
330 
331  if( nMDTHits < m_minMDTHits ||
332  nRPCPhiHits < m_minRPCPhiHits ||
333  nTGCPhiHits < m_minTGCPhiHits ||
334  msd0atIP > m_maxMSd0 ||
335  msz0atIP > m_maxMSz0 ||
336  ptMSatIP < m_minMSPt ){
337 
338  ATH_MSG_DEBUG("this combined muon not pass MS cuts --- nMDTHits: " << nMDTHits << " nRPCPhiHits: " << nRPCPhiHits <<
339  " nTGCPhiHits: " << nTGCPhiHits << " msd0atIP: " << msd0atIP <<
340  " msz0atIP: " << msz0atIP << " pMSatIP:" << ptMSatIP);
341  return false;
342  }
343 
344 
346  const Rec::TrackParticle* aTrackParticle = it->track();
347 
348  const Trk::Track* aTrack = nullptr;
349  if (aTrackParticle) aTrack = aTrackParticle->originalTrack();
350 
351  if (aTrack && aTrack != it->inDetTrkTrack()) {
352  summary = m_muonHitSummaryTool->summary(*aTrack);
353  }
354  else {
355  ATH_MSG_WARNING("aTrack possible null !");
356  std::vector<const Muon::MuonSegment*> segments;
357  unsigned int nSeg = it->numberOfSegments();
358  segments.reserve(nSeg); // avoid death by push back
359  for( unsigned int si=0; si<nSeg; ++si ){
360  const Muon::MuonSegment* seg = dynamic_cast<const Muon::MuonSegment*>(it->muonSegment(si));
361  if( seg ) segments.push_back(seg);
362  }
363  summary = m_muonHitSummaryTool->summary(segments);
364  }
365 
366  // it is possible to avoid the verbose summary construction in the above,
367  const int sectors = summary.sectors.size();
368  const int phiLayers = summary.phiLayers.size();
369  const int stationLayers = summary.stationLayers.size();
370 
371 
372  if ( sectors > m_maxNumberOfSectors ||
373  phiLayers < m_minNumberOfPhiLayers ||
374  stationLayers < m_minStationLayers ){
375 
376  ATH_MSG_DEBUG("this combined muon not pass muonHitSummary cuts --- sectors: "<< sectors << " phiLayers: "<< phiLayers << " stationLayers: " << stationLayers);
377 
378  return false;
379  }
380 
381  m_pID = it->inDetTrackParticle()->p();
382  m_pMS = it->muonExtrapolatedTrackParticle()->p();
383  m_ptID = it->inDetTrackParticle()->pt();
384  m_ptMS = it->muonExtrapolatedTrackParticle()->pt();
385  m_charge = it->inDetTrackParticle()->charge();
386 
387  m_combinedEta = it->eta();
388  m_IDEta = it->inDetTrackParticle()->eta();
389  m_combinedPhi = it->phi();
390  m_IDPhi = it->inDetTrackParticle()->phi();
391 
392  m_nPIXHits = it->numberOfPixelHits();
393  m_nSCTHits = it->numberOfSCTHits();
394  m_nTRTHits = it->numberOfTRTHits();
395 
396  m_sectors = sectors;
397  m_phiLayers = phiLayers;
398  m_stationLayers = stationLayers;
399 
400  m_sectorNum = *(summary.sectors.begin());
401  //m_phiLayerNum = (summary.phiLayers)[0];
402  //m_stationLayerNum = (summary.stationLayers)[0];
403 
404 
405 
406  return true;
407  }
408 
409 
410 
413 
414  originalTracks = nullptr;
415 
416  const Analysis::MuonContainer* muonContainer = nullptr;
417  if ( StatusCode::SUCCESS != evtStore()->retrieve( muonContainer , m_inputMuonCollection) ){
418  ATH_MSG_WARNING(" Can't retrieve " << m_inputMuonCollection << " from the StoreGate ");
419  ATH_MSG_WARNING("One probability is that you are not running on ESD/DESD ");
420 
421  // Can't do MS constraint refit, resort to retrieve tracks directly
422  if ( StatusCode::SUCCESS != evtStore()->retrieve(originalTracks, m_inputTracksCollection) ){
423  originalTracks = nullptr;
424  ATH_MSG_WARNING(" Can't retrieve " << m_inputTracksCollection << " from the StoreGate ");
425  } else {
426  if (originalTracks){
427  ATH_MSG_DEBUG(" have tracks of this event: " << originalTracks->size());
428  }
429  }
430 
431  return StatusCode::SUCCESS;
432  } else {
433 
435  ATH_MSG_DEBUG("have combined Muons of the event: " << muonContainer->size());
436 
439  int goodQualityCombinedMuon = 0;
440 
441  for ( ; combinedTrackIt != combinedTrackItE; ++combinedTrackIt ) {
443  const Analysis::Muon* muon = *combinedTrackIt;
444  if ( muon->isCombinedMuon() && muon->hasMuonExtrapolatedTrackParticle() && muon->hasInDetTrackParticle() ){
447  ATH_MSG_DEBUG("have good quality combined Muons of the event: " << ++goodQualityCombinedMuon);
449  const Trk::Perigee* METrkMeasuredPerigee = dynamic_cast<const Trk::Perigee*>(&(muon->muonExtrapolatedTrackParticle()->definingParameters()));
450  if(!METrkMeasuredPerigee){
451  ATH_MSG_DEBUG("NO muonExtrapolatedTrackParticle or no METrkMeasuredPerigee");
452  continue;
453  }
454 
455  const Trk::Surface* surf = &(METrkMeasuredPerigee->associatedSurface()) ;
456  if( !surf ) {
457  ATH_MSG_DEBUG("NO surface of the METrkMeasuredPerigee");
458  continue;
459  }
460 
461  const Trk::Perigee* IDTrkMeasuredPerigee = dynamic_cast<const Trk::Perigee*>(&(muon->inDetTrackParticle()->definingParameters()));
462  if(!IDTrkMeasuredPerigee){
463  ATH_MSG_DEBUG("NO inDetTrackParticle or no IDTrkMeasuredPerigee");
464  continue;
465  }
466 
467  Trk::DefinedParameter qOverPFromMS(METrkMeasuredPerigee->parameters()[Trk::qOverP], Trk::qOverP) ;
468 
469  std::vector<Trk::DefinedParameter> parFromMSVec;
470  parFromMSVec.push_back( qOverPFromMS) ;
471 
472  Amg::MatrixX covFromMS( 1,1 ) ;
473  covFromMS( 1, 1 ) = (*METrkMeasuredPerigee->covariance())( Trk::qOverP, Trk::qOverP ) ;
474 
475  auto pmot = std::make_unique<Trk::PseudoMeasurementOnTrack>(
476  Trk::LocalParameters(parFromMSVec), std::move(covFromMS), *surf);
477 
478  auto trackStateOnSurfaces = std::make_unique<Trk::TrackStates>();
479  trackStateOnSurfaces->reserve(muon->inDetTrackParticle()->originalTrack()->trackStateOnSurfaces()->size() + 1);
480  Trk::TrackStates::const_iterator sb = muon->inDetTrackParticle()->originalTrack()->trackStateOnSurfaces()->begin();
481 
482  std::bitset<Trk::TrackStateOnSurface::NumberOfTrackStateOnSurfaceTypes> type;
484 
485  const Perigee* IDPerigeeParameters = muon->inDetTrackParticle()->originalTrack()->perigeeParameters();
486 
487  auto IDPerigeeParametersClone =
488  (IDPerigeeParameters)
489  ? std::make_unique<Perigee>(*IDPerigeeParameters)
490  : nullptr;
491 
492  if(IDPerigeeParameters && IDPerigeeParametersClone ){
493  trackStateOnSurfaces->push_back(new const Trk::TrackStateOnSurface(std::move(pmot), std::move(IDPerigeeParametersClone), nullptr, type));
494 
495  for ( ; sb != muon->inDetTrackParticle()->originalTrack()->trackStateOnSurfaces()->end(); ++sb) trackStateOnSurfaces->push_back((**sb).clone());
496 
497  Trk::Track* tmpTrack = new Trk::Track(
498  muon->inDetTrackParticle()->originalTrack()->info(),
499  std::move(trackStateOnSurfaces),
500  nullptr);
501 
502  Trk::Track* MSConstraintFittedTrack = (m_trackFitter->fit(Gaudi::Hive::currentContext(),
503  *tmpTrack, m_runOutlierRemoval,
504  Trk::muon)).release();
505 
506  if(!MSConstraintFittedTrack){
508  ATH_MSG_WARNING("MSConstraintFittedTrack refit failed!");
509 
511  ATH_MSG_WARNING("Try to push the originalIDTrack into the trackCollection");
512  Trk::Track* IDOriginalTrackClone = new Trk::Track(*(muon->inDetTrackParticle()->originalTrack()));
513  if(IDOriginalTrackClone){
514  const Trk::Perigee * aMeasPerClone = IDOriginalTrackClone->perigeeParameters();
515  if (aMeasPerClone) {
517  "IDOriginalTrackClone parameters --- pt: "
518  << fabs(1. / (aMeasPerClone->parameters()[Trk::qOverP])) *
519  sin(aMeasPerClone->parameters()[Trk::theta])
520  << " d0: " << aMeasPerClone->parameters()[Trk::d0]);
521  }
522  }
523  if(!IDOriginalTrackClone){
524  ATH_MSG_WARNING("Exception when IDOriginalTrackClone!");
525  } else
526  trackCollection->push_back(IDOriginalTrackClone);
527  }
528  } else {
530  ATH_MSG_DEBUG("Got 1 successful MSConstraintFittedTrack ");
531 
532  Trk::Track* MSConstraintFittedTrackClone = new Trk::Track(*MSConstraintFittedTrack);
533  const Trk::Perigee * MSConstraintFittedTrackMPClone = (MSConstraintFittedTrackClone->perigeeParameters());
534  m_pID_constrained = fabs(1./(MSConstraintFittedTrackMPClone->parameters()[Trk::qOverP]));
535  m_IDEta_constrained = -log(tan(MSConstraintFittedTrackMPClone->parameters()[Trk::theta]/2.));
536  m_IDPhi_constrained = MSConstraintFittedTrackMPClone->parameters()[Trk::phi];
537  m_ptID_constrained = fabs( m_pID_constrained*sin(MSConstraintFittedTrackMPClone->parameters()[Trk::theta]) );
538  m_charge_constrained = MSConstraintFittedTrackMPClone->parameters()[Trk::qOverP]/fabs(MSConstraintFittedTrackMPClone->parameters()[Trk::qOverP]);
539 
540  delete MSConstraintFittedTrackClone;
541  // only fill the tracks used in the alignment
542  m_ntuple->cd();
543  m_tree->Fill();
544 
545  trackCollection->push_back(MSConstraintFittedTrack);
546  }
547 
548  // clean up
549  delete tmpTrack;
550  } else{
551  ATH_MSG_WARNING("failed in IDPerigeeParameters or IDPerigeeParametersClone !");
552  }
553 
554  }
555  }
556  }// end loop over tracks
557 
558  if (StatusCode::SUCCESS != evtStore()->record(trackCollection, "MSMomentumConstraintTracks")){
559  ATH_MSG_WARNING("problem with recording MSMomentumConstraintTracks to StoreGate!");
560  return StatusCode::SUCCESS;
561  }
562 
563  ATH_MSG_DEBUG(" The final trackCollection size : " << trackCollection->size() );
564  if ( not trackCollection->empty() ){
565  originalTracks = trackCollection;
566  }
567 
568  }
569  return StatusCode::SUCCESS;
570 }
571 
572 
574 
575  if(m_logStream) {
576 
577  *m_logStream<<"*************************************************************"<<std::endl;
578  *m_logStream<<"****** MSConstraintTracksProvider Summary ******"<<std::endl;
579  *m_logStream<<"*"<<std::endl;
580  *m_logStream<<"* number of combined muons From SG : " << m_nCBMuonsFromSG << std::endl;
581  *m_logStream<<"* number of combined muons have Extrapolated && InDet TrackParticle : " << m_nCBMuonsHasEXandID << std::endl;
582  *m_logStream<<"* number of combined muons pass selection: " << m_nCBMuonsPassSelection << std::endl;
583  *m_logStream<<"* number of combined muons failed in refit: " << m_nCBMuonsFailedRefit << std::endl;
584  *m_logStream<<"* number of combined muons succeeded in refit: " << m_nCBMuonsSucRefit << std::endl;
585 
586  *m_logStream<<"*"<<std::endl;
587  }
588  }
589 
590 
591 } // end namespace
muonContainer
xAOD::MuonContainer * muonContainer
Definition: TrigGlobEffCorrValidation.cxx:188
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
MSConstraintTracksProvider.h
Trk::MSConstraintTracksProvider::m_ntuple
TFile * m_ntuple
Definition: MSConstraintTracksProvider.h:85
Trk::LocalParameters
Definition: LocalParameters.h:98
Trk::MSConstraintTracksProvider::m_nCBMuonsHasEXandID
int m_nCBMuonsHasEXandID
Definition: MSConstraintTracksProvider.h:79
Trk::MSConstraintTracksProvider::m_nCBMuonsFailedRefit
int m_nCBMuonsFailedRefit
Definition: MSConstraintTracksProvider.h:81
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
Amg::MatrixX
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Definition: EventPrimitives.h:27
TrackParameters.h
TrackParticle.h
MeasurementBase.h
Trk::MSConstraintTracksProvider::initializeNtuple
void initializeNtuple()
Definition: MSConstraintTracksProvider.cxx:192
PerigeeSurface.h
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Trk::MSConstraintTracksProvider::trackCollection
virtual StatusCode trackCollection(const TrackCollection *&tracks)
Definition: MSConstraintTracksProvider.cxx:411
Trk::MSConstraintTracksProvider::m_maxMSd0
double m_maxMSd0
Definition: MSConstraintTracksProvider.h:72
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
Trk::MSConstraintTracksProvider::m_useMSConstraintTrkOnly
bool m_useMSConstraintTrkOnly
Definition: MSConstraintTracksProvider.h:59
Trk::MSConstraintTracksProvider::m_minPt
double m_minPt
Definition: MSConstraintTracksProvider.h:62
xAOD::JetInput::Track
@ Track
Definition: JetContainerInfo.h:61
MuonContainer.h
skel.it
it
Definition: skel.GENtoEVGEN.py:396
test_pyathena.pt
pt
Definition: test_pyathena.py:11
Trk::MSConstraintTracksProvider::m_minSCTHits
int m_minSCTHits
Definition: MSConstraintTracksProvider.h:64
Muon::IMuonHitSummaryTool::CompactSummary
Definition: IMuonHitSummaryTool.h:70
Trk::MSConstraintTracksProvider::m_stationLayerNum
int m_stationLayerNum
Definition: MSConstraintTracksProvider.h:125
Trk::z0
@ z0
Definition: ParamDefs.h:64
Trk::MSConstraintTracksProvider::m_eBLhits
int m_eBLhits
Definition: MSConstraintTracksProvider.h:106
Trk::MSConstraintTracksProvider::m_IDPhi_constrained
double m_IDPhi_constrained
Definition: MSConstraintTracksProvider.h:103
Trk::MSConstraintTracksProvider::m_nCBMuonsPassSelection
int m_nCBMuonsPassSelection
Definition: MSConstraintTracksProvider.h:80
Trk::MSConstraintTracksProvider::m_maxNumberOfSectors
double m_maxNumberOfSectors
Definition: MSConstraintTracksProvider.h:75
Trk::MSConstraintTracksProvider::m_minTGCPhiHits
int m_minTGCPhiHits
Definition: MSConstraintTracksProvider.h:71
Trk::MSConstraintTracksProvider::m_minMSPt
double m_minMSPt
Definition: MSConstraintTracksProvider.h:74
Trk::MSConstraintTracksProvider::m_minStationLayers
double m_minStationLayers
Definition: MSConstraintTracksProvider.h:77
Trk::MSConstraintTracksProvider::m_maxIDz0
double m_maxIDz0
Definition: MSConstraintTracksProvider.h:67
Trk::MSConstraintTracksProvider::m_stationLayers
int m_stationLayers
Definition: MSConstraintTracksProvider.h:121
Trk::DefinedParameter
std::pair< double, ParamDefs > DefinedParameter
Definition: DefinedParameter.h:27
Trk::MSConstraintTracksProvider::m_minPIXHits
int m_minPIXHits
Definition: MSConstraintTracksProvider.h:63
Trk::MSConstraintTracksProvider::m_pID
double m_pID
Definition: MSConstraintTracksProvider.h:89
Trk::ParametersT::associatedSurface
virtual const S & associatedSurface() const override final
Access to the Surface method.
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
Trk::MSConstraintTracksProvider::m_phiLayers
int m_phiLayers
Definition: MSConstraintTracksProvider.h:120
Trk::MSConstraintTracksProvider::m_runOutlierRemoval
RunOutlierRemoval m_runOutlierRemoval
run outlier removal in the GX2 fitter
Definition: MSConstraintTracksProvider.h:57
Trk::MSConstraintTracksProvider::setNtuple
void setNtuple(TFile *ntuple)
sets ntuple
Definition: MSConstraintTracksProvider.cxx:123
Trk::MSConstraintTracksProvider::MSConstraintTracksProvider
MSConstraintTracksProvider(const std::string &type, const std::string &name, const IInterface *parent)
Definition: MSConstraintTracksProvider.cxx:28
Trk::MSConstraintTracksProvider::m_nPIXH
int m_nPIXH
Definition: MSConstraintTracksProvider.h:112
TrackCollection
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Definition: TrackCollection.h:19
IDTPM::nSCTHits
float nSCTHits(const U &p)
Definition: TrackParametersHelper.h:393
IDTPM::nTRTHits
float nTRTHits(const U &p)
Definition: TrackParametersHelper.h:446
Trk::theta
@ theta
Definition: ParamDefs.h:66
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
Trk::MSConstraintTracksProvider::m_nSCTH
int m_nSCTH
Definition: MSConstraintTracksProvider.h:113
Trk::MSConstraintTracksProvider::m_ptID
double m_ptID
Definition: MSConstraintTracksProvider.h:91
Trk::MSConstraintTracksProvider::m_phiLayerNum
int m_phiLayerNum
Definition: MSConstraintTracksProvider.h:124
Trk::MSConstraintTracksProvider::m_nSCTDS
int m_nSCTDS
Definition: MSConstraintTracksProvider.h:110
Trk::MSConstraintTracksProvider::m_nTRTHits
int m_nTRTHits
Definition: MSConstraintTracksProvider.h:117
Trk::MSConstraintTracksProvider::m_inputMuonCollection
std::string m_inputMuonCollection
Name of input combined muons collection.
Definition: MSConstraintTracksProvider.h:55
Trk::MSConstraintTracksProvider::m_maxMSz0
double m_maxMSz0
Definition: MSConstraintTracksProvider.h:73
PseudoMeasurementOnTrack.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trk::MSConstraintTracksProvider::m_event
int m_event
Definition: MSConstraintTracksProvider.h:88
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
Trk::MSConstraintTracksProvider::fillNtuple
StatusCode fillNtuple()
writes tree to ntuple
Definition: MSConstraintTracksProvider.cxx:239
Analysis::Muon
The ATLAS Muon object - see doxygen, physics workbookd and the Muon Combined Performance WG's pages f...
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/Muon.h:48
Trk::MSConstraintTracksProvider::m_ptMS
double m_ptMS
Definition: MSConstraintTracksProvider.h:92
Trk::MSConstraintTracksProvider::m_IDEta
double m_IDEta
Definition: MSConstraintTracksProvider.h:96
Trk::MSConstraintTracksProvider::m_minTRTHits
int m_minTRTHits
Definition: MSConstraintTracksProvider.h:65
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
Trk::MSConstraintTracksProvider::m_IDPhi
double m_IDPhi
Definition: MSConstraintTracksProvider.h:98
Analysis::MuonContainer
definition of StoreGate container holding a vector of Analysis::Muon
Definition: Reconstruction/MuonIdentification/muonEvent/muonEvent/MuonContainer.h:38
Trk::muon
@ muon
Definition: ParticleHypothesis.h:28
DataVector< Trk::Track >
Trk::MSConstraintTracksProvider::m_combinedEta
double m_combinedEta
Definition: MSConstraintTracksProvider.h:95
Trk::MSConstraintTracksProvider::m_pMS
double m_pMS
Definition: MSConstraintTracksProvider.h:90
Trk::MSConstraintTracksProvider::combinedMuonSelection
bool combinedMuonSelection(const Analysis::Muon *)
Definition: MSConstraintTracksProvider.cxx:259
Trk::MSConstraintTracksProvider::~MSConstraintTracksProvider
virtual ~MSConstraintTracksProvider()
Trk::MSConstraintTracksProvider::m_minNumberOfPhiLayers
double m_minNumberOfPhiLayers
Definition: MSConstraintTracksProvider.h:76
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
keylayer_zslicemap.sb
sb
Definition: keylayer_zslicemap.py:192
Trk::MSConstraintTracksProvider::m_tree
TTree * m_tree
Definition: MSConstraintTracksProvider.h:86
Trk::TrackStateOnSurface
represents the track state (measurement, material, fit parameters and quality) at a surface.
Definition: TrackStateOnSurface.h:71
python.EventInfoMgtInit.release
release
Definition: EventInfoMgtInit.py:24
Trk::MSConstraintTracksProvider::m_nBLhits
int m_nBLhits
Definition: MSConstraintTracksProvider.h:107
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::d0
@ d0
Definition: ParamDefs.h:63
Trk::MSConstraintTracksProvider::m_minIDPt
double m_minIDPt
Definition: MSConstraintTracksProvider.h:68
Trk::MSConstraintTracksProvider::m_trackFitter
ToolHandle< IGlobalTrackFitter > m_trackFitter
normal track fitter
Definition: MSConstraintTracksProvider.h:51
Trk::MSConstraintTracksProvider::m_charge
int m_charge
Definition: MSConstraintTracksProvider.h:93
Rec::TrackParticle
Definition: Reconstruction/Particle/Particle/TrackParticle.h:47
Trk::MSConstraintTracksProvider::m_nCBMuonsSucRefit
int m_nCBMuonsSucRefit
Definition: MSConstraintTracksProvider.h:82
Trk::MSConstraintTracksProvider::m_maxIDd0
double m_maxIDd0
Definition: MSConstraintTracksProvider.h:66
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Trk::MSConstraintTracksProvider::m_sectors
int m_sectors
Definition: MSConstraintTracksProvider.h:119
Trk::MSConstraintTracksProvider::m_minRPCPhiHits
int m_minRPCPhiHits
Definition: MSConstraintTracksProvider.h:70
Trk::MSConstraintTracksProvider::m_muonHitSummaryTool
PublicToolHandle< Muon::IMuonHitSummaryTool > m_muonHitSummaryTool
Definition: MSConstraintTracksProvider.h:53
Trk::MSConstraintTracksProvider::finalize
virtual StatusCode finalize()
Definition: MSConstraintTracksProvider.cxx:253
Trk::MSConstraintTracksProvider::m_pID_constrained
double m_pID_constrained
Definition: MSConstraintTracksProvider.h:100
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Trk::MSConstraintTracksProvider::m_charge_constrained
int m_charge_constrained
Definition: MSConstraintTracksProvider.h:104
Trk::ITrackCollectionProvider::m_logStream
std::ostream * m_logStream
logfile output stream
Definition: ITrackCollectionProvider.h:53
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Trk::MSConstraintTracksProvider::m_nPIXHits
int m_nPIXHits
Definition: MSConstraintTracksProvider.h:115
Muon.h
Trk::MSConstraintTracksProvider::initialize
virtual StatusCode initialize()
Definition: MSConstraintTracksProvider.cxx:109
Trk::MSConstraintTracksProvider::m_nPIXDS
int m_nPIXDS
Definition: MSConstraintTracksProvider.h:109
Trk::MSConstraintTracksProvider::m_inputTracksCollection
std::string m_inputTracksCollection
Name of input tracks collection.
Definition: MSConstraintTracksProvider.h:56
MuonSegment.h
Trk::MSConstraintTracksProvider::m_nCBMuonsFromSG
int m_nCBMuonsFromSG
Definition: MSConstraintTracksProvider.h:78
Trk::phi
@ phi
Definition: ParamDefs.h:75
MuonParamDefs.h
Muon::MuonSegment
Definition: MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonSegment/MuonSegment/MuonSegment.h:45
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
AthAlgTool
Definition: AthAlgTool.h:26
Trk::MSConstraintTracksProvider::m_nSCTHits
int m_nSCTHits
Definition: MSConstraintTracksProvider.h:116
Trk::MSConstraintTracksProvider::m_minMDTHits
int m_minMDTHits
Definition: MSConstraintTracksProvider.h:69
Trk::MSConstraintTracksProvider::m_combinedPhi
double m_combinedPhi
Definition: MSConstraintTracksProvider.h:97
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75
Trk::MSConstraintTracksProvider::m_doTree
bool m_doTree
Definition: MSConstraintTracksProvider.h:60
Trk::MSConstraintTracksProvider::m_run
int m_run
Definition: MSConstraintTracksProvider.h:87
Trk::TrackParticleBase::originalTrack
const Track * originalTrack() const
Return pointer to associated track.
Definition: TrackParticleBase.h:205
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
ITrackFitter.h
Trk::TrackStateOnSurface::Measurement
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
Definition: TrackStateOnSurface.h:101
Trk::MSConstraintTracksProvider::bookNtuple
bool bookNtuple()
Definition: MSConstraintTracksProvider.cxx:131
IGlobalTrackFitter.h
Trk::MSConstraintTracksProvider::m_ptID_constrained
double m_ptID_constrained
Definition: MSConstraintTracksProvider.h:101
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Trk::MSConstraintTracksProvider::m_IDEta_constrained
double m_IDEta_constrained
Definition: MSConstraintTracksProvider.h:102
Trk::MSConstraintTracksProvider::printSummary
virtual void printSummary()
Print statistical summary to logfile.
Definition: MSConstraintTracksProvider.cxx:573
Trk::MSConstraintTracksProvider::m_sectorNum
int m_sectorNum
Definition: MSConstraintTracksProvider.h:123
SCT_Monitoring::summary
@ summary
Definition: SCT_MonitoringNumbers.h:65