Skip to content

Commit 8f0c9c4

Browse files
shahor02davidrohr
authored andcommitted
Suppress firstBC and firstOrbit opts. use instead HBFUtils.orbitFirstSampled.
Save HBFUtils.orbitFirstSampled as DigitizationContext::mFirstOrbitForSampling
1 parent ee9e90b commit 8f0c9c4

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

DataFormats/simulation/include/SimulationDataFormat/DigitizationContext.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ class DigitizationContext
4848
public:
4949
DigitizationContext() : mNofEntries{0}, mMaxPartNumber{0}, mEventRecords(), mEventParts() {}
5050

51+
uint32_t getFirstOrbitForSampling() const { return mFirstOrbitForSampling; }
52+
void setFirstOrbitForSampling(uint32_t o) { mFirstOrbitForSampling = o; }
53+
5154
int getNCollisions() const { return mNofEntries; }
5255
void setNCollisions(int n) { mNofEntries = n; }
5356

@@ -111,6 +114,8 @@ class DigitizationContext
111114
private:
112115
int mNofEntries = 0;
113116
int mMaxPartNumber = 0; // max number of parts in any given collision
117+
uint32_t mFirstOrbitForSampling = 0; // 1st orbit to start sampling
118+
114119
float mMuBC; // probability of hadronic interaction per bunch
115120

116121
std::vector<o2::InteractionTimeRecord> mEventRecords;
@@ -127,7 +132,7 @@ class DigitizationContext
127132
std::string mQEDSimPrefix; // prefix for QED production/contribution
128133
mutable o2::parameters::GRPObject* mGRP = nullptr; //!
129134

130-
ClassDefNV(DigitizationContext, 3);
135+
ClassDefNV(DigitizationContext, 4);
131136
};
132137

133138
/// function reading the hits from a chain (previously initialized with initSimChains

Steer/DigitizerWorkflow/src/SimReaderSpec.cxx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "Steer/InteractionSampler.h"
2121
#include "CommonDataFormat/InteractionRecord.h"
2222
#include "DataFormatsTPC/TPCSectorHeader.h"
23+
#include "DetectorsRaw/HBFUtils.h"
2324
#include <FairMQLogger.h>
2425
#include <TMessage.h> // object serialization
2526
#include <memory> // std::unique_ptr
@@ -116,12 +117,8 @@ DataProcessorSpec getSimReaderSpec(SubspecRange range, const std::vector<std::st
116117
LOG(INFO) << "Imposing hadronic interaction rate " << intRate << "Hz";
117118
mgr.getInteractionSampler().setInteractionRate(intRate);
118119

119-
int bc0 = ctx.options().get<int>("firstBC");
120-
int orbit0 = ctx.options().get<int>("firstOrbit");
121-
if (bc0 < 0 || orbit0 < 0) {
122-
throw std::runtime_error("negative 1st orbit or BC provided");
123-
}
124-
mgr.getInteractionSampler().setFirstIR({uint16_t(bc0 % o2lhc::LHCMaxBunches), orbit0 + uint32_t(bc0 / o2lhc::LHCMaxBunches)});
120+
mgr.getInteractionSampler().setFirstIR({0, o2::raw::HBFUtils::Instance().orbitFirstSampled});
121+
mgr.getDigitizationContext().setFirstOrbitForSampling(o2::raw::HBFUtils::Instance().orbitFirstSampled);
125122

126123
auto bcPatternFile = ctx.options().get<std::string>("bcPatternFile");
127124
if (!bcPatternFile.empty()) {
@@ -207,8 +204,6 @@ DataProcessorSpec getSimReaderSpec(SubspecRange range, const std::vector<std::st
207204
/* OPTIONS */
208205
Options{
209206
{"interactionRate", VariantType::Float, 50000.0f, {"Total hadronic interaction rate (Hz)"}},
210-
{"firstBC", VariantType::Int, 0, {"First BC in interaction sampling, will affect 1st orbit if > LHCMaxBunches"}},
211-
{"firstOrbit", VariantType::Int, 1, {"First orbit in interaction sampling"}},
212207
{"bcPatternFile", VariantType::String, "", {"Interacting BC pattern file (e.g. from CreateBCPattern.C)"}},
213208
{"simPrefixQED", VariantType::String, "", {"Sim (QED) input prefix (example: path/o2qed). The prefix allows to find files like path/o2qed_Kine.root etc."}},
214209
{"qed-x-section-ratio", VariantType::Float, -1.f, {"Ratio of cross sections QED/hadronic events. Determines QED interaction rate from hadronic interaction rate."}},

prodtests/full_system_test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ else
6969
fi
7070

7171
taskwrapper sim.log o2-sim --seed $O2SIMSEED -n $NEvents --skipModules ZDC --configKeyValues "Diamond.width[2]=6." -g pythia8hi -j $NJOBS
72-
taskwrapper digi.log o2-sim-digitizer-workflow -n $NEvents --simPrefixQED qed/o2sim --qed-x-section-ratio ${QED2HAD} ${NOMCLABELS} --firstOrbit 0 --firstBC 0 --tpc-lanes $((NJOBS < 36 ? NJOBS : 36)) --shm-segment-size $SHMSIZE ${GLOBALDPLOPT} ${DIGITRDOPT}
73-
[ $SPLITTRDDIGI == "1" ] && taskwrapper digiTRD.log o2-sim-digitizer-workflow -n $NEvents ${NOMCLABELS} --firstOrbit 0 --firstBC 0 --onlyDet TRD --shm-segment-size $SHMSIZE ${GLOBALDPLOPT} --incontext collisioncontext.root ${DIGITRDOPTREAL}
72+
taskwrapper digi.log o2-sim-digitizer-workflow -n $NEvents --simPrefixQED qed/o2sim --qed-x-section-ratio ${QED2HAD} ${NOMCLABELS} --tpc-lanes $((NJOBS < 36 ? NJOBS : 36)) --shm-segment-size $SHMSIZE ${GLOBALDPLOPT} ${DIGITRDOPT}
73+
[ $SPLITTRDDIGI == "1" ] && taskwrapper digiTRD.log o2-sim-digitizer-workflow -n $NEvents ${NOMCLABELS} --onlyDet TRD --shm-segment-size $SHMSIZE ${GLOBALDPLOPT} --incontext collisioncontext.root ${DIGITRDOPTREAL}
7474
touch digiTRD.log_done
7575

7676
mkdir -p zdc
7777
cd zdc
7878
taskwrapper zdcsim.log o2-sim --seed $O2SIMSEED -n $NEvents -m PIPE ZDC --configKeyValues '"Diamond.width[2]=6.;SimCutParams.maxRTracking=50;"' -g pythia8hi -j $NJOBS
79-
taskwrapper digiZDC.log o2-sim-digitizer-workflow -n $NEvents ${NOMCLABELS} --firstOrbit 0 --firstBC 0 --onlyDet ZDC --shm-segment-size $SHMSIZE ${GLOBALDPLOPT} --incontext ../collisioncontext.root
79+
taskwrapper digiZDC.log o2-sim-digitizer-workflow -n $NEvents ${NOMCLABELS} --onlyDet ZDC --shm-segment-size $SHMSIZE ${GLOBALDPLOPT} --incontext ../collisioncontext.root
8080
cp zdcdigits.root ../
8181
cd ..
8282

0 commit comments

Comments
 (0)