ATLAS Offline Software
Functions | Variables
jetMakeRefSamples Namespace Reference

Functions

def makeDirAndCd (dir)
 
def runStep (inputFile)
 
def runChain (inputFile)
 

Variables

 parser
 
 type
 
 str
 
 help
 
 nargs
 
 default
 
 action
 
 int
 
 arg = parser.parse_args()
 
 maxEvents = arg.maxEvents
 
int skipEvents = 0
 
string logFile = "output.log"
 
bool specifyCondAndGeo = False
 
string geometryVersion = "ATLAS-GEO-20-00-01"
 
string conditionsTagMC = "OFLCOND-MC12-SDR-06"
 
string conditionsTagData = "COMCOND-BLKPA-RUN1-01"
 
bool IsCOMMON = True
 
string defaultMC = "/afs/cern.ch/atlas/groups/JetEtmiss/ReferenceFiles/RTT/MC/RDO/mc12_8TeV.CurrentRef.RDO.pool.root"
 
string defaultData = "/afs/cern.ch/atlas/groups/JetEtmiss/ReferenceFiles/RTT/DATA/RAW/data12_8TeV.CurrentRef.RAW"
 
string inputFile = defaultMC
 
 outputDir
 

Function Documentation

◆ makeDirAndCd()

def jetMakeRefSamples.makeDirAndCd (   dir)

Definition at line 81 of file jetMakeRefSamples.py.

81 def makeDirAndCd(dir):
82  if not os.path.exists(dir):
83  os.mkdir(dir)
84  elif not arg.overWrite:
85  print ()
86  print ("ERROR !!!")
87  print (" Directory ",dir,'already exists. Not overwriting it (use --overWrite option if needed)')
88  sys.exit(1)
89 
90  os.chdir(dir)
91 
92 

◆ runChain()

def jetMakeRefSamples.runChain (   inputFile)

Definition at line 178 of file jetMakeRefSamples.py.

178 def runChain(inputFile):
179  print ('runChain ', inputFile)
180  while any( [t in os.path.basename(inputFile) for t in ['HITS','RDO','RAW','ESD'] ] ):
181  print ('runStep at ',os.path.basename(inputFile))
182  inputFile = runStep(inputFile)
183  if arg.oneStep:
184  return
185 
186 

◆ runStep()

def jetMakeRefSamples.runStep (   inputFile)

Definition at line 93 of file jetMakeRefSamples.py.

93 def runStep(inputFile):
94  if not os.path.exists(inputFile) and not arg.noRun:
95  print ('ERROR input file ', inputFile , ' missing')
96  sys.exit(2)
97 
98  preExec = ''
99  transform="Reco_tf.py"
100 
101  inputFileBase = os.path.basename(inputFile)
102 
103  if 'HITS' in inputFileBase:
104  inputType = 'HITS'
105  outputType = "RDO"
106  #transform="Digi_trf.py"
107  preExec=""
108 
109  elif "RDO" in inputFileBase:
110  inputType="RDO"
111  inputDataType=inputType
112  outputType="ESD"
113  preExec='''flags.Reco.EnableTrigger=False; flags.Reco.EnableBTagging=False'''
114 
115  elif "RAW" in inputFileBase:
116  inputType="RAW"
117  inputDataType="BS" #bytestream
118  outputType="ESD"
119  preExec='''flags.Reco.EnableTrigger=False'''
120 
121  elif 'ESD' in inputFileBase:
122  inputType="ESD"
123  inputDataType=inputType
124  outputType="AOD"
125  preExec='''flags.Reco.EnableTrigger=False'''
126 
127  else:
128  print ("ERROR RunStep: Input file does not appear to be a supported type (RAW, HITS, RDO, ESD)")
129  print (' -> got', inputFileBase)
130  sys.exit(3)
131 
132  print ("Starting ",inputType, ' to ', outputType)
133 
134 
135  runDir = arg.outputDir + '/' + inputType+'to'+outputType + '/'
136  if not os.path.exists(runDir):
137  os.mkdir(runDir)
138  outputFile = runDir + inputFileBase.replace(inputType, outputType)
139  if arg.overWrite and os.path.exists(outputFile):
140  os.remove(outputFile)
141 
142  outputLog = runDir+'log'
143 
144  if specifyCondAndGeo:
145  # from older sh script
146  fullComand="${transform} preExec=${preExec} input${inputDataType}File=${inputDir}/${inputFile} output${outputType}File=${outputFile} maxEvents=${maxEvents} skipEvents=${skipEvents} geometryVersion=$geometryVersion conditionsTag=$conditionsTag autoConfiguration=everything"
147  else:
148  comandArgs = [ '--preExec='+preExec,
149  '--input%sFile=%s'%(inputDataType, inputFile),
150  '--output%sFile=%s'%(outputType, outputFile),
151  '--maxEvents='+str(maxEvents),
152  '--skipEvents='+str(skipEvents),
153  '--autoConfiguration=everything',
154  #'--postExec=saxasxa'
155  ]
156 
157  print ('Running : ')
158  print (transform, ' '.join(comandArgs))
159  print()
160 
161  if arg.noRun :
162  res = 0
163  else:
164  logfile = open(outputLog, 'w')
165  res = subprocess.call( [transform] + comandArgs, stdout=logfile, stderr=logfile)
166  logfile.close()
167 
168  if res != 0:
169  print ('ERROR RunStep: Transform appears to have failed - exiting. Check ', outputLog)
170  sys.exit(4)
171 
172 
173 
174  print ('Done %s to %s step'%(inputType, outputType))
175  return outputFile
176 
177 

Variable Documentation

◆ action

jetMakeRefSamples.action

Definition at line 43 of file jetMakeRefSamples.py.

◆ arg

jetMakeRefSamples.arg = parser.parse_args()

Definition at line 49 of file jetMakeRefSamples.py.

◆ conditionsTagData

string jetMakeRefSamples.conditionsTagData = "COMCOND-BLKPA-RUN1-01"

Definition at line 69 of file jetMakeRefSamples.py.

◆ conditionsTagMC

string jetMakeRefSamples.conditionsTagMC = "OFLCOND-MC12-SDR-06"

Definition at line 68 of file jetMakeRefSamples.py.

◆ default

jetMakeRefSamples.default

Definition at line 41 of file jetMakeRefSamples.py.

◆ defaultData

string jetMakeRefSamples.defaultData = "/afs/cern.ch/atlas/groups/JetEtmiss/ReferenceFiles/RTT/DATA/RAW/data12_8TeV.CurrentRef.RAW"

Definition at line 77 of file jetMakeRefSamples.py.

◆ defaultMC

string jetMakeRefSamples.defaultMC = "/afs/cern.ch/atlas/groups/JetEtmiss/ReferenceFiles/RTT/MC/RDO/mc12_8TeV.CurrentRef.RDO.pool.root"

Definition at line 76 of file jetMakeRefSamples.py.

◆ geometryVersion

string jetMakeRefSamples.geometryVersion = "ATLAS-GEO-20-00-01"

Definition at line 67 of file jetMakeRefSamples.py.

◆ help

jetMakeRefSamples.help

Definition at line 40 of file jetMakeRefSamples.py.

◆ inputFile

string jetMakeRefSamples.inputFile = defaultMC

Definition at line 188 of file jetMakeRefSamples.py.

◆ int

jetMakeRefSamples.int

Definition at line 44 of file jetMakeRefSamples.py.

◆ IsCOMMON

bool jetMakeRefSamples.IsCOMMON = True

Definition at line 70 of file jetMakeRefSamples.py.

◆ logFile

string jetMakeRefSamples.logFile = "output.log"

Definition at line 56 of file jetMakeRefSamples.py.

◆ maxEvents

jetMakeRefSamples.maxEvents = arg.maxEvents

Definition at line 54 of file jetMakeRefSamples.py.

◆ nargs

jetMakeRefSamples.nargs

Definition at line 41 of file jetMakeRefSamples.py.

◆ outputDir

jetMakeRefSamples.outputDir

Definition at line 200 of file jetMakeRefSamples.py.

◆ parser

jetMakeRefSamples.parser
Initial value:
1 = argparse.ArgumentParser(description=%((os.path.basename(sys.argv[0]),)*3),
2  formatter_class=argparse.RawDescriptionHelpFormatter,
3  )

Definition at line 23 of file jetMakeRefSamples.py.

◆ skipEvents

int jetMakeRefSamples.skipEvents = 0

Definition at line 55 of file jetMakeRefSamples.py.

◆ specifyCondAndGeo

bool jetMakeRefSamples.specifyCondAndGeo = False

Definition at line 66 of file jetMakeRefSamples.py.

◆ str

jetMakeRefSamples.str

Definition at line 40 of file jetMakeRefSamples.py.

◆ type

jetMakeRefSamples.type

Definition at line 40 of file jetMakeRefSamples.py.

jetMakeRefSamples.runStep
def runStep(inputFile)
Definition: jetMakeRefSamples.py:93
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:26
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
Trk::open
@ open
Definition: BinningType.h:40
jetMakeRefSamples.makeDirAndCd
def makeDirAndCd(dir)
Definition: jetMakeRefSamples.py:81
str
Definition: BTagTrackIpAccessor.cxx:11
jetMakeRefSamples.runChain
def runChain(inputFile)
Definition: jetMakeRefSamples.py:178