51 float cone_boundaries[] = {0.05, 0.1, 0.2, 0.3, 0.4};
52 size_t ncone_boundaries =
sizeof(cone_boundaries) /
sizeof(
float);
53 unsigned int nJet = srcJet->size();
54 unsigned int ncand = 0;
55 std::vector<float> numdaughterspt03;
56 std::vector<std::vector<float>> EmFractionEnergyRings(ncone_boundaries + 1, std::vector<float>(nJet, 0.));
57 std::vector<std::vector<float>> ChFractionEnergyRings(ncone_boundaries + 1, std::vector<float>(nJet, 0.));
58 std::vector<std::vector<float>> NeFractionEnergyRings(ncone_boundaries + 1, std::vector<float>(nJet, 0.));
59 std::vector<std::vector<float>> MuFractionEnergyRings(ncone_boundaries + 1, std::vector<float>(nJet, 0.));
61 for (
unsigned int ij = 0; ij < nJet; ij++) {
63 auto jet = srcJet->ptrAt(ij);
64 int numDaughtersPt03 = 0;
65 for (
unsigned int ijcone = 0; ijcone < ncone_boundaries; ijcone++) {
66 EmFractionEnergyRings[ijcone][ij] = 0;
67 MuFractionEnergyRings[ijcone][ij] = 0;
68 ChFractionEnergyRings[ijcone][ij] = 0;
69 NeFractionEnergyRings[ijcone][ij] = 0;
71 for (
const auto&
d :
jet->daughterPtrVector()) {
74 std::lower_bound(&cone_boundaries[0], &cone_boundaries[ncone_boundaries], candDr) - &cone_boundaries[0];
75 float candEnergy =
d->energy();
77 if (pdgid == 22 || pdgid == 11) {
78 EmFractionEnergyRings[icone][ij] += candEnergy;
79 }
else if (pdgid == 13) {
80 MuFractionEnergyRings[icone][ij] += candEnergy;
81 }
else if (
d->charge() != 0) {
82 ChFractionEnergyRings[icone][ij] += candEnergy;
84 NeFractionEnergyRings[icone][ij] += candEnergy;
87 numDaughtersPt03 += 1;
89 numdaughterspt03.push_back(numDaughtersPt03);
91 auto tab = std::make_unique<nanoaod::FlatTable>(ncand,
name_,
false,
true);
95 tab->addColumn<
float>(
"EmFractionEnergyRing0",
96 EmFractionEnergyRings[0],
97 "Em energy fraction in ring in dR 0-0.05",
99 tab->addColumn<
float>(
"EmFractionEnergyRing1",
100 EmFractionEnergyRings[1],
101 "Em energy fraction in ring in dR 0.05-0.1",
103 tab->addColumn<
float>(
"EmFractionEnergyRing2",
104 EmFractionEnergyRings[2],
105 "Em energy fraction in ring in dR 0.1-0.2",
107 tab->addColumn<
float>(
"EmFractionEnergyRing3",
108 EmFractionEnergyRings[3],
109 "Em energy fraction in ring in dR 0.2-0.3",
111 tab->addColumn<
float>(
"EmFractionEnergyRing4",
112 EmFractionEnergyRings[4],
113 "Em energy fraction in ring in dR 0.3-0.4",
115 tab->addColumn<
float>(
"EmFractionEnergyRing5",
116 EmFractionEnergyRings[5],
117 "Em energy fraction in ring in dR 0.4 overflow",
120 tab->addColumn<
float>(
"ChFractionEnergyRing0",
121 ChFractionEnergyRings[0],
122 "Ch energy fraction in ring in dR 0-0.05",
124 tab->addColumn<
float>(
"ChFractionEnergyRing1",
125 ChFractionEnergyRings[1],
126 "Ch energy fraction in ring in dR 0.05-0.1",
128 tab->addColumn<
float>(
"ChFractionEnergyRing2",
129 ChFractionEnergyRings[2],
130 "Ch energy fraction in ring in dR 0.1-0.2",
132 tab->addColumn<
float>(
"ChFractionEnergyRing3",
133 ChFractionEnergyRings[3],
134 "Ch energy fraction in ring in dR 0.2-0.3",
136 tab->addColumn<
float>(
"ChFractionEnergyRing4",
137 ChFractionEnergyRings[4],
138 "Ch energy fraction in ring in dR 0.3-0.4",
140 tab->addColumn<
float>(
"ChFractionEnergyRing5",
141 ChFractionEnergyRings[5],
142 "Ch energy fraction in ring in dR 0.4 overflow",
145 tab->addColumn<
float>(
"MuFractionEnergyRing0",
146 MuFractionEnergyRings[0],
147 "Mu energy fraction in ring in dR 0-0.05",
149 tab->addColumn<
float>(
"MuFractionEnergyRing1",
150 MuFractionEnergyRings[1],
151 "Mu energy fraction in ring in dR 0.05-0.1",
153 tab->addColumn<
float>(
"MuFractionEnergyRing2",
154 MuFractionEnergyRings[2],
155 "Mu energy fraction in ring in dR 0.1-0.2",
157 tab->addColumn<
float>(
"MuFractionEnergyRing3",
158 MuFractionEnergyRings[3],
159 "Mu energy fraction in ring in dR 0.2-0.3",
161 tab->addColumn<
float>(
"MuFractionEnergyRing4",
162 MuFractionEnergyRings[4],
163 "Mu energy fraction in ring in dR 0.3-0.4",
165 tab->addColumn<
float>(
"MuFractionEnergyRing5",
166 MuFractionEnergyRings[5],
167 "Mu energy fraction in ring in dR 0.4 overflow",
170 tab->addColumn<
float>(
"NeFractionEnergyRing0",
171 NeFractionEnergyRings[0],
172 "Ne energy fraction in ring in dR 0-0.05",
174 tab->addColumn<
float>(
"NeFractionEnergyRing1",
175 NeFractionEnergyRings[1],
176 "Ne energy fraction in ring in dR 0.05-0.1",
178 tab->addColumn<
float>(
"NeFractionEnergyRing2",
179 NeFractionEnergyRings[2],
180 "Ne energy fraction in ring in dR 0.1-0.2",
182 tab->addColumn<
float>(
"NeFractionEnergyRing3",
183 NeFractionEnergyRings[3],
184 "Ne energy fraction in ring in dR 0.2-0.3",
186 tab->addColumn<
float>(
"NeFractionEnergyRing4",
187 NeFractionEnergyRings[4],
188 "Ne energy fraction in ring in dR 0.3-0.4",
190 tab->addColumn<
float>(
"NeFractionEnergyRing5",
191 NeFractionEnergyRings[5],
192 "Ne energy fraction in ring in dR 0.4 overflow",
edm::EDGetTokenT< edm::View< pat::Jet > > srcJet_
Abs< T >::type abs(const T &t)