CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 30 of file PDRates.py.

References print().

30 
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 = subprocess.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 
def PrimaryDatasets
Definition: PDRates.py:30
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def PDRates.RateInPD (   Run,
  PrimaryDataset,
  lsMin,
  lsMax,
  printLS = False 
)

Definition at line 50 of file PDRates.py.

References beamvalidation.exit(), print(), and sistrip::SpyUtilities.range().

50 
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 = subprocess.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 LSinFile.items():
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 
const uint16_t range(const Frame &aFrame)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def RateInPD
Definition: PDRates.py:50

Variable Documentation

int PDRates.average = 0

Definition at line 138 of file PDRates.py.

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

list PDRates.Datasets = []

Definition at line 178 of file PDRates.py.

int PDRates.lsMax = 999999

Definition at line 121 of file PDRates.py.

int PDRates.lsMin = -1

Definition at line 120 of file PDRates.py.

int PDRates.nLS_within_range = 0

Definition at line 139 of file PDRates.py.

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

Definition at line 21 of file PDRates.py.

PDRates.PrimaryDataset = options.PrimaryDataset

Definition at line 133 of file PDRates.py.

dictionary PDRates.RatePerLS = {}

Definition at line 134 of file PDRates.py.

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

Definition at line 141 of file PDRates.py.

PDRates.Run = options.RunNumber

Definition at line 132 of file PDRates.py.

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

Definition at line 160 of file PDRates.py.

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

Definition at line 154 of file PDRates.py.