35#include "GPUParam.inc"
41#define GPUSETTINGS_STANDALONE
42#define GPUSETTINGS_DISPLAY
52int32_t genEvents::GetSector(
double GlobalPhi)
54 double phi = GlobalPhi;
63 return (int32_t)(
phi / mSectorDAngle);
66int32_t genEvents::GetDSector(
double LocalPhi) {
return GetSector(LocalPhi + mSectorAngleOffset); }
68double genEvents::GetSectorAngle(int32_t
iSector) {
return mSectorAngleOffset +
iSector * mSectorDAngle; }
72 double phi = atan2(
t.GetY(),
t.GetX());
80 double dAlpha =
dSector * mSectorDAngle;
92double genEvents::GetGaus(
double sigma)
96 x = gRandom->Gaus(0., sigma);
97 if (fabs(
x) <= 3.5 * sigma) {
106 for (int32_t
i = 0;
i < 3;
i++) {
107 for (int32_t
j = 0;
j < 2;
j++) {
108 char name[1024], title[1024];
110 snprintf(
name, 1024,
"clError%s%d", (
j == 0 ?
"Y" :
"Z"),
i);
112 snprintf(title, 1024,
"Cluster %s Error for row region %d", (
j == 0 ?
"Y" :
"Z"),
i);
114 mClusterError[
i][
j] =
new TH1F(
name, title, 1000, 0., .7);
115 mClusterError[
i][
j]->GetXaxis()->SetTitle(
"Cluster Error [cm]");
118 mRec->rec()->DumpSettings(dir.c_str());
123 TFile* tout =
new TFile(
"generator.root",
"RECREATE");
124 TCanvas*
c =
new TCanvas(
"ClusterErrors",
"Cluste rErrors", 0, 0, 700, 700. * 2. / 3.);
127 for (int32_t
j = 0;
j < 2;
j++) {
128 for (int32_t
i = 0;
i < 3;
i++) {
138 mClusterError[k][
j]->Write();
141 mClusterError[k][
j]->Draw();
146 c->Print(
"plots/clusterErrors.pdf");
156 mRec->ClearIOPointers();
164 cout <<
"NTracks " << nTracks << endl;
165 std::vector<GPUTPCMCInfo> mcInfo(nTracks);
166 memset(mcInfo.data(), 0, nTracks *
sizeof(mcInfo[0]));
174 prop.SetPolynomialField(&
merger.Param().polynomialField);
179 std::vector<GenCluster> vClusters;
184 for (int32_t itr = 0; itr < nTracks; itr++) {
188 mcInfo[itr].pid = -100;
189 mcInfo[itr].charge = 1;
190 mcInfo[itr].prim = 1;
191 mcInfo[itr].primDaughters = 0;
200 double dphi = mTwoPi / nTracks;
201 double phi = mSectorAngleOffset + dphi * itr;
202 double eta = gRandom->Uniform(-1.5, 1.5);
204 double theta = 2 * std::atan(1. /
exp(eta));
205 double lambda = theta - M_PI / 2;
207 double pt = .08 * std::pow(10, gRandom->Uniform(0, 2.2));
214 double x0 = cosf(phi);
215 double y0 = sinf(phi);
216 double z0 = tanf(lambda);
217 t.Set(
x0,
y0, z0, pt *
x0, pt *
y0, pt * z0, q);
219 if (RecalculateSector(
t,
iSector) != 0) {
220 std::cout <<
"Initial sector wrong!!!" << std::endl;
224 for (
uint32_t iRow = 0; iRow < GPUTPCGeometry::NROWS; iRow++) {
226 float xRow = GPUTPCGeometry::Row2X(iRow);
229 for (int32_t itry = 0; itry < 1; itry++) {
231 prop.GetBxByBz(GetSectorAngle(
iSector),
t.GetX(),
t.GetY(),
t.GetZ(),
B);
233 err =
t.PropagateToXBxByBz(xRow,
B[0],
B[1],
B[2], dLp);
235 std::cout <<
"Can not propagate to x = " << xRow << std::endl;
239 if (fabsf(
t.GetZ()) >= GPUTPCGeometry::TPCLength()) {
240 std::cout <<
"Can not propagate to x = " << xRow <<
": Z outside the volume" << std::endl;
250 std::cout <<
"track " << itr <<
": new sector " <<
iSector <<
" at row " << iRow << std::endl;
263 tg.Rotate(-GetSectorAngle(
iSector));
266 mcInfo[itr].charge = 3 * q;
267 mcInfo[itr].x = tg.GetX();
268 mcInfo[itr].y = tg.GetY();
269 mcInfo[itr].z = tg.GetZ();
270 mcInfo[itr].pX = tg.GetPx();
271 mcInfo[itr].pY = tg.GetPy();
272 mcInfo[itr].pZ = tg.GetPz();
280 const int32_t rowType = iRow < 64 ? 0 : (iRow < 128 ? 2 : 1);
282 param.GetClusterErrors2(
iSector, rowType,
t.GetZ(),
t.GetSinPhi(),
t.GetDzDs(), -1.f, 0.f, 0.f, sigmaY, sigmaZ);
283 sigmaY = std::sqrt(sigmaY);
284 sigmaZ = std::sqrt(sigmaZ);
285 mClusterError[rowType][0]->Fill(sigmaY);
286 mClusterError[rowType][1]->Fill(sigmaZ);
294 c.y =
t.GetY() + GetGaus(sigmaY);
295 c.z =
t.GetZ() + GetGaus(sigmaZ);
297 vClusters.push_back(
c);
301 std::vector<AliHLTTPCClusterMCLabel>
labels;
314 mRec->mIOPtrs.nClusterData[
iSector] = nNumberOfHits;
320 GenCluster&
c = vClusters[
i];
330 for (int32_t
j = 0;
j < 3;
j++) {
336 labels.push_back(clusterLabel);
344 mRec->mIOPtrs.nMCLabelsTPC =
labels.size();
345 mRec->mIOPtrs.mcLabelsTPC =
labels.data();
347 mRec->mIOPtrs.nMCInfosTPC = mcInfo.size();
348 mRec->mIOPtrs.mcInfosTPC = mcInfo.data();
350 mRec->mIOPtrs.mcInfosTPCCol = &mcColInfo;
351 mRec->mIOPtrs.nMCInfosTPCCol = 1;
362 mkdir(dir.c_str(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
364 gen->InitEventGenerator(dir);
370 gen->FinishEventGenerator();
default_random_engine gen(dev())
uint64_t exp(uint64_t base, uint8_t exp) noexcept
#define GPUCA_EVDUMP_FILE
configStandalone Light OpenGL display display_light Apply smoothing to points Enable Z buffer Highlight links Highlight seeds Highlight sector tracks Highlight final tracks Show individual sector
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of< 0:reject at max -n hits") AddOptionRTC(rejectIFCLowRadiusCluster, uint8_t, 1, "", 0, "Reject clusters that get the IFC mask error during refit") AddOptionRTC(dEdxTruncLow, uint8_t, 2, "", 0, "Low truncation threshold, fraction of 128") AddOptionRTC(dEdxTruncHigh, uint8_t, 77, "", 0, "High truncation threshold, fraction of 128") AddOptionRTC(extrapolationTracking, int8_t, 1, "", 0, "Enable Extrapolation Tracking(prolong tracks to adjacent sectors to find short segments)") AddOptionRTC(disableRefitAttachment, uint8_t, 0, "", 0, "Bitmask to disable certain attachment steps during refit(1:attachment, 2:propagation, 4:loop following, 8:mirroring)") AddOptionRTC(rejectionStrategy, uint8_t, o2::gpu::GPUSettings::RejectionStrategyA, "", 0, "Enable rejection of TPC clusters for compression(0=no, 1=strategy A, 2=strategy B)") AddOptionRTC(mergeLoopersAfterburner, uint8_t, 1, "", 0, "Run afterburner for additional looper merging") AddOptionRTC(compressionTypeMask, uint8_t, o2::gpu::GPUSettings::CompressionFull, "", 0, "TPC Compression mode bits(1=truncate charge/width LSB, 2=differences, 4=track-model)") AddOptionRTC(compressionSortOrder, uint8_t, o2::gpu::GPUSettings::SortTime, "", 0, "Sort order of TPC compression(0=time, 1=pad, 2=Z-time-pad, 3=Z-pad-time, 4=no sorting(use incoming order))") AddOptionRTC(sigBitsCharge, uint8_t, 4, "", 0, "Number of significant bits for TPC cluster charge in compression mode 1") AddOptionRTC(sigBitsWidth, uint8_t, 3, "", 0, "Number of significant bits for TPC cluster width in compression mode 1") AddOptionRTC(dropLoopers, uint8_t, 0, "", 0, "Drop looping tracks starting from second loop") AddOptionRTC(mergerInterpolateErrors, uint8_t, 1, "", 0, "Use interpolation instead of extrapolation for chi2 based cluster rejection") AddOptionRTC(mergerInterpolateRejectAlsoOnCurrentPosition, uint8_t, 1, "", 0, "When using mergerInterpolateErrors, reject based on chi2 twice computed with interpolated and current track position starting from NDF > mergerNonInterpolateRejectMinNDF Merge tracks accross the central electrode Enable PID response Add sub threshold clusters in TPC dEdx computation OR mask of TPC flags that will reject the cluster in alternative dEdx Reject edge clusters based on uncorrected track Y during track fit Increase decrease removal by when on this number of pads from the edge h configStandalone Reconstruction rec_trd Max chi2 for TRD tracklets to be matched to a track Chi2 cut for strict matching mode Number of sigmas for ITS TPC track time error estimate Addition to search road around track prolongation along Y in cm Optimal tracklet rphi resolution in maximum chi2 per attached tracklet for TRD tracks take into account the full likelihood of the slope including exponential tails Tracks with less attached tracklets are discarded after the tracking Post trigger Pile up integration time in BCs fits all iterations but the last one in projections Use material lookup table for TPC refit Apply workarounds to avoid cyclic merge should not be needed tpc dyn configStandalone Processing proc_rtc Replace constant variables static by constexpr expressions Compile RTC in deterministic with NO_FAST_MATH flags and GPUCA_DETERMINISTIC_MODE define Use RTC to optimize GPU code h configStandalone Processing proc_rtctech Use a file lock to serialize access to the cache folder int32_t
configStandalone Reconstruction rec_tpc multiplier for the combined cluster track error during track following area in cm for the search of for z only used if decrease removal by when above this local occupancy rowx Shift of TPC revert cluster flag edge bit distance to edge exceeds this ZOffset for secondary multiple of radius max P of electron K BB bands crossing max P of electron p BB bands crossing max P of electron d BB bands crossing max P of electron t BB bands crossing min accepted dEdxMaxTPC of the track Additive extra cluster error for Y2 if edge flag set Additive extra cluster error for Y2 if single set Additive extra cluster error for Y2 if or single set Additive extra cluster error for Z2 if or single set Extra errors to add to track when crossing depending on addErrorsCECrossing Inner portion of y range in sector that is not used in searching for extrapolated track candidates factor2YS for track merging factor2K for track merging Margin in cm of Y position when rejecting edge clusters based on uncorrected track Y Max fraction of shared clusters for tracklet Except pad from cluster finding if total number of charges in a fragment is above this Except pad from cluster finding if number of consecutive charges in a fragment is above this Threshold where a timebin is considered disabling the noisy pad check for that pad Treat signal above this minimum as saturated Smoothing factor for the exponential Highly Ionising Particle tail filter Number of timebins to use for the averaging Add additional custom track errors when crossing relative as fraction of Do N fit passes in final fit of merger(must be odd to end with inward fit)") AddOptionRTC(trackFitRejectMode
std::vector< o2::MCCompLabel > labels
static constexpr int32_t NSECTORS
void InitEventGenerator(const std::string &dir)
int32_t GenerateEvent(const GPUParam §orParam, const char *filename)
void FinishEventGenerator()
static void RunEventGenerator(GPUChainTracking *rec, const std::string &dir)
GLuint const GLchar * name
GLuint GLfloat GLfloat y0
GPUSettingsStandalone configStandalone
float dSector(float phi, int nSectors=18, float sectorPhaseRad=0.f)
Fractional azimuthal position inside a periodic sector pattern.
std::string to_string(gsl::span< T, Size > span)
AliHLTTPCClusterMCWeight fClusterID[3]
std::vector< Cluster > clusters