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

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

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

◆ merge()

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

Definition at line 27 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().

27  {
28  // parse the command line
29 
31  options.helper(argc, argv);
32  options.parser(argc, argv);
33 
34  //Read in AllInOne json config
35  pt::ptree main_tree;
36  pt::read_json(options.config, main_tree);
37 
38  pt::ptree alignments = main_tree.get_child("alignments");
39  pt::ptree validation = main_tree.get_child("validation");
40 
41  TString filesAndLabels;
42  for (const auto& childTree : alignments) {
43  // Print node name and its attributes
44  // std::cout << "Node: " << childTree.first << std::endl;
45  // for (const auto& attr : childTree.second) {
46  // std::cout << " Attribute: " << attr.first << " = " << attr.second.data() << std::endl;
47  // }
48 
49  std::string file = childTree.second.get<string>("file");
50  std::cout << file << std::endl;
51  std::cout << childTree.second.get<string>("title") << std::endl;
52 
53  // Check if the file contains "/eos/cms/" and add the prefix accordingly
54  std::string prefixToAdd = file.find("/eos/cms/") != std::string::npos ? "root://eoscms.cern.ch/" : "";
56  prefixToAdd + file + "/DiMuonVertexValidation.root=" + childTree.second.get<string>("title") + ",";
57  filesAndLabels += toAdd;
58  }
59 
60  if (filesAndLabels.Length() > 0) {
61  filesAndLabels.Remove(filesAndLabels.Length() - 1); // Remove the last character
62  }
63 
64  std::cout << "filesAndLabels: " << filesAndLabels << std::endl;
65 
66  loopAndPlot(filesAndLabels);
67 
68  return EXIT_SUCCESS;
69 }