187 cout << __func__ <<
' ' << slice <<
" start" << endl;
191 auto tOut = unique_ptr<TTree>(tIn->CloneTree(0));
195 auto isMC = metainfo.Get<
bool>(
"flags",
"isMC");
197 GenEvent * gEv =
nullptr;
198 RecEvent * rEv =
nullptr;
200 tIn->SetBranchAddress(
"genEvent", &gEv);
201 tIn->SetBranchAddress(
"recEvent", &rEv);
203 vector<RecJet> * recJets =
nullptr;
204 vector<GenJet> * genJets =
nullptr;
205 tIn->SetBranchAddress(
"recJets", &recJets);
207 tIn->SetBranchAddress(
"genJets", &genJets);
212 for (
DT::Looper looper(tIn, slice); looper(); ++looper) {
216 auto MNJets = GetMNJet<RecJet>(*recJets, [](RecJet jet){
return jet.CorrPt() < 35;});
218 double recy = std::abs( MNJets->first.p4.Eta() - MNJets->second.p4.Eta() );
219 bool LowRecY = recy <
minY,
220 HighRecY = recy >=
maxY;
221 bool goodRec = (!LowRecY) && (!HighRecY)
222 && MNJets->first.p4.Eta() <
maxy && MNJets->second.p4.Eta() <
maxy
223 &&
minpt < MNJets->first.CorrPt() && MNJets->first.CorrPt() <
maxpt
224 &&
minpt < MNJets->second.CorrPt() && MNJets->second.CorrPt() <
maxpt;
227 double evweight = rEv->weights.front();
228 if (
isMC) evweight *= gEv->weights.front();
229 recHist.Fill(*recJets, evweight);
230 Obs2Jets obs2jets(MNJets->first, MNJets->second);
231 auto minijets =
GetMiniJets(*recJets, *MNJets,
function<
bool(RecJet&)>([](RecJet& jet){
return jet.CorrPt() < 20;}));
232 ObsMiniJets obsminijets(minijets);
233 recHist.Fill(obs2jets, obsminijets, evweight);
239 auto genMNJets = GetMNJet<GenJet>(*genJets, [](GenJet jet){
return jet.p4.Pt() < 35;});
241 double genY = std::abs( genMNJets->first.p4.Eta() - genMNJets->second.p4.Eta() );
242 bool LowGenY = genY <
minY,
243 HighGenY = genY >=
maxY,
244 goodGen = (!LowGenY) && (!HighGenY)
245 && genMNJets->first.p4.Eta() <
maxy && genMNJets->second.p4.Eta() <
maxy
246 &&
minpt < genMNJets->first.p4.Pt() && genMNJets->first.p4.Pt() <
maxpt
247 &&
minpt < genMNJets->second.p4.Pt() && genMNJets->second.p4.Pt() <
maxpt;
250 double evweight = gEv->weights.front();
251 genHist.Fill(*genJets, evweight);
252 Obs2Jets obs2jets(genMNJets->first, genMNJets->second);
253 auto minijets =
GetMiniJets(*genJets, *genMNJets,
function<
bool(GenJet&)>([](GenJet& jet){
return jet.p4.Pt() < 20;}));
254 ObsMiniJets obsminijets(minijets);
255 genHist.Fill(obs2jets, obsminijets, evweight);
260 recHist.Write(fOut.get());
262 genHist.Write(fOut.get());
264 metainfo.Set<
bool>(
"git",
"complete",
true);
267 cout << __func__ <<
' ' << slice <<
" end" << endl;