Skip to content
Open

Jecs #110

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
10d9674
new update for 2018 and 2017
GuillelmoGomezCeballos Dec 13, 2018
c832ae9
fixing an issue with puppimet
GuillelmoGomezCeballos Dec 15, 2018
86c7336
Merge remote-tracking branch 'sid/master'
GuillelmoGomezCeballos Dec 15, 2018
31d4d7f
Merge remote-tracking branch 'sid/master'
GuillelmoGomezCeballos Jan 21, 2019
2741836
new xs
GuillelmoGomezCeballos Jan 25, 2019
65d46af
updated xs
GuillelmoGomezCeballos Jan 27, 2019
4d0fbec
2018 update
GuillelmoGomezCeballos Feb 14, 2019
905316c
jecs
dr-stringfellow Mar 6, 2019
9ac1e6e
jecs
dr-stringfellow Mar 6, 2019
8d66dac
jecs
dr-stringfellow Mar 6, 2019
36c9463
jec update and 2018 inputs
GuillelmoGomezCeballos Mar 7, 2019
c9db2bf
jec update and 2018 inputs
GuillelmoGomezCeballos Mar 7, 2019
16fc7aa
merging
GuillelmoGomezCeballos Mar 7, 2019
d74438c
improved leptonic macro
GuillelmoGomezCeballos Mar 7, 2019
9c89ff4
jecs
dr-stringfellow Mar 11, 2019
b6737c9
jec bug fixed
GuillelmoGomezCeballos Mar 12, 2019
ed427c7
new processes
GuillelmoGomezCeballos Mar 20, 2019
75a5067
new 2018 json
GuillelmoGomezCeballos Mar 21, 2019
1cc6b6f
Merge pull request #2 from GuillelmoGomezCeballos/master
dr-stringfellow Apr 4, 2019
b6b8c10
added new analysis for 2016
GuillelmoGomezCeballos Apr 5, 2019
e6e754e
added new analysis for 2016
GuillelmoGomezCeballos Apr 5, 2019
df7a10f
added new analysis for 2016
GuillelmoGomezCeballos Apr 5, 2019
4b46767
added new analysis for 2016
GuillelmoGomezCeballos Apr 5, 2019
06da7c7
t remote add bmaier https://github.com/PandaPhysics/PandaAnalysis.git
GuillelmoGomezCeballos Apr 8, 2019
6fe7fd9
updates for new jec and better submission handling for leptonic analyses
GuillelmoGomezCeballos Apr 8, 2019
aa90650
new
GuillelmoGomezCeballos Apr 8, 2019
13daab3
Merge pull request #4 from GuillelmoGomezCeballos/master
dr-stringfellow Apr 8, 2019
3a593f5
Update BTagOps.cc
dr-stringfellow Apr 8, 2019
ff050f6
Update JetsOps.cc
dr-stringfellow Apr 8, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Deep/python/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Automatically created by SCRAM
import os
__path__.append(os.path.dirname(os.path.abspath(__file__).rsplit('/PandaAnalysis/Deep/',1)[0])+'/cfipython/slc6_amd64_gcc630/PandaAnalysis/Deep')
__path__.append(os.path.dirname(os.path.abspath(__file__).rsplit('/PandaAnalysis/Deep/',1)[0])+'/cfipython/slc6_amd64_gcc700/PandaAnalysis/Deep')
68 changes: 7 additions & 61 deletions Flat/bin/generateTreeClass.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
#!/usr/bin/env python

from sys import argv,exit
from os import path
from os import system, path
from re import sub, match
import argparse
import copy

from PandaCore.Tools.script import *

parser = argparse.ArgumentParser(description='build object from configuration')
parser.add_argument('--cfg',type=str)
parser.add_argument('--clean',action='store_true')
args = parser.parse_args()


Expand Down Expand Up @@ -210,38 +207,6 @@ def write_write(self):
)
final_s.append(s)
return final_s
def write_read(self):
final_s = []
if self.shift:
if self.array:
for i,e in enumerate(self.shift.expr):
s = 'Bind("{n}{v}",{n}[{i}]);'.format(
n=self.name,
v=e,
i=i,
)
final_s.append(s)
else:
for i,e in enumerate(self.shift.expr):
s = 'Bind("{n}{v}",&({n}[{i}]));'.format(
n=self.name,
v=e,
i=i,
)
final_s.append(s)
else:
if self.array:
s = 'Bind("{n}",{n});'.format(
n=self.name,
)
final_s.append(s)
else:
s = 'Bind("{n}",&{n});'.format(
n=self.name,
)
final_s.append(s)
return final_s


def extract_custom(lines):
custom = {}
Expand All @@ -266,18 +231,18 @@ def get_custom(d, n):
cfg_path = args.cfg
header_path = cfg_path.replace('config','interface').replace('.cfg','.h')
src_path = cfg_path.replace('config','src').replace('.cfg','.cc')
if not path.isfile(header_path) or args.clean:
if not path.isfile(header_path):
tmpl_path = '/'.join(header_path.split('/')[:-2])
tmpl_path += ('bin/treeClassTmpl.h' if len(tmpl_path) == 0 else '/bin/treeClassTmpl.h')
do('cp -v %s %s'%(tmpl_path, header_path))
if not path.isfile(src_path) or args.clean:
system('cp -v %s %s'%(tmpl_path, header_path))
if not path.isfile(src_path):
tmpl_path = '/'.join(src_path.split('/')[:-2])
tmpl_path += ('bin/treeClassTmpl.cc' if len(tmpl_path) == 0 else '/bin/treeClassTmpl.cc')
do('cp -v %s %s'%(tmpl_path, src_path))
system('cp -v %s %s'%(tmpl_path, src_path))
class_name = cfg_path.split('/')[-1].replace('.cfg','')

for p in [header_path, src_path]:
do('cp -v {0} {0}.bkp'.format(p))
system('cp -v {0} {0}.bkp'.format(p))

# first let's parse the cfg file
fcfg = open(cfg_path)
Expand Down Expand Up @@ -323,9 +288,8 @@ def get_custom(d, n):
' {n}();',
' ~{n}();',
' void WriteTree(TTree* t);',
' void ReadTree(TTree* t);',
' void Fill() {{ treePtr->Fill(); }}',
' void Reset();',
' void Reset();'
' void SetAuxTree(TTree*);'
])).format(n=class_name))
header_out.extend(get_custom(custom, 'PUBLIC'))
Expand Down Expand Up @@ -428,24 +392,6 @@ def get_custom(d, n):
for i,c in enumerate(cond):
src_out.append(' ' + (' ' * (len(cond) - i - 1)) + '}')
src_out.append('}')

src_out.extend(['void {n}::ReadTree(TTree *t) {{'.format(n=class_name),
' treePtr = t;',
' treePtr->SetBranchStatus("*",0);'])
src_out.extend(get_custom(custom, 'READ'))
for b in branches:
if not b.filled:
src_out.extend([' ' + x for x in b.write_read()])
for cond,bs in by_filled.iteritems():
for i,c in enumerate(cond):
src_out.append(' ' + (' ' * i) + 'if (%s) {'%str(c))
for b in bs:
src_out.extend([' ' + (' ' * i) + x for x in b.write_read()])
for i,c in enumerate(cond):
src_out.append(' ' + (' ' * (len(cond) - i - 1)) + '}')
src_out.append('}')


with open(src_path,'w') as fout:
fout.write('\n'.join(src_out))

Expand Down
5 changes: 0 additions & 5 deletions Flat/bin/treeClassTmpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,3 @@ void treeClassTmpl::WriteTree(TTree *t) {
// STARTCUSTOM WRITE
// ENDCUSTOM
}
void treeClassTmpl::ReadTree(TTree *t) {
treePtr = t;
// STARTCUSTOM READ
// ENDCUSTOM
}
1 change: 0 additions & 1 deletion Flat/bin/treeClassTmpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class treeClassTmpl : public genericTree {
treeClassTmpl();
~treeClassTmpl();
void WriteTree(TTree* t);
void ReadTree(TTree* t);
void Fill() { treePtr->Fill(); }
void Reset();
void SetAuxTree(TTree*);
Expand Down
14 changes: 6 additions & 8 deletions Flat/config/GeneralTree.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,10 @@ block:filled=cond:vt
jetIsIso int[2]
endblock
block:filled=cond:hbb
block:tree_size=cond:njot
jotDeepBReg float[const:NJET] default=1
jotDeepBRegWidth float[const:NJET] default=0
jotDeepBRegSampled float[const:NJET] default=1
endblock
jotBReg float[2]
jotDeepBReg float[2]
jotDeepBRegWidth float[2]
jotDeepBRegSampled float[2]
adjetPt float default=-1
adjetCMVA float default=-2
zvvhClass float default=-1
Expand All @@ -193,8 +192,6 @@ block:tree_size=cond:njot
block:shifts=shift:jes
jotPt float[const:NJET]
endblock
jotE float[const:NJET]
jotRawPt float[const:NJET]
jotEta float[const:NJET]
jotPhi float[const:NJET]
jotCSV float[const:NJET]
Expand Down Expand Up @@ -241,6 +238,7 @@ block:tree_size=cond:njot
jotGenM float[const:NJET]
jotNPt03 int[const:NJET]
jotPtD float[const:NJET]
jotRawPt float[const:NJET]
jotRawMt float[const:NJET]
jotRawEt float[const:NJET]
jotRawM float[const:NJET]
Expand Down Expand Up @@ -453,7 +451,7 @@ mT float shifts=shift:jes[2]

# hbb kinematics
block:filled=cond:hbb
hbbjtidx int[2] default=-1 shifts=shift:jes
hbbjtidx int[2] shifts=shift:jes
hbbpt float shifts=shift:jes
hbbeta float shifts=shift:jes
hbbphi float shifts=shift:jes
Expand Down
33 changes: 0 additions & 33 deletions Flat/config/JetGraphTree.cfg

This file was deleted.

29 changes: 0 additions & 29 deletions Flat/interface/CTAnalyzer.h

This file was deleted.

14 changes: 2 additions & 12 deletions Flat/interface/CommonOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,26 +127,16 @@ namespace pa {
Utils& utils_,
GeneralTree& gt_,
int level_=0) :
AnalysisOp("global", event_, cfg_, utils_, gt_, level_),
jesShifts(std::v_make_shared<JESHandler>(jes2i(shiftjes::N))) {
JESLOOP {
(*jesShifts)[shift].shift_idx = shift;
}
}
AnalysisOp("global", event_, cfg_, utils_, gt_, level_) { }

virtual ~GlobalOp () { }

protected:
void do_init(Registry& registry) {
registry.publish("jesShifts", jesShifts);
auto dummy = registry.access<std::vector<JESHandler>>("jesShifts");
}
void do_execute();
void do_reset() {
for (auto& s : *jesShifts)
s.clear();
}
private:
std::shared_ptr<std::vector<JESHandler>> jesShifts;
};

template <typename T>
Expand Down
90 changes: 0 additions & 90 deletions Flat/interface/CommonTopOp.h

This file was deleted.

4 changes: 1 addition & 3 deletions Flat/interface/DeepOps.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
#define DEEPOPS

#include "Operator.h"
#include <set>
#include "JetGraphTree.h"
#include "set"
#include "PandaAnalysis/Utilities/interface/EnergyCorrelations.h"
#include "fastjet/contrib/Njettiness.hh"
#include "PhysicsTools/TensorFlow/interface/TensorFlow.h"
Expand Down Expand Up @@ -202,7 +201,6 @@ namespace pa {
std::unique_ptr<float[]> bjetreg_vars;
};


}


Expand Down
Loading