CMS 3D CMS Logo

Functions
MTSmerge.cc File Reference
#include <cstdlib>
#include <string>
#include <iostream>
#include <numeric>
#include <functional>
#include "exceptions.h"
#include "toolbox.h"
#include "Options.h"
#include "boost/filesystem.hpp"
#include "boost/property_tree/ptree.hpp"
#include "boost/property_tree/json_parser.hpp"
#include "boost/optional.hpp"
#include "TString.h"
#include "TASImage.h"
#include "Alignment/OfflineValidation/macros/trackSplitPlot.h"
#include "Alignment/OfflineValidation/macros/trackSplitPlot.C"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 
int merge (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 86 of file MTSmerge.cc.

References dir2webdir::argc, and GCPpyPlots::argv.

86 { return exceptions<merge>(argc, argv); }

◆ merge()

int merge ( int  argc,
char *  argv[] 
)

Definition at line 28 of file MTSmerge.cc.

References dir2webdir::argc, GCPpyPlots::argv, gather_cfg::cout, CUSTOM, TkAlStyle::legendheader, TkAlStyle::legendoptions, makePlots(), NONE, AlcaSiPixelAliHarvester0T_cff::options, outliercut, TkAlStyle::set(), AlCaHLTBitMon_QueryRunRegistry::string, subdetector, HLT_2024v14_cff::toAdd, and TkAlStyle::toStatus().

28  {
29  // parse the command line
30 
32  options.helper(argc, argv);
33  options.parser(argc, argv);
34 
35  //Read in AllInOne json config
36  pt::ptree main_tree;
37  pt::read_json(options.config, main_tree);
38 
39  pt::ptree alignments = main_tree.get_child("alignments");
40  pt::ptree validation = main_tree.get_child("validation");
41  pt::ptree global_style;
42  pt::ptree merge_style;
43 
44  int iov = validation.count("IOV") ? validation.get<int>("IOV") : 1;
45  std::string rlabel = validation.count("customrighttitle") ? validation.get<std::string>("customrighttitle") : "";
46  rlabel = merge_style.count("Rlabel") ? merge_style.get<std::string>("Rlabel") : rlabel;
47  std::string cmslabel = merge_style.count("CMSlabel") ? merge_style.get<std::string>("CMSlabel") : "INTERNAL";
48  if (TkAlStyle::toStatus(cmslabel) == CUSTOM)
49  TkAlStyle::set(CUSTOM, NONE, cmslabel, rlabel);
50  else
51  TkAlStyle::set(TkAlStyle::toStatus(cmslabel), NONE, "", rlabel);
52 
53  TString filesAndLabels;
54  for (const auto& childTree : alignments) {
55  // Print node name and its attributes
56  std::cout << "Node: " << childTree.first << std::endl;
57  for (const auto& attr : childTree.second) {
58  std::cout << " Attribute: " << attr.first << " = " << attr.second.data() << std::endl;
59  }
60 
61  //std::cout << childTree.second.get<string>("file") << std::endl;
62  //std::cout << childTree.second.get<string>("title") << std::endl;
63  //std::cout << childTree.second.get<int>("color") << std::endl;
64  //std::cout << childTree.second.get<int>("style") << std::endl;
65 
66  std::string toAdd = childTree.second.get<string>("file") +
67  Form("/MTSValidation_%s_%d.root=", childTree.first.c_str(), iov) +
68  childTree.second.get<string>("title") +
69  Form("|%i|%i,", childTree.second.get<int>("color"), childTree.second.get<int>("style"));
70  filesAndLabels += toAdd;
71  }
72 
73  std::cout << "filesAndLabels: " << filesAndLabels << std::endl;
74 
77  outliercut = -1.0;
78  //fillmatrix();
79  subdetector = "PIXEL";
80  makePlots(filesAndLabels, "./");
81 
82  return EXIT_SUCCESS;
83 }
double outliercut
TString subdetector
static void set(const PublicationStatus status, const Era era=NONE, const TString customTitle="", const TString customRightTitle="")
Definition: TkAlStyle.cc:275
static TString legendheader
Definition: TkAlStyle.h:101
static TString legendoptions
Definition: TkAlStyle.h:102
Definition: TkAlStyle.h:43
static PublicationStatus toStatus(std::string _status)
Definition: TkAlStyle.cc:83
void makePlots(Int_t nFiles, TString *files, TString *names, TString misalignment, Double_t *values, Double_t *phases, TString directory, Bool_t matrix[xsize][ysize])