Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of the Muon Track Splitting (MTS) Validation in the new TkAl all-in-one tool #43708

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Alignment/OfflineValidation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,8 @@ For details read [`README_PV.md`](https://github.com/cms-sw/cmssw/blob/master/Al
## JetHT validation
For details read [`README_JetHT.md`](https://github.com/cms-sw/cmssw/blob/master/Alignment/OfflineValidation/README_JetHT.md)

## MTS validation
For details read [`README_MTS.md`](https://github.com/cms-sw/cmssw/blob/master/Alignment/OfflineValidation/README_MTS.md)

## General info about IOV/run arguments
For details read [`README_IOV.md`](https://github.com/cms-sw/cmssw/blob/master/Alignment/OfflineValidation/README_IOV.md)
33 changes: 33 additions & 0 deletions Alignment/OfflineValidation/README_MTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## MTS (Muon Track Splitting) validation

### General info

```
validations:
MTS:
<step_type>:
<step_name>:
<options>
```

MTS validation runs in 1 possible type of steps:
- single (validation analysis by MTS_cfg.py)
Step name is arbitrary string which will be used as a reference for consequent steps.
Merge and trend jobs are not yet implemented.

### Single MTS jobs

Single jobs can be specified per run (IoV as well).

**Parameters below to be updated**
Variable | Default value | Explanation/Options
-------- | ------------- | --------------------
IOV | None | List of IOVs/runs defined by integer value. IOV 1 is reserved for MC.
Alignments | None | List of alignments. Will create separate directory for each.
dataset | See defaultInputFiles_cff.py | Path to txt file containing list of datasets to be used. If file is missing at EOS or is corrupted - job will eventually fail (most common issue).
goodlumi | cms.untracked.VLuminosityBlockRange() | Path to json file containing lumi information about selected IoV - must contain list of runs under particular IoV with lumiblock info. Format: `IOV_Vali_{}.json`
maxevents | 1 | Maximum number of events before cmsRun terminates.
trackcollection | "generalTracks" | Track collection to be specified here, e.g. "ALCARECOTkAlMuonIsolated" or "ALCARECOTkAlMinBias" ...
tthrbuilder | "WithAngleAndTemplate" | Specify TTRH Builder
usePixelQualityFlag | True | Use pixel quality flag?
cosmicsZeroTesla | False | Is this validation for cosmics with zero magnetic field?
1 change: 1 addition & 0 deletions Alignment/OfflineValidation/bin/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
<bin name="SplitVmerge" file="SplitVmerge.cc,Options.cc" />
<bin name="Zmumumerge" file="Zmumumerge.cc,Options.cc" />
<bin name="DiMuonVmerge" file="DiMuonVmerge.cc,Options.cc" />
<bin name="MTSmerge" file="MTSmerge.cc,Options.cc" />
<bin name="haddws" file="haddws.C" />
<bin name="jetHtPlotter" file="jetHtPlotter.cc,JetHtPlotConfiguration.cc,Options.cc" />
87 changes: 87 additions & 0 deletions Alignment/OfflineValidation/bin/MTSmerge.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#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"
#include "Alignment/OfflineValidation/interface/TkAlStyle.h"

using namespace std;
using namespace AllInOneConfig;

namespace pt = boost::property_tree;

int merge(int argc, char* argv[]) {
// parse the command line

Options options;
options.helper(argc, argv);
options.parser(argc, argv);

//Read in AllInOne json config
pt::ptree main_tree;
pt::read_json(options.config, main_tree);

pt::ptree alignments = main_tree.get_child("alignments");
pt::ptree validation = main_tree.get_child("validation");
pt::ptree global_style;
pt::ptree merge_style;

int iov = validation.count("IOV") ? validation.get<int>("IOV") : 1;
std::string rlabel = validation.count("customrighttitle") ? validation.get<std::string>("customrighttitle") : "";
rlabel = merge_style.count("Rlabel") ? merge_style.get<std::string>("Rlabel") : rlabel;
std::string cmslabel = merge_style.count("CMSlabel") ? merge_style.get<std::string>("CMSlabel") : "INTERNAL";
if (TkAlStyle::toStatus(cmslabel) == CUSTOM)
TkAlStyle::set(CUSTOM, NONE, cmslabel, rlabel);
else
TkAlStyle::set(TkAlStyle::toStatus(cmslabel), NONE, "", rlabel);

TString filesAndLabels;
for (const auto& childTree : alignments) {
// Print node name and its attributes
std::cout << "Node: " << childTree.first << std::endl;
for (const auto& attr : childTree.second) {
std::cout << " Attribute: " << attr.first << " = " << attr.second.data() << std::endl;
}

//std::cout << childTree.second.get<string>("file") << std::endl;
//std::cout << childTree.second.get<string>("title") << std::endl;
//std::cout << childTree.second.get<int>("color") << std::endl;
//std::cout << childTree.second.get<int>("style") << std::endl;

std::string toAdd = childTree.second.get<string>("file") +
Form("/MTSValidation_%s_%d.root=", childTree.first.c_str(), iov) +
childTree.second.get<string>("title") +
Form("|%i|%i,", childTree.second.get<int>("color"), childTree.second.get<int>("style"));
filesAndLabels += toAdd;
}

std::cout << "filesAndLabels: " << filesAndLabels << std::endl;

TkAlStyle::legendheader = "";
TkAlStyle::legendoptions = "all";
outliercut = -1.0;
//fillmatrix();
subdetector = "PIXEL";
makePlots(filesAndLabels, "./");

return EXIT_SUCCESS;
}

#ifndef DOXYGEN_SHOULD_SKIP_THIS
int main(int argc, char* argv[]) { return exceptions<merge>(argc, argv); }
#endif
Loading