17 "\n **********************\n * *\n * " 18 "Looper *\n * *\n **********************\n");
21 options.add_options()(
"i,input",
22 "Comma separated input file list OR if just a directory is provided it will glob all in the " 23 "directory BUT must end with '/' for the path",
24 cxxopts::value<std::string>())(
"o,output",
"Output file name", cxxopts::value<std::string>())(
25 "n,nevents",
"N events to loop over", cxxopts::value<int>()->default_value(
"-1"))(
26 "j,nsplit_jobs",
"Enable splitting jobs by N blocks (--job_index must be set)", cxxopts::value<int>())(
28 "job_index of split jobs (--nsplit_jobs must be set. index starts from 0. i.e. 0, 1, 2, 3, etc...)",
29 cxxopts::value<int>())(
30 "g,pdgid",
"additional pdgid filtering to use (must be comma separated)", cxxopts::value<std::string>())(
31 "p,pt_cut",
"Transverse momentum cut", cxxopts::value<float>()->default_value(
"0.9"))(
32 "e,eta_cut",
"Pseudorapidity cut", cxxopts::value<float>()->default_value(
"4.5"))(
33 "d,debug",
"Run debug job. i.e. overrides output option to 'debug.root' and 'recreate's the file.")(
"h,help",
44 if (
result.count(
"help")) {
51 if (
result.count(
"input")) {
55 std::cout <<
"ERROR: Input list is not provided! Check your arguments" << std::endl;
63 if (
result.count(
"pdgid")) {
65 for (
auto& pdgid_str : pdgid_strs) {
80 if (
result.count(
"debug")) {
85 if (
result.count(
"output")) {
89 std::cout <<
"ERROR: output already exists! provide new output name or delete old file. OUTPUTFILE=" 95 std::cout <<
"ERROR: Output file name is not provided! Check your arguments" << std::endl;
106 if (
result.count(
"nsplit_jobs")) {
112 std::cout <<
"I am not sure what this means..." << std::endl;
121 if (
result.count(
"job_index")) {
125 std::cout <<
"ERROR: option string --job_index" <<
ana.
job_index <<
" has negative value!" << std::endl;
126 std::cout <<
"I am not sure what this means..." << std::endl;
136 if (not(
result.count(
"job_index") and
result.count(
"nsplit_jobs"))) {
138 std::cout <<
"ERROR: option string --job_index and --nsplit_jobs must be set at the same time!" << std::endl;
145 std::cout <<
"ERROR: --job_index >= --nsplit_jobs ! This does not make sense..." << std::endl;
154 std::cout <<
"=========================================================" << std::endl;
155 std::cout <<
" Setting of the analysis job based on provided arguments " << std::endl;
156 std::cout <<
"---------------------------------------------------------" << std::endl;
164 std::cout <<
"=========================================================" << std::endl;
206 TFile* firstFile =
new TFile(vstr[0]);
209 TString code_tag_data = firstFile->Get(
"code_tag_data")->GetTitle();
210 TString gitdiff = firstFile->Get(
"gitdiff")->GetTitle();
211 TString
input = firstFile->Get(
"input")->GetTitle();
218 githash = githash(0, 6);
219 std::cout <<
" gitdiff.Length(): " << gitdiff.Length() << std::endl;
220 if (gitdiff.Length() > 0)
222 std::cout <<
" githash: " << githash << std::endl;
223 TNamed githash_tnamed(
"githash", githash.Data());
224 githash_tnamed.Write();
227 if (
input.Contains(
"PU200"))
230 TNamed input_tnamed(
"input",
input.Data());
231 input_tnamed.Write();
235 for (
unsigned int ibr = 0; ibr < (
unsigned int)brobjArray->GetEntries(); ++ibr) {
236 TString brname = brobjArray->At(ibr)->GetName();
237 if (brname.EqualTo(
"t5_pt"))
243 std::vector<float> pt_boundaries;
245 pt_boundaries = {0, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.5, 2.0, 3.0, 5.0, 10, 15., 25, 50};
247 pt_boundaries = {0.988, 0.99, 0.992, 0.994, 0.996, 0.998, 1.0, 1.002, 1.004, 1.006, 1.008, 1.01, 1.012};
249 pt_boundaries = {0.955, 0.96, 0.965, 0.97, 0.975, 0.98, 0.985, 0.99, 0.995, 1.00,
250 1.005, 1.01, 1.015, 1.02, 1.025, 1.03, 1.035, 1.04, 1.045, 1.05};
253 0.5, 0.6, 0.7, 0.8, 0.9, 0.92, 0.94, 0.96, 0.98, 1.0, 1.02, 1.04, 1.06, 1.08, 1.1, 1.2, 1.5};
255 pt_boundaries = {0.5, 0.52, 0.54, 0.56, 0.58, 0.6, 0.62, 0.64, 0.66, 0.68, 0.7, 0.72, 0.74,
256 0.76, 0.78, 0.8, 0.82, 0.84, 0.86, 0.88, 0.9, 0.92, 0.94, 0.96, 0.98, 1.0,
257 1.02, 1.04, 1.06, 1.08, 1.1, 1.12, 1.14, 1.16, 1.18, 1.2, 1.22, 1.24, 1.26,
258 1.28, 1.3, 1.32, 1.34, 1.36, 1.38, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0};
260 pt_boundaries = {0.5, 0.52, 0.54, 0.56, 0.58, 0.6, 0.62, 0.64, 0.66, 0.68, 0.7, 0.72, 0.74,
261 0.76, 0.78, 0.8, 0.82, 0.84, 0.86, 0.88, 0.9, 0.92, 0.94, 0.96, 0.98, 1.0,
262 1.02, 1.04, 1.06, 1.08, 1.1, 1.12, 1.14, 1.16, 1.18, 1.2, 1.24, 1.28, 1.32,
263 1.36, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0};
265 pt_boundaries = {0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 2.0, 3.0, 4.0, 5.0};
267 pt_boundaries = {0.5, 0.52, 0.54, 0.56, 0.58, 0.6, 0.62, 0.64, 0.66, 0.68, 0.7, 0.72, 0.74, 0.76, 0.78,
268 0.8, 0.82, 0.84, 0.86, 0.88, 0.9, 0.92, 0.94, 0.96, 0.98, 1.0, 1.02, 1.04, 1.06, 1.08,
269 1.1, 1.12, 1.14, 1.16, 1.18, 1.2, 1.22, 1.24, 1.26, 1.28, 1.3, 1.32, 1.34, 1.36, 1.38,
270 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.2, 2.4, 2.6, 2.8, 3, 4, 5, 6,
271 7, 8, 9, 10, 15, 20, 25, 30, 35, 40, 45, 50};
273 pt_boundaries = {0, 0.5, 1.0, 1.5, 2.0, 3.0, 5.0, 10, 15., 25, 50};
274 else if (
mode == 9) {
275 for (
int i = 0;
i < 41; ++
i) {
276 pt_boundaries.push_back(
pow(10., -1. + 4. *
i / 40.));
279 return pt_boundaries;
std::vector< float > getPtBounds(int mode)
void init(TChain *chain, TREECLASS *treeclass, int nEventsToProcess)
vecTString split(TString in, TString separator=" ")
RecoTrackSetDefinition(TString, std::function< bool(unsigned int)>, std::function< bool(unsigned int)>, std::function< const std::vector< float >()>, std::function< const std::vector< float >()>, std::function< const std::vector< float >()>, std::function< const std::vector< int >()>)
static std::string const input
std::function< bool(unsigned int)> pass
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::function< bool(unsigned int)> pass
RooUtil::Looper< Trktree > looper
SimTrackSetDefinition(TString, int, int, std::function< bool(unsigned int)>, std::function< bool(unsigned int)>)
std::function< bool(unsigned int)> sel
TString input_file_list_tstring
std::vector< int > pdgids
TChain * createTChain(TString, TString)
void initializeInputsAndOutputs()
Power< A, B >::type pow(const A &a, const B &b)
std::function< bool(unsigned int)> sel
void parseArguments(int argc, char **argv)