#0 - 8 
#slice 0 - 23
#pole

    $merge_dvodb = "\/data\/ipp094.0\/eugene\/pv3.cam.20150607";
$mergedvodb = "LAP.PV3.MERGE";

$command = "mergetool -definebyquery -dbname gpc1 -mergedvodb '$mergedvodb' -set_mergedvodb_path '$merge_dvodb' ";


@stages = ("cam","skycal.V2","ff");
@segments = (0,1,2,3,4,5,6,7,8);
@slices = ("00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23");

foreach $stage (@stages) {


$com = $command . " -minidvodb_group LAP.PV3.pole.".$stage;
print "$com\n";
`$com`;
foreach $slice (@slices) {

    foreach $segment (@segments) {
$com = $command . " -minidvodb_group LAP.PV3.slice".$slice.".".$segment.".".$stage;
print "$com\n";
`$com`;
    }
}




}
