ATLAS Offline Software
Functions
TestTrkParametersIdentificationHelpers.cxx File Reference
#include "TrkParametersIdentificationHelpers/TrackParametersIdentificationHelper.h"
#include <iostream>
#include <iomanip>
#include <bitset>
Include dependency graph for TestTrkParametersIdentificationHelpers.cxx:

Go to the source code of this file.

Functions

void testBitField ()
 
void testCalo ()
 
int main ()
 

Function Documentation

◆ main()

int main ( )

getCoefficientMap(label, EigenIdxList)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light
  2. EigenIdxList is user defined vector containing all eigenvector index that user interested in. output: Map of format map<string, map<string, float>> containing decomposition coefficient of the list of eigenvectors defined by EigenIdxList.

getCoefficients(label, evIdx)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light
  2. evIdx: The index of eigenvector user interested in. output value: vector of coefficient values. The order is the same as output given by getListOfOriginalNuisanceParameters()

getListOfOriginalNuisanceParameters(label)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light output value: List of original nuisance parameter names.

getNumEigenVectors(label)

input value:

  1. label: falvor label in std::string format, could be one of B, C, T, Light return value: number of eigen vectors used for chosen label. Return 0 if error occured.

Definition at line 80 of file TestTrkParametersIdentificationHelpers.cxx.

80  {
81 
82  testBitField();
83  testCalo();
84 }

◆ testBitField()

void testBitField ( )

Definition at line 11 of file TestTrkParametersIdentificationHelpers.cxx.

11  {
14  unsigned int max = -1;
15  std::cout << " starting loop " << max << std::endl;
16  for( unsigned int i=0;i<max;++i ){
17  if( !field.encode(i,id) ){
18  std::cout << " encoding failed for " << i << std::endl;
19  break;
20  }
21  unsigned int value = field.decode(id);
22  std::cout << " i " << std::setw(3) << i << " value " << std::setw(3) << value << " " << std::bitset<32>(i) << " id " << std::bitset<32>(id) << std::endl;
23  }
24 }

◆ testCalo()

void testCalo ( )

Definition at line 26 of file TestTrkParametersIdentificationHelpers.cxx.

26  {
27 
29  unsigned int good = 0;
30  unsigned int bad = 0;
31  unsigned int goodCalo = 0;
32  unsigned int badCalo = 0;
33 
34  // loop over technologies
36 
38 
39  // loop over samplings
41 
42  for( unsigned int isEntry = 0; isEntry < 2 ; ++isEntry ){
43  bool entry = isEntry == 1;
45  static_cast<CaloSampling::CaloSample>(sample), entry );
46  AtlasDetDescr::AtlasDetTechnology itech = helper.technology(id);
47  CaloSampling::CaloSample isample = helper.caloSample(id);
48  bool ientry = helper.isEntryToVolume(id);
49  bool ivalid = helper.isValid(id);
50  bool printDetails = false;
51  if( !ivalid || sample != isample || entry != ientry ) {
52  ++bad;
53  if( isCalo ) {
54  std::cout << "WARNING bad decoding/encoding " << std::endl;
55  ++badCalo;
56  printDetails = true;
57  }
58  }else{
59  ++good;
60  if( isCalo ) { ++goodCalo;
61  } else {
62  std::cout << " good but no calo!!! " << std::endl;
63  printDetails = true;
64  }
65  }
66  if( printDetails ){
67  std::cout << " tech " << std::setw(4) << tech << " sample " << std::setw(4) << sample << " isEntry " << entry << std::endl
68  << " itech " << std::setw(4) << itech << " isample " << std::setw(4) << isample << " isEntry " << ientry
69  << " valid " << ivalid << " id " << std::bitset<32>(id) << std::endl;
70  }
71  }
72  }
73  }
74  std::cout << "all: good " << good << " bad " << bad << std::endl;
75  std::cout << "calo: good " << goodCalo << " bad " << badCalo << std::endl;
76 
77 }
bad
@ bad
Definition: SUSYToolsTester.cxx:100
GetLCDefs::Unknown
@ Unknown
Definition: GetLCDefs.h:21
Trk::BitField< unsigned int >
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
athena.value
value
Definition: athena.py:124
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
AtlasDetDescr::fLastAtlasCaloTechnology
@ fLastAtlasCaloTechnology
Definition: AtlasDetTechnology.h:46
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
AtlasDetDescr::fFirstAtlasDetTechnology
@ fFirstAtlasDetTechnology
Definition: AtlasDetTechnology.h:32
Trk::TrackParametersIdHelper
helper class to encode and decode a TrackParametersIdentifier
Definition: TrackParametersIdHelper.h:18
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:113
lumiFormat.i
int i
Definition: lumiFormat.py:85
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
AtlasDetDescr::fFirstAtlasCaloTechnology
@ fFirstAtlasCaloTechnology
Definition: AtlasDetTechnology.h:40
AtlasDetDescr::AtlasDetTechnology
AtlasDetTechnology
Definition: AtlasDetTechnology.h:28
AtlasDetDescr::fNumAtlasDetTechnologies
@ fNumAtlasDetTechnologies
Definition: AtlasDetTechnology.h:57
TrackParametersIdentifier
unsigned int TrackParametersIdentifier
Definition: TrackParametersIdHelper.h:13
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
ReadBchFromCool.good
good
Definition: ReadBchFromCool.py:433
CaloCell_ID_FCS::PreSamplerB
@ PreSamplerB
Definition: FastCaloSim_CaloCell_ID.h:19
testBitField
void testBitField()
Definition: TestTrkParametersIdentificationHelpers.cxx:11
testCalo
void testCalo()
Definition: TestTrkParametersIdentificationHelpers.cxx:26