Skip to content
Snippets Groups Projects
Commit 43945869 authored by Ulrich Schwickerath's avatar Ulrich Schwickerath
Browse files

add skeleton for inventory from files

parent b4898185
No related branches found
No related tags found
No related merge requests found
*
* PDLINPUT file for DES multievt request
*
*FAT = dsto00z_e/c001
*
*FILE=/eos/opendata/delphi/raw-data/y96/ED0312/ED0312.46.sl
* cosmic event
*FILE=/eos/opendata/delphi/raw-data/y93/ED0121/ED0121.42.sl
* 96 raw data
FILE=/eos/experiment/delphi/castor2015/rawd/y96/ED0334/ED0334.67.sl
\ No newline at end of file
# Inventory from file
## Target format
Should be similar to uxcopy
```bash
--------------------------------------------------------------------------------
************************** U X C O P Y L I S T I N G *************************
--------------------------------------------------------------------------------
================================================================================
NUMBER EXPER RUN FILE FILL EVENT EVENT EVENT D/S D/S NUMBER
EVENTS NR. NR. NR. NR. NR. DATE TIME REQ FOUND WORDS
================================================================================
----- 1 117081 8 ----- 1 1001014 215108 R BOF 59717
----- 1 117081 8 ----- 23538 1001015 000519 R CPT 2975
1 1 117081 8 0 23539 1001015 000521 R D 0
2 1 117081 8 0 23540 1001015 000521 R D 0
3 1 117081 8 0 23541 1001015 000521 R D 0
4 1 117081 8 0 23542 1001015 000521 R D 0
5 1 117081 8 0 23543 1001015 000522 R D 0
6 1 117081 8 0 23544 1001015 000522 R D 0
7 1 117081 8 0 23545 1001015 000522 R D 0
8 1 117081 8 0 23546 1001015 000523 R D 0
9 1 117081 8 0 23547 1001015 000523 R D 0
10 1 117081 8 0 23548 1001015 000523 R D 0
11 1 117081 8 0 23549 1001015 000523 R D 0
----- 1 117081 8 ----- 23551 1001015 000645 R EOR 2747
----- 1 117081 8 ----- 23552 1001017 232406 R EOF 2747
```
In addition, for DST files let's call user02 and see what we have in there.
## Issues
* The fill number is zero all the time (for raw data at least) which is ... interesting
## TODO:
USER01:
* ensure the fill is set for non-cosmic files
* update format
* for DST, print information only in user02 and add processing, maybe labo, check if it is MC etc
#!/usr/bin/perl -w
use strict;
use diagnostics;
use File::Basename;
my %minevt;
my %maxevt;
my %vid;
my %nvid;
my $filename=$ARGV[0];
if (not defined $filename){
print("Usage: ana.pl <filename>\n");
exit;
} else {
print("Reading files from $filename\n");
}
my $files = `cat $filename`;
foreach my $file (split("\n", $files)) {
my $base=basename($file);
my $logf=$base . ".log";
my $year = 'unknown';
open(FH, '<', $logf);
while(<FH>){
if (/^\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+R\s+(\w+)\s+\d+$/) {
my $exp=$2;
my $run=$3;
my $filenr=$4;
my $fill=$5;
my $evt=$6;
my $date=$7;
my $time=$8;
my $type=$9;
if ($date=~/^(\d\d)\d\d\d\d$/){
$year = $1;
} elsif ($date=~/^(\d\d\d)\d\d\d\d$/){
$year = $1;
if ($year == 100) {
$year = '00';
} else {
$year = 'unknown';
}
}
# check the type
my $dtype;
if ($type eq "R"){
# raw data
if ($fill == 0) {
$dtype = "cosm";
} else {
$dtype = "rawd";
}
} elsif ($type eq "d"){
if ($run < 0){
$dtype = "data-dst";
} else {
$dtype = "sim-dst";
}
} else {
# unknown really
$dtype = $type;
}
if ($minevt{$exp}{$year}{$dtype}{$run}{$file}){
$minevt{$exp}{$year}{$dtype}{$run}{$file} = $evt if ($evt < $minevt{$exp}{$year}{$dtype}{$run}{$file});
} else {
$minevt{$exp}{$year}{$dtype}{$run}{$file} = $evt;
}
if ($maxevt{$exp}{$year}{$dtype}{$run}{$file}){
$maxevt{$exp}{$year}{$dtype}{$run}{$file} = $evt if ($evt > $maxevt{$exp}{$year}{$dtype}{$run}{$file});
} else {
$maxevt{$exp}{$year}{$dtype}{$run}{$file} = $evt;
}
if ($vid{$exp}{$year}{$dtype}{$file}{$run}){
$vid{$exp}{$year}{$dtype}{$file}{$run} += 1;
} else {
$vid{$exp}{$year}{$dtype}{$file}{$run} = 1;
}
}
}
close(FH);
}
foreach my $exp (sort keys %vid){
foreach my $year (sort keys %{$vid{$exp}}){
foreach my $dtype (sort keys %{$vid{$exp}{$year}}){
my %by_run_vid;
my %by_run_castor;
my $nevt = 0;
foreach my $filepath (sort keys %{$vid{$exp}{$year}{$dtype}}){
my $vidname = basename($filepath);
foreach my $run (sort keys %{$vid{$exp}{$year}{$dtype}{$filepath}}) {
my $castor = $filepath;
$castor =~ s/\/eos\/experiment\/delphi\/castor2015/\/castor\/cern.ch\/delphi/g;
my $sc = sprintf("%5d - %5d %60s\n", $minevt{$exp}{$year}{$dtype}{$run}{$filepath}, $maxevt{$exp}{$year}{$dtype}{$run}{$filepath}, $castor);
my $sv = sprintf("%5d - %5d %60s\n", $minevt{$exp}{$year}{$dtype}{$run}{$filepath}, $maxevt{$exp}{$year}{$dtype}{$run}{$filepath}, $vidname);
push(@{$by_run_castor{$run}}, $sc);
push(@{$by_run_vid{$run}}, $sv);
$nevt += $vid{$exp}{$year}{$dtype}{$filepath}{$run};
}
}
my $nickname;
$nickname = "${dtype}${year}_expnr_${exp}";
open(NICK, '>', $nickname);
print NICK <<EOF
* NICK : None
* EXPER NR.: $exp
* GNAME : None
* YEAR : $year
* Events : $nevt
* DESC : RAW data
*
* Run File <- Event range -> Vid.Seq
*
EOF
;
foreach my $run (sort { $a <=> $b } keys %by_run_castor) {
my $i = 0;
foreach my $ent (@{$by_run_castor{$run}}){
printf(NICK "%6d %2d %s", $run, $i+1, $ent);
$i++;
}
}
close (NICK);
}
}
}
This diff is collapsed.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Machine independent cradle to create SKELANA library %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
+OPTION VERbose
+USE, ${PLINAM}.
%
+USE, IBMVM, IF = CERNVM.
+USE, VMS , IF = ALPHAVMS, VAXVMS.
+USE, UNIX , IF = ALPHAOSF, DECS, HPUX, IBMRT, LINUX, DARWIN.
%
+EXE.
+PARAM, CLASH, N=1.
+OPT, MAPASM, UREF, LOST, BIGUSE.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Get all the KEEP's needed for SKELANA
%
% PHDST CDE's
+USE,P=PHDSTCDE.
+PAM,11,T=A,C, R=PHDSTCDE, IF=IBMVM. PHDSTXX CARDS F
+PAM,11,T=A,C, R=PHDSTCDE, IF=VMS. DELPHI_PAM:PHDSTXX.CAR
+PAM,11,T=A,C, R=PHDSTCDE, IF=UNIX. (DELPHI_PAM)/phdstxx.car
%
% DELPHI standard CDE's
+USE,P=STDCDES.
+PAM,11,T=A,C, R=STDCDES, IF=IBMVM. STDCDES CARDS E
+PAM,11,T=A,C, R=STDCDES, IF=VMS. DELPHI_PAM:STDCDES.CAR
+PAM,11,T=A,C, R=STDCDES, IF=UNIX. (DELPHI_PAM)/stdcdes.car
%
% JETSET CDE's
+USE,P=JETCDES.
+PAM,11,T=A,C, R=JETCDES, IF=IBMVM. JETSET74 CAR W
+PAM,11,T=A,C, R=JETCDES, IF=VMS. DELPHI_PAM:JETSET74.CAR
+PAM,11,T=A,C, R=JETCDES, IF=UNIX. (DELPHI_PAM)/jetset74.car
%
% VECSUB CDE's
+USE,P=VECDES.
+PAM,11,T=A,C, R=VECDES, IF=IBMVM. VECSUB72 CARDS E
+PAM,11,T=A,C, R=VECDES, IF=VMS. DELPHI_PAM:VECSUB72.CAR
+PAM,11,T=A,C, R=VECDES, IF=UNIX. (DELPHI_PAM)/vecsub72.car
%
% MUID CDE's
+USE,P=FMUCDE.
+PAM,11,T=A,C, R=FMUCDE, IF=IBMVM. MUFLAG CARDS E
+PAM,11,T=A,C, R=FMUCDE, IF=VMS. DELPHI_PAM:MUFLAG.CAR
+PAM,11,T=A,C, R=FMUCDE, IF=UNIX. (DELPHI_PAM)/muflag.car
%
% HACCOR CDE's
+USE,P=MYCDES.
+PAM,11,T=A,C, R=MYCDES, IF=IBMVM. HACCORXX CARDS E
+PAM,11,T=A,C, R=MYCDES, IF=VMS. DELPHI_PAM:haccorxx.car
+PAM,11,T=A,C, R=MYCDES, IF=UNIX. (DELPHI_PAM)/haccorxx.car
%
% ELEPHANT CDE's
+USE,P=ELEPHCDE.
+PAM,11,T=A,C, R=ELEPHCDE, IF=IBMVM. ELEPHA32 CARDS E
+PAM,11,T=A,C, R=ELEPHCDE, IF=VMS. DELPHI_PAM:ELEPHA32.CAR
+PAM,11,T=A,C, R=ELEPHCDE, IF=UNIX. (DELPHI_PAM)/elepha32.car
%
% B_TAGGING CDE's
+USE,P=AABTCDE.
+PAM,11,T=A,C, R=AABTCDE, IF=IBMVM. AABTAGXX CARDS E
+PAM,11,T=A,C, R=AABTCDE, IF=VMS. DELPHI_PAM:AABTAGXX.CAR
+PAM,11,T=A,C, R=AABTCDE, IF=UNIX. (DELPHI_PAM)/aabtagxx.car
%
% B_TAGGING CDE's
+USE,P=MAMCDE.
+PAM,11,T=A,C, R=MAMCDE, IF=IBMVM. MAMMOTH CARDS E
+PAM,11,T=A,C, R=MAMCDE, IF=VMS. DELPHI_PAM:MAMMOTH.CAR
+PAM,11,T=A,C, R=MAMCDE, IF=UNIX. (DELPHI_PAM)/mammoth.car
%
% RICH identification keeps
+USE,P=PXRIUN,D=RIBCDE.
+PAM,11,T=A,C, IF=IBMVM. PXRICH CARDS E
+PAM,11,T=A,C, IF=VMS. DELPHI_PAM:pxrich.car
+PAM,11,T=A,C, IF=UNIX. (DELPHI_PAM)/pxrich.car
%
+USE,P=ANA_RIBCDE.
+PAM,11,T=A,C, R=ANA_RIBCDE, IF=IBMVM. RIBMEAN CARDS E
+PAM,11,T=A,C, R=ANA_RIBCDE, IF=VMS. DELPHI_PAM:ribmean.car
+PAM,11,T=A,C, R=ANA_RIBCDE, IF=UNIX. (DELPHI_PAM)/ribmean.car
%
%
+USE,P=REMCDE.
+PAM,11,T=A,C, IF=IBMVM. REMCLU CARDS E
+PAM,11,T=A,C, IF=VMS. DELPHI_PAM:remclu.car
+PAM,11,T=A,C, IF=UNIX. (DELPHI_PAM)/remclu.car
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Define the necessary SKELANA modules/processors
%
%+USE,NOPSHORT. NO Short DST information
%+USE,NOPSFULL. NO Full DST information
%
%+USE,NOIFLTRA. NO Track information
%+USE,NOIFLSIM. NO Simulation information
%+USE,NOIFLBSP. NO Beam Spot information
%+USE,NOIFLBTG. NO Btagging information
%+USE,NOIFLEMC. NO Elm. calorimetry
%+USE,NOIFLHAC. NO Hadron calorimetry
%+USE,NOIFLELE. NO Electron identification
%+USE,NOIFLPHO. NO Photon identification
%+USE,NOIFLPHC. NO Photon conversion
%+USE,NOIFLMUO. NO Muon identification
%+USE,NOIFLHAD. NO Hadron identification
%+USE,NOIFLVDH. NO Vertex Detector hits
%+USE,NOIFLRV0. NO V0 reconstruction
%+USE,NOIFLUTE. NO TE banks information
%+USE,NOIFLSTC. NO STIC information
%+USE,NOIFLFIX. NO Fixing (full DST only)
%+USE,NOIFLRNQ. NO Run quality selection
%+USE,NOIFLBHP. NO Bad 97 HPC event rejections
%+USE,NOIFLECL. NO Elm.cluster reconstruction
%+USE,NOIFLJET. NO Jet reconstruction
%
% Get the code of SKELANA and utility routines
%
+USE, P=PSMAIN, T=E.
%
+PAM,11,T=A,C, IF=UNIX. inventory.car
%
+QUIT.
#!/bin/bash
pgm=inventory
export DELLIBS=`dellib skelana dstana pxdst vfclap vdclap ux tanagra ufield bsaurus herlib trigger uhlib dstana pxtag`
export CERNLIBS=`cernlib genlib packlib kernlib ariadne herwig jetset74`
# run patchy
ycmd=`which nypatchy`
command="$ycmd - ${pgm}.f $pgm.cra $pgm.ylog - - - ${pgm}.f .go"
echo "Running $command"
eval $command
# compile
for ending in .f .F ; do
ls *$ending >/dev/null 2>&1
if [ $? -eq 0 ]; then
for file in *$ending ; do
$FCOMP $FFLAGS -c $file
done
fi
done
# link
$FCOMP $LDFLAGS *.o -o $pgm.exe $ADDLIB $DELLIBS $CERNLIBS
# execute
./$pgm.exe 1>$pgm.log 2>$pgm.err
# cleanup
#rm -f *.f *.c *.o
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment