Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 3 additions & 2 deletions MC/prodinfo/mcprodinfo_ccdb_upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ def upload_mcprodinfo_meta(base_url, user, run_number, lpm_prod_tag, keys, cert_

return response

def publish_MCProdInfo(mc_prod_info, ccdb_url = "https://alice-ccdb.cern.ch", username = "aliprod", include_meta_into_aod=False):
def publish_MCProdInfo(mc_prod_info, ccdb_url = "https://alice-ccdb.cern.ch", username = "aliprod", force_overwrite=False, include_meta_into_aod=False):
print("Publishing MCProdInfo")

# see if this already has meta-data uploaded, otherwise do nothing
mc_prod_info_q = query_mcprodinfo(ccdb_url, username, mc_prod_info.RunNumber, mc_prod_info.LPMProductionTag)
if mc_prod_info_q == None:
if mc_prod_info_q == None or force_overwrite == True:
# could make this depend on hash values in future
upload_mcprodinfo_meta(ccdb_url, username, mc_prod_info.RunNumber, mc_prod_info.LPMProductionTag, dataclasses.asdict(mc_prod_info))

7 changes: 4 additions & 3 deletions MC/prodinfo/mcprodinfo_harvester.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def split_key(entry):
return None, None, None, None


def process_prod_tag(prod_tag, year="2025", ccdb_url=None, username=None):
def process_prod_tag(prod_tag, year="2025", ccdb_url=None, username=None, overwrite=False):
base_path = f"/alice/sim/{year}/{prod_tag}"

workflow_files = alien_find(base_path, "workflow.json")
Expand Down Expand Up @@ -184,7 +184,7 @@ def process_prod_tag(prod_tag, year="2025", ccdb_url=None, username=None):
if info_min.OrbitsPerTF != info_max.OrbitsPerTF:
print(f"❌ OrbitsPerTF mismatch for run {run_number}")

publish_MCProdInfo(info_min, username=username, ccdb_url=ccdb_url)
publish_MCProdInfo(info_min, username=username, ccdb_url=ccdb_url, force_overwrite=overwrite)
print (info_min)


Expand All @@ -196,9 +196,10 @@ def main():
parser.add_argument("--ccdb", required=False, default="https://alice-ccdb.cern.ch", help="CCDB server URL")
parser.add_argument("--username", required=False, help="GRID username (needs appropriate AliEn token initialized)")
parser.add_argument("--year", default="2025", help="Production year (default: 2025)")
parser.add_argument("--overwrite", action="store_true", help="Overwrite existing entries")
args = parser.parse_args()

process_prod_tag(args.prod_tag, year=args.year, ccdb_url=args.ccdb, username=args.username)
process_prod_tag(args.prod_tag, year=args.year, ccdb_url=args.ccdb, username=args.username, overwrite=args.overwrite)

if __name__ == "__main__":
main()