Display in terminal AND saving to a file for o2-sim-digitizer-workflow

Hello,

I want to save the output of running the digitization routine while still keeping the output verbose in terminal. I tried:

o2-sim-digitizer-workflow -b | tee o2digi.log

and the output I get is:

[INFO] Loading field from GRP of o2sim_grp.root Run: 1582711658 Fill: 0 Period: LHC State: Start: Wed Feb 26 10:07:38 2020 End : Wed Feb 26 10:07:39 2020 Beam0: Z:A = 0: 0, Energy = 0.000 Beam1: Z:A = 0: 0, Energy = 0.000 sqrt[s] = 0.000 crossing angle (radian) = 0.000000e+00 magnet currents (A) L3 = -30000.000, Dipole = -6000 Detectors: Cont.RO Triggers FV0: + - [INFO] MagneticField::Print: MagneticFieldMap: Info in <TGeoGlobalMagField::SetField>: Global magnetic field set to <MagneticFieldMap> Info in <TGeoGlobalMagField::Lock>: Global magnetic field <MagneticFieldMap> is now locked [INFO] MagneticField::Print: Solenoid (-1*)5 kG, Dipole ON (-1) [INFO] MagneticField::Print: Machine B fields for p-p beam (7000 GeV): QGrad: 22.0002 Dipole: 37.8781 [INFO] MagneticField::Print: Uses Sol30_Dip6_Hole of /persist/sw/slc7_x86-64/O2/v1.1.0-1/share/Common/maps/mfchebKGI_sym.root [INFO] Running with the B field constructed out of GRP [INFO] Access field via TGeoGlobalMagField::Instance()->Field(xyz,bxyz) or via [INFO] auto o2field = static_cast<o2::field::MagneticField*>( TGeoGlobalMagField::Instance()->GetField() ) [INFO] TPC: GEM setup from existing cache [INFO] TPC: GEM setup (polya) took 0.36 [INFO] TPC is in grp? no; is skipped? no [INFO] ITS is in grp? no; is skipped? no [INFO] MFT is in grp? no; is skipped? no [INFO] TOF is in grp? no; is skipped? no [INFO] FT0 is in grp? no; is skipped? no [INFO] FV0 is in grp? yes; is skipped? no [INFO] EMC is in grp? no; is skipped? no [INFO] HMP is in grp? no; is skipped? no [INFO] ZDC is in grp? no; is skipped? no [INFO] TRD is in grp? no; is skipped? no [INFO] MCH is in grp? no; is skipped? no [INFO] MID is in grp? no; is skipped? no [INFO] FDD is in grp? no; is skipped? no [INFO] PHS is in grp? no; is skipped? no [INFO] CPV is in grp? no; is skipped? no { "workflow": [ { "name": "SimReader", "inputs": [], "outputs": [ { "binding": "collisioncontext", "origin": "SIM", "description": "COLLISIONCONTEXT", "subspec": 0, "lifetime": 0 } ], "options": [ { "name": "interactionRate", "type": "2", "defaultValue": "50000", "help": "Total hadronic interaction rate (Hz)" }, { "name": "bcPatternFile", "type": "4", "defaultValue": "", "help": "Interacting BC pattern file (e.g. from CreateBCPattern.C)" }, { "name": "simFile", "type": "4", "defaultValue": "o2sim.root", "help": "Sim input filename" }, { "name": "simFileS", "type": "4", "defaultValue": "", "help": "Sim (signal) input filename" }, { "name": "simFileQED", "type": "4", "defaultValue": "", "help": "Sim (QED) input filename" }, { "name": "outcontext", "type": "4", "defaultValue": "collisioncontext.root", "help": "Output file for collision context" }, { "name": "incontext", "type": "4", "defaultValue": "", "help": "Take collision context from this file" }, { "name": "ncollisions,n", "type": "0", "defaultValue": "0", "help": "number of collisions to sample (default is given by number of entries in chain" } ], "rank": 0, "nSlots": 1, "inputTimeSliceId": 0, "maxInputTimeslices": 1 }, { "name": "FV0Digitizer", "inputs": [ { "binding": "collisioncontext", "origin": "SIM", "description": "COLLISIONCONTEXT", "subspec": 0, "lifetime": 0 } ], "outputs": [ { "binding": "FV0/DIGITSBC/0", "origin": "FV0", "description": "DIGITSBC", "subspec": 0, "lifetime": 0 }, { "binding": "FV0/DIGITSCH/0", "origin": "FV0", "description": "DIGITSCH", "subspec": 0, "lifetime": 0 }, { "binding": "FV0/DIGITLBL/0", "origin": "FV0", "description": "DIGITLBL", "subspec": 0, "lifetime": 0 }, { "binding": "FV0/ROMode/0", "origin": "FV0", "description": "ROMode", "subspec": 0, "lifetime": 0 } ], "options": [ { "name": "simFile", "type": "4", "defaultValue": "o2sim.root", "help": "Sim (background) input filename" }, { "name": "simFileS", "type": "4", "defaultValue": "", "help": "Sim (signal) input filename" }, { "name": "pileup", "type": "0", "defaultValue": "1", "help": "whether to run in continuous time mode" } ], "rank": 0, "nSlots": 1, "inputTimeSliceId": 0, "maxInputTimeslices": 1 }, { "name": "FV0DigitWriter", "inputs": [ { "binding": "digitBCinput", "origin": "FV0", "description": "DIGITSBC", "subspec": 0, "lifetime": 0 }, { "binding": "digitChinput", "origin": "FV0", "description": "DIGITSCH", "subspec": 0, "lifetime": 0 }, { "binding": "labelinput", "origin": "FV0", "description": "DIGITLBL", "subspec": 0, "lifetime": 0 } ], "outputs": [], "options": [ { "name": "outfile", "type": "4", "defaultValue": "fv0digits.root", "help": "Name of the output file" }, { "name": "treename", "type": "4", "defaultValue": "o2sim", "help": "Name of tree" }, { "name": "nevents", "type": "0", "defaultValue": "1", "help": "Number of events to execute" }, { "name": "terminate", "type": "4", "defaultValue": "process", "help": "Terminate the 'process' or 'workflow'" } ], "rank": 0, "nSlots": 1, "inputTimeSliceId": 0, "maxInputTimeslices": 1 }, { "name": "GRPUpdater", "inputs": [ { "binding": "FV0", "origin": "FV0", "description": "ROMode", "subspec": 0, "lifetime": 0 } ], "outputs": [], "options": [], "rank": 0, "nSlots": 1, "inputTimeSliceId": 0, "maxInputTimeslices": 1 } ], "metadata": [ { "name": "SimReader", "executable": "o2-sim-digitizer-workflow", "cmdLineArgs": [ "-b" ], "workflowOptions": [ { "name": "readers", "type": "1", "defaultValue": "1", "help": "number of parallel readers to use" }, { "name": "tpc-lanes", "type": "0", "defaultValue": "2", "help": "Number of tpc processing lanes. A lane is a pipeline of algorithms." }, { "name": "tpc-sectors", "type": "4", "defaultValue": "0-35", "help": "List of TPC sectors, comma separated ranges, e.g. 0-3,7,9-15" }, { "name": "onlyDet", "type": "4", "defaultValue": "none", "help": "Comma separated list of detectors to accept. Takes precedence over the skipDet option. (Default is none)" }, { "name": "skipDet", "type": "4", "defaultValue": "none", "help": "Comma separate list of detectors to skip/ignore. (Default is none)" }, { "name": "tpc-reco-type", "type": "4", "defaultValue": "", "help": "Run TPC reco workflow to specified output type, currently supported: 'tracks'" }, { "name": "configKeyValues", "type": "4", "defaultValue": "", "help": "Semicolon separated key=value strings (e.g.: 'TPC.gasDensity=1;...')" }, { "name": "configFile", "type": "4", "defaultValue": "", "help": "configuration file for configurable parameters" }, { "name": "use-ccdb-tof", "type": "5", "defaultValue": "0", "help": "enable access to ccdb tof calibration objects" } ] }, { "name": "FV0Digitizer", "executable": "o2-sim-digitizer-workflow", "cmdLineArgs": [ "-b" ], "workflowOptions": [ { "name": "readers", "type": "1", "defaultValue": "1", "help": "number of parallel readers to use" }, { "name": "tpc-lanes", "type": "0", "defaultValue": "2", "help": "Number of tpc processing lanes. A lane is a pipeline of algorithms." }, { "name": "tpc-sectors", "type": "4", "defaultValue": "0-35", "help": "List of TPC sectors, comma separated ranges, e.g. 0-3,7,9-15" }, { "name": "onlyDet", "type": "4", "defaultValue": "none", "help": "Comma separated list of detectors to accept. Takes precedence over the skipDet option. (Default is none)" }, { "name": "skipDet", "type": "4", "defaultValue": "none", "help": "Comma separate list of detectors to skip/ignore. (Default is none)" }, { "name": "tpc-reco-type", "type": "4", "defaultValue": "", "help": "Run TPC reco workflow to specified output type, currently supported: 'tracks'" }, { "name": "configKeyValues", "type": "4", "defaultValue": "", "help": "Semicolon separated key=value strings (e.g.: 'TPC.gasDensity=1;...')" }, { "name": "configFile", "type": "4", "defaultValue": "", "help": "configuration file for configurable parameters" }, { "name": "use-ccdb-tof", "type": "5", "defaultValue": "0", "help": "enable access to ccdb tof calibration objects" } ] }, { "name": "internal-dpl-clock", "executable": "o2-sim-digitizer-workflow", "cmdLineArgs": [ "-b" ], "workflowOptions": [ { "name": "readers", "type": "1", "defaultValue": "1", "help": "number of parallel readers to use" }, { "name": "tpc-lanes", "type": "0", "defaultValue": "2", "help": "Number of tpc processing lanes. A lane is a pipeline of algorithms." }, { "name": "tpc-sectors", "type": "4", "defaultValue": "0-35", "help": "List of TPC sectors, comma separated ranges, e.g. 0-3,7,9-15" }, { "name": "onlyDet", "type": "4", "defaultValue": "none", "help": "Comma separated list of detectors to accept. Takes precedence over the skipDet option. (Default is none)" }, { "name": "skipDet", "type": "4", "defaultValue": "none", "help": "Comma separate list of detectors to skip/ignore. (Default is none)" }, { "name": "tpc-reco-type", "type": "4", "defaultValue": "", "help": "Run TPC reco workflow to specified output type, currently supported: 'tracks'" }, { "name": "configKeyValues", "type": "4", "defaultValue": "", "help": "Semicolon separated key=value strings (e.g.: 'TPC.gasDensity=1;...')" }, { "name": "configFile", "type": "4", "defaultValue": "", "help": "configuration file for configurable parameters" }, { "name": "use-ccdb-tof", "type": "5", "defaultValue": "0", "help": "enable access to ccdb tof calibration objects" } ] }, { "name": "FV0DigitWriter", "executable": "o2-sim-digitizer-workflow", "cmdLineArgs": [ "-b" ], "workflowOptions": [ { "name": "readers", "type": "1", "defaultValue": "1", "help": "number of parallel readers to use" }, { "name": "tpc-lanes", "type": "0", "defaultValue": "2", "help": "Number of tpc processing lanes. A lane is a pipeline of algorithms." }, { "name": "tpc-sectors", "type": "4", "defaultValue": "0-35", "help": "List of TPC sectors, comma separated ranges, e.g. 0-3,7,9-15" }, { "name": "onlyDet", "type": "4", "defaultValue": "none", "help": "Comma separated list of detectors to accept. Takes precedence over the skipDet option. (Default is none)" }, { "name": "skipDet", "type": "4", "defaultValue": "none", "help": "Comma separate list of detectors to skip/ignore. (Default is none)" }, { "name": "tpc-reco-type", "type": "4", "defaultValue": "", "help": "Run TPC reco workflow to specified output type, currently supported: 'tracks'" }, { "name": "configKeyValues", "type": "4", "defaultValue": "", "help": "Semicolon separated key=value strings (e.g.: 'TPC.gasDensity=1;...')" }, { "name": "configFile", "type": "4", "defaultValue": "", "help": "configuration file for configurable parameters" }, { "name": "use-ccdb-tof", "type": "5", "defaultValue": "0", "help": "enable access to ccdb tof calibration objects" } ] }, { "name": "GRPUpdater", "executable": "o2-sim-digitizer-workflow", "cmdLineArgs": [ "-b" ], "workflowOptions": [ { "name": "readers", "type": "1", "defaultValue": "1", "help": "number of parallel readers to use" }, { "name": "tpc-lanes", "type": "0", "defaultValue": "2", "help": "Number of tpc processing lanes. A lane is a pipeline of algorithms." }, { "name": "tpc-sectors", "type": "4", "defaultValue": "0-35", "help": "List of TPC sectors, comma separated ranges, e.g. 0-3,7,9-15" }, { "name": "onlyDet", "type": "4", "defaultValue": "none", "help": "Comma separated list of detectors to accept. Takes precedence over the skipDet option. (Default is none)" }, { "name": "skipDet", "type": "4", "defaultValue": "none", "help": "Comma separate list of detectors to skip/ignore. (Default is none)" }, { "name": "tpc-reco-type", "type": "4", "defaultValue": "", "help": "Run TPC reco workflow to specified output type, currently supported: 'tracks'" }, { "name": "configKeyValues", "type": "4", "defaultValue": "", "help": "Semicolon separated key=value strings (e.g.: 'TPC.gasDensity=1;...')" }, { "name": "configFile", "type": "4", "defaultValue": "", "help": "configuration file for configurable parameters" }, { "name": "use-ccdb-tof", "type": "5", "defaultValue": "0", "help": "enable access to ccdb tof calibration objects" } ] } ]

Is there a way to save the output to a file for digitization while still keeping the display in terminal?

Best Regards,
Zlatko

I believe the pipe operator “|” has been overloaded for DPL workflows so that ordinary IO piping may not be working anymore (I could be wrong).

@eulisse: Is there a way to still have the normal pipe behaviour? To avoid such problems, could we maybe do workflow composition different than with the pipe operator?

Hello @zsaldic,

o2-sim-digitizer-workflow -b --run | tee o2digi.log

should work.

Cheers,
Thomas

This worked, thank you!

Yes --run can be used to run the workflow. At some point we discussed this and the proposed behavior was summarised at https://alice.its.cern.ch/jira/browse/O2-707. Would that be ok with you?

Thanks. I was also not aware of the --run option.