ATLAS Offline Software
MuonInsideOutValidationNtuple.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 namespace Muon {
9 
11 
12  // clear entries
13  for( const auto& entry : intBlocks ) entry.first.get()->clear();
14  for( const auto& entry : unsignedIntBlocks ) entry.first.get()->clear();
15  for( const auto& entry : floatBlocks ) entry.first.get()->clear();
16  for( auto entry : subBlocks ) entry.first->clear();
17 
18  }
19 
21  // delete entries
22  //for( auto entry : intBlocks ) delete entry.first.get();
23  //for( auto entry : floatBlocks ) delete entry.first.get();
24  }
25 
26 
27 
28  void MuonValidationBlockBase::init( const std::string& prefix, TTree* tree, bool write ) {
29 
30 
31  for( const auto& entry : intBlocks ) {
32  if( tree ){
33  if( write ){
34  entry.first.get() = new std::vector<int>();
35  tree->Branch( (prefix + entry.second).c_str(), entry.first.get());
36  }else{
37  tree->SetBranchAddress( (prefix + entry.second).c_str(), &entry.first.get());
38  }
39  }
40  }
41 
42  for( const auto& entry : unsignedIntBlocks ) {
43  if( tree ){
44  if( write ){
45  entry.first.get() = new std::vector<unsigned int>();
46  tree->Branch( (prefix + entry.second).c_str(), entry.first.get());
47  }else{
48  tree->SetBranchAddress( (prefix + entry.second).c_str(), &entry.first.get());
49  }
50  }
51  }
52 
53  for( const auto& entry : floatBlocks ) {
54  if( tree ){
55  if( write ){
56  entry.first.get() = new std::vector<float>();
57  tree->Branch( (prefix + entry.second).c_str(), entry.first.get());
58  }else{
59  tree->SetBranchAddress( (prefix + entry.second).c_str(), &entry.first.get());
60  }
61  }
62  }
63 
64  for( auto entry : subBlocks ) {
65  entry.first->init(prefix + entry.second, tree, write );
66  }
67 
68  }
69 
71  addBlock(pt,"pt");
72  addBlock(p,"p");
73  addBlock(eta,"eta");
74  addBlock(phi,"phi");
75  addBlock(&truth,"");
76  }
77 
79  addBlock(&id,"");
80  addBlock(&track,"");
81  addBlock(&truth,"");
82  addBlock(type,"type");
83  addBlock(stage,"stage");
84  addBlock(gasgapId,"gasgapId");
85  addBlock(r,"r");
86  addBlock(z,"z");
87  addBlock(d,"d");
88  addBlock(time,"time");
89  addBlock(err,"err");
90  addBlock(timeProp,"timeProp");
91  addBlock(avTimeProp,"avTimeProp");
92  addBlock(tof,"tof");
93  addBlock(avTof,"avTof");
94  addBlock(timeCor,"timeCor");
95  }
96 
97 
99  addBlock(residual,"res");
100  addBlock(pull,"pull");
101  addBlock(pos,"pos");
102  addBlock(err,"err");
103  addBlock(expos,"expos");
104  addBlock(expos_err,"expos_err");
105  addBlock(expos_errstatus,"expos_errstatus");
106  }
107 
109  addBlock(sector,"sector");
110  addBlock(chIndex,"chIndex");
111  }
112 
114  addBlock(trkid,"trkid");
115  }
116 
118  addBlock(pdg,"pdg");
119  addBlock(barcode,"barcode");
120  addBlock(beta,"beta");
121  }
122 
124  addBlock(stage,"stage");
125  addBlock(quality,"quality");
126  addBlock(nmdtHits,"nmdtHits");
127  addBlock(ntrigEtaHits,"ntrigEtaHits");
128  addBlock(ntrigPhiHits,"ntrigPhiHits");
129  addBlock(r,"r");
130  addBlock(z,"z");
131  addBlock(t0,"t0");
132  addBlock(t0Error,"t0Error");
133  addBlock(t0Trig,"t0Trig");
134  addBlock(t0TrigError,"t0TrigError");
135  addBlock(&id,"");
136  addBlock(&track,"");
137  addBlock(&truth,"");
138  addBlock(&xresiduals,"x");
139  addBlock(&yresiduals,"y");
140  addBlock(&angleXZ,"angleXZ");
141  addBlock(&angleYZ,"angleYZ");
142  addBlock(&combinedYZ,"combYZ");
143  }
144 
146  addBlock(maximum,"max");
147  addBlock(&residuals,"");
148  addBlock(&id,"");
149  addBlock(&track,"");
150  addBlock(&truth,"");
151  }
152 
153 
155  addBlock(&id,"");
156  addBlock(&track,"");
157  addBlock(&truth,"");
158  addBlock(&residuals,"");
159  }
160 
162  addBlock(ntimes,"ntimes");
163  addBlock(chi2ndof,"chi2ndof");
164  addBlock(beta,"beta");
165  addBlock(nseg,"nseg");
166  addBlock(nprec,"nprec");
167  addBlock(ntrigPhi,"ntrigPhi");
168  addBlock(ntrigEta,"ntrigEta");
169  addBlock(stage,"stage");
170  addBlock(&track,"");
171  }
172 
174  addBlock(&trackParticleBlock,"trk_");
175  addBlock(&segmentBlock,"seg_");
176  addBlock(&houghBlock,"hou_");
177  addBlock(&hitBlock,"hit_");
178  addBlock(&timeBlock,"time_");
179  addBlock(&candidateBlock,"candidate_");
180  }
181 
182 }
Muon::MuonValidationTrackParticleBlock::p
std::vector< float > * p
Definition: MuonInsideOutValidationNtuple.h:196
Muon::MuonValidationTimeBlock::stage
std::vector< int > * stage
Definition: MuonInsideOutValidationNtuple.h:107
Muon::MuonValidationBlockBase::floatBlocks
std::vector< FloatBlock > floatBlocks
Definition: MuonInsideOutValidationNtuple.h:45
Muon::MuonValidationTrackParticleBlock::phi
std::vector< float > * phi
Definition: MuonInsideOutValidationNtuple.h:198
Muon::MuonValidationTrackParticleBlock::pt
std::vector< float > * pt
Definition: MuonInsideOutValidationNtuple.h:195
Muon::MuonValidationTimeBlock::d
std::vector< float > * d
Definition: MuonInsideOutValidationNtuple.h:111
Muon::MuonValidationTimeBlock::z
std::vector< float > * z
Definition: MuonInsideOutValidationNtuple.h:110
Muon::MuonValidationTrackParticleBlock::truth
MuonValidationTruthBlock truth
Definition: MuonInsideOutValidationNtuple.h:199
Muon::MuonInsideOutValidationNtuple::candidateBlock
MuonValidationCandidateBlock candidateBlock
Definition: MuonInsideOutValidationNtuple.h:291
Muon::MuonValidationCandidateBlock::chi2ndof
std::vector< float > * chi2ndof
Definition: MuonInsideOutValidationNtuple.h:259
Muon::MuonValidationTimeBlock::timeCor
std::vector< float > * timeCor
Definition: MuonInsideOutValidationNtuple.h:118
Muon::MuonValidationBlockBase::~MuonValidationBlockBase
virtual ~MuonValidationBlockBase()
Definition: MuonInsideOutValidationNtuple.cxx:20
Muon::MuonValidationResidualBlock::pos
std::vector< float > * pos
Definition: MuonInsideOutValidationNtuple.h:181
Muon::MuonValidationSegmentBlock::ntrigEtaHits
std::vector< int > * ntrigEtaHits
Definition: MuonInsideOutValidationNtuple.h:212
Muon::MuonValidationTimeBlock::MuonValidationTimeBlock
MuonValidationTimeBlock()
Definition: MuonInsideOutValidationNtuple.cxx:78
Muon::MuonValidationResidualBlock::pull
std::vector< float > * pull
Definition: MuonInsideOutValidationNtuple.h:180
Muon::MuonValidationSegmentBlock::track
MuonValidationTrackBlock track
Definition: MuonInsideOutValidationNtuple.h:221
Muon::MuonValidationTrackBlock::MuonValidationTrackBlock
MuonValidationTrackBlock()
Definition: MuonInsideOutValidationNtuple.cxx:113
Muon::MuonValidationHoughBlock::track
MuonValidationTrackBlock track
Definition: MuonInsideOutValidationNtuple.h:239
tree
TChain * tree
Definition: tile_monitor.h:30
Muon::MuonValidationBlockBase::intBlocks
std::vector< IntBlock > intBlocks
Definition: MuonInsideOutValidationNtuple.h:43
Muon::MuonValidationTruthBlock::barcode
std::vector< int > * barcode
Definition: MuonInsideOutValidationNtuple.h:76
Muon::MuonValidationSegmentBlock::quality
std::vector< int > * quality
Definition: MuonInsideOutValidationNtuple.h:210
Muon::MuonValidationCandidateBlock::MuonValidationCandidateBlock
MuonValidationCandidateBlock()
Definition: MuonInsideOutValidationNtuple.cxx:161
Muon::MuonValidationSegmentBlock::combinedYZ
MuonValidationResidualBlock combinedYZ
Definition: MuonInsideOutValidationNtuple.h:227
Muon::MuonValidationTimeBlock::time
std::vector< float > * time
Definition: MuonInsideOutValidationNtuple.h:112
Muon::MuonValidationHitBlock::residuals
MuonValidationResidualBlock residuals
Definition: MuonInsideOutValidationNtuple.h:251
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
Muon::MuonValidationTruthBlock::beta
std::vector< float > * beta
Definition: MuonInsideOutValidationNtuple.h:77
Muon::MuonInsideOutValidationNtuple::houghBlock
MuonValidationHoughBlock houghBlock
Definition: MuonInsideOutValidationNtuple.h:288
Muon::MuonValidationSegmentBlock::xresiduals
MuonValidationResidualBlock xresiduals
Definition: MuonInsideOutValidationNtuple.h:223
Muon::MuonValidationSegmentBlock::t0
std::vector< float > * t0
Definition: MuonInsideOutValidationNtuple.h:216
Muon::MuonValidationHoughBlock::MuonValidationHoughBlock
MuonValidationHoughBlock()
Definition: MuonInsideOutValidationNtuple.cxx:145
Muon::MuonValidationTimeBlock::type
std::vector< int > * type
Definition: MuonInsideOutValidationNtuple.h:106
Muon::MuonValidationBlockBase::unsignedIntBlocks
std::vector< UnsignedIntBlock > unsignedIntBlocks
Definition: MuonInsideOutValidationNtuple.h:44
Muon::MuonValidationTimeBlock::err
std::vector< float > * err
Definition: MuonInsideOutValidationNtuple.h:113
Muon::MuonValidationBlockBase::subBlocks
std::vector< SubBlock > subBlocks
Definition: MuonInsideOutValidationNtuple.h:46
Muon::MuonValidationSegmentBlock::t0Error
std::vector< float > * t0Error
Definition: MuonInsideOutValidationNtuple.h:217
Muon::MuonInsideOutValidationNtuple::MuonInsideOutValidationNtuple
MuonInsideOutValidationNtuple()
Definition: MuonInsideOutValidationNtuple.cxx:173
Muon::MuonValidationHoughBlock::residuals
MuonValidationResidualBlock residuals
Definition: MuonInsideOutValidationNtuple.h:241
Muon::MuonValidationTrackBlock::trkid
std::vector< int > * trkid
Definition: MuonInsideOutValidationNtuple.h:89
Muon::MuonValidationTimeBlock::timeProp
std::vector< float > * timeProp
Definition: MuonInsideOutValidationNtuple.h:114
Muon::MuonValidationHoughBlock::maximum
std::vector< float > * maximum
Definition: MuonInsideOutValidationNtuple.h:237
Muon::MuonValidationTruthBlock::pdg
std::vector< int > * pdg
Definition: MuonInsideOutValidationNtuple.h:75
Muon::MuonValidationIdBlock::chIndex
std::vector< int > * chIndex
Definition: MuonInsideOutValidationNtuple.h:63
Muon::MuonValidationResidualBlock::residual
std::vector< float > * residual
Definition: MuonInsideOutValidationNtuple.h:179
Muon::MuonInsideOutValidationNtuple::trackParticleBlock
MuonValidationTrackParticleBlock trackParticleBlock
Definition: MuonInsideOutValidationNtuple.h:286
Muon::MuonValidationCandidateBlock::track
MuonValidationTrackBlock track
Definition: MuonInsideOutValidationNtuple.h:266
Muon::MuonValidationTimeBlock::tof
std::vector< float > * tof
Definition: MuonInsideOutValidationNtuple.h:116
Muon::MuonValidationCandidateBlock::beta
std::vector< float > * beta
Definition: MuonInsideOutValidationNtuple.h:258
Muon::MuonValidationTimeBlock::r
std::vector< float > * r
Definition: MuonInsideOutValidationNtuple.h:109
Muon::MuonValidationTrackParticleBlock::eta
std::vector< float > * eta
Definition: MuonInsideOutValidationNtuple.h:197
python.ByteStreamConfig.write
def write
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:247
Muon::MuonValidationSegmentBlock::truth
MuonValidationTruthBlock truth
Definition: MuonInsideOutValidationNtuple.h:222
Muon::MuonValidationCandidateBlock::ntrigPhi
std::vector< int > * ntrigPhi
Definition: MuonInsideOutValidationNtuple.h:262
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
Muon::MuonValidationSegmentBlock::yresiduals
MuonValidationResidualBlock yresiduals
Definition: MuonInsideOutValidationNtuple.h:224
Muon::MuonValidationResidualBlock::expos_err
std::vector< float > * expos_err
Definition: MuonInsideOutValidationNtuple.h:184
Muon::MuonValidationIdBlock::sector
std::vector< int > * sector
Definition: MuonInsideOutValidationNtuple.h:62
Muon::MuonValidationSegmentBlock::angleYZ
MuonValidationResidualBlock angleYZ
Definition: MuonInsideOutValidationNtuple.h:226
Muon::MuonValidationResidualBlock::MuonValidationResidualBlock
MuonValidationResidualBlock()
Definition: MuonInsideOutValidationNtuple.cxx:98
Muon::MuonValidationSegmentBlock::t0TrigError
std::vector< float > * t0TrigError
Definition: MuonInsideOutValidationNtuple.h:219
Muon::MuonValidationCandidateBlock::nseg
std::vector< int > * nseg
Definition: MuonInsideOutValidationNtuple.h:260
Muon::MuonValidationTimeBlock::avTof
std::vector< float > * avTof
Definition: MuonInsideOutValidationNtuple.h:117
Muon::MuonValidationCandidateBlock::ntrigEta
std::vector< int > * ntrigEta
Definition: MuonInsideOutValidationNtuple.h:263
Muon::MuonValidationSegmentBlock::z
std::vector< float > * z
Definition: MuonInsideOutValidationNtuple.h:215
Muon::MuonValidationResidualBlock::expos_errstatus
std::vector< int > * expos_errstatus
Definition: MuonInsideOutValidationNtuple.h:185
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
Muon::MuonValidationResidualBlock::expos
std::vector< float > * expos
Definition: MuonInsideOutValidationNtuple.h:183
Muon::MuonValidationHitBlock::MuonValidationHitBlock
MuonValidationHitBlock()
Definition: MuonInsideOutValidationNtuple.cxx:154
Muon::MuonValidationCandidateBlock::ntimes
std::vector< int > * ntimes
Definition: MuonInsideOutValidationNtuple.h:257
Muon::MuonValidationTimeBlock::avTimeProp
std::vector< float > * avTimeProp
Definition: MuonInsideOutValidationNtuple.h:115
MuonInsideOutValidationNtuple.h
Muon::MuonValidationSegmentBlock::ntrigPhiHits
std::vector< int > * ntrigPhiHits
Definition: MuonInsideOutValidationNtuple.h:213
Muon::MuonValidationSegmentBlock::nmdtHits
std::vector< int > * nmdtHits
Definition: MuonInsideOutValidationNtuple.h:211
Muon::MuonInsideOutValidationNtuple::hitBlock
MuonValidationHitBlock hitBlock
Definition: MuonInsideOutValidationNtuple.h:289
Muon::MuonValidationHitBlock::truth
MuonValidationTruthBlock truth
Definition: MuonInsideOutValidationNtuple.h:250
Muon::MuonValidationCandidateBlock::nprec
std::vector< int > * nprec
Definition: MuonInsideOutValidationNtuple.h:261
Muon::MuonValidationIdBlock::MuonValidationIdBlock
MuonValidationIdBlock()
Definition: MuonInsideOutValidationNtuple.cxx:108
Muon::MuonValidationBlockBase::addBlock
void addBlock(std::vector< int > *&block, std::string name)
Definition: MuonInsideOutValidationNtuple.h:37
Muon::MuonValidationSegmentBlock::t0Trig
std::vector< float > * t0Trig
Definition: MuonInsideOutValidationNtuple.h:218
Muon::MuonValidationTimeBlock::gasgapId
std::vector< unsigned int > * gasgapId
Definition: MuonInsideOutValidationNtuple.h:108
Muon::MuonValidationSegmentBlock::r
std::vector< float > * r
Definition: MuonInsideOutValidationNtuple.h:214
Muon::MuonValidationSegmentBlock::stage
std::vector< int > * stage
Definition: MuonInsideOutValidationNtuple.h:209
Muon::MuonValidationSegmentBlock::MuonValidationSegmentBlock
MuonValidationSegmentBlock()
Definition: MuonInsideOutValidationNtuple.cxx:123
Muon::MuonValidationTruthBlock::MuonValidationTruthBlock
MuonValidationTruthBlock()
Definition: MuonInsideOutValidationNtuple.cxx:117
Muon::MuonValidationTrackParticleBlock::MuonValidationTrackParticleBlock
MuonValidationTrackParticleBlock()
Definition: MuonInsideOutValidationNtuple.cxx:70
Muon::MuonValidationTimeBlock::truth
MuonValidationTruthBlock truth
Definition: MuonInsideOutValidationNtuple.h:104
Muon::MuonValidationResidualBlock::err
std::vector< float > * err
Definition: MuonInsideOutValidationNtuple.h:182
Muon::MuonInsideOutValidationNtuple::segmentBlock
MuonValidationSegmentBlock segmentBlock
Definition: MuonInsideOutValidationNtuple.h:287
Muon::MuonValidationBlockBase::clear
void clear()
Definition: MuonInsideOutValidationNtuple.cxx:10
Muon::MuonInsideOutValidationNtuple::timeBlock
MuonValidationTimeBlock timeBlock
Definition: MuonInsideOutValidationNtuple.h:290
Muon::MuonValidationTimeBlock::track
MuonValidationTrackBlock track
Definition: MuonInsideOutValidationNtuple.h:103
Muon::MuonValidationSegmentBlock::angleXZ
MuonValidationResidualBlock angleXZ
Definition: MuonInsideOutValidationNtuple.h:225
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
Muon::MuonValidationHitBlock::track
MuonValidationTrackBlock track
Definition: MuonInsideOutValidationNtuple.h:249
Muon::MuonValidationCandidateBlock::stage
std::vector< int > * stage
Definition: MuonInsideOutValidationNtuple.h:264