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 30 of file PDRates.py.

References print().

30 def PrimaryDatasets(Run):
31  # -- List of Primary Datasets:
32 
33  dbs_cmd = """ dbs search --query='find primds.name
34  where run=%d and dataset like */RAW' """ % (Run)
35  rows = subprocess.getoutput(dbs_cmd)
36  lines = rows.split("\n")
37  j=0
38  print("\nThe primary datasets for this run are: \n")
39  for Line in lines:
40  j=j+1
41  if j <=4:
42  continue
43  print(Line)
44  line=Line.split()
45  Datasets.append(line[0])
46  print(" ")
47 
48 
49 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def PrimaryDatasets(Run)
Definition: PDRates.py:30

◆ RateInPD()

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

Definition at line 50 of file PDRates.py.

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

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

Variable Documentation

◆ action

PDRates.action

Definition at line 24 of file PDRates.py.

◆ args

PDRates.args

Definition at line 27 of file PDRates.py.

◆ average

PDRates.average

◆ Datasets

PDRates.Datasets

Definition at line 178 of file PDRates.py.

◆ default

PDRates.default

Definition at line 24 of file PDRates.py.

◆ dest

PDRates.dest

Definition at line 22 of file PDRates.py.

◆ False

PDRates.False

Definition at line 24 of file PDRates.py.

◆ help

PDRates.help

Definition at line 22 of file PDRates.py.

◆ lsMax

PDRates.lsMax

Definition at line 121 of file PDRates.py.

◆ lsMin

PDRates.lsMin

Definition at line 120 of file PDRates.py.

◆ metavar

PDRates.metavar

Definition at line 22 of file PDRates.py.

◆ nLS_within_range

PDRates.nLS_within_range

Definition at line 139 of file PDRates.py.

◆ options

PDRates.options

Definition at line 27 of file PDRates.py.

◆ parser

PDRates.parser

Definition at line 21 of file PDRates.py.

◆ PrimaryDataset

PDRates.PrimaryDataset

Definition at line 133 of file PDRates.py.

◆ RatePerLS

PDRates.RatePerLS

Definition at line 134 of file PDRates.py.

◆ RatesTmp

PDRates.RatesTmp

Definition at line 141 of file PDRates.py.

◆ Run

PDRates.Run

Definition at line 132 of file PDRates.py.

◆ st_title

PDRates.st_title

Definition at line 160 of file PDRates.py.

◆ TempFile

PDRates.TempFile

Definition at line 154 of file PDRates.py.

◆ type

PDRates.type

Definition at line 22 of file PDRates.py.

◆ usage

PDRates.usage

Definition at line 21 of file PDRates.py.