ATLAS Offline Software
Loading...
Searching...
No Matches
jetMakeRefSamples Namespace Reference

Functions

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

Variables

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

Function Documentation

◆ makeDirAndCd()

jetMakeRefSamples.makeDirAndCd ( dir)

Definition at line 80 of file jetMakeRefSamples.py.

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

◆ runChain()

jetMakeRefSamples.runChain ( inputFile)

Definition at line 172 of file jetMakeRefSamples.py.

172def runChain(inputFile):
173 print ('runChain ', inputFile)
174 while any( [t in os.path.basename(inputFile) for t in ['HITS','RDO','RAW','ESD'] ] ):
175 print ('runStep at ',os.path.basename(inputFile))
176 inputFile = runStep(inputFile)
177 if arg.oneStep:
178 return
179
180

◆ runStep()

jetMakeRefSamples.runStep ( inputFile)

Definition at line 92 of file jetMakeRefSamples.py.

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

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

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

Definition at line 68 of file jetMakeRefSamples.py.

◆ conditionsTagMC

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

Definition at line 67 of file jetMakeRefSamples.py.

◆ default

jetMakeRefSamples.default

Definition at line 41 of file jetMakeRefSamples.py.

◆ defaultData

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

Definition at line 76 of file jetMakeRefSamples.py.

◆ defaultMC

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

Definition at line 75 of file jetMakeRefSamples.py.

◆ geometryVersion

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

Definition at line 66 of file jetMakeRefSamples.py.

◆ help

jetMakeRefSamples.help

Definition at line 40 of file jetMakeRefSamples.py.

◆ inputFile

str jetMakeRefSamples.inputFile = defaultMC

Definition at line 182 of file jetMakeRefSamples.py.

◆ int

jetMakeRefSamples.int

Definition at line 44 of file jetMakeRefSamples.py.

◆ IsCOMMON

bool jetMakeRefSamples.IsCOMMON = True

Definition at line 69 of file jetMakeRefSamples.py.

◆ logFile

str 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 194 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.

◆ str

jetMakeRefSamples.str

Definition at line 40 of file jetMakeRefSamples.py.

◆ type

jetMakeRefSamples.type

Definition at line 40 of file jetMakeRefSamples.py.