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 82 of file jetMakeRefSamples.py.

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

◆ runChain()

def jetMakeRefSamples.runChain (   inputFile)

Definition at line 179 of file jetMakeRefSamples.py.

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

◆ runStep()

def jetMakeRefSamples.runStep (   inputFile)

Definition at line 94 of file jetMakeRefSamples.py.

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

Variable Documentation

◆ action

jetMakeRefSamples.action

Definition at line 44 of file jetMakeRefSamples.py.

◆ arg

jetMakeRefSamples.arg = parser.parse_args()

Definition at line 50 of file jetMakeRefSamples.py.

◆ conditionsTagData

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

Definition at line 70 of file jetMakeRefSamples.py.

◆ conditionsTagMC

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

Definition at line 69 of file jetMakeRefSamples.py.

◆ default

jetMakeRefSamples.default

Definition at line 42 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 78 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 77 of file jetMakeRefSamples.py.

◆ geometryVersion

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

Definition at line 68 of file jetMakeRefSamples.py.

◆ help

jetMakeRefSamples.help

Definition at line 41 of file jetMakeRefSamples.py.

◆ inputFile

string jetMakeRefSamples.inputFile = defaultMC

Definition at line 189 of file jetMakeRefSamples.py.

◆ int

jetMakeRefSamples.int

Definition at line 45 of file jetMakeRefSamples.py.

◆ IsCOMMON

bool jetMakeRefSamples.IsCOMMON = True

Definition at line 71 of file jetMakeRefSamples.py.

◆ logFile

string jetMakeRefSamples.logFile = "output.log"

Definition at line 57 of file jetMakeRefSamples.py.

◆ maxEvents

jetMakeRefSamples.maxEvents = arg.maxEvents

Definition at line 55 of file jetMakeRefSamples.py.

◆ nargs

jetMakeRefSamples.nargs

Definition at line 42 of file jetMakeRefSamples.py.

◆ outputDir

jetMakeRefSamples.outputDir

Definition at line 201 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 24 of file jetMakeRefSamples.py.

◆ skipEvents

int jetMakeRefSamples.skipEvents = 0

Definition at line 56 of file jetMakeRefSamples.py.

◆ specifyCondAndGeo

bool jetMakeRefSamples.specifyCondAndGeo = False

Definition at line 67 of file jetMakeRefSamples.py.

◆ str

jetMakeRefSamples.str

Definition at line 41 of file jetMakeRefSamples.py.

◆ type

jetMakeRefSamples.type

Definition at line 41 of file jetMakeRefSamples.py.

jetMakeRefSamples.runStep
def runStep(inputFile)
Definition: jetMakeRefSamples.py:94
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
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:82
str
Definition: BTagTrackIpAccessor.cxx:11
jetMakeRefSamples.runChain
def runChain(inputFile)
Definition: jetMakeRefSamples.py:179