Skip to content

Commit

Permalink
(debug, not present in std workflows) plots of particleFlowRecHitECAL…
Browse files Browse the repository at this point in the history
…; introduce patMetVars to cover PAT-specific variables
  • Loading branch information
slava77devel committed Feb 27, 2018
1 parent 46e4913 commit 831f756
Showing 1 changed file with 44 additions and 8 deletions.
52 changes: 44 additions & 8 deletions comparisons/validate.C
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ double plotvar(TString v,TString cut="", bool tryCatch = false){
return countDiff;
}


void jet(TString type, TString algo, TString var, bool log10Var = false, bool trycatch = false, bool notafunction = false){
TString v = type+"_"+algo+(algo.Contains("_")? "_" : "__")+recoS+".obj."+var+(notafunction? "" : "()");
if (log10Var) v = "log10(" + v + ")";
Expand Down Expand Up @@ -331,10 +330,10 @@ void calomet(TString algo, TString var, bool doLog10 = false){
plotvar(v);
}

void met(TString var, TString cName = "tcMet_", TString tName = "recoMETs_", bool notafunction=false){
TString v=notafunction ? tName+cName+"_"+recoS+".obj."+var:
tName+cName+"_"+recoS+".obj."+var+"()";
plotvar(v);
void met(TString var, TString cName = "tcMet_", TString tName = "recoMETs_", bool log10Var = false, bool trycatch = false, bool notafunction=false){
TString v = tName+cName+"_"+recoS+".obj."+var+(notafunction? "" : "()");
if (log10Var) v = "log10(" + v + ")";
plotvar(v, "", trycatch);
}

void metVars(TString cName = "tcMet_", TString tName = "recoMETs_") {
Expand All @@ -347,6 +346,37 @@ void metVars(TString cName = "tcMet_", TString tName = "recoMETs_") {
met("significance",cName,tName);
}

void patMetVars(TString cName){
const TString tName = "patMETs_";
metVars(cName, tName);

met("[email protected]", cName, tName);
for (int i = 0; i< 32; ++i){
plotvar(tName+cName+"_"+recoS+Form(".obj[0].userFloats_[%d]",i), "", true);
}
met("[email protected]", cName, tName);
for (int i = 0; i< 32; ++i){
plotvar(tName+cName+"_"+recoS+Form(".obj[0].userInts_[%d]",i), "", true);
}
met("[email protected]", cName, tName);

met("pfMET_[0].NeutralEMFraction", cName, tName, false, true, true);
met("pfMET_[0].NeutralHadFraction", cName, tName, false, true, true);
met("pfMET_[0].ChargedEMFraction", cName, tName, false, true, true);
met("pfMET_[0].ChargedHadFraction", cName, tName, false, true, true);
met("pfMET_[0].MuonFraction", cName, tName, false, true, true);
met("pfMET_[0].Type6Fraction", cName, tName, false, true, true);
met("pfMET_[0].Type7Fraction", cName, tName, false, true, true);

for (int i = 0; i< 24; ++i){
plotvar(tName+cName+"_"+recoS+Form(".obj[0].uncertainties_[%d].dpx()",i), "", true);
plotvar(tName+cName+"_"+recoS+Form(".obj[0].uncertainties_[%d].dsumEt()",i), "", true);

plotvar(tName+cName+"_"+recoS+Form(".obj[0].corrections_[%d].dpx()",i), "", true);
plotvar(tName+cName+"_"+recoS+Form(".obj[0].corrections_[%d].dsumEt()",i), "", true);
}
}

void tau(TString var, TString cName = "hpsPFTauProducer_", TString tName = "recoPFTaus_",
bool log10Var = false, bool trycatch = false, bool notafunction = false){
TString v=notafunction ? tName+cName+"_"+recoS+".obj."+var:
Expand Down Expand Up @@ -2291,6 +2321,12 @@ void validateEvents(TString step, TString file, TString refFile, TString r="RECO
plotvar("log10(recoPFRecHits_particleFlowRecHitHO_Cleaned_"+recoS+".obj.energy())");
plotvar("recoPFRecHits_particleFlowRecHitHO_Cleaned_"+recoS+".obj.time()");

plotvar("recoPFRecHits_particleFlowRecHitECAL__"+recoS+"[email protected]()");
plotvar("recoPFRecHits_particleFlowRecHitECAL__"+recoS+".obj.position_.eta()");
plotvar("recoPFRecHits_particleFlowRecHitECAL__"+recoS+".obj.position_.phi()");
plotvar("log10(recoPFRecHits_particleFlowRecHitECAL__"+recoS+".obj.energy())");
plotvar("recoPFRecHits_particleFlowRecHitECAL__"+recoS+".obj.time()");

plotvar("recoPFRecHits_particleFlowRecHitECAL_Cleaned_"+recoS+"[email protected]()");
plotvar("recoPFRecHits_particleFlowRecHitECAL_Cleaned_"+recoS+".obj.position_.eta()");
plotvar("recoPFRecHits_particleFlowRecHitECAL_Cleaned_"+recoS+".obj.position_.phi()");
Expand Down Expand Up @@ -2488,10 +2524,10 @@ void validateEvents(TString step, TString file, TString refFile, TString r="RECO
metVars("htMetAK7_");

// miniaod
metVars("slimmedMETs_","patMETs_");
metVars("slimmedMETsPuppi_","patMETs_");
patMetVars("slimmedMETs_");
patMetVars("slimmedMETsPuppi_");
// miniaod debug
metVars("patMETsPuppi_","patMETs_");
patMetVars("patMETsPuppi_");
metVars("pfMetT1Puppi_","recoPFMETs_");
metVars("pfMetPuppi_","recoPFMETs_");

Expand Down

0 comments on commit 831f756

Please sign in to comment.