Commit 18da273c authored by Martino Salomone Centonze's avatar Martino Salomone Centonze
Browse files

changed run.sh script and introduced single bH pt and DR (w.r.t. jet axis)

parent d5b9f103
Pipeline #2372557 passed with stages
in 9 minutes
......@@ -4,7 +4,9 @@
// the constructor just builds the decorator
DecoratorExample::DecoratorExample(const std::string& prefix):
// m_deco(prefix + "decorator")
m_deco("SV1_LLR")
m_deco("SV1_LLR"),
m_deco_bH_pt("bH_pt"),
m_deco_bH_DR("bH_DR")
{
}
......@@ -17,28 +19,45 @@ void DecoratorExample::decorate(const xAOD::Jet& jet) const {
throw std::runtime_error("no b-tagging object on jet");
}
/*
using xAOD::IParticle;
std::vector<const IParticle*> ghostB;
std::vector<double> bH_pt;
// std::vector<double> bH_pt;
float singlebH_pt=-1,singlebH_DR=-1;
const std::string labelB = "ConeExclBHadronsFinal";
jet.getAssociatedObjects<IParticle>(labelB, ghostB);
if ( ghostB.size()>0 ){//&& !double_btagging ) {
if ( ghostB.size()==1 ){
//sort hadrons by dR to jet
// std::vector<int> BhadIndices = getDRSortedIndices(ghostB,&jet);
for ( unsigned int iB=0; iB< ghostB.size(); iB++) {
const xAOD::TruthParticle * myB=(const xAOD::TruthParticle*)(ghostB.at(iB));
bH_pt.push_back( myB->pt() );
}
const xAOD::TruthParticle * myB=(const xAOD::TruthParticle*)(ghostB.at(0));//was iB
singlebH_pt=myB->pt();
singlebH_DR=DR(myB,jet);
}
// Store something to the jet.
// m_deco(*btag) = std::log(jet.pt());
m_deco(*btag) = ghostB.size();
*/
// m_deco_nbH(jet)= ghostB.size();
m_deco(*btag)=btag->SV1_loglikelihoodratio();
m_deco_bH_pt(*btag)=singlebH_pt;
m_deco_bH_DR(*btag)=singlebH_DR;
}
float DecoratorExample::DR(const xAOD::TruthParticle *bH, const xAOD::Jet& jet) const{
float Deta=bH->eta()-jet.eta();
float tmp_Dphi=std::abs(bH->phi()-jet.phi());
float Dphi=0.;
if(tmp_Dphi>M_PI){
Dphi=2*M_PI-tmp_Dphi;
}
else{
Dphi=tmp_Dphi;
}
return std::sqrt(Deta*Deta+Dphi*Dphi);
}
......@@ -2,6 +2,7 @@
#define DECORATOR_EXAMPLE_HH
#include "xAODJet/Jet.h"
#include "xAODTruth/TruthParticle.h"
#include <string>
......@@ -15,13 +16,18 @@ public:
// this is the function that actually does the decoration
void decorate(const xAOD::Jet& jet) const;
float DR(const xAOD::TruthParticle *bH, const xAOD::Jet& jet) const;
private:
// All this class does is apply a decoration, so all it needs to do
// is contain one decorator. We could have also written a function
// and statically initalized this, but static data in functions is
// probably best avoided.
SG::AuxElement::Decorator<float> m_deco;
// SG::AuxElement::Decorator<int> m_deco_nbH;
SG::AuxElement::Decorator<float> m_deco_bH_pt;
SG::AuxElement::Decorator<float> m_deco_bH_DR;
};
#endif
......@@ -15,7 +15,9 @@
"SV1_deltaR",
"SV1_Lxy",
"SV1_L3d",
"SV1_LLR"
"SV1_LLR",
"bH_pt",
"bH_DR"
],
"doubles": [
"IP3D_pu", "IP3D_pc", "IP3D_pb"
......
#!/usr/bin/env bash
INPUT_FILE=test_FTAG1.pool.root
if [[ ! -f $INPUT_FILE ]] ; then
curl https://dguest-ci.web.cern.ch/dguest-ci/ci/ftag/dumper/21.2.80/DAOD_FTAG1.small.pool.root > ${INPUT_FILE}
while getopts "d:" opt; do
case "${opt}" in
d)
d=${OPTARG}
(( d==0 || d==1 ))
# echo d
;;
*)
echo "Incorrect options provided"
exit 1
;;
esac
done
if [ $d -eq 0 ] ; then
DIR=/eos/user/m/mcentonz/File/FTPF/mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.deriv.DAOD_FTAG1.e6337_e5984_s3126_r10201_r10210_p4062/mc16_13TeV.410470.PhPy8EG_A14_ttbar_hdamp258p75_nonallhad.deriv.DAOD_FTAG1.e6337_e5984_s3126_r10201_r10210_p4062/
echo $d: run on ttbar
echo $DIR
for i in {01..14}
do
echo ${i}
FILE=DAOD_FTAG1.20480638._0000${i}.pool.root.1
INPUT_FILE=${DIR}${FILE}
if [[ ! -f $INPUT_FILE ]] ; then
echo "no file"
fi
echo $(dirname ${BASH_SOURCE[0]})/${CFG_FILE} $INPUT_FILE
# run the script
CFG_FILE=configs/single-b-tag/EMPFlow.json
dump-single-btag -t -c ../training-dataset-dumper/configs/single-b-tag/EMPFlow.json $INPUT_FILE -o output_ttbar_EMPFlow_${i}.h5
done
fi
if [ $d -eq 1 ] ; then
DIR=/eos/user/m/mcentonz/File/FTPF/mc16_13TeV.427080.Pythia8EvtGen_A14NNPDF23LO_flatpT_Zprime.deriv.DAOD_FTAG1.e5362_e5984_s3126_r10724_r10726_p3985/
echo $d: run on Zprime
echo $DIR
for i in {10..32}
do
FILE=DAOD_FTAG1.20123788._0000${i}.pool.root.1
INPUT_FILE=${DIR}${FILE}
if [[ ! -f $INPUT_FILE ]] ; then
echo "no file"
fi
echo $(dirname ${BASH_SOURCE[0]})/${CFG_FILE} $INPUT_FILE
# run the script
CFG_FILE=configs/single-b-tag/EMPFlow.json
dump-single-btag -t -c ../training-dataset-dumper/configs/single-b-tag/EMPFlow.json $INPUT_FILE -o output_Zprime_${i}.h5
done
fi
# run the script
CFG_FILE=configs/single-b-tag/EMPFlow.json
dump-single-btag -c $(dirname ${BASH_SOURCE[0]})/${CFG_FILE} $INPUT_FILE
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment