Skip to content
Snippets Groups Projects
Commit ed8e89e4 authored by Mintu Kumar's avatar Mintu Kumar
Browse files

cosmatic chages

parent 7feb3792
No related branches found
No related tags found
1 merge request!278B weigth normalization for central and systematic variation
Pipeline #8260297 passed
...@@ -21,7 +21,7 @@ def Get_WeightSum_Btag(source_paths,logger): ...@@ -21,7 +21,7 @@ def Get_WeightSum_Btag(source_paths,logger):
del dataset_check_fields del dataset_check_fields
if (flag_bWeight_sys): if (flag_bWeight_sys):
logger.info( logger.info(
"Attampeting Extracting sum of central weights and bweight systematics from metadata of files to be merged for "+source_paths f"Attampeting Extracting sum of central weights and bweight systematics from metadata of files to be merged from {source_path}"
) )
else: else:
logger.warn( logger.warn(
......
...@@ -222,10 +222,7 @@ for i, source_path in enumerate(source_paths): ...@@ -222,10 +222,7 @@ for i, source_path in enumerate(source_paths):
syst_weight_fields = [field for field in dataset_arr.fields if (("weight_" in field) and ("Up" in field or "Down" in field))] syst_weight_fields = [field for field in dataset_arr.fields if (("weight_" in field) and ("Up" in field or "Down" in field))]
for weight_field in ["weight"] + syst_weight_fields: for weight_field in ["weight"] + syst_weight_fields:
dataset_arr[weight_field] = dataset_arr[weight_field] / sum_genw_beforesel_arr[i] dataset_arr[weight_field] = dataset_arr[weight_field] / sum_genw_beforesel_arr[i]
print( WeightSum_postBTag_sys_arr[i]["sum_weight_bTagSF_lfstats1Up"])
print(f'{dataset_arr["weight"] = }')
dataset_arr = Renormalize_BTag_Weights(dataset_arr,target_paths[i],cat,WeightSum_preBTag_arr[i],WeightSum_postBTag_arr[i],WeightSum_postBTag_sys_arr[i],IsBtagNorm_sys_arr[i],logger) dataset_arr = Renormalize_BTag_Weights(dataset_arr,target_paths[i],cat,WeightSum_preBTag_arr[i],WeightSum_postBTag_arr[i],WeightSum_postBTag_sys_arr[i],IsBtagNorm_sys_arr[i],logger)
print(f'{dataset_arr["weight"] = }')
awkward.to_parquet(dataset_arr, target_paths[i] + cat + "_merged.parquet") awkward.to_parquet(dataset_arr, target_paths[i] + cat + "_merged.parquet")
logger.info( logger.info(
"Successfully added normalised weight column to dataset" "Successfully added normalised weight column to dataset"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment