test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
PDRates Namespace Reference

Functions

def PrimaryDatasets
 
def RateInPD
 

Variables

int average = 0
 
list Datasets = []
 
int lsMax = 999999
 
int lsMin = -1
 
int nLS_within_range = 0
 
tuple parser = OptionParser(usage="Example: ./PDRates.py --runNumber 146644 --PD Mu --perLS")
 
 PrimaryDataset = options.PrimaryDataset
 
dictionary RatePerLS = {}
 
tuple RatesTmp = open("rates_tmp.txt","w")
 
 Run = options.RunNumber
 
string st_title = " \"Rates in PrimaryDataset "
 
tuple TempFile = open("tmp.gnuplot.txt","w")
 

Function Documentation

def PDRates.PrimaryDatasets (   Run)

Definition at line 29 of file PDRates.py.

29 
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 = commands.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 
def PrimaryDatasets
Definition: PDRates.py:29
def PDRates.RateInPD (   Run,
  PrimaryDataset,
  lsMin,
  lsMax,
  printLS = False 
)

Definition at line 49 of file PDRates.py.

References cmsRelvalreport.exit.

49 
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 = commands.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.iteritems():
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 
def RateInPD
Definition: PDRates.py:49

Variable Documentation

int PDRates.average = 0

Definition at line 137 of file PDRates.py.

Referenced by TPedValues.checkEntries(), Cluster1DCleaner< T >.cleanCluster1Ds(), pixeltemp::Cluster1DCleaner< T >.cleanCluster1Ds(), PFClient_JetRes.createResolutionPlots(), PFClient.createResolutionPlots(), DTTTrigCorrectionFirst.endJob(), SiStripCommissioningSource.fillCablingHistos(), FastTimerServiceClient.fillPathSummaryPlots(), ThroughputServiceClient.fillSummaryPlots(), LASProfileJudge.IsNegativePeaksInProfile(), LASProfileJudge.IsPeaksInProfile(), SMS.location(), TPedValues.makePlots(), NoisyChannel.runTest(), ContentsWithinExpected.runTest(), CompareLastFilledBin.setAverage(), and TPedValues.terminate().

list PDRates.Datasets = []

Definition at line 177 of file PDRates.py.

int PDRates.lsMax = 999999

Definition at line 120 of file PDRates.py.

int PDRates.lsMin = -1

Definition at line 119 of file PDRates.py.

int PDRates.nLS_within_range = 0

Definition at line 138 of file PDRates.py.

tuple PDRates.parser = OptionParser(usage="Example: ./PDRates.py --runNumber 146644 --PD Mu --perLS")

Definition at line 20 of file PDRates.py.

PDRates.PrimaryDataset = options.PrimaryDataset

Definition at line 132 of file PDRates.py.

dictionary PDRates.RatePerLS = {}

Definition at line 133 of file PDRates.py.

tuple PDRates.RatesTmp = open("rates_tmp.txt","w")

Definition at line 140 of file PDRates.py.

PDRates.Run = options.RunNumber

Definition at line 131 of file PDRates.py.

Referenced by edm::EventProcessor.readAndMergeRun(), and edm::EventProcessor.readRun().

string PDRates.st_title = " \"Rates in PrimaryDataset "

Definition at line 159 of file PDRates.py.

tuple PDRates.TempFile = open("tmp.gnuplot.txt","w")

Definition at line 153 of file PDRates.py.