Report problems to ATLAS LXR Team (with time and IP address indicated)

The LXR Cross Referencer

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Architecture: linux ]
Version: head ] [ nightly ] [ GaudiDev ]
  Links to LXR source navigation pages for stable releases [ 12.*.* ]   [ 13.*.* ]   [ 14.*.* ] 

001 # flags to configure RecExCommon
002 # Default values are set only if the variables do not exist yet.
003 # To configure it there are several possibilities, from the most
004 # recommended to the least 
005 #  - specify values to be changed with the -c option
006 #    athena -c "readG3=True ; EvtMax = 100" RecExCommon_topOptions.py
007 #    Note: please use \" if a " is needed inside the command line
008 #    athena -c "include(\"RecExCommon/RecExCommon_flags.py\") ; DetFlags.Muon_setOff()" RecExCommon_topOptions.py
009 #  - create a file myconfig.py with the values to be changed
010 #     (myconfig.py could be copied/edited from RecExCommon_flags.py),
011 #    then run
012 #    athena myconfig.py RecExCommon_topOptions.py
013 #  - edit/modify RecExCommon_topOptions.py and add the new values
014 #    specification inside
015 #  - edit/modify the default values in RecExCommon_flags.py 
016 # prevent the current file to be included a second time
017 include.block("RecExCond/RecExCommon_flags.py")
018 
019 
020 from AthenaCommon.Logging import logging
021 from RecExConfig.RecFlags import rec
022 from RecExConfig.Resilience import treatException,protectedInclude
023 
024 logRecExCommon_flags = logging.getLogger( 'RecExCommon_flags' )
025 logRecExCommon_flags.info("Executing RecExCommon_flags.py")
026 
027 # default value for old flag compatibility
028 if not 'oldFlagDefault' in dir():
029    oldFlagDefault=True
030 if not oldFlagDefault:
031    logRecExCommon_flags.info("old flags default will be IGNORED !. Also switching oldFlagCompatibility to False" )
032    oldFlagCompatibility=False
033 
034 
035 
036 # start using the new job properties
037 from AthenaCommon.JobProperties import jobproperties
038 
039 # mgallas 
040 from AthenaCommon.AthenaCommonFlags import jobproperties,athenaCommonFlags
041 # mgallas end  
042 
043 
044 #(can be disabled by doing:
045 # athenaCommonFlags.RuntimeStrictness.set_Value_and_Lock('none')
046 
047 from AthenaCommon.Constants import *
048 
049 
050 
051 
052 
053 
054    
055 
056 
057 
058 
059 # trick : dir() should be done before the import of AthenaCommonFlags
060 # so that the default in RecExCommonFlags supersedes the default in
061 # AthenaCommonFlags
062 varInit=dir()
063 
064 
065 # compat layer : check if some obsolete variables have been set
066    
067 
068 
069 # some very general flags, EvtMax, SkipEvents, PoolESDInput etc...
070 #include ("AthenaCommon/AthenaCommonFlags.py")
071 # prevent this file to be included a second time
072 #include.block("AthenaCommon/AthenaCommonFlags.py")
073 # temporary cut and paste here as I cannot control the settings
074 # be careful that default value are in fact overriden by new flags
075 AthenaCommonFlags = {
076    'EvtMax' : 5,    # number of events to be processed
077    'SkipEvents' : 0,    # number of events to be skipped      
078    'PoolEvgenInput' : ["Evgen.pool.root"],
079    'PoolHitsInput' : ["Hits.pool.root"],
080    'PoolRDOInput' :  ["RDO.pool.root"], # input RDO file
081    'PoolESDInput' : [ "ESD.pool.root" ], # pool ESD input file
082    'PoolAODInput' : [ "AOD.pool.root" ], # pool ESD input file
083    'PoolEvgenOutput' : "Event.pool.root", # pool evgen file 
084    'PoolHitsOutput' : "Hits.pool.root", # pool evgen file 
085    'PoolRDOOutput' : "RDO.pool.root", # pool evgen file 
086    'PoolESDOutput' : "ESD.pool.root", # pool ESD output file
087    'PoolAODOutput' : "AOD.pool.root", # pool AOD output file
088    'PoolTAGOutput' : "TAG.pool.root" # pool TAG output file                
089    }
090 
091 # set variable to default if not already set
092 # do not override
093 #for o in [ o for o in AthenaCommonFlags.keys() if not o in varInit ]:
094 #   exec '%s = AthenaCommonFlags[ "%s" ]' % (o,o)
095 
096 
097 
098 
099 # use python ntuple to store variables (from wim)
100 # these are default values
101 # temporary hack change the default of athenaCommonFlags
102 # athenaCommonFlags.BSRDOInput=["./dc2_mixing_all_phys_0003621_file100002.data"]
103 athenaCommonFlags.PoolRDOInput=["LFN:top_GEO-02-01-00_RDO_extract.pool"]
104 
105 # be careful that default value are in fact overriden by new flags
106 RecExCommonFlags = {
107       'BSRDOInput' :      ["./dc2_mixing_all_phys_0003621_file100002.data"],
108       'PoolRDOInput' :  ["LFN:top_GEO-02-01-00_RDO_extract.pool"], # input RDO file 
109       'BSRDOOutput' : "", # BS output file name
110       # (LFN for logical file name, otherwise specify full path (preceded by rfio: for castor files)
111       # see RecExCommon_links_zc.sh for a few more test files
112       # be careful to set correctly DetDescrVersion 
113       'readTAG' : False, # if true use collection (to be done in *addition* to readESD if relevant) (collections are to be created first with:
114       # athena.py -c " In=[\"LFN:zee_RDO_extract.pool\"] ; Out=\"MyColl\" " TagCollectionTest/MakeSimpleCollection.py      
115       'RootNtupleOutput' : "ntuple.root", # Root Ntuple output  
116       'RootHistoOutput' : "histo.root", # Root Histogram output       
117       'readESD' : False,  # if run on ESD file
118       'readAOD' : False,  # if read AOD file
119       'readRDO' : True,  # if read RDO file      
120       'doWriteBS' : False, # if write out byte stream file 
121       'doWriteRDO' : False, # if write out RDO file 
122       'doWriteESD' : True, # if write out ESD file
123       'doWriteAOD' : True, # if write out AOD file
124       'doWriteTAG' : True, # if write out TAG file 
125       'doDPD' : False, # if compute DPD objects and writes them
126       'doAOD' : True, # if compute AOD objects (without necessary writing them)
127       'doESD' : True, # if compute ESD objects (without necessary writing them)
128       'doRestrictedESD' : False, # if write restricted ESD
129       'doAODall' : True, # write all ID track particles if available
130       'doAODCaloCells' : True, # make AOD cell container
131       'OutputLevel': INFO,  # general msg output level VERBOSE DEBUG INFO
132       'doDetStatus' : True, # include DetStatusSvc_CondDB.py and optionaly DetStatusSvc_ToFileMetaData.py
133       'doTimeLimit': False, # if stop execution when allocated time elapsed
134       'doTruth' : True, # id use the truth
135       'doDumpMC' : False, # if dump mc truth in log file
136       'doNameAuditor' : False, # if NameAuditor switched on (one line print out per alg)
137       'doShowSizeStatistics' : False, # if print pool object size stat of input file
138       'noESDTrigger' : False, # specify that ESD has no trigger info (hack!)
139       'doFileMetaData' : True, # specify that meta data should be written to file      
140       'doBackNavigation' : False, # if allow back navigation
141       'doEdmMonitor' : False, # if monitor edm leak
142       'doDumpTES' : False, # if dump storegate transient event store
143       'doDumpTDS' : False, # if dump storegate transient detector store
144       'doFloatingPointException' : False, # if enable floating-point exception      
145       'doCheckJOT' : False, # if check multiple includes and property modifications
146       'doDumpPoolInputContent' : False, # if dump pool input object list 
147       'doDumpProperties' : False, # if dump all algs properties
148       'doDetailedAuditor' : False, # if monitor alg/tools and services memory and CPU time
149       'doSGAuditor' : False, # if monitor data flow, see https://twiki.cern.ch/twiki/bin/view/Atlas/DataFlowMonitoring 
150       'doPerfMon' : False, # if monitor software performance, see https://twiki.cern.ch/twiki/bin/view/Atlas/PerfMonComps
151       'doDetailedPerfMon' : False, # if monitor software performance, see https://twiki.cern.ch/twiki/bin/view/Atlas/PerfMonComps
152       'doCheckDictionary' : False, # if check dictionary
153       'doMonitoring': False, # if activate monitoring
154       'doCBNT' : True, # if output combined ntuple
155       'CBNTAthenaAware' : True, # if CBNT is AthenaAware
156       'doHeavyIon' : False, # if run HeavyIon reconstruction
157       'doLowPt' : False, # if special low pt reco
158       'doMinimalRec' : False, # if run minimal reconstruction
159       'doHist' : True, # if output some histograms
160       'doJiveXML' : False, # if output xml file for atlantis
161       'doPersint' : False, # if output ascci file for persint
162       'LoadGeometry' : True, # loads ATLAS detector geometry and magnetic field
163       'UserAlgs' : [],
164       'DPDMakerScripts' : [],
165       'AMITag' : ""
166       } # user algorithm(s) e.g  ["MyPackage/MyAlg_jobOptions.py"]
167 
168 
169 # set variable to default if not already set
170 #if oldFlagDefault:
171 #   for o in [ o for o in RecExCommonFlags.keys() if not o in varInit ]:
172 #      exec '%s = RecExCommonFlags[ "%s" ]' % (o,o)
173 
174 
175 # Algorithm switches (separated so that they can be manipulated all together
176 # be careful that default value are in fact overriden by new flags
177 RecExCommonAlgs = {
178       'doTrackRecordFilter' : True,
179       'donewTracking' : True,   
180       'doxKalman' : False,
181       'doiPatRec' : True,
182       'doBackTracking' : True,      
183       'doEmCluster' : True,
184       'doCaloCluster' : False,
185       'doCaloTopoCluster' : True,
186       'doMoore' : True,
187       'doMuonboy' : True,
188       'doEgamma' : True,
189       'doJetRec' : True,
190       'doTauRec' : True,
191       'doMuonIDStandAlone' : True,
192       'doMuonIDCombined' : True,
193       'doMuidLowPt' : False,      
194       'doMuGirl' : True,
195       'doStaco' : True,
196       'doMuTag' : True,
197       'doTileMuID' : True,
198       'doCaloTrkMuId' : True,
199       'doMuonSpShower' : True,      
200       'doMissingET' : True,
201       'doObjMissingET' : True,
202       'doMissingETSig' : True,
203       'doEFlow' : False,
204       'doEFlowJet' : False,
205       'doTrigger' : True,
206       'doAtlfast' : False
207 }
208    
209 
210 
211 
212 #if oldFlagDefault:
213 #   if doESD :
214 #      for o in [ o for o in RecExCommonAlgs.keys() if not o in varInit ]:
215 #         exec '%s = RecExCommonAlgs[ "%s" ]' % (o,o)      
216 #   else:
217 #      logRecExCommon_flags.info("By default switch off all algorithms")
218 #      # make sure RecExCommonAlgs is consistent (necessary for clarity   
219 #      for o in [ o for o in RecExCommonAlgs.keys() if o in varInit ]:
220 #         exec 'RecExCommonAlgs["%s"] = %s' % (o,o)
221 #      for o in [ o for o in RecExCommonAlgs.keys() if not o in varInit ]:
222 #         exec '%s = False' % (o)
223 
224 
225 
226 # merge Algs flag with the other flags for future reference
227 RecExCommonFlags.update (AthenaCommonFlags)
228 RecExCommonFlags.update (RecExCommonAlgs)
229 
230 
231 
232 
233 varInit=dir()
234 
235 # mgallas 
236 logRecExCommon_flags.info('starting the migration to JobProperties')
237 
238 # first update RecExCommonFlags value according to variable set
239 for i in RecExCommonFlags.keys(): 
240    if i in varInit:
241       i_value=eval(str(i))
242       if not i_value == RecExCommonFlags[i]:
243          logRecExCommon_flags.info( 'updating %s to value %s ' ,i,i_value)
244          RecExCommonFlags[i]=i_value
245 #   else:
246 #      raise RuntimeError, ( ' Variable %s is in RecExCommonFlags but not in varInit. Impossible !', i)
247 
248 if rec.OutputLevel() <= DEBUG:
249    print "RecExCommon Flags values:"
250    print RecExCommonFlags
251 # at this step RecExCommonFlags is consistent with the variables
252 # i.e. doTruth=True ==> RecExCommonFlags['doTruth"]=True
253 
254 
255 # now update the job properties from the RecExCommonFlags
256 #  only if steering from old flags
257 from RecExConfig.RecFlags  import jobproperties, rec
258 
259 
260 from RecExConfig.RecAlgsFlags  import recAlgs
261 
262 from AthenaCommon.GlobalFlags import globalflags
263 
264 # only necessary during migration
265 try:
266    from CaloRec.CaloRecFlags import jobproperties
267    CaloRecFlagsOK=True
268 except Exception:
269    treatException("Could not instantiate CaloRecFlags ")
270    CaloRecFlagsOK=False
271 
272 try:
273    # horrible hack for commissioning InDetFlags should test on rec.Commissioning
274  #   if rec.Commissioning and jobproperties.Beam.beamType=='collisions':
275  #      jobproperties.Beam.beamType.unlock() 
276  #      jobproperties.Beam.beamType='cosmics'
277  #      from InDetRecExample.InDetJobProperties import InDetFlags
278  #      jobproperties.Beam.beamType.set_Value_and_Lock('collisions')
279  #   else:
280  #      from InDetRecExample.InDetJobProperties import InDetFlags
281    from InDetRecExample.InDetJobProperties import InDetFlags
282    # change default here
283    InDetFlags.doxKalman=False
284 except Exception:
285    treatException("Could not instantiate InDetFlags ")
286 
287 
288 try:
289    from MuonRecExample.MuonRecFlags import muonRecFlags
290 except Exception:
291    treatException("Could not instantiate muonRecFlags ")
292 
293 try:
294    from MuonRecExample.MuonCBNTFlags import muonCBNT
295 except Exception:
296    treatException("Could not instantiate muonCBNT ")
297 
298 try:
299    from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags
300 except Exception:
301    treatException("Could not instantiate muonCombinedRecFlags ")
302 
303 
304 try:
305    from tauRec.tauRecFlags import jobproperties
306    tauRecFlagsOK=True
307 except Exception:
308    treatException("Could not instantiate tauRecFlags ")
309    tauRecFlagsOK=False
310 
311 try:
312    from JetRec.JetRecFlags import jobproperties
313    JetRecFlagsOK=True
314 except Exception:
315    JetRecFlagsOK=False
316    pass
317 
318 try:
319    from egammaRec.egammaRecFlags import jobproperties
320    egammaRecFlagsOK=True
321 except Exception:
322    treatException("Could not instantiate egammaRecFlags ")
323    egammaRecFlagsOK=False
324 
325 #print jobproperties
326 
327 varInit=dir()
328 
329 # only take old flag if explicitly set
330 if not rec.oldFlagTopSteering() :
331    logRecExCommon_flags.info( 'Steering from old flags disabled!')
332 else:
333    logRecExCommon_flags.info( 'Synchronising  old flags to new flags')
334    for i in RecExCommonFlags.keys():
335     inew=i
336     # hack handle name mismatch
337     if i=="donewTracking":
338        inew="doNewTracking"
339     # hack do not map doTrigger to rec.doTrigger but to recAlgs.doTrigger   
340     if jobproperties.Rec.__dict__.keys().__contains__(i) and i != "doTrigger" : 
341        if i in varInit:
342           exec 'i_value=%s' % (i)
343           data={'JobProperties.Rec':{i:i_value}}
344           jobproperties._log.info('RecExCommon_flags:: migration data %s',data)  
345           jobproperties.set_JobProperties(data)
346        else:
347           exec 'jpvalue=jobproperties.Rec.%s()' % (i)
348           i_value=RecExCommonFlags.get(i)
349           if i_value!=jpvalue:
350              logRecExCommon_flags.warning ('inconsistency: for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
351 
352     if(jobproperties.MuonCombinedRec.__dict__.keys().__contains__(inew)):
353        if i in varInit:
354           # i_value=RecExCommonFlags.get(i)
355           exec 'i_value=%s' % (i)
356           data={'JobProperties.MuonCombinedRec':{inew:i_value}}
357           jobproperties._log.info('RecExCommon_flags:: migration LOCKED data %s',data)  
358           jobproperties.set_JobProperties(data)
359           #for RecAlgFlags : lock the value
360           exec 'jobproperties.MuonCombinedRec.%s._locked=True' % (inew)
361        else:
362           exec 'jpvalue=jobproperties.MuonCombinedRec.%s()' % (inew)
363           i_value=RecExCommonFlags.get(i)
364           if i_value!=jpvalue:
365              logRecExCommon_flags.warning ('inconsistency: for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
366     if(jobproperties.Rec.RecAlgs.__dict__.keys().__contains__(i)):
367        if i in varInit:
368           # i_value=RecExCommonFlags.get(i)
369           exec 'i_value=%s' % (i)
370           data={'JobProperties.Rec.RecAlgs':{i:i_value}}
371           jobproperties._log.info('RecExCommon_flags:: migration LOCKED data %s',data)  
372           jobproperties.set_JobProperties(data)
373           #for RecAlgFlags : lock the value
374           exec 'recAlgs.%s._locked=True' % (i)
375        else:
376           exec 'jpvalue=jobproperties.Rec.RecAlgs.%s()' % (i)
377           i_value=RecExCommonFlags.get(i)
378           if i_value!=jpvalue:
379              logRecExCommon_flags.warning ('inconsistency: for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
380     if(CaloRecFlagsOK and jobproperties.CaloRecFlags.__dict__.keys().__contains__(i)):
381        if i in varInit:
382           # i_value=RecExCommonFlags.get(i)
383           exec 'i_value=%s' % (i)
384           data={'JobProperties.CaloRecFlags':{i:i_value}}
385           jobproperties._log.info('RecExCommon_flags:: migration LOCKED data %s',data)  
386           jobproperties.set_JobProperties(data)
387           #for RecAlgFlags : lock the value
388           exec 'jobproperties.CaloRecFlags.%s._locked=True' % (i)
389        else:
390           exec 'jpvalue=jobproperties.CaloRecFlags.%s()' % (i)
391           i_value=RecExCommonFlags.get(i)
392           if i_value!=jpvalue:
393              logRecExCommon_flags.warning ('inconsistency: for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
394     elif(tauRecFlagsOK and jobproperties.tauRecFlags.__dict__.keys().__contains__(i)):
395        if i in varInit:
396           # i_value=RecExCommonFlags.get(i)
397           exec 'i_value=%s' % (i)
398           data={'JobProperties.tauRecFlags':{i:i_value}}
399           jobproperties._log.info('RecExCommon_flags:: migration LOCKED data %s',data)  
400           jobproperties.set_JobProperties(data)
401           #for RecAlgFlags : lock the value
402           exec 'jobproperties.tauRecFlags.%s._locked=True' % (i)
403        else:
404           exec 'jpvalue=jobproperties.tauRecFlags.%s()' % (i)
405           i_value=RecExCommonFlags.get(i)
406           if i_value!=jpvalue:
407              logRecExCommon_flags.warning ('inconsistency: for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
408     if(jobproperties.InDetJobProperties.__dict__.keys().__contains__(inew)):
409        if i in varInit:
410           # i_value=RecExCommonFlags.get(i)
411           exec 'i_value=%s' % (i)
412           data={'JobProperties.InDetJobProperties':{inew:i_value}}
413           jobproperties._log.info('RecExCommon_flags:: migration LOCKED data %s',data)  
414           jobproperties.set_JobProperties(data)
415           #for RecAlgFlags : lock the value
416           exec 'jobproperties.InDetJobProperties.%s._locked=True' % (inew)
417        else:
418           exec 'jpvalue=jobproperties.InDetJobProperties.%s()' % (inew)
419           i_value=RecExCommonFlags.get(i)
420           if i_value!=jpvalue:
421              logRecExCommon_flags.warning ('inconsistency: for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
422     if(jobproperties.MuonRec.__dict__.keys().__contains__(inew)):
423        if i in varInit:
424           # i_value=RecExCommonFlags.get(i)
425           exec 'i_value=%s' % (i)
426           data={'JobProperties.MuonRec':{inew:i_value}}
427           jobproperties._log.info('RecExCommon_flags:: migration LOCKED data %s',data)  
428           jobproperties.set_JobProperties(data)
429           #for RecAlgFlags : lock the value
430           exec 'jobproperties.MuonRec.%s._locked=True' % (inew)
431        else:
432           exec 'jpvalue=jobproperties.MuonRec.%s()' % (inew)
433           i_value=RecExCommonFlags.get(i)
434           if i_value!=jpvalue:
435              logRecExCommon_flags.warning ('inconsistency: for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
436     if(jobproperties.Global.__dict__.keys().__contains__(i)):
437        if i in varInit:
438           exec 'i_value=%s' % (i)
439           data={'JobProperties.Global':{i:i_value}}
440           jobproperties._log.info('RecExCommon_flags:: migration data %s',data)  
441           jobproperties.set_JobProperties(data)
442 
443        else:
444           i_value=RecExCommonFlags.get(i)
445           exec 'jpvalue=jobproperties.Global.%s()' % (i)
446           if i_value!=jpvalue:
447              logRecExCommon_flags.warning ('inconsistency: for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
448 
449     if(jobproperties.AthenaCommonFlags.__dict__.keys().__contains__(i)):
450        if i in varInit:
451           exec 'i_value=%s' % (i)
452           data={'JobProperties.AthenaCommonFlags':{i:i_value}}
453           jobproperties._log.info('RecExCommon_flags:: migration data %s',data)
454           jobproperties.set_JobProperties(data)
455        else:   
456           i_value=RecExCommonFlags.get(i)
457           exec 'jpvalue=jobproperties.AthenaCommonFlags.%s()' % (i)
458           if i!="PoolRDOInput":
459             if i_value!=jpvalue:
460                logRecExCommon_flags.warning ('inconsistency: for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
461           else:   
462             if i_value!=jpvalue:
463                logRecExCommon_flags.info ('Modified value for flag %s new flag: %s old flag:%s',i,jpvalue,i_value)
464 ##     else:
465 ##        # warning if failure in migration.
466 ##        # BackNavigation is special being in RecConfFlags
467 ##        if i!= 'doBackNavigation' and i!= 'doJetRec' and i!= 'doFloatingPointException':
468 ##           logRecExCommon_flags.warning('JobProperties does not know about %s ',i)
469 
470 
471 
472 # some special migration
473 if rec.oldFlagTopSteering() and 'doBackNavigation' in varInit:
474    from RecExConfig.RecConfFlags import recConfFlags
475    recConfFlags.AllowBackNavigation=doBackNavigation
476 
477 
478 
479 
480 try:
481    import os
482    # first check if NICOS (ATN test)
483    _env=os.environ
484    NICOS_NIGHTLY_NAME=''
485    NICOS_PROJECT_RELNAME_COPY=''   
486    try:
487       NICOS_NIGHTLY_NAME=_env['NICOS_NIGHTLY_NAME']
488       NICOS_PROJECT_RELNAME_COPY=_env['NICOS_PROJECT_RELNAME_COPY']
489       logRecExCommon_flags.info('Detected NICOS name %s and copy  %s'%(NICOS_NIGHTLY_NAME,NICOS_PROJECT_RELNAME_COPY) )
490    except Exception:
491       pass
492 
493    if NICOS_NIGHTLY_NAME!='':
494       # we are running in NICOS environment
495       if NICOS_PROJECT_RELNAME_COPY=='rel_0' and (NICOS_NIGHTLY_NAME=='15.X.0' or NICOS_NIGHTLY_NAME=='15.X.0-VAL'):
496          logRecExCommon_flags.warning('Detected a dev or devval rel_0 nightly running NICOS. Enabling floating point exception ')
497          rec.doFloatingPointException=True
498    else:
499       # we are running in afs context
500       _path=_env['PATH']
501       if  _path.find('/afs/cern.ch/atlas/software/builds/nightlies/dev/AtlasCore/rel_0/')>=0 or _path.find('/afs/cern.ch/atlas/software/builds/nightlies/devval/AtlasCore/rel_0/')>=0:
502          logRecExCommon_flags.warning('Detected a dev or devval rel_0 nightly. Enabling floating point exception ')
503          rec.doFloatingPointException=True
504       del _path
505    del _env
506 except Exception:
507    treatException ("Trouble detecting doFloatingPointException condition")
508                                     
509 
510 
511 
512 # some special migration (temporary)
513 if rec.doFloatingPointException() and not athenaCommonFlags.isOnline():
514    from AthenaCommon.AthenaCommonFlags  import athenaCommonFlags
515    athenaCommonFlags.RuntimeStrictness='abort'
516 else:
517    from AthenaCommon.AthenaCommonFlags  import athenaCommonFlags
518    athenaCommonFlags.RuntimeStrictness='none'
519 
520 #enable floating point exception
521 ## if not athenaCommonFlags.isOnline():
522 ##    from AthenaCommon.AthenaCommonFlags  import athenaCommonFlags
523 ##    athenaCommonFlags.RuntimeStrictness='abort'
524 
525 
526 
527 
528 #FIXME temporary
529 if 'doJetRec' in varInit:
530    try:
531       from JetRec.JetRecFlags import jobproperties
532       jobproperties.JetRecFlags.Enabled.set_Value(doJetRec)
533    except Exception:
534       treatException("Could not set JetRecFlags.Enabled")
535 
536       
537 
538 
539 varInit=dir()
540 #delete again !
541 if not rec.oldFlagCompatibility():
542    print "oldFlagCompatibility==True : Deleting all standalone flags!"
543    for i in RecExCommonFlags.keys(): 
544       # delete old flags unless required otherwise
545       if i in varInit:
546          print "now deleting:",i
547          exec 'del %s' % i
548 
549 
550 
551    
552  
553 if rec.doWriteRDO():
554    logRecExCommon_flags.info( "write RDO " )
555    # switch off all algorithms
556    rec.doESD=False
557    
558    # switch off CBNT
559    rec.doCBNT=False
560 
561    if rec.readRDO() and globalflags.InputFormat()!='bytestream':
562       # this is a RDO to RDO copy, do not put detector status
563       rec.doDetStatus=False
564    
565 if rec.readAOD() and rec.readESD():
566    raise RuntimeError," readAOD and readESD cannot be on together" 
567 
568 if rec.readAOD():
569    logRecExCommon_flags.info( "read AOD : all algs switched off " )
570    # switch off all algorithms
571    rec.doESD=False
572    rec.doWriteESD=False
573    if rec.readRDO:
574       logRecExCommon_flags.info( "readAOD : switch readRDO off " )
575       rec.readRDO=False
576 
577 
578 if rec.readESD() :
579    logRecExCommon_flags.info( "read ESD : all algs switched off " )
580    # switch off all algorithms
581    rec.doESD=False
582 
583 
584    if rec.readRDO():
585       logRecExCommon_flags.info( "readESD : switch readRDO off " )
586       rec.readRDO=False
587 
588 
589 if not (rec.readRDO() or rec.readESD() or rec.readAOD()):
590    raise RuntimeError," at least one of readRDO readESD readAOD should be on !!!"
591 
592 
593 
594 if athenaCommonFlags.FilesInput()!=[]:
595    logRecExCommon_flags.info("athenaCommonFlags.FilesInput override input file specification")
596    # first scan all files and WARN about non existing files (do not try to fix)
597    # spot first existing file
598    firstValid=-1
599    import PyUtils.AthFile as athFile
600    iFi=0
601    for fi in athenaCommonFlags.FilesInput():   
602       if athFile.exists(fi):
603          if firstValid==-1:
604             firstValid=iFi
605             firstValidFi=fi
606       else:
607          logRecExCommon_flags.warning("File %s does not exist. Continue" % fi)
608          ++iFi
609    if firstValid==-1:
610       raise RunTimeError," no existing input file detected. Stop here."
611    else:
612       logRecExCommon_flags.info("Now configuring flags according to input file %s " % athenaCommonFlags.FilesInput()[iFi])
613       if len(athenaCommonFlags.FilesInput())>1:
614          logRecExCommon_flags.info("Be careful that all the input files should be consistent")
615          #FIXME : optionally check all files ?
616        
617    # now spot if file is a BS one
618    fileType=athFile.ftype(firstValidFi)
619    if fileType=="bs":
620       if not rec.readRDO():
621          raise RuntimeError, "athenaCommonFlags.FilesInput are bytestream files but rec.readRDO is False !"
622       try:
623          GlobalFlags.InputFormat.set_bytestream()
624       except Exception:
625          logRecExCommon_flags.warning("GlobalFlags.InputFormat already set")    
626       athenaCommonFlags.BSRDOInput=athenaCommonFlags.FilesInput()
627    else:
628       # now we only have pool files in input
629       import PyUtils.PoolFile as poolFile
630       try:
631          streams = poolFile.extract_stream_names (firstValidFi)
632       except Exception:   
633          logRecExCommon_flags.warning("Exception extracting streams from input file %s " % firstValidFi )
634 
635 
636       logRecExCommon_flags.info("Extracted streams %s from input file " % streams )   
637       if len(streams)==0:
638          logRecExCommon_flags.warning("No stream in input file. Default action.")   
639       elif len(streams)>1:
640          logRecExCommon_flags.warning("More than one stream: %s in input file. Default action.")   
641 
642       if len(streams)==1:
643          if streams[0]=='Stream1':
644             logRecExCommon_flags.info("Input RDO detected")   
645          elif streams[0]=='StreamESD':
646             logRecExCommon_flags.info("Input ESD detected. Do not remake ESD")               
647             rec.readRDO=False
648             rec.readESD=True            
649             rec.doESD=False
650          elif streams[0]=='StreamAOD':
651             logRecExCommon_flags.info("Input AOD detected. Do not remake ESD nor AOD.")               
652             rec.readRDO=False
653             rec.readAOD=True            
654             rec.doESD=False
655             rec.doAOD=False            
656          elif streams[0]=='TAG':
657             logRecExCommon_flags.info("Input TAG detected. Default is to navigate to AOD. Do not remake ESD nor AOD")               
658             rec.readRDO=False
659             rec.readTAG=True
660             # by default tag navigate to AOD
661             rec.readAOD=True                        
662             rec.doESD=False
663             rec.doAOD=False            
664             rec.doWriteTAG=False
665          else:
666             logRecExCommon_flags.info ("unknown stream detected %s keep default ",streams[0])
667 
668 
669       if rec.readTAG():
670          athenaCommonFlags.PoolTAGInput=athenaCommonFlags.FilesInput()         
671       else:   
672          if rec.readRDO():
673             athenaCommonFlags.PoolRDOInput=athenaCommonFlags.FilesInput()
674          elif rec.readESD():
675             athenaCommonFlags.PoolESDInput=athenaCommonFlags.FilesInput()
676          elif rec.readAOD():
677             athenaCommonFlags.PoolAODInput=athenaCommonFlags.FilesInput()
678          elif rec.readAOD():
679             athenaCommonFlags.PoolAODInput=athenaCommonFlags.FilesInput()
680    
681 
682 
683 
684 #now read input file to set up some flags accordingly if possible
685 # load an OKS with the input data file
686 from AthenaCommon.Include import excludeTracePattern
687 excludeTracePattern.append("*/PyUtils/*")
688 
689 
690 
691 # get OKS from input file. Lock first the flags, because any further modification might lead to inconsistency.
692 rec.readRDO.lock()
693 rec.readESD.lock()
694 rec.readAOD.lock()
695 rec.readTAG.lock()
696 athenaCommonFlags.FilesInput.lock()
697 athenaCommonFlags.PoolRDOInput.lock()
698 athenaCommonFlags.PoolESDInput.lock()
699 athenaCommonFlags.PoolAODInput.lock()
700 athenaCommonFlags.PoolTAGInput.lock()
701 globalflags.InputFormat.lock()
702 
703 oksInputFileOriginal=None
704 
705 from RecExCond.RecFlagFunctions import inputFileNames
706 
707 if globalflags.InputFormat()=='pool':
708    try:
709       from AthenaCommon.KeyStore import loadKeyStoreFromPoolFile
710       _inputFile=inputFileNames()[0]
711       logRecExCommon_flags.info("Determined first input file %s",_inputFile)
712       oksInputFileOriginal = loadKeyStoreFromPoolFile(keyStore="inputFileOriginal",pool_file=_inputFile,label='inputFile')
713       del _inputFile
714    except Exception:        
715       logRecExCommon_flags.warning("could not load oks from input file %s . Either file does not exist either a LFN." % _inputFile )
716       #treatException("could not load oks from input file %s . Either file does not exist either a LFN." % _inputFile )
717 
718 
719 # if no truth in input file, switch doTruth to false
720 if rec.doTruth() and  oksInputFileOriginal!=None and not oksInputFileOriginal.inputFile.dict().has_key("McEventCollection"):
721    logRecExCommon_flags.info("No McEventCollection in input file. Switching doTruth=False")
722    rec.doTruth=False
723    # check again, emit warning if lock 
724    if rec.doTruth():
725       logRecExCommon_flags.warning("No McEventCollection in input file. Could not switch doTruth=False. Continue at your own risk.")
726             
727         
728 
729 
730 
731 
732 
733 #load commissioning flags here (major cleanup needed)
734 if rec.Commissioning():
735    #--------------------------------------------------------------
736    # Common flags with RecExCommon
737    #--------------------------------------------------------------
738    #if rec.readRDO:
739    #   include( "RecExCommission/RecExCommissionCommonFlags_jobOptions.py" )
740 
741 
742    # ---------------------------------------------------------------------------
743    # AthenaCommonFlags
744    # ---------------------------------------------------------------------------
745 
746    # start using the new job properties
747    from AthenaCommon.JobProperties import jobproperties
748 
749    # AthenaCommon flags
750    from AthenaCommon.AthenaCommonFlags  import athenaCommonFlags
751 
752    # -----------------------------------------------------------------------
753    # being general reconstruction flags
754    # -----------------------------------------------------------------------
755    from RecExConfig.RecFlags  import jobproperties, rec
756 
757    athenaCommonFlags.PoolInputQuery = "TRT_Cosmic_Tracks"
758    # GlobalFlags 
759    from AthenaCommon.GlobalFlags import globalflags
760 
761    rec.RootHistoOutput = "monitoring.root"  
762    rec.RootNtupleOutput = "ntuple.root" 
763 
764    ### Switch on/off Combined Algorithms (to be checked)
765    #from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags,muidFlags
766    #muonCombinedRecFlags.doMuGirl = False
767    #muonCombinedRecFlags.doCaloTrkMuId = True
768    #muonCombinedRecFlags.doStaco = False
769    #muonCombinedRecFlags.doMuTag = False
770    #muonCombinedRecFlags.doAODMuons = True  # switch off AOD making
771    #muonCombinedRecFlags.doMergeMuons = True # switch off merging for ESD
772    #muidFlags.SegmentTagger = 'MuTagIMO' # switch off  by ''
773    ##muidFlags.Extrapolated = 'MuidStandalone' # switch off  by ''
774    #muidFlags.Extrapolated = '' # switch off  by ''
775    ##muidFlags.Combined = 'MuidCombined' # NOW not run # switch off  by ''
776    #muidFlags.Combined = 'CombinedMuonFit' # switch off  by ''
777 
778 
779    # ----------------------------------------------------------------------
780    # being flags to switch algorithm on/off
781    # ----------------------------------------------------------------------
782    from RecExConfig.RecAlgsFlags  import recAlgs
783 
784    #recAlgs.doTrigger 
785 
786    #
787    # hack...
788    #
789    from RecExConfig.RecFlags import rec
790    if not 'InDetKeys' in dir():
791        #
792        # --- setup StoreGate keys (JobProperties!)
793        #
794        print "InDetRec_jobOptions: InDetKeys not set before - I import them now"
795        from InDetRecExample.InDetKeys import InDetKeys
796    #    InDetKeys.lock_JobProperties()
797 
798 
799    #--------------------------------------------------------------
800    # Internal flags for ATLAS RecExCommission
801    #--------------------------------------------------------------
802    include( "RecExCommission/RecExCommissionFlags_jobOptions.py" )
803    if rec.readESD() or rec.readAOD():
804       ATLASCosmicFlags.doFilteredESD=False
805       ATLASCosmicFlags.doCalibFillNt = False
806       
807 
808 
809    # Number of events to be processed
810    theApp.EvtMax = athenaCommonFlags.EvtMax()
811 
812 
813    if rec.readESD():
814        rec.doHist = False
815        ATLASCosmicFlags.doLVL1Calo = False
816        ATLASCosmicFlags.doCTPMon=False
817    #    rec.doCBNT = True
818 
819    if athenaCommonFlags.isOnline:
820        rec.doWriteTAG = False
821        rec.doWriteTAGCOM = False    
822        rec.doWriteESD = False
823        rec.doDetStatus=False
824        rec.doHist=False
825        
826    #--------------------------------------------------------------
827    # Internal flags for each subsystem
828    #--------------------------------------------------------------
829 
830 
831    # MuDet
832    if rec.doMuon() and rec.doESD():
833 
834        from MuonRecExample.MuonRecFlags import muonRecFlags
835        from MuonCalibAlgs.MuonCalibFlags import muonCalibFlags
836 
837        muonRecFlags.doCalib = ATLASCosmicFlags.doCalibFillNt
838        # muonCalibFlags.Mode = 'trackNtuple'    
839        #muonRecFlags.dataPeriod = ATLASCosmicFlags.CosmicSetup  
840 
841        if globalflags.DataSource()=='geant4' and ATLASCosmicFlags.doMasking:
842            #MW/RN MuDetCosmicFlags.doSelectPRD = True
843            muonRecFlags.doPrdSelect = True
844 
845 
846 
847 
848        from AthenaCommon.BFieldFlags import jobproperties
849        # monitoring
850        from MuonDQAMonFlags.MuonDQAFlags import MuonDQAFlags as MuonDQAFlags
851        MuonDQAFlags.doMuonMon = ATLASCosmicFlags.doMuonMon
852        MuonDQAFlags.doMuonEvtMon = ATLASCosmicFlags.doMuonEvtMon
853        MuonDQAFlags.doMuonHitMon = ATLASCosmicFlags.doMuonHitMon
854        MuonDQAFlags.doMDTMon = ATLASCosmicFlags.doMDTMon
855        MuonDQAFlags.doRPCMon = ATLASCosmicFlags.doRPCMon
856        MuonDQAFlags.doRPCL1Mon = ATLASCosmicFlags.doRPCL1Mon
857        MuonDQAFlags.doMDTRPCMon = ATLASCosmicFlags.doMDTRPCMon
858        MuonDQAFlags.doMDTTGCL1Mon = ATLASCosmicFlags.doMDTTGCL1Mon
859        MuonDQAFlags.doCSCMon = ATLASCosmicFlags.doCSCMon
860        MuonDQAFlags.doTGCMon = ATLASCosmicFlags.doTGCMon
861        MuonDQAFlags.doTGCL1Mon = ATLASCosmicFlags.doTGCL1Mon
862        MuonDQAFlags.doMuonSegmMon = ATLASCosmicFlags.doMuonSegmMon
863        MuonDQAFlags.doMuonTrackMon = ATLASCosmicFlags.doMuonTrackMon
864        MuonDQAFlags.doMuonPhysMon = ATLASCosmicFlags.doMuonPhysMon
865        MuonDQAFlags.MuonTrkMonDoTrigger = False
866 
867 
868 
869    # LAr
870    from LArConditionsCommon.LArCondFlags import larCondFlags
871    if rec.doESD() and rec.doLArg():
872        if larCondFlags.OFCShapeFolder=='5samples3bins17phases':
873            doLAr3nsOFCs = True
874        else:
875            doLAr3nsOFCs = False
876        include( "CaloCosEx/LArCosmicFlags_jobOptions.py" )
877        if globalflags.DataSource()=='geant4':
878            LArCosmicFlags.doSim = True
879        else:
880            LArCosmicFlags.doSim = False
881    #        if not "LArCoolChannelSelection" in dir():
882            if larCondFlags.LArCoolChannelSelection=='':
883                if ATLASCosmicFlags.CosmicSetup == 'M6':
884                    larCondFlags.LArCoolChannelSelection="0,92:116,206:230,232,234,236,238,1003,1007,1009,1011"
885                if ATLASCosmicFlags.CosmicSetup == 'M7':    
886                    #LArCoolChannelSelection="3:238,306,313,319,325,331,338,344,350,1001:1012,1021,1022"
887                    larCondFlags.LArCoolChannelSelection="35:66,92:116,149:180,206:230,232,234,236,238,331,338,344,350,1001,1003,1005,1007,1011,1021"
888 
889        if globalflags.DataSource()=='geant4' and ATLASCosmicFlags.doMasking:
890            if ATLASCosmicFlags.CosmicSetup == 'M6':
891                MaskedLArCells=["0 0","0 1","1 0"]        
892    # Tile
893    if rec.doESD() and rec.doTile():
894        include( "CaloCosEx/TileCosmicFlags_jobOptions.py" )
895        if globalflags.DataSource()=='geant4':
896            TileCosmicFlags.doSim = True
897        else:
898            TileCosmicFlags.doSim = False
899        TileCosmicFlags.doMasking = ATLASCosmicFlags.doMasking
900        TileCosmicFlags.CosmicSetup = ATLASCosmicFlags.CosmicSetup
901        TileCosmicFlags.storeTileCellDetails = True
902 
903    if rec.doESD() and ATLASCosmicFlags.doCTPMon:
904        include("TrigT1CTMonitoring/CTPFlags.py")
905    #    CTPFlags.doMuRIO = False
906        # this alg has a horrible mem issue - to be understood!
907 
908    # FIXME obsolete flags (should be removed)!!!
909    # ------------------------------------
910    # import GlobalFlags from RecExCommon
911    # ------------------------------------
912    # new flag
913    rec.Commissioning=True
914    rec.ScopingLevel=4 
915 
916    from AthenaCommon.GlobalFlags import GlobalFlags    
917 
918    if jobproperties.Beam.beamType()=='cosmics':
919        GlobalFlags.DetGeo.set_commis()
920    else:
921        GlobalFlags.DetGeo.set_atlas()
922 
923    if globalflags.DataSource()=='geant4':
924        GlobalFlags.DataSource.set_geant4()
925    if globalflags.InputFormat() == 'pool':
926        GlobalFlags.InputFormat.set_pool()
927 
928    if globalflags.DataSource()=='data':
929        GlobalFlags.DataSource.set_data()
930    if globalflags.InputFormat() == 'bytestream':
931        GlobalFlags.InputFormat.set_bytestream()
932 
933 
934    # Set Global tag for IOVDbSvc
935    from AthenaCommon.GlobalFlags import jobproperties
936    if globalflags.DataSource()=='geant4':
937        if ATLASCosmicFlags.IOVDbSvcGlobalTagSimOverride:
938            jobproperties.Global.ConditionsTag.set_Value_and_Lock(ATLASCosmicFlags.IOVDbSvcGlobalTagSim)
939        else:
940            jobproperties.Global.ConditionsTag.set_Value_and_Lock('')
941    else:
942        jobproperties.Global.ConditionsTag.set_Value_and_Lock(ATLASCosmicFlags.IOVDbSvcGlobalTagData)
943        #svcMgr.IOVDbSvc.ManagePoolConnections = True  #Close POOL files at the end of the first event
944 
945    from IOVDbSvc.CondDB import conddb
946    conddb.setGlobalTag(globalflags.ConditionsTag())
947 
948 
949 
950 
951 
952 # FIXME should not be there as soon as JobProperties is updated  
953 athenaCommonFlags.SkipEvents.set_On()
954 
955 logRecExCommon_flags.info('done the mapping in between the old flags and JobProperties')
956 # mgallas end 
957 
958 
959 
960 # if production switch off resilience
961 if rec.Production():
962    athenaCommonFlags.AllowIgnoreConfigError=False
963    from RecExConfig.RecConfFlags import recConfFlags   
964    recConfFlags.AllowIgnoreConfigError=False
965 #take default values
966 #recConfFlags.AllowIgnoreExistingDataObject=True
967 #recConfFlags.AllowIgnoreConfigError=True
968 #recConfFlags.AllowDisable=True
969 #recConfFlags.AllowBackNavigation=False
970 
971 
972 
973 if not rec.oldFlagTopSteering and rec.oldFlagCompatibility:
974    raise RuntimeError,"rec.oldFlagTopSteering false inconsistent with rec.oldFlagCompatibility true"
975 
976 
977    # put back oldFlagCompatibility which has just been deleted ! Needed further down.   
978    #oldFlagCompatibility=False   
979 
980 #now some compatibility set up and check
981 
982 
983 
984 
985 include ("RecExCond/RecExCommon_DetFlags.py")
986 
987 
988 
989 # if bytestream no truth
990 if globalflags.InputFormat.is_bytestream():
991    logRecExCommon_flags.info("No truth in bytestream, setting doTruth=False")    
992    rec.doTruth=False   
993 
994 import os
995 # edm monitor (so far only id)
996 if os.environ['CMTCONFIG'].endswith('-dbg'):
997   rec.doEdmMonitor=True 
998 else:
999   rec.doEdmMonitor=False 
1000 
1001 
1002 if not rec.doESD():
1003    # switch off all algorithms unless was explicitly switched on
1004    for algflag in jobproperties.Rec.RecAlgs.__dict__.keys():
1005    ##   # ugly but necessary
1006       if not algflag in ["__name__","_context_name"]:
1007          data={'JobProperties.Rec.RecAlgs':{algflag:False}}
1008          jobproperties._log.info('RecExCommon_flags:: migration data %s',data)  
1009          jobproperties.set_JobProperties(data)
1010 
1011    try:      
1012       from CaloRec.CaloRecFlags import jobproperties
1013       jobproperties.CaloRecFlags.Enabled=False
1014    except Exception:
1015       treatException("Could not instantiate CaloRecFlags")
1016 
1017    try:
1018       from InDetRecExample.InDetJobProperties import InDetFlags
1019       jobproperties.InDetJobProperties.Enabled=False
1020    except Exception:
1021       treatException("Could not instantiate InDetFlags")
1022 
1023    try:
1024       from MuonRecExample.MuonRecFlags import muonRecFlags
1025       jobproperties.MuonRec.Enabled=False
1026    except Exception:
1027       treatException("Could not instantiate muonRecFlags")
1028 
1029    try:
1030       from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags 
1031       jobproperties.MuonCombinedRec.Enabled=False 
1032    except Exception: 
1033       treatException("Could not instantiate muonCombinedRecFlags") 
1034 
1035    try:
1036       from egammaRec.egammaRecFlags import jobproperties
1037       jobproperties.egammaRecFlags.Enabled=False
1038    except Exception:
1039       treatException("Could not instantiate egammaRecFlags")
1040 
1041    try:
1042       from JetRec.JetRecFlags import jobproperties
1043       jobproperties.JetRecFlags.Enabled=False
1044    except Exception:
1045       treatException("Could not instantiate JetRecFlags")
1046       
1047 
1048    try:
1049       from tauRec.tauRecFlags import jobproperties
1050       jobproperties.tauRecFlags.Enabled=False
1051    except Exception:
1052       treatException("Could not instantiate tauRecFlags")
1053 
1054 
1055 if rec.doESD() and rec.doHeavyIon():
1056    include ("HIRecExample/heavyion_flagsESD.py")
1057 if rec.doAOD() and rec.doHeavyIon():
1058       include ("HIRecExample/heavyion_flagsAOD.py")
1059 
1060 
1061 # minimal reconstruction defaults 
1062 
1063 
1064 if rec.doMinimalRec():
1065    include ("RecExCond/MinimalRec_flagsESD.py")
1066 
1067 
1068 # now translate all the rec.doInDet doCalo etc... into lower level flags
1069 # not complete yet
1070 
1071 _AODFlagsAvailable=True
1072 try:
1073    from ParticleBuilderOptions.AODFlags import AODFlags
1074 except Exception:
1075    _AODFlagsAvailable=False
1076    logRecExCommon_flags.info("AODFlags not available. Ok if AtlasReconstruction")
1077    
1078 if not rec.doInDet:
1079    DetFlags.ID_setOff()
1080    from InDetRecExample.InDetJobProperties import InDetFlags
1081    InDetFlags.Enabled=False
1082    if _AODFlagsAvailable:
1083       AODFlags.FastTrackParticle=False
1084 else:
1085    if rec.Production:
1086       from InDetRecExample.InDetJobProperties import InDetFlags
1087       InDetFlags.doiPatRec=False
1088    
1089 if not rec.doLArg:
1090    DetFlags.LAr_setOff()
1091 
1092 if not rec.doTile:
1093    DetFlags.Tile_setOff()
1094    try:
1095       from CaloRec.CaloRecFlags import jobproperties
1096       jobproperties.CaloRecFlags.doTileMuId=False
1097    except Exception:
1098       
1099       pass
1100 
1101 if not rec.doCalo:
1102    DetFlags.Calo_setOff()
1103    try:
1104       from CaloRec.CaloRecFlags import jobproperties
1105       jobproperties.CaloRecFlags.Enabled=False
1106    except Exception:
1107       pass
1108 
1109 
1110 if not rec.doMuon:
1111    DetFlags.Muon_setOff()
1112    #FIXME redundant
1113    recAlgs.doTrackRecordFilter=False
1114    from MuonRecExample.MuonRecFlags import muonRecFlags
1115    jobproperties.MuonRec.Enabled=False
1116    if _AODFlagsAvailable:
1117       AODFlags.MuonTrackSlimmer=False
1118 
1119 if not rec.doJetMissingETTag:
1120    recAlgs.doMissingET=False
1121    recAlgs.doObjMissingET=False
1122    recAlgs.doMissingETSig=False
1123    recAlgs.doEFlow=False
1124    recAlgs.doEFlowJet=False   
1125    from JetRec.JetRecFlags import jobproperties
1126    jobproperties.JetRecFlags.Enabled.set_Value(False)
1127 
1128    if _AODFlagsAvailable:
1129       AODFlags.ParticleJet=False
1130       AODFlags.JetTag=False
1131       AODFlags.MissingEtTruth=False
1132       AODFlags.TruthParticleJet=False   
1133    
1134 if not rec.doEgamma:
1135    try:
1136       jobproperties.egammaRecFlags.Enabled=False
1137    except Exception:
1138       pass
1139 
1140    if _AODFlagsAvailable:
1141       AODFlags.egammaTrackSlimmer=False
1142    
1143 if not rec.doMuonCombined:
1144    #FIXME a separate container to be used eventually
1145    from MuonCombinedRecExample.MuonCombinedRecFlags import muonCombinedRecFlags
1146    muonCombinedRecFlags.Enabled=False
1147    recAlgs.doMuonSpShower=False # not (yet?) handled by MuonCombinedRecFlags
1148    recAlgs.doMuidLowPt=False    # not (yet?) handled by MuonCombinedRecFlags -- OBSOLETE FLAG ???
1149    
1150 
1151 if not rec.doTau:
1152    try:
1153       jobproperties.tauRecFlags.Enabled=False
1154    except Exception:
1155       pass
1156 
1157 if not rec.doTrigger:
1158    #FIXME a separate container to be used eventually
1159    recAlgs.doTrigger=False
1160    if _AODFlagsAvailable:
1161       AODFlags.Trigger=False # obsolete
1162 
1163    
1164 
1165 #obsolete
1166 readMuonDigit=False
1167 
1168 # internal tracking configuration
1169 #if not 'doNotLoadInDetFlags' in varInit:
1170 #   doNotLoadInDetFlags=False
1171 
1172 
1173 # FIXME functionality is needed !!!
1174 ##    try:
1175 ##       if rec.doLowPt:
1176 ##          include ("InDetRecExample/ConfiguredInDetCutValues.py")
1177 ##          InDetCutValues=ConfiguredInDetCutValues(minPT=0.1*GeV)
1178 
1179 ##       include ( "InDetRecExample/ConfiguredInDetFlags.py" )
1180 ##    except Exception:
1181 ##       logRecExCommon_flags.warning("ConfiguredInDetFlags unavailable. ")
1182 ##       doNotLoadInDetFlags=True
1183 
1184 #if not doNotLoadInDetFlags:
1185 
1186 try:
1187    from InDetRecExample.InDetJobProperties import InDetFlags
1188    if not rec.doTruth():
1189       InDetFlags.doTruth       = False
1190 except Exception:
1191    treatException("Could not instantiate InDetFlags=>switch off ID ")
1192    DetFlags.ID_setOff()
1193 
1194 
1195 ##    if rec.doAODall() and oneTrackingAlg :
1196 ##       if recAlgs.donewTracking() + recAlgs.doiPatRec() +recAlgs.doxKalman() <= 1 :
1197 ##          logRecExCommon_flags.warning('doAODall=True :  more than one tracking alg should be enabled ! So switching doAODall=False')
1198 ##          rec.doAODall=False
1199 ##       else:
1200 ##          InDetFlags.setAODall()
1201 
1202 
1203 if not rec.doTruth() or ( globalflags.DetDescrVersion()[0:3]=="DC1" or globalflags.DetDescrVersion()[0:3]=="DC2" )  :
1204       logRecExCommon_flags.info("TrackRecordFilter alg switched off ")
1205       recAlgs.doTrackRecordFilter=False
1206 
1207 
1208 
1209 
1210 # AOD Flags
1211 if rec.doWriteAOD() and not rec.doAOD() and not rec.readAOD():
1212    logRecExCommon_flags.warning("doAOD False and doWriteAOD True and readAOD False. Most likely meaninglesss !! ")
1213 
1214 
1215 if rec.doWriteTAGCOM() and not rec.Commissioning():
1216    logRecExCommon_flags.info("Not commissioning, switching of doWriteTAGCOM ")
1217    rec.doWriteTAGCOM=False
1218 
1219 # If no AOD objects made, then do not write out a TAG
1220 if not rec.doAOD() and not rec.readAOD() and rec.doWriteTAG():
1221     logRecExCommon_flags.warning("no AOD objects available, cannot write out tag, switching rec.doWriteTAG=False")
1222     rec.doWriteTAG=False
1223 
1224 
1225 
1226 # if want to write tag : at least switch on trigger configuration
1227 doTriggerConfigOnly=False
1228 if rec.doWriteTAG() and not recAlgs.doTrigger() and not ('EventTagFlags' in dir() and not EventTagFlags.doTrigger()) :
1229    try:
1230       from TriggerJobOpts.TriggerFlags import TriggerFlags
1231       doTriggerConfigOnly=True
1232       jobproperties.Trigger.doTriggerConfigOnly=True
1233    except:
1234       logRecExCommon_flags.info("TriggerJobOpts.TriggerFlags not available.")
1235 
1236 if not recAlgs.doTrigger() and not rec.readAOD() and not rec.readESD() and rec.doWriteTAG():
1237     logRecExCommon_flags.warning("no trigger and running from RDO: cannot write out tag, switching of trigger part of tag")
1238     include ('EventTagAlgs/EventTagFlags.py') 
1239     EventTagFlags.set_TriggerOff() 
1240 
1241 
1242 if rec.doAOD() and _AODFlagsAvailable:
1243    from ParticleBuilderOptions.AODFlags import AODFlags
1244 
1245    # make sure AOD truth are off if truth is off
1246    if not rec.doTruth():
1247       AODFlags.SpclMC=False
1248       AODFlags.TruthParticleJet=False
1249       AODFlags.FastSimulation=False
1250 
1251 
1252    AODFlags.FastTrackParticle=rec.doTruth()      
1253 
1254 
1255    AODFlags.Print()
1256 
1257 
1258 
1259 try:
1260    if rec.doTrigger():
1261       from TriggerJobOpts.TriggerFlags import TriggerFlags, sync_Trigger2Reco
1262       sync_Trigger2Reco()
1263 except Exception:
1264    logRecExCommon_flags.info("Could not load TriggerFlags. OK only if AtlasReconstruction")
1265       
1266 
1267 class landmine:
1268    def __nonzero__(self):
1269       raise RuntimeError,"usage of this flag is forbidden!"
1270 
1271 #delete again !
1272 varInit=dir()
1273 if not rec.oldFlagCompatibility():
1274    print "oldFlagCompatibility==True : Deleting all standalone flags! and forbidding use of old flags"
1275    for i in RecExCommonFlags.keys(): 
1276       if i in varInit:
1277          print "deleting again:",i
1278          exec 'del %s' % i
1279       # if true this will prevent reuse of old flags   
1280       if rec.oldFlagLandMine():   
1281          exec '%s=landmine()' % i    
1282 
1283 del _AODFlagsAvailable

source navigation ] diff markup ] identifier search ] general search ]

Due to the LXR bug, the updates fail sometimes to remove references to deleted files. The Saturday's full rebuilds fix these problems
This page was automatically generated by the LXR engine. Valid HTML 4.01!