Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update xah #1655

Closed
wants to merge 73 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
7458f0d
add protection to MuonEfficiencyCorrector for when running over MC16a…
jburzy Nov 9, 2020
3fea669
update isPHYS to work for PHYSLLP
jburzy Nov 23, 2021
9c01c2f
added LooseBadLLP to jet cleaning
Darij-Starko Jan 21, 2022
5e9877d
Correct setBranch for significance branches, /F is incorrect should be F
flumeware Jan 21, 2022
79484d5
Merge pull request #1 from flumeware/fix-metsigclus-jb
jburzy01 Jan 21, 2022
524f428
Correct setBranch for significance branches, /F is incorrect should be F
flumeware Jan 21, 2022
72410d0
removed whitespaces
Darij-Starko Jan 25, 2022
971fa67
Merge pull request #2 from flumeware/metsigclus2
jburzy01 Jan 25, 2022
f643a77
test out of removal of whitespace
Darij-Starko Jan 25, 2022
2f0fff4
included LooseBadLLP cut in jet-cleaning
Darij-Starko Jan 25, 2022
91c2723
removed extra whitespaces
Darij-Starko Jan 25, 2022
8817cc4
removed extra whitespaces
Darij-Starko Jan 25, 2022
c1a24d2
Merge pull request #4 from jburzy01/darij/jet-cleaning
jburzy01 Jan 25, 2022
a006c69
adjusted WP LooseBadLLP into an infoswitch
Darij-Starko Jan 26, 2022
57eb3ca
Merge pull request #5 from jburzy01/darij/jet-cleaning
jburzy01 Jan 26, 2022
67654ed
Merge branch 'r22/master' of https://github.com/UCATLAS/xAODAnaHelper…
Darij-Starko Jan 31, 2022
26dcf4b
included jet clean infoswitch in OR and fixed or->|| in Algorithm.cxx
Darij-Starko Jan 31, 2022
89feca9
add option to set DoSetMuonJetEMScale to false, this is required if t…
flumeware Feb 7, 2022
274c507
Merge pull request #6 from flumeware/metnomuon-jb
jburzy01 Feb 7, 2022
f0ae4f3
fixed LLP WP issue in JetContainer
Darij-Starko Feb 8, 2022
ab29531
Merge branch 'darij/jet-cleaning' of https://github.com/jburzy01/xAOD…
Darij-Starko Feb 8, 2022
e8ba6ca
Merge pull request #7 from jburzy01/darij/jet-cleaning
jburzy01 Feb 8, 2022
1ddb769
Added displaced in Jet container
Feb 8, 2022
0d8fd1a
Merge pull request #10 from jburzy01/hamza_displaced
hamzahanif2210 Feb 8, 2022
2cbbe6b
Made changes in JetContainer to resolve the issues
Feb 10, 2022
a769e12
Merge pull request #12 from jburzy01/hamza_displaced
jburzy01 Feb 10, 2022
97de85d
fixed jet cleaning
Darij-Starko Feb 17, 2022
166c86c
Merge pull request #13 from jburzy01/r22/darijWIP
jburzy01 Feb 17, 2022
8f5a504
update derivation name
jburzy Mar 16, 2022
7910985
Add support for plotting the xAH::MetContainer to MetHists
flumeware Mar 20, 2022
c5fa48f
Merge pull request #16 from flumeware/flumeware/methist
jburzy01 Mar 22, 2022
b7d2bb1
fix merge conflicts
jburzy Mar 23, 2022
9309268
update for AB 22.2.64
jburzy Mar 24, 2022
3771841
Merge branch 'r22/master-PHYSLLP' of github.com:jburzy01/xAODAnaHelpe…
jburzy Mar 24, 2022
a44cf70
changes
Mar 26, 2022
92c6c1c
made changes to implement displaced variables in jethist - finally wo…
Mar 26, 2022
6839082
changes
Mar 26, 2022
50c1f03
resolved issues with jethist
Mar 26, 2022
1b08a42
changes
Mar 27, 2022
57b4650
Merge pull request #17 from jburzy01/hr22
jburzy01 Mar 28, 2022
2535eb9
add GhostTrackLRT and additional variables to Jet.h
jburzy Apr 7, 2022
6f9ee39
added dchf variable in JetContainer and JetHists algos
Apr 12, 2022
5094128
added new diplaced variable "pT_rel" in JetContainer and JetHist algos
Apr 13, 2022
dd31ddf
changed the x-max of pt-rel histogram
Apr 13, 2022
542a688
chg --> chf
Apr 13, 2022
87281ad
Merge pull request #19 from jburzy01/hr22
jburzy01 Apr 14, 2022
eeb0dd1
Merge pull request #18 from jburzy01/jet-tracks
jburzy01 Apr 14, 2022
04e24fc
added "ptrel_highest" variable in jethist and jetcontainer algos
Apr 15, 2022
a3a40f7
change the x-lim of ptrel_highest variable
Apr 20, 2022
a2fd317
remove Stream access due to missing aux in R22
jburzy Apr 20, 2022
17347e1
Merge pull request #20 from jburzy01/fix-Stream-issue
jburzy01 Apr 20, 2022
5c4cccf
added new Diplaced variables
May 7, 2022
7164070
changes
May 7, 2022
23b5014
Merge pull request #21 from jburzy01/hhNewDisplacedVariables
jburzy01 May 11, 2022
4fbe362
comment out stream tag
jburzy May 11, 2022
2c4e99a
Merge pull request #22 from jburzy01/fix-stream-for-data
jburzy01 May 11, 2022
ff5fd71
merge from upstream
jburzy Jul 25, 2022
d9a0af2
Merge remote-tracking branch 'upstream/r22/master' into r22/master-PH…
jburzy Aug 23, 2022
4849c4c
Merge remote-tracking branch 'upstream/r22/master' into r22/master-PH…
jburzy Oct 14, 2022
f610872
Merge pull request #23 from jburzy01/fast-forward
jburzy01 Oct 14, 2022
0ae8548
remove static aux accessor
jburzy Oct 22, 2022
618051f
Merge pull request #24 from jburzy01/fix-electronSelector
jburzy01 Oct 22, 2022
cc3d724
added bdt score in Jet container
Nov 5, 2022
835c247
Merge pull request #25 from jburzy01/hamza/bdtscores
hamzahanif2210 Nov 5, 2022
cc87b2c
added median d0 variable
Dec 1, 2022
ceddf76
Merge pull request #27 from jburzy01/hamza/median
hamzahanif2210 Dec 1, 2022
fddac2e
Update JetHists.cxx
hamzahanif2210 Dec 1, 2022
568627d
Load the online beamspot info only when needed, reduces file io
flumeware Feb 28, 2023
544eafb
merge main into master-PHYSLLP
jburzy Apr 25, 2023
fd119cb
Merge pull request #28 from flumeware/flumeware-onlinebeamspot-load-jb
jburzy01 Apr 25, 2023
134b522
Merge pull request #29 from jburzy01/update-release
jburzy01 Apr 25, 2023
e04c718
add more displaced jet vars
jburzy Apr 26, 2023
effbf22
update to latest xAH
jburzy Aug 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Root/HelperClasses.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ namespace HelperClasses{
void JetInfoSwitch::initialize(){
std::string tmpConfigStr; // temporary config string used to extract multiple values

m_displaced = has_exact("displaced");
m_trigger = has_exact("trigger");
m_substructure = has_exact("substructure");
m_ntrimsubjets = has_exact("ntrimsubjets");
Expand All @@ -298,6 +299,7 @@ namespace HelperClasses{
m_rapidity = has_exact("rapidity");
m_clean = has_exact("clean");
m_cleanLight = has_exact("cleanLight");
m_cleanLLP = has_exact("cleanLLP");
m_cleanTrig = has_exact("cleanTrig");
m_cleanLLP = has_exact("cleanLLP");
m_timing = has_exact("timing");
Expand Down
242 changes: 242 additions & 0 deletions Root/JetContainer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,25 @@ JetContainer::JetContainer(const std::string& name, const std::string& detailStr
m_trkSelTool(nullptr)

{

// displaced
if(m_infoSwitch.m_displaced) {
m_ipsig = new std::vector<float>();
m_bdt_score = new std::vector<float>();
m_ptrel = new std::vector<float>();
m_ptrel_highest = new std::vector<float>();
m_chf = new std::vector<float>();
m_dchf = new std::vector<float>();
m_alpha_max = new std::vector<float>();
m_maxd0Value = new std::vector<float>();
m_mind0Value = new std::vector<float>();
m_mediand0Value = new std::vector<float>();
m_ntrk = new std::vector<int>();
m_ntrk_prompt = new std::vector<int>();


}

// rapidity
if(m_infoSwitch.m_rapidity) {
m_rapidity =new std::vector<float>();
Expand Down Expand Up @@ -479,6 +498,23 @@ JetContainer::~JetContainer()
delete m_rapidity;
}

if(m_infoSwitch.m_displaced) {
delete m_ipsig;
delete m_bdt_score;
delete m_ptrel;
delete m_ptrel_highest;
delete m_chf;
delete m_dchf;
delete m_alpha_max;
delete m_mind0Value;
delete m_maxd0Value;
delete m_mediand0Value;
delete m_ntrk;
delete m_ntrk_prompt;

}


// trigger
if ( m_infoSwitch.m_trigger ) {
delete m_isTrigMatched ;
Expand Down Expand Up @@ -923,6 +959,23 @@ void JetContainer::setTree(TTree *tree)
// Connect branches
ParticleContainer::setTree(tree);

if ( m_infoSwitch.m_displaced ){
connectBranch<float> (tree,"ipsig", &m_ipsig);
connectBranch<float> (tree,"bdt_score", &m_bdt_score);
connectBranch<float> (tree,"ptrel", &m_ptrel);
connectBranch<float> (tree,"ptrel_highest", &m_ptrel_highest);
connectBranch<float> (tree,"alpha_max", &m_alpha_max);
connectBranch<float> (tree,"chf", &m_chf);
connectBranch<float> (tree,"dchf", &m_dchf);
connectBranch<float> (tree,"maxd0Value", &m_maxd0Value);
connectBranch<float> (tree,"mind0Value", &m_mind0Value);
connectBranch<float> (tree,"mediand0Value", &m_mediand0Value);
connectBranch<int> (tree,"ntrk", &m_ntrk);
connectBranch<int> (tree,"ntrk_prompt", &m_ntrk_prompt);

}


if(m_infoSwitch.m_rapidity)
{
connectBranch<float>(tree,"rapidity", &m_rapidity);
Expand Down Expand Up @@ -1011,6 +1064,30 @@ void JetContainer::setTree(TTree *tree)
connectBranch<float>(tree, "Jvt", &m_Jvt);
}

if ( m_infoSwitch.m_allTrack ) {
connectBranch<int >(tree,"GhostTrackCount", &m_GhostTrackCount );
connectBranch<float>(tree,"GhostTrackPt", &m_GhostTrackPt );
connectBranch<std::vector<float> >(tree,"GhostTrack_pt", &m_GhostTrack_pt );
connectBranch<std::vector<float> >(tree,"GhostTrack_qOverP",&m_GhostTrack_qOverP);
connectBranch<std::vector<float> >(tree,"GhostTrack_eta", &m_GhostTrack_eta );
connectBranch<std::vector<float> >(tree,"GhostTrack_phi", &m_GhostTrack_phi );
connectBranch<std::vector<float> >(tree,"GhostTrack_e", &m_GhostTrack_e );
connectBranch<std::vector<float> >(tree,"GhostTrack_d0", &m_GhostTrack_d0 );
connectBranch<std::vector<float> >(tree,"GhostTrack_z0", &m_GhostTrack_z0 );
if ( m_infoSwitch.m_allTrackDetail ) {
connectBranch<std::vector<int> >(tree,"GhostTrack_nPixelHits", &m_GhostTrack_nPixelHits);
connectBranch<std::vector<int> >(tree,"GhostTrack_nSCTHits", &m_GhostTrack_nSCTHits);
connectBranch<std::vector<int> >(tree,"GhostTrack_nTRTHits", &m_GhostTrack_nTRTHits);
connectBranch<std::vector<int> >(tree,"GhostTrack_nPixelSharedHits", &m_GhostTrack_nPixelSharedHits);
connectBranch<std::vector<int> >(tree,"GhostTrack_nPixelSplitHits", &m_GhostTrack_nPixelSplitHits);
connectBranch<std::vector<int> >(tree,"m_GhostTrack_nInnermostPixelLayerHits", &m_GhostTrack_nInnermostPixelLayerHits);
connectBranch<std::vector<int> >(tree,"m_GhostTrack_nInnermostPixelLayerSharedHits", &m_GhostTrack_nInnermostPixelLayerSharedHits);
connectBranch<std::vector<int> >(tree,"m_GhostTrack_nInnermostPixelLayerSplitHits", &m_GhostTrack_nInnermostPixelLayerSplitHits);
connectBranch<std::vector<int> >(tree,"m_GhostTrack_nNextToInnermostPixelLayerHits", &m_GhostTrack_nNextToInnermostPixelLayerHits);
connectBranch<std::vector<int> >(tree,"m_GhostTrack_nNextToInnermostPixelLayerSharedHits", &m_GhostTrack_nNextToInnermostPixelLayerSharedHits);
connectBranch<std::vector<int> >(tree,"m_GhostTrack_nNextToInnermostPixelLayerSplitHits", &m_GhostTrack_nNextToInnermostPixelLayerSplitHits);
}
}

if ( m_infoSwitch.m_chargedPFOPV ) {
connectBranch<float>(tree, "SumPtChargedPFOPt500PV", &m_SumPtChargedPFOPt500PV);
Expand Down Expand Up @@ -1180,6 +1257,27 @@ void JetContainer::updateParticle(uint idx, Jet& jet)
if(m_debug) std::cout << "in JetContainer::updateParticle " << std::endl;
ParticleContainer::updateParticle(idx,jet);

if(m_infoSwitch.m_displaced)
{
jet.chf =m_chf ->at(idx);
jet.dchf =m_dchf ->at(idx);
jet.ipsig =m_ipsig ->at(idx);
jet.bdt_score =m_bdt_score ->at(idx);
jet.ptrel =m_ptrel ->at(idx);
jet.ptrel_highest =m_ptrel_highest ->at(idx);
jet.alpha_max =m_alpha_max ->at(idx);
jet.mind0Value =m_mind0Value ->at(idx);
jet.maxd0Value =m_maxd0Value ->at(idx);
jet.mediand0Value =m_mediand0Value ->at(idx);
jet.ntrk =m_ntrk ->at(idx);
jet.ntrk_prompt =m_ntrk_prompt ->at(idx);



}



if(m_infoSwitch.m_rapidity)
{
jet.rapidity =m_rapidity ->at(idx);
Expand Down Expand Up @@ -1270,6 +1368,32 @@ void JetContainer::updateParticle(uint idx, Jet& jet)
jet.Jvt =m_Jvt ->at(idx);
}

if ( m_infoSwitch.m_allTrack ) {
jet.GhostTrackCount = m_GhostTrackCount->at(idx);
jet.GhostTrackPt = m_GhostTrackPt->at(idx);

jet.GhostTrack_pt = m_GhostTrack_pt->at(idx);
jet.GhostTrack_qOverP = m_GhostTrack_qOverP->at(idx);
jet.GhostTrack_eta = m_GhostTrack_eta->at(idx);
jet.GhostTrack_phi = m_GhostTrack_phi->at(idx);
jet.GhostTrack_e = m_GhostTrack_e->at(idx);
jet.GhostTrack_d0 = m_GhostTrack_d0->at(idx);
jet.GhostTrack_z0 = m_GhostTrack_z0->at(idx);
if ( m_infoSwitch.m_allTrackDetail ) {
jet.GhostTrack_nPixelHits = m_GhostTrack_nPixelHits->at(idx);
jet.GhostTrack_nSCTHits = m_GhostTrack_nSCTHits->at(idx);
jet.GhostTrack_nTRTHits = m_GhostTrack_nTRTHits->at(idx);
jet.GhostTrack_nPixelSharedHits = m_GhostTrack_nPixelSharedHits->at(idx);
jet.GhostTrack_nPixelSplitHits = m_GhostTrack_nPixelSplitHits->at(idx);
jet.GhostTrack_nInnermostPixelLayerHits = m_GhostTrack_nInnermostPixelLayerHits->at(idx);
jet.GhostTrack_nInnermostPixelLayerSharedHits = m_GhostTrack_nInnermostPixelLayerSharedHits->at(idx);
jet.GhostTrack_nInnermostPixelLayerSplitHits = m_GhostTrack_nInnermostPixelLayerSplitHits->at(idx);
jet.GhostTrack_nNextToInnermostPixelLayerHits = m_GhostTrack_nNextToInnermostPixelLayerHits->at(idx);
jet.GhostTrack_nNextToInnermostPixelLayerSharedHits = m_GhostTrack_nNextToInnermostPixelLayerSharedHits->at(idx);
jet.GhostTrack_nNextToInnermostPixelLayerSplitHits = m_GhostTrack_nNextToInnermostPixelLayerSplitHits->at(idx);
}
}

if ( m_infoSwitch.m_chargedPFOPV ) {
jet.SumPtChargedPFOPt500PV=m_SumPtChargedPFOPt500PV->at(idx);
jet.fCharged=m_fCharged->at(idx);
Expand Down Expand Up @@ -1539,6 +1663,23 @@ void JetContainer::setBranches(TTree *tree)
{
ParticleContainer::setBranches(tree);

if ( m_infoSwitch.m_displaced ) {
setBranch<float>(tree,"ipsig", m_ipsig );
setBranch<float>(tree,"bdt_score", m_bdt_score );
setBranch<float>(tree,"ptrel", m_ptrel );
setBranch<float>(tree,"ptrel_highest", m_ptrel_highest );
setBranch<float>(tree,"chf", m_chf );
setBranch<float>(tree,"dchf", m_dchf );
setBranch<float>(tree,"alpha_max", m_alpha_max );
setBranch<float>(tree,"maxd0Value", m_maxd0Value );
setBranch<float>(tree,"mind0Value", m_mind0Value );
setBranch<float>(tree,"mediand0Value", m_mediand0Value );
setBranch<int>(tree,"ntrk", m_ntrk );
setBranch<int>(tree,"ntrk_prompt", m_ntrk_prompt );

}


if ( m_infoSwitch.m_rapidity ) {
setBranch<float>(tree,"rapidity", m_rapidity );
}
Expand Down Expand Up @@ -1981,6 +2122,24 @@ void JetContainer::clear()

ParticleContainer::clear();

// displaced
if( m_infoSwitch.m_displaced ) {
m_alpha_max->clear();
m_chf->clear();
m_dchf->clear();
m_ipsig->clear();
m_bdt_score->clear();
m_ptrel->clear();
m_ptrel_highest->clear();
m_maxd0Value->clear();
m_mind0Value->clear();
m_mediand0Value->clear();
m_ntrk->clear();
m_ntrk_prompt->clear();

}


// rapidity
if( m_infoSwitch.m_rapidity ) {
m_rapidity->clear();
Expand Down Expand Up @@ -2423,6 +2582,77 @@ void JetContainer::FillJet( const xAOD::IParticle* particle, const xAOD::Vertex*

const xAOD::Jet* jet=dynamic_cast<const xAOD::Jet*>(particle);

if( m_infoSwitch.m_displaced ){
if( jet->isAvailable< float >( "alpha_max" ) ) {
m_alpha_max->push_back( jet->auxdata< float >("alpha_max") );
} else {
m_alpha_max->push_back( -999 );
}
if( jet->isAvailable< float >( "bdt_score" ) ) {
m_bdt_score->push_back( jet->auxdata< float >("bdt_score") );
} else {
m_bdt_score->push_back( -999 );
}
if( jet->isAvailable< float >( "ipsig" ) ) {
m_ipsig->push_back( jet->auxdata< float >("ipsig") );
} else {
m_ipsig->push_back( -999 );
}
if( jet->isAvailable< float >( "ptrel" ) ) {
m_ptrel->push_back( jet->auxdata< float >("ptrel") );
} else {
m_ptrel->push_back( -999 );
}
if( jet->isAvailable< float >( "ptrel_highest" ) ) {
m_ptrel_highest->push_back( jet->auxdata< float >("ptrel_highest") );
} else {
m_ptrel_highest->push_back( -999 );
}
if( jet->isAvailable< float >( "chf" ) ) {
m_chf->push_back( jet->auxdata< float >("chf") );
} else {
m_chf->push_back( -999 );
}
if( jet->isAvailable< float >( "dchf" ) ) {
m_dchf->push_back( jet->auxdata< float >("dchf") );
} else {
m_dchf->push_back( -999 );
}
if( jet->isAvailable< float >( "maxd0Value" ) ) {
m_maxd0Value->push_back( jet->auxdata< float >("maxd0Value") );
} else {
m_maxd0Value->push_back( -999 );
}

if( jet->isAvailable< float >( "mind0Value" ) ) {
m_mind0Value->push_back( jet->auxdata< float >("mind0Value") );
} else {
m_mind0Value->push_back( -999 );
}


if( jet->isAvailable< float >( "mediand0Value" ) ) {
m_mediand0Value->push_back( jet->auxdata< float >("mediand0Value") );
} else {
m_mediand0Value->push_back( -999 );
}

if( jet->isAvailable< int >( "ntrk" ) ) {
m_ntrk->push_back( jet->auxdata< int >("ntrk") );
} else {
m_ntrk->push_back( -999 );
}

if( jet->isAvailable< int >( "ntrk_prompt" ) ) {
m_ntrk_prompt->push_back( jet->auxdata< int >("ntrk_prompt") );
} else {
m_ntrk_prompt->push_back( -999 );
}


}


if( m_infoSwitch.m_rapidity ){
m_rapidity->push_back( jet->rapidity() );
}
Expand Down Expand Up @@ -2986,8 +3216,13 @@ void JetContainer::FillJet( const xAOD::IParticle* particle, const xAOD::Vertex*
std::vector<int> nNIMLPixSharedHits;
std::vector<int> nNIMLPixSplitHits;
static SG::AuxElement::ConstAccessor< std::vector<ElementLink<DataVector<xAOD::IParticle> > > >ghostTrack ("GhostTrack");
static SG::AuxElement::ConstAccessor< std::vector<ElementLink<DataVector<xAOD::IParticle> > > >ghostTrackLRT ("GhostTrackLRT");
if ( ghostTrack.isAvailable( *jet ) ) {
std::vector<ElementLink<DataVector<xAOD::IParticle> > > trackLinks = ghostTrack( *jet );
if ( ghostTrackLRT.isAvailable( *jet ) ) {
std::vector<ElementLink<DataVector<xAOD::IParticle> > > trackLinksLRT = ghostTrackLRT( *jet );
trackLinks.insert( trackLinks.end(), trackLinksLRT.begin(), trackLinksLRT.end() );
}
//std::vector<float> pt(trackLinks.size(),-999);
for ( auto link_itr : trackLinks ) {
if( !link_itr.isValid() ) { continue; }
Expand All @@ -3010,6 +3245,12 @@ void JetContainer::FillJet( const xAOD::IParticle* particle, const xAOD::Vertex*
e. push_back( track->e() / m_units );
d0. push_back( track->d0() );
z0. push_back( track->z0() + track->vz() - pv->z() ); // store z0 wrt PV...most useful
// TODO: z0sinTheta
// Sd0
// sign
// ptFrac
// dEta
// dPhi
if( m_infoSwitch.m_allTrackDetail ) {
uint8_t getInt(0);
// n pix, sct, trt
Expand Down Expand Up @@ -3116,6 +3357,7 @@ void JetContainer::FillJet( const xAOD::IParticle* particle, const xAOD::Vertex*
myBTag->variable<float>("DL1r" , "pb", pb);
//FixMe: Retrieve the correct f_c value from the CDI file would be the best approach
score=log( pb / (0.018*pc+0.982*pu) );

m_DL1r_pu->push_back(pu);
m_DL1r_pc->push_back(pc);
m_DL1r_pb->push_back(pb);
Expand Down
Loading
Loading