Skip to content

Commit 2b544a3

Browse files
committed
issue with gen variables
1 parent 4346724 commit 2b544a3

File tree

4 files changed

+31
-14
lines changed

4 files changed

+31
-14
lines changed

interface/EventWriterOperator.h

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ template <class EventClass> class EventWriterOperator : public BaseOperator<Even
1818
alp::EventInfo * eventInfo_ptr = nullptr;
1919

2020
std::vector<std::string> weights_;
21-
bool hasGen_ = true;
21+
bool hasGen_;
2222

2323
// variables to save in branches
2424
float_t evtWeight = 1.;
@@ -39,7 +39,10 @@ template <class EventClass> class EventWriterOperator : public BaseOperator<Even
3939

4040
EventWriterOperator(const std::string & config_s, const std::vector<std::string> & weights = {}) :
4141
config_(json::parse(config_s)),
42-
weights_(weights) {}
42+
weights_(weights) {
43+
if(config_s.find("isSignal")) hasGen_ = true;
44+
else hasGen_ = false;
45+
}
4346

4447
virtual ~EventWriterOperator() {}
4548

@@ -95,9 +98,6 @@ template <class EventClass> class EventWriterOperator : public BaseOperator<Even
9598
tree_.SetDirectory(tdir);
9699
tree_.AutoSave();
97100

98-
if(config_.at("isData" )) hasGen_ = false;
99-
if(config_.at("isMixed")) hasGen_ = false;
100-
101101
}
102102

103103

@@ -116,10 +116,8 @@ template <class EventClass> class EventWriterOperator : public BaseOperator<Even
116116
genhs_ptr = dynamic_cast<std::vector<alp::Candidate> *>(&ev.genhs_);
117117
tl_genhs_ptr = dynamic_cast<std::vector<alp::Candidate> *>(&ev.tl_genhs_);
118118

119-
if(hasGen_){
120-
ev.tl_genhh_.clear();
121-
ev.tl_genhh_.emplace_back(ev.tl_genhs_.at(0).p4_ , ev.tl_genhs_.at(1).p4_); // check if reasonable
122-
}
119+
ev.tl_genhh_.clear();
120+
//if(hasGen_) ev.tl_genhh_.emplace_back(ev.tl_genhs_.at(0).p4_ , ev.tl_genhs_.at(1).p4_); #FIXME
123121
tl_genhh_ptr = dynamic_cast<std::vector<alp::DiObject> *>(&ev.tl_genhh_);
124122
dijets_ptr = dynamic_cast<std::vector<alp::DiObject> *>(&ev.dijets_);
125123
dihiggs_ptr = dynamic_cast<std::vector<alp::DiObject> *>(&ev.dihiggs_);

python/alpSamples.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,20 @@
198198
'matcheff': 1.,
199199
'kfactor' : 1.,
200200
},
201+
'BTagCSVRun2016_BE' : {
202+
'sam_name': 'BTagCSVRun2016BE',
203+
'nevents' : 1,
204+
'xsec_br' : 1.,
205+
'matcheff': 1.,
206+
'kfactor' : 1.,
207+
},
208+
'BTagCSVRun2016_FH' : {
209+
'sam_name': 'BTagCSVRun2016FH',
210+
'nevents' : 1,
211+
'xsec_br' : 1.,
212+
'matcheff': 1.,
213+
'kfactor' : 1.,
214+
},
201215

202216
########## MC ##########
203217
### Signals
@@ -856,5 +870,6 @@
856870
'Data_BDT_28_11_16_15h_bkg' :{
857871
'sam_name': 'Data_BDT_28_11_16_15h_bkg',
858872
},
873+
859874
}
860875

python/samplelists.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
'signals' : ['HHTo4B_SM', 'HHTo4B_BM2','HHTo4B_BM3','HHTo4B_BM4','HHTo4B_BM5','HHTo4B_BM7','HHTo4B_BM8',
88
'HHTo4B_BM9','HHTo4B_BM10','HHTo4B_BM11','HHTo4B_BM12','HHTo4B_BM13','HHTo4B_BMbox','VBF_HHTo4B_SM'], #'HHTo4B_BM6',
99

10-
'data' : ['BTagCSVRun2016_'],
10+
'data' : ['BTagCSVRun2016'],
11+
'dataBE' : ['BTagCSVRun2016_BE'],
12+
'dataFH' : ['BTagCSVRun2016_FH'],
1113
'data_ichep' : ['BTagCSVRun2016B-v1','BTagCSVRun2016B-v2','BTagCSVRun2016C-v2','BTagCSVRun2016D-v2'], #12.6 fb-1
1214
'data_singleMu' : ['SingleMuonRun2016B-v1', 'SingleMuonRun2016B-v2', 'SingleMuonRun2016C-v2', 'SingleMuonRun2016D-v2'],
1315
'data_moriond' : ['BTagCSVRun2016B-23Sep2016-v2', 'BTagCSVRun2016B-23Sep2016-v3', 'BTagCSVRun2016C-23Sep2016-v1',
@@ -81,6 +83,6 @@
8183

8284
## for testing
8385
'short' : ['QCD_HT300to500_BGenFilter', 'QCD_HT500to700_BGenFilter', 'QCD_HT700to1000_BGenFilter'],
84-
'test' : ['BTagCSVRun2016'], #'QCD_HT200to300''SingleMuonRun2016B-v2'SingleMuonRun2016B-v2
86+
'test' : ['BTagCSVRun2016_'], #'QCD_HT200to300''SingleMuonRun2016B-v2'SingleMuonRun2016B-v2
8587

8688
}

scripts/BaselineSelector.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
parser.add_argument("-t", "--doTrigger", help="apply trigger filter", action='store_true')
3232
parser.add_argument("--jetCorr", help="apply [0=jesUp, 1=jesDown, 2=jerUp, 3=jerDown]", type=int, default='-1')
3333
parser.add_argument("--btag", help="which btag algo", default='cmva')
34-
parser.add_argument("-i", "--iDir", help="input directory", default="v2_20170202") # _noJetCut
34+
parser.add_argument("-i", "--iDir", help="input directory", default="v2_20170210")
3535
parser.add_argument("-o", "--oDir", help="output directory", default="def_cmva")
3636
parser.add_argument("-m", "--doMixed", help="to process mixed samples", action='store_true')
3737
parser.add_argument("-f", "--no_savePlots", help="to save histos already in output file", action='store_false', dest='savePlots', ) #to get faster execution
@@ -44,7 +44,7 @@
4444
if not args.samList: samList = ['test'] # list of samples to be processed - append multiple lists
4545
else: samList = [args.samList]
4646
trgList = 'def_2016'
47-
intLumi_fb = 36.26
47+
intLumi_fb = 35.9
4848

4949
if args.doMixed: iDir = "/lustre/cmswork/hh/alp_moriond_base/" + args.iDir
5050
else: iDir = "/lustre/cmswork/hh/alpha_ntuples/" + args.iDir
@@ -100,7 +100,8 @@
100100
"xsec_br" : 0,
101101
"matcheff": 0,
102102
"kfactor" : 0,
103-
"isData" : False,
103+
"isData" : False,
104+
"isSignal" : False,
104105
"lumiFb" : intLumi_fb,
105106
"isMixed" : args.doMixed,
106107
} )
@@ -126,6 +127,7 @@
126127
continue
127128
else:
128129
if "Run" in files[0]: config["isData"] = True
130+
if "GluGluToHH" in files[0] or "HH4B" in files[0]: config["isSignal"] = True
129131

130132
#read counters to get generated eventsbj (from alpha ntuple only)
131133
if not args.doMixed:

0 commit comments

Comments
 (0)