CMS 3D CMS Logo

Functions | Variables
PDRates Namespace Reference

Functions

def PrimaryDatasets (Run)
 
def RateInPD (Run, PrimaryDataset, lsMin, lsMax, printLS=False)
 

Variables

 action
 
 args
 
 average
 
 Datasets
 
 default
 
 dest
 
 False
 
 help
 
 lsMax
 
 lsMin
 
 metavar
 
 nLS_within_range
 
 options
 
 parser
 
 PrimaryDataset
 
 RatePerLS
 
 RatesTmp
 
 Run
 
 st_title
 
 TempFile
 
 type
 
 usage
 

Function Documentation

◆ PrimaryDatasets()

def PDRates.PrimaryDatasets (   Run)

Definition at line 31 of file PDRates.py.

31 def PrimaryDatasets(Run):
32  # -- List of Primary Datasets:
33 
34  dbs_cmd = """ dbs search --query='find primds.name
35  where run=%d and dataset like */RAW' """ % (Run)
36  rows = commands.getoutput(dbs_cmd)
37  lines = rows.split("\n")
38  j=0
39  print("\nThe primary datasets for this run are: \n")
40  for Line in lines:
41  j=j+1
42  if j <=4:
43  continue
44  print(Line)
45  line=Line.split()
46  Datasets.append(line[0])
47  print(" ")
48 
49 
50 

References print().

◆ RateInPD()

def PDRates.RateInPD (   Run,
  PrimaryDataset,
  lsMin,
  lsMax,
  printLS = False 
)

Definition at line 51 of file PDRates.py.

51 def RateInPD(Run,PrimaryDataset,lsMin,lsMax,printLS=False):
52  dbs_cmd = """ dbs search --query='find file,lumi,file.numevents, file.size
53  where run=%d and dataset like /%s/*/RAW
54  and lumi >= %d and lumi <= %d
55  and file.status=VALID '""" % (Run, PrimaryDataset,lsMin, lsMax)
56  rows = commands.getoutput(dbs_cmd)
57  lines = rows.split("\n")
58  j=0
59  LumiSections = []
60  Files = []
61  Evts = 0
62  Size = 0
63  LSinFile = {}
64  NumberOfLSInFile = {}
65  for Line in lines:
66  j=j+1
67  if j <=4:
68  continue
69  line=Line.split()
70  LS = line[1]
71  file = line[0]
72  Nevts = int(line[2])
73  size = int(line[3])
74  LSinFile[LS] = file
75  if LumiSections.count(LS) == 0:
76  LumiSections.append(LS)
77  if Files.count(file) == 0:
78  Files.append(file)
79  Evts += Nevts
80  Size += size
81  NumberOfLSInFile[file] =1
82  else:
83  NumberOfLSInFile[file] = NumberOfLSInFile[file]+1
84  RatePerLS[LS] = Nevts
85 
86  Number_of_LS = len(LumiSections)
87  LS_Length = 23.3
88  if Run < 125100:
89  LS_Length = 93.3
90  rate = Evts / (Number_of_LS * LS_Length)
91  if Evts > 0:
92  size_per_event = (Size / Evts) / 1000.
93  else:
94  size_per_event=-1
95  print("Rate in \t",PrimaryDataset,"\t is : \t",rate," Hz", " \t size is : \t",size_per_event, "kB / event ")
96 
97  lsmin=9999999
98  lsmax=-1
99  for (LS,file) in six.iteritems(LSinFile):
100  nls = NumberOfLSInFile[file]
101  RatePerLS[LS] = RatePerLS[LS] / nls
102  RatePerLS[LS] = RatePerLS[LS] / LS_Length
103  if int(LS) > lsmax:
104  lsmax=int(LS)
105  if int(LS) < lsmin:
106  lsmin=int(LS)
107  if printLS:
108  print("lsmin lsmax",lsmin,lsmax)
109  for ls in range(lsmin,lsmax):
110  if not repr(ls) in RatePerLS.keys():
111  RatePerLS[LS] = 0
112  print("Missing LS ",ls)
113 
114 

References beamvalidation.exit(), createfilelist.int, print(), and FastTimerService_cff.range.

Variable Documentation

◆ action

PDRates.action

Definition at line 25 of file PDRates.py.

◆ args

PDRates.args

Definition at line 28 of file PDRates.py.

◆ average

PDRates.average

◆ Datasets

PDRates.Datasets

Definition at line 179 of file PDRates.py.

◆ default

PDRates.default

Definition at line 25 of file PDRates.py.

◆ dest

PDRates.dest

Definition at line 23 of file PDRates.py.

◆ False

PDRates.False

Definition at line 25 of file PDRates.py.

◆ help

PDRates.help

Definition at line 23 of file PDRates.py.

◆ lsMax

PDRates.lsMax

Definition at line 122 of file PDRates.py.

◆ lsMin

PDRates.lsMin

Definition at line 121 of file PDRates.py.

◆ metavar

PDRates.metavar

Definition at line 23 of file PDRates.py.

◆ nLS_within_range

PDRates.nLS_within_range

Definition at line 140 of file PDRates.py.

◆ options

PDRates.options

Definition at line 28 of file PDRates.py.

◆ parser

PDRates.parser

Definition at line 22 of file PDRates.py.

◆ PrimaryDataset

PDRates.PrimaryDataset

Definition at line 134 of file PDRates.py.

◆ RatePerLS

PDRates.RatePerLS

Definition at line 135 of file PDRates.py.

◆ RatesTmp

PDRates.RatesTmp

Definition at line 142 of file PDRates.py.

◆ Run

PDRates.Run

Definition at line 133 of file PDRates.py.

◆ st_title

PDRates.st_title

Definition at line 161 of file PDRates.py.

◆ TempFile

PDRates.TempFile

Definition at line 155 of file PDRates.py.

◆ type

PDRates.type

Definition at line 23 of file PDRates.py.

◆ usage

PDRates.usage

Definition at line 22 of file PDRates.py.

FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
print
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:46
createfilelist.int
int
Definition: createfilelist.py:10
PDRates.PrimaryDatasets
def PrimaryDatasets(Run)
Definition: PDRates.py:31
PDRates.RateInPD
def RateInPD(Run, PrimaryDataset, lsMin, lsMax, printLS=False)
Definition: PDRates.py:51