186 cout << __func__ <<
' ' << slice <<
" start" << endl;
190 auto tOut = unique_ptr<TTree>(tIn->CloneTree(0));
194 auto isMC = metainfo.Get<
bool>(
"flags",
"isMC");
196 GenEvent * gEv =
nullptr;
197 RecEvent * rEv =
nullptr;
199 tIn->SetBranchAddress(
"genEvent", &gEv);
200 tIn->SetBranchAddress(
"recEvent", &rEv);
202 vector<RecJet> * recJets =
nullptr;
203 vector<GenJet> * genJets =
nullptr;
204 tIn->SetBranchAddress(
"recJets", &recJets);
206 tIn->SetBranchAddress(
"genJets", &genJets);
211 for (
DT::Looper looper(tIn, slice); looper(); ++looper) {
215 auto MNJets = GetMNJet<RecJet>(*recJets, [](RecJet jet){
return jet.CorrPt() < 35;});
217 double recy = std::abs( MNJets->first.p4.Eta() - MNJets->second.p4.Eta() );
218 bool LowRecY = recy <
minY,
219 HighRecY = recy >=
maxY;
220 bool goodRec = (!LowRecY) && (!HighRecY)
221 && MNJets->first.p4.Eta() <
maxy && MNJets->second.p4.Eta() <
maxy
222 &&
minpt < MNJets->first.CorrPt() && MNJets->first.CorrPt() <
maxpt
223 &&
minpt < MNJets->second.CorrPt() && MNJets->second.CorrPt() <
maxpt;
226 double evweight = rEv->weights.front();
227 if (
isMC) evweight *= gEv->weights.front();
228 recHist.Fill(*recJets, evweight);
229 Obs2Jets obs2jets(MNJets->first, MNJets->second);
230 auto minijets =
GetMiniJets(*recJets, *MNJets,
function<
bool(RecJet&)>([](RecJet& jet){
return jet.CorrPt() < 20;}));
231 ObsMiniJets obsminijets(minijets);
232 recHist.Fill(obs2jets, obsminijets, evweight);
238 auto genMNJets = GetMNJet<GenJet>(*genJets, [](GenJet jet){
return jet.p4.Pt() < 35;});
240 double genY = std::abs( genMNJets->first.p4.Eta() - genMNJets->second.p4.Eta() );
241 bool LowGenY = genY <
minY,
242 HighGenY = genY >=
maxY,
243 goodGen = (!LowGenY) && (!HighGenY)
244 && genMNJets->first.p4.Eta() <
maxy && genMNJets->second.p4.Eta() <
maxy
245 &&
minpt < genMNJets->first.p4.Pt() && genMNJets->first.p4.Pt() <
maxpt
246 &&
minpt < genMNJets->second.p4.Pt() && genMNJets->second.p4.Pt() <
maxpt;
249 double evweight = gEv->weights.front();
250 genHist.Fill(*genJets, evweight);
251 Obs2Jets obs2jets(genMNJets->first, genMNJets->second);
252 auto minijets =
GetMiniJets(*genJets, *genMNJets,
function<
bool(GenJet&)>([](GenJet& jet){
return jet.p4.Pt() < 20;}));
253 ObsMiniJets obsminijets(minijets);
254 genHist.Fill(obs2jets, obsminijets, evweight);
259 recHist.Write(fOut.get());
261 genHist.Write(fOut.get());
263 metainfo.Set<
bool>(
"git",
"complete",
true);
266 cout << __func__ <<
' ' << slice <<
" end" << endl;