17from DataQualityUtils
import pathExtract
18from xmlrpc
import client
as xmlrpclib
20from ROOT
import TChain
21from ROOT
import gStyle
24gStyle.SetOptStat(
"em")
28parser = argparse.ArgumentParser()
29parser.add_argument(
'-r',
'--run',type=int,dest=
'runNumber',default=
'267599',help=
"Run number",action=
'store')
30parser.add_argument(
'-s',
'--stream',dest=
'stream',default=
'express',help=
"Stream without prefix: express, CosmicCalo, Egamma...",action=
'store')
31parser.add_argument(
'-t',
'--tag',dest=
'tag',default=
'',help=
"DAQ tag: data12_8TeV, data12_calocomm...By default retrieve it via atlasdqm",action=
'store')
32parser.add_argument(
'-a',
'--amiTag',dest=
'amiTag',default=
'x',help=
"First letter of AMI tag: x->express / f->bulk",action=
'store')
36args = parser.parse_args()
38runNumber = args.runNumber
43 if (
not os.path.isfile(
"atlasdqmpass.txt")):
44 print(
"To retrieve the data project tag, you need to generate an atlasdqm key and store it in this directory as atlasdqmpass.txt (yourname:key)")
45 print(
"To generate a kay, go here : https://atlasdqm.cern.ch/dqauth/")
46 print(
"You can also define by hand the data project tag wit hthe option -t")
48 passfile = open(
"atlasdqmpass.txt")
49 passwd = passfile.read().
strip(); passfile.close()
50 passurl =
'https://%s@atlasdqm.cern.ch'%passwd
51 s = xmlrpclib.ServerProxy(passurl)
52 run_spec = {
'stream':
'physics_CosmicCalo',
'proc_ver': 1,
'source':
'tier0',
'low_run': runNumber,
'high_run':runNumber}
53 run_info= s.get_run_information(run_spec)
54 if '%d'%runNumber
not in run_info.keys()
or len(run_info[
'%d'%runNumber])<2:
55 print(
"Unable to retrieve the data project tag via atlasdqm... Please double check your atlasdqmpass.txt or define it by hand with -t option")
57 tag = run_info[
'%d'%runNumber][1]
61listOfFiles = pathExtract.returnEosLArNoisePath(runNumber,stream,amiTag,tag)
63tree = TChain(
"CollectionTree")
66for fileNames
in listOfFiles:
67 print(
"Adding %s"%(fileNames))
68 tree.AddFile(
"root://eosatlas/%s"%(fileNames))
70entries = tree.GetEntries()
72 print(
"The chained tree contains %d entries"%(entries))
74 print(
"Empty chain...")
void print(char *figname, TCanvas *c1)