560 def postExecute(self):
562 runArgs=self.conf._argdict
563 prefix=runArgs[
'prefix']._value
569 listOfKeys = self._trf.dataDictionary
571 if 'doNoisyStrip' in runArgs[
'part']._value
and runArgs[
'splitHitMap']._value == 1:
572 outInstance0 = self.conf.dataDictionary[
list(self._output)[0]]
573 outTFile0 = TFile(outInstance0._value[0])
574 print (outTFile0.GetName())
575 outNentries0 =
int(outTFile0.Get(
'GENERAL/events').
GetEntries())
576 outInstance0._setMetadata(outInstance0._value,{
'nentries': outNentries0})
578 outInstance1 = self.conf.dataDictionary[
list(self._output)[1]]
579 outTFile1 = TFile(outInstance1._value[0])
580 print (outTFile1.GetName())
581 outNentries1 =
int(outTFile1.Get(
'GENERAL/events').
GetEntries())
582 outInstance1._setMetadata(outInstance1._value,{
'nentries': outNentries1})
584 if (
'doDeadStrip' in runArgs[
'part']._value
or 'doDeadChip' in runArgs[
'part']._value
or 'doQuietStrip' in runArgs[
'part']._value
or 'doQuietChip' in runArgs[
'part']._value )
and runArgs[
'splitHitMap']._value == 1:
585 outInstance0 = self.conf.dataDictionary[
list(self._output)[0]]
586 outTFile0 = TFile(outInstance0._value[0])
587 print (outTFile0.GetName())
588 outNentries0 =
int(outTFile0.Get(
'GENERAL/events').
GetEntries())
589 outInstance0._setMetadata(outInstance0._value,{
'nentries': outNentries0})
591 outInstance1 = self.conf.dataDictionary[
list(self._output)[1]]
592 outTFile1 = TFile(outInstance1._value[0])
593 print (outTFile1.GetName())
594 outNentries1 =
int(outTFile1.Get(
'GENERAL/events').
GetEntries())
595 outInstance1._setMetadata(outInstance1._value,{
'nentries': outNentries1})
597 if 'doDeadStrip' in runArgs[
'part']._value
and runArgs[
'splitHitMap']._value != 1:
599 deadFile=pwd+
'/'+prefix+
'.DeadStripsFile.xml'
600 deadSummary=pwd+
'/'+prefix+
'.DeadSummaryFile.xml'
604 if os.path.exists(deadFile):
605 numLinesFile =
sum(1
for line
in open(deadFile))
606 if os.path.exists(deadSummary):
607 numLinesSummary =
sum(1
for line
in open(deadSummary))
612 if ( numLinesFile == 2
and numLinesSummary == 20 ):
613 dataDic = self._trf.dataDictionary
618 listOfKeys.append(key)
620 redDict = {key:dataDic[key]
for key
in listOfKeys}
621 self._trf._dataDictionary = redDict
623 if 'doDeadChip' in runArgs[
'part']._value
and runArgs[
'splitHitMap']._value != 1:
625 deadFile=pwd+
'/'+prefix+
'.DeadChipsFile.xml'
626 deadSummary=pwd+
'/'+prefix+
'.DeadSummaryFile.xml'
630 if os.path.exists(deadFile):
631 numLinesFile =
sum(1
for line
in open(deadFile))
632 if os.path.exists(deadSummary):
633 numLinesSummary =
sum(1
for line
in open(deadSummary))
638 if ( numLinesFile == 2
and numLinesSummary == 20 ):
639 dataDic = self._trf.dataDictionary
644 listOfKeys.append(key)
646 redDict = {key:dataDic[key]
for key
in listOfKeys}
647 self._trf._dataDictionary = redDict
649 if 'doQuietStrip' in runArgs[
'part']._value
and runArgs[
'splitHitMap']._value != 1:
651 deadFile=pwd+
'/'+prefix+
'.QuietStripsFile.xml'
652 deadSummary=pwd+
'/'+prefix+
'.QuietSummaryFile.xml'
656 if os.path.exists(deadFile):
657 numLinesFile =
sum(1
for line
in open(deadFile))
658 if os.path.exists(deadSummary):
659 numLinesSummary =
sum(1
for line
in open(deadSummary))
664 if ( numLinesFile == 2
and numLinesSummary == 20 ):
665 dataDic = self._trf.dataDictionary
670 listOfKeys.append(key)
672 redDict = {key:dataDic[key]
for key
in listOfKeys}
673 self._trf._dataDictionary = redDict
675 if 'doQuietChip' in runArgs[
'part']._value
and runArgs[
'splitHitMap']._value != 1:
677 deadFile=pwd+
'/'+prefix+
'.QuietChipsFile.xml'
678 deadSummary=pwd+
'/'+prefix+
'.QuietSummaryFile.xml'
682 if os.path.exists(deadFile):
683 numLinesFile =
sum(1
for line
in open(deadFile))
684 if os.path.exists(deadSummary):
685 numLinesSummary =
sum(1
for line
in open(deadSummary))
690 if ( numLinesFile == 2
and numLinesSummary == 20 ):
691 dataDic = self._trf.dataDictionary
696 listOfKeys.append(key)
698 redDict = {key:dataDic[key]
for key
in listOfKeys}
699 self._trf._dataDictionary = redDict
703 if runArgs[
'splitHitMap']._value !=1
and 'COOL' in listOfKeys:
704 os.rename(
'mycool.db',prefix+
'.mycool.db')
705 if runArgs[
'splitHitMap']._value == 2:
706 os.rename(
'SCTHitMaps.root',prefix+
'.SCTHitMaps.root')
707 if 'doNoisyStrip' in runArgs[
'part']._value:
708 os.rename(
'SCTLB.root',prefix+
'.SCTLB.root')
709 if (
'doDeadStrip' in runArgs[
'part']._value
or 'doDeadChip' in runArgs[
'part']._value
or 'doQuietStrip' in runArgs[
'part']._value
or 'doQuietChip' in runArgs[
'part']._value ):
710 os.rename(
'SCTBSErrors.root',prefix+
'.SCTBSErrors.root')
712 self._echologger.warning(
'failed to rename DB, ROOT or LOG file.' )
714 super(SCTCalibExecutor, self).postExecute()