Functions | Variables
TierConfigurations Namespace Reference

Functions

def parseTierConfiguration (tiers, verbose)
 FD data NuMI chains["FD_data_NuMI"].AddTier(Tier(short_name = "raw", input_name = FD_input_base+FD_raw_NuMI_input_file, precommand = "ifdh_fetch -e nova %s"FD_input_base+FD_raw_NuMI_input_file, inspect_only = True, parent_in_sam = True)) More...
 

Variables

string FD_input_base = "%s/FD_raw/"
 
string FD_raw_cosmic_input_file = "fardet_r00018228_s31_t02.raw"
 
string FD_raw_NuMI_input_file = "fardet_r00018228_s31_t00.raw"
 
string ND_input_base = "%s/ND_raw/"
 
string ND_raw_cosmic_input_file = "neardet_r00010402_s54_t02.raw"
 
string ND_raw_NuMI_input_file = "neardet_r00010402_s54_t00.raw"
 
dictionary chains
 

Function Documentation

def TierConfigurations.parseTierConfiguration (   tiers,
  verbose 
)

FD data NuMI chains["FD_data_NuMI"].AddTier(Tier(short_name = "raw", input_name = FD_input_base+FD_raw_NuMI_input_file, precommand = "ifdh_fetch -e nova %s"FD_input_base+FD_raw_NuMI_input_file, inspect_only = True, parent_in_sam = True))

FD data cosmics chains["FD_data_cosmics"].AddTier(Tier(short_name = "raw", input_name = FD_input_base+FD_raw_cosmic_input_file, precommand = "ifdh_fetch -e nova %s"FD_input_base+FD_raw_cosmic_input_file, inspect_only = True, parent_in_sam = True)) FD genie FHC nonswap FD genie FHC swap FD genie FHC tau FD genie RHC nonswap FD genie RHC swap FD genie RHC tau FD cosmics ND data NuMIf chains["ND_data_NuMI"].AddTier(Tier(short_name = "raw", input_name = ND_input_base+ND_raw_NuMI_input_file, precommand = "ifdh_fetch -e nova %s"ND_input_base+ND_raw_NuMI_input_file, inspect_only = True, parent_in_sam = True)) ND data cosmics chains["ND_data_cosmics"].AddTier(Tier(short_name = "raw", input_name = ND_input_base+ND_raw_cosmic_input_file, precommand = "ifdh_fetch -e nova %s"ND_input_base+ND_raw_cosmic_input_file, inspect_only = True, parent_in_sam = True)) ND genie_FHC_nonswap ND genie_RHC_nonswap ND cosmics Parse Tier configurations

Tier configurations are expected to be provided in the form:
    PRODUCTIONCHAIN<:END TIER:START TIER>
where PRODUCTIONCHAIN is included in chains
and the optional END/START TIERs are included in chains[chain]
with configurations PRODUCTIONCHAIN_END/START TIER defined in tier_config

Definition at line 746 of file TierConfigurations.py.

References exit(), if(), and allTimeWatchdog.index.

746 def parseTierConfiguration(tiers, verbose):
747  """
748  Tier configurations are expected to be provided in the form:
749  PRODUCTIONCHAIN<:END TIER:START TIER>
750  where PRODUCTIONCHAIN is included in chains
751  and the optional END/START TIERs are included in chains[chain]
752  with configurations PRODUCTIONCHAIN_END/START TIER defined in tier_config
753  """
754  tier_tokens = tiers.split(":")
755 
756  chain_name = tier_tokens[0]
757  if verbose: print "tconf: chain: %s"%chain_name
758  if(chain_name not in chains.keys()):
759  print "Non configured chain requested: %s"%chain_name
760  print "Configured options are: "
761  for c in chains.keys(): print " %s"%c
762  exit(1)
763  chain = chains[chain_name]
764 
765  if len(tier_tokens) > 1:
766  start_tier = tier_tokens[1]
767  if start_tier not in chain.GetTierShortNames():
768  print "Non configured start tier requested: %s for chain: %s"%(start_tier,chain_name)
769  print "Configured options are: "
770  for t in chain.GetTierShortNames(): print " %s"%t
771  exit(1)
772  else:
773  start_tier = chain.GetTierShortNames()[0]
774  start_tier_index = chain.GetTierShortNames().index(start_tier)
775  if verbose: print "tconf: start tier: %s, index: %i"%(start_tier,start_tier_index)
776 
777  if len(tier_tokens) > 2:
778  end_tier = tier_tokens[2]
779  # if end_tier is an empty string, then run the chain to the end
780  if end_tier == "": end_tier = chain.GetTierShortNames()[-1]
781  if end_tier not in chain.GetTierShortNames():
782  print "Non configured end tier requested: %s for chain: %s"%(end_tier,chain_name)
783  print "Configured options are: "
784  for t in chain.GetTierShortNames(): print " %s"%t
785  exit(1)
786  elif len(tier_tokens) > 1:
787  # if start but not end is specified, then run only start
788  end_tier = start_tier
789  else:
790  # else default to the full chain
791  end_tier = chain.GetTierShortNames()[-1]
792  end_tier_index = chain.GetTierShortNames().index(end_tier)
793  if verbose: print "tconf: end tier: %s, index: %i"%(end_tier,end_tier_index)
794 
795  if (start_tier_index > end_tier_index):
796  print "Requested end tier: %s [index: %i], is earlier in requested chain: %s, than requested start tier: %s [index: %i]"%\
797  (end_tier, end_tier_index, chain_name, start_tier, start_tier_index)
798  print "Order of tiers is:"
799  for i_t,t in enumerate(chain.GetTierShortNames()): print " [%i]: %s"%(i_t,t)
800  exit(1)
801 
802  tiers = chain.GetTiers(start_tier,end_tier)
803  if verbose:
804  print "tconf: Tiers: ",
805  for t in tiers: print t.short_name,
806  print ""
807 
808  if verbose and (start_tier_index != 0):
809  print "tconf: Starting production chain (%s) from non-base tier: %s"%(chain_name,start_tier)
810  print "tconf: This will require the input file: %s"%\
811  (chain.GetTier(start_tier).input_name)
812 
813  return chain, tiers
814 
815 
if(dump)
def parseTierConfiguration(tiers, verbose)
FD data NuMI chains["FD_data_NuMI"].AddTier(Tier(short_name = "raw", input_name = FD_input_base+FD_ra...
exit(0)

Variable Documentation

dictionary TierConfigurations.chains
Initial value:
1 = {
2  "FD_data_NuMI" : Chain("FD_data_NuMI"),
3  "FD_data_cosmics" : Chain("FD_data_cosmics"),
4  "FD_genie_FHC_nonswap": Chain("FD_genie_FHC_nonswap"),
5  "FD_genie_FHC_swap" : Chain("FD_genie_FHC_swap"),
6  "FD_genie_FHC_tau" : Chain("FD_genie_FHC_tau"),
7  "FD_genie_RHC_nonswap": Chain("FD_genie_RHC_nonswap"),
8  "FD_genie_RHC_swap" : Chain("FD_genie_RHC_swap"),
9  "FD_genie_RHC_tau" : Chain("FD_genie_RHC_tau"),
10  "FD_cosmics" : Chain("FD_cosmics"),
11 
12  "ND_data_NuMI" : Chain("ND_data_NuMI"),
13  "ND_data_cosmics" : Chain("ND_data_cosmics"),
14  "ND_genie_FHC_nonswap": Chain("ND_genie_FHC_nonswap"),
15  "ND_genie_RHC_nonswap": Chain("ND_genie_RHC_nonswap"),
16  "ND_cosmics" : Chain("ND_cosmics"),
17 }

Definition at line 12 of file TierConfigurations.py.

string TierConfigurations.FD_input_base = "%s/FD_raw/"

Definition at line 3 of file TierConfigurations.py.

string TierConfigurations.FD_raw_cosmic_input_file = "fardet_r00018228_s31_t02.raw"

Definition at line 4 of file TierConfigurations.py.

string TierConfigurations.FD_raw_NuMI_input_file = "fardet_r00018228_s31_t00.raw"

Definition at line 5 of file TierConfigurations.py.

string TierConfigurations.ND_input_base = "%s/ND_raw/"

Definition at line 6 of file TierConfigurations.py.

string TierConfigurations.ND_raw_cosmic_input_file = "neardet_r00010402_s54_t02.raw"

Definition at line 7 of file TierConfigurations.py.

string TierConfigurations.ND_raw_NuMI_input_file = "neardet_r00010402_s54_t00.raw"

Definition at line 8 of file TierConfigurations.py.