8 for dir
in os.listdir(
'.'):
9 if(dir.find(
'Plugins')<0) :
continue
18 lines = ( line
for line
in file(
'src/plugin.cc')
19 if (line.find(
'CondFormats')>0
and line.find(
'DataRecord')<0)
22 _f = _f[_f.find(
'CondFormats/')+len(
'CondFormats/'):]
23 return _f[:_f.find(
'/')]
27 lines = ( line
for line
in file(
'src/plugin.cc')
if line[0:3]==
'REG')
29 _ret.append(line[line.find(
',')+1:line.find(
')')])
34 _header =
'/* Condition Objects'
35 _footer =
'\n */\n\n#include "CondFormats/Common/interface/PayloadWrapper.h"\n\n'
40 _newch =
file(
'../../CondFormats/'+package+
'/src/classes_new.h',
'w')
43 _newch.write(_leader+cl)
45 for line
in file(
'../../CondFormats/'+package+
'/src/classes.h'):
50 _header =
'Condition Objects'
52 _ch =
file(
'../../CondFormats/'+package+
'/src/classes.h')
53 if (_ch.readline().
find(_header)<0) :
54 print 'comment header not found in '+package
57 if (line.find(
'*/')>0) :
break
58 _ret.append(line[3:].rstrip())
62 wrapperDeclarationHeader =
"""
63 // wrapper declarations
67 wrapperDeclarationFooter =
"""
73 _newch =
file(
'../../CondFormats/'+package+
'/src/classes_new.h',
'w')
74 for line
in file(
'../../CondFormats/'+package+
'/src/classes.h'):
75 if (line.find(
'wrapper declarations')>0) :
break
77 _newch.write(wrapperDeclarationHeader)
80 _newch.write(
' pool::Ptr<'+cl+
' > p'+str(_n)+
';\n')
81 _newch.write(
' cond::DataWrapper<'+cl+
' > dw'+str(_n)+
';\n')
83 _newch.write(wrapperDeclarationFooter)
87 _wrapperComment =
'<-- wrapper declarations -->\n'
88 _newxml =
file(
'../../CondFormats/'+package+
'/src/classes_def_new.xml',
'w')
89 for line
in file(
'../../CondFormats/'+package+
'/src/classes_def.xml'):
90 if (line.find(
'wrapper declarations')>0) :
break
92 _newch.write_(wrapperComment)
94 _newch.write(
' <class name="pool::Ptr<'+cl+
' >"/>\n')
95 _newch.write(
' <class name="cond::DataWrapper<'+cl+
' >"/>\n')
102 f =
file(
'plugins/BuildFile',
'w')
104 s = string.Template(buildfileTemplate)
105 for classname
in classes:
106 f.write(s.substitute(_PACKAGE_=package, _CLASS_NAME_=classname).
replace(
'-',
''))
109 s = string.Template(wrapperTemplate)
110 for classname
in classes:
111 f =
file(
'plugins/'+classname+
'PyWrapper.cc',
'w')
112 print "generating file:", f.name
113 f.write(s.substitute(_PACKAGE_=package, _CLASS_NAME_=classname, _HEADER_FILE_=classname))
118 os.system(
'cd ../../;cvs co CondFormats/'+package)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
def generateClassesHeader
def declareXMLCondWrappers