#!/usr/bin/perl #--------------readin module data base------------ open(IN,"../SCT/module_DB.txt"); @file = ; close(IN); #print "@file\n"; $i=0; foreach $xxx (@file){ (@id[$i],$w,@ed[$i],@layer[$i],@phi[$i],@eta[$i]) = split(/ /,$xxx); $add=1; if($ed[$i]==0) {$add=3;} @layer[$i] += $add; @ed[$i] = (@ed[$i]+2)/2; #print "$i: @id[$i] = @ed[$i] @layer[$i] @phi[$i] @eta[$i]\n"; $i++; } print "Module data base were read-in for $i modules\n"; #--------------readin CiS------------ open(IN,"../SCT/CiS.txt"); @CiS = ; close(IN); #print "@CiS\n"; $iCiS=0; foreach $xxx (@CiS){ @idCiS[$iCiS] = split(/ /,$xxx); @idCiT = split(/\s+/,$xxx); #print "$iCiS: @idCiS[$iCiS] \n"; $iCiS++; } print "CiS module data were read-in for $iCiS modules\n"; print "idCiS: @idCiS[0] @idCiS[1] @idCiS[2] @idCiS[3] @idCiS[4] @idCiS[5] @idCiS[6] @idCiS[7] @idCiS[8] @idCiS[9] \n"; print "idCiT: @idCiT[0] @idCiT[1] @idCiT[2] @idCiT[3] @idCiT[4] @idCiT[5] @idCiT[6] @idCiT[7] @idCiT[8] @idCiT[9] \n"; #--------------readin <100> modules------------ open(IN,"../SCT/100.txt"); @id100 = ; close(IN); #print "@id100\n"; $i100=0; foreach $xxx (@id100){ #print "$xxx"; $i100++; } print "<100> module data were read-in for $i100 modules\n"; #------------------------ #------------------------ $test1=20220990291318; $type=111; foreach $xxx (@idCiS) { if($xxx == $test1) {$type = 200;} } foreach $xxx (@id100) { if($xxx == $test1) {$type = 100;} } $k=0; foreach $xxx (@id) { if($xxx == $test1) { print "$k , $test1 : $xxx = @ed[$k] @layer[$k] @phi[$k] @eta[$k] $type\n" } $k++; } #------------------------ $test1=20220040200333; $type=111; foreach $xxx (@idCiS) { if($xxx == $test1) {$type = 200;} } foreach $xxx (@id100) { if($xxx == $test1) {$type = 100;} } $k=0; foreach $xxx (@id) { if($xxx == $test1) { print "$k , $test1 : $xxx = @ed[$k] @layer[$k] @phi[$k] @eta[$k] $type\n" } $k++; } #------------------------ $test1=20220040200020; $type=111; foreach $xxx (@idCiS) { if($xxx == $test1) {$type = 200;} } foreach $xxx (@id100) { if($xxx == $test1) {$type = 100;} } $k=0; foreach $xxx (@id) { if($xxx == $test1) { print "$k , $test1 : $xxx = @ed[$k] @layer[$k] @phi[$k] @eta[$k] $type\n" } $k++; } =============================================== $ perl read.pl Module data base were read-in for 4088 modules CiS module data were read-in for 496 modules idCiS: 20220270300262 20220270300180 20220270300279 20220270300186 20220270300282 20220270300189 20220270300283 20220270300258 20220270300284 20220270300259 idCiT: 20220990291318 149305344 0 7 12 7 <100> module data were read-in for 92 modules 4064 , 20220990291318 : 20220990291318 = 0 8 12 1 200 273 , 20220040200333 : 20220040200333 = 1 3 20 -2 100 6 , 20220040200020 : 20220040200020 = 1 6 40 -5 111