Install fatal handler with default options.
This is meant to be easy to call from python via ctypes.
Install fatal handler with default options.
getLorentzAngle() Read LorentzAngle from HIST and write out into local DB
getBSErrors() Read BSErrors from Monitoring HIST and write out into local DB
getEfficiency() Read Efficiency from Monitoring HIST and write out into local DB
getRawOccupancy() Read RawOccupancy from Monitoring HIST and write out into local DB
getNoiseOccupancy() Read NoiseOccupancy from HIST and write out into local DB
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
beginning of the loop of channels
bad bit newly found
known bad bit
for low noisy cells
for high noisy cells
0.01 is used to scale "PER" to the same order of magnitude to "SIG"
smaller deviation: distorted
checking TmaxAmp, Not mixed with MaxAmp and Width
channel information output
Only dead or distorted, or short known BCs are considered below.
index of bc
getCoefficientMap(label, EigenIdxList)
input value:
- label: falvor label in std::string format, could be one of B, C, T, Light
- 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:
- label: falvor label in std::string format, could be one of B, C, T, Light
- 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:
- 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:
- 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 49 of file SystematicStrategyComparison.cxx.
51 bool perform_jet_validation =
false;
53 std::vector<std::string> strats;
54 strats.push_back(
"SFEigen");
55 strats.push_back(
"SFGlobalEigen");
56 std::cout <<
"Starting up the SystematicStrategyComparison . . ." << std::endl;
58 std::string CDIfile =
"/cvmfs/atlas.cern.ch/repo/sw/database/GroupData/xAODBTaggingEfficiency/13TeV/2022-22-13TeV-MC20-CDI-2022-07-28_v1.root";
60 if(perform_jet_validation){
62 std::string DAODpath =
"/DAODs/Example.pool.root.1";
64 TFile* root_file = TFile::Open(DAODpath.c_str(),
"read");
66 std::cout <<
"failed to load file" << std::endl;
73 for(
const std::string&
tag :
Reader.getTaggers()){
74 for(
const std::string& jeta :
Reader.getJetCollections(
tag)){
75 for(
const std::string&
wp :
Reader.getWorkingPoints(
tag, jeta)){
76 for(
const std::string& strat : strats ){
78 StatusCode code1 =
tool.setProperty(
"ScaleFactorFileName", CDIfile);
87 if (code_init != StatusCode::SUCCESS || code1 != StatusCode::SUCCESS || code2 != StatusCode::SUCCESS
88 || code3 != StatusCode::SUCCESS || code4 != StatusCode::SUCCESS || code5 != StatusCode::SUCCESS
89 || code6 != StatusCode::SUCCESS || code7 != StatusCode::SUCCESS)
91 std::cout <<
"Initialization of tool " <<
tool->name() <<
" failed! " << std::endl;
95 std::cout <<
"Initialization of tool " <<
tool->name() <<
" finished." << std::endl;
99 unsigned int sample_dsid = 410464;
101 tool->setMapIndex(sample_dsid);
104 std::cout <<
"-----------------------------------------------------" << std::endl;
105 const std::map<CP::SystematicVariation, std::vector<std::string> > allowed_variations =
tool->listSystematics();
106 std::cout <<
"Allowed systematics variations for tool " <<
tool->name() <<
":" << std::endl;
107 for (
const auto&
var : allowed_variations) {
108 std::cout << std::setw(40) << std::left <<
var.first.name() <<
":";
109 for (
const auto& flv :
var.second) std::cout <<
" " << flv;
110 std::cout << std::endl;
112 std::cout <<
"-----------------------------------------------------" << std::endl;
114 if(perform_jet_validation){
117 if (!
event.
retrieve(
jets, jeta).isSuccess()){ std::cout <<
" error retrieving jets " << std::endl;
return -1;}
122 if(
jet->pt() < 20000 or std::abs(
jet->eta()) > 2.4)
break;
123 int truthlabel = -999;
124 jet->getAttribute(
"HadronConeExclTruthLabelID",truthlabel);
125 std::cout <<
"\n- - - - - - - - - - - - - - - Jet " << jet_index <<
" - - - - - - - - - - - - - - - -" << std::endl;
126 std::cout <<
" |- Jet index " << jet_index <<
" px = " <<
jet->px() <<
" py = " <<
jet->py() <<
" pz = " <<
jet->pz() <<
" e " <<
jet->e() << std::endl;
127 std::cout <<
" \\_ pt = " <<
jet->pt() <<
" eta = " <<
jet->eta() <<
" phi = " <<
jet->phi() <<
" m " <<
jet->m() << std::endl;
133 std::cout <<
"Testing function calls without systematics..." << std::endl;
135 if(
result!=CorrectionCode::Ok) { std::cout <<
"b jet get efficiency failed"<<std::endl;
retval=
false;}
137 std::cout <<
"b jet get efficiency succeeded: " <<
eff << std::endl;
140 if(
result!=CorrectionCode::Ok) { std::cout <<
"b jet get scale factor failed"<<std::endl;
retval=
false;}
142 std::cout <<
"b jet get scale factor succeeded: " <<
sf << std::endl;
145 std::cout <<
"Testing function calls with systematics..." << std::endl;
147 for(
const auto&
var : systs){
151 if( sresult !=StatusCode::SUCCESS) {
152 std::cout <<
var.name() <<
" apply systematic variation FAILED " << std::endl;
155 if(
result!=CorrectionCode::Ok) {
156 std::cout <<
var.name() <<
" getScaleFactor FAILED" << std::endl;
158 std::cout <<
var.name() <<
": scale-factor = " <<
sf << std::endl;
164 if (
dummyResult != StatusCode::SUCCESS) std::cout <<
"problem disabling systematics setting!" << std::endl;
173 std::cout <<
" Great, now the SystematicStrategyComparison is finished! " << std::endl;