File indexing completed on 2024-04-06 12:22:28
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 $GLOBAL="Commissioning08";
0013 $pathToFiles="Calo/RAW/v1";
0014
0015 $eventSource="\"PoolSource\"";
0016 $nfiles= 100;
0017 $numJobs = -1;
0018 $nEvents = -1;
0019 $lumiMin = -1;
0020 $lumiMax = 9999;
0021
0022
0023
0024 if(! $ARGV[0] ) {print "Usage: ./runNtpMaker.pl RunNumber\n"; exit;}
0025
0026 $RUN = $ARGV[0];
0027
0028 $A = substr($RUN,0,2);
0029 $ZERO = "0";
0030 $A = $ZERO.$A;
0031 $B = substr($RUN,2);
0032
0033
0034 system("nsls /castor/cern.ch/cms/store/data/$GLOBAL/$pathToFiles/000/$A/$B/ > files.txt");
0035 $count = `wc -l < files.txt`;
0036 die "wc failed: $?" if $?;
0037 chomp($count);
0038 print "-----------------------------\n";
0039 print "Total number of file: $count\n";
0040 print "-----------------------------\n";
0041
0042
0043 open(MYFILE, "<files.txt");
0044 $line=0;
0045 $myn=0;
0046 $job=1;
0047 @names = ();
0048 while(<MYFILE>)
0049 {
0050 $name = $_;
0051 chomp($name);
0052
0053
0054 $indx = index($name, '.');
0055 $indx = index($name, '.',$indx+1);
0056 $lumi = substr($name,$indx+1,4);
0057 $lumi = $lumi+0;
0058
0059 if($lumi > $lumiMin && $lumi < $lumiMax) {
0060
0061 push(@names, $name);
0062
0063 $line++;
0064 $job = $line%$nfiles;
0065
0066 if(eof(MYFILE))
0067 {
0068 $job=0;
0069 }
0070 }
0071
0072
0073 if($job==0){
0074
0075 $total=@names;
0076 $myn=$line/$nfiles;
0077
0078 if(eof(MYFILE) || int($myn)==0) {$myn=0;}
0079
0080
0081 open CFGFILE, "> l1prompt_$RUN\_$myn\_cfg.py";
0082
0083 print CFGFILE "import FWCore.ParameterSet.Config as cms\n";
0084 print CFGFILE "\n";
0085 print CFGFILE "process = cms.Process(\"L1Prompt\")\n";
0086 print CFGFILE "\n";
0087 print CFGFILE "process.load(\"L1TriggerConfig.L1GeometryProducers.l1CaloGeometry_cfi\")\n";
0088 print CFGFILE "process.load(\"L1TriggerConfig.L1GeometryProducers.l1CaloGeomRecordSource_cff\")\n";
0089 print CFGFILE "process.load(\"L1TriggerOffline.L1Analyzer.dttfUnpack_cff\")\n";
0090 print CFGFILE "process.load(\"L1TriggerOffline.L1Analyzer.gtUnpack_cff\")\n";
0091 print CFGFILE "process.load(\"L1TriggerOffline.L1Analyzer.gctUnpack_cff\")\n";
0092 print CFGFILE "process.load(\"L1TriggerOffline.L1Analyzer.L1PromptAnalysis_cfi\")\n";
0093 print CFGFILE "process.l1PromptAnalysis.OutputFile = '$RUN\_$myn.root'\n";
0094 print CFGFILE "\n";
0095 print CFGFILE "process.source = cms.Source($eventSource,\n";
0096 print CFGFILE "fileNames = cms.untracked.vstring(\n";
0097 $ii=0;
0098 foreach $ll (@names)
0099 {
0100 $ii++;
0101
0102 if($ii != $total){
0103 print CFGFILE "\'/store/data/$GLOBAL/$pathToFiles/000/$A/$B/$ll\',\n";
0104 } else
0105 {
0106 print CFGFILE "\'/store/data/$GLOBAL/$pathToFiles/000/$A/$B/$ll\'\n";
0107 }
0108 }
0109 @names=();
0110 print CFGFILE ")\n";
0111 print CFGFILE ")\n";
0112 print CFGFILE "\n";
0113 print CFGFILE "process.maxEvents = cms.untracked.PSet(\n";
0114 print CFGFILE " input = cms.untracked.int32($nEvents)\n";
0115 print CFGFILE ")\n";
0116 print CFGFILE "\n";
0117 print CFGFILE "process.p = cms.Path(process.l1GtUnpack+process.l1GctHwDigis+process.l1GtEvmUnpack+process.l1dttfunpack+process.l1PromptAnalysis)\n";
0118 print CFGFILE "\n";
0119
0120 print "bsub -J $RUN\_$myn -q cmscaf submit.ch l1prompt_$RUN\_$myn\_cfg.py $RUN\_$myn\n";
0121 system("bsub -J $RUN\_$myn -q cmscaf submit.ch l1prompt_$RUN\_$myn\_cfg.py $RUN\_$myn\n");
0122
0123
0124 if($myn==$numJobs) {exit;}
0125
0126 }
0127 }
0128 print "End submission...\n";
0129