CMS 3D CMS Logo

Functions
DiMuonVmerge.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 "TGraph.h"
#include "Alignment/OfflineValidation/macros/loopAndPlot.C"
#include "Alignment/OfflineValidation/interface/TkAlStyle.h"

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 73 of file DiMuonVmerge.cc.

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

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

◆ merge()

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

Definition at line 28 of file DiMuonVmerge.cc.

References dir2webdir::argc, GCPpyPlots::argv, gather_cfg::cout, geometryDiff::file, AlcaSiPixelAliHarvester0T_cff::options, AlCaHLTBitMon_QueryRunRegistry::string, and HLT_2024v13_cff::toAdd.

Referenced by CaloTowersCreationAlgo::assignHitHcal(), edm::EventProcessor::beginJob(), edm::SubProcess::keepOnlyConsumedUnscheduledModules(), tmtt::HTrphi::mergedCell(), DDI::LogicalPart::mergedSpecificsV(), DDExpandedView::mergedSpecificsV(), DAClusterizerInZT_vect::vertices(), DAClusterizerInZ_vect::vertices_in_blocks(), and DAClusterizerInZ_vect::vertices_no_blocks().

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 
42  TString filesAndLabels;
43  for (const auto& childTree : alignments) {
44  // Print node name and its attributes
45  // std::cout << "Node: " << childTree.first << std::endl;
46  // for (const auto& attr : childTree.second) {
47  // std::cout << " Attribute: " << attr.first << " = " << attr.second.data() << std::endl;
48  // }
49 
50  std::string file = childTree.second.get<string>("file");
51  std::cout << file << std::endl;
52  std::cout << childTree.second.get<string>("title") << std::endl;
53 
54  // Check if the file contains "/eos/cms/" and add the prefix accordingly
55  std::string prefixToAdd = file.find("/eos/cms/") != std::string::npos ? "root://eoscms.cern.ch/" : "";
57  prefixToAdd + file + "/DiMuonVertexValidation.root=" + childTree.second.get<string>("title") + ",";
58  filesAndLabels += toAdd;
59  }
60 
61  if (filesAndLabels.Length() > 0) {
62  filesAndLabels.Remove(filesAndLabels.Length() - 1); // Remove the last character
63  }
64 
65  std::cout << "filesAndLabels: " << filesAndLabels << std::endl;
66 
67  loopAndPlot(filesAndLabels);
68 
69  return EXIT_SUCCESS;
70 }