Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #11 from usarica/master
Browse files Browse the repository at this point in the history
MCFM 702b3
  • Loading branch information
usarica authored Dec 21, 2016
2 parents e7a5bfa + 6c8f472 commit c250489
Show file tree
Hide file tree
Showing 6 changed files with 393 additions and 80 deletions.
4 changes: 2 additions & 2 deletions MELA/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<flags FFLAGS="-O3 -ffree-form -ffree-line-length-none -Dcompiler=2 -Dmela -fno-automatic -fno-f2c -fPIC -g"/>

<!--Some magic to retrieve the mcfm library over http, and link it hardcoding its path in the resulting library, so that LD_LIBRARY_PATH is not required. -->
<Flags LDFLAGS="-Wl,-rpath=$(CMSSW_BASE)/src/ZZMatrixElement/MELA/data/$(SCRAM_ARCH) $(shell $(CMSSW_BASE)/src/ZZMatrixElement/MELA/data/retrieve.csh $(SCRAM_ARCH) mcfm_702b2) -L$(CMSSW_BASE)/src/ZZMatrixElement/MELA/data/$(SCRAM_ARCH) -lmcfm_702b2 -ljhugenmela" />
<Flags LDFLAGS="-Wl,-rpath=$(CMSSW_BASE)/src/ZZMatrixElement/MELA/data/$(SCRAM_ARCH) $(shell $(CMSSW_BASE)/src/ZZMatrixElement/MELA/data/retrieve.csh $(SCRAM_ARCH) mcfm_702b3) -L$(CMSSW_BASE)/src/ZZMatrixElement/MELA/data/$(SCRAM_ARCH) -lmcfm_702b3 -ljhugenmela" />
<Flags CPPDEFINES="_def_melatools_">

</flags>
Expand All @@ -18,7 +18,7 @@

<export>
<lib name="1"/>
<use name="mcfm_702b2"/> <!--For this to work, one needs to specify mcfm as a scram tool.-->
<use name="mcfm_702b3"/> <!--For this to work, one needs to specify mcfm as a scram tool.-->
</export>

<export>
Expand Down
2 changes: 2 additions & 0 deletions MELA/interface/TMCFMUtils.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ namespace TMCFMUtils{

void AssociatedParticleOrdering_QQVVQQAny(int iSel, int jSel, int rSel, int sSel, int order[2]);
std::vector<intQuad_t> Hash_QQVVQQAny();
std::vector<intQuad_t> Hash_QQVVQQ();
std::vector<intQuad_t> Hash_QQVVQQStrong();
}

#endif
Expand Down
75 changes: 68 additions & 7 deletions MELA/src/TMCFMUtils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void TMCFMUtils::AssociatedParticleOrdering_QQVVQQAny(int iSel, int jSel, int rS
order[0]=0;
order[1]=1;
outFound=true;
cout << "Hash requested outgoing "<< hash.at(ih)[2] << " " << hash.at(ih)[3] << ", unswapped r, s = " << rSel << " " << sSel << endl;
//cout << "Hash requested outgoing "<< hash.at(ih)[2] << " " << hash.at(ih)[3] << ", unswapped r, s = " << rSel << " " << sSel << endl;
}
else if (
(PDGHelpers::isAnUnknownJet(rSel) || rSel==hash.at(ih)[3])
Expand All @@ -40,7 +40,7 @@ void TMCFMUtils::AssociatedParticleOrdering_QQVVQQAny(int iSel, int jSel, int rS
order[0]=1;
order[1]=0;
outFound=true;
cout << "Hash requested outgoing "<< hash.at(ih)[2] << " " << hash.at(ih)[3] << ", swapped r, s = " << rSel << " " << sSel << endl;
//cout << "Hash requested outgoing "<< hash.at(ih)[2] << " " << hash.at(ih)[3] << ", swapped r, s = " << rSel << " " << sSel << endl;
}
}
// Final particles l/nu
Expand All @@ -61,7 +61,7 @@ void TMCFMUtils::AssociatedParticleOrdering_QQVVQQAny(int iSel, int jSel, int rS
order[0]=0;
order[1]=1;
outFound=true;
cout << "Hash requested outgoing "<< hash.at(ih)[2] << " " << hash.at(ih)[3] << ", unswapped r, s = " << rSel << " " << sSel << endl;
//cout << "Hash requested outgoing "<< hash.at(ih)[2] << " " << hash.at(ih)[3] << ", unswapped r, s = " << rSel << " " << sSel << endl;
}
else if (
(
Expand All @@ -77,7 +77,7 @@ void TMCFMUtils::AssociatedParticleOrdering_QQVVQQAny(int iSel, int jSel, int rS
order[0]=1;
order[1]=0;
outFound=true;
cout << "Hash requested outgoing "<< hash.at(ih)[2] << " " << hash.at(ih)[3] << ", swapped r, s = " << rSel << " " << sSel << endl;
//cout << "Hash requested outgoing "<< hash.at(ih)[2] << " " << hash.at(ih)[3] << ", swapped r, s = " << rSel << " " << sSel << endl;
}
if (PDGHelpers::getCoupledVertex(rSel, sSel)!=PDGHelpers::getCoupledVertex(hash.at(ih)[2], hash.at(ih)[3])) outFound=false;
}
Expand All @@ -86,6 +86,14 @@ void TMCFMUtils::AssociatedParticleOrdering_QQVVQQAny(int iSel, int jSel, int rS
if (!outFound){ for (unsigned int ip=0; ip<2; ip++) order[ip]=-1; }
}
std::vector<TMCFMUtils::intQuad_t> TMCFMUtils::Hash_QQVVQQAny(){
std::vector<TMCFMUtils::intQuad_t> pcfg;
std::vector<TMCFMUtils::intQuad_t> hash_qqvvqq = TMCFMUtils::Hash_QQVVQQ();
std::vector<TMCFMUtils::intQuad_t> hash_qqvvqqstrong = TMCFMUtils::Hash_QQVVQQStrong();
for (unsigned int c=0; c<hash_qqvvqq.size(); c++) pcfg.push_back(hash_qqvvqq.at(c));
for (unsigned int c=0; c<hash_qqvvqqstrong.size(); c++) pcfg.push_back(hash_qqvvqqstrong.at(c));
return pcfg;
}
std::vector<TMCFMUtils::intQuad_t> TMCFMUtils::Hash_QQVVQQ(){
// FIXME: NEED TO INCLUDE LEPTONS AS WELL FOR J=4-8 AND 9-12
/*
Based on the following cases in MCFM:
Expand Down Expand Up @@ -163,9 +171,62 @@ std::vector<TMCFMUtils::intQuad_t> TMCFMUtils::Hash_QQVVQQAny(){
// Uncommenting the lines below prints out the hash when the library is loaded.
/*
for (unsigned int ic=0; ic<pcfg.size(); ic++) std::cout
<< "TMCFMUtils::Hash_QQVVQQAny: Hash configuration " << ic << " requests ids=( "
<< pcfg.at(ic)[0] << ", " << pcfg.at(ic)[1] << ", " << pcfg.at(ic)[2] << ", " << pcfg.at(ic)[3]
<< ")" << std::endl;
<< "TMCFMUtils::Hash_QQVVQQAny: Hash configuration " << ic << " requests ids=( "
<< pcfg.at(ic)[0] << ", " << pcfg.at(ic)[1] << ", " << pcfg.at(ic)[2] << ", " << pcfg.at(ic)[3]
<< ")" << std::endl;
*/
return pcfg;
}
std::vector<TMCFMUtils::intQuad_t> TMCFMUtils::Hash_QQVVQQStrong(){
/*
Based on the following cases in MCFM:
call qq4lggampf(1,2,3,4,5,6,7,8,3,4,za,zb,msqgg)
msq(1,-1)=msq(1,-1)+stat*aveqq*msqgg(1)
call qq4lggampf(2,1,3,4,5,6,7,8,3,4,za,zb,msqgg)
msq(-1,1)=msq(-1,1)+stat*aveqq*msqgg(1)
call qq4lggampf(7,8,3,4,5,6,1,2,3,4,za,zb,msqgg)
msq(0,0)=msq(0,0)+avegg*(3d0*msqgg(1)+2d0*msqgg(2))
call qq4lggampf(7,2,3,4,5,6,1,8,3,4,za,zb,msqgg)
msq(0,-1)=msq(0,-1)+aveqg*msqgg(1)
call qq4lggampf(7,1,3,4,5,6,2,8,3,4,za,zb,msqgg)
msq(-1,0)=msq(-1,0)+aveqg*msqgg(1)
call qq4lggampf(2,8,3,4,5,6,1,7,3,4,za,zb,msqgg)
msq(0,1)=msq(0,1)+aveqg*msqgg(1)
call qq4lggampf(1,8,3,4,5,6,2,7,3,4,za,zb,msqgg)
msq(1,0)=msq(1,0)+aveqg*msqgg(1)
*/
std::vector<TMCFMUtils::intQuad_t> base_cfg;
// Start with qqb_gg
for (int iq=1; iq<=5; iq++) base_cfg.push_back(TMCFMUtils::intQuad_t(iq, -iq, 21, 21));

std::vector<TMCFMUtils::intQuad_t> jcfg;
jcfg.push_back(TMCFMUtils::intQuad_t(0, 1, 2, 3)); // qqb->gg
jcfg.push_back(TMCFMUtils::intQuad_t(1, 0, 2, 3)); // qbq->gg
jcfg.push_back(TMCFMUtils::intQuad_t(2, 3, 0, 1)); // gg->qbq
jcfg.push_back(TMCFMUtils::intQuad_t(2, 1, 0, 3)); // gqb->qbg
jcfg.push_back(TMCFMUtils::intQuad_t(2, 0, 1, 3)); // qbg->qbg
jcfg.push_back(TMCFMUtils::intQuad_t(1, 3, 2, 0)); // gq->gq
jcfg.push_back(TMCFMUtils::intQuad_t(0, 3, 2, 1)); // qg->gq

std::vector<TMCFMUtils::intQuad_t> pcfg;
for (unsigned int j=0; j<jcfg.size(); j++){
for (unsigned int p=0; p<base_cfg.size(); p++){
TMCFMUtils::intQuad_t cfg;
for (unsigned int ipos=0; ipos<4; ipos++){
int idpos = jcfg.at(j)[ipos];
int idAssigned = base_cfg.at(p)[ipos];
if (((idpos<2 && ipos>=2) || (idpos>=2 && ipos<2)) && !PDGHelpers::isAGluon(idAssigned)) idAssigned = -idAssigned;
cfg[jcfg.at(j)[ipos]] = idAssigned;
}
pcfg.push_back(cfg);
}
}
// Uncommenting the lines below prints out the hash when the library is loaded.
/*
for (unsigned int ic=0; ic<pcfg.size(); ic++) std::cout
<< "TMCFMUtils::Hash_QQVVQQAny: Hash configuration " << ic << " requests ids=( "
<< pcfg.at(ic)[0] << ", " << pcfg.at(ic)[1] << ", " << pcfg.at(ic)[2] << ", " << pcfg.at(ic)[3]
<< ")" << std::endl;
*/
return pcfg;
}
30 changes: 28 additions & 2 deletions MELA/src/TUtil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,13 @@ bool TUtil::MCFM_chooser(
breit_.mass3 =masses_mcfm_.zmass;
breit_.width3=masses_mcfm_.zwidth;

vsymfact_.vsymfact=1.0;
interference_.interference=false;
if (hasZZ4fInterf && (leptonInterf==TVar::DefaultLeptonInterf || leptonInterf==TVar::InterfOn)){
vsymfact_.vsymfact=0.5;
interference_.interference=true;
}

if (verbosity>=TVar::DEBUG) cout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;

}
Expand Down Expand Up @@ -1691,6 +1698,13 @@ bool TUtil::MCFM_chooser(
breit_.mass3 =masses_mcfm_.zmass;
breit_.width3=masses_mcfm_.zwidth;

vsymfact_.vsymfact=1.0;
interference_.interference=false;
if (hasZZ4fInterf && (leptonInterf==TVar::DefaultLeptonInterf || leptonInterf==TVar::InterfOn)){
vsymfact_.vsymfact=0.5;
interference_.interference=true;
}

if (verbosity>=TVar::DEBUG) cout << "TUtil::MCFM_chooser: Setup is (production, process)=(" << TVar::ProductionName(production) << ", " << TVar::ProcessName(process) << ")" << endl;

}
Expand Down Expand Up @@ -2528,7 +2542,13 @@ bool TUtil::MCFM_SetupParticleCouplings(
// All of these require ZZ ordering since they use either ZZ ME or VV ME
if (process==TVar::HSMHiggs || process==TVar::bkgZZ_SMHiggs || process==TVar::bkgZZ){
ordering = pZOrder;
if (!hasZ1 || !hasZ2) result = false;
if (
!(
(hasZ1 && hasZ2)
||
(process==TVar::HSMHiggs && hasW1 && hasW2)
)
) result = false;
}
else if (process==TVar::HSMHiggs_WWZZ || process==TVar::bkgWWZZ_SMHiggs || process==TVar::bkgWWZZ){
ordering = pZOrder;
Expand Down Expand Up @@ -2558,7 +2578,13 @@ bool TUtil::MCFM_SetupParticleCouplings(
// All of these require ZZ ordering since they use either ZZ ME or VV ME
else if (process==TVar::HSMHiggs || process==TVar::bkgZZ_SMHiggs || process==TVar::bkgZZ){
ordering = pZOrder;
if (!hasZ1 || !hasZ2) result = false;
if (
!(
(hasZ1 && hasZ2)
||
(process==TVar::HSMHiggs && hasW1 && hasW2)
)
) result = false;
}
else if (process==TVar::HSMHiggs_WWZZ || process==TVar::bkgWWZZ_SMHiggs || process==TVar::bkgWWZZ){
ordering = pZOrder;
Expand Down
5 changes: 1 addition & 4 deletions MELA/test/loadMELA.C
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
//
// MELA root package loader - see testKD.C for instructions
//
{
TString LIBMCFM="libmcfm_702.so";
TString LIBMCFM="libmcfm_702b3.so";
gSystem->AddIncludePath("-I$ROOFITSYS/include/");
gSystem->AddIncludePath("-I$CMSSW_BASE/interface/");
gSystem->AddIncludePath("-I$CMSSW_BASE/src/");
Expand Down
Loading

0 comments on commit c250489

Please sign in to comment.