Functions | Variables
mkDefs Namespace Reference

Functions

def deleteDef (defname)
 
def createDef (defname, constraints)
 

Variables

 test
 
 daqReleases
 
 samweb
 
 experiment
 
 detName
 
 fileType
 
 baseDef
 
 streamConstraint
 
 streamName
 
 defname
 
 constraints
 
 daqRelease
 
 inFileName
 if we get here, we're doing the base definitions: More...
 
 inFile
 
 firstRun
 
 lastRun
 
 line
 
 fields
 
 msg
 

Function Documentation

def mkDefs.createDef (   defname,
  constraints 
)

Definition at line 36 of file mkDefs.py.

36 def createDef(defname,constraints):
37  if test:
38  print "Would create %s with contraints" % defname
39  print constraints
40  if count:
41  nfiles=samweb.countFiles(constraints)
42  print "and %d files" %(nfiles)
43 
44  return
45 
46  samweb.createDefinition(defname,constraints)
47  if count:
48  nfiles=samweb.countFiles(constraints)
49  info("Made %s with %d files" %(defname,nfiles))
50 
51 prog=sys.argv[0]
52 NovaGridUtils.prog=prog
53 
54 parser=argparse.ArgumentParser(prog=prog,
55  description="Create raw and artdaq definitions")
56 
57 parser.add_argument('--det',
58  required=True,
59  help='Detector (can be neardet or fardet)',
60  type=str)
61 
62 parser.add_argument('--span',
63  required=True,
64  help='Timespan: must be a valid period (eg period1) or epoch (eg epoch3a)',
65  type=str)
66 
67 parser.add_argument('--defType',
68  required=True,
69  help='Type of definition to create (base, raw or artdaq); base implies basic definition w/o specifying a tier',
70  type=str)
71 
72 parser.add_argument('--fileType',
73  required=True,
74  help='Type of files: data or mc',
75  type=str)
76 
77 parser.add_argument('--stream',
78  help='Type of stream (numi or cosmic), required for anything other than --defType=base',
79  type=str)
80 
81 parser.add_argument('--test',
82  help='Do not delete or create datasets, but print definitions and constraints',
83  action='store_true',default=False)
84 
85 parser.add_argument('--count',
86  help='Count files in',
87  action='store_true',default=False)
88 
89 
90 parser.add_argument('--delete',
91  help='delete old definition first (if it exists)',
92  action='store_true',default=False)
93 
94 
95 args=parser.parse_args()
96 test=args.test
97 count=args.count
98 
99 span=args.span
100 
101 defType=args.defType
102 detName=""
103 
104 det=args.det
def createDef(defname, constraints)
Definition: mkDefs.py:36
def mkDefs.deleteDef (   defname)

Definition at line 18 of file mkDefs.py.

18 def deleteDef(defname):
19  if test:
20  info("Would delete %s" % defname)
21  return
22 
23  info("About to delete %s, y/n?" % defname)
24  while True:
25  c=sys.stdin.read(1)
26  if c=="y":
27  break
28  elif c=="n":
29  print "Quitting w/o doing anything"
30  sys.exit(0)
31  else:
32  print "Please enter 'y' or 'n' only"
33 
34  samweb.deleteDefinition(defname)
35 
def deleteDef(defname)
Definition: mkDefs.py:18

Variable Documentation

mkDefs.baseDef

Definition at line 116 of file mkDefs.py.

mkDefs.constraints
mkDefs.daqRelease

Definition at line 154 of file mkDefs.py.

mkDefs.daqReleases

Definition at line 12 of file mkDefs.py.

mkDefs.defname

Definition at line 143 of file mkDefs.py.

mkDefs.detName
mkDefs.experiment

Definition at line 16 of file mkDefs.py.

mkDefs.fields

Definition at line 176 of file mkDefs.py.

mkDefs.fileType
mkDefs.firstRun

Definition at line 171 of file mkDefs.py.

mkDefs.inFile

Definition at line 169 of file mkDefs.py.

mkDefs.inFileName

if we get here, we're doing the base definitions:

Definition at line 168 of file mkDefs.py.

Referenced by art::TrivialFileTransfer.doTranslateToLocalFilename().

mkDefs.lastRun

Definition at line 172 of file mkDefs.py.

mkDefs.line

Definition at line 175 of file mkDefs.py.

mkDefs.msg

Definition at line 178 of file mkDefs.py.

mkDefs.samweb

Definition at line 16 of file mkDefs.py.

mkDefs.streamConstraint

Definition at line 125 of file mkDefs.py.

mkDefs.streamName

Definition at line 126 of file mkDefs.py.

mkDefs.test

Definition at line 10 of file mkDefs.py.