SND@LHC Software
Loading...
Searching...
No Matches
makeRunListDB Namespace Reference

Variables

 parser
 
 type
 
 str
 
 help
 
 required
 
 nargs
 
 int
 
 default
 
 float
 
 args = parser.parse_args()
 
 client = pymongo.MongoClient("sndrundb.cern.ch")
 
 db = client.sndrundb
 
list pipeline = []
 
dict run_length_expr = {"$dateDiff": {"startDate": "$start", "endDate": "$stop", "unit": "minute"}}
 
dict projection
 
 result = list(db["EcsData"].aggregate(pipeline))
 
list include_pipeline = []
 
 include_result = list(db["EcsData"].aggregate(include_pipeline))
 
 key
 
 now = datetime.now()
 
 root = ET.Element("runlist")
 
 meta_data = ET.SubElement(root, "meta")
 
 text
 
 selection = ET.SubElement(meta_data, "selection")
 
 runs = ET.SubElement(root, "runs")
 
int n_runs = 0
 
 totals = defaultdict(int)
 
 this_run = ET.SubElement(runs, "run")
 
 data = run[field_name]
 
 stats = ET.SubElement(meta_data, "statistics")
 
 tree = ET.ElementTree(root)
 
 space
 
 encoding
 
 xml_declaration
 

Variable Documentation

◆ args

makeRunListDB.args = parser.parse_args()

Definition at line 24 of file makeRunListDB.py.

◆ client

makeRunListDB.client = pymongo.MongoClient("sndrundb.cern.ch")

Definition at line 26 of file makeRunListDB.py.

◆ data

makeRunListDB.data = run[field_name]

Definition at line 131 of file makeRunListDB.py.

◆ db

makeRunListDB.db = client.sndrundb

Definition at line 27 of file makeRunListDB.py.

◆ default

makeRunListDB.default

Definition at line 13 of file makeRunListDB.py.

◆ encoding

makeRunListDB.encoding

Definition at line 150 of file makeRunListDB.py.

◆ float

makeRunListDB.float

Definition at line 14 of file makeRunListDB.py.

◆ help

makeRunListDB.help

Definition at line 11 of file makeRunListDB.py.

◆ include_pipeline

list makeRunListDB.include_pipeline = []

Definition at line 96 of file makeRunListDB.py.

◆ include_result

makeRunListDB.include_result = list(db["EcsData"].aggregate(include_pipeline))

Definition at line 100 of file makeRunListDB.py.

◆ int

makeRunListDB.int

Definition at line 12 of file makeRunListDB.py.

◆ key

makeRunListDB.key

Definition at line 104 of file makeRunListDB.py.

◆ meta_data

makeRunListDB.meta_data = ET.SubElement(root, "meta")

Definition at line 112 of file makeRunListDB.py.

◆ n_runs

int makeRunListDB.n_runs = 0

Definition at line 122 of file makeRunListDB.py.

◆ nargs

makeRunListDB.nargs

Definition at line 12 of file makeRunListDB.py.

◆ now

makeRunListDB.now = datetime.now()

Definition at line 107 of file makeRunListDB.py.

◆ parser

makeRunListDB.parser
Initial value:
1= argparse.ArgumentParser(
2 prog="makeRunListDB",
3 description="Extracts a list of runs from the SND@LHC DB, matching the conditions given in the arguments. Produces an XML file with the run list and a summary of the selection.")

Definition at line 8 of file makeRunListDB.py.

◆ pipeline

list makeRunListDB.pipeline = []

Definition at line 29 of file makeRunListDB.py.

◆ projection

dict makeRunListDB.projection
Initial value:
1= {"$project":{"_id": 0, # Do not extract DB entry ID
2 "run_number": "$runNumber", # Run number
3 "n_events": "$events", # Number of events
4 "start": 1, # Start date
5 "end": 1, # End date
6 "duration": run_length_expr, # Run duration
7 "n_files": {"$size": "$files"}, # Number of files
8 "path": {"$first": "$files.file"}, # Path of the first file
9 "fill_number": "$fill", # Fill number
10 "fill_int_lumi": {"$first": "$LPC.ATLAS_Int_Lumi"}, # Integrated luminosity
11 "fill_stable_time" : {"$first": "$LPC.Stable_time"}} # Stable beams duration
12 }

Definition at line 78 of file makeRunListDB.py.

◆ required

makeRunListDB.required

Definition at line 11 of file makeRunListDB.py.

◆ result

makeRunListDB.result = list(db["EcsData"].aggregate(pipeline))

Definition at line 93 of file makeRunListDB.py.

◆ root

makeRunListDB.root = ET.Element("runlist")

Definition at line 110 of file makeRunListDB.py.

◆ run_length_expr

dict makeRunListDB.run_length_expr = {"$dateDiff": {"startDate": "$start", "endDate": "$stop", "unit": "minute"}}

Definition at line 75 of file makeRunListDB.py.

◆ runs

makeRunListDB.runs = ET.SubElement(root, "runs")

Definition at line 119 of file makeRunListDB.py.

◆ selection

makeRunListDB.selection = ET.SubElement(meta_data, "selection")

Definition at line 115 of file makeRunListDB.py.

◆ space

makeRunListDB.space

Definition at line 149 of file makeRunListDB.py.

◆ stats

makeRunListDB.stats = ET.SubElement(meta_data, "statistics")

Definition at line 143 of file makeRunListDB.py.

◆ str

makeRunListDB.str

Definition at line 11 of file makeRunListDB.py.

◆ text

makeRunListDB.text

Definition at line 113 of file makeRunListDB.py.

◆ this_run

makeRunListDB.this_run = ET.SubElement(runs, "run")

Definition at line 127 of file makeRunListDB.py.

◆ totals

makeRunListDB.totals = defaultdict(int)

Definition at line 123 of file makeRunListDB.py.

◆ tree

makeRunListDB.tree = ET.ElementTree(root)

Definition at line 148 of file makeRunListDB.py.

◆ type

makeRunListDB.type

Definition at line 11 of file makeRunListDB.py.

◆ xml_declaration

makeRunListDB.xml_declaration

Definition at line 150 of file makeRunListDB.py.