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