ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::MuonValidationResidualBlock Struct Reference

Block with residual and pull information. More...

#include <MuonInsideOutValidationNtuple.h>

Inheritance diagram for Muon::MuonValidationResidualBlock:
Collaboration diagram for Muon::MuonValidationResidualBlock:

Public Types

typedef std::pair< std::reference_wrapper< std::vector< int > * >, std::string > IntBlock
typedef std::pair< std::reference_wrapper< std::vector< unsigned int > * >, std::string > UnsignedIntBlock
typedef std::pair< std::reference_wrapper< std::vector< float > * >, std::string > FloatBlock
typedef std::pair< MuonValidationBlockBase *, std::string > SubBlock

Public Member Functions

 MuonValidationResidualBlock ()
void fill (const Trk::MeasurementBase &hit, const MuonSystemExtension::Intersection &intersection, Trk::ParamDefs par)
void fill (float pos_, float err_, const MuonSystemExtension::Intersection &intersection, Trk::ParamDefs par)
void fill (float pos_, float err_, float expos_, float expos_err_, int status=1)
void fillResPull (float res_, float pull_, int status=1)
void fillResPull (float res_, float pull_, float err_, float expos_err_, int status=1)
void addBlock (std::vector< int > *&block, std::string name)
void addBlock (std::vector< unsigned int > *&block, std::string name)
void addBlock (std::vector< float > *&block, std::string name)
void addBlock (MuonValidationBlockBase *block, std::string name)
void init (const std::string &prefix, TTree *, bool write=true)
void clear ()

Public Attributes

std::vector< float > * residual = nullptr
std::vector< float > * pull = nullptr
std::vector< float > * pos = nullptr
std::vector< float > * err = nullptr
std::vector< float > * expos = nullptr
std::vector< float > * expos_err = nullptr
std::vector< int > * expos_errstatus = nullptr
std::vector< IntBlockintBlocks
std::vector< UnsignedIntBlockunsignedIntBlocks
std::vector< FloatBlockfloatBlocks
std::vector< SubBlocksubBlocks

Detailed Description

Block with residual and pull information.

Definition at line 133 of file MuonInsideOutValidationNtuple.h.

Member Typedef Documentation

◆ FloatBlock

typedef std::pair<std::reference_wrapper<std::vector<float>*>,std::string> Muon::MuonValidationBlockBase::FloatBlock
inherited

Definition at line 30 of file MuonInsideOutValidationNtuple.h.

◆ IntBlock

typedef std::pair<std::reference_wrapper<std::vector<int>*>,std::string> Muon::MuonValidationBlockBase::IntBlock
inherited

Definition at line 28 of file MuonInsideOutValidationNtuple.h.

◆ SubBlock

typedef std::pair< MuonValidationBlockBase*, std::string > Muon::MuonValidationBlockBase::SubBlock
inherited

Definition at line 31 of file MuonInsideOutValidationNtuple.h.

◆ UnsignedIntBlock

typedef std::pair<std::reference_wrapper<std::vector<unsigned int>*>,std::string> Muon::MuonValidationBlockBase::UnsignedIntBlock
inherited

Definition at line 29 of file MuonInsideOutValidationNtuple.h.

Constructor & Destructor Documentation

◆ MuonValidationResidualBlock()

Muon::MuonValidationResidualBlock::MuonValidationResidualBlock ( )

Definition at line 98 of file MuonInsideOutValidationNtuple.cxx.

98 {
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 }
void addBlock(std::vector< int > *&block, std::string name)

Member Function Documentation

◆ addBlock() [1/4]

void Muon::MuonValidationBlockBase::addBlock ( MuonValidationBlockBase * block,
std::string name )
inlineinherited

Definition at line 40 of file MuonInsideOutValidationNtuple.h.

40{ subBlocks.push_back( SubBlock(block,name) ); }
std::pair< MuonValidationBlockBase *, std::string > SubBlock

◆ addBlock() [2/4]

void Muon::MuonValidationBlockBase::addBlock ( std::vector< float > *& block,
std::string name )
inlineinherited

Definition at line 39 of file MuonInsideOutValidationNtuple.h.

39{ block=nullptr; floatBlocks.push_back( FloatBlock(block,name) ); }
std::pair< std::reference_wrapper< std::vector< float > * >, std::string > FloatBlock

◆ addBlock() [3/4]

void Muon::MuonValidationBlockBase::addBlock ( std::vector< int > *& block,
std::string name )
inlineinherited

Definition at line 37 of file MuonInsideOutValidationNtuple.h.

37{ block=nullptr; intBlocks.push_back( IntBlock(block,name) ); }
std::pair< std::reference_wrapper< std::vector< int > * >, std::string > IntBlock

◆ addBlock() [4/4]

void Muon::MuonValidationBlockBase::addBlock ( std::vector< unsigned int > *& block,
std::string name )
inlineinherited

Definition at line 38 of file MuonInsideOutValidationNtuple.h.

38{ block=nullptr; unsignedIntBlocks.push_back( UnsignedIntBlock(block,name) ); }
std::pair< std::reference_wrapper< std::vector< unsigned int > * >, std::string > UnsignedIntBlock
std::vector< UnsignedIntBlock > unsignedIntBlocks

◆ clear()

void Muon::MuonValidationBlockBase::clear ( )
inherited

Definition at line 10 of file MuonInsideOutValidationNtuple.cxx.

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

◆ fill() [1/3]

void Muon::MuonValidationResidualBlock::fill ( const Trk::MeasurementBase & hit,
const MuonSystemExtension::Intersection & intersection,
Trk::ParamDefs par )
inline

Definition at line 136 of file MuonInsideOutValidationNtuple.h.

136 {
137 float pos_ = hit.localParameters()[par];
138 float err_ = Amg::error(hit.localCovariance(),par);
139 fill(pos_,err_,intersection,par);
140 }
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
std::vector< std::string > intersection(std::vector< std::string > &v1, std::vector< std::string > &v2)
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
void fill(const Trk::MeasurementBase &hit, const MuonSystemExtension::Intersection &intersection, Trk::ParamDefs par)

◆ fill() [2/3]

void Muon::MuonValidationResidualBlock::fill ( float pos_,
float err_,
const MuonSystemExtension::Intersection & intersection,
Trk::ParamDefs par )
inline

Definition at line 142 of file MuonInsideOutValidationNtuple.h.

142 {
143 float expos_ = intersection.trackParameters->parameters()[Trk::loc1];
144 auto cov = intersection.trackParameters->covariance();
145 float expos_err_ = cov ? Amg::error(*cov,par) : 0;
146 fill(pos_,err_,expos_,expos_err_, cov!=nullptr );
147 }
@ loc1
Definition ParamDefs.h:34

◆ fill() [3/3]

void Muon::MuonValidationResidualBlock::fill ( float pos_,
float err_,
float expos_,
float expos_err_,
int status = 1 )
inline

Definition at line 149 of file MuonInsideOutValidationNtuple.h.

149 {
150
151 float res = pos_ - expos_;
152 float err2 = err_*err_ + expos_err_*expos_err_;
153 float pull_ = res/sqrt(err2);
154
155 residual->push_back(res);
156 pull->push_back(pull_);
157 pos->push_back(pos_);
158 err->push_back(err_);
159 expos->push_back(expos_);
160 expos_err->push_back(expos_err_);
161 expos_errstatus->push_back(status);
162 }
std::pair< std::vector< unsigned int >, bool > res

◆ fillResPull() [1/2]

void Muon::MuonValidationResidualBlock::fillResPull ( float res_,
float pull_,
float err_,
float expos_err_,
int status = 1 )
inline

Definition at line 168 of file MuonInsideOutValidationNtuple.h.

168 {
169
170 residual->push_back(res_);
171 pull->push_back(pull_);
172 pos->push_back(0.);
173 err->push_back(err_);
174 expos->push_back(0.);
175 expos_err->push_back(expos_err_);
176 expos_errstatus->push_back(status);
177 }

◆ fillResPull() [2/2]

void Muon::MuonValidationResidualBlock::fillResPull ( float res_,
float pull_,
int status = 1 )
inline

Definition at line 164 of file MuonInsideOutValidationNtuple.h.

164 {
165 fillResPull(res_,pull_,1.,1.,status);
166 }
void fillResPull(float res_, float pull_, int status=1)

◆ init()

void Muon::MuonValidationBlockBase::init ( const std::string & prefix,
TTree * tree,
bool write = true )
inherited

Definition at line 28 of file MuonInsideOutValidationNtuple.cxx.

28 {
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 }
TChain * tree

Member Data Documentation

◆ err

std::vector<float>* Muon::MuonValidationResidualBlock::err = nullptr

Definition at line 182 of file MuonInsideOutValidationNtuple.h.

◆ expos

std::vector<float>* Muon::MuonValidationResidualBlock::expos = nullptr

Definition at line 183 of file MuonInsideOutValidationNtuple.h.

◆ expos_err

std::vector<float>* Muon::MuonValidationResidualBlock::expos_err = nullptr

Definition at line 184 of file MuonInsideOutValidationNtuple.h.

◆ expos_errstatus

std::vector<int>* Muon::MuonValidationResidualBlock::expos_errstatus = nullptr

Definition at line 185 of file MuonInsideOutValidationNtuple.h.

◆ floatBlocks

std::vector< FloatBlock > Muon::MuonValidationBlockBase::floatBlocks
inherited

Definition at line 45 of file MuonInsideOutValidationNtuple.h.

◆ intBlocks

std::vector< IntBlock > Muon::MuonValidationBlockBase::intBlocks
inherited

Definition at line 43 of file MuonInsideOutValidationNtuple.h.

◆ pos

std::vector<float>* Muon::MuonValidationResidualBlock::pos = nullptr

Definition at line 181 of file MuonInsideOutValidationNtuple.h.

◆ pull

std::vector<float>* Muon::MuonValidationResidualBlock::pull = nullptr

Definition at line 180 of file MuonInsideOutValidationNtuple.h.

◆ residual

std::vector<float>* Muon::MuonValidationResidualBlock::residual = nullptr

Definition at line 179 of file MuonInsideOutValidationNtuple.h.

◆ subBlocks

std::vector< SubBlock > Muon::MuonValidationBlockBase::subBlocks
inherited

Definition at line 46 of file MuonInsideOutValidationNtuple.h.

◆ unsignedIntBlocks

std::vector< UnsignedIntBlock > Muon::MuonValidationBlockBase::unsignedIntBlocks
inherited

Definition at line 44 of file MuonInsideOutValidationNtuple.h.


The documentation for this struct was generated from the following files: