1 |
|
#!/usr/bin/env python |
2 |
+ |
|
3 |
+ |
__revision__ = "$Id$" |
4 |
+ |
__version__ = "$Revision$" |
5 |
+ |
|
6 |
|
import exceptions |
7 |
|
import DBSAPI.dbsApi |
8 |
|
from DBSAPI.dbsApiException import * |
88 |
|
# Attributes |
89 |
|
self.datasetPath = datasetPath |
90 |
|
# Analysis dataset is primary/processed/tier/definition |
91 |
< |
self.ads = len(self.datasetPath.split("/")) > 3 |
91 |
> |
self.ads = len(self.datasetPath.split("/")) > 4 or len(self.datasetPath.split("/")) == 1 |
92 |
|
self.cfg_params = cfg_params |
93 |
|
self.skipBlocks = skipAnBlocks |
94 |
|
|
111 |
|
global_url="http://cmsdbsprod.cern.ch/cms_dbs_prod_global/servlet/DBSServlet" |
112 |
|
caf_url = "http://cmsdbsprod.cern.ch/cms_dbs_caf_analysis_01/servlet/DBSServlet" |
113 |
|
dbs_url_map = {'glite': global_url, |
114 |
+ |
'glite_slc5':global_url,\ |
115 |
|
'glitecoll':global_url,\ |
116 |
|
'condor': global_url,\ |
117 |
|
'condor_g': global_url,\ |
118 |
|
'glidein': global_url,\ |
119 |
|
'lsf': global_url,\ |
120 |
|
'caf': caf_url,\ |
121 |
< |
'sge': global_url, |
122 |
< |
'arc': global_url |
121 |
> |
'sge': global_url,\ |
122 |
> |
'arc': global_url,\ |
123 |
> |
'pbs': global_url |
124 |
|
} |
125 |
|
|
126 |
|
dbs_url_default = dbs_url_map[(common.scheduler.name()).lower()] |
127 |
|
dbs_url= self.cfg_params.get('CMSSW.dbs_url', dbs_url_default) |
128 |
< |
common.logger.debug("Accessing DBS at: "+dbs_url) |
128 |
> |
common.logger.info("Accessing DBS at: "+dbs_url) |
129 |
|
|
130 |
|
## check if runs are selected |
131 |
|
runselection = [] |
140 |
|
args = {} |
141 |
|
args['url'] = dbs_url |
142 |
|
args['level'] = 'CRITICAL' |
143 |
+ |
args['adshome'] = '$HOME/DBSADS' |
144 |
|
|
145 |
|
## check if has been requested to use the parent info |
146 |
|
useparent = int(self.cfg_params.get('CMSSW.use_parent',0)) |
215 |
|
common.logger.debug("Set of input parameters used for DBS query: %s" % allowedRetriveValue) |
216 |
|
try: |
217 |
|
if len(runselection) <=0 : |
218 |
< |
if useParent==1 or self.splitByRun==1 : |
218 |
> |
if useParent==1 or self.splitByRun==1 or self.ads: |
219 |
|
if self.ads: |
220 |
|
files = api.listFiles(analysisDataset=path, retriveList=allowedRetriveValue) |
221 |
|
else : |
251 |
|
return self.maxEvents |
252 |
|
|
253 |
|
|
254 |
+ |
def getMaxLumis(self): |
255 |
+ |
""" |
256 |
+ |
Return the number of lumis in the dataset |
257 |
+ |
""" |
258 |
+ |
return self.maxLumis |
259 |
+ |
|
260 |
+ |
|
261 |
|
def getEventsPerBlock(self): |
262 |
|
""" |
263 |
|
list the event collections structure by fileblock |