Skip to content

Commit 2d33ede

Browse files
mdhankMichael Hank
andauthored
Updating to run with AnalysisBase 25.2.94 (#1739)
* Updating to run with AnalysisBase 25.2.94 * Update python for docs * Updating jet flavor tagging details * Updating MET significance calculator * Adding list of working AnalysisBase --------- Co-authored-by: Michael Hank <mhank@login02.af.uchicago.edu>
1 parent b8eba0d commit 2d33ede

17 files changed

Lines changed: 134 additions & 81 deletions

.github/workflows/ci.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ jobs:
1919
release_type:
2020
- analysisbase
2121
release_version:
22-
- 25.2.62
23-
- 25.2.63
22+
- 25.2.94
23+
- 25.2.95
24+
- 25.2.96
2425

2526
steps:
2627
- uses: actions/checkout@master
@@ -55,11 +56,11 @@ jobs:
5556
runs-on: ubuntu-latest
5657
strategy:
5758
matrix:
58-
python-version: [3.10.20]
59+
python-version: [3.10.21]
5960

6061
steps:
6162
- uses: actions/checkout@master
62-
- name: Set up Python 3.10.20
63+
- name: Set up Python 3.10.21
6364
uses: actions/setup-python@v1
6465
with:
6566
python-version: ${{ matrix.python-version }}

Root/EventInfo.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ void EventInfo::clear()
283283
return;
284284
}
285285

286-
void EventInfo::FillEvent( const xAOD::EventInfo* eventInfo, xAOD::TEvent* event, const xAOD::VertexContainer* vertices) {
286+
void EventInfo::FillEvent( const xAOD::EventInfo* eventInfo, xAOD::Event* event, const xAOD::VertexContainer* vertices) {
287287

288288
if (!m_infoSwitch.m_noDataInfo){ // saved always (unless specifically requiring not to)
289289
m_runNumber = eventInfo->runNumber();

Root/HelpTreeBase.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ using std::vector;
2929
#pragma link C++ class vector<float>+;
3030
#endif
3131

32-
HelpTreeBase::HelpTreeBase(xAOD::TEvent* event, TTree* tree, TFile* file, const float units, bool debug, xAOD::TStore* store, std::string nominalTreeName):
32+
HelpTreeBase::HelpTreeBase(xAOD::Event* event, TTree* tree, TFile* file, const float units, bool debug, xAOD::TStore* store, std::string nominalTreeName):
3333
m_trigInfoSwitch(nullptr),
3434
m_trigConfTool(nullptr),
3535
m_trigDecTool(nullptr),
@@ -110,7 +110,7 @@ HelpTreeBase::~HelpTreeBase() {
110110
}
111111

112112

113-
HelpTreeBase::HelpTreeBase(TTree* tree, TFile* file, xAOD::TEvent* event, xAOD::TStore* store, const float units, bool debug, std::string nominalTreeName):
113+
HelpTreeBase::HelpTreeBase(TTree* tree, TFile* file, xAOD::Event* event, xAOD::TStore* store, const float units, bool debug, std::string nominalTreeName):
114114
HelpTreeBase(event, tree, file, units, debug, store, nominalTreeName)
115115
{
116116
// use the other constructor for everything
@@ -143,7 +143,7 @@ void HelpTreeBase::AddEvent( const std::string& detailStr ) {
143143
this->AddEventUser(detailStr);
144144
}
145145

146-
void HelpTreeBase::FillEvent( const xAOD::EventInfo* eventInfo, xAOD::TEvent* /*event*/, const xAOD::VertexContainer* vertices ) {
146+
void HelpTreeBase::FillEvent( const xAOD::EventInfo* eventInfo, xAOD::Event* /*event*/, const xAOD::VertexContainer* vertices ) {
147147

148148
this->ClearEvent();
149149

Root/JetContainer.cxx

Lines changed: 72 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3319,9 +3319,16 @@ void JetContainer::FillJet( const xAOD::IParticle* particle, const xAOD::Vertex*
33193319
float pu, pb, pc, ptau, score;
33203320

33213321
pu=0; pb=0; pc=0;
3322-
myBTag->variable<float>("DL1r" , "pu", pu);
3323-
myBTag->variable<float>("DL1r" , "pc", pc);
3324-
myBTag->variable<float>("DL1r" , "pb", pb);
3322+
std::string actualTagger = "DL1r";
3323+
SG::ConstAccessor<float> pbTaggerAcc_dl1r (actualTagger+"_pb");
3324+
SG::ConstAccessor<float> pcTaggerAcc_dl1r (actualTagger+"_pc");
3325+
SG::ConstAccessor<float> puTaggerAcc_dl1r (actualTagger+"_pu");
3326+
if (pbTaggerAcc_dl1r.isAvailable(*jet) && pcTaggerAcc_dl1r.isAvailable(*jet)
3327+
&& puTaggerAcc_dl1r.isAvailable(*jet)) {
3328+
pb = pbTaggerAcc_dl1r(*jet);
3329+
pc = pcTaggerAcc_dl1r(*jet);
3330+
pu = puTaggerAcc_dl1r(*jet);
3331+
}
33253332
//FixMe: Retrieve the correct f_c value from the CDI file would be the best approach
33263333
score=log( pb / (0.018*pc+0.982*pu) );
33273334
m_DL1r_pu->push_back(pu);
@@ -3330,19 +3337,33 @@ void JetContainer::FillJet( const xAOD::IParticle* particle, const xAOD::Vertex*
33303337
m_DL1r->push_back( score );
33313338

33323339
pu=0; pb=0; pc=0;
3333-
myBTag->variable<float>("DL1dv00" , "pu", pu);
3334-
myBTag->variable<float>("DL1dv00" , "pc", pc);
3335-
myBTag->variable<float>("DL1dv00" , "pb", pb);
3340+
actualTagger = "DL1dv00";
3341+
SG::ConstAccessor<float> pbTaggerAcc_dl1dv00 (actualTagger+"_pb");
3342+
SG::ConstAccessor<float> pcTaggerAcc_dl1dv00 (actualTagger+"_pc");
3343+
SG::ConstAccessor<float> puTaggerAcc_dl1dv00 (actualTagger+"_pu");
3344+
if (pbTaggerAcc_dl1dv00.isAvailable(*jet) && pcTaggerAcc_dl1dv00.isAvailable(*jet)
3345+
&& puTaggerAcc_dl1dv00.isAvailable(*jet)) {
3346+
pb = pbTaggerAcc_dl1dv00(*jet);
3347+
pc = pcTaggerAcc_dl1dv00(*jet);
3348+
pu = puTaggerAcc_dl1dv00(*jet);
3349+
}
33363350
//FixMe: Retrieve the correct f_c value from the CDI file would be the best approach
33373351
score=log( pb / (0.018*pc+0.982*pu) );
33383352
m_DL1dv00_pu->push_back(pu);
33393353
m_DL1dv00_pc->push_back(pc);
33403354
m_DL1dv00_pb->push_back(pb);
33413355
m_DL1dv00->push_back( score );
33423356
pu=0; pb=0; pc=0;
3343-
myBTag->variable<float>("DL1dv01" , "pu", pu);
3344-
myBTag->variable<float>("DL1dv01" , "pc", pc);
3345-
myBTag->variable<float>("DL1dv01" , "pb", pb);
3357+
actualTagger = "DL1dv01";
3358+
SG::ConstAccessor<float> pbTaggerAcc_dl1dv01 (actualTagger+"_pb");
3359+
SG::ConstAccessor<float> pcTaggerAcc_dl1dv01 (actualTagger+"_pc");
3360+
SG::ConstAccessor<float> puTaggerAcc_dl1dv01 (actualTagger+"_pu");
3361+
if (pbTaggerAcc_dl1dv01.isAvailable(*jet) && pcTaggerAcc_dl1dv01.isAvailable(*jet)
3362+
&& puTaggerAcc_dl1dv01.isAvailable(*jet)) {
3363+
pb = pbTaggerAcc_dl1dv01(*jet);
3364+
pc = pcTaggerAcc_dl1dv01(*jet);
3365+
pu = puTaggerAcc_dl1dv01(*jet);
3366+
}
33463367
//FixMe: Retrieve the correct f_c value from the CDI file would be the best approach
33473368
score=log( pb / (0.018*pc+0.982*pu) );
33483369
m_DL1dv01_pu->push_back(pu);
@@ -3351,9 +3372,16 @@ void JetContainer::FillJet( const xAOD::IParticle* particle, const xAOD::Vertex*
33513372
m_DL1dv01->push_back( score );
33523373

33533374
pu=0; pb=0; pc=0;
3354-
myBTag->variable<float>("GN120220509" , "pu", pu);
3355-
myBTag->variable<float>("GN120220509" , "pc", pc);
3356-
myBTag->variable<float>("GN120220509" , "pb", pb);
3375+
actualTagger = "GN120220509";
3376+
SG::ConstAccessor<float> pbTaggerAcc_GN120220509 (actualTagger+"_pb");
3377+
SG::ConstAccessor<float> pcTaggerAcc_GN120220509 (actualTagger+"_pc");
3378+
SG::ConstAccessor<float> puTaggerAcc_GN120220509 (actualTagger+"_pu");
3379+
if (pbTaggerAcc_GN120220509.isAvailable(*jet) && pcTaggerAcc_GN120220509.isAvailable(*jet)
3380+
&& puTaggerAcc_GN120220509.isAvailable(*jet)) {
3381+
pb = pbTaggerAcc_GN120220509(*jet);
3382+
pc = pcTaggerAcc_GN120220509(*jet);
3383+
pu = puTaggerAcc_GN120220509(*jet);
3384+
}
33573385
//FixMe: Retrieve the correct f_c value from the CDI file would be the best approach
33583386
score=log( pb / (0.05*pc+0.95*pu) ); // GN1 uses a different f_c value than DL1d which is 0.05
33593387
m_GN1_pu->push_back(pu);
@@ -3362,9 +3390,16 @@ void JetContainer::FillJet( const xAOD::IParticle* particle, const xAOD::Vertex*
33623390
m_GN1->push_back( score );
33633391

33643392
pu=0; pb=0; pc=0;
3365-
myBTag->variable<float>("GN2v00LegacyWP" , "pu", pu);
3366-
myBTag->variable<float>("GN2v00LegacyWP" , "pc", pc);
3367-
myBTag->variable<float>("GN2v00LegacyWP" , "pb", pb);
3393+
actualTagger = "GN2v00LegacyWP";
3394+
SG::ConstAccessor<float> pbTaggerAcc_GN2v00LegacyWP (actualTagger+"_pb");
3395+
SG::ConstAccessor<float> pcTaggerAcc_GN2v00LegacyWP (actualTagger+"_pc");
3396+
SG::ConstAccessor<float> puTaggerAcc_GN2v00LegacyWP (actualTagger+"_pu");
3397+
if (pbTaggerAcc_GN2v00LegacyWP.isAvailable(*jet) && pcTaggerAcc_GN2v00LegacyWP.isAvailable(*jet)
3398+
&& puTaggerAcc_GN2v00LegacyWP.isAvailable(*jet)) {
3399+
pb = pbTaggerAcc_GN2v00LegacyWP(*jet);
3400+
pc = pcTaggerAcc_GN2v00LegacyWP(*jet);
3401+
pu = puTaggerAcc_GN2v00LegacyWP(*jet);
3402+
}
33683403
//FixMe: Retrieve the correct f_c value from the CDI file would be the best approach
33693404
score=log( pb / (0.10*pc+0.90*pu) ); // GN2 uses a different f_c value than DL1d which is 0.01
33703405
m_GN2v00LegacyWP_pu->push_back(pu);
@@ -3373,9 +3408,16 @@ void JetContainer::FillJet( const xAOD::IParticle* particle, const xAOD::Vertex*
33733408
m_GN2v00LegacyWP->push_back( score );
33743409

33753410
pu=0; pb=0; pc=0;
3376-
myBTag->variable<float>("GN2v00NewAliasWP" , "pu", pu);
3377-
myBTag->variable<float>("GN2v00NewAliasWP" , "pc", pc);
3378-
myBTag->variable<float>("GN2v00NewAliasWP" , "pb", pb);
3411+
actualTagger = "GN2v00NewAliasWP";
3412+
SG::ConstAccessor<float> pbTaggerAcc_GN2v00NewAliasWP (actualTagger+"_pb");
3413+
SG::ConstAccessor<float> pcTaggerAcc_GN2v00NewAliasWP (actualTagger+"_pc");
3414+
SG::ConstAccessor<float> puTaggerAcc_GN2v00NewAliasWP (actualTagger+"_pu");
3415+
if (pbTaggerAcc_GN2v00NewAliasWP.isAvailable(*jet) && pcTaggerAcc_GN2v00NewAliasWP.isAvailable(*jet)
3416+
&& puTaggerAcc_GN2v00NewAliasWP.isAvailable(*jet)) {
3417+
pb = pbTaggerAcc_GN2v00NewAliasWP(*jet);
3418+
pc = pcTaggerAcc_GN2v00NewAliasWP(*jet);
3419+
pu = puTaggerAcc_GN2v00NewAliasWP(*jet);
3420+
}
33793421
//FixMe: Retrieve the correct f_c value from the CDI file would be the best approach
33803422
score=log( pb / (0.10*pc+0.90*pu) ); // GN2 uses a different f_c value than DL1d which is 0.01
33813423
m_GN2v00NewAliasWP_pu->push_back(pu);
@@ -3384,18 +3426,25 @@ void JetContainer::FillJet( const xAOD::IParticle* particle, const xAOD::Vertex*
33843426
m_GN2v00NewAliasWP->push_back( score );
33853427

33863428
pu=0; pb=0; pc=0; ptau=0;
3387-
myBTag->variable<float>("GN2v01" , "pu", pu);
3388-
myBTag->variable<float>("GN2v01" , "pc", pc);
3389-
myBTag->variable<float>("GN2v01" , "pb", pb);
3390-
myBTag->variable<float>("GN2v01" , "ptau", ptau);
3429+
actualTagger = "GN2v01";
3430+
SG::ConstAccessor<float> pbTaggerAcc_GN2v01 (actualTagger+"_pb");
3431+
SG::ConstAccessor<float> pcTaggerAcc_GN2v01 (actualTagger+"_pc");
3432+
SG::ConstAccessor<float> puTaggerAcc_GN2v01 (actualTagger+"_pu");
3433+
SG::ConstAccessor<float> ptauTaggerAcc_GN2v01 (actualTagger+"_ptau");
3434+
if (pbTaggerAcc_GN2v01.isAvailable(*jet) && pcTaggerAcc_GN2v01.isAvailable(*jet)
3435+
&& puTaggerAcc_GN2v01.isAvailable(*jet) && ptauTaggerAcc_GN2v01.isAvailable(*jet)) {
3436+
pb = pbTaggerAcc_GN2v01(*jet);
3437+
pc = pcTaggerAcc_GN2v01(*jet);
3438+
pu = puTaggerAcc_GN2v01(*jet);
3439+
ptau = ptauTaggerAcc_GN2v01(*jet);
3440+
}
33913441
//FixMe: Retrieve the correct f_c value from the CDI file would be the best approach
33923442
score=log( pb / (0.20*pc+0.01*ptau+0.79*pu) ); // GN2v01 uses a different f_c value than DL1dv01 which is 0.018
33933443
m_GN2v01_pu->push_back(pu);
33943444
m_GN2v01_pc->push_back(pc);
33953445
m_GN2v01_pb->push_back(pb);
33963446
m_GN2v01_ptau->push_back(ptau);
33973447
m_GN2v01->push_back( score );
3398-
33993448
if(m_infoSwitch.m_jetFitterDetails ) {
34003449

34013450
static SG::AuxElement::ConstAccessor< int > jf_nVTXAcc ("JetFitter_nVTX");

Root/JetSelector.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ EL::StatusCode JetSelector :: initialize ()
267267
ATH_CHECK( m_jetNNJvtSelectionTool.setProperty("JetContainer", m_outContainerName) );
268268
ATH_CHECK( m_jetNNJvtSelectionTool.setProperty("WorkingPoint", m_WorkingPointJVT) );
269269
ATH_CHECK( m_jetNNJvtSelectionTool.setProperty("OutputLevel", msg().level()) );
270+
ATH_CHECK( m_jetNNJvtSelectionTool.setProperty("JvtMomentName", "NNJvt") );
270271
ATH_CHECK( m_jetNNJvtSelectionTool.retrieve() );
271272
ANA_MSG_DEBUG("Retrieved tool: " << m_jetNNJvtSelectionTool);
272273

Root/METConstructor.cxx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ EL::StatusCode METConstructor :: initialize ()
116116
ANA_MSG_DEBUG( "Is MC? " << isMC() );
117117

118118
//////////// IMETMaker ////////////////
119+
ATH_CHECK( m_metmaker_handle.setProperty("JetContainer", "AntiKt4EMPFlowJets") );
119120
if ( m_dofJVTCut ) {
120121
ANA_CHECK(m_metmaker_handle.setProperty("JetRejectionDec", m_fJVTdecorName));
121122
}
@@ -145,6 +146,14 @@ EL::StatusCode METConstructor :: initialize ()
145146
if ( m_calculateSignificance ) {
146147
ANA_CHECK( m_metSignificance_handle.setProperty("TreatPUJets", m_significanceTreatPUJets) );
147148
ANA_CHECK( m_metSignificance_handle.setProperty("SoftTermReso", m_significanceSoftTermReso) );
149+
ANA_CHECK( m_metSignificance_handle.setProperty("EgammaESModel", m_significanceESModel) );
150+
ANA_CHECK( m_metSignificance_handle.setProperty("EgammaDecorrelationModel", "1NP_v1") );
151+
// This is the only recommended set of jet resolutions for use with R22+ MET Significance until "Consolidated" recommendations are available
152+
ANA_CHECK( m_metSignificance_handle.setProperty("JetCalibConfig", "JES_data2017_2016_2015_Recommendation_PFlow_Aug2018_rel21.config") );
153+
ANA_CHECK( m_metSignificance_handle.setProperty("JetCalibSequence", "JetArea_Residual_EtaJES_GSC_Smear") );
154+
ATH_CHECK( m_metSignificance_handle.setProperty("JetCalibArea", "00-04-81") );
155+
156+
ANA_CHECK( m_metSignificance_handle.setProperty("MuonCalibMode", m_significanceMuonCalibMode) );
148157

149158
// For AFII samples
150159
if ( isFastSim() ){

Root/MinixAOD.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ EL::StatusCode MinixAOD :: initialize ()
115115

116116
// always do this, obviously
117117
TFile *file_xAOD = wk()->getOutputFile(m_outputFileName);
118-
ANA_CHECK( m_event->writeTo(file_xAOD));
118+
ANA_CHECK( m_event->writeTo(*file_xAOD));
119119

120120
if(m_copyFileMetaData){
121121
m_fileMetaDataTool = new xAODMaker::FileMetaDataTool();
@@ -330,7 +330,7 @@ EL::StatusCode MinixAOD :: finalize () {
330330
//
331331
// Close file
332332
TFile *file_xAOD = wk()->getOutputFile(m_outputFileName);
333-
ANA_CHECK( m_event->finishWritingTo(file_xAOD));
333+
ANA_CHECK( m_event->finishWritingTo(*file_xAOD));
334334

335335
if(m_fileMetaDataTool) delete m_fileMetaDataTool;
336336
// if(m_trigMetaDataTool) delete m_trigMetaDataTool;

Root/TreeAlgo.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,6 +715,6 @@ EL::StatusCode TreeAlgo :: finalize () {
715715

716716
EL::StatusCode TreeAlgo :: histFinalize () { return EL::StatusCode::SUCCESS; }
717717

718-
HelpTreeBase* TreeAlgo :: createTree(xAOD::TEvent *event, TTree* tree, TFile* file, const float units, bool debug, xAOD::TStore* store) {
718+
HelpTreeBase* TreeAlgo :: createTree(xAOD::Event *event, TTree* tree, TFile* file, const float units, bool debug, xAOD::TStore* store) {
719719
return new HelpTreeBase( event, tree, file, units, debug, store );
720720
}

Root/Writer.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ EL::StatusCode Writer :: initialize ()
9898

9999
// output xAOD
100100
TFile * file = wk()->getOutputFile (m_outputLabel.Data());
101-
ANA_CHECK( m_event->writeTo(file));
101+
ANA_CHECK( m_event->writeTo(*file));
102102

103103
//FIXME add this as well
104104
// Set which variables not to write out:
@@ -204,7 +204,7 @@ EL::StatusCode Writer :: finalize ()
204204

205205
// finalize and close our output xAOD file ( and write MetaData tree )
206206
TFile * file = wk()->getOutputFile(m_outputLabel.Data());
207-
ANA_CHECK( m_event->finishWritingTo( file ));
207+
ANA_CHECK( m_event->finishWritingTo( *file ));
208208

209209
return EL::StatusCode::SUCCESS;
210210
}

scripts/xAH_run.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -453,17 +453,6 @@ def __call__(self, parser, namespace, values, option_string=None):
453453
job.options().setDouble(ROOT.EL.Job.optXAODPerfStats, 1)
454454
job.options().setDouble(ROOT.EL.Job.optPrintPerFileStats, 1)
455455

456-
# access mode branch
457-
if args.access_mode == 'branch':
458-
xAH_logger.info("\tusing branch access mode: ROOT.EL.Job.optXaodAccessMode_branch")
459-
job.options().setString( ROOT.EL.Job.optXaodAccessMode, ROOT.EL.Job.optXaodAccessMode_branch )
460-
elif args.access_mode == 'athena':
461-
xAH_logger.info("\tusing branch access mode: ROOT.EL.Job.optXaodAccessMode_athena")
462-
job.options().setString (ROOT.EL.Job.optXaodAccessMode, ROOT.EL.Job.optXaodAccessMode_athena)
463-
else:
464-
xAH_logger.info("\tusing class access mode: ROOT.EL.Job.optXaodAccessMode_class")
465-
job.options().setString( ROOT.EL.Job.optXaodAccessMode, ROOT.EL.Job.optXaodAccessMode_class )
466-
467456
# formatted string
468457
algorithmConfiguration_string = []
469458

0 commit comments

Comments
 (0)