CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes | Static Private Attributes
cmsswVersionTools.PickRelValInputFiles Class Reference


Automatic pick-up of RelVal input files

More...

Inheritance diagram for cmsswVersionTools.PickRelValInputFiles:

Public Member Functions

def __call__
 
def __init__
 
def apply
 
def getDefaultParameters
 
def messageEmptyList
 

Private Attributes

 _comment
 
 _parameters
 

Static Private Attributes

tuple _defaultParameters = dicttypes.SortedKeysDict()
 
string _label = 'pickRelValInputFiles'
 

Detailed Description


Automatic pick-up of RelVal input files

Picks up RelVal input files automatically and
  returns a vector of strings with the paths to be used in [PoolSource].fileNames
PickRelValInputFiles( cmsswVersion, relVal, dataTier, condition, globalTag, maxVersions, skipFiles, numberOfFiles, debug )
- useDAS       : switch to perform query in DAS rather than in DBS
                 optional; default: False
- cmsswVersion : CMSSW release to pick up the RelVal files from
                 optional; default: the current release (determined automatically from environment)
- formerVersion: use the last before the last valid CMSSW release to pick up the RelVal files from
                 applies also, if 'cmsswVersion' is set explicitly
                 optional; default: False
- relVal       : RelVal sample to be used
                 optional; default: 'RelValTTbar'
- dataTier     : data tier to be used
                 optional; default: 'GEN-SIM-RECO'
- condition    : identifier of GlobalTag as defined in Configurations/PyReleaseValidation/python/autoCond.py
                 possibly overwritten, if 'globalTag' is set explicitly
                 optional; default: 'startup'
- globalTag    : name of GlobalTag as it is used in the data path of the RelVals
                 optional; default: determined automatically as defined by 'condition' in Configurations/PyReleaseValidation/python/autoCond.py
  !!!            Determination is done for the release one runs in, not for the release the RelVals have been produced in.
  !!!            Example of deviation: data RelVals (CMSSW_4_1_X) might not only have the pure name of the GlobalTag 'GR_R_311_V2' in the full path,
                 but also an extension identifying the data: 'GR_R_311_V2_RelVal_wzMu2010B'
- maxVersions  : max. versioning number of RelVal to check
                 optional; default: 9
- skipFiles    : number of files to skip for a found RelVal sample
                 optional; default: 0
- numberOfFiles: number of files to pick up
                 setting it to negative values, returns all found ('skipFiles' remains active though)
                 optional; default: -1
- debug        : switch to enable enhanced messages in 'stdout'
                 optional; default: False

Definition at line 16 of file cmsswVersionTools.py.

Constructor & Destructor Documentation

def cmsswVersionTools.PickRelValInputFiles.__init__ (   self)

Definition at line 56 of file cmsswVersionTools.py.

References editorTools.UserCodeTool._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, editorTools.ChangeSource._defaultParameters, cmsswVersionTools.PickRelValInputFiles._defaultParameters, root::helper::RootFunctionAdapter< F, args >.addParameter(), root::helper::RootFunctionHelper< F, args, Tag >.addParameter(), ParameterMgr.addParameter(), fit::RootMinuit< Function >.addParameter(), DropBoxMetadata::Parameters.addParameter(), PythonParameterSet.addParameter(), LutXml.addParameter(), ConfigToolBase.ConfigToolBase.addParameter(), edm::ParameterSet.addParameter(), editorTools.ChangeSource.getDefaultParameters(), and cmsswVersionTools.PickRelValInputFiles.getDefaultParameters().

56 
57  def __init__( self ):
58  ConfigToolBase.__init__( self )
59  self.addParameter( self._defaultParameters, 'useDAS' , False , '' )
60  self.addParameter( self._defaultParameters, 'cmsswVersion' , os.getenv( "CMSSW_VERSION" ) , 'auto from environment' )
61  self.addParameter( self._defaultParameters, 'formerVersion', False , '' )
62  self.addParameter( self._defaultParameters, 'relVal' , 'RelValTTbar' , '' )
63  self.addParameter( self._defaultParameters, 'dataTier' , 'GEN-SIM-RECO' , '' )
64  self.addParameter( self._defaultParameters, 'condition' , 'startup' , '' )
65  self.addParameter( self._defaultParameters, 'globalTag' , autoCond[ self.getDefaultParameters()[ 'condition' ].value ][ : -5 ], 'auto from \'condition\'' )
66  self.addParameter( self._defaultParameters, 'maxVersions' , 3 , '' )
67  self.addParameter( self._defaultParameters, 'skipFiles' , 0 , '' )
68  self.addParameter( self._defaultParameters, 'numberOfFiles', -1 , 'all' )
69  self.addParameter( self._defaultParameters, 'debug' , False , '' )
70  self._parameters = copy.deepcopy( self._defaultParameters )
71  self._comment = ""

Member Function Documentation

def cmsswVersionTools.PickRelValInputFiles.__call__ (   self,
  useDAS = None,
  cmsswVersion = None,
  formerVersion = None,
  relVal = None,
  dataTier = None,
  condition = None,
  globalTag = None,
  maxVersions = None,
  skipFiles = None,
  numberOfFiles = None,
  debug = None 
)

Definition at line 84 of file cmsswVersionTools.py.

References gen::PhotosInterfaceBase.apply(), MatrixReader.MatrixReader.apply, DummyOOTPileupCorrection.apply(), gen::PhotosppInterface.apply(), gen::PhotosInterface.apply(), SurveyParameters.apply(), FWPSetCellEditor.apply(), FWGUIEventFilter.apply(), DeviationsFromFileSensor2D.apply(), RigidBodyAlignmentParameters.apply(), BeamSpotAlignmentParameters.apply(), MatRepSparse< T, D1, D2, S, F >.apply(), ConfigToolBase.ConfigToolBase.apply(), BowedSurfaceAlignmentParameters.apply(), OOTPileupCorrData.apply(), AlignmentParameters.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool.apply(), Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool.apply(), AbsOOTPileupCorrection.apply(), TwoBowedSurfacesAlignmentParameters.apply(), Vispa.Gui.BoxContentDialog.BoxContentDialog.apply(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog.apply(), cmsswVersionTools.PickRelValInputFiles.apply(), npstat::ArrayND< Numeric, StackLen, StackDim >.apply(), editorTools.ChangeSource.getDefaultParameters(), cmsswVersionTools.PickRelValInputFiles.getDefaultParameters(), ora::OraMainTable.setParameter(), ora::IMainTable.setParameter(), ora::PoolMainTable.setParameter(), PedeReader.setParameter(), IntegratedCalibrationBase.setParameter(), SiStripLorentzAngleCalibration.setParameter(), SiPixelLorentzAngleCalibration.setParameter(), SiStripBackplaneCalibration.setParameter(), fit::RootMinuit< Function >.setParameter(), and ConfigToolBase.ConfigToolBase.setParameter().

84 
85  ):
86  if useDAS is None:
87  useDAS = self.getDefaultParameters()[ 'useDAS' ].value
88  if cmsswVersion is None:
89  cmsswVersion = self.getDefaultParameters()[ 'cmsswVersion' ].value
90  if formerVersion is None:
91  formerVersion = self.getDefaultParameters()[ 'formerVersion' ].value
92  if relVal is None:
93  relVal = self.getDefaultParameters()[ 'relVal' ].value
94  if dataTier is None:
95  dataTier = self.getDefaultParameters()[ 'dataTier' ].value
96  if condition is None:
97  condition = self.getDefaultParameters()[ 'condition' ].value
98  if globalTag is None:
99  globalTag = autoCond[ condition ][ : -5 ] # auto from 'condition'
100  if maxVersions is None:
101  maxVersions = self.getDefaultParameters()[ 'maxVersions' ].value
102  if skipFiles is None:
103  skipFiles = self.getDefaultParameters()[ 'skipFiles' ].value
104  if numberOfFiles is None:
105  numberOfFiles = self.getDefaultParameters()[ 'numberOfFiles' ].value
106  if debug is None:
107  debug = self.getDefaultParameters()[ 'debug' ].value
108  self.setParameter( 'useDAS' , useDAS )
109  self.setParameter( 'cmsswVersion' , cmsswVersion )
110  self.setParameter( 'formerVersion', formerVersion )
111  self.setParameter( 'relVal' , relVal )
112  self.setParameter( 'dataTier' , dataTier )
113  self.setParameter( 'condition' , condition )
114  self.setParameter( 'globalTag' , globalTag )
115  self.setParameter( 'maxVersions' , maxVersions )
116  self.setParameter( 'skipFiles' , skipFiles )
117  self.setParameter( 'numberOfFiles', numberOfFiles )
118  self.setParameter( 'debug' , debug )
119  return self.apply()
def cmsswVersionTools.PickRelValInputFiles.apply (   self)

Definition at line 124 of file cmsswVersionTools.py.

References editorTools.UserCodeTool._label, MagneticFieldMapESProducer._label, TrackerInteractionGeometryESProducer._label, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._label, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._label, ConfigToolBase.ConfigToolBase._label, editorTools.ChangeSource._label, LHECOMWeightProducer._label, cmsswVersionTools.PickRelValInputFiles._label, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool._label, Vispa.Views.LineDecayView.DecayLine._label, editorTools.UserCodeTool._parameters, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._parameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._parameters, ConfigToolBase.ConfigToolBase._parameters, editorTools.ChangeSource._parameters, TAbsFitConstraint._parameters, TAbsFitParticle._parameters, cmsswVersionTools.PickRelValInputFiles._parameters, communicate(), cmsRelvalreport.exit, editorTools.ChangeSource.getDefaultParameters(), cmsswVersionTools.PickRelValInputFiles.getDefaultParameters(), cmsswVersionTools.PickRelValInputFiles.messageEmptyList(), and split.

Referenced by heavyIonTools.ConfigureHeavyIons.__call__(), editorTools.UserCodeTool.__call__(), HiCoreTools.RestrictInputToAOD.__call__(), coreTools.RunOnData.__call__(), trackTools.MakeAODTrackCandidates.__call__(), metTools.AddMETCollection.__call__(), heavyIonTools.ProductionDefaults.__call__(), editorTools.ChangeSource.__call__(), HiCoreTools.RemoveMCMatching.__call__(), cmsswVersionTools.PickRelValInputFiles.__call__(), jetTools.AddJetCollection.__call__(), coreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), heavyIonTools.SelectionDefaults.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), heavyIonTools.DisbaleMonteCarloDeps.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), tauTools.AddTauCollection.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.RemoveCleaning.__call__(), HiCoreTools.AddCleaning.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.AddJetID.__call__(), jetTools.SetTagInfos.__call__(), and metUncertaintyTools.RunMEtUncertainties.__call__().

125  def apply( self ):
126  useDAS = self._parameters[ 'useDAS' ].value
127  cmsswVersion = self._parameters[ 'cmsswVersion' ].value
128  formerVersion = self._parameters[ 'formerVersion' ].value
129  relVal = self._parameters[ 'relVal' ].value
130  dataTier = self._parameters[ 'dataTier' ].value
131  condition = self._parameters[ 'condition' ].value # only used for GT determination in initialization, if GT not explicitly given
132  globalTag = self._parameters[ 'globalTag' ].value
133  maxVersions = self._parameters[ 'maxVersions' ].value
134  skipFiles = self._parameters[ 'skipFiles' ].value
135  numberOfFiles = self._parameters[ 'numberOfFiles' ].value
136  debug = self._parameters[ 'debug' ].value
137 
138  filePaths = []
139 
140  # Determine corresponding CMSSW version for RelVals
141  preId = '_pre'
142  patchId = '_patch' # patch releases
143  hltPatchId = '_hltpatch' # HLT patch releases
144  dqmPatchId = '_dqmpatch' # DQM patch releases
145  slhcId = '_SLHC' # SLHC releases
146  rootId = '_root' # ROOT test releases
147  ibId = '_X_' # IBs
148  if patchId in cmsswVersion:
149  cmsswVersion = cmsswVersion.split( patchId )[ 0 ]
150  elif hltPatchId in cmsswVersion:
151  cmsswVersion = cmsswVersion.split( hltPatchId )[ 0 ]
152  elif dqmPatchId in cmsswVersion:
153  cmsswVersion = cmsswVersion.split( dqmPatchId )[ 0 ]
154  elif rootId in cmsswVersion:
155  cmsswVersion = cmsswVersion.split( rootId )[ 0 ]
156  elif slhcId in cmsswVersion:
157  cmsswVersion = cmsswVersion.split( slhcId )[ 0 ]
158  elif ibId in cmsswVersion or formerVersion:
159  outputTuple = Popen( [ 'scram', 'l -c CMSSW' ], stdout = PIPE, stderr = PIPE ).communicate()
160  if len( outputTuple[ 1 ] ) != 0:
161  print '%s INFO : SCRAM error'%( self._label )
162  if debug:
163  print ' from trying to determine last valid releases before \'%s\''%( cmsswVersion )
164  print
165  print outputTuple[ 1 ]
166  print
167  self.messageEmptyList()
168  return filePaths
169  versions = { 'last' :''
170  , 'lastToLast':''
171  }
172  for line in outputTuple[ 0 ].splitlines():
173  version = line.split()[ 1 ]
174  if cmsswVersion.split( ibId )[ 0 ] in version or cmsswVersion.rpartition( '_' )[ 0 ] in version:
175  if not ( patchId in version or hltPatchId in version or dqmPatchId in version or slhcId in version or ibId in version or rootId in version ):
176  versions[ 'lastToLast' ] = versions[ 'last' ]
177  versions[ 'last' ] = version
178  if version == cmsswVersion:
179  break
180  # FIXME: ordering of output problematic ('XYZ_pre10' before 'XYZ_pre2', no "formerVersion" for 'XYZ_pre1')
181  if formerVersion:
182  # Don't use pre-releases as "former version" for other releases than CMSSW_X_Y_0
183  if preId in versions[ 'lastToLast' ] and not preId in versions[ 'last' ] and not versions[ 'last' ].endswith( '_0' ):
184  versions[ 'lastToLast' ] = versions[ 'lastToLast' ].split( preId )[ 0 ] # works only, if 'CMSSW_X_Y_0' esists ;-)
185  # Use pre-release as "former version" for CMSSW_X_Y_0
186  elif versions[ 'last' ].endswith( '_0' ) and not ( preId in versions[ 'lastToLast' ] and versions[ 'lastToLast' ].startswith( versions[ 'last' ] ) ):
187  versions[ 'lastToLast' ] = ''
188  for line in outputTuple[ 0 ].splitlines():
189  version = line.split()[ 1 ]
190  versionParts = version.partition( preId )
191  if versionParts[ 0 ] == versions[ 'last' ] and versionParts[ 1 ] == preId:
192  versions[ 'lastToLast' ] = version
193  elif versions[ 'lastToLast' ] != '':
194  break
195  # Don't use CMSSW_X_Y_0 as "former version" for pre-releases
196  elif preId in versions[ 'last' ] and not preId in versions[ 'lastToLast' ] and versions[ 'lastToLast' ].endswith( '_0' ):
197  versions[ 'lastToLast' ] = '' # no alternative :-(
198  cmsswVersion = versions[ 'lastToLast' ]
199  else:
200  cmsswVersion = versions[ 'last' ]
201 
202  # Debugging output
203  if debug:
204  print '%s DEBUG: Called with...'%( self._label )
205  for key in self._parameters.keys():
206  print ' %s:\t'%( key ),
207  print self._parameters[ key ].value,
208  if self._parameters[ key ].value is self.getDefaultParameters()[ key ].value:
209  print ' (default)'
210  else:
211  print
212  if key == 'cmsswVersion' and cmsswVersion != self._parameters[ key ].value:
213  if formerVersion:
214  print ' ==> modified to last to last valid release %s (s. \'formerVersion\' parameter)'%( cmsswVersion )
215  else:
216  print ' ==> modified to last valid release %s'%( cmsswVersion )
217 
218  # Check domain
219  domain = socket.getfqdn().split( '.' )
220  domainSE = ''
221  if len( domain ) == 0:
222  print '%s INFO : Cannot determine domain of this computer'%( self._label )
223  if debug:
224  self.messageEmptyList()
225  return filePaths
226  elif os.uname()[0] == "Darwin":
227  print '%s INFO : Running on MacOSX without direct access to RelVal files.'%( self._label )
228  if debug:
229  self.messageEmptyList()
230  return filePaths
231  elif len( domain ) == 1:
232  print '%s INFO : Running on local host \'%s\' without direct access to RelVal files'%( self._label, domain[ 0 ] )
233  if debug:
234  self.messageEmptyList()
235  return filePaths
236  if not ( ( domain[ -2 ] == 'cern' and domain[ -1 ] == 'ch' ) or ( domain[ -2 ] == 'fnal' and domain[ -1 ] == 'gov' ) ):
237  print '%s INFO : Running on site \'%s.%s\' without direct access to RelVal files'%( self._label, domain[ -2 ], domain[ -1 ] )
238  if debug:
239  self.messageEmptyList()
240  return filePaths
241  if domain[ -2 ] == 'cern':
242  domainSE = 'T2_CH_CERN'
243  elif domain[ -2 ] == 'fnal':
244  domainSE = 'T1_US_FNAL_MSS'
245  if debug:
246  print '%s DEBUG: Running at site \'%s.%s\''%( self._label, domain[ -2 ], domain[ -1 ] )
247  print '%s DEBUG: Looking for SE \'%s\''%( self._label, domainSE )
248 
249  # Find files
250  validVersion = 0
251  dataset = ''
252  datasetAll = '/%s/%s-%s-v*/%s'%( relVal, cmsswVersion, globalTag, dataTier )
253  if useDAS:
254  if debug:
255  print '%s DEBUG: Using DAS query'%( self._label )
256  dasLimit = numberOfFiles
257  if dasLimit <= 0:
258  dasLimit += 1
259  for version in range( maxVersions, 0, -1 ):
260  filePaths = []
261  filePathsTmp = []
262  fileCount = 0
263  dataset = '/%s/%s-%s-v%i/%s'%( relVal, cmsswVersion, globalTag, version, dataTier )
264  dasQuery = 'file dataset=%s | grep file.name'%( dataset )
265  if debug:
266  print '%s DEBUG: Querying dataset \'%s\' with'%( self._label, dataset )
267  print ' \'%s\''%( dasQuery )
268  # partially stolen from das_client.py for option '--format=plain', needs filter ("grep") in the query
269  jsondict = das_client.get_data(dasQuery, dasLimit)
270  if debug:
271  print '%s DEBUG: Received DAS JSON dictionary:'%( self._label )
272  print ' \'%s\''%( jsondict )
273  if jsondict[ 'status' ] != 'ok':
274  print 'There was a problem while querying DAS with query \'%s\'. Server reply was:\n %s' % (dasQuery, jsondict)
275  exit( 1 )
276  mongo_query = jsondict[ 'mongo_query' ]
277  filters = mongo_query[ 'filters' ]
278  data = jsondict[ 'data' ]
279  if debug:
280  print '%s DEBUG: Query in JSON dictionary:'%( self._label )
281  print ' \'%s\''%( mongo_query )
282  print '%s DEBUG: Filters in query:'%( self._label )
283  print ' \'%s\''%( filters )
284  print '%s DEBUG: Data in JSON dictionary:'%( self._label )
285  print ' \'%s\''%( data )
286  for row in data:
287  filePath = [ r for r in das_client.get_value( row, filters[ 'grep' ] ) ][ 0 ]
288  if debug:
289  print '%s DEBUG: Testing file entry \'%s\''%( self._label, filePath )
290  if len( filePath ) > 0:
291  if validVersion != version:
292  jsontestdict = das_client.get_data('site dataset=%s | grep site.name'%( dataset ), 999)
293  mongo_testquery = jsontestdict[ 'mongo_query' ]
294  testfilters = mongo_testquery[ 'filters' ]
295  testdata = jsontestdict[ 'data' ]
296  if debug:
297  print '%s DEBUG: Received DAS JSON dictionary (site test):'%( self._label )
298  print ' \'%s\''%( jsontestdict )
299  print '%s DEBUG: Query in JSON dictionary (site test):'%( self._label )
300  print ' \'%s\''%( mongo_testquery )
301  print '%s DEBUG: Filters in query (site test):'%( self._label )
302  print ' \'%s\''%( testfilters )
303  print '%s DEBUG: Data in JSON dictionary (site test):'%( self._label )
304  print ' \'%s\''%( testdata )
305  foundSE = False
306  for testrow in testdata:
307  siteName = [ tr for tr in das_client.get_value( testrow, testfilters[ 'grep' ] ) ][ 0 ]
308  if siteName == domainSE:
309  foundSE = True
310  break
311  if not foundSE:
312  if debug:
313  print '%s DEBUG: Possible version \'v%s\' not available on SE \'%s\''%( self._label, version, domainSE )
314  break
315  validVersion = version
316  if debug:
317  print '%s DEBUG: Valid version set to \'v%i\''%( self._label, validVersion )
318  if numberOfFiles == 0:
319  break
320  # protect from double entries ( 'unique' flag in query does not work here)
321  if not filePath in filePathsTmp:
322  filePathsTmp.append( filePath )
323  if debug:
324  print '%s DEBUG: File \'%s\' found'%( self._label, filePath )
325  fileCount += 1
326  # needed, since and "limit" overrides "idx" in 'get_data' (==> "idx" set to '0' rather than "skipFiles")
327  if fileCount > skipFiles:
328  filePaths.append( filePath )
329  elif debug:
330  print '%s DEBUG: File \'%s\' found again'%( self._label, filePath )
331  if validVersion > 0:
332  if numberOfFiles == 0 and debug:
333  print '%s DEBUG: No files requested'%( self._label )
334  break
335  else:
336  if debug:
337  print '%s DEBUG: Using DBS query'%( self._label )
338  print '%s WARNING: DBS query disabled for DBS3 transition to new API'%( self._label )
339  #for version in range( maxVersions, 0, -1 ):
340  #filePaths = []
341  #fileCount = 0
342  #dataset = '/%s/%s-%s-v%i/%s'%( relVal, cmsswVersion, globalTag, version, dataTier )
343  #dbsQuery = 'find file where dataset = %s'%( dataset )
344  #if debug:
345  #print '%s DEBUG: Querying dataset \'%s\' with'%( self._label, dataset )
346  #print ' \'%s\''%( dbsQuery )
347  #foundSE = False
348  #for line in os.popen( 'dbs search --query="%s"'%( dbsQuery ) ).readlines():
349  #if line.find( '.root' ) != -1:
350  #if validVersion != version:
351  #if not foundSE:
352  #dbsSiteQuery = 'find dataset where dataset = %s and site = %s'%( dataset, domainSE )
353  #if debug:
354  #print '%s DEBUG: Querying site \'%s\' with'%( self._label, domainSE )
355  #print ' \'%s\''%( dbsSiteQuery )
356  #for lineSite in os.popen( 'dbs search --query="%s"'%( dbsSiteQuery ) ).readlines():
357  #if lineSite.find( dataset ) != -1:
358  #foundSE = True
359  #break
360  #if not foundSE:
361  #if debug:
362  #print '%s DEBUG: Possible version \'v%s\' not available on SE \'%s\''%( self._label, version, domainSE )
363  #break
364  #validVersion = version
365  #if debug:
366  #print '%s DEBUG: Valid version set to \'v%i\''%( self._label, validVersion )
367  #if numberOfFiles == 0:
368  #break
369  #filePath = line.replace( '\n', '' )
370  #if debug:
371  #print '%s DEBUG: File \'%s\' found'%( self._label, filePath )
372  #fileCount += 1
373  #if fileCount > skipFiles:
374  #filePaths.append( filePath )
375  #if not numberOfFiles < 0:
376  #if numberOfFiles <= len( filePaths ):
377  #break
378  #if validVersion > 0:
379  #if numberOfFiles == 0 and debug:
380  #print '%s DEBUG: No files requested'%( self._label )
381  #break
382 
383  # Check output and return
384  if validVersion == 0:
385  print '%s WARNING : No RelVal file(s) found at all in datasets \'%s*\' on SE \'%s\''%( self._label, datasetAll, domainSE )
386  if debug:
387  self.messageEmptyList()
388  elif len( filePaths ) == 0:
389  print '%s WARNING : No RelVal file(s) picked up in dataset \'%s\''%( self._label, dataset )
390  if debug:
391  self.messageEmptyList()
392  elif len( filePaths ) < numberOfFiles:
393  print '%s INFO : Only %i RelVal file(s) instead of %i picked up in dataset \'%s\''%( self._label, len( filePaths ), numberOfFiles, dataset )
394 
395  if debug:
396  print '%s DEBUG: returning %i file(s):\n%s'%( self._label, len( filePaths ), filePaths )
397  return filePaths
static void * communicate(void *obj)
Definition: DQMNet.cc:1246
double split
Definition: MVATrainer.cc:139
def cmsswVersionTools.PickRelValInputFiles.getDefaultParameters (   self)

Definition at line 53 of file cmsswVersionTools.py.

References editorTools.UserCodeTool._defaultParameters, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._defaultParameters, editorTools.ChangeSource._defaultParameters, and cmsswVersionTools.PickRelValInputFiles._defaultParameters.

Referenced by cmsswVersionTools.PickRelValInputFiles.__call__(), cmsswVersionTools.PickRelValInputFiles.__init__(), and cmsswVersionTools.PickRelValInputFiles.apply().

53 
54  def getDefaultParameters( self ):
55  return self._defaultParameters
def cmsswVersionTools.PickRelValInputFiles.messageEmptyList (   self)

Definition at line 120 of file cmsswVersionTools.py.

References editorTools.UserCodeTool._label, MagneticFieldMapESProducer._label, TrackerInteractionGeometryESProducer._label, Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigFolder._label, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ImportTool._label, editorTools.ChangeSource._label, ConfigToolBase.ConfigToolBase._label, LHECOMWeightProducer._label, cmsswVersionTools.PickRelValInputFiles._label, Vispa.Plugins.ConfigEditor.ToolDataAccessor.ApplyTool._label, and Vispa.Views.LineDecayView.DecayLine._label.

Referenced by cmsswVersionTools.PickRelValInputFiles.apply().

121  def messageEmptyList( self ):
122  print '%s DEBUG: Empty file list returned'%( self._label )
123  print ' This might be overwritten by providing input files explicitly to the source module in the main configuration file.'

Member Data Documentation

cmsswVersionTools.PickRelValInputFiles._comment
private

Definition at line 70 of file cmsswVersionTools.py.

Referenced by metUncertaintyTools.RunMEtUncertainties.__init__().

tuple cmsswVersionTools.PickRelValInputFiles._defaultParameters = dicttypes.SortedKeysDict()
staticprivate

Definition at line 51 of file cmsswVersionTools.py.

Referenced by HiCoreTools.RestrictInputToAOD.__call__(), coreTools.RunOnData.__call__(), trackTools.MakeAODTrackCandidates.__call__(), metTools.AddMETCollection.__call__(), HiCoreTools.RemoveMCMatching.__call__(), jetTools.AddJetCollection.__call__(), coreTools.RemoveMCMatching.__call__(), trackTools.MakePATTrackCandidates.__call__(), trigTools.SwitchOnTrigger.__call__(), HiCoreTools.RemoveAllPATObjectsBut.__call__(), HiCoreTools.RemoveSpecificPATObjects.__call__(), trigTools.SwitchOnTriggerStandAlone.__call__(), trackTools.MakeTrackCandidates.__call__(), tauTools.AddTauCollection.__call__(), trigTools.SwitchOnTriggerMatching.__call__(), HiCoreTools.RemoveCleaning.__call__(), HiCoreTools.AddCleaning.__call__(), trigTools.SwitchOnTriggerMatchingStandAlone.__call__(), trigTools.SwitchOnTriggerMatchEmbedding.__call__(), jetTools.SwitchJetCollection.__call__(), jetTools.AddJetID.__call__(), jetTools.SetTagInfos.__call__(), metUncertaintyTools.RunMEtUncertainties.__call__(), metTools.AddMETCollection.__init__(), trackTools.MakeAODTrackCandidates.__init__(), coreTools.RunOnData.__init__(), HiCoreTools.RestrictInputToAOD.__init__(), metUncertaintyTools.RunMEtUncertainties.__init__(), jetTools.AddJetCollection.__init__(), cmsswVersionTools.PickRelValInputFiles.__init__(), HiCoreTools.RemoveMCMatching.__init__(), coreTools.RemoveMCMatching.__init__(), trackTools.MakePATTrackCandidates.__init__(), trigTools.SwitchOnTrigger.__init__(), HiCoreTools.RemoveAllPATObjectsBut.__init__(), HiCoreTools.RemoveSpecificPATObjects.__init__(), trigTools.SwitchOnTriggerStandAlone.__init__(), trackTools.MakeTrackCandidates.__init__(), tauTools.AddTauCollection.__init__(), trigTools.SwitchOnTriggerMatching.__init__(), HiCoreTools.RemoveCleaning.__init__(), HiCoreTools.AddCleaning.__init__(), trigTools.SwitchOnTriggerMatchingStandAlone.__init__(), jetTools.SwitchJetCollection.__init__(), trigTools.SwitchOnTriggerMatchEmbedding.__init__(), jetTools.AddJetID.__init__(), jetTools.SetTagInfos.__init__(), metUncertaintyTools.RunMEtUncertainties._initializeInputTag(), ConfigToolBase.ConfigToolBase.dumpPython(), ConfigToolBase.ConfigToolBase.getAllowedValues(), heavyIonTools.ConfigureHeavyIons.getDefaultParameters(), HiCoreTools.RestrictInputToAOD.getDefaultParameters(), coreTools.RunOnData.getDefaultParameters(), trackTools.MakeAODTrackCandidates.getDefaultParameters(), metTools.AddMETCollection.getDefaultParameters(), heavyIonTools.ProductionDefaults.getDefaultParameters(), cmsswVersionTools.PickRelValInputFiles.getDefaultParameters(), HiCoreTools.RemoveMCMatching.getDefaultParameters(), jetTools.AddJetCollection.getDefaultParameters(), metUncertaintyTools.RunMEtUncertainties.getDefaultParameters(), coreTools.RemoveMCMatching.getDefaultParameters(), trackTools.MakePATTrackCandidates.getDefaultParameters(), trigTools.SwitchOnTrigger.getDefaultParameters(), heavyIonTools.SelectionDefaults.getDefaultParameters(), HiCoreTools.RemoveAllPATObjectsBut.getDefaultParameters(), heavyIonTools.DisbaleMonteCarloDeps.getDefaultParameters(), HiCoreTools.RemoveSpecificPATObjects.getDefaultParameters(), trigTools.SwitchOnTriggerStandAlone.getDefaultParameters(), trackTools.MakeTrackCandidates.getDefaultParameters(), tauTools.AddTauCollection.getDefaultParameters(), trigTools.SwitchOnTriggerMatching.getDefaultParameters(), HiCoreTools.RemoveCleaning.getDefaultParameters(), HiCoreTools.AddCleaning.getDefaultParameters(), trigTools.SwitchOnTriggerMatchingStandAlone.getDefaultParameters(), trigTools.SwitchOnTriggerMatchEmbedding.getDefaultParameters(), jetTools.SwitchJetCollection.getDefaultParameters(), jetTools.AddJetID.getDefaultParameters(), jetTools.SetTagInfos.getDefaultParameters(), ConfigToolBase.ConfigToolBase.reset(), and ConfigToolBase.ConfigToolBase.setParameter().

string cmsswVersionTools.PickRelValInputFiles._label = 'pickRelValInputFiles'
staticprivate

Definition at line 50 of file cmsswVersionTools.py.

Referenced by cmsswVersionTools.PickRelValInputFiles.apply(), cmsswVersionTools.PickRelValInputFiles.messageEmptyList(), trigTools.SwitchOnTrigger.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), and trigTools.SwitchOnTriggerMatchEmbedding.toolCode().

cmsswVersionTools.PickRelValInputFiles._parameters
private

Definition at line 69 of file cmsswVersionTools.py.

Referenced by metUncertaintyTools.RunMEtUncertainties.__init__(), cmsswVersionTools.PickRelValInputFiles.apply(), HiCoreTools.RestrictInputToAOD.toolCode(), coreTools.RunOnData.toolCode(), trackTools.MakeAODTrackCandidates.toolCode(), metTools.AddMETCollection.toolCode(), HiCoreTools.RemoveMCMatching.toolCode(), coreTools.RemoveMCMatching.toolCode(), trackTools.MakePATTrackCandidates.toolCode(), trigTools.SwitchOnTrigger.toolCode(), jetTools.AddJetCollection.toolCode(), HiCoreTools.RemoveAllPATObjectsBut.toolCode(), HiCoreTools.RemoveSpecificPATObjects.toolCode(), trigTools.SwitchOnTriggerStandAlone.toolCode(), trackTools.MakeTrackCandidates.toolCode(), tauTools.AddTauCollection.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), trigTools.SwitchOnTriggerMatching.toolCode(), HiCoreTools.AddCleaning.toolCode(), trigTools.SwitchOnTriggerMatchingStandAlone.toolCode(), trigTools.SwitchOnTriggerMatchEmbedding.toolCode(), jetTools.SwitchJetCollection.toolCode(), jetTools.AddJetID.toolCode(), jetTools.SetTagInfos.toolCode(), and metUncertaintyTools.RunMEtUncertainties.toolCode().