Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:48

0001 #! /usr/bin/env perl
0002 use File::Basename;
0003 
0004 # get the complete list of class names for replacement:
0005 
0006 my @src = ();
0007 my @rep = ();
0008 
0009 print <<EOF;
0010 
0011 Generally you'll need to create/edit all of these files to install a new CondFormat.
0012 
0013 But by putting your classname into:
0014 #modified:   L1Trigger/L1TCommon/scripts/make_records_files.txt
0015 creating your class header file, and running this script, most of this is automated.
0016 
0017 The complete list of files you'll need to update for class L1TXXX is:
0018 
0019 # Changes to be committed:
0020 #   (use "git reset HEAD <file>..." to unstage)
0021 #
0022 #modified:   CondCore/Utilities/src/CondDBFetch.cc
0023 #modified:   CondCore/Utilities/src/CondDBImport.cc
0024 #modified:   CondCore/Utilities/src/CondFormats.h
0025 #new file:   CondFormats/DataRecord/interface/L1TXXXRcd.h
0026 #new file:   CondFormats/DataRecord/src/L1TXXXRcd.cc
0027 #new file:   CondFormats/L1TObjects/interface/L1TXXX.h
0028 #new file:   CondFormats/L1TObjects/src/L1TXXX.cc
0029 #modified:   CondFormats/L1TObjects/src/classes.h
0030 #modified:   CondFormats/L1TObjects/src/classes_def.xml
0031 #modified:   CondFormats/L1TObjects/test/testSerializationL1TObjects.cpp
0032 #modified:   L1Trigger/L1TCommon/scripts/make_records.pl
0033 EOF
0034 
0035 open FILELIST, "L1Trigger/L1TCommon/scripts/make_records_files.txt";
0036 while($classname = <FILELIST>){
0037     next if ($fullfile =~ /^\s*\#/);
0038     chomp $classname;
0039     $rcdname     = "${classname}Rcd";
0040     print "INFO:  class: \"$classname\" --> record:  \"$rcdname\"\n";
0041     open INPUT, "L1Trigger/L1TCommon/scripts/template.h";
0042     open OUTPUT, ">CondFormats/DataRecord/interface/${classname}Rcd.h";
0043     while(<INPUT>){
0044     s/XXX/$classname/g;
0045     print OUTPUT $_;
0046     }
0047     close INPUT;
0048     close OUTPUT;
0049 
0050 
0051     open INPUT, "L1Trigger/L1TCommon/scripts/template.cc";
0052     open OUTPUT, ">CondFormats/DataRecord/src/${classname}Rcd.cc";
0053     while(<INPUT>){
0054     s/XXX/$classname/g;
0055     print OUTPUT $_;
0056     }
0057     close INPUT;
0058     close OUTPUT;
0059 }
0060 close FILELIST;
0061 
0062 open FILELIST, "L1Trigger/L1TCommon/scripts/make_records_files.txt";
0063 while($classname = <FILELIST>){
0064     next if ($fullfile =~ /^\s*\#/);
0065     chomp $classname;
0066     $file = "CondFormats/L1TObjects/src/T_EventSetup_${classname}.cc";
0067     open OUTPUT, "$file";
0068     print OUTPUT "#include \"CondFormats/L1TObjects/interface/${classname}.h\"\n";
0069     print OUTPUT "#include \"CondFormats/DataRecord/interface/${classname}Rcd.h\"\n";
0070     print OUTPUT "REGISTER_PLUGIN(${classname}Rcd, ${classname});\n";
0071     print OUTPUT "\n";
0072     close OUTPUT;
0073 }
0074 close FILELIST;
0075 
0076 print "MANUAL ADDITION NEEDED to CondCore/Utilities/src/CondDBFetch.cc, add following snippet:\n"; 
0077 
0078 open FILELIST, "L1Trigger/L1TCommon/scripts/make_records_files.txt";
0079 while($classname = <FILELIST>){
0080     next if ($fullfile =~ /^\s*\#/);
0081     chomp $classname;
0082     print "FETCH_PAYLOAD_CASE( $classname )\n";
0083 }
0084 close FILELIST;
0085 print "\n";
0086 
0087 print "MANUAL ADDITION NEEDED to CondCore/Utilities/src/CondDBImport.cc, add following snippet:\n"; 
0088 
0089 open FILELIST, "L1Trigger/L1TCommon/scripts/make_records_files.txt";
0090 while($classname = <FILELIST>){
0091     next if ($fullfile =~ /^\s*\#/);
0092     chomp $classname;
0093     print "IMPORT_PAYLOAD_CASE( $classname )\n";
0094 }
0095 close FILELIST;
0096 print "\n";
0097 
0098 open FILELIST, "L1Trigger/L1TCommon/scripts/make_records_files.txt";
0099 while($classname = <FILELIST>){
0100     next if ($fullfile =~ /^\s*\#/);
0101     chomp $classname;
0102     open OUTPUT, ">CondFormats/L1TObjects/src/${classname}.cc";
0103     print OUTPUT "#include \"CondFormats/L1TObjects/interface/${classname}.h\"\n";
0104     close OUTPUT;
0105 }
0106 close FILELIST;
0107 
0108 print "MANUAL ADDITION NEEDED to CondCore/Utilities/src/CondFormats.h, add following snippet:\n"; 
0109 open FILELIST, "L1Trigger/L1TCommon/scripts/make_records_files.txt";
0110 while($classname = <FILELIST>){
0111     next if ($fullfile =~ /^\s*\#/);
0112     chomp $classname;
0113     print "#include \"CondFormats/L1TObjects/interface/${classname}.h\"\n";
0114 }
0115 close FILELIST;
0116 
0117 print "MANUAL ADDITION NEEDED to CondFormats/L1TObjects/src/classes_def.xml, add following snippet:\n"; 
0118 
0119 #open FILELIST, "L1Trigger/L1TCommon/scripts/make_records_files.txt";
0120 #while($classname = <FILELIST>){
0121 #    next if ($fullfile =~ /^\s*\#/);
0122 #    chomp $classname;
0123 #    print "\<class name=\"std::vector\<${classname}>\"/>\n";
0124 #    print "\<class name=\"std::map\<std::string, ${classname}>\"/>\n";
0125 #}
0126 #close FILELIST;
0127 
0128 
0129 
0130 open FILELIST, "L1Trigger/L1TCommon/scripts/make_records_files.txt";
0131 while($classname = <FILELIST>){
0132     next if ($fullfile =~ /^\s*\#/);
0133     chomp $classname;
0134     print "\<class name=\"${classname}\">\n";
0135     open CLASSDEF, "CondFormats/L1TObjects/interface/${classname}.h";
0136     while (<CLASSDEF>){
0137     #print $_;
0138     if (/std::(vector|map).* (\S+)\;/){
0139         next if ($2 eq "\}");
0140         #print "--------------------------------------------------\n";
0141         print "  \<field name=\"$2\" mapping=\"blob\" />\n";
0142         #print "--------------------------------------------------\n";
0143 
0144     }
0145 
0146     }
0147     print "\</class>\n";
0148 }
0149 close FILELIST;