Skip to content

Commit

Permalink
* remove NOMINAL_SVFIT, as NOMINAL is just enough
Browse files Browse the repository at this point in the history
* add cleaning of the selection word bits in HTTEvent
  • Loading branch information
akalinow committed Feb 28, 2017
1 parent fd42034 commit e74df9d
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion HTTAnalysis/AnalysisEnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ eventCategory *myQCDSFDenom;

};

enum sysEffects {NOMINAL, NOMINAL_SVFIT,
enum sysEffects {NOMINAL,
TESUp, TESDown,
JESUp, JESDown,
M2TUp, M2TDown,
Expand Down
6 changes: 3 additions & 3 deletions HTTAnalysis/HTTAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void HTTAnalyzer::fillControlHistos(const std::string & hNameSuffix, float event
myHistos_->fill2DUnrolledHistogram("h1DUnRollMjjMassSV"+hNameSuffix, aPair.getP4(aSystEffect).M(), jetsMass, eventWeight);

myHistos_->fill1DHistogram("h1DIso"+hNameSuffix,aLeg1.getProperty(PropertyEnum::combreliso),eventWeight);
if(aSystEffect!=HTTAnalysis::NOMINAL_SVFIT) return;
if(aSystEffect!=HTTAnalysis::NOMINAL) return;

fillDecayPlaneAngle(hNameSuffix, eventWeight, aSystEffect);
fillGenDecayPlaneAngle(hNameSuffix+"_Gen", eventWeight);
Expand Down Expand Up @@ -253,7 +253,7 @@ bool HTTAnalyzer::analyze(const EventProxyBase& iEvent){
std::string categorySuffix = "";
std::string systEffectName = "";
const std::vector<const HTTAnalysis::eventCategory*> & aCategoryRejester = myChannelSpecifics->getCategoryRejester();
for(unsigned int iSystEffect = (unsigned int)HTTAnalysis::NOMINAL_SVFIT;
for(unsigned int iSystEffect = (unsigned int)HTTAnalysis::NOMINAL;
iSystEffect<=(unsigned int)HTTAnalysis::ZmumuDown; ++iSystEffect) {

if(iSystEffect==(unsigned int)HTTAnalysis::DUMMY_SYS) continue;
Expand All @@ -278,7 +278,7 @@ bool HTTAnalyzer::analyze(const EventProxyBase& iEvent){

categorySuffix = std::to_string(iCategory);
systEffectName = HTTAnalysis::systEffectName(iCategory, iSystEffect, aCategoryRejester);
hNameSuffix = sampleName+"_"+categorySuffix+systEffectName;
hNameSuffix = sampleName+"_"+categorySuffix+systEffectName;
fillControlHistos(hNameSuffix, eventWeightWithSyst, aSystEffect);
}
}
Expand Down
2 changes: 1 addition & 1 deletion HTTAnalysis/HTTAnalyzerCPmethods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ void HTTAnalyzer::fillGenDecayPlaneAngle(const std::string & hNameSuffix, float
}

///////////////////////////////////////////////////////////
HTTAnalysis::sysEffects sysType = HTTAnalysis::NOMINAL_SVFIT;
HTTAnalysis::sysEffects sysType = HTTAnalysis::NOMINAL;

if(aGenLeg2.getProperty(PropertyEnum::decayMode)==HTTAnalysis::tauDecay1ChargedPion0PiZero){
float cosPhiNN = muonPCA.Vect().Unit().Dot(tauPCA.Vect().Unit());
Expand Down
2 changes: 1 addition & 1 deletion HTTAnalysis/HTTAnalyzerUtilityMethods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ std::string HTTAnalyzer::getSampleName(const EventProxyHTT & myEventProxy){
//////////////////////////////////////////////////////////////////////////////
float HTTAnalyzer::getSystWeight(const HTTAnalysis::sysEffects & aSystEffect){

if(aSystEffect==HTTAnalysis::NOMINAL || aSystEffect==HTTAnalysis::NOMINAL_SVFIT) return 1.0;
if(aSystEffect==HTTAnalysis::NOMINAL) return 1.0;

if(aSystEffect==HTTAnalysis::ZPtUp && sampleName.find("DYJets")!=std::string::npos) return aEvent.getPtReWeight();
else if(aSystEffect==HTTAnalysis::ZPtDown && sampleName.find("DYJets")!=std::string::npos) return 1.0/aEvent.getPtReWeight();
Expand Down
7 changes: 4 additions & 3 deletions HTTAnalysis/HTTEvent.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ void HTTEvent::clear(){

nTracksInRefit = 0;

selectionWord.ResetAllBits();
}
////////////////////////////////////////////////
////////////////////////////////////////////////
Expand All @@ -67,7 +68,7 @@ void HTTParticle::clear(){
////////////////////////////////////////////////
const TLorentzVector & HTTParticle::getSystScaleP4(HTTAnalysis::sysEffects type) const{

if(type==HTTAnalysis::NOMINAL || type==HTTAnalysis::NOMINAL_SVFIT) {
if(type==HTTAnalysis::NOMINAL) {
lastSystEffect = type;
return p4;
}
Expand Down Expand Up @@ -147,13 +148,13 @@ const TLorentzVector & HTTPair::getP4(HTTAnalysis::sysEffects type) const {
//std::cout<<"type: "<<(unsigned int)type<<" size: "<<p4Vector.size()<<std::endl;

if(p4Vector.size()>(unsigned int)type) return p4Vector[(unsigned int)type];
return p4Vector[(unsigned int)HTTAnalysis::NOMINAL_SVFIT];
return p4Vector[(unsigned int)HTTAnalysis::NOMINAL];
}
////////////////////////////////////////////////
////////////////////////////////////////////////
const TVector2 & HTTPair::getSystScaleMET(HTTAnalysis::sysEffects type) const{

if(type==HTTAnalysis::NOMINAL || type==HTTAnalysis::NOMINAL_SVFIT ||
if(type==HTTAnalysis::NOMINAL ||
(unsigned int)type>(unsigned int)HTTAnalysis::DUMMY_SYS) {
lastSystEffect = type;
return met;
Expand Down
4 changes: 3 additions & 1 deletion HTTAnalysis/HTTEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class HTTEvent{
"byVTightIsolationMVArun2v1DBdR03oldDMwLT"
};

HTTEvent(){ clear();}
HTTEvent(){clear();}

~HTTEvent(){}

Expand Down Expand Up @@ -105,6 +105,8 @@ class HTTEvent{
///Reset class data members
void clear();

void clearSelectionWord() {selectionWord.ResetAllBits();}

///Data member getters.
unsigned int getRunId() const {return runId;}

Expand Down
2 changes: 1 addition & 1 deletion HTTAnalysis/HTTHistograms.cc
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ void HTTHistograms::finalizeHistograms(const std::vector<const HTTAnalysis::even
}

///Make systematic effect histos.
for(unsigned int iSystEffect = (unsigned int)HTTAnalysis::NOMINAL_SVFIT;
for(unsigned int iSystEffect = (unsigned int)HTTAnalysis::NOMINAL;
iSystEffect<=(unsigned int)HTTAnalysis::ZmumuDown; ++iSystEffect) {
if(iSystEffect==(unsigned int)HTTAnalysis::DUMMY_SYS) continue;
for(auto iCategory: mainCategoriesRejester) {
Expand Down
8 changes: 4 additions & 4 deletions HTTAnalysis/HTTHistograms.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class HTTHistograms: public AnalysisHistograms {
using AnalysisHistograms::get1DHistogram;

TH1F *get1DHistogram(unsigned int iCategory, std::string varName,
unsigned int iSystEffect = (unsigned int)HTTAnalysis::NOMINAL_SVFIT);
unsigned int iSystEffect = (unsigned int)HTTAnalysis::NOMINAL);

std::string getTemplateName(const std::string& name);

Expand All @@ -38,18 +38,18 @@ class HTTHistograms: public AnalysisHistograms {

///Estimate QCD background using the SS/OS method.
TH1F* getQCDbackground(unsigned int iCategory, std::string varName,
unsigned int iSystEffect = (unsigned int)HTTAnalysis::NOMINAL_SVFIT);
unsigned int iSystEffect = (unsigned int)HTTAnalysis::NOMINAL);

///Calculate scaling factor for the WJets MC
///Scaling factor is estimated in high Mt region.
///Other backgrounds are subtracted, basing on MC
///QCD contribution is neglected.
std::pair<float,float> getWNormalisation(unsigned int iCategory,
unsigned int iSystEffect = (unsigned int)HTTAnalysis::NOMINAL_SVFIT);
unsigned int iSystEffect = (unsigned int)HTTAnalysis::NOMINAL);

///Calculate QCD ratio between signal and control regions.
std::pair<float,float> getQCDControlToSignal(unsigned int iCategory,
unsigned int iSystEffect = (unsigned int)HTTAnalysis::NOMINAL_SVFIT);
unsigned int iSystEffect = (unsigned int)HTTAnalysis::NOMINAL);

private:

Expand Down
3 changes: 1 addition & 2 deletions HTTAnalysis/Tools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ float getCrossSection(const std::string & sampleName){
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
std::string systEffectName(unsigned int iSystEffect){
if(iSystEffect==(int)NOMINAL) return "";
else if(iSystEffect==(int)NOMINAL_SVFIT) return "";
if(iSystEffect==(int)NOMINAL) return "";
else if(iSystEffect==(int)TESUp) return "_CMS_scale_t_mt_13TeVUp";
else if(iSystEffect==(int)TESDown) return "_CMS_scale_t_mt_13TeVDown";
else if(iSystEffect==(int)JESUp) return "_CMS_scale_j_13TeVUp";
Expand Down

0 comments on commit e74df9d

Please sign in to comment.