5050parser .add_argument ('-confKey' ,help = 'generator or trigger configuration key values, for example: "GeneratorPythia8.config=pythia8.cfg;A.x=y"' , default = '' )
5151
5252parser .add_argument ('-interactionRate' ,help = 'Interaction rate, used in digitization' , default = - 1 )
53- parser .add_argument ('-bcPatternFile' ,help = 'Bunch crossing pattern file, used in digitization' , default = '' )
53+ parser .add_argument ('-bcPatternFile' ,help = 'Bunch crossing pattern file, used in digitization (a file name or "ccdb") ' , default = '' )
5454parser .add_argument ('-eCM' ,help = 'CMS energy' , default = - 1 )
5555parser .add_argument ('-eA' ,help = 'Beam A energy' , default = - 1 ) #6369 PbPb, 2.510 pp 5 TeV, 4 pPb
5656parser .add_argument ('-eB' ,help = 'Beam B energy' , default = - 1 )
@@ -629,7 +629,8 @@ def putConfigValuesNew(listOfMainKeys=[], localCF = {}):
629629 tf = tf , cwd = timeframeworkdir , lab = ["DIGI" ], cpu = NWORKERS , mem = '8000' )
630630 TRDDigitask ['cmd' ] = ('' ,'ln -nfs ../bkg_HitsTRD.root . ;' )[doembedding ]
631631 TRDDigitask ['cmd' ] += '${O2_ROOT}/bin/o2-sim-digitizer-workflow ' + getDPL_global_options () + ' -n ' + str (args .ns ) + simsoption + ' --onlyDet TRD --interactionRate ' + str (INTRATE ) + putConfigValuesNew (localCF = {"TRDSimParams.digithreads" : NWORKERS }) + ' --incontext ' + str (CONTEXTFILE ) + ' --disable-write-ini'
632- workflow ['stages' ].append (TRDDigitask )
632+ if isActive ("TRD" ):
633+ workflow ['stages' ].append (TRDDigitask )
633634
634635 # these are digitizers which are single threaded
635636 def createRestDigiTask (name , det = 'ALLSMALLER' ):
@@ -649,16 +650,17 @@ def createRestDigiTask(name, det='ALLSMALLER'):
649650 return t
650651
651652 else : # here we create individual digitizers
652- if usebkgcache :
653- tneeds += [ BKG_HITDOWNLOADER_TASKS [det ]['name' ] ]
654- t = createTask (name = name , needs = tneeds ,
653+ if isActive (det ):
654+ if usebkgcache :
655+ tneeds += [ BKG_HITDOWNLOADER_TASKS [det ]['name' ] ]
656+ t = createTask (name = name , needs = tneeds ,
655657 tf = tf , cwd = timeframeworkdir , lab = ["DIGI" ,"SMALLDIGI" ], cpu = '1' )
656- t ['cmd' ] = ('' ,'ln -nfs ../bkg_Hits' + str (det ) + '.root . ;' )[doembedding ]
657- t ['cmd' ] += commondigicmd + ' --onlyDet ' + str (det )
658- if det == 'TOF' :
659- t ['cmd' ] += ' --ccdb-tof-sa'
660- workflow ['stages' ].append (t )
661- return t
658+ t ['cmd' ] = ('' ,'ln -nfs ../bkg_Hits' + str (det ) + '.root . ;' )[doembedding ]
659+ t ['cmd' ] += commondigicmd + ' --onlyDet ' + str (det )
660+ if det == 'TOF' :
661+ t ['cmd' ] += ' --ccdb-tof-sa'
662+ workflow ['stages' ].append (t )
663+ return t
662664
663665 det_to_digitask = {}
664666
@@ -682,6 +684,11 @@ def createRestDigiTask(name, det='ALLSMALLER'):
682684 det_to_digitask ["FT0" ]= t
683685 det_to_digitask ["FV0" ]= t
684686
687+ def getDigiTaskName (det ):
688+ t = det_to_digitask .get (det )
689+ if t == None :
690+ return "undefined"
691+ return t ['name' ]
685692
686693 # -----------
687694 # reco
@@ -697,7 +704,7 @@ def createRestDigiTask(name, det='ALLSMALLER'):
697704 tpcclustertasks .append (taskname )
698705 tpcclussect = createTask (name = taskname , needs = [TPCDigitask ['name' ]], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], cpu = '2' , mem = '8000' )
699706 tpcclussect ['cmd' ] = '${O2_ROOT}/bin/o2-tpc-chunkeddigit-merger --tpc-sectors ' + str (s )+ '-' + str (s + sectorpertask - 1 ) + ' --tpc-lanes ' + str (NWORKERS )
700- tpcclussect ['cmd' ] += ' | ${O2_ROOT}/bin/o2-tpc-reco-workflow ' + getDPL_global_options (bigshm = True ) + ' --input-type digitizer --output-type clusters,send-clusters-per-sector --outfile tpc-native-clusters-part' + str ((int )(s / sectorpertask )) + '.root --tpc-sectors ' + str (s )+ '-' + str (s + sectorpertask - 1 ) + ' ' + putConfigValues ( {"GPU_proc.ompThreads" : 4 })
707+ tpcclussect ['cmd' ] += ' | ${O2_ROOT}/bin/o2-tpc-reco-workflow ' + getDPL_global_options (bigshm = True ) + ' --input-type digitizer --output-type clusters,send-clusters-per-sector --outfile tpc-native-clusters-part' + str ((int )(s / sectorpertask )) + '.root --tpc-sectors ' + str (s )+ '-' + str (s + sectorpertask - 1 ) + ' ' + putConfigValuesNew ([ "GPU_global" ], {"GPU_proc.ompThreads" : 4 })
701708 tpcclussect ['env' ] = { "OMP_NUM_THREADS" : "4" , "SHMSIZE" : "5000000000" }
702709 workflow ['stages' ].append (tpcclussect )
703710
@@ -708,22 +715,22 @@ def createRestDigiTask(name, det='ALLSMALLER'):
708715 else :
709716 tpcclus = createTask (name = 'tpccluster_' + str (tf ), needs = [TPCDigitask ['name' ]], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], cpu = NWORKERS , mem = '2000' )
710717 tpcclus ['cmd' ] = '${O2_ROOT}/bin/o2-tpc-chunkeddigit-merger --tpc-lanes ' + str (NWORKERS )
711- tpcclus ['cmd' ] += ' | ${O2_ROOT}/bin/o2-tpc-reco-workflow ' + getDPL_global_options () + ' --input-type digitizer --output-type clusters,send-clusters-per-sector ' + putConfigValues ( {"GPU_proc.ompThreads" : 1 })
718+ tpcclus ['cmd' ] += ' | ${O2_ROOT}/bin/o2-tpc-reco-workflow ' + getDPL_global_options () + ' --input-type digitizer --output-type clusters,send-clusters-per-sector ' + putConfigValuesNew ([ "GPU_global" ], {"GPU_proc.ompThreads" : 1 })
712719 workflow ['stages' ].append (tpcclus )
713720 tpcreconeeds .append (tpcclus ['name' ])
714721
715722 TPCRECOtask = createTask (name = 'tpcreco_' + str (tf ), needs = tpcreconeeds , tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], relative_cpu = 3 / 8 , mem = '16000' )
716- TPCRECOtask ['cmd' ] = '${O2_ROOT}/bin/o2-tpc-reco-workflow ' + getDPL_global_options (bigshm = True ) + ' --input-type clusters --output-type tracks,send-clusters-per-sector ' + putConfigValues ( {"GPU_proc.ompThreads" :NWORKERS , "GPU_rec.maxTrackQPt" :Q2PTCUTOFF })
723+ TPCRECOtask ['cmd' ] = '${O2_ROOT}/bin/o2-tpc-reco-workflow ' + getDPL_global_options (bigshm = True ) + ' --input-type clusters --output-type tracks,send-clusters-per-sector ' + putConfigValuesNew ([ "GPU_global" ], {"GPU_proc.ompThreads" :NWORKERS , "GPU_rec.maxTrackQPt" :Q2PTCUTOFF })
717724 workflow ['stages' ].append (TPCRECOtask )
718725
719726 ITSConfig = {"ITSClustererParam.dictFilePath" :"../" }
720- ITSRECOtask = createTask (name = 'itsreco_' + str (tf ), needs = [ITS_DICT_DOWNLOADER_TASK ['name' ], det_to_digitask [ "ITS" ][ 'name' ] ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], cpu = '1' , mem = '2000' )
727+ ITSRECOtask = createTask (name = 'itsreco_' + str (tf ), needs = [ITS_DICT_DOWNLOADER_TASK ['name' ], getDigiTaskName ( "ITS" ) ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], cpu = '1' , mem = '2000' )
721728 ITSRECOtask ['cmd' ] = '${O2_ROOT}/bin/o2-its-reco-workflow --trackerCA --tracking-mode async ' + getDPL_global_options () \
722729 + putConfigValuesNew (["ITSVertexerParam" , "ITSAlpideParam" ,
723730 'ITSClustererParam' ], localCF = ITSConfig )
724731 workflow ['stages' ].append (ITSRECOtask )
725732
726- FT0RECOtask = createTask (name = 'ft0reco_' + str (tf ), needs = [det_to_digitask [ "FT0" ][ 'name' ] ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1000' )
733+ FT0RECOtask = createTask (name = 'ft0reco_' + str (tf ), needs = [getDigiTaskName ( "FT0" ) ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1000' )
727734 FT0RECOtask ['cmd' ] = '${O2_ROOT}/bin/o2-ft0-reco-workflow ' + getDPL_global_options () + putConfigValues ()
728735 workflow ['stages' ].append (FT0RECOtask )
729736
@@ -741,63 +748,68 @@ def createRestDigiTask(name, det='ALLSMALLER'):
741748 + " --track-sources " + anchorConfig .get ("o2-trd-global-tracking-options" ,{}).get ("track-sources" ,"all" )
742749 workflow ['stages' ].append (TRDTRACKINGtask )
743750
744- TOFRECOtask = createTask (name = 'tofmatch_' + str (tf ), needs = [ITSTPCMATCHtask ['name' ], det_to_digitask [ "TOF" ][ 'name' ] ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
751+ TOFRECOtask = createTask (name = 'tofmatch_' + str (tf ), needs = [ITSTPCMATCHtask ['name' ], getDigiTaskName ( "TOF" ) ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
745752 TOFRECOtask ['cmd' ] = '${O2_ROOT}/bin/o2-tof-reco-workflow --use-ccdb ' + getDPL_global_options () + putConfigValuesNew ()
746753 workflow ['stages' ].append (TOFRECOtask )
747754
748- TOFTPCMATCHERtask = createTask (name = 'toftpcmatch_' + str (tf ), needs = [TOFRECOtask ['name' ], TPCRECOtask ['name' ], TRDTRACKINGtask ['name' ]], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1000' )
755+ toftpcmatchneeds = [TOFRECOtask ['name' ], TPCRECOtask ['name' ]]
756+ toftracksrcdefault = "TPC,ITS-TPC"
757+ if isActive ('TRD' ):
758+ toftpcmatchneeds .append (TRDTRACKINGtask ['name' ])
759+ toftracksrcdefault += ",TPC-TRD,ITS-TPC-TRD"
760+ TOFTPCMATCHERtask = createTask (name = 'toftpcmatch_' + str (tf ), needs = toftpcmatchneeds , tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1000' )
749761 TOFTPCMATCHERtask ['cmd' ] = '${O2_ROOT}/bin/o2-tof-matcher-workflow ' + getDPL_global_options () \
750762 + putConfigValuesNew (["ITSClustererParam" ,
751763 'TPCGasParam' ,
752764 'ITSCATrackerParam' ,
753765 'MFTClustererParam' ],{"ITSClustererParam.dictFilePath" :"../" }) \
754- + " --track-sources " + anchorConfig .get ("o2-tof-matcher-workflow-options" ,{}).get ("track-sources" ,"all" )
766+ + " --track-sources " + anchorConfig .get ("o2-tof-matcher-workflow-options" ,{}).get ("track-sources" ,toftracksrcdefault )
755767 workflow ['stages' ].append (TOFTPCMATCHERtask )
756768
757769 MFTConfig = {"MFTClustererParam.dictFilePath" :"../" }
758- MFTRECOtask = createTask (name = 'mftreco_' + str (tf ), needs = [det_to_digitask [ "MFT" ][ 'name' ] , MFT_DICT_DOWNLOADER_TASK ['name' ]], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
770+ MFTRECOtask = createTask (name = 'mftreco_' + str (tf ), needs = [getDigiTaskName ( "MFT" ) , MFT_DICT_DOWNLOADER_TASK ['name' ]], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
759771 MFTRECOtask ['cmd' ] = '${O2_ROOT}/bin/o2-mft-reco-workflow ' + getDPL_global_options () + putConfigValuesNew (['MFTTracking' , 'MFTAlpideParam' , 'ITSClustererParam' ,'MFTClustererParam' ],MFTConfig )
760772 if args .mft_assessment_full == True :
761773 MFTRECOtask ['cmd' ]+= ' --run-assessment '
762774 workflow ['stages' ].append (MFTRECOtask )
763775
764776 # MCH reco: needing access to kinematics ... so some extra logic needed here
765- mchreconeeds = [det_to_digitask [ "MCH" ][ 'name' ] ]
777+ mchreconeeds = [getDigiTaskName ( "MCH" ) ]
766778 if usebkgcache :
767779 mchreconeeds += [ BKG_KINEDOWNLOADER_TASK ['name' ] ]
768780
769- MCHRECOtask = createTask (name = 'mchreco_' + str (tf ), needs = [det_to_digitask [ "MCH" ][ 'name' ] ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
781+ MCHRECOtask = createTask (name = 'mchreco_' + str (tf ), needs = [getDigiTaskName ( "MCH" ) ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
770782 MCHRECOtask ['cmd' ] = ('' ,'ln -nfs ../bkg_Kine.root . ;' )[doembedding ]
771783 MCHRECOtask ['cmd' ] += '${O2_ROOT}/bin/o2-mch-reco-workflow ' + getDPL_global_options () + putConfigValues ()
772784 workflow ['stages' ].append (MCHRECOtask )
773785
774- MIDRECOtask = createTask (name = 'midreco_' + str (tf ), needs = [det_to_digitask [ "MID" ][ 'name' ] ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
786+ MIDRECOtask = createTask (name = 'midreco_' + str (tf ), needs = [getDigiTaskName ( "MID" ) ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
775787 MIDRECOtask ['cmd' ] = '${O2_ROOT}/bin/o2-mid-digits-reader-workflow | ${O2_ROOT}/bin/o2-mid-reco-workflow ' + getDPL_global_options () + putConfigValues ()
776788 workflow ['stages' ].append (MIDRECOtask )
777789
778- FDDRECOtask = createTask (name = 'fddreco_' + str (tf ), needs = [det_to_digitask [ "FDD" ][ 'name' ] ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
790+ FDDRECOtask = createTask (name = 'fddreco_' + str (tf ), needs = [getDigiTaskName ( "FDD" ) ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
779791 FDDRECOtask ['cmd' ] = '${O2_ROOT}/bin/o2-fdd-reco-workflow ' + getDPL_global_options () + putConfigValues ()
780792 workflow ['stages' ].append (FDDRECOtask )
781793
782- FV0RECOtask = createTask (name = 'fv0reco_' + str (tf ), needs = [det_to_digitask [ "FV0" ][ 'name' ] ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
794+ FV0RECOtask = createTask (name = 'fv0reco_' + str (tf ), needs = [getDigiTaskName ( "FV0" ) ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
783795 FV0RECOtask ['cmd' ] = '${O2_ROOT}/bin/o2-fv0-reco-workflow ' + getDPL_global_options () + putConfigValues ()
784796 workflow ['stages' ].append (FV0RECOtask )
785797
786798 # calorimeters
787- EMCRECOtask = createTask (name = 'emcalreco_' + str (tf ), needs = [det_to_digitask [ "EMC" ][ 'name' ] ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
799+ EMCRECOtask = createTask (name = 'emcalreco_' + str (tf ), needs = [getDigiTaskName ( "EMC" ) ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
788800 EMCRECOtask ['cmd' ] = '${O2_ROOT}/bin/o2-emcal-reco-workflow --input-type digits --output-type cells --infile emcaldigits.root ' + getDPL_global_options () + putConfigValues ()
789801 workflow ['stages' ].append (EMCRECOtask )
790802
791- PHSRECOtask = createTask (name = 'phsreco_' + str (tf ), needs = [det_to_digitask [ "PHS" ][ 'name' ] ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
803+ PHSRECOtask = createTask (name = 'phsreco_' + str (tf ), needs = [getDigiTaskName ( "PHS" ) ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
792804 PHSRECOtask ['cmd' ] = '${O2_ROOT}/bin/o2-phos-reco-workflow ' + getDPL_global_options () + putConfigValues ()
793805 workflow ['stages' ].append (PHSRECOtask )
794806
795- CPVRECOtask = createTask (name = 'cpvreco_' + str (tf ), needs = [det_to_digitask [ "CPV" ][ 'name' ] ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
807+ CPVRECOtask = createTask (name = 'cpvreco_' + str (tf ), needs = [getDigiTaskName ( "CPV" ) ], tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], mem = '1500' )
796808 CPVRECOtask ['cmd' ] = '${O2_ROOT}/bin/o2-cpv-reco-workflow ' + getDPL_global_options () + putConfigValues ()
797809 workflow ['stages' ].append (CPVRECOtask )
798810
799811 if args .with_ZDC :
800- ZDCRECOtask = createTask (name = 'zdcreco_' + str (tf ), needs = [det_to_digitask [ "ZDC" ][ 'name' ] ], tf = tf , cwd = timeframeworkdir , lab = ["ZDC" ])
812+ ZDCRECOtask = createTask (name = 'zdcreco_' + str (tf ), needs = [getDigiTaskName ( "ZDC" ) ], tf = tf , cwd = timeframeworkdir , lab = ["ZDC" ])
801813 ZDCRECOtask ['cmd' ] = '${O2_ROOT}/bin/o2-zdc-digits-reco ' + getDPL_global_options () + putConfigValues ()
802814 workflow ['stages' ].append (ZDCRECOtask )
803815
@@ -860,7 +872,7 @@ def addQCPerTF(taskName, needs, readerCommand, configFilePath, objectsFile=''):
860872 # to be enabled once MFT Digits should run 5 times with different configurations
861873 for flp in range (5 ):
862874 addQCPerTF (taskName = 'mftDigitsQC' + str (flp ),
863- needs = [det_to_digitask [ "MFT" ][ 'name' ] ],
875+ needs = [getDigiTaskName ( "MFT" ) ],
864876 readerCommand = 'o2-qc-mft-digits-root-file-reader --mft-digit-infile=mftdigits.root' ,
865877 configFilePath = 'json://${O2DPG_ROOT}/MC/config/QC/json/qc-mft-digit-' + str (flp ) + '.json' ,
866878 objectsFile = 'mftDigitsQC.root' )
@@ -892,7 +904,7 @@ def addQCPerTF(taskName, needs, readerCommand, configFilePath, objectsFile=''):
892904
893905 ### TOF
894906 addQCPerTF (taskName = 'tofDigitsQC' ,
895- needs = [det_to_digitask [ "TOF" ][ 'name' ] ],
907+ needs = [getDigiTaskName ( "TOF" ) ],
896908 readerCommand = '${O2_ROOT}/bin/o2-tof-reco-workflow --input-type digits --output-type none' ,
897909 configFilePath = 'json://${O2DPG_ROOT}/MC/config/QC/json/tofdigits.json' ,
898910 objectsFile = 'TOFDigitsQC.root' )
@@ -934,11 +946,13 @@ def addQCPerTF(taskName, needs, readerCommand, configFilePath, objectsFile=''):
934946 # produce AOD
935947 # -----------
936948 aodneeds = [PVFINDERtask ['name' ], SVFINDERtask ['name' ], TOFRECOtask ['name' ],
937- TRDTRACKINGtask [ 'name' ], FV0RECOtask ['name' ]]
949+ FV0RECOtask ['name' ]]
938950 if isActive ('FV0' ):
939951 aodneeds += [ FV0RECOtask ['name' ] ]
940952 if isActive ('TOF' ):
941953 aodneeds += [ TOFRECOtask ['name' ] ]
954+ if isActive ('TRD' ):
955+ aodneeds += [ TRDTRACKINGtask ['name' ] ]
942956 if isActive ('EMC' ):
943957 aodneeds += [ EMCRECOtask ['name' ] ]
944958 if isActive ('CPV' ):
0 commit comments