ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Muon::MuonInsideOutAnalysis Class Reference

#include <MuonInsideOutAnalysis.h>

Collaboration diagram for Muon::MuonInsideOutAnalysis:

Public Types

enum  MatchingStrategy { SameTrack = 0, NotSameTrack = 1, All = 2 }
 

Public Member Functions

 MuonInsideOutAnalysis (TDirectory *dir)
 create analsyis for a given tree More...
 
void analyse (TTree &tree)
 analyse tree More...
 

Private Member Functions

bool testStrategy (MuonInsideOutAnalysis::MatchingStrategy matchingStrategy, bool sameTrack) const
 
unsigned int handleHits (MuonInsideOutValidationNtuple &ntuple, unsigned int trkIndex, const std::vector< int > &indexVec, MuonInsideOutAnalysis::MatchingStrategy matchingStrategy, HitPlots &plots)
 
unsigned int handleHough (MuonInsideOutValidationNtuple &ntuple, unsigned int trkIndex, const std::vector< int > &indexVec, MuonInsideOutAnalysis::MatchingStrategy matchingStrategy, HoughPlots &plots)
 
unsigned int handleSegments (MuonInsideOutValidationNtuple &ntuple, unsigned int trkIndex, const std::vector< int > &indexVec, int stage, MuonInsideOutAnalysis::MatchingStrategy matchingStrategy, SegmentPlots &segmentPlots)
 
std::pair< unsigned int, unsigned int > handleCandidates (MuonInsideOutValidationNtuple &ntuple, unsigned int trkIndex, const std::vector< int > &indexVec, StageSummaryPlots &plots, int stage)
 
void handleTimes (MuonInsideOutValidationNtuple &ntuple, unsigned int trkIndex, const std::vector< int > &indexVec, MuonInsideOutAnalysis::MatchingStrategy matchingStrategy, TrackPlots &trackPlots)
 
TimePointBetaFitter::FitResult fitBeta (MuonInsideOutValidationNtuple &ntuple, const std::vector< int > &indexVec, const std::set< int > &type)
 

Private Attributes

MuonInsideOutAnalysisPlots m_plots
 

Detailed Description

Definition at line 18 of file MuonInsideOutAnalysis.h.

Member Enumeration Documentation

◆ MatchingStrategy

Enumerator
SameTrack 
NotSameTrack 
All 

Definition at line 20 of file MuonInsideOutAnalysis.h.

20  {
21  SameTrack = 0,
22  NotSameTrack = 1,
23  All = 2
24  };

Constructor & Destructor Documentation

◆ MuonInsideOutAnalysis()

Muon::MuonInsideOutAnalysis::MuonInsideOutAnalysis ( TDirectory *  dir)

create analsyis for a given tree

Definition at line 19 of file MuonInsideOutAnalysis.cxx.

19  {
20  m_plots.book(dir,"");
21  }

Member Function Documentation

◆ analyse()

void Muon::MuonInsideOutAnalysis::analyse ( TTree &  tree)

analyse tree

Definition at line 23 of file MuonInsideOutAnalysis.cxx.

23  {
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  }

◆ fitBeta()

TimePointBetaFitter::FitResult Muon::MuonInsideOutAnalysis::fitBeta ( MuonInsideOutValidationNtuple ntuple,
const std::vector< int > &  indexVec,
const std::set< int > &  type 
)
private

fit beta

Definition at line 389 of file MuonInsideOutAnalysis.cxx.

390  {
391 
392  TimePointBetaFitter fitter;
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 
420  TimePointBetaFitter::FitResult result;
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  }

◆ handleCandidates()

std::pair< unsigned int, unsigned int > Muon::MuonInsideOutAnalysis::handleCandidates ( MuonInsideOutValidationNtuple ntuple,
unsigned int  trkIndex,
const std::vector< int > &  indexVec,
StageSummaryPlots plots,
int  stage 
)
private

Definition at line 214 of file MuonInsideOutAnalysis.cxx.

216  {
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  }

◆ handleHits()

unsigned int Muon::MuonInsideOutAnalysis::handleHits ( MuonInsideOutValidationNtuple ntuple,
unsigned int  trkIndex,
const std::vector< int > &  indexVec,
MuonInsideOutAnalysis::MatchingStrategy  matchingStrategy,
HitPlots plots 
)
private

Definition at line 326 of file MuonInsideOutAnalysis.cxx.

328  {
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  }

◆ handleHough()

unsigned int Muon::MuonInsideOutAnalysis::handleHough ( MuonInsideOutValidationNtuple ntuple,
unsigned int  trkIndex,
const std::vector< int > &  indexVec,
MuonInsideOutAnalysis::MatchingStrategy  matchingStrategy,
HoughPlots plots 
)
private

Definition at line 305 of file MuonInsideOutAnalysis.cxx.

307  {
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  }

◆ handleSegments()

unsigned int Muon::MuonInsideOutAnalysis::handleSegments ( MuonInsideOutValidationNtuple ntuple,
unsigned int  trkIndex,
const std::vector< int > &  indexVec,
int  stage,
MuonInsideOutAnalysis::MatchingStrategy  matchingStrategy,
SegmentPlots segmentPlots 
)
private

Definition at line 282 of file MuonInsideOutAnalysis.cxx.

285  {
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  }

◆ handleTimes()

void Muon::MuonInsideOutAnalysis::handleTimes ( MuonInsideOutValidationNtuple ntuple,
unsigned int  trkIndex,
const std::vector< int > &  indexVec,
MuonInsideOutAnalysis::MatchingStrategy  matchingStrategy,
TrackPlots trackPlots 
)
private

Definition at line 360 of file MuonInsideOutAnalysis.cxx.

362  {
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  }

◆ testStrategy()

bool Muon::MuonInsideOutAnalysis::testStrategy ( MuonInsideOutAnalysis::MatchingStrategy  matchingStrategy,
bool  sameTrack 
) const
private

Definition at line 353 of file MuonInsideOutAnalysis.cxx.

353  {
354  if( matchingStrategy == SameTrack && !sameTrack ) return false;
355  if( matchingStrategy == NotSameTrack && sameTrack ) return false;
356  return true;
357  }

Member Data Documentation

◆ m_plots

MuonInsideOutAnalysisPlots Muon::MuonInsideOutAnalysis::m_plots
private

Definition at line 55 of file MuonInsideOutAnalysis.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
LArSamples::FitterData::fitter
const ShapeFitter * fitter
Definition: ShapeFitter.cxx:23
test_pyathena.eta
eta
Definition: test_pyathena.py:10
Muon::MuonValidationTrackParticleBlock::pt
std::vector< float > * pt
Definition: MuonInsideOutValidationNtuple.h:195
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::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
python.FPGATrackSimAnalysisConfig.stage
stage
Definition: FPGATrackSimAnalysisConfig.py:558
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
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
Muon::MuonInsideOutAnalysisPlots::book
void book(TDirectory *dir, const TString &prefix)
Definition: MuonInsideOutAnalysisPlots.cxx:437
Muon::MuonValidationSegmentBlock::track
MuonValidationTrackBlock track
Definition: MuonInsideOutValidationNtuple.h:221
Muon::MuonValidationHoughBlock::track
MuonValidationTrackBlock track
Definition: MuonInsideOutValidationNtuple.h:239
tree
TChain * tree
Definition: tile_monitor.h:30
Muon::MuonInsideOutAnalysis::NotSameTrack
@ NotSameTrack
Definition: MuonInsideOutAnalysis.h:22
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Muon::MuonValidationSegmentBlock::quality
std::vector< int > * quality
Definition: MuonInsideOutValidationNtuple.h:210
Muon::MuonInsideOutAnalysis::MatchingStrategy
MatchingStrategy
Definition: MuonInsideOutAnalysis.h:20
Muon::MuonInsideOutAnalysis::All
@ All
Definition: MuonInsideOutAnalysis.h:23
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::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
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
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::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::MuonInsideOutAnalysisPlots::rest
TrackPlots rest
Definition: MuonInsideOutAnalysisPlots.h:250
beamspotman.dir
string dir
Definition: beamspotman.py:623
selection
const std::string selection
Definition: fbtTestBasics.cxx:74
Muon::MuonInsideOutAnalysis::handleTimes
void handleTimes(MuonInsideOutValidationNtuple &ntuple, unsigned int trkIndex, const std::vector< int > &indexVec, MuonInsideOutAnalysis::MatchingStrategy matchingStrategy, TrackPlots &trackPlots)
Definition: MuonInsideOutAnalysis.cxx:360
python.root_lsr_rank.types
types
Definition: root_lsr_rank.py:35
Muon::MuonInsideOutAnalysisPlots::muon
TrackPlots muon
Definition: MuonInsideOutAnalysisPlots.h:248
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::TimePointBetaFitter::HitVec
std::vector< Hit > HitVec
Definition: TimePointBetaFitter.h:30
Muon::MuonInsideOutAnalysis::m_plots
MuonInsideOutAnalysisPlots m_plots
Definition: MuonInsideOutAnalysis.h:55
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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::MuonInsideOutValidationNtuple
Definition: MuonInsideOutValidationNtuple.h:282
covarianceTool.plots
plots
Definition: covarianceTool.py:698
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
MuonParameters::beta
@ beta
Definition: MuonParamDefs.h:144
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
error
Definition: IImpactPoint3dEstimator.h:70
Muon::MuonValidationHitBlock::track
MuonValidationTrackBlock track
Definition: MuonInsideOutValidationNtuple.h:249
Muon::MuonInsideOutAnalysis::SameTrack
@ SameTrack
Definition: MuonInsideOutAnalysis.h:21