diff --git a/CODEOWNERS b/CODEOWNERS index 3a3568f07..d089f7eb5 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -17,11 +17,15 @@ /DATA/testing/detectors/TRD @martenole /DATA/testing/detectors/ZDC -/MC @sawenzel @chiarazampolli @gconesab @benedikt-voelkel +/MC @sawenzel @chiarazampolli @benedikt-voelkel # PWG experts /MC/*/PWGHF @AliceO2Group/reviewers-pwg-hf @sawenzel @chiarazampolli @benedikt-voelkel /MC/*/PWGLF @AliceO2Group/reviewers-pwg-lf @sawenzel @chiarazampolli @benedikt-voelkel /MC/*/PWGEM @AliceO2Group/reviewers-pwg-em @sawenzel @chiarazampolli @benedikt-voelkel +/MC/*/PWGGAJE @AliceO2Group/reviewers-pwg-je @sawenzel @chiarazampolli @benedikt-voelkel +/MC/*/PWGCF @AliceO2Group/reviewers-pwg-cf @sawenzel @chiarazampolli @benedikt-voelkel +/MC/*/PWGDQ @AliceO2Group/reviewers-pwg-dq @sawenzel @chiarazampolli @benedikt-voelkel +/MC/*/PWGUD @AliceO2Group/reviewers-pwg-ud @sawenzel @chiarazampolli @benedikt-voelkel -/RelVal @sawenzel @chiarazampolli @gconesab @benedikt-voelkel +/RelVal @sawenzel @chiarazampolli @benedikt-voelkel diff --git a/DATA/common/setenv_calib.sh b/DATA/common/setenv_calib.sh index a2da3ec46..ec1a78b31 100755 --- a/DATA/common/setenv_calib.sh +++ b/DATA/common/setenv_calib.sh @@ -208,6 +208,7 @@ fi if [[ "0${GEN_TOPO_VERBOSE:-}" == "01" ]]; then + echo "CALIB_RCT_UPDATER = ${CALIB_RCT_UPDATER:-}" 1>&2 echo "CALIB_PRIMVTX_MEANVTX = $CALIB_PRIMVTX_MEANVTX" 1>&2 echo "CALIB_TOF_LHCPHASE = $CALIB_TOF_LHCPHASE" 1>&2 echo "CALIB_TOF_CHANNELOFFSETS = $CALIB_TOF_CHANNELOFFSETS" 1>&2 @@ -239,6 +240,8 @@ fi # define spec for proxy for TF-based outputs from BARREL if [[ -z ${CALIBDATASPEC_BARREL_TF:-} ]]; then + # RCT updater + if [[ ${CALIB_RCT_UPDATER:-} == 1 ]]; then add_semicolon_separated CALIBDATASPEC_BARREL_TF "calibRCT:CTD/DONE/0"; fi # prim vtx if [[ $CALIB_PRIMVTX_MEANVTX == 1 ]]; then add_semicolon_separated CALIBDATASPEC_BARREL_TF "pvtx:GLO/PVTX/0"; fi diff --git a/DATA/production/calib/tpc-laser-filter.sh b/DATA/production/calib/tpc-laser-filter.sh index 42ba384f8..f7926d851 100755 --- a/DATA/production/calib/tpc-laser-filter.sh +++ b/DATA/production/calib/tpc-laser-filter.sh @@ -67,11 +67,12 @@ o2-dpl-raw-proxy ${ARGS_ALL} \ | o2-tpc-reco-workflow ${ARGS_ALL} ${TPC_CORR_SCALING:-} \ --input-type digitizer \ --output-type "tracks,disable-writer,clusters" \ + --disable-ctp-lumi-request \ --disable-mc \ --pipeline tpc-zsEncoder:20,tpc-tracker:8 \ ${GPU_CONFIG} \ --condition-remap "file:///home/wiechula/processData/inputFilesTracking/triggeredLaser/=GLO/Config/GRPECS;file:///home/wiechula/processData/inputFilesTracking/triggeredLaser/=GLO/Config/GRPMagField;file:///home/wiechula/processData/inputFilesTracking/triggeredLaser=TPC/Calib/LaserTracks" \ - --configKeyValues "${ARGS_ALL_CONFIG};align-geom.mDetectors=none;GPU_global.deviceType=$GPUTYPE;GPU_proc.tpcIncreasedMinClustersPerRow=500000;GPU_proc.ignoreNonFatalGPUErrors=1;$GPU_CONFIG_KEY;GPU_global.tpcTriggeredMode=1;GPU_rec_tpc.clusterError2AdditionalY=0.1;GPU_rec_tpc.clusterError2AdditionalZ=0.15;GPU_rec_tpc.clustersShiftTimebinsClusterizer=35;GPU_proc.memoryScalingFactor=2" \ + --configKeyValues "${ARGS_ALL_CONFIG};align-geom.mDetectors=none;GPU_global.deviceType=$GPUTYPE;GPU_proc.tpcIncreasedMinClustersPerRow=500000;GPU_proc.ignoreNonFatalGPUErrors=1;$GPU_CONFIG_KEY;GPU_global.tpcTriggeredMode=1;GPU_rec_tpc.clusterError2AdditionalY=0.1;GPU_rec_tpc.clusterError2AdditionalZ=0.15;GPU_rec_tpc.clustersShiftTimebinsClusterizer=35;GPU_proc.memoryScalingFactor=2;GPU_proc_param.tpcTriggerHandling=0" \ | o2-tpc-laser-track-filter ${ARGS_ALL} \ | o2-dpl-output-proxy ${ARGS_ALL} \ --dataspec "$PROXY_OUTSPEC" \ diff --git a/DATA/production/qc-async/cpv.json b/DATA/production/qc-async/cpv.json index 71f02f0c9..f7130b5c1 100644 --- a/DATA/production/qc-async/cpv.json +++ b/DATA/production/qc-async/cpv.json @@ -3,23 +3,14 @@ "config": { "database": { "implementation": "CCDB", - "host": "alio2-cr1-hv-qcdb1.cern.ch:8083", - "username": "not_applicable", - "password": "not_applicable", - "name": "not_applicable" - }, - "Activity": { - "number": "42", - "type": "2" + "host": "ccdb-test.cern.ch:8080" }, + "Activity": {}, "monitoring": { - "url": "influxdb-unix:///tmp/telegraf.sock" - }, - "consul": { - "url": "alio2-cr1-hv-aliecs:8500" + "url": "infologger:///debug?qc" }, "conditionDB": { - "url": "http://localhost:8084/" + "url": "ccdb-test.cern.ch:8080" } }, "tasks": { @@ -30,7 +21,6 @@ "moduleName": "QcCPV", "detectorName": "CPV", "cycleDurationSeconds": "120", - "maxNumberCycles": "-1", "dataSource": { "type": "direct", "query": "clusters:CPV/CLUSTERS/0;ctrigrec:CPV/CLUSTERTRIGRECS/0" @@ -40,9 +30,7 @@ "ccdbCheckInterval": "1000" } } - }, - "dataSamplingPolicies": [ - - ] - } -} + } + }, + "dataSamplingPolicies": [] +} \ No newline at end of file diff --git a/DATA/production/qc-async/its.json b/DATA/production/qc-async/its.json index ff8c0408b..832f88c63 100644 --- a/DATA/production/qc-async/its.json +++ b/DATA/production/qc-async/its.json @@ -44,17 +44,7 @@ "dicttimestamp" : "0", "publishDetailedSummary": "1", "publishSummary1D": "0" - }, - "grpGeomRequest" : { - "geomRequest": "Aligned", - "askGRPECS": "false", - "askGRPLHCIF": "false", - "askGRPMagField": "false", - "askMatLUT": "false", - "askTime": "false", - "askOnceAllButField": "true", - "needPropagatorD": "false" - } + } }, "ITSTracks": { "active": "true", @@ -80,7 +70,8 @@ "nBCbins" : "103", "dicttimestamp" : 0, "doNorm": "1", - "InvMasses" : "1" + "InvMasses" : "1", + "publishMore": "0" } } }, diff --git a/DATA/production/qc-async/mch-tracks.json b/DATA/production/qc-async/mch-tracks.json index 137486fa7..8b12e7a1e 100644 --- a/DATA/production/qc-async/mch-tracks.json +++ b/DATA/production/qc-async/mch-tracks.json @@ -33,7 +33,7 @@ "maxNumberCycles": "-1", "dataSource": { "type": "direct", - "query": "trackMCH:MCH/TRACKS;trackMCHROF:MCH/TRACKROFS;trackMCHTRACKCLUSTERS:MCH/TRACKCLUSTERS" + "query": "trackMCH:MCH/TRACKS;trackMCHROF:MCH/TRACKROFS;trackMCHTRACKCLUSTERS:MCH/TRACKCLUSTERS;mchtrackdigits:MCH/TRACKDIGITS" }, "taskParameters": { "maxTracksPerTF": "600", diff --git a/DATA/production/qc-async/mft.json b/DATA/production/qc-async/mft.json index d055da0d8..de4d80b24 100644 --- a/DATA/production/qc-async/mft.json +++ b/DATA/production/qc-async/mft.json @@ -37,21 +37,12 @@ }, "movingWindows": [ "mClustersROFSize" ], "taskParameters": { + "onlineQC" : "0", "maxClusterROFSize" : "50000", "maxDuration" : "60000", "timeBinSize" : "0.1", "ROFLengthInBC" : "594" - }, - "grpGeomRequest" : { - "geomRequest": "Aligned", - "askGRPECS": "false", - "askGRPLHCIF": "false", - "askGRPMagField": "true", - "askMatLUT": "false", - "askTime": "false", - "askOnceAllButField": "true", - "needPropagatorD": "false" - } + } }, "MFTTracks": { "active": "true", @@ -74,6 +65,16 @@ "MaxClusterROFSize": "50000", "MaxDuration": "60000", "TimeBinSize": "0.1" + }, + "grpGeomRequest" : { + "geomRequest": "None", + "askGRPECS": "true", + "askGRPLHCIF": "false", + "askGRPMagField": "false", + "askMatLUT": "false", + "askTime": "false", + "askOnceAllButField": "false", + "needPropagatorD": "false" } } }, diff --git a/DATA/production/qc-async/phs.json b/DATA/production/qc-async/phs.json index 63a7dd28d..37d57a4a6 100644 --- a/DATA/production/qc-async/phs.json +++ b/DATA/production/qc-async/phs.json @@ -3,23 +3,14 @@ "config": { "database": { "implementation": "CCDB", - "host": "ali-qcdb.cern.ch:8083", - "username": "not_applicable", - "password": "not_applicable", - "name": "not_applicable" - }, - "Activity": { - "number": "42", - "type": "2" + "host": "ccdb-test.cern.ch:8080" }, + "Activity": {}, "monitoring": { - "url": "influxdb-unix:///tmp/telegraf.sock" - }, - "consul": { - "url": "" + "url": "infologger:///debug?qc" }, "conditionDB": { - "url": "http://localhost:8084" + "url": "ccdb-test.cern.ch:8080" } }, "tasks": { @@ -30,18 +21,13 @@ "moduleName": "QcPHOS", "detectorName": "PHS", "cycleDurationSeconds": "100", - "maxNumberCycles": "-1", "dataSource": { "type": "direct", "query": "clusters:PHS/CLUSTERS/0;clustertr:PHS/CLUSTERTRIGREC/0" }, - "taskParameters": { - "": "" - } + "taskParameters": {} } - }, - "dataSamplingPolicies": [ - - ] - } -} + } + }, + "dataSamplingPolicies": [] +} \ No newline at end of file diff --git a/DATA/production/qc-async/tpc.json b/DATA/production/qc-async/tpc.json index 350ed4d49..a8c7f2ac9 100644 --- a/DATA/production/qc-async/tpc.json +++ b/DATA/production/qc-async/tpc.json @@ -33,7 +33,8 @@ "cycleDurationSeconds": "300", "dataSource": { "type": "dataSamplingPolicy", - "name": "tpc-clusters" + "name": "tpc-clusters", + "query": "inputClusters:TPC/CLUSTERNATIVE" }, "taskParameters": { "mergeableOutput": "true", @@ -65,7 +66,8 @@ "cutMinpTPC": "0.05", "cutMaxpTPC": "20.", "cutMinpTPCMIPs": "0.45", - "cutMaxpTPCMIPs": "0.55" + "cutMaxpTPCMIPs": "0.55", + "turnOffHistosForAsync": "true" } }, "TPCTrackClusters": { @@ -97,14 +99,16 @@ "movingWindows" : [ "h2DNClustersEta" ], "dataSource": { "type": "dataSamplingPolicy", - "name": "tpc-tracks" + "name": "tpc-tracks", + "query": "inputTracks:TPC/TRACKS/0" }, "taskParameters": { "cutAbsEta": "1.", "cutMinNCluster": "60", "cutMindEdxTot": "20.", "samplingFractionDCAr": "0.1", - "cutPtForDCAr": "1.5" + "cutPtForDCAr": "1.5", + "turnOffHistosForAsync": "true" }, "grpGeomRequest" : { "geomRequest": "None", diff --git a/DATA/production/qc-sync/its.json b/DATA/production/qc-sync/its.json index e3a2acc4b..2d8fb9d78 100644 --- a/DATA/production/qc-sync/its.json +++ b/DATA/production/qc-sync/its.json @@ -46,17 +46,7 @@ "publishSummary1D": "0", "publishDetailedSummary": "0" }, - "grpGeomRequest" : { - "geomRequest": "Aligned", - "askGRPECS": "false", - "askGRPLHCIF": "false", - "askGRPMagField": "false", - "askMatLUT": "false", - "askTime": "false", - "askOnceAllButField": "true", - "needPropagatorD": "false" - }, - "localMachines": [ + "localMachines": [ "localhost", "epn" ], "localControl": "odc", diff --git a/DATA/production/qc-sync/mft-full-no-tracks.json b/DATA/production/qc-sync/mft-full-no-tracks.json index 6087535a8..3c39a234e 100644 --- a/DATA/production/qc-sync/mft-full-no-tracks.json +++ b/DATA/production/qc-sync/mft-full-no-tracks.json @@ -58,6 +58,16 @@ "timeBinSize" : "0.1", "ROFLengthInBC" : "594" }, + "grpGeomRequest" : { + "geomRequest": "None", + "askGRPECS": "true", + "askGRPLHCIF": "false", + "askGRPMagField": "false", + "askMatLUT": "false", + "askTime": "false", + "askOnceAllButField": "false", + "needPropagatorD": "false" + }, "location": "local", "localMachines" : [ "flp" ], "remoteMachine": "any", @@ -75,21 +85,12 @@ "name": "mft-clusters" }, "taskParameters" : { + "onlineQC" : "1", "maxClusterROFSize" : "50000", "maxDuration" : "60000", "timeBinSize" : "0.1", "ROFLengthInBC" : "594" }, - "grpGeomRequest" : { - "geomRequest": "Aligned", - "askGRPECS": "false", - "askGRPLHCIF": "false", - "askGRPMagField": "true", - "askMatLUT": "false", - "askTime": "false", - "askOnceAllButField": "true", - "needPropagatorD": "false" - }, "location": "local", "localMachines": [ "epn", "localhost" diff --git a/DATA/production/qc-sync/mft-full.json b/DATA/production/qc-sync/mft-full.json index 5a446e3e5..6b1bf6d64 100644 --- a/DATA/production/qc-sync/mft-full.json +++ b/DATA/production/qc-sync/mft-full.json @@ -58,6 +58,16 @@ "timeBinSize" : "0.1", "ROFLengthInBC" : "594" }, + "grpGeomRequest" : { + "geomRequest": "None", + "askGRPECS": "true", + "askGRPLHCIF": "false", + "askGRPMagField": "false", + "askMatLUT": "false", + "askTime": "false", + "askOnceAllButField": "false", + "needPropagatorD": "false" + }, "location": "local", "localMachines" : [ "flp" ], "remoteMachine": "any", @@ -75,21 +85,12 @@ "name": "mft-clusters" }, "taskParameters" : { + "onlineQC" : "1", "maxClusterROFSize" : "50000", "maxDuration" : "60000", "timeBinSize" : "0.1", "ROFLengthInBC" : "594" }, - "grpGeomRequest" : { - "geomRequest": "Aligned", - "askGRPECS": "false", - "askGRPLHCIF": "false", - "askGRPMagField": "true", - "askMatLUT": "false", - "askTime": "false", - "askOnceAllButField": "true", - "needPropagatorD": "false" - }, "location": "local", "localMachines": [ "epn", "localhost" @@ -109,6 +110,16 @@ "type" : "direct", "query" : "tracks:MFT/TRACKS/0;tracksrofs:MFT/MFTTrackROF/0;clustersrofs:MFT/CLUSTERSROF/0" }, + "grpGeomRequest" : { + "geomRequest": "None", + "askGRPECS": "true", + "askGRPLHCIF": "false", + "askGRPMagField": "false", + "askMatLUT": "false", + "askTime": "false", + "askOnceAllButField": "false", + "needPropagatorD": "false" + }, "location": "local", "localMachines": [ "epn", "localhost" @@ -120,6 +131,16 @@ "MaxDuration": "60000", "TimeBinSize": "0.1" }, + "grpGeomRequest": { + "geomRequest": "None", + "askGRPECS": "true", + "askGRPLHCIF": "false", + "askGRPMagField": "false", + "askMatLUT": "false", + "askTime": "false", + "askOnceAllButField": "false", + "needPropagatorD": "false" + }, "remoteMachine": "alio2-cr1-qme05.cern.ch", "remotePort": "47796", "localControl": "odc" diff --git a/DATA/production/qc-workflow.sh b/DATA/production/qc-workflow.sh index c1c471130..45d06d2c3 100755 --- a/DATA/production/qc-workflow.sh +++ b/DATA/production/qc-workflow.sh @@ -313,6 +313,7 @@ elif [[ -z ${QC_JSON_FROM_OUTSIDE:-} ]]; then fi [[ $EPNSYNCMODE == 1 && $NUMAGPUIDS == 1 ]] && QC_CONFIG_OVERRIDE+="qc.config.infologger.filterDiscardFile=../../qc-_ID_-${NUMAID}.log;" +[[ $EPNSYNCMODE == 0 ]] && QC_CONFIG+=" --no-infologger" [[ ! -z $QC_CONFIG_OVERRIDE ]] && QC_CONFIG+=" --override-values \"$QC_CONFIG_OVERRIDE\"" diff --git a/MC/bin/o2dpg_sim_workflow.py b/MC/bin/o2dpg_sim_workflow.py index d1ae5ced4..4649a68c0 100755 --- a/MC/bin/o2dpg_sim_workflow.py +++ b/MC/bin/o2dpg_sim_workflow.py @@ -34,7 +34,7 @@ sys.path.append(join(dirname(__file__), '.', 'o2dpg_workflow_utils')) -from o2dpg_workflow_utils import createTask, createGlobalInitTask, dump_workflow, adjust_RECO_environment, isActive, activate_detector, deactivate_detector +from o2dpg_workflow_utils import createTask, createGlobalInitTask, dump_workflow, adjust_RECO_environment, isActive, activate_detector, deactivate_detector, compute_n_workers from o2dpg_qc_finalization_workflow import include_all_QC_finalization from o2dpg_sim_config import create_sim_config, create_geant_config, constructConfigKeyArg @@ -85,12 +85,15 @@ parser.add_argument('-confKeyBkg',help='embedding background configuration key values, for example: "GeneratorPythia8.config=pythia8bkg.cfg"', default='') parser.add_argument('-colBkg',help='embedding background collision system', default='PbPb') -parser.add_argument('-e',help='simengine', default='TGeant4') +parser.add_argument('-e',help='simengine', default='TGeant4', choices=['TGeant4', 'TGeant3', 'TFluka']) parser.add_argument('-tf',help='number of timeframes', default=2) parser.add_argument('--production-offset',help='Offset determining bunch-crossing ' + ' range within a (GRID) production. This number sets first orbit to ' + 'Offset x Number of TimeFrames x OrbitsPerTimeframe (up for further sophistication)', default=0) -parser.add_argument('-j',help='number of workers (if applicable)', default=8, type=int) +parser.add_argument('-j', '--n-workers', dest='n_workers', help='number of workers (if applicable)', default=8, type=int) +parser.add_argument('--force-n-workers', dest='force_n_workers', action='store_true', help='by default, number of workers is re-computed ' + 'for given interaction rate if --pregenCollContext is set; ' + 'pass this to avoid that') parser.add_argument('-mod',help='Active modules (deprecated)', default='--skipModules ZDC') parser.add_argument('--with-ZDC', action='store_true', help='Enable ZDC in workflow') parser.add_argument('-seed',help='random seed number', default=None) @@ -118,7 +121,8 @@ parser.add_argument('--sor', default=-1, type=int, help=argparse.SUPPRESS) # may pass start of run with this (otherwise it is autodetermined from run number) parser.add_argument('--run-anchored', action='store_true', help=argparse.SUPPRESS) parser.add_argument('--alternative-reco-software', default="", help=argparse.SUPPRESS) # power feature to set CVFMS alienv software version for reco steps (different from default) -parser.add_argument('--dpl-child-driver', default="", help="Child driver to use in DPL processes (export mode)") +parser.add_argument('--dpl-child-driver', default="", help="Child driver to use in DPL processes (expert mode)") +parser.add_argument('--event-gen-mode', choices=['separated', 'integrated'], default='separated', help="Whether event generation is done before (separated) or within detector simulation (integrated).") # QC related arguments parser.add_argument('--include-qc', '--include-full-qc', action='store_true', help='includes QC in the workflow, both per-tf processing and finalization') @@ -313,7 +317,7 @@ def extractVertexArgs(configKeyValuesStr, finalDiamondDict): args.timestamp = args.sor NTIMEFRAMES=int(args.tf) -NWORKERS=args.j +NWORKERS=args.n_workers MODULES = "--skipModules ZDC" if not isActive("ZDC") else "" SIMENGINE=args.e BFIELD=args.field @@ -638,6 +642,9 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True): QEDdigiargs=' --simPrefixQED qed_' + str(tf) + ' --qed-x-section-ratio ' + str(QEDXSecExpected/PbPbXSec) workflow['stages'].append(QED_task) + # recompute the number of workers to increase CPU efficiency + NWORKERS_TF = compute_n_workers(INTRATE, COLTYPE) if (args.pregenCollContext and not args.force_n_workers) else NWORKERS + # produce the signal configuration SGN_CONFIG_task=createTask(name='gensgnconf_'+str(tf), tf=tf, cwd=timeframeworkdir) SGN_CONFIG_task['cmd'] = 'echo "placeholder / dummy task"' @@ -685,7 +692,6 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True): if (args.pregenCollContext == True): signalneeds.append(PreCollContextTask['name']) - # add embedIntoFile only if embeddPattern does contain a '@' embeddinto= "--embedIntoFile ../bkg_MCHeader.root" if (doembedding & ("@" in args.embeddPattern)) else "" #embeddinto= "--embedIntoFile ../bkg_MCHeader.root" if doembedding else "" @@ -694,18 +700,37 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True): signalneeds = signalneeds + [ BKGtask['name'] ] else: signalneeds = signalneeds + [ BKG_HEADER_task['name'] ] + + # (separate) event generation task + sep_event_mode = args.event_gen_mode == 'separated' + SGNGENtask=createTask(name='sgngen_'+str(tf), needs=signalneeds, tf=tf, cwd='tf'+str(tf), lab=["GEN"], + cpu=1, mem=1000) + SGNGENtask['cmd']='${O2_ROOT}/bin/o2-sim --noGeant -j 1 --field ccdb --vertexMode kCCDB' \ + + ' --run ' + str(args.run) + ' ' + str(CONFKEY) + str(TRIGGER) \ + + ' -g ' + str(GENERATOR) + ' ' + str(INIFILE) + ' -o genevents ' + embeddinto \ + + ('', ' --timestamp ' + str(args.timestamp))[args.timestamp!=-1] \ + + ' --seed ' + str(TFSEED) + ' -n ' + str(NSIGEVENTS) + if args.pregenCollContext == True: + SGNGENtask['cmd'] += ' --fromCollContext collisioncontext.root:' + signalprefix + if sep_event_mode == True: + workflow['stages'].append(SGNGENtask) + signalneeds = signalneeds + [SGNGENtask['name']] + sgnmem = 6000 if COLTYPE == 'PbPb' else 4000 - SGNtask=createTask(name='sgnsim_'+str(tf), needs=signalneeds, tf=tf, cwd='tf'+str(tf), lab=["GEANT"], relative_cpu=7/8, n_workers=NWORKERS, mem=str(sgnmem)) - SGNtask['cmd']='${O2_ROOT}/bin/o2-sim -e ' + str(SIMENGINE) + ' ' + str(MODULES) + ' -n ' + str(NSIGEVENTS) + ' --seed ' + str(TFSEED) \ - + ' --field ccdb -j ' + str(NWORKERS) + ' -g ' + str(GENERATOR) \ - + ' ' + str(TRIGGER) + ' ' + str(CONFKEY) + ' ' + str(INIFILE) \ - + ' -o ' + signalprefix + ' ' + embeddinto \ - + ('', ' --timestamp ' + str(args.timestamp))[args.timestamp!=-1] + ' --run ' + str(args.run) \ - + ' --vertexMode kCCDB' + SGNtask=createTask(name='sgnsim_'+str(tf), needs=signalneeds, tf=tf, cwd='tf'+str(tf), lab=["GEANT"], + relative_cpu=7/8, n_workers=NWORKERS_TF, mem=str(sgnmem)) + sgncmdbase = '${O2_ROOT}/bin/o2-sim -e ' + str(SIMENGINE) + ' ' + str(MODULES) + ' -n ' + str(NSIGEVENTS) + ' --seed ' + str(TFSEED) \ + + ' --field ccdb -j ' + str(NWORKERS_TF) + ' ' + str(CONFKEY) + ' ' + str(INIFILE) + ' -o ' + signalprefix + ' ' + embeddinto \ + + ('', ' --timestamp ' + str(args.timestamp))[args.timestamp!=-1] + ' --run ' + str(args.run) + if sep_event_mode: + SGNtask['cmd'] = sgncmdbase + ' -g extkinO2 --extKinFile genevents_Kine.root ' + ' --vertexMode kNoVertex' + else: + SGNtask['cmd'] = sgncmdbase + ' -g ' + str(GENERATOR) + ' ' + str(TRIGGER) + ' --vertexMode kCCDB ' if not isActive('all'): SGNtask['cmd'] += ' --readoutDetectors ' + " ".join(activeDetectors) if args.pregenCollContext == True: SGNtask['cmd'] += ' --fromCollContext collisioncontext.root' + workflow['stages'].append(SGNtask) # some tasks further below still want geometry + grp in fixed names, so we provide it here @@ -846,10 +871,10 @@ def putConfigValuesNew(listOfMainKeys=[], localCF = {}): tpcdigimem = 12000 if havePbPb else 9000 TPCDigitask=createTask(name='tpcdigi_'+str(tf), needs=tpcdigineeds, - tf=tf, cwd=timeframeworkdir, lab=["DIGI"], cpu=NWORKERS, mem=str(tpcdigimem)) + tf=tf, cwd=timeframeworkdir, lab=["DIGI"], cpu=NWORKERS_TF, mem=str(tpcdigimem)) TPCDigitask['cmd'] = ('','ln -nfs ../bkg_HitsTPC.root . ;')[doembedding] TPCDigitask['cmd'] += '${O2_ROOT}/bin/o2-sim-digitizer-workflow ' + getDPL_global_options() + ' -n ' + str(args.ns) + simsoption \ - + ' --onlyDet TPC --TPCuseCCDB --interactionRate ' + str(INTRATE) + ' --tpc-lanes ' + str(NWORKERS) \ + + ' --onlyDet TPC --TPCuseCCDB --interactionRate ' + str(INTRATE) + ' --tpc-lanes ' + str(NWORKERS_TF) \ + ' --incontext ' + str(CONTEXTFILE) + ' --disable-write-ini --early-forward-policy always --forceSelectedDets ' \ + putConfigValuesNew(["TPCGasParam","TPCGEMParam","TPCEleParam","TPCITCorr","TPCDetParam"], localCF={"DigiParams.maxOrbitsToDigitize" : str(orbitsPerTF), "DigiParams.seed" : str(TFSEED)}) @@ -864,11 +889,11 @@ def putConfigValuesNew(listOfMainKeys=[], localCF = {}): if usebkgcache: trddigineeds += [ BKG_HITDOWNLOADER_TASKS['TRD']['name'] ] TRDDigitask=createTask(name='trddigi_'+str(tf), needs=trddigineeds, - tf=tf, cwd=timeframeworkdir, lab=["DIGI"], cpu=NWORKERS, mem='8000') + tf=tf, cwd=timeframeworkdir, lab=["DIGI"], cpu=NWORKERS_TF, mem='8000') TRDDigitask['cmd'] = ('','ln -nfs ../bkg_HitsTRD.root . ;')[doembedding] TRDDigitask['cmd'] += '${O2_ROOT}/bin/o2-sim-digitizer-workflow ' + getDPL_global_options() + ' -n ' + str(args.ns) + simsoption \ + ' --onlyDet TRD --interactionRate ' + str(INTRATE) + ' --incontext ' + str(CONTEXTFILE) + ' --disable-write-ini' \ - + putConfigValuesNew(localCF={"TRDSimParams.digithreads" : NWORKERS, "DigiParams.seed" : str(TFSEED)}) + " --forceSelectedDets" + + putConfigValuesNew(localCF={"TRDSimParams.digithreads" : NWORKERS_TF, "DigiParams.seed" : str(TFSEED)}) + " --forceSelectedDets" TRDDigitask['cmd'] += ('',' --disable-mc')[args.no_mc_labels] workflow['stages'].append(TRDDigitask) @@ -958,7 +983,7 @@ def getDigiTaskName(det): taskname = 'tpcclusterpart' + str((int)(s/sectorpertask)) + '_' + str(tf) tpcclustertasks.append(taskname) tpcclussect = createTask(name=taskname, needs=[TPCDigitask['name']], tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu='2', mem='8000') - digitmergerstr = '${O2_ROOT}/bin/o2-tpc-chunkeddigit-merger --tpc-sectors ' + str(s)+'-'+str(s+sectorpertask-1) + ' --tpc-lanes ' + str(NWORKERS) + ' | ' + digitmergerstr = '${O2_ROOT}/bin/o2-tpc-chunkeddigit-merger --tpc-sectors ' + str(s)+'-'+str(s+sectorpertask-1) + ' --tpc-lanes ' + str(NWORKERS_TF) + ' | ' tpcclussect['cmd'] = (digitmergerstr,'')[args.no_tpc_digitchunking] + ' ${O2_ROOT}/bin/o2-tpc-reco-workflow ' + getDPL_global_options(bigshm=True) + ' --input-type ' + ('digitizer','digits')[args.no_tpc_digitchunking] + ' --output-type clusters,send-clusters-per-sector --tpc-native-cluster-writer \" --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}) + ('',' --disable-mc')[args.no_mc_labels] tpcclussect['env'] = { "OMP_NUM_THREADS" : "4", "SHMSIZE" : "16000000000" } tpcclussect['semaphore'] = "tpctriggers.root" @@ -970,8 +995,8 @@ def getDigiTaskName(det): workflow['stages'].append(TPCCLUSMERGEtask) tpcreconeeds.append(TPCCLUSMERGEtask['name']) else: - tpcclus = createTask(name='tpccluster_' + str(tf), needs=[TPCDigitask['name']], tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu=NWORKERS, mem='2000') - tpcclus['cmd'] = '${O2_ROOT}/bin/o2-tpc-chunkeddigit-merger --tpc-lanes ' + str(NWORKERS) + tpcclus = createTask(name='tpccluster_' + str(tf), needs=[TPCDigitask['name']], tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu=NWORKERS_TF, mem='2000') + tpcclus['cmd'] = '${O2_ROOT}/bin/o2-tpc-chunkeddigit-merger --tpc-lanes ' + str(NWORKERS_TF) 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","TPCGasParam","TPCCorrMap"],{"GPU_proc.ompThreads" : 1}) + ('',' --disable-mc')[args.no_mc_labels] workflow['stages'].append(tpcclus) tpcreconeeds.append(tpcclus['name']) @@ -979,7 +1004,7 @@ def getDigiTaskName(det): tpc_corr_scaling_options = anchorConfig.get('tpc-corr-scaling','') TPCRECOtask=createTask(name='tpcreco_'+str(tf), needs=tpcreconeeds, tf=tf, cwd=timeframeworkdir, lab=["RECO"], relative_cpu=3/8, mem='16000') 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","TPCGasParam", "TPCCorrMap", "GPU_rec_tpc", "trackTuneParams"], {"GPU_proc.ompThreads":NWORKERS}) + ('',' --disable-mc')[args.no_mc_labels] \ + + putConfigValuesNew(["GPU_global","TPCGasParam", "TPCCorrMap", "GPU_rec_tpc", "trackTuneParams"], {"GPU_proc.ompThreads":NWORKERS_TF}) + ('',' --disable-mc')[args.no_mc_labels] \ + tpc_corr_scaling_options workflow['stages'].append(TPCRECOtask) @@ -1142,7 +1167,7 @@ def getDigiTaskName(det): pvfinder_matching_sources = anchorConfig.get('', {}).get('vertex-track-matching-sources', 'ITS-TPC,TPC-TRD,ITS-TPC-TRD,TPC-TOF,ITS-TPC-TOF,TPC-TRD-TOF,ITS-TPC-TRD-TOF,MFT-MCH,MCH-MID,ITS,MFT,TPC,TOF,FT0,MID,EMC,PHS,CPV,ZDC,FDD,HMP,FV0,TRD,MCH,CTP') pvfinderneeds = [TRDTRACKINGtask2['name'], FT0RECOtask['name'], FV0RECOtask['name'], EMCRECOtask['name'], PHSRECOtask['name'], CPVRECOtask['name'], FDDRECOtask['name'], ZDCRECOtask['name'], HMPMATCHtask['name'], HMPMATCHtask['name'], ITSTPCMATCHtask['name'], TOFTPCMATCHERtask['name'], MFTMCHMATCHtask['name'], MCHMIDMATCHtask['name']] - PVFINDERtask = createTask(name='pvfinder_'+str(tf), needs=pvfinderneeds, tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu=NWORKERS, mem='4000') + PVFINDERtask = createTask(name='pvfinder_'+str(tf), needs=pvfinderneeds, tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu=NWORKERS_TF, mem='4000') PVFINDERtask['cmd'] = '${O2_ROOT}/bin/o2-primary-vertexing-workflow ' \ + getDPL_global_options() + putConfigValuesNew(['ITSAlpideParam','MFTAlpideParam', 'pvertexer', 'TPCGasParam', 'TPCCorrMap', 'ft0tag'], {"NameConf.mDirMatLUT" : ".."}) PVFINDERtask['cmd'] += ' --vertexing-sources ' + pvfinder_sources + ' --vertex-track-matching-sources ' + pvfinder_matching_sources + (' --combine-source-devices','')[args.no_combine_dpl_devices] @@ -1300,7 +1325,7 @@ def addQCPerTF(taskName, needs, readerCommand, configFilePath, objectsFile=''): needs=[PHSRECOtask['name']], readerCommand='o2-phos-reco-workflow --input-type cells --output-type clusters --disable-mc --disable-root-output', configFilePath='json://${O2DPG_ROOT}/MC/config/QC/json/phs-cells-clusters-task.json') - + ### MID if isActive('MID'): addQCPerTF(taskName='MIDTaskQC', diff --git a/MC/bin/o2dpg_workflow_utils.py b/MC/bin/o2dpg_workflow_utils.py index 18fd600c9..b28333674 100755 --- a/MC/bin/o2dpg_workflow_utils.py +++ b/MC/bin/o2dpg_workflow_utils.py @@ -24,6 +24,28 @@ def deactivate_detector(det): def isActive(det): return det not in INACTIVE_DETECTORS and ("all" in ACTIVE_DETECTORS or det in ACTIVE_DETECTORS) +def compute_n_workers(interaction_rate, collision_system, n_workers_user=8, n_workers_min=1, interaction_rate_linear_below=300000): + """ + Compute number of workers + + n_workers = m * IR + b + + based on + https://indico.cern.ch/event/1395900/contributions/5868567/attachments/2823967/4932440/20240320_slides_cpu_eff.pdf, slide 3 + + Assume n_workers_in=8 to be ideal for pp IR > interaction_rate_linear_below + + Start with 1 worker at IR=0 + Go linearly until interaction_rate_linear_below + """ + if collision_system == "PbPb" or interaction_rate >= interaction_rate_linear_below: + return n_workers_user + + n_workers_min = max(1, n_workers_min) + m = (n_workers_user - n_workers_min) / interaction_rate_linear_below + # at least 1 worker + return max(1, round(m * interaction_rate + n_workers_min)) + def relativeCPU(n_rel, n_workers): # compute number of CPUs from a given number of workers # n_workers and a fraction n_rel diff --git a/MC/config/PWGDQ/external/generator/GeneratorPromptCharmonia.C b/MC/config/PWGDQ/external/generator/GeneratorPromptCharmonia.C index a8b7e1e0f..8cd554e43 100644 --- a/MC/config/PWGDQ/external/generator/GeneratorPromptCharmonia.C +++ b/MC/config/PWGDQ/external/generator/GeneratorPromptCharmonia.C @@ -8,6 +8,9 @@ // Jpsi+Psi2S fwdy: o2-sim -j 4 -n 10 -g external -o sgn --configKeyValues "GeneratorExternal.fileName=$O2DPG_ROOT/MC/config/PWGDQ/external/generator/GeneratorPromptCharmonia.C;GeneratorExternal.funcName=GeneratorCocktailPromptCharmoniaToMuonEvtGen_pp13TeV()" // Jpsi fwdy: o2-sim -j 4 -n 10 -g external -o sgn --configKeyValues "GeneratorExternal.fileName=$O2DPG_ROOT/MC/config/PWGDQ/external/generator/GeneratorPromptCharmonia.C;GeneratorExternal.funcName=GeneratorParamPromptJpsiToMuonEvtGen_pp13TeV()" // Psi2S fwdy: o2-sim -j 4 -n 10 -g external -o sgn --configKeyValues "GeneratorExternal.fileName=$O2DPG_ROOT/MC/config/PWGDQ/external/generator/GeneratorPromptCharmonia.C;GeneratorExternal.funcName=GeneratorParamPromptPSiToMuonEvtGen_pp13TeV()" +// ChiC1+ChiC2 midy:o2-sim -j 4 -n 10 -g external -o sgn --configKeyValues "GeneratorExternal.fileName=$O2DPG_ROOT/MC/config/PWGDQ/external/generator/GeneratorPromptCharmonia.C;GeneratorExternal.funcName=GeneratorCocktailChiCToElectronEvtGen_pp13TeV()" +// + // R__ADD_INCLUDE_PATH($O2DPG_ROOT/MC/config/PWGDQ/EvtGen) @@ -312,6 +315,183 @@ class O2_GeneratorParamPsiFwdY : public GeneratorTGenerator }; +class O2_GeneratorParamChiC1 : public GeneratorTGenerator +{ + + public: + O2_GeneratorParamChiC1() : GeneratorTGenerator("ParamChiC1") + { + paramChiC1 = new GeneratorParam(1, -1, PtChiC1pp13TeV, YChiC1pp13TeV, V2ChiC1pp13TeV, IpChiC1pp13TeV); + paramChiC1->SetMomentumRange(0., 1.e6); + paramChiC1->SetPtRange(0., 1000.); + paramChiC1->SetYRange(-1.0, 1.0); + paramChiC1->SetPhiRange(0., 360.); + paramChiC1->SetDecayer(new TPythia6Decayer()); // Pythia + paramChiC1->SetForceDecay(kNoDecay); // particle left undecayed + setTGenerator(paramChiC1); + }; + + ~O2_GeneratorParamChiC1() + { + delete paramChiC1; + }; + + Bool_t Init() override + { + GeneratorTGenerator::Init(); + paramChiC1->Init(); + return true; + } + + void SetNSignalPerEvent(Int_t nsig) { paramChiC1->SetNumberParticles(nsig); } + + //-------------------------------------------------------------------------// + static Double_t PtChiC1pp13TeV(const Double_t* px, const Double_t* /*dummy*/) + { + // prompt J/Psi pT + // pp, 13TeV (tuned on pp 13 TeV, 2016-2018) + // + // ChiC1 R/(1+R12) Jpsi R= Ra+Rb pT(Jpsi), R12 = R12a + R12b pT(Jpsi)+ R12c pT(Jpsi)^2 + // C. Rosenthal, Y. Pachmayer. LHCb chiC/Jpsi and chiC1/chiC2, + // PLB 718 (2012) 431 + // JHEP 10 (2013) 115, PLB 714 (2012) 215 + // Linear function for chiC to Jpsi and quadratic for ChiC2/ChiC1 + + const Double_t Ra = 0.121; + const Double_t Rb = 0.011; + + const Double_t R12a = 1.43953; + const Double_t R12b = -0.145874; + const Double_t R12c = 0.00638469; + + const Double_t kC = 2.28550e+00; + const Double_t kpt0 = 3.73619e+00; + const Double_t kn = 2.81708e+00; + Double_t pt = px[0]; + + Double_t scaleChiC1 = (Ra+ Rb*pt)/(1+R12a+R12b*pt+R12c*pt*pt); + + + return scaleChiC1 * kC * pt / TMath::Power((1. + (pt / kpt0) * (pt / kpt0)), kn); + } + + //-------------------------------------------------------------------------// + static Double_t YChiC1pp13TeV(const Double_t* py, const Double_t* /*dummy*/) + { + // jpsi y in pp at 13 TeV, tuned on data, prompt jpsi ALICE+LHCb, 13 TeV + Double_t y = *py; + Float_t p0, p1, p2; + p0 = 7.79382e+00; + p1 = 2.87827e-06; + p2 = 4.41847e+00; + return p0 * TMath::Exp(-(1. / 2.) * TMath::Power(((y - p1) / p2), 2)); + } + + + //-------------------------------------------------------------------------// + static Double_t V2ChiC1pp13TeV(const Double_t* /*dummy*/, const Double_t* /*dummy*/) + { + // jpsi v2 + return 0.; + } + + //-------------------------------------------------------------------------// + static Int_t IpChiC1pp13TeV(TRandom*) + { + return 20443; + } + + private: + GeneratorParam* paramChiC1 = nullptr; +}; + +class O2_GeneratorParamChiC2 : public GeneratorTGenerator +{ + + public: + O2_GeneratorParamChiC2() : GeneratorTGenerator("ParamChiC2") + { + paramChiC2 = new GeneratorParam(1, -1, PtChiC2pp13TeV, YChiC2pp13TeV, V2ChiC2pp13TeV, IpChiC2pp13TeV); + paramChiC2->SetMomentumRange(0., 1.e6); // Momentum range added from me + paramChiC2->SetPtRange(0., 1000.); // transverse of momentum range + paramChiC2->SetYRange(-1.0, 1.0); // rapidity range + paramChiC2->SetPhiRange(0., 360.); // phi range + paramChiC2->SetDecayer(new TPythia6Decayer()); // Pythia decayer + paramChiC2->SetForceDecay(kNoDecay); // particle left undecayed + setTGenerator(paramChiC2); // Setting parameters to ParamPsi for Psi(2S) + }; + + ~O2_GeneratorParamChiC2() + { + delete paramChiC2; + }; + + Bool_t Init() override + { + GeneratorTGenerator::Init(); + paramChiC2->Init(); + return true; + } + void SetNSignalPerEvent(Int_t nsig) { paramChiC2->SetNumberParticles(nsig); } + + //-------------------------------------------------------------------------// + static Double_t PtChiC2pp13TeV(const Double_t* px, const Double_t* /*dummy*/) + { + + // ChiC2 R/(1+1/R12) Jpsi R= Ra+Rb pT(Jpsi), R12 = R12a + R12b pT(Jpsi)+ R12c pT(Jpsi)^2 + // prompt J/Psi pT + // pp, 13TeV (tuned on pp 13 TeV, 2016-2018) + // + const Double_t Ra = 0.121; + const Double_t Rb = 0.011; + + const Double_t R12a = 1.43953; + const Double_t R12b = -0.145874; + const Double_t R12c = 0.00638469; + + + + + const Double_t kC = 2.28550e+00; + const Double_t kpt0 = 3.73619e+00; + const Double_t kn = 2.81708e+00; + Double_t pt = px[0]; + Double_t scaleChiC2 = (Ra+ Rb*pt)/(1.+1./(R12a+R12b*pt+R12c*pt*pt)); + + + return scaleChiC2 * kC * pt / TMath::Power((1. + (pt / kpt0) * (pt / kpt0)), kn); + } + + + //-------------------------------------------------------------------------// + static Double_t YChiC2pp13TeV(const Double_t* py, const Double_t* /*dummy*/) + { + // jpsi y in pp at 13 TeV, tuned on data, prompt jpsi ALICE+LHCb, 13 TeV + Double_t y = *py; + Float_t p0, p1, p2; + p0 = 7.79382e+00; + p1 = 2.87827e-06; + p2 = 4.41847e+00; + return p0 * TMath::Exp(-(1. / 2.) * TMath::Power(((y - p1) / p2), 2)); + } + + //-------------------------------------------------------------------------// + static Double_t V2ChiC2pp13TeV(const Double_t* /*dummy*/, const Double_t* /*dummy*/) + { + // jpsi v2 + return 0.; + } + + //-------------------------------------------------------------------------// + static Int_t IpChiC2pp13TeV(TRandom*) + { + return 445; + } + + private: + GeneratorParam* paramChiC2 = nullptr; +}; + } // namespace eventgen } // namespace o2 @@ -459,3 +639,39 @@ FairGenerator* return gen; } + + +FairGenerator* + GeneratorCocktailChiCToElectronEvtGen_pp13TeV() +{ + auto genCocktailEvtGen = new o2::eventgen::GeneratorEvtGen(); + + auto genChiC1 = new o2::eventgen::O2_GeneratorParamChiC1; + genChiC1->SetNSignalPerEvent(1); // signal per event for ChiC1 + auto genChiC2 = new o2::eventgen::O2_GeneratorParamChiC2; + genChiC2->SetNSignalPerEvent(1); // signal per event for ChiC2 + genCocktailEvtGen->AddGenerator(genChiC1, 1); // add cocktail --> ChiC1 + genCocktailEvtGen->AddGenerator(genChiC2, 1); // add cocktail --> ChiC2 + + + TString pdgs = "20443;445"; + std::string spdg; + TObjArray* obj = pdgs.Tokenize(";"); + genCocktailEvtGen->SetSizePdg(obj->GetEntriesFast()); + for (int i = 0; i < obj->GetEntriesFast(); i++) { + spdg = obj->At(i)->GetName(); + genCocktailEvtGen->AddPdg(std::stoi(spdg), i); + printf("PDG %d \n", std::stoi(spdg)); + } +// genCocktailEvtGen->SetForceDecay(kEvtDiElectron); + genCocktailEvtGen->SetForceDecay(kEvtChiToJpsiGammaToElectronElectron); + // print debug + genCocktailEvtGen->PrintDebug(); + + return genCocktailEvtGen; +} + + + + + diff --git a/MC/config/PWGDQ/external/generator/generator_pythia8_withInjectedPromptSignals_gaptriggered_dq.C b/MC/config/PWGDQ/external/generator/generator_pythia8_withInjectedPromptSignals_gaptriggered_dq.C index 5901729f4..335dc01ee 100644 --- a/MC/config/PWGDQ/external/generator/generator_pythia8_withInjectedPromptSignals_gaptriggered_dq.C +++ b/MC/config/PWGDQ/external/generator/generator_pythia8_withInjectedPromptSignals_gaptriggered_dq.C @@ -3,7 +3,6 @@ #include "Pythia8/Pythia.h" #include "TRandom.h" #include "GeneratorPromptCharmonia.C" - #include using namespace o2::eventgen; @@ -40,6 +39,10 @@ public: case 5: // generate prompt psi2S at forward rapidity mGeneratorParam = (Generator*)GeneratorParamPromptPsiToMuonEvtGen_pp13TeV("100443"); break; + case 6: // generate prompt ChiC1 + ChiC2 cocktail at midrapidity + mGeneratorParam = (Generator*)GeneratorCocktailChiCToElectronEvtGen_pp13TeV(); + break; + } mGeneratorParam->Init(); } diff --git a/MC/config/PWGDQ/ini/Generator_InjectedChiCToElectronMidy_TriggerGap.ini b/MC/config/PWGDQ/ini/Generator_InjectedChiCToElectronMidy_TriggerGap.ini new file mode 100755 index 000000000..2a713bf6f --- /dev/null +++ b/MC/config/PWGDQ/ini/Generator_InjectedChiCToElectronMidy_TriggerGap.ini @@ -0,0 +1,7 @@ +### The external generator derives from GeneratorPythia8. +[GeneratorExternal] +fileName=${O2DPG_ROOT}/MC/config/PWGDQ/external/generator/generator_pythia8_withInjectedPromptSignals_gaptriggered_dq.C +funcName=GeneratorPythia8InjectedPromptCharmoniaGapTriggered(5,6) + +[GeneratorPythia8] +config=${O2DPG_ROOT}/MC/config/PWGDQ/pythia8/generator/pythia8_inel_triggerGap.cfg diff --git a/MC/config/PWGDQ/ini/tests/Generator_InjectedChiCToElectronMidy_TriggerGap.C b/MC/config/PWGDQ/ini/tests/Generator_InjectedChiCToElectronMidy_TriggerGap.C new file mode 100644 index 000000000..0ca9d149f --- /dev/null +++ b/MC/config/PWGDQ/ini/tests/Generator_InjectedChiCToElectronMidy_TriggerGap.C @@ -0,0 +1,173 @@ +int External() +{ + int checkPdgSignal[] = {20443,445}; + int checkPdgDecay = 11; + int checkPdgDecayOther = 22; + int checkPdgDecayFirst = 443; + std::string path{"o2sim_Kine.root"}; + std::cout << "Check for\nsignal PDG " << checkPdgSignal[0] << " and "<< checkPdgSignal[1] << "\ndecay PDG " << checkPdgDecayOther << " and" << checkPdgDecayFirst << "\n"; + TFile file(path.c_str(), "READ"); + if (file.IsZombie()) { + std::cerr << "Cannot open ROOT file " << path << "\n"; + return 1; + } + + int hasElectron=0; + int hasPositron=0; + + auto tree = (TTree*)file.Get("o2sim"); + std::vector* tracks{}; + tree->SetBranchAddress("MCTrack", &tracks); + + int nPhotons{}; + int nLeptons{}; + int nSignalJpsi{}; + int nAntileptons{}; + int nLeptonPairsChild0{}; + int nLeptonPairsChild0ToBeDone{}; + int nLeptonPairsChild1{}; + int nLeptonPairsChild1ToBeDone{}; + int nGammaJpsiPairs{}; + int nGammaJpsiPairsToBeDone{}; + int nSignalChiC1{}; + int nSignalChiC2{}; + int nSignalChiC1WithinAcc{}; + int nSignalChiC2WithinAcc{}; + auto nEvents = tree->GetEntries(); + o2::steer::MCKinematicsReader mcreader("o2sim", o2::steer::MCKinematicsReader::Mode::kMCKine); + Bool_t isInjected = kFALSE; + + for (int i = 0; i < nEvents; i++) { + tree->GetEntry(i); + for (auto& track : *tracks) { + auto pdg = track.GetPdgCode(); + auto rapidity = track.GetRapidity(); + auto idMoth = track.getMotherTrackId(); + if (pdg == checkPdgDecay) { + // count leptons + nLeptons++; + } else if(pdg == -checkPdgDecay) { + // count anti-leptons + nAntileptons++; + } else if(pdg == checkPdgDecayFirst) { + // count J/psi + nSignalJpsi++; + } else if(pdg == checkPdgDecayOther) { + // count photons + nPhotons++; + } else if (pdg == checkPdgSignal[0] || pdg == checkPdgSignal[1]) { + if(idMoth < 0){ + // count signal PDG + pdg == checkPdgSignal[0] ? nSignalChiC1++ : nSignalChiC2++; + // count signal PDG within acceptance + if(std::abs(rapidity) < 1.0) { pdg == checkPdgSignal[0] ? nSignalChiC1WithinAcc++ : nSignalChiC2WithinAcc++;} + } + auto child0 = o2::mcutils::MCTrackNavigator::getDaughter0(track, *tracks); + auto child1 = o2::mcutils::MCTrackNavigator::getDaughter1(track, *tracks); + if (child0 != nullptr && child1 != nullptr) { + // check for parent-child relations + auto pdg0 = child0->GetPdgCode(); + auto pdg1 = child1->GetPdgCode(); +// std::cout << "First and last children of parent " << checkPdgSignal << " are PDG0: " << pdg0 << " PDG1: " << pdg1 << "\n"; + if ( (std::abs(pdg0) == checkPdgDecayFirst && std::abs(pdg1) == checkPdgDecayOther ) || + (std::abs(pdg0) == checkPdgDecayOther && std::abs(pdg1) == checkPdgDecayFirst ) ) { + nGammaJpsiPairs++; + + + hasElectron=0; + hasPositron=0; + + if (child0->getToBeDone() == 0) { + + auto grandChild0FromChild0 = &(*tracks).at(child0-> getFirstDaughterTrackId()); + auto grandChild1FromChild0 = &(*tracks).at(child0-> getLastDaughterTrackId()); + + for(int ii = child0-> getFirstDaughterTrackId() ; ii< child0-> getLastDaughterTrackId()+1 ;ii++){ + auto grandChildFromChild0 = &(*tracks).at(ii); + if ( grandChildFromChild0->GetPdgCode() == -checkPdgDecay ){ + hasElectron = 1; + auto grandChild0FromChild0 = &(*tracks).at(ii); + } + if ( grandChildFromChild0->GetPdgCode() == checkPdgDecay ){ + hasPositron = 1; + auto grandChild1FromChild0 = &(*tracks).at(ii); + + } + } + if (hasElectron && hasPositron) { + nLeptonPairsChild0++; + if (grandChild0FromChild0->getToBeDone() && grandChild1FromChild0->getToBeDone()) { + nLeptonPairsChild0ToBeDone++; + } + } + } + + hasElectron=0; + hasPositron=0; + + if (child1->getToBeDone() == 0) { + auto grandChild0FromChild1 = &(*tracks).at(child1-> getFirstDaughterTrackId()); + auto grandChild1FromChild1 = &(*tracks).at(child1-> getLastDaughterTrackId()); + + for(int ii = child1-> getFirstDaughterTrackId() ; ii< child1-> getLastDaughterTrackId()+1 ;ii++){ + auto grandChildFromChild1 = &(*tracks).at(ii); + if ( grandChildFromChild1->GetPdgCode() == -checkPdgDecay ){ + hasElectron = 1; + auto grandChild0FromChild1 = &(*tracks).at(ii); + } + if ( grandChildFromChild1->GetPdgCode() == checkPdgDecay ){ + hasPositron = 1; + auto grandChild1FromChild1 = &(*tracks).at(ii); + + } + } + if (hasElectron && hasPositron) { + nLeptonPairsChild1++; + if (grandChild0FromChild1->getToBeDone() && grandChild1FromChild1->getToBeDone()) { + nLeptonPairsChild1ToBeDone++; + } + } + } + } + } + } + } + } + nGammaJpsiPairsToBeDone = nLeptonPairsChild0ToBeDone + nLeptonPairsChild1ToBeDone; + + std::cout << "#events: " << nEvents << "\n" + << "#leptons: " << nLeptons << "\n" + << "#antileptons: " << nAntileptons << "\n" + << "#signal photon " << nPhotons << "\n" + << "#signal (prompt Jpsi): " << nSignalJpsi << "\n" + << "#signal (prompt ChiC1): " << nSignalChiC1 << "; within acceptance (|y| < 1): " << nSignalChiC1WithinAcc << "\n" + << "#signal (prompt ChiC2): " << nSignalChiC2 << "; within acceptance (|y| < 1): " << nSignalChiC2WithinAcc << "\n" + << "#GammaJpsi pairs: " << nGammaJpsiPairs << "\n" + << "#GammaJpsi pairs to be done: " << nGammaJpsiPairsToBeDone << "\n" + << "#lepton pairs to be done from child0: " << nLeptonPairsChild0 << " " << nLeptonPairsChild0ToBeDone << "\n" + << "#lepton pairs to be done from Child 1: " << nLeptonPairsChild1 << " " << nLeptonPairsChild1ToBeDone << "\n"; + + + + if (nGammaJpsiPairs == 0 || nPhotons == 0 || nSignalJpsi == 0) { + std::cerr << "Number of photons, number of J/psi as well as number of Gamma-Jpsi pairs should all be greater than 1.\n"; + return 1; + } + if (nLeptonPairsChild0 != nLeptonPairsChild0ToBeDone){ + std::cerr << "The number of gamma J/psi pairs should be the same as the number of Gamma Jpsi pairs which should be transported.\n"; + return 1; + } + + if (nLeptonPairsChild1 != nLeptonPairsChild1ToBeDone){ + std::cerr << "The number of gamma J/psi pairs should be the same as the number of Gamma Jpsi pairs which should be transported.\n"; + return 1; + } + + + if (nGammaJpsiPairs < nGammaJpsiPairsToBeDone) { + std::cerr << "The number of gamma J/psi pairs should be the same as the number of Gamma Jpsi pairs which should be transported.\n"; + return 1; + } + + return 0; +} diff --git a/MC/config/PWGHF/ini/GeneratorHF_D2H_ccbar_and_bbbar_Mode2_ptHardBins.ini b/MC/config/PWGHF/ini/GeneratorHF_D2H_ccbar_and_bbbar_Mode2_ptHardBins.ini new file mode 100644 index 000000000..5d07dea5c --- /dev/null +++ b/MC/config/PWGHF/ini/GeneratorHF_D2H_ccbar_and_bbbar_Mode2_ptHardBins.ini @@ -0,0 +1,8 @@ +### The external generator derives from GeneratorPythia8. +[GeneratorExternal] +fileName=${O2DPG_ROOT}/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C +funcName=GeneratorPythia8GapTriggeredCharmAndBeauty(1, -1.5, 1.5) + +[GeneratorPythia8] +config=${O2DPG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays_Mode2_ptHardBins.cfg +includePartonEvent=true diff --git a/MC/config/PWGHF/ini/GeneratorHF_D2H_ccbar_and_bbbar_gap3_Mode2.ini b/MC/config/PWGHF/ini/GeneratorHF_D2H_ccbar_and_bbbar_gap3_Mode2.ini new file mode 100755 index 000000000..1a9c4bb19 --- /dev/null +++ b/MC/config/PWGHF/ini/GeneratorHF_D2H_ccbar_and_bbbar_gap3_Mode2.ini @@ -0,0 +1,8 @@ +### The external generator derives from GeneratorPythia8. +[GeneratorExternal] +fileName=${O2DPG_ROOT}/MC/config/PWGHF/external/generator/generator_pythia8_gaptriggered_hf.C +funcName=GeneratorPythia8GapTriggeredCharmAndBeauty(3, -1.5, 1.5) + +[GeneratorPythia8] +config=${O2DPG_ROOT}/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays_Mode2.cfg +includePartonEvent=true diff --git a/MC/config/PWGHF/ini/tests/GeneratorHF_D2H_ccbar_and_bbbar_Mode2_ptHardBins.C b/MC/config/PWGHF/ini/tests/GeneratorHF_D2H_ccbar_and_bbbar_Mode2_ptHardBins.C new file mode 100644 index 000000000..a119e684a --- /dev/null +++ b/MC/config/PWGHF/ini/tests/GeneratorHF_D2H_ccbar_and_bbbar_Mode2_ptHardBins.C @@ -0,0 +1,138 @@ +int External() { + std::string path{"o2sim_Kine.root"}; + + int checkPdgQuarkOne{4}; + int checkPdgQuarkTwo{5}; + float ratioTrigger = 1.; // each event triggered + float averagePt = 0.; + + std::vector checkPdgHadron{411, 421, 431, 4122, 4132, 4232, 4332}; + std::map>> checkHadronDecays{ // sorted pdg of daughters + {411, {{-321, 211, 211}, {-313, 211}, {211, 311}, {211, 333}}}, // D+ + {421, {{-321, 211}, {-321, 111, 211}}}, // D0 + {431, {{211, 333}, {-313, 321}}}, // Ds+ + {4122, {{-313, 2212}, {-321, 2224}, {211, 3124}, {-321, 211, 2212}, {311, 2212}}}, // Lc+ + {4132, {{211, 3312}}}, // Xic0 + {4232, {{-313, 2212}, {-321, 3324}, {211, 211, 3312}, {-321, 211, 2212}}}, // Xic+ + {4332, {{211, 3334}}} // Omegac+ + }; + + TFile file(path.c_str(), "READ"); + if (file.IsZombie()) { + std::cerr << "Cannot open ROOT file " << path << "\n"; + return 1; + } + + auto tree = (TTree *)file.Get("o2sim"); + std::vector *tracks{}; + tree->SetBranchAddress("MCTrack", &tracks); + o2::dataformats::MCEventHeader *eventHeader = nullptr; + tree->SetBranchAddress("MCEventHeader.", &eventHeader); + + int nEventsMB{}, nEventsInjOne{}, nEventsInjTwo{}; + int nQuarksOne{}, nQuarksTwo{}, nSignals{}, nSignalGoodDecay{}; + auto nEvents = tree->GetEntries(); + + for (int i = 0; i < nEvents; i++) { + tree->GetEntry(i); + + // check subgenerator information + if (eventHeader->hasInfo(o2::mcgenid::GeneratorProperty::SUBGENERATORID)) { + bool isValid = false; + int subGeneratorId = eventHeader->getInfo(o2::mcgenid::GeneratorProperty::SUBGENERATORID, isValid); + if (subGeneratorId == 0) { + nEventsMB++; + } else if (subGeneratorId == checkPdgQuarkOne) { + nEventsInjOne++; + } else if (subGeneratorId == checkPdgQuarkTwo) { + nEventsInjTwo++; + } + } + + for (auto &track : *tracks) { + auto pdg = track.GetPdgCode(); + if (std::abs(pdg) == checkPdgQuarkOne) { + nQuarksOne++; + continue; + } + if (std::abs(pdg) == checkPdgQuarkTwo) { + nQuarksTwo++; + continue; + } + if (std::find(checkPdgHadron.begin(), checkPdgHadron.end(), std::abs(pdg)) != checkPdgHadron.end()) { // found signal + nSignals++; // count signal PDG + averagePt += track.GetPt(); + + std::vector pdgsDecay{}; + std::vector pdgsDecayAntiPart{}; + for (int j{track.getFirstDaughterTrackId()}; j <= track.getLastDaughterTrackId(); ++j) { + auto pdgDau = tracks->at(j).GetPdgCode(); + pdgsDecay.push_back(pdgDau); + if (pdgDau != 333) { // phi is antiparticle of itself + pdgsDecayAntiPart.push_back(-pdgDau); + } else { + pdgsDecayAntiPart.push_back(pdgDau); + } + } + + std::sort(pdgsDecay.begin(), pdgsDecay.end()); + std::sort(pdgsDecayAntiPart.begin(), pdgsDecayAntiPart.end()); + + for (auto &decay : checkHadronDecays[std::abs(pdg)]) { + if (pdgsDecay == decay || pdgsDecayAntiPart == decay) { + nSignalGoodDecay++; + break; + } + } + } + } + } + + averagePt /= nSignals; + + std::cout << "--------------------------------\n"; + std::cout << "# Events: " << nEvents << "\n"; + std::cout << "# MB events: " << nEventsMB << "\n"; + std::cout << Form("# events injected with %d quark pair: ", checkPdgQuarkOne) << nEventsInjOne << "\n"; + std::cout << Form("# events injected with %d quark pair: ", checkPdgQuarkTwo) << nEventsInjTwo << "\n"; + std::cout << Form("# %d (anti)quarks: ", checkPdgQuarkOne) << nQuarksOne << "\n"; + std::cout << Form("# %d (anti)quarks: ", checkPdgQuarkTwo) << nQuarksTwo << "\n"; + std::cout <<"# signal hadrons: " << nSignals << "\n"; + std::cout <<"# signal hadrons decaying in the correct channel: " << nSignalGoodDecay << "\n"; + std::cout <<"average pT of signal hadrons: " << averagePt << "\n"; + + if (nEventsMB < nEvents * (1 - ratioTrigger) * 0.95 || nEventsMB > nEvents * (1 - ratioTrigger) * 1.05) { // we put some tolerance since the number of generated events is small + std::cerr << "Number of generated MB events different than expected\n"; + return 1; + } + if (nEventsInjOne < nEvents * ratioTrigger * 0.5 * 0.95 || nEventsInjOne > nEvents * ratioTrigger * 0.5 * 1.05) { + std::cerr << "Number of generated events injected with " << checkPdgQuarkOne << " different than expected\n"; + return 1; + } + if (nEventsInjTwo < nEvents * ratioTrigger * 0.5 * 0.95 || nEventsInjTwo > nEvents * ratioTrigger * 0.5 * 1.05) { + std::cerr << "Number of generated events injected with " << checkPdgQuarkTwo << " different than expected\n"; + return 1; + } + + if (nQuarksOne < nEvents * ratioTrigger) { // we expect anyway more because the same quark is repeated several time, after each gluon radiation + std::cerr << "Number of generated (anti)quarks " << checkPdgQuarkOne << " lower than expected\n"; + return 1; + } + if (nQuarksTwo < nEvents * ratioTrigger) { // we expect anyway more because the same quark is repeated several time, after each gluon radiation + std::cerr << "Number of generated (anti)quarks " << checkPdgQuarkTwo << " lower than expected\n"; + return 1; + } + + float fracForcedDecays = float(nSignalGoodDecay) / nSignals; + if (fracForcedDecays < 0.9) { // we put some tolerance (e.g. due to oscillations which might change the final state) + std::cerr << "Fraction of signals decaying into the correct channel " << fracForcedDecays << " lower than expected\n"; + return 1; + } + + if (averagePt < 8.) { // by testing locally it should be around 8.5 GeV/c with pthard bin 20-200 (contrary to 2-2.5 GeV/c of SoftQCD) + std::cerr << "Average pT of charmed hadrons " << averagePt << " lower than expected\n"; + return 1; + } + + return 0; +} diff --git a/MC/config/PWGHF/ini/tests/GeneratorHF_D2H_ccbar_and_bbbar_gap3_Mode2.C b/MC/config/PWGHF/ini/tests/GeneratorHF_D2H_ccbar_and_bbbar_gap3_Mode2.C new file mode 100644 index 000000000..79321e058 --- /dev/null +++ b/MC/config/PWGHF/ini/tests/GeneratorHF_D2H_ccbar_and_bbbar_gap3_Mode2.C @@ -0,0 +1,128 @@ +int External() { + std::string path{"o2sim_Kine.root"}; + + int checkPdgQuarkOne{4}; + int checkPdgQuarkTwo{5}; + float ratioTrigger = 1./3; // one event triggered out of 3 + + std::vector checkPdgHadron{411, 421, 431, 4122, 4132, 4232, 4332}; + std::map>> checkHadronDecays{ // sorted pdg of daughters + {411, {{-321, 211, 211}, {-313, 211}, {211, 311}, {211, 333}}}, // D+ + {421, {{-321, 211}, {-321, 111, 211}}}, // D0 + {431, {{211, 333}, {-313, 321}}}, // Ds+ + {4122, {{-313, 2212}, {-321, 2224}, {211, 3124}, {-321, 211, 2212}, {311, 2212}}}, // Lc+ + {4132, {{211, 3312}}}, // Xic0 + {4232, {{-313, 2212}, {-321, 3324}, {211, 211, 3312}, {-321, 211, 2212}}}, // Xic+ + {4332, {{211, 3334}}} // Omegac+ + }; + + TFile file(path.c_str(), "READ"); + if (file.IsZombie()) { + std::cerr << "Cannot open ROOT file " << path << "\n"; + return 1; + } + + auto tree = (TTree *)file.Get("o2sim"); + std::vector *tracks{}; + tree->SetBranchAddress("MCTrack", &tracks); + o2::dataformats::MCEventHeader *eventHeader = nullptr; + tree->SetBranchAddress("MCEventHeader.", &eventHeader); + + int nEventsMB{}, nEventsInjOne{}, nEventsInjTwo{}; + int nQuarksOne{}, nQuarksTwo{}, nSignals{}, nSignalGoodDecay{}; + auto nEvents = tree->GetEntries(); + + for (int i = 0; i < nEvents; i++) { + tree->GetEntry(i); + + // check subgenerator information + if (eventHeader->hasInfo(o2::mcgenid::GeneratorProperty::SUBGENERATORID)) { + bool isValid = false; + int subGeneratorId = eventHeader->getInfo(o2::mcgenid::GeneratorProperty::SUBGENERATORID, isValid); + if (subGeneratorId == 0) { + nEventsMB++; + } else if (subGeneratorId == checkPdgQuarkOne) { + nEventsInjOne++; + } else if (subGeneratorId == checkPdgQuarkTwo) { + nEventsInjTwo++; + } + } + + for (auto &track : *tracks) { + auto pdg = track.GetPdgCode(); + if (std::abs(pdg) == checkPdgQuarkOne) { + nQuarksOne++; + continue; + } + if (std::abs(pdg) == checkPdgQuarkTwo) { + nQuarksTwo++; + continue; + } + if (std::find(checkPdgHadron.begin(), checkPdgHadron.end(), std::abs(pdg)) != checkPdgHadron.end()) { // found signal + nSignals++; // count signal PDG + + std::vector pdgsDecay{}; + std::vector pdgsDecayAntiPart{}; + for (int j{track.getFirstDaughterTrackId()}; j <= track.getLastDaughterTrackId(); ++j) { + auto pdgDau = tracks->at(j).GetPdgCode(); + pdgsDecay.push_back(pdgDau); + if (pdgDau != 333) { // phi is antiparticle of itself + pdgsDecayAntiPart.push_back(-pdgDau); + } else { + pdgsDecayAntiPart.push_back(pdgDau); + } + } + + std::sort(pdgsDecay.begin(), pdgsDecay.end()); + std::sort(pdgsDecayAntiPart.begin(), pdgsDecayAntiPart.end()); + + for (auto &decay : checkHadronDecays[std::abs(pdg)]) { + if (pdgsDecay == decay || pdgsDecayAntiPart == decay) { + nSignalGoodDecay++; + break; + } + } + } + } + } + + std::cout << "--------------------------------\n"; + std::cout << "# Events: " << nEvents << "\n"; + std::cout << "# MB events: " << nEventsMB << "\n"; + std::cout << Form("# events injected with %d quark pair: ", checkPdgQuarkOne) << nEventsInjOne << "\n"; + std::cout << Form("# events injected with %d quark pair: ", checkPdgQuarkTwo) << nEventsInjTwo << "\n"; + std::cout << Form("# %d (anti)quarks: ", checkPdgQuarkOne) << nQuarksOne << "\n"; + std::cout << Form("# %d (anti)quarks: ", checkPdgQuarkTwo) << nQuarksTwo << "\n"; + std::cout <<"# signal hadrons: " << nSignals << "\n"; + std::cout <<"# signal hadrons decaying in the correct channel: " << nSignalGoodDecay << "\n"; + + if (nEventsMB < nEvents * (1 - ratioTrigger) * 0.95 || nEventsMB > nEvents * (1 - ratioTrigger) * 1.05) { // we put some tolerance since the number of generated events is small + std::cerr << "Number of generated MB events different than expected\n"; + return 1; + } + if (nEventsInjOne < nEvents * ratioTrigger * 0.5 * 0.95 || nEventsInjOne > nEvents * ratioTrigger * 0.5 * 1.05) { + std::cerr << "Number of generated events injected with " << checkPdgQuarkOne << " different than expected\n"; + return 1; + } + if (nEventsInjTwo < nEvents * ratioTrigger * 0.5 * 0.95 || nEventsInjTwo > nEvents * ratioTrigger * 0.5 * 1.05) { + std::cerr << "Number of generated events injected with " << checkPdgQuarkTwo << " different than expected\n"; + return 1; + } + + if (nQuarksOne < nEvents * ratioTrigger) { // we expect anyway more because the same quark is repeated several time, after each gluon radiation + std::cerr << "Number of generated (anti)quarks " << checkPdgQuarkOne << " lower than expected\n"; + return 1; + } + if (nQuarksTwo < nEvents * ratioTrigger) { // we expect anyway more because the same quark is repeated several time, after each gluon radiation + std::cerr << "Number of generated (anti)quarks " << checkPdgQuarkTwo << " lower than expected\n"; + return 1; + } + + float fracForcedDecays = float(nSignalGoodDecay) / nSignals; + if (fracForcedDecays < 0.9) { // we put some tolerance (e.g. due to oscillations which might change the final state) + std::cerr << "Fraction of signals decaying into the correct channel " << fracForcedDecays << " lower than expected\n"; + return 1; + } + + return 0; +} diff --git a/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays.cfg b/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays.cfg index 472204cbf..cc26a7c9d 100644 --- a/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays.cfg +++ b/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays.cfg @@ -28,7 +28,7 @@ ParticleDecays:tau0Max 10. 411:oneChannel = 1 0.0752 0 -321 211 211 411:addChannel = 1 0.0104 0 -313 211 411:addChannel = 1 0.0156 0 311 211 -411:addChannel = 1 0.00276 0 333 211 +411:addChannel = 1 0.0752 0 333 211 # to have the same amount of D+->KKpi and D+->Kpipi ## add Lc decays absent in PYTHIA8 decay table and set BRs from PDG for other 4122:oneChannel = 1 0.0196 100 2212 -313 4122:addChannel = 1 0.0108 100 2224 -321 diff --git a/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays_Mode2.cfg b/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays_Mode2.cfg index 885531e5b..13bd3ebdf 100644 --- a/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays_Mode2.cfg +++ b/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays_Mode2.cfg @@ -46,7 +46,7 @@ BeamRemnants:saturation 5 411:oneChannel = 1 0.0752 0 -321 211 211 411:addChannel = 1 0.0104 0 -313 211 411:addChannel = 1 0.0156 0 311 211 -411:addChannel = 1 0.00276 0 333 211 +411:addChannel = 1 0.0752 0 333 211 # to have the same amount of D+->KKpi and D+->Kpipi ## add Lc decays absent in PYTHIA8 decay table and set BRs from PDG for other 4122:oneChannel = 1 0.0196 100 2212 -313 4122:addChannel = 1 0.0108 100 2224 -321 diff --git a/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays_Mode2_ptHardBins.cfg b/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays_Mode2_ptHardBins.cfg new file mode 100644 index 000000000..578b5383f --- /dev/null +++ b/MC/config/PWGHF/pythia8/generator/pythia8_charmhadronic_with_decays_Mode2_ptHardBins.cfg @@ -0,0 +1,153 @@ +### authors: Fabrizio Grosa (fabrizio.grosa@cern.ch) +### Cristina Terrevoli (cristina.terrevoli@cern.ch) +### Fabio Catalano (fabio.catalano@cern.ch) +### last update: March 2024 + +### beams +Beams:idA 2212 # proton +Beams:idB 2212 # proton +Beams:eCM 13600. # GeV + +### processes: c-cbar and b-bbar processes +HardQCD:hardccbar on +HardQCD:hardbbbar on +HardQCD:gg2ccbar on +HardQCD:qqbar2ccbar on +HardQCD:gg2bbbar on +HardQCD:qqbar2bbbar on + +### decays +ParticleDecays:limitTau0 on +ParticleDecays:tau0Max 10. + +### switching on Pythia Mode2 +ColourReconnection:mode 1 +ColourReconnection:allowDoubleJunRem off +ColourReconnection:m0 0.3 +ColourReconnection:allowJunctions on +ColourReconnection:junctionCorrection 1.20 +ColourReconnection:timeDilationMode 2 +ColourReconnection:timeDilationPar 0.18 +StringPT:sigma 0.335 +StringZ:aLund 0.36 +StringZ:bLund 0.56 +StringFlav:probQQtoQ 0.078 +StringFlav:ProbStoUD 0.2 +StringFlav:probQQ1toQQ0join 0.0275,0.0275,0.0275,0.0275 +MultiPartonInteractions:pT0Ref 2.15 +BeamRemnants:remnantMode 1 +BeamRemnants:saturation 5 + +### pT-hard bins +PhaseSpace:pTHatMin = 20 +PhaseSpace:pTHatMax = 200 + +# Correct decay lengths (wrong in PYTHIA8 decay table) +# Lb +5122:tau0 = 0.4390 +# Xic0 +4132:tau0 = 0.0455 +# OmegaC +4332:tau0 = 0.0803 + +### Force golden charm hadrons decay modes for D2H studies +### add D+ decays absent in PYTHIA8 decay table and set BRs from PDG for other +411:oneChannel = 1 0.0752 0 -321 211 211 +411:addChannel = 1 0.0104 0 -313 211 +411:addChannel = 1 0.0156 0 311 211 +411:addChannel = 1 0.0752 0 333 211 # to have the same amount of D+->KKpi and D+->Kpipi +## add Lc decays absent in PYTHIA8 decay table and set BRs from PDG for other +4122:oneChannel = 1 0.0196 100 2212 -313 +4122:addChannel = 1 0.0108 100 2224 -321 +4122:addChannel = 1 0.022 100 3124 211 +4122:addChannel = 1 0.035 0 2212 -321 211 +4122:addChannel = 1 0.0159 0 2212 311 +### add Xic+ decays absent in PYTHIA8 decay table +4232:addChannel = 1 0.2 0 2212 -313 +4232:addChannel = 1 0.2 0 2212 -321 211 +4232:addChannel = 1 0.2 0 3324 211 +4232:addChannel = 1 0.2 0 3312 211 211 +### add Xic0 decays absent in PYTHIA8 decay table +4132:addChannel = 1 0.0143 0 3312 211 +### add OmegaC decays absent in PYTHIA8 decay table +4332:addChannel = 1 0.5 0 3334 211 +4332:addChannel = 1 0.5 0 3312 211 + +### K* -> K pi +313:onMode = off +313:onIfAll = 321 211 +### for Ds -> Phi pi+ +333:onMode = off +333:onIfAll = 321 321 +### for D0 -> rho0 pi+ k- +113:onMode = off +113:onIfAll = 211 211 +### for Lambda_c -> Delta++ K- +2224:onMode = off +2224:onIfAll = 2212 211 +### for Lambda_c -> Lambda(1520) K- +102134:onMode = off +102134:onIfAll = 2212 321 +### for Xic0 -> pi Xi -> pi pi Lambda -> pi pi pi p +### and Omega_c -> pi Xi -> pi pi Lambda -> pi pi pi p +3312:onMode = off +3312:onIfAll = 3122 -211 +3122:onMode = off +3122:onIfAll = 2212 -211 +### for Omega_c -> pi Omega -> pi K Lambda -> pi K pi p +3334:onMode = off +3334:onIfAll = 3122 -321 + +### switch off all decay channels +411:onMode = off +421:onMode = off +431:onMode = off +4112:onMode = off +4122:onMode = off +4232:onMode = off +4132:onMode = off +443:onMode = off +4332:onMode = off + +### D0 -> K pi +421:onIfMatch = 321 211 + +### D+/- -> K pi pi +411:onIfMatch = 321 211 211 +### D+/- -> K* pi +411:onIfMatch = 313 211 +### D+/- -> phi pi +411:onIfMatch = 333 211 + +### D_s -> K K* +431:onIfMatch = 321 313 +### D_s -> Phi pi +431:onIfMatch = 333 211 + +### Lambda_c -> p K* +4122:onIfMatch = 2212 313 +### Lambda_c -> Delta K +4122:onIfMatch = 2224 321 +### Lambda_c -> Lambda(1520) pi +4122:onIfMatch = 3124 211 +### Lambda_c -> p K pi +4122:onIfMatch = 2212 321 211 +### Lambda_c -> pK0s +4122:onIfMatch = 2212 311 + +### Xic+ -> pK*0 +4232:onIfMatch = 2212 313 +### Xic+ -> p K- pi+ +4232:onIfMatch = 2212 321 211 +### Xic+ -> Xi*0 pi+, Xi*->Xi- pi+ +4232:onIfMatch = 3324 211 +### Xic+ -> Xi- pi+ pi+ +4232:onIfMatch = 3312 211 211 + +### Xic0 -> Xi- pi+ +4132:onIfMatch = 3312 211 + +### Omega_c -> Omega pi +4332:onIfMatch = 3334 211 +### Omega_c -> Xi pi +4332:onIfMatch = 3312 211 diff --git a/MC/config/PWGLF/ini/GeneratorLF_ExoticResonances_pp1360.ini b/MC/config/PWGLF/ini/GeneratorLF_ExoticResonances_pp1360.ini new file mode 100644 index 000000000..c610bc3ef --- /dev/null +++ b/MC/config/PWGLF/ini/GeneratorLF_ExoticResonances_pp1360.ini @@ -0,0 +1,10 @@ +[GeneratorExternal] +fileName=${O2DPG_ROOT}/MC/config/PWGLF/pythia8/generator_pythia8_LF.C +funcName=generateLF("${O2DPG_ROOT}/MC/config/PWGLF/pythia8/generator/exoticresonancegun.json", true, 4) + +# [GeneratorPythia8] # if triggered then this will be used as the background event +# config=${O2DPG_ROOT}/MC/config/PWGLF/pythia8/generator/pythia8_inel_136tev.cfg + +[DecayerPythia8] # after for transport code! +config[0]=${O2DPG_ROOT}/MC/config/common/pythia8/decayer/base.cfg +config[1]=${O2DPG_ROOT}/MC/config/PWGLF/pythia8/generator/resonances.cfg \ No newline at end of file diff --git a/MC/config/PWGLF/ini/tests/GeneratorLF_ExoticResonances_pp1360.C b/MC/config/PWGLF/ini/tests/GeneratorLF_ExoticResonances_pp1360.C new file mode 100644 index 000000000..c0a789557 --- /dev/null +++ b/MC/config/PWGLF/ini/tests/GeneratorLF_ExoticResonances_pp1360.C @@ -0,0 +1,144 @@ +int External() +{ + std::string path{"o2sim_Kine.root"}; + int numberOfInjectedSignalsPerEvent{1}; + int numberOfGapEvents{4}; + int numberOfEventsProcessed{0}; + int numberOfEventsProcessedWithoutInjection{0}; + std::vector injectedPDGs = { + 20223, // f_1(1285) + 20333, // f_1(1420) + 9030221, // f_0(1500) + 10331, // f_0(1710) + 335, // f_2(1525) + 10221 // f_0(1370) + }; + std::vector> decayDaughters = { + {310, -321, 211}, // f_1(1285) + {310, -321, 211}, // f_1(1420) + {310, 310}, // f_0(1500) + {310, 310}, // f_0(1710) + {310, 310}, // f_2(1525) + {310, 310} // f_0(1370) + }; + + auto nInjection = injectedPDGs.size(); + + TFile file(path.c_str(), "READ"); + if (file.IsZombie()) + { + std::cerr << "Cannot open ROOT file " << path << "\n"; + return 1; + } + + auto tree = (TTree *)file.Get("o2sim"); + if (!tree) + { + std::cerr << "Cannot find tree o2sim in file " << path << "\n"; + return 1; + } + std::vector *tracks{}; + tree->SetBranchAddress("MCTrack", &tracks); + + std::vector nSignal; + for (int i = 0; i < nInjection; i++) + { + nSignal.push_back(0); + } + std::vector> nDecays; + std::vector nNotDecayed; + for (int i = 0; i < nInjection; i++) + { + std::vector nDecay; + for (int j = 0; j < decayDaughters[i].size(); j++) + { + nDecay.push_back(0); + } + nDecays.push_back(nDecay); + nNotDecayed.push_back(0); + } + auto nEvents = tree->GetEntries(); + bool hasInjection = false; + for (int i = 0; i < nEvents; i++) + { + hasInjection = false; + numberOfEventsProcessed++; + auto check = tree->GetEntry(i); + for (int idxMCTrack = 0; idxMCTrack < tracks->size(); ++idxMCTrack) + { + auto track = tracks->at(idxMCTrack); + auto pdg = track.GetPdgCode(); + auto it = std::find(injectedPDGs.begin(), injectedPDGs.end(), pdg); + int index = std::distance(injectedPDGs.begin(), it); // index of injected PDG + if (it != injectedPDGs.end()) // found + { + // count signal PDG + nSignal[index]++; + if(track.getFirstDaughterTrackId() < 0) + { + nNotDecayed[index]++; + continue; + } + for (int j{track.getFirstDaughterTrackId()}; j <= track.getLastDaughterTrackId(); ++j) + { + auto pdgDau = tracks->at(j).GetPdgCode(); + bool foundDau= false; + // count decay PDGs + for (int idxDaughter = 0; idxDaughter < decayDaughters[index].size(); ++idxDaughter) + { + if (pdgDau == decayDaughters[index][idxDaughter]) + { + nDecays[index][idxDaughter]++; + foundDau= true; + hasInjection = true; + break; + } + } + if (!foundDau) { + std::cerr << "Decay daughter not found: " << pdg << " -> " << pdgDau << "\n"; + } + } + } + } + if (!hasInjection) + { + numberOfEventsProcessedWithoutInjection++; + } + } + std::cout << "--------------------------------\n"; + std::cout << "# Events: " << nEvents << "\n"; + for (int i = 0; i < nInjection; i++) + { + std::cout << "# Mother \n"; + std::cout << injectedPDGs[i] << " generated: " << nSignal[i] << ", " << nNotDecayed[i] << " did not decay\n"; + if (nSignal[i] == 0){ + std::cerr << "No generated: " << injectedPDGs[i] << "\n"; + // return 1; // At least one of the injected particles should be generated + } + for (int j = 0; j < decayDaughters[i].size(); j++) + { + std::cout << "# Daughter " << decayDaughters[i][j] << ": " << nDecays[i][j] << "\n"; + } + // if (nSignal[i] != nEvents * numberOfInjectedSignalsPerEvent) + // { + // std::cerr << "Number of generated: " << injectedPDGs[i] << ", lower than expected\n"; + // // return 1; // Don't need to return 1, since the number of generated particles is not the same for each event + // } + } + std::cout << "--------------------------------\n"; + std::cout << "Number of events processed: " << numberOfEventsProcessed << "\n"; + std::cout << "Number of input for the gap events: " << numberOfGapEvents << "\n"; + std::cout << "Number of events processed without injection: " << numberOfEventsProcessedWithoutInjection << "\n"; + // injected event + numberOfGapEvents*gap events + injected event + numberOfGapEvents*gap events + ... + // total fraction of the gap event: numberOfEventsProcessedWithoutInjection/numberOfEventsProcessed + float ratioOfNormalEvents = numberOfEventsProcessedWithoutInjection/numberOfEventsProcessed; + if (ratioOfNormalEvents > 0.75) + { + std::cout << "The number of injected event is loo low!!" << std::endl; + return 1; + } + + return 0; +} + +void GeneratorLF_ExoticResonances_pp1360() { External(); } diff --git a/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp1360.C b/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp1360.C index 121db3d0b..facf80ba5 100644 --- a/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp1360.C +++ b/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp1360.C @@ -25,15 +25,12 @@ int External() 2224, // Delta(1232)+ -2224, // Delta(1232)bar- 2114, // Delta(1232)0 - -2114 // Delta(1232)0bar + -2114, // Delta(1232)0bar + 123314, // Xi(1820)- + -123314, // Xi(1820)+ + 123324, // Xi(1820)0 + -123324 // Xi(1820)0bar }; - // TODO: add decay daughters - // 9030221, // f_0(1500) - // 10331, // f_0(1710) - // 123314, // Xi(1820)- - // -123314, // Xi(1820)+ - // 123324, // Xi(1820)0 - // -123324 // Xi(1820)0bar std::vector> decayDaughters = { {311, 211}, // K*+- {-311, -211}, // K*bar+- @@ -54,15 +51,12 @@ int External() {2212, 211}, // Delta(1232)+ {-2212, -211}, // Delta(1232)bar- {2212, -211}, // Delta(1232)- - {-2212, 211} // Delta(1232)bar+ + {-2212, 211}, // Delta(1232)bar+ + {3122, -311}, // Xi(1820)- + {3122, 311}, // Xi(1820)+ + {3122, 310}, // Xi(1820)0 + {-3122, 310} // Xi(1820)0bar }; - // TODO: add decay daughters - // {211, 211}, // f_0(1500) - // {211, 211}, // f_0(1710) - // {211, 211, 111}, // Xi(1820)- - // {-211, -211, -111}, // Xi(1820)+ - // {211, 211, 111}, // Xi(1820)0 - // {-211, -211, -111} // Xi(1820)0bar auto nInjection = injectedPDGs.size(); diff --git a/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp900.C b/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp900.C index 64463dcbe..a7864016f 100644 --- a/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp900.C +++ b/MC/config/PWGLF/ini/tests/GeneratorLF_Resonances_pp900.C @@ -25,15 +25,12 @@ int External() 2224, // Delta(1232)+ -2224, // Delta(1232)bar- 2114, // Delta(1232)0 - -2114 // Delta(1232)0bar + -2114, // Delta(1232)0bar + 123314, // Xi(1820)- + -123314, // Xi(1820)+ + 123324, // Xi(1820)0 + -123324 // Xi(1820)0bar }; - // TODO: add decay daughters - // 9030221, // f_0(1500) - // 10331, // f_0(1710) - // 123314, // Xi(1820)- - // -123314, // Xi(1820)+ - // 123324, // Xi(1820)0 - // -123324 // Xi(1820)0bar std::vector> decayDaughters = { {311, 211}, // K*+- {-311, -211}, // K*bar+- @@ -54,15 +51,12 @@ int External() {2212, 211}, // Delta(1232)+ {-2212, -211}, // Delta(1232)bar- {2212, -211}, // Delta(1232)- - {-2212, 211} // Delta(1232)bar+ + {-2212, 211}, // Delta(1232)bar+ + {3122, -311}, // Xi(1820)- + {3122, 311}, // Xi(1820)+ + {3122, 310}, // Xi(1820)0 + {-3122, 310} // Xi(1820)0bar }; - // TODO: add decay daughters - // {211, 211}, // f_0(1500) - // {211, 211}, // f_0(1710) - // {211, 211, 111}, // Xi(1820)- - // {-211, -211, -111}, // Xi(1820)+ - // {211, 211, 111}, // Xi(1820)0 - // {-211, -211, -111} // Xi(1820)0bar auto nInjection = injectedPDGs.size(); diff --git a/MC/config/PWGLF/pythia8/generator/exoticresonancegun.json b/MC/config/PWGLF/pythia8/generator/exoticresonancegun.json new file mode 100644 index 000000000..a2d964c1a --- /dev/null +++ b/MC/config/PWGLF/pythia8/generator/exoticresonancegun.json @@ -0,0 +1,56 @@ +{ + "f_1(1285)" : { + "pdg": 20223, + "n": 1, + "ptMin": 0.0, + "ptMax": 20, + "etaMin": -1.2, + "etaMax": 1.2, + "genDecayed": true + }, + "f_1(1420)" : { + "pdg": 20333, + "n": 1, + "ptMin": 0.0, + "ptMax": 20, + "etaMin": -1.2, + "etaMax": 1.2, + "genDecayed": true + }, + "f_0(1500)" : { + "pdg": 9030221, + "n": 1, + "ptMin": 0.0, + "ptMax": 20, + "etaMin": -1.2, + "etaMax": 1.2, + "genDecayed": true + }, + "f_0(1710)" : { + "pdg": 10331, + "n": 1, + "ptMin": 0.0, + "ptMax": 20, + "etaMin": -1.2, + "etaMax": 1.2, + "genDecayed": true + }, + "f_2(1525)" : { + "pdg": 335, + "n": 1, + "ptMin": 0.0, + "ptMax": 20, + "etaMin": -1.2, + "etaMax": 1.2, + "genDecayed": true + }, + "f_0(1370)" : { + "pdg": 10221, + "n": 1, + "ptMin": 0.0, + "ptMax": 20, + "etaMin": -1.2, + "etaMax": 1.2, + "genDecayed": true + } +} diff --git a/MC/config/PWGLF/pythia8/generator/resonancelistgun.json b/MC/config/PWGLF/pythia8/generator/resonancelistgun.json index 2d2ae56ef..b8c248b16 100644 --- a/MC/config/PWGLF/pythia8/generator/resonancelistgun.json +++ b/MC/config/PWGLF/pythia8/generator/resonancelistgun.json @@ -178,5 +178,41 @@ "etaMin": -1.2, "etaMax": 1.2, "genDecayed": true + }, + "Xi(1820)0" : { + "pdg": 123314, + "n": 1, + "ptMin": 0.0, + "ptMax": 20, + "etaMin": -1.2, + "etaMax": 1.2, + "genDecayed": true + }, + "Anti-Xi(1820)0" : { + "pdg": -123314, + "n": 1, + "ptMin": 0.0, + "ptMax": 20, + "etaMin": -1.2, + "etaMax": 1.2, + "genDecayed": true + }, + "Xi(1820)-" : { + "pdg": 123324, + "n": 1, + "ptMin": 0.0, + "ptMax": 20, + "etaMin": -1.2, + "etaMax": 1.2, + "genDecayed": true + }, + "Xi(1820)+" : { + "pdg": -123324, + "n": 1, + "ptMin": 0.0, + "ptMax": 20, + "etaMin": -1.2, + "etaMax": 1.2, + "genDecayed": true } } diff --git a/MC/config/PWGLF/pythia8/generator/resonances.cfg b/MC/config/PWGLF/pythia8/generator/resonances.cfg index 7153511c8..628ba85e2 100644 --- a/MC/config/PWGLF/pythia8/generator/resonances.cfg +++ b/MC/config/PWGLF/pythia8/generator/resonances.cfg @@ -2,21 +2,18 @@ ProcessLevel:all = off # will not look for the 'process' # id::all = name antiName spinType chargeType colType m0 mWidth mMin mMax tau0 -102134:all = Lambda1520 Lambda1520bar 0 0 0 1.5195 0.01560 0.06240 0.00000E+00 0 1 +102134:all = Lambda1520 Lambda1520bar 4 0 0 1.51950 0.01560 1.47 1.60 0 ### add Resonance decays absent in PYTHIA8 decay table and set BRs from PDG for other -102134:oneChannel = 1 0.223547 0 2212 -321 -102134:addChannel = 1 0.223547 0 2112 -311 -102134:addChannel = 1 0.139096 0 3222 -211 -102134:addChannel = 1 0.139096 0 3212 111 -102134:addChannel = 1 0.139096 0 3112 211 -102134:addChannel = 1 0.028780 0 3224 -211 -102134:addChannel = 1 0.028780 0 3214 111 -102134:addChannel = 1 0.028780 0 3114 211 -102134:addChannel = 1 0.019373 0 3212 22 -102134:addChannel = 1 0.014638 0 3122 211 -102134:addChannel = 1 0.007948 0 3122 22 -102134:addChannel = 1 0.007319 0 3122 111 +102134:oneChannel = 1 0.229944 5 2212 -321 +102134:addChannel = 1 0.229944 5 2112 -311 +102134:addChannel = 1 0.143076 5 3222 -211 +102134:addChannel = 1 0.143076 5 3212 111 +102134:addChannel = 1 0.143076 5 3112 211 +102134:addChannel = 1 0.034066 4 3224 -211 +102134:addChannel = 1 0.034066 4 3214 111 +102134:addChannel = 1 0.034066 4 3114 211 +102134:addChannel = 1 0.008687 3 3122 22 102134:onMode = off @@ -28,7 +25,51 @@ ProcessLevel:all = off # will not look for the 'process' 102134:onIfMatch = 3224 -211 102134:onIfMatch = 3214 111 102134:onIfMatch = 3114 211 -102134:onIfMatch = 3212 22 -102134:onIfMatch = 3122 211 102134:onIfMatch = 3122 22 -102134:onIfMatch = 3122 111 + +### Xi1820 +123324:all = Xi1820 Xi1820bar 0 0 0 1.8234 0.0 0.0 0.0 0 +123324:oneChannel = 1 1.000 0 3122 310 +123324:onMode = off +123324:onIfMatch = 3122 310 + +123314:all = Xi1820Minus Xi1820Plus 0 -1 0 1.8234 0.0 0.0 0.0 0 +123314:oneChannel = 1 1.000 0 3122 -321 +123314:onMode = off +123314:onIfMatch = 3122 -321 + +### f1 study +20223:all = f_1(1285) f_1(1285) 3 0 0 1.28210 0.02420 1.20000 1.50000 0 +20223:oneChannel = 1 0.5 0 310 -321 211 +20223:addChannel = 1 0.5 0 310 321 -211 +20223:onMode = off +20223:onIfMatch = 310 -321 211 +20223:onIfMatch = 310 321 -211 + +20333:all = f_1(1420) f_1(1420) 3 0 0 1.42640 0.05490 1.40000 1.80000 0 +20333:oneChannel = 1 0.5 0 310 -321 211 +20333:addChannel = 1 0.5 0 310 321 -211 +20333:onMode = off +20333:onIfMatch = 310 -321 211 +20333:onIfMatch = 310 321 -211 + +### glueball hunting +9030221:all = f_0(1500) f_0(1500) 3 0 0 1.50600 0.11200 1.40000 1.60000 0 +9030221:oneChannel = 1 1.000 0 310 310 +9030221:onMode = off +9030221:onIfMatch = 310 310 + +10331:all = f_0(1710) f_0(1710) 3 0 0 1.72000 0.13500 1.10000 2.40000 0 +10331:oneChannel = 1 1.000 0 310 310 +10331:onMode = off +10331:onIfMatch = 310 310 + +335:all = f_2(1525) f_2(1525) 5 0 0 1.52500 0.07300 1.10000 2.00000 0 +335:oneChannel = 1 1.000 0 310 310 +335:onMode = off +335:onIfMatch = 310 310 + +10221:all = f_0(1370) f_0(1370) 3 0 0 1.35000 0.20000 0.80000 2.00000 0 +10221:oneChannel = 1 1.000 0 310 310 +10221:onMode = off +10221:onIfMatch = 310 310 diff --git a/MC/config/QC/json/its-clusters-tracks-qc.json b/MC/config/QC/json/its-clusters-tracks-qc.json index 5fa4ec5ff..d29046c08 100644 --- a/MC/config/QC/json/its-clusters-tracks-qc.json +++ b/MC/config/QC/json/its-clusters-tracks-qc.json @@ -45,16 +45,6 @@ "dicttimestamp": "0", "publishSummary1D": "0", "publishDetailedSummary": "1" - }, - "grpGeomRequest": { - "geomRequest": "Aligned", - "askGRPECS": "false", - "askGRPLHCIF": "false", - "askGRPMagField": "false", - "askMatLUT": "false", - "askTime": "false", - "askOnceAllButField": "true", - "needPropagatorD": "false" } }, "Tracks": { @@ -78,7 +68,8 @@ "doTTree": "0", "nBCbins": "103", "dicttimestamp": "0", - "doNorm": "1" + "doNorm": "1", + "publishMore": "0" } } }, @@ -148,4 +139,4 @@ } } } -} \ No newline at end of file +} diff --git a/MC/config/QC/json/mft-clusters.json b/MC/config/QC/json/mft-clusters.json index ba03a1e9d..4deebb702 100644 --- a/MC/config/QC/json/mft-clusters.json +++ b/MC/config/QC/json/mft-clusters.json @@ -39,21 +39,12 @@ "query": "randomcluster:MFT/COMPCLUSTERS/0;clustersrof:MFT/CLUSTERSROF/0;patterns:MFT/PATTERNS/0;cldict:MFT/CLUSDICT/0?lifetime=condition&ccdb-path=MFT/Calib/ClusterDictionary" }, "taskParameters": { + "onlineQC" : "0", "maxClusterROFSize": "50000", "maxDuration": "60000", "timeBinSize": "0.1", "ROFLengthInBC": "594" }, - "grpGeomRequest": { - "geomRequest": "Aligned", - "askGRPECS": "false", - "askGRPLHCIF": "false", - "askGRPMagField": "true", - "askMatLUT": "false", - "askTime": "false", - "askOnceAllButField": "true", - "needPropagatorD": "false" - }, "location": "remote" } }, @@ -85,4 +76,4 @@ } }, "dataSamplingPolicies": [] -} \ No newline at end of file +} diff --git a/MC/config/QC/json/mft-digits-0.json b/MC/config/QC/json/mft-digits-0.json index c23beec15..215b86758 100644 --- a/MC/config/QC/json/mft-digits-0.json +++ b/MC/config/QC/json/mft-digits-0.json @@ -46,6 +46,16 @@ "timeBinSize": "0.1", "ROFLengthInBC": "594" }, + "grpGeomRequest" : { + "geomRequest": "None", + "askGRPECS": "true", + "askGRPLHCIF": "false", + "askGRPMagField": "false", + "askMatLUT": "false", + "askTime": "false", + "askOnceAllButField": "false", + "needPropagatorD": "false" + }, "location": "remote" } }, diff --git a/MC/config/QC/json/mft-digits-1.json b/MC/config/QC/json/mft-digits-1.json index 59d3ea277..13f5260b6 100644 --- a/MC/config/QC/json/mft-digits-1.json +++ b/MC/config/QC/json/mft-digits-1.json @@ -46,6 +46,16 @@ "timeBinSize": "0.1", "ROFLengthInBC": "594" }, + "grpGeomRequest" : { + "geomRequest": "None", + "askGRPECS": "true", + "askGRPLHCIF": "false", + "askGRPMagField": "false", + "askMatLUT": "false", + "askTime": "false", + "askOnceAllButField": "false", + "needPropagatorD": "false" + }, "location": "remote" } }, diff --git a/MC/config/QC/json/mft-digits-2.json b/MC/config/QC/json/mft-digits-2.json index 8ae2a2d58..ace3733ff 100644 --- a/MC/config/QC/json/mft-digits-2.json +++ b/MC/config/QC/json/mft-digits-2.json @@ -46,6 +46,16 @@ "timeBinSize": "0.1", "ROFLengthInBC": "594" }, + "grpGeomRequest" : { + "geomRequest": "None", + "askGRPECS": "true", + "askGRPLHCIF": "false", + "askGRPMagField": "false", + "askMatLUT": "false", + "askTime": "false", + "askOnceAllButField": "false", + "needPropagatorD": "false" + }, "location": "remote" } }, diff --git a/MC/config/QC/json/mft-digits-3.json b/MC/config/QC/json/mft-digits-3.json index 287edbb97..cd5362d70 100644 --- a/MC/config/QC/json/mft-digits-3.json +++ b/MC/config/QC/json/mft-digits-3.json @@ -46,6 +46,16 @@ "timeBinSize": "0.1", "ROFLengthInBC": "594" }, + "grpGeomRequest" : { + "geomRequest": "None", + "askGRPECS": "true", + "askGRPLHCIF": "false", + "askGRPMagField": "false", + "askMatLUT": "false", + "askTime": "false", + "askOnceAllButField": "false", + "needPropagatorD": "false" + }, "location": "remote" } }, diff --git a/MC/config/QC/json/mft-digits-4.json b/MC/config/QC/json/mft-digits-4.json index a544794ce..156cf3391 100644 --- a/MC/config/QC/json/mft-digits-4.json +++ b/MC/config/QC/json/mft-digits-4.json @@ -46,6 +46,16 @@ "timeBinSize": "0.1", "ROFLengthInBC": "594" }, + "grpGeomRequest" : { + "geomRequest": "None", + "askGRPECS": "true", + "askGRPLHCIF": "false", + "askGRPMagField": "false", + "askMatLUT": "false", + "askTime": "false", + "askOnceAllButField": "false", + "needPropagatorD": "false" + }, "location": "remote" } }, diff --git a/MC/config/QC/json/mft-tracks.json b/MC/config/QC/json/mft-tracks.json index 718c1e581..1f6cb91aa 100644 --- a/MC/config/QC/json/mft-tracks.json +++ b/MC/config/QC/json/mft-tracks.json @@ -44,10 +44,20 @@ "MaxDuration": "60000", "TimeBinSize": "0.1" }, + "grpGeomRequest" : { + "geomRequest": "None", + "askGRPECS": "true", + "askGRPLHCIF": "false", + "askGRPMagField": "false", + "askMatLUT": "false", + "askTime": "false", + "askOnceAllButField": "false", + "needPropagatorD": "false" + }, "location": "remote" } }, "checks": {} }, "dataSamplingPolicies": [] -} \ No newline at end of file +} diff --git a/MC/run/ANCHOR/anchorMC.sh b/MC/run/ANCHOR/anchorMC.sh index 13512fea7..432977c38 100755 --- a/MC/run/ANCHOR/anchorMC.sh +++ b/MC/run/ANCHOR/anchorMC.sh @@ -15,6 +15,16 @@ # helper functionality # ######################## +echo_info() +{ + echo "INFO [anchorMC]: ${*}" +} + +echo_error() +{ + echo "ERROR [anchorMC]: ${*}" +} + print_help() { echo "Usage: ./anchorMC.sh" @@ -53,7 +63,7 @@ print_help() # Prevent the script from being soured to omit unexpected surprises when exit is used SCRIPT_NAME="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")" if [ "${SCRIPT_NAME}" != "$(basename ${BASH_SOURCE[0]})" ] ; then - echo "ERROR: This script cannot not be sourced" >&2 + echo_error "This script cannot not be sourced" >&2 return 1 fi @@ -70,8 +80,15 @@ while [ "$1" != "" ] ; do done # make sure O2DPG + O2 is loaded -[ ! "${O2DPG_ROOT}" ] && echo "Error: This needs O2DPG loaded" && exit 1 -[ ! "${O2_ROOT}" ] && echo "Error: This needs O2 loaded" && exit 1 +[ ! "${O2DPG_ROOT}" ] && echo_error "This needs O2DPG loaded" && exit 1 +[ ! "${O2_ROOT}" ] && echo_error "This needs O2 loaded" && exit 1 + +# check if jq is there +which jq >/dev/null 2>&1 +[ "${?}" != "0" ] && { echo_error "jq is not found. Install or load via alienv." ; exit 1 ; } + +alien-token-info >/dev/null 2>&1 +[ "${?}" != "0" ] && { echo_error "No GRID token found, required to run." ; exit 1 ; } ################################################################# # Set all required variables to identify an anchored production # @@ -87,8 +104,8 @@ export ALIEN_JDL_WORKFLOWDETECTORS=${ALIEN_JDL_WORKFLOWDETECTORS:-ITS,TPC,TOF,FV export ALIEN_JDL_ANCHOR_SIM_OPTIONS=${ALIEN_JDL_ANCHOR_SIM_OPTIONS:--gen pythia8} # all others MUST be set by the user/on the outside export ALIEN_JDL_LPMANCHORPASSNAME=${ALIEN_JDL_LPMANCHORPASSNAME:-${ANCHORPASSNAME}} -export ALIEN_JDL_MCANCHOR=${ALIEN_JDL_MCANCHOR:-${MCANCHOR}} -export ALIEN_JDL_LPMPASSNAME=${ALIEN_JDL_LPMPASSNAME:-${PASSNAME}} +# LPMPASSNAME is used in O2 and O2DPG scripts, however on the other hand, ALIEN_JDL_LPMANCHORPASSNAME is the one that is set in JDL templates; so use ALIEN_JDL_LPMANCHORPASSNAME and set ALIEN_JDL_LPMPASSNAME +export ALIEN_JDL_LPMPASSNAME=${ALIEN_JDL_LPMANCHORPASSNAME} export ALIEN_JDL_LPMRUNNUMBER=${ALIEN_JDL_LPMRUNNUMBER:-${RUNNUMBER}} export ALIEN_JDL_LPMPRODUCTIONTYPE=${ALIEN_JDL_LPMPRODUCTIONTYPE:-${PRODUCTIONTYPE}} export ALIEN_JDL_LPMINTERACTIONTYPE=${ALIEN_JDL_LPMINTERACTIONTYPE:-${INTERACTIONTYPE}} @@ -101,29 +118,29 @@ export ALIEN_JDL_ADDTIMESERIESINMC=${ALIEN_JDL_ADDTIMESERIESINMC:-1} # cache the production tag, will be set to a special anchor tag; reset later in fact ALIEN_JDL_LPMPRODUCTIONTAG_KEEP=$ALIEN_JDL_LPMPRODUCTIONTAG -echo "Substituting ALIEN_JDL_LPMPRODUCTIONTAG=$ALIEN_JDL_LPMPRODUCTIONTAG with ALIEN_JDL_LPMANCHORPRODUCTION=$ALIEN_JDL_LPMANCHORPRODUCTION for simulating reco pass..." +echo_info "Substituting ALIEN_JDL_LPMPRODUCTIONTAG=$ALIEN_JDL_LPMPRODUCTIONTAG with ALIEN_JDL_LPMANCHORPRODUCTION=$ALIEN_JDL_LPMANCHORPRODUCTION for simulating reco pass..." ALIEN_JDL_LPMPRODUCTIONTAG=$ALIEN_JDL_LPMANCHORPRODUCTION # check variables that need to be set -[ -z "${ALIEN_JDL_LPMANCHORPASSNAME}" ] && { echo "ERROR: Set ALIEN_JDL_LPMANCHORPASSNAME or ANCHORPASSNAME" ; exit 1 ; } -[ -z "${ALIEN_JDL_MCANCHOR}" ] && { echo "ERROR: Set ALIEN_JDL_MCANCHOR or MCANCHOR" ; exit 1 ; } -[ -z "${ALIEN_JDL_LPMPASSNAME}" ] && { echo "ERROR: Set ALIEN_JDL_LPMPASSNAME or PASSNAME" ; exit 1 ; } -[ -z "${ALIEN_JDL_LPMRUNNUMBER}" ] && { echo "ERROR: Set ALIEN_JDL_LPMRUNNUMBER or RUNNUMBER" ; exit 1 ; } -[ -z "${ALIEN_JDL_LPMPRODUCTIONTYPE}" ] && { echo "ERROR: Set ALIEN_JDL_LPMPRODUCTIONTYPE or PRODUCTIONTYPE" ; exit 1 ; } -[ -z "${ALIEN_JDL_LPMINTERACTIONTYPE}" ] && { echo "ERROR: Set ALIEN_JDL_LPMINTERACTIONTYPE or INTERACTIONTYPE" ; exit 1 ; } -[ -z "${ALIEN_JDL_LPMPRODUCTIONTAG}" ] && { echo "ERROR: Set ALIEN_JDL_LPMPRODUCTIONTAG or PRODUCTIONTAG" ; exit 1 ; } -[ -z "${ALIEN_JDL_LPMANCHORRUN}" ] && { echo "ERROR: Set ALIEN_JDL_LPMANCHORRUN or ANCHORRUN" ; exit 1 ; } -[ -z "${ALIEN_JDL_LPMANCHORPRODUCTION}" ] && { echo "ERROR: Set ALIEN_JDL_LPMANCHORPRODUCTION or ANCHORPRODUCTION" ; exit 1 ; } -[ -z "${ALIEN_JDL_LPMANCHORYEAR}" ] && { echo "ERROR: Set ALIEN_JDL_LPMANCHORYEAR or ANCHORYEAR" ; exit 1 ; } - -[ -z "${NTIMEFRAMES}" ] && { echo "ERROR: Set NTIMEFRAMES" ; exit 1 ; } -[ -z "${NSIGEVENTS}" ] && { echo "ERROR: Set NSIGEVENTS" ; exit 1 ; } -[ -z "${SPLITID}" ] && { echo "ERROR: Set SPLITID" ; exit 1 ; } -[ -z "${CYCLE}" ] && { echo "ERROR: Set CYCLE" ; exit 1 ; } -[ -z "${PRODSPLIT}" ] && { echo "ERROR: Set PRODSPLIT" ; exit 1 ; } +[ -z "${ALIEN_JDL_LPMANCHORPASSNAME}" ] && { echo_error "Set ALIEN_JDL_LPMANCHORPASSNAME or ANCHORPASSNAME" ; exit 1 ; } +[ -z "${ALIEN_JDL_LPMRUNNUMBER}" ] && { echo_error "Set ALIEN_JDL_LPMRUNNUMBER or RUNNUMBER" ; exit 1 ; } +[ -z "${ALIEN_JDL_LPMPRODUCTIONTYPE}" ] && { echo_error "Set ALIEN_JDL_LPMPRODUCTIONTYPE or PRODUCTIONTYPE" ; exit 1 ; } +[ -z "${ALIEN_JDL_LPMINTERACTIONTYPE}" ] && { echo_error "Set ALIEN_JDL_LPMINTERACTIONTYPE or INTERACTIONTYPE" ; exit 1 ; } +[ -z "${ALIEN_JDL_LPMPRODUCTIONTAG}" ] && { echo_error "Set ALIEN_JDL_LPMPRODUCTIONTAG or PRODUCTIONTAG" ; exit 1 ; } +[ -z "${ALIEN_JDL_LPMANCHORRUN}" ] && { echo_error "Set ALIEN_JDL_LPMANCHORRUN or ANCHORRUN" ; exit 1 ; } +[ -z "${ALIEN_JDL_LPMANCHORPRODUCTION}" ] && { echo_error "Set ALIEN_JDL_LPMANCHORPRODUCTION or ANCHORPRODUCTION" ; exit 1 ; } +[ -z "${ALIEN_JDL_LPMANCHORYEAR}" ] && { echo_error "Set ALIEN_JDL_LPMANCHORYEAR or ANCHORYEAR" ; exit 1 ; } + +[ -z "${NTIMEFRAMES}" ] && { echo_error "Set NTIMEFRAMES" ; exit 1 ; } +[ -z "${NSIGEVENTS}" ] && { echo_error "Set NSIGEVENTS" ; exit 1 ; } +[ -z "${SPLITID}" ] && { echo_error "Set SPLITID" ; exit 1 ; } +[ -z "${CYCLE}" ] && { echo_error "Set CYCLE" ; exit 1 ; } +[ -z "${PRODSPLIT}" ] && { echo_error "Set PRODSPLIT" ; exit 1 ; } # also for this keep a real default NWORKERS=${NWORKERS:-8} +# set a default seed if not given +SEED=${ALIEN_PROC_ID:-${SEED:-1}} # default async_pass.sh script @@ -143,14 +160,14 @@ fi # if there is no setenv_extra.sh in this directory (so no special version is "shipped" with this rpodcution), copy the default one if [[ ! -f setenv_extra.sh ]] ; then cp ${DPGSETENV} . - echo "[INFO alien_setenv_extra.sh] Use default setenv_extra.sh from ${DPGSETENV}." + echo_info "Use default setenv_extra.sh from ${DPGSETENV}." else - echo "[INFO alien_setenv_extra.sh] setenv_extra.sh was found in the current working directory, use it." + echo_info "setenv_extra.sh was found in the current working directory, use it." fi chmod u+x setenv_extra.sh -echo "[INFO alien_async_pass.sh] Setting up DPGRECO to ${DPGRECO}" +echo_info "Setting up DPGRECO to ${DPGRECO}" # settings that are MC-specific, modify setenv_extra.sh in-place sed -i 's/GPU_global.dEdxUseFullGainMap=1;GPU_global.dEdxDisableResidualGainMap=1/GPU_global.dEdxSplineTopologyCorrFile=splines_for_dedx_V1_MC_iter0_PP.root;GPU_global.dEdxDisableTopologyPol=1;GPU_global.dEdxDisableGainMap=1;GPU_global.dEdxDisableResidualGainMap=1;GPU_global.dEdxDisableResidualGain=1/' setenv_extra.sh @@ -167,14 +184,14 @@ touch list.list ./async_pass.sh ${CTF_TEST_FILE:-""} 2&> async_pass_log.log RECO_RC=$? -echo "RECO finished with ${RECO_RC}" +echo_info "async_pass.sh finished with ${RECO_RC}" if [[ "${RECO_RC}" != "0" ]] ; then exit ${RECO_RC} fi ALIEN_JDL_LPMPRODUCTIONTAG=$ALIEN_JDL_LPMPRODUCTIONTAG_KEEP -echo "Setting back ALIEN_JDL_LPMPRODUCTIONTAG to $ALIEN_JDL_LPMPRODUCTIONTAG" +echo_info "Setting back ALIEN_JDL_LPMPRODUCTIONTAG to $ALIEN_JDL_LPMPRODUCTIONTAG" # now create the local MC config file --> config-config.json ${O2DPG_ROOT}/UTILS/parse-async-WorkflowConfig.py @@ -182,15 +199,13 @@ ASYNC_WF_RC=${?} # check if config reasonably created if [[ "${ASYNC_WF_RC}" != "0" || `grep "o2-ctf-reader-workflow-options" config-json.json 2> /dev/null | wc -l` == "0" ]]; then - echo "Problem in anchor config creation. Exiting." + echo_error "Problem in anchor config creation. Exiting." exit 1 fi # -- CREATE THE MC JOB DESCRIPTION ANCHORED TO RUN -- MODULES="--skipModules ZDC" -# introduce variable to make usage clear -SEED=${ALIEN_PROC_ID} # Since this is used, set it explicitly ALICEO2_CCDB_LOCALCACHE=${ALICEO2_CCDB_LOCALCACHE:-$(pwd)/ccdb} @@ -205,28 +220,31 @@ remainingargs="${remainingargs} -productionTag ${ALIEN_JDL_LPMPRODUCTIONTAG:-ali # since the last passed argument wins, e.g. -productionTag cannot be overwritten by the user remainingargs="${ALIEN_JDL_ANCHOR_SIM_OPTIONS} ${remainingargs} --anchor-config config-json.json" -echo "baseargs: ${baseargs}" -echo "remainingargs: ${remainingargs}" +echo_info "baseargs passed to o2dpg_sim_workflow_anchored.py: ${baseargs}" +echo_info "remainingargs forwarded to o2dpg_sim_workflow.py: ${remainingargs}" # query CCDB has changed, w/o "_" ${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow_anchored.py ${baseargs} -- ${remainingargs} &> timestampsampling_${ALIEN_JDL_LPMRUNNUMBER}.log -if [ "$?" != "0" ] ; then - echo "Problem during anchor timestamp sampling and workflow creation. Exiting." - exit 1 +WF_RC="${?}" +if [ "${WF_RC}" != "0" ] ; then + echo_error "Problem during anchor timestamp sampling and workflow creation. Exiting." + exit ${WF_RC} fi TIMESTAMP=`grep "Determined timestamp to be" timestampsampling_${ALIEN_JDL_LPMRUNNUMBER}.log | awk '//{print $6}'` -echo "TIMESTAMP IS ${TIMESTAMP}" +echo_info "TIMESTAMP IS ${TIMESTAMP}" # -- Create aligned geometry using ITS ideal alignment to avoid overlaps in geant CCDBOBJECTS_IDEAL_MC="ITS/Calib/Align" TIMESTAMP_IDEAL_MC=1 ${O2_ROOT}/bin/o2-ccdb-downloadccdbfile --host http://alice-ccdb.cern.ch/ -p ${CCDBOBJECTS_IDEAL_MC} -d ${ALICEO2_CCDB_LOCALCACHE} --timestamp ${TIMESTAMP_IDEAL_MC} -if [ ! "$?" == "0" ]; then - echo "Problem during CCDB prefetching of ${CCDBOBJECTS_IDEAL_MC}. Exiting." - exit 1 +CCDB_RC="${?}" +if [ ! "${CCDB_RC}" == "0" ]; then + echo_error "Problem during CCDB prefetching of ${CCDBOBJECTS_IDEAL_MC}. Exiting." + exit ${CCDB_RC} fi +# TODO This can potentially be removed or if needed, should be taken over by o2dpg_sim_workflow_anchored.py and O2_dpg_workflow_runner.py echo "run with echo in pipe" | ${O2_ROOT}/bin/o2-create-aligned-geometry-workflow --configKeyValues "HBFUtils.startTime=${TIMESTAMP}" --condition-remap=file://${ALICEO2_CCDB_LOCALCACHE}=ITS/Calib/Align -b mkdir -p $ALICEO2_CCDB_LOCALCACHE/GLO/Config/GeometryAligned ln -s -f $PWD/o2sim_geometry-aligned.root $ALICEO2_CCDB_LOCALCACHE/GLO/Config/GeometryAligned/snapshot.root @@ -235,22 +253,22 @@ ln -s -f $PWD/o2sim_geometry-aligned.root $ALICEO2_CCDB_LOCALCACHE/GLO/Config/Ge export FAIRMQ_IPC_PREFIX=./ -echo "Ready to start main workflow" +echo_info "Ready to start main workflow" ${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json -tt ${ALIEN_JDL_O2DPGWORKFLOWTARGET:-aod} --cpu-limit ${ALIEN_JDL_CPULIMIT:-8} MCRC=$? # <--- we'll report back this code - +exit 0 if [[ "${ALIEN_JDL_ADDTIMESERIESINMC}" != "0" ]]; then # Default value is 1 so this is run by default. - echo "Running TPC time series" + echo_info "Running TPC time series" ${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json -tt tpctimes fi -[[ ! -z "${DISABLE_QC}" ]] && echo "INFO: QC is disabled, skip it." +[[ ! -z "${DISABLE_QC}" ]] && echo_info "QC is disabled, skip it." if [[ -z "${DISABLE_QC}" && "${MCRC}" = "0" && "${remainingargs}" == *"--include-local-qc"* ]] ; then # do QC tasks - echo "Doing QC" + echo_info "Doing QC" ${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json --target-labels QC --cpu-limit ${ALIEN_JDL_CPULIMIT:-8} -k # NOTE that with the -k|--keep-going option, the runner will try to keep on executing even if some tasks fail. # That means, even if there is a failing QC task, the return code will be 0 diff --git a/MC/run/ANCHOR/tests/test_anchor_2023_apass2_PbPb.sh b/MC/run/ANCHOR/tests/test_anchor_2023_apass2_PbPb.sh index 095908e4b..0b3cc549e 100755 --- a/MC/run/ANCHOR/tests/test_anchor_2023_apass2_PbPb.sh +++ b/MC/run/ANCHOR/tests/test_anchor_2023_apass2_PbPb.sh @@ -8,9 +8,7 @@ # taken from https://its.cern.ch/jira/browse/O2-4586 export ALIEN_JDL_LPMANCHORPASSNAME=apass2 export ALIEN_JDL_MCANCHOR=apass2 -export ALIEN_JDL_COLLISIONSYSTEM=Pb-Pb export ALIEN_JDL_CPULIMIT=8 -export ALIEN_JDL_LPMPASSNAME=apass2 export ALIEN_JDL_LPMRUNNUMBER=544121 export ALIEN_JDL_LPMPRODUCTIONTYPE=MC export ALIEN_JDL_LPMINTERACTIONTYPE=PbPb @@ -25,12 +23,15 @@ export SPLITID=100 export PRODSPLIT=153 export CYCLE=0 -# on the GRID, this is set, for our use case, we can mimic any job ID -export ALIEN_PROC_ID=2963436952 +# on the GRID, this is set and used as seed; when set, it takes precedence over SEED +#export ALIEN_PROC_ID=2963436952 +export SEED=5 # run the central anchor steering script; this includes # * derive timestamp # * derive interaction rate # * extract and prepare configurations (which detectors are contained in the run etc.) # * run the simulation (and QC) +# To disable QC, uncomment the following line +#export DISABLE_QC=1 ${O2DPG_ROOT}/MC/run/ANCHOR/anchorMC.sh diff --git a/MC/run/ANCHOR/tests/test_anchor_2023_apass2_pp.sh b/MC/run/ANCHOR/tests/test_anchor_2023_apass2_pp.sh index e528b8a0a..9d8378044 100755 --- a/MC/run/ANCHOR/tests/test_anchor_2023_apass2_pp.sh +++ b/MC/run/ANCHOR/tests/test_anchor_2023_apass2_pp.sh @@ -8,9 +8,7 @@ # taken from https://its.cern.ch/jira/browse/O2-4586 export ALIEN_JDL_LPMANCHORPASSNAME=apass2 export ALIEN_JDL_MCANCHOR=apass2 -export ALIEN_JDL_COLLISIONSYSTEM=p-p export ALIEN_JDL_CPULIMIT=8 -export ALIEN_JDL_LPMPASSNAME=apass2 export ALIEN_JDL_LPMRUNNUMBER=535069 export ALIEN_JDL_LPMPRODUCTIONTYPE=MC export ALIEN_JDL_LPMINTERACTIONTYPE=pp @@ -19,21 +17,24 @@ export ALIEN_JDL_LPMANCHORRUN=535069 export ALIEN_JDL_LPMANCHORPRODUCTION=LHC23f export ALIEN_JDL_LPMANCHORYEAR=2023 -export NTIMEFRAMES=2 +export NTIMEFRAMES=1 export NSIGEVENTS=50 export SPLITID=100 export PRODSPLIT=153 export CYCLE=0 -# on the GRID, this is set, for our use case, we can mimic any job ID -export ALIEN_PROC_ID=2963436952 +# on the GRID, this is set and used as seed; when set, it takes precedence over SEED +#export ALIEN_PROC_ID=2963436952 +export SEED=5 # for pp and 50 events per TF, we launch only 4 workers. -export NWORKERS=4 +export NWORKERS=2 # run the central anchor steering script; this includes # * derive timestamp # * derive interaction rate # * extract and prepare configurations (which detectors are contained in the run etc.) # * run the simulation (and QC) +# To disable QC, uncomment the following line +#export DISABLE_QC=1 ${O2DPG_ROOT}/MC/run/ANCHOR/anchorMC.sh diff --git a/test/run_workflow_tests.sh b/test/run_workflow_tests.sh index 9962b3293..3d00df9d6 100755 --- a/test/run_workflow_tests.sh +++ b/test/run_workflow_tests.sh @@ -52,8 +52,9 @@ test_single_wf() local memlimit=${O2DPG_TEST_WORKFLOW_MEMLIMIT:+--mem-limit ${O2DPG_TEST_WORKFLOW_MEMLIMIT}} ${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json --cpu-limit 8 -tt aod ${memlimit} >> ${LOG_FILE_WF} 2>&1 ret_this=${?} - [[ "${ret_this}" == "0" ]] && { ${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json --cpu-limit 8 --target-labels QC ${memlimit} >> ${LOG_FILE_WF} 2>&1 ; ret_this_qc=${?} ; } - [[ "${ret_this}" == "0" ]] && { ${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json --cpu-limit 8 --target-labels Analysis ${memlimit} >> ${LOG_FILE_WF} 2>&1 ; ret_this_analysis=${?} ; } + # use -k|--keep-going feature to not stop after the first failure but see, if there are more + [[ "${ret_this}" == "0" ]] && { ${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json --cpu-limit 8 --target-labels QC ${memlimit} -k >> ${LOG_FILE_WF} 2>&1 ; ret_this_qc=${?} ; } + [[ "${ret_this}" == "0" ]] && { ${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json --cpu-limit 8 --target-labels Analysis ${memlimit} -k >> ${LOG_FILE_WF} 2>&1 ; ret_this_analysis=${?} ; } ret_this=$((ret_this + ret_this_qc + ret_this_analysis)) [[ "${ret_this}" != "0" ]] && echo "[FATAL]: O2DPG_TEST Workflow execution failed" >> ${LOG_FILE_WF} || echo_green " -> PASSED" else