ATLAS Offline Software
MuonInsideOutAnalysis.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 #include "TTree.h"
10 #include "TH1.h"
11 #include "TH2.h"
12 #include <iostream>
13 
14 #include "GaudiKernel/MsgStream.h"
16 
17 namespace Muon {
18 
20  m_plots.book(dir,"");
21  }
22 
24 
25  // create ntuple and initialize it
27  ntuple.init("",&tree,false);
28  //tree.SetMakeClass(1);
29  // loop over tree
30  Long64_t nentries = tree.GetEntries();
31  MsgStream log(Athena::getMessageSvc(),"MuonInsideOutAnalysis");
32  if (log.level()<=MSG::INFO) log << MSG::INFO << "Opening tree " << nentries << endmsg;
33  for (Long64_t jentry=0; jentry<nentries;jentry++) {
34 
35  // load tree and get entries
36  Long64_t centry = tree.LoadTree(jentry);
37  if (centry < 0) return;
38  tree.GetEntry(jentry);
39 
40 
41  if( jentry%1000 == 0 ){
42  if (log.level()<=MSG::INFO) {
43  log << MSG::INFO << " new event " << jentry << endmsg;
44  log << MSG::INFO << " tracks " << ntuple.trackParticleBlock.pt->size() << " segments " << ntuple.segmentBlock.quality->size() << endmsg;
45  }
46  }
47 
48  // to simplify the analysis we in the beginning look up the indicies of objects corresponding to a given track identifier
49  // fill look up tables
50  typedef std::map<int,std::vector<int> > TrackMap;
51  auto fillTrackMap = []( const std::vector<int>& trkids, TrackMap& trackMap ){
52  for( unsigned int i=0;i<trkids.size();++i){
53  trackMap[ trkids[i] ].push_back(i);
54  }
55  };
56 
57  TrackMap track_seg_map;
58  fillTrackMap( *ntuple.segmentBlock.track.trkid, track_seg_map );
59 
60  TrackMap track_hough_map;
61  fillTrackMap( *ntuple.houghBlock.track.trkid, track_hough_map );
62 
63  TrackMap track_hit_map;
64  fillTrackMap( *ntuple.hitBlock.track.trkid, track_hit_map );
65 
66  TrackMap track_time_map;
67  fillTrackMap( *ntuple.timeBlock.track.trkid, track_time_map );
68 
69  TrackMap track_candidate_map;
70  fillTrackMap( *ntuple.candidateBlock.track.trkid, track_candidate_map );
71 
72  // now run the analysis per track
73  // loop over tracks
74  TrackPlots* trackPlots = nullptr;
75  for( unsigned int i=0;i<ntuple.trackParticleBlock.pt->size();++i){
76 
77  //if( (*ntuple.trackParticleBlock.pt)[i] < 50000. ) continue;
78  float eta = (*ntuple.trackParticleBlock.eta)[i];
79  bool isBarrel = std::abs(eta)<1.05;
80  float betaTruth = (*ntuple.trackParticleBlock.truth.beta)[i];
81 
82  // this loop is ther to deal with the following cases:
83  // 1) true muon + segments from the same muon in the MS -> our signal
84  // 2) true muon + segments from other particles -> background
85  // 3) ID track not a muon -> background
86  for( int ii=0;ii<3;++ii ){
87  MatchingStrategy matchingStrategy = static_cast<MatchingStrategy>(ii);
88 
89  // first select track type, first deal with the case the track is a stau
90  if( std::abs((*ntuple.trackParticleBlock.truth.pdg)[i]) == 1000015 ) {
91  if( matchingStrategy == SameTrack ) trackPlots = &m_plots.stau;
92  else if( matchingStrategy == NotSameTrack ) trackPlots = &m_plots.rest;
93  else continue;
94  }else if( std::abs((*ntuple.trackParticleBlock.truth.pdg)[i]) == 13 ) {
95  if( matchingStrategy == SameTrack ) trackPlots = &m_plots.muon;
96  else if( matchingStrategy == NotSameTrack ) trackPlots = &m_plots.rest;
97  else continue;
98  }else{
99  // track is not a muon
100  if( matchingStrategy == All ) trackPlots = &m_plots.rest;
101  else continue;
102  }
103 
104  // count the number of true segments/reconstructed segments/layers with hough maxima
105  unsigned int ntruth = 0;
106  unsigned int nseg = 0;
107  unsigned int nseg1 = 0;
108  unsigned int nseg2 = 0;
109  unsigned int nseg3 = 0;
110  unsigned int nhough = 0;
111 
112  // process segments
113  TrackMap::iterator pos = track_seg_map.find(i);
114  if( pos != track_seg_map.end() ) {
115  nseg = handleSegments(ntuple,i,pos->second,0, matchingStrategy, trackPlots->segments);
116  nseg1 = handleSegments(ntuple,i,pos->second,1, matchingStrategy, trackPlots->segments1);
117  nseg2 = handleSegments(ntuple,i,pos->second,2, matchingStrategy, trackPlots->segments2);
118  nseg3 = handleSegments(ntuple,i,pos->second,3, matchingStrategy, trackPlots->segments3);
119  }
120 
121  // process hough
122  pos = track_hough_map.find(i);
123  if( pos != track_hough_map.end() ) {
124  nhough = handleHough(ntuple,i,pos->second, matchingStrategy, trackPlots->hough);
125  }
126 
127  // process hits
128  pos = track_hit_map.find(i);
129  if( pos != track_hit_map.end() ) {
130  ntruth = handleHits(ntuple,i,pos->second, matchingStrategy, trackPlots->hits);
131  }
132 
133  // process times
134  pos = track_time_map.find(i);
135  if( pos != track_time_map.end() ) {
136  handleTimes(ntuple,i,pos->second, matchingStrategy, *trackPlots);
137  }
138 
139 
140  // fill general track block only once per track
141  if( matchingStrategy == SameTrack || matchingStrategy == All ) {
142  trackPlots->fill(ntuple.trackParticleBlock,i);
143  trackPlots->fill(ntruth,nseg,nseg1,nseg2,nseg3,nhough);
144 
145  pos = track_candidate_map.find(i);
146  // bool justOnCandidate = true;
147  // loop over stages and fill plots
148  for( unsigned int si=0;si<trackPlots->candidateStages.size();++si ){
149  StageSummaryPlots& plots = trackPlots->candidateStages[si];
150  std::pair<unsigned int,unsigned int> candidateCounts(0,0);
151  if( pos != track_candidate_map.end() ) candidateCounts = handleCandidates(ntuple,i,pos->second, plots, si );
152  if( candidateCounts.first == 0 ) {
153  plots.etaMissed->Fill(eta);
154  plots.etaBetaMissed->Fill(eta,betaTruth);
155  plots.betaMissed->Fill(betaTruth);
156  }
157  if( candidateCounts.second == 0 ) {
158  plots.etaMissedCombined->Fill(eta);
159  plots.betaMissedCombined->Fill(betaTruth);
160  }
161  plots.ncandidates->Fill(candidateCounts.first);
162  plots.ncombinedCandidates->Fill(candidateCounts.second);
163  // if( candidateCounts.first > 1 ) justOnCandidate = false;
164  }
165  if( nseg3 < 2 ) continue;
166 
167  pos = track_time_map.find(i);
168  if( pos != track_time_map.end() ) {
169 
170  BetaFitRegionPlots& betaRegionPlots = isBarrel ? trackPlots->barrel : trackPlots->endcap;
171 
172  // loop over input types, RPC + MDT segment or RPC + MDTT
173  for( unsigned int co=0;co<2;++co ){
174 
175  std::set<int> selection = {1};
176  TimePointBetaFitter::FitResult betaFitResult = fitBeta( ntuple, pos->second,selection);
177  if( betaFitResult.status != 0 ) betaRegionPlots.mdt.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
178  if( isBarrel ){
179 
180  selection = {2};
181  betaFitResult = fitBeta( ntuple, pos->second,selection );
182  if( betaFitResult.status != 0 ) betaRegionPlots.rpc.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
183 
184  selection = {12};
185  betaFitResult = fitBeta( ntuple, pos->second,selection );
186  if( betaFitResult.status != 0 ) betaRegionPlots.rpct.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
187 
188  selection = {1,2};
189  betaFitResult = fitBeta( ntuple, pos->second,selection );
190  if( betaFitResult.status != 0 ) betaRegionPlots.all.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
191 
192  selection = {10,12};
193  betaFitResult = fitBeta( ntuple, pos->second,selection );
194  if( betaFitResult.status != 0 ) {
195  betaRegionPlots.allt.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
196  if( betaFitResult.ndof > 9 ) betaRegionPlots.allt_good.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
197  }
198  }
199 
200  selection = {10};
201  betaFitResult = fitBeta( ntuple, pos->second,selection );
202  if( betaFitResult.status != 0 ) {
203  betaRegionPlots.mdtt.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
204  if( betaFitResult.ndof > 9 ) betaRegionPlots.mdtt_good.fill( betaFitResult.beta, betaTruth, betaFitResult.chi2, betaFitResult.ndof );
205  }
206  }
207  }
208  }
209  }
210  }
211  }
212  }
213 
214  std::pair<unsigned int,unsigned int> MuonInsideOutAnalysis::handleCandidates( MuonInsideOutValidationNtuple& ntuple, unsigned int trkIndex,
215  const std::vector<int>& indexVec,
216  StageSummaryPlots& plots, int stage ){
217 
218  CandidatePlots& allCandidates = plots.allCandidates;
219  CandidatePlots& tagCandidates = plots.tagCandidates;
220  CandidatePlots& combinedCandidates = plots.combinedCandidates;
221 
222  float betaTruth = (*ntuple.trackParticleBlock.truth.beta)[trkIndex];
223 
224  // loop over hits
225  int bestTagCandidateIndex = -1;
226  float bestRes = FLT_MAX;
227  int bestCombinedCandidateIndex = -1;
228  float bestCombinedRes = FLT_MAX;
229  unsigned int ncandidates = 0;
230  unsigned int ncombinedCandidates = 0;
231  for( std::vector<int>::const_iterator it=indexVec.begin();it!=indexVec.end();++it ){
232 
233  if( *it < 0 || *it >= (int)ntuple.candidateBlock.ntimes->size() ) {
234  MsgStream log(Athena::getMessageSvc(),"MuonInsideOutAnalysis");
235  if (log.level()<=MSG::WARNING) log << MSG::WARNING << "index out of range: " << (*it) << " max " << ntuple.candidateBlock.ntimes->size() << endmsg;
236  continue;
237  }
238  if( (*ntuple.candidateBlock.stage)[*it] != stage ) continue;
239  bool hasTrack = (*ntuple.candidateBlock.nprec)[*it] > 0;
240  float beta = (*ntuple.candidateBlock.beta)[*it];
241  float res = std::abs(beta-betaTruth);
242  ++ncandidates;
243 
244  allCandidates.fill(ntuple.trackParticleBlock,trkIndex);
245  allCandidates.betaCandidates.fill( beta, betaTruth, (*ntuple.candidateBlock.chi2ndof)[*it], (*ntuple.candidateBlock.ntimes)[*it] );
246 
247  if( hasTrack ){
248  if( res < bestCombinedRes ){
249  bestCombinedRes = res;
250  bestCombinedCandidateIndex = *it;
251  }
252  combinedCandidates.fill(ntuple.trackParticleBlock,trkIndex);
253  combinedCandidates.betaCandidates.fill( beta, betaTruth, (*ntuple.candidateBlock.chi2ndof)[*it], (*ntuple.candidateBlock.ntimes)[*it] );
254  ++ncombinedCandidates;
255  }else{
256  if( res < bestRes ){
257  bestRes = res;
258  bestTagCandidateIndex = *it;
259  }
260  tagCandidates.fill(ntuple.trackParticleBlock,trkIndex);
261  tagCandidates.betaCandidates.fill( beta, betaTruth, (*ntuple.candidateBlock.chi2ndof)[*it], (*ntuple.candidateBlock.ntimes)[*it] );
262  }
263 
264  }
265  if( bestCombinedCandidateIndex != -1 ){
266  combinedCandidates.betaBestCandidate.fill( (*ntuple.candidateBlock.beta)[bestCombinedCandidateIndex], betaTruth,
267  (*ntuple.candidateBlock.chi2ndof)[bestCombinedCandidateIndex],
268  (*ntuple.candidateBlock.ntimes)[bestCombinedCandidateIndex] );
269  }
270  if( bestTagCandidateIndex != -1 ){
271  tagCandidates.betaBestCandidate.fill( (*ntuple.candidateBlock.beta)[bestTagCandidateIndex], betaTruth, (*ntuple.candidateBlock.chi2ndof)[bestTagCandidateIndex],
272  (*ntuple.candidateBlock.ntimes)[bestTagCandidateIndex] );
273  }
274  int bestCandidateIndex = bestCombinedCandidateIndex != -1 ? bestCombinedCandidateIndex : bestTagCandidateIndex;
275  if( bestCandidateIndex != -1 ){
276  allCandidates.betaBestCandidate.fill( (*ntuple.candidateBlock.beta)[bestCandidateIndex], betaTruth, (*ntuple.candidateBlock.chi2ndof)[bestCandidateIndex],
277  (*ntuple.candidateBlock.ntimes)[bestCandidateIndex] );
278  }
279  return std::make_pair(ncandidates,ncombinedCandidates);
280  }
281 
282  unsigned int MuonInsideOutAnalysis::handleSegments( MuonInsideOutValidationNtuple& ntuple, unsigned int trkIndex,
283  const std::vector<int>& indexVec, int stage,
285  SegmentPlots& segmentPlots ) {
286 
287  unsigned int nseg = 0;
288  int barcode_trk = (*ntuple.trackParticleBlock.truth.barcode)[trkIndex];
289  float p = (*ntuple.trackParticleBlock.p)[trkIndex]*0.001;
290 
291  for( std::vector<int>::const_iterator it=indexVec.begin();it!=indexVec.end();++it ){
292 
293  bool sameTrack = (*ntuple.segmentBlock.truth.barcode)[*it] == barcode_trk;
294  // select stage + same track only same barcode for now
295  if( (*ntuple.segmentBlock.stage)[*it] != stage ) continue;
296  ++nseg;
297  if( !testStrategy(matchingStrategy,sameTrack) ) continue;
298 
299  segmentPlots.fill( ntuple.segmentBlock, *it, p, (*ntuple.trackParticleBlock.truth.beta)[trkIndex] );
300 
301  }
302  return nseg;
303  }
304 
305  unsigned int MuonInsideOutAnalysis::handleHough( MuonInsideOutValidationNtuple& ntuple, unsigned int trkIndex,
306  const std::vector<int>& indexVec, MuonInsideOutAnalysis::MatchingStrategy matchingStrategy,
307  HoughPlots& plots ) {
308 
309  unsigned int nhough = 0;
310  int barcode_trk = (*ntuple.trackParticleBlock.truth.barcode)[trkIndex];
311  float p = (*ntuple.trackParticleBlock.p)[trkIndex]*0.001;
312  for( std::vector<int>::const_iterator it=indexVec.begin();it!=indexVec.end();++it ){
313 
314  // same track
315  bool sameTrack = (*ntuple.houghBlock.truth.barcode)[*it] == barcode_trk;
316  if( !testStrategy(matchingStrategy,sameTrack) ) continue;
317 
318  plots.fill( ntuple.houghBlock, *it, p );
319 
320  ++nhough;
321  }
322 
323  return nhough;
324  }
325 
326  unsigned int MuonInsideOutAnalysis::handleHits( MuonInsideOutValidationNtuple& ntuple, unsigned int trkIndex,
327  const std::vector<int>& indexVec, MuonInsideOutAnalysis::MatchingStrategy matchingStrategy,
328  HitPlots& plots ) {
329 
330  int barcode_trk = (*ntuple.trackParticleBlock.truth.barcode)[trkIndex];
331  float p = (*ntuple.trackParticleBlock.p)[trkIndex]*0.001;
332 
333  // count the number of hits per layer and use that to get the number of 'truth' segments
334  std::map<int,int> countsPerLayer;
335 
336  for( std::vector<int>::const_iterator it=indexVec.begin();it!=indexVec.end();++it ){
337 
338  // select stagesame track, only same barcode for now
339  bool sameTrack = (*ntuple.hitBlock.truth.barcode)[*it] == barcode_trk;
340  if( !testStrategy(matchingStrategy,sameTrack) ) continue;
341  ++countsPerLayer[(*ntuple.hitBlock.id.chIndex)[*it]];
342  plots.fill( ntuple.hitBlock, *it, p );
343 
344  }
345  // count layers, require at least 3 hits
346  unsigned int nlayers = 0;
347  for( std::map<int,int>::iterator it=countsPerLayer.begin();it!=countsPerLayer.end();++it ){
348  if( it->second>2 )++nlayers;
349  }
350  return nlayers;
351  }
352 
353  bool MuonInsideOutAnalysis::testStrategy( MuonInsideOutAnalysis::MatchingStrategy matchingStrategy, bool sameTrack ) const {
354  if( matchingStrategy == SameTrack && !sameTrack ) return false;
355  if( matchingStrategy == NotSameTrack && sameTrack ) return false;
356  return true;
357  }
358 
359 
361  const std::vector<int>& indexVec, MuonInsideOutAnalysis::MatchingStrategy /*matchingStrategy*/,
362  TrackPlots& trackPlots ) {
363 
364  //int barcode_trk = (*ntuple.trackParticleBlock.truth.barcode)[trkIndex];
365  //float p = (*ntuple.trackParticleBlock.p)[trkIndex]*0.001;
366  float eta = (*ntuple.trackParticleBlock.eta)[trkIndex];
367  bool isBarrel = std::abs(eta)<1.05;
368 
369  // loop over hits
370  for( std::vector<int>::const_iterator it=indexVec.begin();it!=indexVec.end();++it ){
371 
372  if( *it < 0 || *it >= (int)ntuple.timeBlock.type->size() ) {
373  MsgStream log(Athena::getMessageSvc(),"MuonInsideOutAnalysis");
374  if (log.level()<=MSG::WARNING) log << MSG::WARNING << "index out of range: " << (*it) << " max " << ntuple.timeBlock.type->size() << endmsg;
375  continue;
376  }
377 
378  int type = (*ntuple.timeBlock.type)[*it];
379  // barrel endcap split
380  if( !isBarrel && (type == 1 || type == 10) ) type += 1000;
381 
382  // check that we have the correct type
383  TimePlots* plots = trackPlots.getTimePlots(type);
384  if( !plots ) continue;
385  plots->fill( ntuple.timeBlock, *it, (*ntuple.trackParticleBlock.truth.beta)[trkIndex] );
386  }
387  }
388 
390  const std::vector<int>& indexVec, const std::set<int>& types ) {
391 
393  std::map<int,TimePointBetaFitter::HitVec> hitsPerCandidate;
394 
395  MsgStream log(Athena::getMessageSvc(),"MuonInsideOutAnalysis");
396  // loop over hits
397  for( std::vector<int>::const_iterator it=indexVec.begin();it!=indexVec.end();++it ){
398 
399  if( *it < 0 || *it >= (int)ntuple.timeBlock.type->size() ) {
400  if (log.level()<=MSG::WARNING) log << MSG::WARNING << "index out of range: " << (*it) << " max " << ntuple.timeBlock.type->size() << endmsg;
401  continue;
402  }
403 
404  // get hits
405  int type = (*ntuple.timeBlock.type)[*it];
406  if( !types.count(type) ) continue;
407  float time = (*ntuple.timeBlock.time)[*it];
408  float error = (*ntuple.timeBlock.err)[*it];
409  int candidateIndex = (*ntuple.timeBlock.stage)[*it];
410 
411  hitsPerCandidate[candidateIndex].push_back( TimePointBetaFitter::Hit((*ntuple.timeBlock.d)[*it], time, error ) );
412  }
413 
414  std::map<int,TimePointBetaFitter::HitVec>::iterator cit = hitsPerCandidate.begin();
415  std::map<int,TimePointBetaFitter::HitVec>::iterator cit_end = hitsPerCandidate.end();
416  if( hitsPerCandidate.size() > 1 ){
417  if (log.level()<=MSG::INFO) log << MSG::INFO << "multple candidates for track " << hitsPerCandidate.size() << endmsg;
418  }
419 
421  for( ;cit!=cit_end;++cit ){
423  TimePointBetaFitter::HitVec& hits = cit->second;
424  TimePointBetaFitter::FitResult candidateResult = fitter.fitWithOutlierLogic(hits);
425 
426  float chi2ndof = candidateResult.chi2/candidateResult.ndof;
427  if (log.level()<=MSG::INFO) {
428  if( hits.size() > 1 && candidateResult.status != 0 && chi2ndof>5 ){
429  MuonBetaCalculationUtils betaUtils(0.);
430  log << MSG::INFO << "Beta " << candidateResult.beta << " of fit for types ";
431  for( auto type : types ) std::cout << " " << type;
432  log << MSG::INFO << " with large chi2 " << chi2ndof << " hits " << hits.size() << endmsg;
433  for( auto& hit : hits ){
434  const char* text = hit.useInFit ? " hit " : " outlier ";
435  log << MSG::INFO << text << ": dist "<< std::setw(7) << (int)hit.distance
436  << " time " << std::setprecision(3) << std::setw(6) << hit.time - betaUtils.calculateTof(1.,hit.distance)
437  << " beta " << std::setw(6) << betaUtils.calculateBeta(hit.time,hit.distance)
438  << " error " << std::setw(6) << hit.error << " residual " << std::setw(6) << hit.residual << " pull " << std::setw(6) << hit.residual/hit.error << endmsg;
439  }
440  }
441  }
442  if( candidateResult.status != 0 ){
443  if( result.status == 0 || result.ndof < candidateResult.ndof ) result = candidateResult;
444  }
445  }
446  return result;
447  }
448 
449 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
Muon::MuonValidationTrackParticleBlock::p
std::vector< float > * p
Definition: MuonInsideOutValidationNtuple.h:196
Muon::MuonValidationTimeBlock::stage
std::vector< int > * stage
Definition: MuonInsideOutValidationNtuple.h:107
LArSamples::FitterData::fitter
const ShapeFitter * fitter
Definition: ShapeFitter.cxx:23
Muon::MuonValidationTrackParticleBlock::pt
std::vector< float > * pt
Definition: MuonInsideOutValidationNtuple.h:195
Muon::HitPlots
hit plots
Definition: MuonInsideOutAnalysisPlots.h:49
Muon::MuonValidationTimeBlock::d
std::vector< float > * d
Definition: MuonInsideOutValidationNtuple.h:111
Muon::TimePointBetaFitter::Hit
simple struct holding the input to the fit
Definition: TimePointBetaFitter.h:18
Muon::MuonValidationTrackParticleBlock::truth
MuonValidationTruthBlock truth
Definition: MuonInsideOutValidationNtuple.h:199
Muon::MuonInsideOutAnalysis::testStrategy
bool testStrategy(MuonInsideOutAnalysis::MatchingStrategy matchingStrategy, bool sameTrack) const
Definition: MuonInsideOutAnalysis.cxx:353
Muon::BetaFitRegionPlots::allt_good
BetaFitPlots allt_good
Definition: MuonInsideOutAnalysisPlots.h:169
Muon::MuonInsideOutValidationNtuple::candidateBlock
MuonValidationCandidateBlock candidateBlock
Definition: MuonInsideOutValidationNtuple.h:291
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
get_generator_info.result
result
Definition: get_generator_info.py:21
Muon::TimePointBetaFitter::FitResult::ndof
int ndof
fit chi2
Definition: TimePointBetaFitter.h:45
python.FPGATrackSimAnalysisConfig.stage
stage
Definition: FPGATrackSimAnalysisConfig.py:475
Muon::MuonInsideOutAnalysis::handleHough
unsigned int handleHough(MuonInsideOutValidationNtuple &ntuple, unsigned int trkIndex, const std::vector< int > &indexVec, MuonInsideOutAnalysis::MatchingStrategy matchingStrategy, HoughPlots &plots)
Definition: MuonInsideOutAnalysis.cxx:305
Muon::MuonValidationCandidateBlock::chi2ndof
std::vector< float > * chi2ndof
Definition: MuonInsideOutValidationNtuple.h:259
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
Muon::TimePlots
time plots
Definition: MuonInsideOutAnalysisPlots.h:62
Muon::MuonValidationHitBlock::id
MuonValidationIdBlock id
Definition: MuonInsideOutValidationNtuple.h:248
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Muon::MuonBetaCalculationUtils::calculateBeta
float calculateBeta(float time, float dist)
Definition: MuonBetaCalculationUtils.h:21
Muon::TrackPlots::barrel
BetaFitRegionPlots barrel
Definition: MuonInsideOutAnalysisPlots.h:237
Muon::HoughPlots
hough plots
Definition: MuonInsideOutAnalysisPlots.h:100
Muon::SegmentPlots
segment plots
Definition: MuonInsideOutAnalysisPlots.h:114
Muon::TrackPlots::fill
void fill(int ntruth_, int nseg_, int nseg1_, int nseg2_, int nseg3_, int nhough_)
Definition: MuonInsideOutAnalysisPlots.cxx:424
Muon::MuonInsideOutAnalysisPlots::book
void book(TDirectory *dir, const TString &prefix)
Definition: MuonInsideOutAnalysisPlots.cxx:437
Muon::TimePointBetaFitter::FitResult::chi2
float chi2
fitted beta
Definition: TimePointBetaFitter.h:44
Muon::MuonValidationSegmentBlock::track
MuonValidationTrackBlock track
Definition: MuonInsideOutValidationNtuple.h:221
Muon::MuonValidationHoughBlock::track
MuonValidationTrackBlock track
Definition: MuonInsideOutValidationNtuple.h:239
Muon::TimePointBetaFitter
Definition: TimePointBetaFitter.h:15
tree
TChain * tree
Definition: tile_monitor.h:30
Muon::MuonValidationTruthBlock::barcode
std::vector< int > * barcode
Definition: MuonInsideOutValidationNtuple.h:76
Muon::MuonInsideOutAnalysis::NotSameTrack
@ NotSameTrack
Definition: MuonInsideOutAnalysis.h:22
Muon::MuonInsideOutAnalysis::analyse
void analyse(TTree &tree)
analyse tree
Definition: MuonInsideOutAnalysis.cxx:23
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Muon::BetaFitRegionPlots::mdt
BetaFitPlots mdt
Definition: MuonInsideOutAnalysisPlots.h:162
Muon::MuonValidationSegmentBlock::quality
std::vector< int > * quality
Definition: MuonInsideOutValidationNtuple.h:210
Muon::BetaFitRegionPlots::mdtt
BetaFitPlots mdtt
Definition: MuonInsideOutAnalysisPlots.h:163
Muon::TrackPlots::segments2
SegmentPlots segments2
Definition: MuonInsideOutAnalysisPlots.h:225
Muon::BetaFitRegionPlots::all
BetaFitPlots all
Definition: MuonInsideOutAnalysisPlots.h:167
Muon::TimePointBetaFitter::FitResult::beta
float beta
status flag (0 = failed, 1 = ok)
Definition: TimePointBetaFitter.h:43
Muon::MuonInsideOutAnalysis::MatchingStrategy
MatchingStrategy
Definition: MuonInsideOutAnalysis.h:20
Muon::MuonInsideOutAnalysis::All
@ All
Definition: MuonInsideOutAnalysis.h:23
Muon::BetaFitRegionPlots::rpc
BetaFitPlots rpc
Definition: MuonInsideOutAnalysisPlots.h:165
Muon::TrackPlots::endcap
BetaFitRegionPlots endcap
Definition: MuonInsideOutAnalysisPlots.h:238
Muon::MuonValidationTimeBlock::time
std::vector< float > * time
Definition: MuonInsideOutValidationNtuple.h:112
Muon::TrackPlots::getTimePlots
TimePlots * getTimePlots(int typeIndex)
Definition: MuonInsideOutAnalysisPlots.h:230
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:45
Muon::MuonInsideOutAnalysis::fitBeta
TimePointBetaFitter::FitResult fitBeta(MuonInsideOutValidationNtuple &ntuple, const std::vector< int > &indexVec, const std::set< int > &type)
Definition: MuonInsideOutAnalysis.cxx:389
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
Muon::MuonValidationTruthBlock::beta
std::vector< float > * beta
Definition: MuonInsideOutValidationNtuple.h:77
Muon::MuonInsideOutValidationNtuple::houghBlock
MuonValidationHoughBlock houghBlock
Definition: MuonInsideOutValidationNtuple.h:288
Muon::CandidatePlots::betaCandidates
BetaFitPlots betaCandidates
Definition: MuonInsideOutAnalysisPlots.h:181
Muon::CandidatePlots::fill
void fill(int ntruth_, int nseg_, int nseg1_, int nhough_)
Muon::MuonValidationTimeBlock::type
std::vector< int > * type
Definition: MuonInsideOutValidationNtuple.h:106
Muon::MuonValidationTimeBlock::err
std::vector< float > * err
Definition: MuonInsideOutValidationNtuple.h:113
Muon::TimePointBetaFitter::FitResult
simple struct holding the fit result
Definition: TimePointBetaFitter.h:33
Muon::MuonInsideOutAnalysis::handleCandidates
std::pair< unsigned int, unsigned int > handleCandidates(MuonInsideOutValidationNtuple &ntuple, unsigned int trkIndex, const std::vector< int > &indexVec, StageSummaryPlots &plots, int stage)
Definition: MuonInsideOutAnalysis.cxx:214
Muon::MuonValidationTrackBlock::trkid
std::vector< int > * trkid
Definition: MuonInsideOutValidationNtuple.h:89
Muon::TrackPlots
track based plots
Definition: MuonInsideOutAnalysisPlots.h:205
PlotCalibFromCool.nentries
nentries
Definition: PlotCalibFromCool.py:798
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Muon::MuonValidationTruthBlock::pdg
std::vector< int > * pdg
Definition: MuonInsideOutValidationNtuple.h:75
Muon::MuonValidationIdBlock::chIndex
std::vector< int > * chIndex
Definition: MuonInsideOutValidationNtuple.h:63
lumiFormat.i
int i
Definition: lumiFormat.py:85
Muon::MuonInsideOutValidationNtuple::trackParticleBlock
MuonValidationTrackParticleBlock trackParticleBlock
Definition: MuonInsideOutValidationNtuple.h:286
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Muon::MuonValidationCandidateBlock::track
MuonValidationTrackBlock track
Definition: MuonInsideOutValidationNtuple.h:266
Muon::MuonValidationCandidateBlock::beta
std::vector< float > * beta
Definition: MuonInsideOutValidationNtuple.h:258
Muon::StageSummaryPlots
Definition: MuonInsideOutAnalysisPlots.h:190
Muon::MuonInsideOutAnalysis::handleSegments
unsigned int handleSegments(MuonInsideOutValidationNtuple &ntuple, unsigned int trkIndex, const std::vector< int > &indexVec, int stage, MuonInsideOutAnalysis::MatchingStrategy matchingStrategy, SegmentPlots &segmentPlots)
Definition: MuonInsideOutAnalysis.cxx:282
Muon::MuonValidationTrackParticleBlock::eta
std::vector< float > * eta
Definition: MuonInsideOutValidationNtuple.h:197
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
Muon::MuonValidationSegmentBlock::truth
MuonValidationTruthBlock truth
Definition: MuonInsideOutValidationNtuple.h:222
Muon::TrackPlots::hough
HoughPlots hough
Definition: MuonInsideOutAnalysisPlots.h:222
Muon::TrackPlots::segments
SegmentPlots segments
Definition: MuonInsideOutAnalysisPlots.h:223
Muon::TrackPlots::candidateStages
std::vector< StageSummaryPlots > candidateStages
Definition: MuonInsideOutAnalysisPlots.h:240
Muon::MuonInsideOutAnalysisPlots::rest
TrackPlots rest
Definition: MuonInsideOutAnalysisPlots.h:250
selection
std::string selection
Definition: fbtTestBasics.cxx:75
beamspotman.dir
string dir
Definition: beamspotman.py:623
Muon::BetaFitRegionPlots::mdtt_good
BetaFitPlots mdtt_good
Definition: MuonInsideOutAnalysisPlots.h:164
Muon::MuonInsideOutAnalysis::handleTimes
void handleTimes(MuonInsideOutValidationNtuple &ntuple, unsigned int trkIndex, const std::vector< int > &indexVec, MuonInsideOutAnalysis::MatchingStrategy matchingStrategy, TrackPlots &trackPlots)
Definition: MuonInsideOutAnalysis.cxx:360
Muon::MuonValidationCandidateBlock::ntimes
std::vector< int > * ntimes
Definition: MuonInsideOutValidationNtuple.h:257
MuonInsideOutValidationNtuple.h
Muon::BetaFitRegionPlots::allt
BetaFitPlots allt
Definition: MuonInsideOutAnalysisPlots.h:168
Muon::BetaFitRegionPlots
Definition: MuonInsideOutAnalysisPlots.h:161
Muon::TrackPlots::segments3
SegmentPlots segments3
Definition: MuonInsideOutAnalysisPlots.h:226
MuonBetaCalculationUtils.h
Muon::MuonInsideOutAnalysisPlots::muon
TrackPlots muon
Definition: MuonInsideOutAnalysisPlots.h:248
Muon::TrackPlots::segments1
SegmentPlots segments1
Definition: MuonInsideOutAnalysisPlots.h:224
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Muon::MuonInsideOutValidationNtuple::hitBlock
MuonValidationHitBlock hitBlock
Definition: MuonInsideOutValidationNtuple.h:289
Muon::MuonInsideOutAnalysisPlots::stau
TrackPlots stau
Definition: MuonInsideOutAnalysisPlots.h:249
Muon::MuonValidationHitBlock::truth
MuonValidationTruthBlock truth
Definition: MuonInsideOutValidationNtuple.h:250
Muon::SegmentPlots::fill
void fill(int chIndex_, int sector_, int quality_)
Definition: MuonInsideOutAnalysisPlots.cxx:289
Muon::MuonValidationCandidateBlock::nprec
std::vector< int > * nprec
Definition: MuonInsideOutValidationNtuple.h:261
Muon::TimePointBetaFitter::HitVec
std::vector< Hit > HitVec
Definition: TimePointBetaFitter.h:30
Muon::MuonInsideOutAnalysis::m_plots
MuonInsideOutAnalysisPlots m_plots
Definition: MuonInsideOutAnalysis.h:55
Muon::MuonValidationSegmentBlock::stage
std::vector< int > * stage
Definition: MuonInsideOutValidationNtuple.h:209
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
Muon::BetaFitRegionPlots::rpct
BetaFitPlots rpct
Definition: MuonInsideOutAnalysisPlots.h:166
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
Muon::MuonInsideOutAnalysis::handleHits
unsigned int handleHits(MuonInsideOutValidationNtuple &ntuple, unsigned int trkIndex, const std::vector< int > &indexVec, MuonInsideOutAnalysis::MatchingStrategy matchingStrategy, HitPlots &plots)
Definition: MuonInsideOutAnalysis.cxx:326
python.LArCondContChannels.isBarrel
isBarrel
Definition: LArCondContChannels.py:659
Muon::MuonInsideOutAnalysis::MuonInsideOutAnalysis
MuonInsideOutAnalysis(TDirectory *dir)
create analsyis for a given tree
Definition: MuonInsideOutAnalysis.cxx:19
Muon::MuonInsideOutValidationNtuple
Definition: MuonInsideOutValidationNtuple.h:282
covarianceTool.plots
plots
Definition: covarianceTool.py:698
MuonInsideOutAnalysis.h
Muon::BetaFitPlots::fill
void fill(float beta_, float betaTruth_, float chi2_, int ndof_)
Definition: MuonInsideOutAnalysisPlots.cxx:302
Muon::MuonInsideOutValidationNtuple::segmentBlock
MuonValidationSegmentBlock segmentBlock
Definition: MuonInsideOutValidationNtuple.h:287
makeTransCanvas.text
text
Definition: makeTransCanvas.py:11
Muon::MuonInsideOutValidationNtuple::timeBlock
MuonValidationTimeBlock timeBlock
Definition: MuonInsideOutValidationNtuple.h:290
Muon::MuonValidationTimeBlock::track
MuonValidationTrackBlock track
Definition: MuonInsideOutValidationNtuple.h:103
Muon::TrackPlots::hits
HitPlots hits
Definition: MuonInsideOutAnalysisPlots.h:221
Muon::CandidatePlots::betaBestCandidate
BetaFitPlots betaBestCandidate
Definition: MuonInsideOutAnalysisPlots.h:182
MuonParameters::beta
@ beta
Definition: MuonParamDefs.h:144
Muon::CandidatePlots
candidate based plots
Definition: MuonInsideOutAnalysisPlots.h:174
get_generator_info.error
error
Definition: get_generator_info.py:40
Muon::MuonValidationBlockBase::init
void init(const std::string &prefix, TTree *, bool write=true)
Definition: MuonInsideOutValidationNtuple.cxx:28
Muon::MuonValidationHoughBlock::truth
MuonValidationTruthBlock truth
Definition: MuonInsideOutValidationNtuple.h:240
error
Definition: IImpactPoint3dEstimator.h:70
Muon::MuonBetaCalculationUtils
Definition: MuonBetaCalculationUtils.h:12
Muon::MuonBetaCalculationUtils::calculateTof
float calculateTof(float beta, float dist)
Definition: MuonBetaCalculationUtils.h:37
Muon::TimePointBetaFitter::FitResult::status
int status
data members
Definition: TimePointBetaFitter.h:42
Muon::MuonValidationHitBlock::track
MuonValidationTrackBlock track
Definition: MuonInsideOutValidationNtuple.h:249
Muon::MuonInsideOutAnalysis::SameTrack
@ SameTrack
Definition: MuonInsideOutAnalysis.h:21
Muon::MuonValidationCandidateBlock::stage
std::vector< int > * stage
Definition: MuonInsideOutValidationNtuple.h:264