3 #include "TClonesArray.h"
28 if (tree_handler->
getTree() !=
nullptr) {
40 study_variations[
"all"][
"light"] = 0;
44 std::string varName = std::string(Form(
"MinTrk: %d;TrkPT: %.2f;MinSig: %.2f",minTrack,minTrkPt,minSignif));
46 study_variations[varName][
"charm"] = 0;
47 study_variations[varName][
"light"] = 0;
55 std::vector<std::string> jets{
"light",
"charm"};
62 std::string bestVariation =
"";
64 std::cout << std::setw(40) <<
"VARIATION" << std::setw(6) <<
"LIGHT"
65 << std::setw(6) <<
"CHARM" << std::setw(8) <<
"PUNZI" << std::endl;
69 csvfile.open(
"tagging_study.csv");
71 csvfile <<
"Variation,Light,Charm" << std::endl;
74 float nLight = float(study_variations[variation][
"light"]);
75 float nCharm = float(study_variations[variation][
"charm"]);
78 PunziFOM = (nCharm/
allCharm)/( 1.5 + TMath::Sqrt(nLight));
80 std::cout << std::setw(40) << variation << std::setw(6) << int(nLight)
81 << std::setw(6) << int(nCharm) << std::setw(8) << Form(
"%.4f", PunziFOM) << std::endl;
83 csvfile <<
"\"" << variation <<
"\"," << int(nLight) <<
"," << nCharm << std::endl;
85 if (PunziFOM > maxFOM) {
87 bestVariation = variation;
91 std::cout <<
"======================================================================" << std::endl;
92 std::cout <<
"Best Variation: " << bestVariation <<
" (FOM: " << maxFOM <<
")" << std::endl;
104 std::vector<Jet*> all_jets;
105 for (
int ijet = 0; ijet <
getJets()->GetEntries(); ijet++)
109 all_jets.push_back(jet);
117 MissingET* MET =
nullptr;
118 for (
int imet = 0; imet <
getMET()->GetEntries(); imet++) {
119 MET =
static_cast<MissingET*
>(
getMET()->At(imet));
122 if (MET ==
nullptr) {
126 if (passed ==
true && MET->MET > 10.0) {
136 std::vector<Jet*> fiducial_jets = SelectorFcn<Jet>(all_jets, [](
Jet* j){
return (TMath::Abs(j->Eta) < 3.0 && j->PT > 5.0); });
138 std::vector<Jet*> charmJets = SelectorFcn<Jet>(fiducial_jets, [](
Jet* j){
return (j->Flavor == 4); });
140 std::vector<Jet*> lightJets = SelectorFcn<Jet>(fiducial_jets, [](
Jet* j){
return (j->Flavor < 4 || j->Flavor == 21); });
148 auto ModifiedTracks =
static_cast<TClonesArray*
>(
getEFlowTracks()->Clone());
149 for (
int i = 0; i < ModifiedTracks->GetEntries(); i++) {
150 auto track =
static_cast<Track*
>(ModifiedTracks->At(i));
157 for (
auto charmjet : charmJets) {
168 std::string varName = std::string(Form(
"MinTrk: %d;TrkPT: %.2f;MinSig: %.2f",minTrack,minTrkPt,minSignif));
169 if (
Tagged_sIP3D(charmjet, *ModifiedTracks, minSignif, minTrkPt, minTrack))
178 for (
auto lightjet : lightJets) {
189 std::string varName = std::string(Form(
"MinTrk: %d;TrkPT: %.2f;MinSig: %.2f",minTrack,minTrkPt,minSignif));
190 if (
Tagged_sIP3D(lightjet, *ModifiedTracks, minSignif, minTrkPt, minTrack))
198 delete ModifiedTracks;