LArPhysOFCAlg.Nphase = Nphases
LArPhysOFCAlg.Dphase = Dphases
LArPhysOFCAlg.Ndelay = Ndelays
LArPhysOFCAlg.Nsample = Nsamples
LArPhysOFCAlg.FillShape = FillShape
LArPhysOFCAlg.TimeShift = TimeShift
LArPhysOFCAlg.TimeShiftByIndex = TimeShiftByIndex
LArPhysOFCAlg.AddTimeOffset = -1.0 * TimeShiftGuardRegion
LArPhysOFCAlg.LArPhysWaveBinKey = ShiftKey

LArPhysOFCAlg.UseDelta = 0  #Only for high-mu OFCs
LArPhysOFCAlg.KeyOFC = OFCKey
LArPhysOFCAlg.KeyShape = ShapeKey
LArPhysOFCAlg.DecoderTool = theLArAutoCorrDecoderTool
LArPhysOFCAlg.isSC = SuperCells
if Nsamples == 4:
    LArPhysOFCAlg.ReadDSPConfig = ReadDSPConfig
    LArPhysOFCAlg.DSPConfigFolder = DSPConfigFolder

topSequence += LArPhysOFCAlg

LArPhysOFCAlg2 = LArOFCAlg("LArPhysOFCAlg2")

LArPhysOFCAlg2.ReadCaliWave = False
LArPhysOFCAlg2.KeyList = [InputKey]
LArPhysOFCAlg2.Normalize = Normalize
LArPhysOFCAlg2.Verify = True
LArPhysOFCAlg2.GroupingType = GroupingType

LArPhysOFCAlg2.Nphase = Nphases2
  LArCaliOFCAlg.ReadCaliWave = True
  LArCaliOFCAlg.KeyList   = [ ContainerKey ]
  LArCaliOFCAlg.Nphase    = Nphases
  LArCaliOFCAlg.Dphase    = Dphases
  LArCaliOFCAlg.Ndelay    = Ndelays
  LArCaliOFCAlg.Nsample   = Nsamples
  LArCaliOFCAlg.Normalize = Normalize
  LArCaliOFCAlg.TimeShift = TimeShift
  LArCaliOFCAlg.TimeShiftByIndex = TimeShiftByIndex
  LArCaliOFCAlg.Verify    = True
  LArCaliOFCAlg.FillShape = False
  if ( DumpOFC ) :
     LArCaliOFCAlg.DumpOFCfile = "LArOFCCali.dat"
  LArCaliOFCAlg.GroupingType = GroupingType
  LArCaliOFCAlg.DecoderTool=theLArAutoCorrDecoderTool
  LArCaliOFCAlg.isSC = SuperCells
  topSequence+=LArCaliOFCAlg



  if ( WritePoolFile ) :
   from RegistrationServices.OutputConditionsAlg import OutputConditionsAlg
   OutputConditionsAlg2=OutputConditionsAlg("OutputConditionsAlg2",OutputPoolFileDir+"/"+OutputPoolFileName,
                                           [OutputObjectSpecOFC],[OutputObjectSpecTagOFC],WriteIOV)
   OutputConditionsAlg2.Run1 = IOVBegin
   if IOVEnd>0:
      OutputConditionsAlg2.Run2 = IOVEnd
   

  if (WriteNtuple):
   from LArCalibTools.LArCalibToolsConf import LArOFC2Ntuple