BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnToCbmHitConverter.cxx
Go to the documentation of this file.
1
3
4#include "BmnMCInfoDst.h" // AZ-211125
5#include "BmnVSPHit.h" // AZ-060625
6#include "CbmMCTrack.h"
7#include "DigiRunHeader.h" // AZ-250726
8#include "DstEventHeader.h"
9#include "FairField.h"
10#include "FairRunAna.h"
11
12#include <TCanvas.h>
13#include <TDatabasePDG.h>
14#include <TFile.h>
15#include <TH2.h>
16#include <TKey.h>
17#include <TObjString.h>
18#include <TRandom.h>
19#include <TStopwatch.h>
20
21static Double_t workTime = 0.0;
22
23// ------ Default constructor -----------------------------------------
25 : BmnTask("BMN to CBM Hits Converter", 1)
26 , fBmnGemHitsBranchName("BmnGemStripHit")
27 , fBmnSilHitsBranchName("BmnSiliconHit")
28 , fBmnVspHitsBranchName("BmnVSPHit")
29 , fCbmHitsBranchName("StsHit")
30 //, fEffFile("")
31 , fBmnGemHitsArray(nullptr)
32 , fBmnGemUpperClusters(nullptr)
33 , fBmnGemLowerClusters(nullptr)
34 , fBmnSilHitsArray(nullptr)
35 , fBmnSilUpperClusters(nullptr)
36 , fBmnSilLowerClusters(nullptr)
37 , fBmnVspHitsArray(nullptr)
38 , fBmnVspUpperClusters(nullptr)
39 , fBmnVspLowerClusters(nullptr)
40 , fCbmHitsArray(nullptr)
41 , fGemConfigFile("GemRun8.xml")
42 , fSilConfigFile("SiliconRun8.xml")
43 , fVspConfigFile("")
44 , GemStationSet(nullptr)
45 , SilStationSet(nullptr)
46 , fVspStationSet(nullptr)
48 , fExp(kFALSE)
49 , fMCcorr(kTRUE)
53 , fPeriod(8)
54{
55 fEffFile[0] = fEffFile[1] = "";
56 fhLorCorX[0][0] = nullptr;
57}
58// -------------------------------------------------------------------------
59
60// ----- Standard constructor ------------------------------------------
61
63 : BmnTask("BMN to CBM Hits Converter", iVerbose)
64 , fBmnGemHitsBranchName("BmnGemStripHit")
65 , fBmnSilHitsBranchName("BmnSiliconHit")
66 , fBmnVspHitsBranchName("BmnVSPHit")
67 , fCbmHitsBranchName("StsHit")
68 //, fEffFile("")
69 , fBmnGemHitsArray(nullptr)
70 , fBmnGemUpperClusters(nullptr)
71 , fBmnGemLowerClusters(nullptr)
72 , fBmnSilHitsArray(nullptr)
73 , fBmnSilUpperClusters(nullptr)
74 , fBmnSilLowerClusters(nullptr)
75 , fBmnVspHitsArray(nullptr)
76 , fBmnVspUpperClusters(nullptr)
77 , fBmnVspLowerClusters(nullptr)
78 , fCbmHitsArray(nullptr)
79 , fGemConfigFile("GemRun8.xml")
80 , fSilConfigFile("SiliconRun8.xml")
81 , fVspConfigFile("")
82 , GemStationSet(nullptr)
83 , SilStationSet(nullptr)
84 , fVspStationSet(nullptr)
86 , fExp(isExp)
87 , fMCcorr(kTRUE)
91 , fPeriod(8)
92{
93 fEffFile[0] = fEffFile[1] = "";
94 fhLorCorX[0][0] = nullptr;
95}
96// -------------------------------------------------------------------------
97
98// ----- Destructor ----------------------------------------------------
100// -------------------------------------------------------------------------
101
102// ----- Public method Exec --------------------------------------------
104{
105
106 TStopwatch sw;
107 sw.Start();
108
109 if (!IsActive())
110 return;
111
112 fCbmHitsArray->Delete();
113
114 int nVspStat = (fVspStationSet) ? fVspStationSet->GetNStations() : 0; // AZ-070625
115
116 set<int> hitSet[19], killedSet[19]; // AZ-280526
117
118 if (fBmnGemHitsArray) {
119
120 for (Int_t iHit = 0; iHit < fBmnGemHitsArray->GetEntriesFast(); ++iHit) {
121 BmnGemStripHit* bmnHit = (BmnGemStripHit*)fBmnGemHitsArray->At(iHit);
122 if (bmnHit->IsPseudo())
123 continue; // AZ-180723 - exclude 1-dim hits (one-sided pseudo hit)
124
125 // if (bmnHit->GetRefIndex() == -1) continue;
126
127 // Section for hit filtration by signal asymmetry
128 // StripCluster* uc = (StripCluster*)fBmnGemUpperClusters->At(bmnHit->GetUpperClusterIndex());
129 // StripCluster* lc = (StripCluster*)fBmnGemLowerClusters->At(bmnHit->GetLowerClusterIndex());
130 // Float_t ls = lc->TotalSignal;
131 // Float_t us = uc->TotalSignal;
132 // if (us < ls - 1000 || us > ls + 1000) continue;
133 // if (Abs((us - ls) / (us + ls)) > 0.75) //asymmetry
134 // continue;
135
136 TVector3 pos;
137 bmnHit->Position(pos);
138 TVector3 dpos;
139 if (fUseFixedErrors) {
140 // dpos[0] = 0.08/TMath::Sqrt(12); //AZ
141 // dpos[1] = 0.1234; //AZ
142 dpos[0] = fDXgem; // 0.015; //AZ - as in cbmroot
143 dpos[1] = fDYgem; // 0.058; //AZ - as in cbmroot
144 } else {
145 bmnHit->PositionError(dpos);
146 }
147
148 Int_t stat = bmnHit->GetStation();
149 Int_t mod = bmnHit->GetModule();
150 // ElectronDriftDirectionInModule driftDir =
151 // GemStationSet->GetStation(stat)->GetModule(mod)->GetElectronDriftDirection(); //AZ-200322
152 // if (driftDir == BackwardZAxisEDrift) pos[2] -= 0.9; //AZ-200322
153 // if (driftDir == ForwardZAxisEDrift) pos[2] -= 0.9; //AZ-200322
154
155 Int_t lay = 0;
156 for (lay = 0; lay < GemStationSet->GetStation(stat)->GetModule(mod)->GetNStripLayers(); lay++) {
157 BmnGemStripLayer* layer = &(GemStationSet->GetStation(stat)->GetModule(mod)->GetStripLayer(lay));
158 if (layer->IsPointInsideStripLayer(-bmnHit->GetX(), bmnHit->GetY()))
159 break;
160 }
161 if (lay == GemStationSet->GetStation(stat)->GetModule(mod)->GetNStripLayers())
162 continue; // AZ-230322 - strange case //CHECK IT!!!
163
164 // formula for converting from the bm@n system of modules and layers to the cbm one
165 Int_t sect = 2 * mod + 1 + lay / 2;
166
167 Int_t sens = 1;
168
169 Int_t nSilStations = SilStationSet->GetNStations();
170 Int_t detId = kGEM << 24 | (stat + 1 + nVspStat + nSilStations) << 16 | sect << 4 | sens << 1;
171
172 new ((*fCbmHitsArray)[fCbmHitsArray->GetEntriesFast()]) CbmStsHit(detId, pos, dpos, 0.0, 0, 0);
173 CbmStsHit* hit = (CbmStsHit*)fCbmHitsArray->At(fCbmHitsArray->GetEntriesFast() - 1);
174 // Z-310726 - moved here from below
175 hit->SetRefIndex(bmnHit->GetRefIndex());
176 // AZ-071225 - Save track ID in hit (temporary fix)
177 if (hit->GetRefIndex() >= 0 && bmnHit->GetLink(0).GetEntry() < 0)
178 hit->SetStatLayer(bmnHit->GetDigitNumberMatch().GetLink(0).GetEntry() + 1);
179 if (fExp)
180 hit->SetRefIndex(
181 -iHit
182 - 1); // AZ-280726 - save index of the original BMN hit (negative to avoid complain from FairRoot)
183 int ista = hit->GetStationNr() - 1; // AZ-280526
184
185 // AZ-120223 - apply alignment
186 if (fExp && fAlignmentEnabled) {
187 if (fPeriod == 9)
188 ApplyAlignment9(hit);
189 else
190 ApplyAlignment(hit);
191 if (fieldFlag)
192 ApplyLorentzCorr(hit); // AZ-280826 - moved here from inside ApplyAlignment
193 } else if (fieldFlag && !fExp) {
194 // AZ-140824 - shift coordinates
195 hit->SetY(hit->GetY() + 0.30);
196 if (fMCcorr) {
197 int iq = 0, trid = -1;
198 Double_t pmom = -1, tx = 0, ty = 0;
199 if (bmnHit->GetRefIndex() >= 0) {
200 // Different smearing for negative tracks
201 // AZ-211125 FairMCPoint* mcp = (FairMCPoint*)fGemPoints->UncheckedAt(bmnHit->GetRefIndex());
202 // AZ-211125 CbmMCTrack* mctr = (CbmMCTrack*)fMCTracks->UncheckedAt(mcp->GetTrackID());
203 if (fGemPoints) {
204 FairMCPoint* mcp = (FairMCPoint*)fGemPoints->UncheckedAt(bmnHit->GetRefIndex());
205 trid = mcp->GetTrackID();
206 } else
207 trid = bmnHit->GetLink(0).GetEntry();
208 if (trid < 0)
209 trid =
210 bmnHit->GetDigitNumberMatch().GetLink(0).GetEntry(); //!!! AZ-071225 - temporary fix
211 CbmMCTrack* mctr = (CbmMCTrack*)fMCTracks->UncheckedAt(trid);
212 pmom = mctr->GetP();
213 TVector3 mom3;
214 mctr->GetMomentum(mom3);
215 // pxz = TMath::Sqrt (mom3.Px()*mom3.Px() + mom3.Pz()*mom3.Pz());
216 if (mom3.Pz() > 0.001) {
217 tx = mom3.Px() / mom3.Pz();
218 ty = mom3.Py() / mom3.Pz();
219 }
220 if (TDatabasePDG::Instance()->GetParticle(mctr->GetPdgCode()))
221 iq = TMath::Nint(TDatabasePDG::Instance()->GetParticle(mctr->GetPdgCode())->Charge() / 3);
222 }
223 // Correct MC hit
224 CorrectHitMC(hit, pmom, iq);
225 if (iq == 0)
226 iq = 1; // for backward compatibility
227 hitSet[ista].insert(fCbmHitsArray->GetEntriesFast() - 1); // AZ-280526
228
229 if (fEffCorr) { // AZ-141225
230 Bool_t ok =
231 CorrectEffic(hit, iq, tx, ty, pmom, 0); // efficiency correction in coordinate space
232 // Bool_t ok = CorrectEffic(hit, 1); // AZ-060126 - w/out sign consideration
233 // if (ok) ok = CorrectEffic (hit, iq, tx, pmom, 1); // efficiency correction in momentum
234 // space
235 if (!ok) {
236 // Remove hit
237 // AZ-280526 fCbmHitsArray->RemoveLast();
238 // cout << " Remove hit " << trid << " " << iq << endl;
239 killedSet[ista].insert(fCbmHitsArray->GetEntriesFast() - 1); // AZ-280526
240 // AZ-280526 continue;
241 }
242 }
243 } // if (fMCcorr)
244 }
245
246 FairRootManager::Instance()->SetUseFairLinks(kTRUE);
247 hit->ResetLinks();
248 hit->SetLinks(bmnHit->GetLinks());
249 /* AZ-211125 - Save track ID in hit
250 if (bmnHit->GetRefIndex() < 0) hit->SetLinks(bmnHit->GetLinks());
251 else {
252 set<FairLink> links = bmnHit->GetLinks();
253 FairMCPoint* mcp = (FairMCPoint*)fGemPoints->UncheckedAt(bmnHit->GetRefIndex());
254
255 for (int jl = 0; jl < bmnHit->GetNLinks(); ++jl) {
256 FairLink lnk = bmnHit->GetLink (jl);
257 if (jl == 0) lnk.SetEntry (mcp->GetTrackID());
258 hit->AddLink (lnk);
259 }
260 } */
261 FairRootManager::Instance()->SetUseFairLinks(kFALSE);
262 /* AZ-310726 - moved up
263 hit->SetRefIndex(bmnHit->GetRefIndex());
264 // AZ-071225 - Save track ID in hit (temporary fix)
265 if (hit->GetRefIndex() >= 0 && bmnHit->GetLink(0).GetEntry() < 0)
266 hit->SetStatLayer(bmnHit->GetDigitNumberMatch().GetLink(0).GetEntry() + 1);
267 if (fExp) hit->SetRefIndex(-iHit-1); // AZ-280726 - save index of the original BMN hit (negative to avoid
268 complain from FairRoot)
269 */
270 hit->fDigiF = bmnHit->GetLowerClusterIndex() + 0; // AZ-250322
271 hit->fDigiB = bmnHit->GetUpperClusterIndex() + 1000000; // AZ-250322
272 // AZ-221022
273 StripCluster* upp = (StripCluster*)fBmnGemUpperClusters->UncheckedAt(hit->fDigiB % 1000000);
274 StripCluster* low = (StripCluster*)fBmnGemLowerClusters->UncheckedAt(hit->fDigiF % 1000000);
275 Double_t uppq = upp->TotalSignal;
276 Double_t lowq = low->TotalSignal;
277 Double_t corrq = (uppq - lowq) / (uppq + lowq);
278 hit->SetSignalDiv(corrq);
279 uppq = upp->Width; // N of strips
280 lowq = low->Width;
281 corrq = (uppq - lowq) / (uppq + lowq);
282 hit->SetTimeStamp(corrq); // just using available space
283 hit->SetStrips(low->MeanPosition, upp->MeanPosition); // AZ-190823
284 // hit->SetWidths (low->Width, upp->Width); //AZ-190823
285 } // for (Int_t iHit = 0; iHit < fBmnGemHitsArray->GetEntriesFast();
286 }
287
288 if (fBmnSilHitsArray) {
289 for (Int_t iHit = 0; iHit < fBmnSilHitsArray->GetEntriesFast(); ++iHit) {
290 BmnSiliconHit* bmnHit = (BmnSiliconHit*)fBmnSilHitsArray->At(iHit);
291 if (bmnHit->IsPseudo())
292 continue; // AZ-180723 - exclude 1-dim hits (one-sided pseudo hit)
293 // if (bmnHit->GetRefIndex() == -1) continue;
294 // Section for hit filtration by signal asymmetry
295 // StripCluster* uc = (StripCluster*)fBmnSilUpperClusters->At(bmnHit->GetUpperClusterIndex());
296 // StripCluster* lc = (StripCluster*)fBmnSilLowerClusters->At(bmnHit->GetLowerClusterIndex());
297 // Float_t ls = lc->TotalSignal;
298 // Float_t us = uc->TotalSignal;
299 // if (us < ls - 1000 || us > ls + 1000) continue;
300 // if (Abs((us - ls) / (us + ls)) > 0.75) //asymmetry
301 // continue;
302
303 TVector3 pos;
304 bmnHit->Position(pos);
305 pos[2] -= 0.0150; // AZ - shift to the entrance
306 TVector3 dpos;
307 if (fUseFixedErrors) {
308 dpos[0] = fDXsil; // 0.01 / TMath::Sqrt(12); //AZ
309 // dpos[1] = 0.1234; //AZ
310 dpos[1] = fDYsil; // 0.021; //AZ - as in cbmroot
311 } else {
312 bmnHit->PositionError(dpos);
313 }
314
315 Int_t sens = 1;
316 Int_t detId = kSILICON << 24 | (bmnHit->GetStation() + nVspStat + 1) << 16 | (bmnHit->GetModule() + 1) << 4
317 | sens << 1;
318 new ((*fCbmHitsArray)[fCbmHitsArray->GetEntriesFast()]) CbmStsHit(detId, pos, dpos, 0.0, 0, 0);
319 CbmStsHit* hit = (CbmStsHit*)fCbmHitsArray->At(fCbmHitsArray->GetEntriesFast() - 1);
320 // AZ-310726 - moved here from below
321 hit->SetRefIndex(bmnHit->GetRefIndex());
322 // AZ-071225 - Save track ID in hit (temporary fix)
323 if (hit->GetRefIndex() >= 0 && bmnHit->GetLink(0).GetEntry() < 0)
324 hit->SetStatLayer(bmnHit->GetDigitNumberMatch().GetLink(0).GetEntry() + 1);
325 if (fExp)
326 hit->SetRefIndex(
327 -iHit
328 - 1); // AZ-280726 - save index of the original BMN hit (negative to avoid complain from FairRoot)
329 int ista = hit->GetStationNr() - 1; // AZ-280526
330
331 if (fExp && fAlignmentEnabled) {
332 // AZ-120223 - alignment
333 if (fPeriod == 9)
334 ApplyAlignment9(hit);
335 else
336 ApplyAlignment(hit);
337 if (fieldFlag)
338 ApplyLorentzCorr(hit); // AZ-280826 - moved here from inside ApplyAlignment
339 } else if (!fExp) {
340 // AZ-140824 - shift coordinates
341 hit->SetY(hit->GetY() + 0.30);
342 if (fMCcorr) {
343 int iq = 0, trid = -1;
344 Double_t pmom = -1, tx = 0, ty = 0;
345 if (bmnHit->GetRefIndex() >= 0) {
346 // AZ-211125 FairMCPoint* mcp = (FairMCPoint*)fSilPoints->UncheckedAt(bmnHit->GetRefIndex());
347 // AZ-211125 CbmMCTrack* mctr = (CbmMCTrack*)fMCTracks->UncheckedAt(mcp->GetTrackID());
348 if (fSilPoints) {
349 FairMCPoint* mcp = (FairMCPoint*)fSilPoints->UncheckedAt(bmnHit->GetRefIndex());
350 trid = mcp->GetTrackID();
351 } else
352 trid = bmnHit->GetLink(0).GetEntry();
353 if (trid < 0)
354 trid =
355 bmnHit->GetDigitNumberMatch().GetLink(0).GetEntry(); //!!! AZ-071225 - temporary fix
356 CbmMCTrack* mctr = (CbmMCTrack*)fMCTracks->UncheckedAt(trid);
357 pmom = mctr->GetP();
358 TVector3 mom3;
359 mctr->GetMomentum(mom3);
360 // pxz = TMath::Sqrt (mom3.Px()*mom3.Px() + mom3.Pz()*mom3.Pz());
361 if (mom3.Pz() > 0.001) {
362 tx = mom3.Px() / mom3.Pz();
363 ty = mom3.Py() / mom3.Pz();
364 }
365 if (TDatabasePDG::Instance()->GetParticle(mctr->GetPdgCode()))
366 iq = TMath::Nint(TDatabasePDG::Instance()->GetParticle(mctr->GetPdgCode())->Charge() / 3);
367 }
368 // Correct MC hit
369 CorrectHitMC(hit, pmom, iq);
370 if (iq == 0)
371 iq = 1; // for backward compatibility
372 hitSet[ista].insert(fCbmHitsArray->GetEntriesFast() - 1); // AZ-280526
373
374 if (fEffCorr) { // AZ-141225
375 Bool_t ok =
376 CorrectEffic(hit, iq, tx, ty, pmom, 0); // efficiency correction in coordinate space
377 // Bool_t ok = CorrectEffic (hit, 1); // AZ-060126 - w/out sign consideration
378 // if (ok) ok = CorrectEffic (hit, iq, tx, pmom, 1); // efficiency correction in momentum
379 // space
380 if (!ok) {
381 // Remove hit
382 // AZ-280526 fCbmHitsArray->RemoveLast();
383 // AZ-280526 continue;
384 killedSet[ista].insert(fCbmHitsArray->GetEntriesFast() - 1); // AZ-280526
385 }
386 }
387 } // if (fMCcorr)
388 }
389 FairRootManager::Instance()->SetUseFairLinks(kTRUE);
390 hit->ResetLinks();
391 hit->SetLinks(bmnHit->GetLinks());
392 /* AZ-211125 - Save track ID in hit
393 if (bmnHit->GetRefIndex() < 0) hit->SetLinks(bmnHit->GetLinks());
394 else {
395 set<FairLink> links = bmnHit->GetLinks();
396 FairMCPoint* mcp = (FairMCPoint*)fSilPoints->UncheckedAt(bmnHit->GetRefIndex());
397
398 for (int jl = 0; jl < bmnHit->GetNLinks(); ++jl) {
399 FairLink lnk = bmnHit->GetLink (jl);
400 if (jl == 0) lnk.SetEntry (mcp->GetTrackID());
401 hit->AddLink (lnk);
402 }
403 } */
404 FairRootManager::Instance()->SetUseFairLinks(kFALSE);
405 /* AZ-310726 - moved up
406 hit->SetRefIndex(bmnHit->GetRefIndex());
407 // AZ-071225 - Save track ID in hit (tempprary fix)
408 if (hit->GetRefIndex() >= 0 && bmnHit->GetLink(0).GetEntry() < 0)
409 hit->SetStatLayer(bmnHit->GetDigitNumberMatch().GetLink(0).GetEntry() + 1);
410 if (fExp) hit->SetRefIndex(-iHit-1); // AZ-280726 - save index of the original BMN hit (negative to avoid
411 complain from FairRoot)
412 */
413 // AZ-201125
414 /*
415 for (int jjj = 0; jjj < hit->GetNLinks(); ++jjj) {
416 FairLink lnk = hit->GetLink (jjj);
417 lnk.PrintLinkInfo();
418 cout << " zzz " << hit->GetNLinks() << " " << hit->GetRefIndex() << " " << jjj << endl;
419 }
420 */
421 // AZ-201125
422 hit->fDigiF =
423 bmnHit->GetLowerClusterIndex() + 2000000; //!!!AZ - for VectorFinder (to have unique indices) - 260322
424 hit->fDigiB =
425 bmnHit->GetUpperClusterIndex() + 3000000; //!!!AZ - for VectorFinder (to have unique indices) - 260322
426 // AZ-221022
427 StripCluster* upp = (StripCluster*)fBmnSilUpperClusters->UncheckedAt(hit->fDigiB % 1000000);
428 StripCluster* low = (StripCluster*)fBmnSilLowerClusters->UncheckedAt(hit->fDigiF % 1000000);
429 Double_t uppq = upp->TotalSignal;
430 Double_t lowq = low->TotalSignal;
431 Double_t corrq = (uppq - lowq) / (uppq + lowq);
432 hit->SetSignalDiv(corrq);
433 uppq = upp->Width; // N of strips
434 lowq = low->Width;
435 corrq = (uppq - lowq) / (uppq + lowq);
436 hit->SetTimeStamp(corrq); // just using available space
437 hit->SetStrips(low->MeanPosition, upp->MeanPosition); // AZ-190823
438 // hit->SetWidths (low->Width, upp->Width); //AZ-190823
439 } // for (Int_t iHit = 0; iHit < fBmnSilHitsArray->GetEntriesFast();
440 } // if (fBmnSilHitsArray)
441
443 AddVspHits(); // AZ-060625
444
445 // AZ-280526 - remove hits
446 if (!fExp)
447 KillHits(hitSet, killedSet);
448
449 sw.Stop();
450 workTime += sw.RealTime();
451}
452// -------------------------------------------------------------------------
453
454// ----- Private method Init -------------------------------------------
456{
457
458 // Get input array
459 FairRootManager* ioman = FairRootManager::Instance();
460 if (!ioman)
461 Fatal("Init", "No FairRootManager");
465
466 fBmnGemLowerClusters = (TClonesArray*)ioman->GetObject("BmnGemLowerCluster");
467 fBmnGemUpperClusters = (TClonesArray*)ioman->GetObject("BmnGemUpperCluster");
468 fBmnSilLowerClusters = (TClonesArray*)ioman->GetObject("BmnSiliconLowerCluster");
469 fBmnSilUpperClusters = (TClonesArray*)ioman->GetObject("BmnSiliconUpperCluster");
470 fBmnVspLowerClusters = (TClonesArray*)ioman->GetObject("BmnVSPLowerCluster");
471 fBmnVspUpperClusters = (TClonesArray*)ioman->GetObject("BmnVSPUpperCluster");
473 cout << "BmnToCbmHitConverter::Init(): branches with inner hits not found! Task will be deactivated" << endl;
474 SetActive(kFALSE);
475 return kERROR;
476 }
477 fGemPoints = (TClonesArray*)ioman->GetObject("StsPoint");
478 fSilPoints = (TClonesArray*)ioman->GetObject("SiliconPoint");
479 fVspPoints = (TClonesArray*)ioman->GetObject("VSPPoint"); // AZ-251125
480 fMCTracks = (TClonesArray*)ioman->GetObject("MCTrack");
481 if (fMCTracks == nullptr) { // AZ-211125
482 BmnMCInfoDst* mcInfo = (BmnMCInfoDst*)ioman->GetObject("BmnMCInfo.");
483 if (mcInfo)
484 fMCTracks = mcInfo->GetMCTracks();
485 }
486
487 // Register output array
488 fCbmHitsArray = new TClonesArray("CbmStsHit");
489 ioman->Register("StsHit", "STSHIT", fCbmHitsArray, kTRUE);
490
491 TString gPathConfig = gSystem->Getenv("VMCWORKDIR");
492
493 // Create GEM detector ------------------------------------------------------
494 GemStationSet = new BmnGemStripStationSet(gPathConfig + "/parameters/gem/XMLConfigs/" + fGemConfigFile);
495 SilStationSet = new BmnSiliconStationSet(gPathConfig + "/parameters/silicon/XMLConfigs/" + fSilConfigFile);
496 if (fVspConfigFile != "")
497 fVspStationSet = new BmnVSPStationSet(gPathConfig + "/parameters/vsp/XMLConfigs/" + fVspConfigFile);
498
499 FairField* mField = FairRunAna::Instance()->GetField();
500 fieldFlag = (TMath::Abs(mField->GetBy(0, 0, 135)) > 0.5) ? kTRUE : kFALSE;
501
502 auto digiRunHeader = static_cast<DigiRunHeader*>(ioman->GetInFile()->Get("DigiRunHeader"));
503 if (digiRunHeader)
504 fPeriod = digiRunHeader->GetPeriodId();
505
506 return kSUCCESS;
507}
508// -------------------------------------------------------------------------
509
510void BmnToCbmHitConverter::OnlineWrite(const std::unique_ptr<TTree>& resultTree)
511{
512 if (!IsActive())
513 return;
514
515 resultTree->Branch("StsHit", &fCbmHitsArray);
516 resultTree->Fill();
517}
518
519// -------------------------------------------------------------------------
520
522{
524 fDXgem = dXgem;
525 fDYgem = dYgem;
526 fDXsil = dXsil;
527 fDYsil = dYsil;
528}
529
530// -------------------------------------------------------------------------
531
533{
534 printf("Work time of BmnToCbmHitConverter: %4.2f sec.\n", workTime);
535}
536
537// -------------------------------------------------------------------------
538
540{
541 // AZ-120223 - apply alignment
542
543 // AZ-070223 - alignment parameters from Igor
544 // /home/ruf/NICA/bmnroot230107
545 // /data4/ruf/Run8raw/7759/00/runAll.sh
546 // GEM: xhit-=StsDX[station][sector], yhit-=StsDY[station][sector], zhit+=GemDZ10[station-4][sector/2]
547 // Si: xhit-= SiDX[stn][sct]; yhit-= SiDY[stn][sct]; zhit+=SiDZ[stn][sct];
548
549 const Int_t MStn = 11 /*, NSct[MStn] = { 6,10,14,18, 8,8,8,8,8,8,8 }*/;
550 /*Double_t StsZ[MStn][18] = {
551 {19.3535, 20.5035, 19.2535, 16.2435, 15.0335, 16.4235},
552 {29.406, 28.231, 29.401, 28.086, 29.256, 23.807, 24.977, 23.827, 25.112, 23.892},
553 {36.9615, 38.1615, 36.8915, 38.1315, 36.8215, 37.9965, 36.8515, 33.534, 32.364, 33.519, 32.344, 33.709, 32.524, 33.719},
554 {46.788, 45.583, 46.733, 45.588, 46.773, 45.438, 46.613, 45.433, 46.618, 41.217, 42.342, 41.212, 42.367, 41.222, 42.512,
555 41.342, 42.467, 41.312}, {65.61, 65.61, 65.61, 65.61, 60.91, 60.91, 60.91, 60.91},
556 {92.392, 92.392, 92.392, 92.392, 97.092, 97.092, 97.092, 97.092},
557 {128.362, 128.362, 128.362, 128.362, 123.662, 123.662, 123.662, 123.662},
558 {154.842, 154.842, 154.842, 154.842, 159.542, 159.542, 159.542, 159.542},
559 {190.839, 190.839, 190.839, 190.839, 186.139, 186.139, 186.139, 186.139},
560 {217.437, 217.437, 217.437, 217.437, 222.137, 222.137, 222.137, 222.137},
561 {253.251, 253.251, 253.251, 253.251, 248.551, 248.551, 248.551, 248.551} };
562 */
563 double GemDZ10[7][4] = {{0.243654, 0.250775, 0.173749, 0.161366}, // for [station][Quater]
564 {-0.143876, -0.150758, 0.109959, 0.156433}, // same values from GEM-6 base
565 {-0.110145, -0.165981, -0.213889, -0.229543},
566 {0.103517, 0.036342, 0.086135, 0.0941369},
567 {-0.037648, -0.0941807, -0.180758, -0.176327},
568 {-0.0674491, -0.0367844, -0.0972473, -0.0584354},
569 {0, 0, 0, 0}};
570
571 // CbmStsHit: hit-track. Shifts of intermediate GEM stations with respect of first and last GEMs
572 Double_t StsDX[MStn][8] = {
573 {0., 0., 0., 0., 0., 0., 0., 0.},
574 {0., 0., 0., 0., 0., 0., 0., 0.},
575 {0., 0., 0., 0., 0., 0., 0., 0.},
576 {0., 0., 0., 0., 0., 0., 0., 0.},
577 {2.28613e-01, 2.34606e-01, 3.70449e-01, 4.39267e-01, 2.67664e-01, 2.84859e-01, 3.41005e-01, 4.16753e-01},
578 {3.17030e-01, 2.45618e-01, 4.29878e-01, 4.29169e-01, 2.60443e-01, 1.79925e-01, 3.76252e-01, 3.71674e-01},
579 {1.25543e-01, 1.37935e-01, 2.77096e-01, 3.51704e-01, 2.16012e-01, 2.12139e-01, 2.88912e-01, 3.57699e-01},
580 {3.17647e-01, 2.36295e-01, 3.75431e-01, 3.80575e-01, 1.68884e-01, 8.80524e-02, 2.51805e-01, 2.56513e-01},
581 {-3.01883e-02, -2.87880e-02, 1.09744e-01, 1.90429e-01, 1.78162e-02, 1.32671e-02, 9.23760e-02, 1.67779e-01},
582 {1.43966e-01, 5.53303e-02, 2.48555e-01, 2.49193e-01, 3.88544e-02, -3.31393e-02, 7.96085e-02, 7.41273e-02},
583 {0., -5.63645e-04, 0.05, 8.74027e-04, 0., 3.60763e-03, 0.074, 1.49797e-01}};
584 Double_t StsDY[MStn][8] = {
585 {0., 0., 0., 0., 0., 0., 0., 0.},
586 {0., 0., 0., 0., 0., 0., 0., 0.},
587 {0., 0., 0., 0., 0., 0., 0., 0.},
588 {0., 0., 0., 0., 0., 0., 0., 0.},
589 {-2.40830e-01, -2.27117e-01, -4.41393e-01, -2.98662e-01, -1.47376e-01, -5.64919e-01, 3.60250e-02, -2.15290e-01},
590 {-4.83443e-01, -3.63780e-01, -3.52015e-01, -3.36903e-01, -1.14008e-01, -3.49136e-01, -2.14579e-01,
591 -6.23524e-01},
592 {-1.91062e-01, -2.04515e-01, -3.79972e-01, -2.57092e-01, -1.01400e-01, -5.18137e-01, 5.39497e-02, -1.85679e-01},
593 {-4.55871e-01, -3.48696e-01, -2.33191e-01, -2.40044e-01, -5.37329e-02, -3.00596e-01, -1.98740e-01,
594 -6.04983e-01},
595 {-2.31062e-01, -2.58276e-01, -4.03759e-01, -2.70196e-01, -8.53213e-02, -5.14891e-01, 3.15495e-02, -2.08464e-01},
596 {-2.58821e-01, -1.58621e-01, -9.84743e-02, -1.05756e-01, 1.54258e-01, -1.04935e-01, 1.83280e-02, -3.86622e-01},
597 {0., -5.86937e-03, -0.23, -1.45342e-01, 0., -3.98117e-01, 0.15, -1.04839e-01}};
598
599 Double_t SiDX[4][18] = {{2.68835e-01, 2.39831e-01, 2.52506e-01, 2.05206e-01, 2.11052e-01, 0.20737190, 0, 0, 0, 0, 0,
600 0, 0, 0, 0, 0, 0, 0},
601 {3.15120e-01, 2.74671e-01, 2.55372e-01, 2.83446e-01, 2.79317e-01, 3.48623e-01, 3.18654e-01,
602 3.00181e-01, 3.16157e-01, 3.80363e-01, 0, 0, 0, 0, 0, 0, 0, 0},
603 {1.65037e-01, 2.71806e-01, 2.66914e-01, 2.40166e-01, 2.59614e-01, 2.66288e-01, 2.83516e-01,
604 2.88311e-01, 2.61280e-01, 3.02609e-01, 2.96469e-01, 2.98769e-01, 2.66650e-01, 3.72627e-01,
605 0, 0, 0, 0},
606 {3.01013e-01, 3.62381e-01, 3.03249e-01, 3.06502e-01, 2.75747e-01, 2.95530e-01, 3.05152e-01,
607 3.42706e-01, 3.09787e-01, 2.24795e-01, 2.31845e-01, 2.59297e-01, 2.17342e-01, 2.20424e-01,
608 2.06861e-01, 2.49563e-01, 2.64846e-01, 2.02358e-01}};
609 Double_t SiDY[4][18] = {
610 {-0.272688, -0.300649, -0.343639, -0.313878, -0.331129, -0.299529, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
611 {-0.342847, -0.343267, -0.328436, -0.354188, -0.332445, -0.349645, -0.332025, -0.294098, -0.249696, -0.217585,
612 0, 0, 0, 0, 0, 0, 0, 0},
613 {-0.398784, -0.342968, -0.325462, -0.325316, -0.338778, -0.338966, -0.324549, -0.339105, -0.314266, -0.301756,
614 -0.288295, -0.272864, -0.272913, -0.21294, 0, 0, 0, 0},
615 {-0.269827, -0.227419, -0.295412, -0.274608, -0.322856, -0.33417, -0.361013, -0.397192, -0.368905, -0.217688,
616 -0.240085, -0.266281, -0.285738, -0.269306, -0.292405, -0.297714, -0.323987, -0.379705}};
617 Double_t SiDZ[4][18] = {
618 {-0.4, -0.3, -0.23, -0.27, -0.3, -0.23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
619 {-0.5, -0.4, -0.4, -0.28, -0.25, -0.45, -0.45, -0.3, -0.23, -0.2, 0, 0, 0, 0, 0, 0, 0, 0},
620 {-0.3, -0.5, -0.45, -0.4, -0.3, -0.2, -0.2, -0.25, -0.2, -0.3, -0.3, -0.4, -0.5, -0.27, 0, 0, 0, 0},
621 {-0.5, -0.6, -0.4, -0.5, -0.3, -0.35, -0.2, -0.1, -0.4, -0.6, -0.6, -0.6, -0.5, -0.35, -0.2, -0.1, 0.1, 0.}};
622
623 // AZ-090223 - Si module rotations around OZ (dx = p0 + p1*y)
624 const Double_t p0si[4][18] = {{3.865e-2, 6.497e-2, 3.848e-2, -3.535e-2, -2.711e-2, -4.438e-2}, // st1
625 {-3.011e-2, -6.724e-3, -2.784e-2, -1.761e-2, -1.431e-2, 2.650e-2, 1.818e-2, 1.052e-2,
626 1.510e-2, 1.977e-2}, // st2
627 {-1.639e-2, -1.628e-2, -4.100e-2, -2.524e-2, -2.082e-2, -3.096e-3, -1.535e-2,
628 -1.594e-2, 1.974e-2, 1.212e-2, 1.859e-2, 3.067e-2, 2.477e-2, -3.289e-3}, // st3
629 {5.774e-2, 5.280e-2, 4.679e-2, 6.866e-2, 6.183e-2, 4.256e-2, 4.247e-2, -5.477e-3,
630 2.597e-2, 1.403e-2, -2.016e-2, -3.445e-2, -3.345e-2, -3.685e-2, -4.381e-2, -6.655e-2,
631 -2.791e-2, -4.438e-2}};
632 const Double_t p1si[4][18] = {
633 {-8.887e-3, -1.128e-2, -6.696e-3, -1.042e-2, -7.374e-3, -1.303e-2}, // st1
634 {4.338e-3, 8.247e-4, 3.374e-3, 1.151e-3, 1.616e-3, 7.210e-3, 3.103e-3, 1.564e-3, 2.896e-3, 5.346e-3}, // st2
635 {3.678e-3, 1.777e-3, 4.869e-3, 2.708e-3, 2.610e-3, 4.911e-4, 2.753e-3, -2.473e-3, 3.427e-3, 1.598e-3, 2.388e-3,
636 3.975e-3, 3.602e-3, 1.143e-3}, // st3
637 {-4.152e-3, -6.035e-3, -4.377e-3, -6.320e-3, -5.058e-3, -3.510e-3, -3.763e-3, 4.285e-4, -5.000e-3, 1.801e-3,
638 -3.673e-3, -3.629e-3, -3.629e-3, -3.660e-3, -4.075e-3, -7.053e-3, -4.439e-3, -6.091e-3}};
639 // Second iteration
640 const Double_t p10si[4][18] = {{-2.385e-3, 6.372e-4, 8.679e-4, -2.758e-3, -5.495e-3, -4.838e-3}, // st1
641 {-3.930e-3, 2.765e-3, -3.730e-4, -5.525e-4, 1.433e-3, 1.042e-3, 2.216e-3, 3.619e-3,
642 1.800e-3, 1.076e-3}, // st2
643 {2.693e-3, 2.794e-3, -4.447e-3, -3.237e-4, 8.975e-4, 8.401e-4, -2.997e-3, -3.868e-3,
644 2.667e-3, -6.283e-4, 3.312e-3, 3.420e-3, 5.233e-3, -4.670e-3}, // st3
645 {7.950e-3, 2.818e-3, -1.178e-3, 3.522e-3, -1.457e-4, -2.013e-3, 3.139e-3, -1.060e-2,
646 -5.446e-3, 4.349e-3, 9.024e-4, -1.297e-3, -2.652e-3, -7.524e-3, -4.564e-3,
647 -9.118e-3, 8.307e-3, -5.750e-3}};
648 const Double_t p11si[4][18] = {
649 {3.525e-4, 4.803e-5, -4.898e-4, -5.709e-4, -1.111e-3, -1.295e-3}, // st1
650 {5.953e-4, -4.350e-4, 6.053e-5, 4.750e-5, 1.259e-4, 6.429e-4, 2.556e-4, 3.749e-4, 1.500e-4, 7.110e-4}, // st2
651 {1.719e-5, -3.435e-4, 6.088e-4, 1.112e-4, 2.683e-4, -6.623e-5, 4.340e-4, -6.263e-4, 4.717e-4, -1.268e-4,
652 4.721e-4, 5.582e-4, 6.571e-4, -4.956e-4}, // st3
653 {-4.333e-4, -3.287e-4, -7.432e-6, -4.067e-4, -6.684e-5, 3.667e-5, -4.441e-4, 8.977e-4, 7.495e-4, 5.340e-4,
654 -1.572e-4, -5.901e-5, -3.272e-4, -6.975e-4, -3.440e-4, -9.403e-4, 5.092e-4, -1.083e-3}};
655 // AZ-120223 - extra dZ-shifts of GEMs
656 /*Double_t dzAZ[9][4] = {{0.40,0.45,0.00,0.00}, {0.05,0.05,0.35,0.35}, {-0.15,-0.15,-0.30,-0.30},
657 {0.18,0.18,0.30,0.30}, {0.05,0.05,0.00,0.00}, {0.05,0.05,0.08,0.08},
658 {-0.15,-0.15,0.00,0.00}, {0}, {0}}; */
659
660 // AZ-260726 static TH2D *hLorCorX[2][17] = {{nullptr}, {nullptr}}, *hLorCorY[2][17] = {{nullptr}, {nullptr}};
661 static int irun = -1;
662 static Double_t zStat[19] = {-99, 0};
663
664 if (irun <= 0)
665 irun = ((DstEventHeader*)FairRootManager::Instance()->GetObject("DstEventHeader."))->GetRunId(); // AZ-010723
666 if (irun <= 0)
667 return;
668
669 if (fhLorCorX[0][0] == nullptr) {
670 fhLorCorX[0][0] = (TH2D*)0x1;
671 FillLorentzHistos(irun); // AZ-260726 - fill histos with Lorentz corrections
672 }
673
674 if (zStat[0] < 0) { // AZ-310826
675 // Station Z-positions
676 int nsta = SilStationSet->GetNStations();
677 for (int ista = 0; ista < nsta; ++ista)
678 zStat[ista] = SilStationSet->GetZStationPosition(ista);
679 int nsta1 = GemStationSet->GetNStations();
680 for (int ista = 0; ista < nsta1; ++ista)
681 zStat[ista + nsta] = GemStationSet->GetZStationPosition(ista);
682 if (fVerbose > 0)
683 for (int j = 0; j < nsta + nsta1; ++j)
684 cout << " Stat: " << j << " " << zStat[j] << endl;
685 }
686
687 int ista = hit->GetStationNr() - 1;
688 int isec = hit->GetSectorNr() - 1;
689
690 if (hit->GetSystemId() != kGEM) {
691 // if (0) {
692 // AZ-070223 - alignment
693 hit->SetX(hit->GetX() - SiDX[ista][isec]);
694 hit->SetY(hit->GetY() - SiDY[ista][isec]);
695 hit->SetZ(hit->GetZ() + SiDZ[ista][isec]);
696 // AZ-090223 - Si rotation around Z-axis (w/out changing Y-coordinate)
697 hit->SetX(hit->GetX()
698 - (p0si[ista][isec] / 2 + p1si[ista][isec] / 2 * hit->GetY() + p10si[ista][isec]
699 + p11si[ista][isec] * hit->GetY()));
700 }
701 // AZ-110223
702 if (hit->GetSystemId() == kGEM) {
703 // if (0) {
704 // AZ-070223 - apply alignment (from Igor)
705 hit->SetX(hit->GetX() - StsDX[ista][isec]);
706 hit->SetY(hit->GetY() - StsDY[ista][isec]);
707 hit->SetZ(hit->GetZ() + GemDZ10[ista - 4][isec / 2]);
708
709 // hit->SetZ(hit->GetZ() + dzAZ[ista - 4][isec / 2]);
710 // 2 missed strips
711 if (ista == 4 && isec == 3) {
712 if (hit->GetX() >= -28.8 && hit->GetX() < -18.5) {
713 hit->SetX(hit->GetX() - 0.16);
714 hit->SetY(hit->GetY() - 0.16 / TMath::Tan(15.0 * TMath::DegToRad()));
715 }
716 }
717
718 // AZ-280223 Apply rotation around OY for lower GEMs
719 if (isec > 3) {
720 // Double_t xshift[9] = {0.32, 0.51, 0.63, 0.89, 1.02, 1.232, 1.368};
721 Double_t xshift[9] = {0.024, 0.058, 0.039, 0.050, 0.005, 0.028, 0.000};
722 Double_t alpha = 0.0055;
723 Double_t xnew = hit->GetX() * TMath::Cos(alpha) - (hit->GetZ() - zStat[ista]) * TMath::Sin(alpha);
724 Double_t znew = hit->GetX() * TMath::Sin(alpha) + (hit->GetZ() - zStat[ista]) * TMath::Cos(alpha);
725 hit->SetX(xnew + xshift[ista - 4]);
726 // if (ista == 6) znew -= 0.05;
727 // else if (ista == 7) znew -= 0.1;
728 // else if (ista == 8) znew -= 0.1;
729 // else if (ista == 10) znew += 0.2; //AZ-010323
730 hit->SetZ(znew + zStat[ista]);
731 } // else if (ista == 10) hit->SetZ (hit->GetZ() - 0.15); //AZ-010323
732
733 // AZ-030323 Lorentz shifts per station
734 /*
735 if (fieldFlag) {
736 Double_t lors[2][9] = {{ 0.017, -0.027, 0.021, -0.018, 0.014, 0.009, -0.038},
737 {-0.012, 0.023, -0.030, 0.039, -0.033, 0.013, -0.001}};
738 hit->SetX (hit->GetX() - lors[isec/4][ista-4] * 0.7);
739 }
740 */
741 } // if (hit->GetSystemId() == kGEM)
742
743 /* AZ-280826 if ((fieldFlag && hit->GetSystemId() == kGEM) || (hit->GetSystemId() != kGEM))
744 ApplyLorentzCorr(hit);*/
745}
746
747// -------------------------------------------------------------------------
748
750 int igem,
751 std::map<int, std::vector<Double_t>>* lorCorX,
752 std::map<int, std::vector<Double_t>>* lorCorY,
753 int& nx,
754 int& ny)
755{
756 // Read file with "effective" Lorentz-corrections
757
758 ifstream fin;
759 TString fileName, chline;
760
761 fileName = gSystem->ExpandPathName("$VMCWORKDIR");
762 // AZ-030825 fileName += "/input/";
763 fileName += "/parameters/reco/"; // AZ-030825
764 if (igem)
765 fileName += "LorentzGemCorr.txt";
766 else
767 fileName += "LorentzFsdCorr.txt";
768 fin.open(fileName.Data());
769 if (!fin.is_open()) { // AZ-040825
770 cout << " !!! Lorentz correction file " << fileName << " not found !!!" << endl;
771 exit(1);
772 }
773
774 map<int, std::size_t> runsMap;
775 TObjArray* tokens = nullptr;
776
777 while (1) {
778 // while (!fin.eof()) {
779 size_t pos = fin.tellg();
780 chline.ReadLine(fin);
781 if (fin.eof())
782 break;
783 if (chline.Contains("Run")) {
784 // new run
785 // cout << chline << endl;
786 tokens = chline.Tokenize(" ");
787 TString run = ((TObjString*)tokens->UncheckedAt(1))->String();
788 run.Atoi();
789 // runsMap[run.Atoi()] = fin.tellg();
790 runsMap[run.Atoi()] = pos;
791 // cout << run.Atoi() << " " << pos << endl;
792 }
793 if (tokens) {
794 tokens->Delete();
795 delete tokens;
796 tokens = nullptr;
797 }
798 }
799 // if (chline[0] == '*') continue; // comment
800 // cout << runsMap.size() << endl;
801
802 auto iter = runsMap.upper_bound(irun);
803 if (iter != runsMap.begin())
804 --iter;
805 cout << " ---> Using corrections for run " << iter->first << " " << iter->second << " " << igem << endl;
806
807 fin.clear();
808 fin.seekg(iter->second);
809 chline.ReadLine(fin);
810 // cout << chline << endl;
811
812 // Read detectors
813 while (1) {
814 chline.ReadLine(fin);
815 if (fin.eof())
816 break;
817 if (chline.Contains("Station")) {
818 // cout << chline << endl;
819 tokens = chline.Tokenize(" ");
820 TString stat = ((TObjString*)tokens->UncheckedAt(1))->String();
821 int ista = stat.Atoi();
822 int iupd = 0; // half-station
823 if (chline.Contains("lower"))
824 iupd = 1;
825 nx = ((TObjString*)tokens->UncheckedAt(3))->String().Atoi();
826 ny = ((TObjString*)tokens->UncheckedAt(4))->String().Atoi();
827 int ixdata = 0;
828 if (chline.Contains("X-"))
829 ixdata = 1;
830 // cout << ista << " " << iupd << " " << nx << " " << ny << endl;
831 if (nx * ny < 1)
832 cout << " !!! Wrong input line !!! " << chline << " " << nx << " " << ny << endl;
833 if (tokens) {
834 tokens->Delete();
835 delete tokens;
836 tokens = nullptr;
837 }
838 chline.ReadLine(fin);
839 tokens = chline.Tokenize(", ");
840 int nreg = tokens->GetEntriesFast();
841 if (nreg != nx * ny) {
842 cout << " !!! Wrong input line !!! " << chline << " " << nreg << " " << nx * ny << endl;
843 exit(0);
844 }
845 auto lorCor = vector<Double_t>(nreg);
846 // cout << tokens->GetEntriesFast() << " " << ((TObjString*)tokens->UncheckedAt(0))->String() << endl;
847 for (int itok = 0; itok < nreg; ++itok) {
848 Double_t corr = ((TObjString*)tokens->UncheckedAt(itok))->String().Atof();
849 // lorCor[iupd][ista][itok] = corr;
850 lorCor[itok] = corr;
851 }
852 if (ixdata)
853 lorCorX[iupd][ista] = lorCor;
854 else
855 lorCorY[iupd][ista] = lorCor;
856 if (tokens) {
857 tokens->Delete();
858 delete tokens;
859 tokens = nullptr;
860 }
861 } else if (chline.Contains("*")) {
862 continue; // comment
863 } else
864 break;
865 } // while (1)
866 fin.close();
867}
868
869// -------------------------------------------------------------------------
870
872{
873 // AZ-211223 Apply efficiency corrections for Monte Carlo
874 // 090726 - kill in momentum space
875
876 /*
877 if (hit->GetStationNr() == 3) {
878 // Apply efficiency for 1 station
879 if (gRandom->Rndm() > 0.90) return kFALSE; // 90%
880 }
881 */
882 // return kTRUE; // no inefficiency applied
883
884 static int first = 1;
885 const int nstat = 19, ny1 = 10, ny2 = ny1 * 2;
886 static TH2D *hEff[2][nstat] = {{nullptr}, {nullptr}}, *hEffMom[ny2][nstat] = {{nullptr}, {nullptr}};
887
888 if (first) {
889 first = 0;
890 // Get histograms with station efficiencies
891 TString fileName0;
892 fileName0 = gSystem->ExpandPathName("$VMCWORKDIR");
893 // AZ-220725 fileName += "/input/";
894 fileName0 += "/parameters/reco/"; // AZ-220725
895 // AZ-231225 TString fileEff = "SiGemEffic.root";
896 TString fileEff = "SiGemEfficV8.root"; // AZ-231225
897 if (FairRun::Instance()->GetTask("STS Vector Finder V9")) {
898 fileEff = "SiGemEfficV8.root";
899 if (fEffFile[0] != "")
900 fileEff = fEffFile[0]; // AZ-011125 - for different efficiencies
901 }
902 TString fileName = fileName0;
903 fileName += fileEff;
904 TFile* f = TFile::Open(fileName);
905 cout << " *** BmnToCbmHitConverter::CorrectEffic(): Reading Monte Carlo efficiency correction file " << endl;
906 cout << " *** " << fileName << endl;
907
908 for (int ipm = 0; ipm < 2; ++ipm) {
909
910 for (int i = 0; i < nstat; ++i) {
911 TString hName = (ipm == 0) ? "hEffpos_" : "hEffneg_";
912 hName += (1 + i);
913 TObject* obj = f->FindObjectAny(hName);
914 if (obj == nullptr)
915 break;
916 hEff[ipm][i] = (TH2D*)obj;
917 // cout << hName << endl;
918 }
919 }
920
921 // AZ-180626 - correction in momentum space
922 if (fEffFile[1] != "") {
923 fileName = fileName0;
924 fileEff = fEffFile[1];
925 fileName += fileEff;
926 TFile* f1 = TFile::Open(fileName);
927 cout << " *** BmnToCbmHitConverter::CorrectEffic(): Reading Monte Carlo efficiency correction file in "
928 "momentum space "
929 << endl;
930 cout << " *** " << fileName << endl;
931
932 for (int ipm = 0; ipm < 2; ++ipm) {
933 int ioff = ipm * ny1;
934
935 for (int iy = 0; iy < ny1; ++iy) {
936
937 for (int i = 0; i < nstat; ++i) {
938 TString hName = (ipm == 0) ? "hEffposY" : "hEffnegY";
939 hName += (iy + 1);
940 hName += "_";
941 hName += (i + 1);
942 TObject* obj = f1->FindObjectAny(hName);
943 if (obj == nullptr)
944 continue;
945 hEffMom[iy + ioff][i] = (TH2D*)obj;
946 // cout << hName << endl;
947 }
948 }
949 }
950 }
951 } // if (first)
952
953 if (ikill != 0 && pmom < -0.5)
954 return kTRUE; // AZ-180626 - do not kill ghost hits !!!
955 int ipm = (iq > 0) ? 0 : 1;
956 int ioff = ipm * ny1;
957 int ista = hit->GetStationNr() - 1, ix = 0, iy = 0, biny = 0;
958 if (ikill > 0) {
959 Double_t ymin = hEff[0][ista]->GetYaxis()->GetXmin();
960 Double_t ymax = hEff[0][ista]->GetYaxis()->GetXmax();
961 Double_t dy = (ymax - ymin) / ny1;
962 biny = (hit->GetY() - ymin) / dy;
963 if (biny < 0)
964 biny = 0;
965 if (biny >= ny1)
966 biny = ny1 - 1;
967 }
968
969 // if (hEff[ipm][ista] == nullptr)
970 // return kTRUE; // last small GEM
971 TH2D* h2eff = (ikill == 0) ? hEff[ipm][ista] : hEffMom[biny + ioff][ista];
972 if (h2eff == nullptr)
973 return kTRUE; // AZ-180626
974
975 if (ikill == 0) {
976 // Kill in coordinate space
977 ix = h2eff->GetXaxis()->FindBin(hit->GetX());
978 iy = h2eff->GetYaxis()->FindBin(hit->GetY());
979 } else {
980 // AZ-180626 - kill in momentum space
981 pmom /= TMath::Abs(iq);
982 iq = TMath::Sign(1, iq);
983 ix = h2eff->GetXaxis()->FindBin(TMath::Log(pmom));
984 iy = h2eff->GetYaxis()->FindBin(tx * iq);
985 }
986 if (ix < 1 || ix > h2eff->GetNbinsX() || iy < 1 || iy > h2eff->GetNbinsY())
987 return kTRUE;
988 Double_t eff = h2eff->GetBinContent(ix, iy);
989
990 // AZ-230626 - combined efficiency
991 if (ikill > 0) {
992 h2eff = hEff[ipm][ista];
993 ix = h2eff->GetXaxis()->FindBin(hit->GetX());
994 iy = h2eff->GetYaxis()->FindBin(hit->GetY());
995 if (ix < 1 || ix > h2eff->GetNbinsX() || iy < 1 || iy > h2eff->GetNbinsY())
996 return kTRUE;
997 Double_t eff1 = h2eff->GetBinContent(ix, iy);
998 if (eff1 >= 0.999999)
999 return kTRUE;
1000 // eff *= eff1; // AZ-250626
1001 // if (eff1 * eff >= 0.999999) return kTRUE;
1002 eff = TMath::Max(eff, eff1); // AZ-260626 - do not overkill
1003 }
1004
1005 // eff = 99; //AZ-170824 - no eff. correction
1006
1007 if (eff >= 0.999999)
1008 return kTRUE;
1009 if (gRandom->Rndm() <= eff)
1010 return kTRUE;
1011 // if (ikill > 0) cout << " killed " << iq << " " << ista << " " << hit << " " << pmom << " " << tx << " " << ty <<
1012 // " " << eff << endl;
1013 return kFALSE;
1014}
1015
1016// -------------------------------------------------------------------------
1017
1019{
1020 // AZ-270824 - apply coordinate corrections for MC hits
1021 // AZ-040125 - use 2-component Gaussian description
1022
1023 Float_t dx = 0;
1024
1025 // AZ-310823 Extra shift for MC
1026 if (hit->GetSystemId() == kGEM) {
1027 dx = 0.0100;
1028 if (hit->GetStationNr() % 2) {
1029 if (hit->GetSectorNr() < 5)
1030 dx = -dx;
1031 } else if (hit->GetSectorNr() >= 5)
1032 dx = -dx;
1033 hit->SetX(hit->GetX() - dx * 0.65);
1034 }
1035
1036 // return; // AZ-040125 - no corrections
1037
1038 static int first = 1;
1039 // static map<int,Double_t> shiftsPos[2][19], sigmasPos[2][19], shiftsNeg[2][19], sigmasNeg[2][19];
1040 static map<int, vector<Float_t>> paramsPos[2][19], paramsNeg[2][19];
1041
1042 // Read file with corrections
1043 if (first) {
1044 first = 0;
1045 ifstream fin;
1046 TString fileName, chline;
1047
1048 fileName = gSystem->ExpandPathName("$VMCWORKDIR");
1049 // AZ-030825 fileName += "/input/SiGemHitCorrMC.txt";
1050 fileName += "/parameters/reco/SiGemHitCorrMC.txt"; // AZ-030825
1051 fin.open(fileName.Data());
1052 if (!fin.is_open()) { // AZ-030825
1053 cout << " !!! MC correction file " << fileName << " not found !!!" << endl;
1054 exit(1);
1055 }
1056
1057 TObjArray* tokens = nullptr;
1058
1059 while (1) {
1060 chline.ReadLine(fin);
1061 if (fin.eof())
1062 break;
1063 // cout << chline << endl;
1064 if (chline.Contains("#"))
1065 continue; // comment
1066 tokens = chline.Tokenize(" ");
1067 TString stations = ((TObjString*)tokens->UncheckedAt(0))->String();
1068 int stat1 = stations.Atoi(), stat2 = stat1;
1069 if (stations.Contains("-")) {
1070 // Several stations
1071 stat1 = stations.Atoi();
1072 int ip = stations.First("-");
1073 TString sstat = stations(ip + 1, stations.Length() - ip - 1);
1074 stat2 = sstat.Atoi();
1075 }
1076 int pmin = (((TObjString*)tokens->UncheckedAt(1))->String()).Atof(); // in MeV
1077 int pmax = (((TObjString*)tokens->UncheckedAt(2))->String()).Atoi(); // in MeV
1078 Float_t ampl1 = (((TObjString*)tokens->UncheckedAt(3))->String()).Atof();
1079 Float_t shift1 = (((TObjString*)tokens->UncheckedAt(4))->String()).Atof() * 1.1;
1080 Float_t sigma1 = (((TObjString*)tokens->UncheckedAt(5))->String()).Atof() * 1.1;
1081 Float_t ampl2 = (((TObjString*)tokens->UncheckedAt(6))->String()).Atof();
1082 Float_t shift2 = (((TObjString*)tokens->UncheckedAt(7))->String()).Atof() * 1.1;
1083 Float_t sigma2 = (((TObjString*)tokens->UncheckedAt(8))->String()).Atof() * 1.1;
1084 int ixy = 0;
1085 if ((((TObjString*)tokens->UncheckedAt(9))->String()).Contains("Y"))
1086 ixy = 1;
1087 Float_t ampl = ampl1 + ampl2;
1088 // cout << stat1 << " " << stat2 << " " << pmax << " " << ampl1 << " " << shift1 << " " << sigma1 << " " <<
1089 // ixy
1090 // << endl;
1091
1092 for (int ista = stat1; ista <= stat2; ++ista) {
1093 if (pmin < 0) {
1094 paramsNeg[ixy][ista][pmax] = {ampl1 / ampl, shift1, sigma1, ampl2 / ampl, shift2, sigma2};
1095 } else {
1096 paramsPos[ixy][ista][pmax] = {ampl1 / ampl, shift1, sigma1, ampl2 / ampl, shift2, sigma2};
1097 }
1098 }
1099 if (tokens) {
1100 tokens->Delete();
1101 delete tokens;
1102 tokens = nullptr;
1103 }
1104 }
1105 }
1106
1107 int ista = hit->GetStationNr(), pmom = 0;
1108 Float_t sigx = 0.03, sigy = 0.05, dy = 0; // for backward compatibility
1109 if (hit->GetSystemId() != kGEM) {
1110 sigx = 0.008;
1111 sigy = 0.04;
1112 }
1113 if (iq != 0) {
1114 int pmomev = int(pmom0 * 1000 / iq);
1115 auto par = (iq > 0) ? &paramsPos : &paramsNeg;
1116 auto params = *par;
1117 if (params[0][ista].size() != 0) {
1118 pmom = TMath::Min(pmomev, params[0][ista].rbegin()->first - 1);
1119 auto iter = params[0][ista].lower_bound(pmom);
1120 vector<Float_t>& pars = iter->second;
1121 dx = pars[1];
1122 sigx = pars[2];
1123 if (gRandom->Rndm() > pars[0]) {
1124 dx = pars[4];
1125 sigx = pars[5];
1126 }
1127 }
1128 if (params[1][ista].size() != 0) {
1129 pmom = TMath::Min(pmomev, params[1][ista].rbegin()->first - 1);
1130 auto iter = params[1][ista].lower_bound(pmom);
1131 vector<Float_t>& pars = iter->second;
1132 dy = pars[1];
1133 sigy = pars[2];
1134 if (gRandom->Rndm() > pars[0]) {
1135 dy = pars[4];
1136 sigy = pars[5];
1137 }
1138 }
1139 }
1140
1141 hit->SetX(hit->GetX() + gRandom->Gaus(dx, sigx));
1142 hit->SetY(hit->GetY() + gRandom->Gaus(dy, sigy));
1143
1144 // cout << " zzz " << iq << " " << ista << " " << pmom0 << " " << pmom << " " << dx << " " << sigx << " " << dy << "
1145 // " << sigy << endl;
1146}
1147
1148// AZ-060625 -------------------------------------------------------------------------
1149
1151{
1152 // Add VSP (Vertex Silicon Plane - CBM sensors) hits
1153
1154 int nhits = fBmnVspHitsArray->GetEntriesFast();
1155
1156 for (Int_t iHit = 0; iHit < nhits; ++iHit) {
1157 BmnVSPHit* bmnHit = (BmnVSPHit*)fBmnVspHitsArray->UncheckedAt(iHit);
1158 TVector3 pos;
1159 bmnHit->Position(pos);
1160 pos[2] -= 0.0150; // AZ - shift to the entrance
1161 TVector3 dpos;
1162 if (fUseFixedErrors) {
1163 dpos[0] = fDXsil; // 0.01 / TMath::Sqrt(12); //AZ
1164 // dpos[1] = 0.1234; //AZ
1165 dpos[1] = fDYsil; // 0.021; //AZ - as in cbmroot
1166 } else {
1167 bmnHit->PositionError(dpos);
1168 }
1169
1170 Int_t sens = 1;
1171 Int_t detId = kVSP << 24 | (bmnHit->GetStation() + 1) << 16 | (bmnHit->GetModule() + 1) << 4 | sens << 1;
1172 new ((*fCbmHitsArray)[fCbmHitsArray->GetEntriesFast()]) CbmStsHit(detId, pos, dpos, 0.0, 0, 0);
1173 CbmStsHit* hit = (CbmStsHit*)fCbmHitsArray->At(fCbmHitsArray->GetEntriesFast() - 1);
1174 // AZ-310726 - moved here from below
1175 hit->SetRefIndex(bmnHit->GetRefIndex());
1176 if (fExp)
1177 hit->SetRefIndex(
1178 -iHit
1179 - 1); // AZ-280726 - save index of the original BMN hit (negative to avoid complain from FairRoot)
1180
1181 if (fExp && fAlignmentEnabled && fPeriod == 9) {
1182 ApplyAlignment9(hit);
1183 if (fieldFlag)
1184 ApplyLorentzCorr(hit); // AZ-280826 - moved here from inside ApplyAlignment
1185 } else if (!fExp) {
1186 /*
1187 int iq = 0, trid = -1;
1188 Double_t pmom = 0;
1189 if (bmnHit->GetRefIndex() >= 0) {
1190 // AZ-251125 FairMCPoint* mcp = (FairMCPoint*) fVspPoints->UncheckedAt(bmnHit->GetRefIndex());
1191 // AZ-251125 CbmMCTrack* mctr = (CbmMCTrack*) fMCTracks->UncheckedAt(mcp->GetTrackID());
1192 if (fVspPoints) {
1193 FairMCPoint* mcp = (FairMCPoint*) fVspPoints->UncheckedAt(bmnHit->GetRefIndex());
1194 trid = mcp->GetTrackID();
1195 } else trid = bmnHit->GetLink(0).GetEntry();
1196 pmom = mctr->GetP();
1197 if (TDatabasePDG::Instance()->GetParticle(mctr->GetPdgCode()))
1198 iq = TMath::Nint(TDatabasePDG::Instance()->GetParticle(mctr->GetPdgCode())->Charge() / 3);
1199 }
1200 // Correct MC hit
1201 CorrectHitMC(hit, pmom, iq);
1202 if (iq == 0)
1203 iq = 1; // for backward compatibility
1204
1205 Bool_t ok = CorrectEffic(hit, iq); // efficiency correction
1206 if (!ok) {
1207 // Remove hit
1208 fCbmHitsArray->RemoveLast();
1209 continue;
1210 } */
1211 // AZ-140824 - shift coordinates
1212 hit->SetY(hit->GetY() + 0.30);
1213 }
1214 FairRootManager::Instance()->SetUseFairLinks(kTRUE);
1215 hit->ResetLinks();
1216 hit->SetLinks(bmnHit->GetLinks());
1217 /* AZ-211125 - Save track ID in hit
1218 if (bmnHit->GetRefIndex() < 0) hit->SetLinks(bmnHit->GetLinks());
1219 else {
1220 set<FairLink> links = bmnHit->GetLinks();
1221 FairMCPoint* mcp = (FairMCPoint*)fSilPoints->UncheckedAt(bmnHit->GetRefIndex());
1222
1223 for (int jl = 0; jl < bmnHit->GetNLinks(); ++jl) {
1224 FairLink lnk = bmnHit->GetLink (jl);
1225 if (jl == 0) lnk.SetEntry (mcp->GetTrackID());
1226 hit->AddLink (lnk);
1227 }
1228 } */
1229 FairRootManager::Instance()->SetUseFairLinks(kFALSE);
1230 /* AZ-310726 - moved up
1231 hit->SetRefIndex(bmnHit->GetRefIndex());
1232 if (fExp) hit->SetRefIndex(-iHit-1); // AZ-280726 - save index of the original BMN hit (negative to avoid
1233 complain from FairRoot)
1234 */
1235 hit->fDigiF =
1236 bmnHit->GetLowerClusterIndex() + 4000000; //!!!AZ - for VectorFinder (to have unique indices) - 260322
1237 hit->fDigiB =
1238 bmnHit->GetUpperClusterIndex() + 5000000; //!!!AZ - for VectorFinder (to have unique indices) - 260322
1239 // AZ-221022
1240 StripCluster* upp = (StripCluster*)fBmnVspUpperClusters->UncheckedAt(hit->fDigiB % 1000000);
1241 StripCluster* low = (StripCluster*)fBmnVspLowerClusters->UncheckedAt(hit->fDigiF % 1000000);
1242 Double_t uppq = (upp) ? upp->TotalSignal : 0.0;
1243 Double_t lowq = (low) ? low->TotalSignal : 0.0;
1244 Double_t corrq = (uppq - lowq) / (uppq + lowq);
1245 hit->SetSignalDiv(corrq);
1246 uppq = (upp) ? upp->Width : 0.0; // N of strips
1247 lowq = (low) ? low->Width : 0.0;
1248 corrq = (uppq - lowq) / (uppq + lowq);
1249 hit->SetTimeStamp(corrq); // just using available space
1250 hit->SetStrips((low) ? low->MeanPosition : 0.0,
1251 (upp) ? upp->MeanPosition : 0.0); // AZ-190823
1252 // hit->SetWidths (low->Width, upp->Width); //AZ-190823
1253 } // for (Int_t iHit = 0; iHit < nhits
1254}
1255
1256// AZ-280526 -------------------------------------------------------------------------
1257
1258void BmnToCbmHitConverter::KillHits(set<int>* hitSet, set<int>* killedSet)
1259{
1260 // Kill hits in MC
1261
1262 const int nStat = 19;
1263 set<int> killedLow[nStat], killedUpp[nStat];
1264 multimap<int, int> clusLow[nStat], clusUpp[nStat];
1265 // int nHits0 = fCbmHitsArray->GetEntriesFast();
1266
1267 for (int ista = 0; ista < nStat; ++ista) {
1268 if (killedSet[ista].size() == 0)
1269 continue;
1270 // cout << ista << " " << killedSet[ista].size() << " " << hitSet[ista].size() << endl;
1271
1272 for (auto sit = killedSet[ista].begin(); sit != killedSet[ista].end(); ++sit) {
1273 CbmStsHit* hit = (CbmStsHit*)fCbmHitsArray->UncheckedAt(*sit);
1274 if (hit->GetRefIndex() >= 0) {
1275 // Store clusters from killed "true" hits
1276 killedLow[ista].insert(hit->fDigiF);
1277 killedUpp[ista].insert(hit->fDigiB);
1278 // cout << ista << " " << hit->GetX() << " " << hit->GetY() << endl; //
1279 }
1280 fCbmHitsArray->RemoveAt(*sit);
1281 }
1282
1283 for (auto sit = hitSet[ista].begin(); sit != hitSet[ista].end(); ++sit) {
1284 CbmStsHit* hit = (CbmStsHit*)fCbmHitsArray->UncheckedAt(*sit);
1285 if (hit == nullptr)
1286 continue;
1287 clusLow[ista].insert(pair<int, int>(hit->fDigiF, *sit));
1288 clusUpp[ista].insert(pair<int, int>(hit->fDigiB, *sit));
1289 }
1290
1291 // Kill hits with clusters from killed hits
1292 if (1) {
1293 pair<multimap<int, int>::iterator, multimap<int, int>::iterator> ret;
1294
1295 for (auto sit = killedLow[ista].begin(); sit != killedLow[ista].end(); ++sit) {
1296 int iclus = *sit;
1297 ret = clusLow[ista].equal_range(iclus);
1298
1299 for (auto mit = ret.first; mit != ret.second; ++mit) {
1300 CbmStsHit* hit = (CbmStsHit*)fCbmHitsArray->UncheckedAt(mit->second);
1301 if (hit == nullptr)
1302 continue;
1303 if (hit->GetRefIndex() >= 0) {
1304 // cout << " aaa " << " " << hit->GetX() << " " << hit->GetY() << endl; //
1305 continue; // do not kill "true" hits
1306 }
1307 fCbmHitsArray->RemoveAt(mit->second);
1308 }
1309 }
1310
1311 for (auto sit = killedUpp[ista].begin(); sit != killedUpp[ista].end(); ++sit) {
1312 int iclus = *sit;
1313 ret = clusUpp[ista].equal_range(iclus);
1314
1315 for (auto mit = ret.first; mit != ret.second; ++mit) {
1316 CbmStsHit* hit = (CbmStsHit*)fCbmHitsArray->UncheckedAt(mit->second);
1317 if (hit == nullptr)
1318 continue;
1319 if (hit->GetRefIndex() >= 0) {
1320 // cout << " bbb " << " " << hit->GetX() << " " << hit->GetY() << endl; //
1321 continue; // do not kill "true" hits
1322 }
1323 fCbmHitsArray->RemoveAt(mit->second);
1324 }
1325 }
1326 }
1327 } // for (int ista = 0; ista < nStat;
1328
1329 fCbmHitsArray->Compress();
1330 // cout << " Hits: " << nHits0 << " " << fCbmHitsArray->GetEntriesFast() << endl;
1331}
1332
1333// AZ-230626 -------------------------------------------------------------------------
1334/*
1335void BmnToCbmHitConverter::KillHitsTxP ()
1336{
1337 // Kill hits on tracks in Tx-P space in MC
1338
1339 BmnStsVectorFinderV9 *vf = (BmnStsVectorFinderV9*) FairRun::Instance()->GetTask("STS Vector Finder V9");
1340 if (vf) {
1341 TClonesArray *tracks = vf->GetVectorArray();
1342 int ntracks = tracks->GetEntriesFast();
1343 cout << " AAAAA " << ntracks << endl;
1344 FairTrackParam param;
1345
1346 for (int itr = 0; itr < ntracks; ++itr) {
1347 CbmStsTrack *tr = (CbmStsTrack*) tracks->UncheckedAt (itr);
1348 CbmKFTrack kftr = CbmKFTrack (*tr, kTRUE);
1349 kftr.Extrapolate (0.0); // extrapolate to the target
1350 kftr.GetTrackParam (param);
1351 Double_t tx = param.GetTx();
1352 Double_t pmom = 1 / param.GetQp();
1353 int iq = (pmom >= 0) ? 1 : -1;
1354 int nhits = tr->GetNStsHits();
1355
1356 for (int ih = 0; ih < nhits; ++ih) {
1357 int ihh = tr->GetStsHitIndex(ih);
1358 CbmStsHit *hit = (CbmStsHit*) stsHit->UncheckedAt (ihh);
1359 if (hit == nullptr) continue;
1360 Bool_t ok = CorrectEffic (hit, iq, tx, TMath::Abs (pmom), 1);
1361 if (!ok) stsHit->RemoveAt (ihh);
1362 }
1363 }
1364 }
1365 stsHit->Compress();
1366 cout << " !!! Hits: " << nhits0 << " " << stsHit->GetEntriesFast() << endl;
1367}
1368*/
1369
1370// -------------------------------------------------------------------------
1371
1373{
1374 // AZ-250726 - apply alignment for run 9
1375 // Code was provided by I.Rufanov
1376
1377 const Double_t shfGemColdX[7][4] = // сдвиг COLD зоны GEM в систему HOT зоны
1378 {{0.00, -0.08, 0.00, -0.08}, {0.08, 0.00, 0.08, 0.00}, {0.00, -0.08, 0.00, -0.08}, {0.08, 0.00, 0.08, 0.00},
1379 {0.00, -0.08, 0.00, -0.08}, {0.08, 0.00, 0.08, 0.00}, {0.00, -0.08, 0.00, -0.08}};
1380
1381 const Double_t shfGemColdY[7][4] = // сдвиг COLD зоны GEM в систему HOT зоны
1382 {{0.0131, -0.1022, 0.4127, 0.2407}, {-0.1025, 0.0035, 0.2344, 0.4093}, {0.0193, -0.0808, 0.4177, 0.2454},
1383 {-0.1069, 0.0288, 0.2310, 0.4147}, {0.0072, -0.1293, 0.4095, 0.2313}, {-0.1179, 0.0030, 0.2323, 0.4062},
1384 {0.0053, -0.1138, 0.4092, 0.2463}};
1385
1386 const Double_t shfGemModuleX[7][4] = // сдвиг GEM модуля по X
1387 {{-0.1251, 0.0592, -0.0743, 0.1234}, {-0.0720, 0.0918, 0.0191, 0.1434}, {-0.0117, 0.0620, -0.0155, 0.1445},
1388 {-0.2280, -0.1040, 0.0146, 0.1670}, {-0.0732, 0.0888, 0.1236, 0.2707}, {-0.0651, 0.1182, -0.0132, 0.1604},
1389 {0.0000, 0.0973, -0.0746, 0.1065}};
1390
1391 const Double_t shfGemModuleY[7][4] = // сдвиг GEM модуля по Y
1392 {{0.1333, 0.0381, -0.2890, -0.0304}, {-0.0321, 0.0003, -0.0026, -0.3052},
1393 {0.0418, -0.1293, -0.3283, -0.0173}, {-0.1771, -0.1612, -0.0736, -0.3755},
1394 {-0.0554, -0.1120, -0.3490, -0.0262}, {-0.1078, -0.0635, -0.1224, -0.4269},
1395 {0.0000, -0.1289, -0.5098, -0.1929}};
1396
1397 const Double_t GemModuleZ[7]
1398 [4] = // Z координата модуля GEM (здесь значения для двух модулей одной камеры одинаковы)
1399 {{66.0942, 66.0942, 61.3303, 61.3303}, {92.4609, 92.4609, 97.2615, 97.2615},
1400 {128.4895, 128.4895, 123.5238, 123.5238}, {154.8822, 154.8822, 159.7121, 159.7121},
1401 {190.8547, 190.8547, 186.0839, 186.0839}, {217.2125, 217.2125, 222.0896, 222.0896},
1402 {253.1800, 253.1800, 248.5170, 248.5170}};
1403
1404 const Double_t shfSiModuleX[5]
1405 [18] = // сдвиг Si модуля по X ( здесь 0-ая станция - это VSP, Si начинается с первой)
1406 {{-0.0749, -0.0658, -0.0703, -0.0074, -0.0357, 0.0177},
1407 {0.0035, 0.0114, -0.0032, 0.0048, 0.0082, 0.0022},
1408 {0.0191, 0.0071, 0.0021, 0.0039, -0.0045, -0.0125, 0.0040, -0.0028, 0.0089, 0.0105},
1409 {0.0315, 0.0119, 0.0100, 0.0038, 0.0034, -0.0020, 0.0031, -0.0126, -0.0011, -0.0061, -0.0047, -0.0049, 0,
1410 -0.0088},
1411 {0.0391, -0.0025, 0.0043, -0.0035, 0.0004, -0.0071, -0.0042, -0.0149, -0.0020, 0.0664, -0.3079, 0.0212, 0.0202,
1412 0.0194, 0.0166, 0.0192, -0.0048, 0.0058}};
1413
1414 const Double_t shfSiModuleY[5][18] = // сдвиг Si модуля по Y ( количество модулей в станциях: 6,6,10,14,18 )
1415 {{0.1315, 0.1563, 0.2000, 0.1403, 0.2708, 0.2257},
1416 {-0.0322, -0.0230, -0.0362, 0.1109, 0.1128, 0.1171},
1417 {-0.0553, -0.0622, -0.0714, -0.0501, -0.0373, 0.1308, 0.1381, 0.13775, 0.1326, 0.1383},
1418 {-0.0481, -0.0792, -0.0762, -0.0752, -0.0741, -0.0644, -0.0458, 0.1312, 0.1108, 0.1181, 0.1233, 0.1243, 0.1206,
1419 0.0963},
1420 {-0.0457, -0.0839, -0.074, -0.1295, -0.0906, -0.0695, -0.0422, -0.0373, -0.0886, 0.0922, 0.1132, 0.1265,
1421 0.1066, 0.1144, 0.1079, 0.1028, 0.0963, 0.1003}};
1422
1423 const Double_t SiModuleZ[5][18] = // Z координата модуля Si
1424 {{8.4219, 8.3338, 8.5018, 7.4086, 7.4899, 7.3798},
1425 {19.2659, 20.4102, 19.2102, 16.1029, 14.8970, 16.2674},
1426 {29.2501, 28.1111, 29.2931, 27.9594, 29.1102, 23.7346, 24.8556, 23.7454, 24.9745, 23.7512},
1427 {36.6630, 37.8982, 36.6077, 37.8718, 36.5320, 37.7034, 36.5650, 33.5985, 32.4420, 33.5933, 32.4600, 33.8248,
1428 32.6458, 33.8743},
1429 {46.7083, 45.5855, 46.7284, 45.5163, 46.7781, 45.3822, 46.5663, 45.4256, 46.5626, 41.2927, 42.6039, 41.3226,
1430 42.5169, 41.4480, 42.6462, 41.4951, 42.5908, 41.4675}};
1431
1432 const int nSi = 5, nGem = 7; // Detector stations
1433 const int istaStrips = 0, isecStrips = 3; // GEM station with shifted strip numbers
1434
1435 if (fhLorCorX[0][0] == nullptr) {
1436 int irun = ((DstEventHeader*)FairRootManager::Instance()->GetObject("DstEventHeader."))->GetRunId();
1437 if (irun > 0)
1438 FillLorentzHistos(irun); // AZ-260726 - fill histos with Lorentz corrections
1439 }
1440
1441 int ista = hit->GetStationNr() - 1;
1442 int isec = hit->GetSectorNr() - 1;
1443 Double_t xyz[3] = {hit->GetX(), hit->GetY(), hit->GetZ()};
1444
1445 if (hit->GetSystemId() == kGEM) {
1446 // GEM alignment
1447 ista -= nSi;
1448 if (ista >= nGem)
1449 return;
1450 // Shift cold zone
1451 if (isec % 2 == 0) {
1452 int icold = isec / 2;
1453 xyz[0] -= shfGemColdX[ista][icold];
1454 xyz[1] -= shfGemColdY[ista][icold];
1455 }
1456 int iquad = isec / 2;
1457 xyz[0] -= shfGemModuleX[ista][iquad];
1458 xyz[1] -= shfGemModuleY[ista][iquad];
1459 xyz[2] = GemModuleZ[ista][iquad];
1460 if (ista == istaStrips && isec == isecStrips) {
1461 // Shift strip numbers
1462 Double_t xclu = (xyz[0] + 38.5292) / 0.08; // упрощенно, чтоб не лезть в кластеры
1463 if (xclu > 130 && xclu < 256.5) {
1464 xyz[0] -= 2 * 0.08; // strips 130-255 (from 0)
1465 xyz[1] -= 0.5972;
1466 }
1467 }
1468 } else {
1469 // Silicon alignment
1470 xyz[0] -= shfSiModuleX[ista][isec];
1471 xyz[1] -= shfSiModuleY[ista][isec];
1472 xyz[2] = SiModuleZ[ista][isec];
1473 }
1474
1475 hit->SetX(xyz[0]);
1476 hit->SetY(xyz[1]);
1477 hit->SetZ(xyz[2]);
1478
1479 /* AZ-280826 if (fieldFlag)
1480 ApplyLorentzCorr(hit); */
1481}
1482
1483// -------------------------------------------------------------------------
1484
1486{
1487 // AZ-210826 - get histograms with Lorentz corrections
1488
1489 if (SilStationSet == nullptr || GemStationSet == nullptr)
1490 return;
1491 /*
1492 int nsta = SilStationSet->GetNStations();
1493 int nsta1 = GemStationSet->GetNStations();
1494 if (fVspStationSet)
1495 nsta += fVspStationSet->GetNStations();
1496 */
1497 TString fileName = gSystem->ExpandPathName("$VMCWORKDIR");
1498 fileName += "/parameters/reco/LorentzCorr.histo.root";
1499
1500 TFile* histFile = TFile::Open(fileName);
1501 if (histFile == nullptr) {
1502 cout << " !!! Lorentz correction file " << fileName << " not found !!!" << endl;
1503 exit(1);
1504 }
1505
1506 // Get runs with silicon and GEM histograms
1507 set<int> runs[2];
1508
1509 TList* keyList = histFile->GetListOfKeys();
1510 TIter next(keyList);
1511 TObject* obj = nullptr;
1512 TKey *key = nullptr, *key1 = nullptr;
1513
1514 while ((obj = next())) {
1515 key = (TKey*)obj;
1516 if (key->IsFolder()) {
1517 TDirectory* dir = (TDirectory*)key->ReadObj();
1518 // key->Print();
1519 TIter nextHist(dir->GetListOfKeys());
1520
1521 while ((key1 = (TKey*)nextHist())) {
1522 if (TString(key1->GetName()).Contains("hSil"))
1523 runs[0].insert(stoi(key->GetName())); // run name
1524 else if (TString(key1->GetName()).Contains("hGem"))
1525 runs[1].insert(stoi(key->GetName())); // run name
1526 }
1527 // key->ReadObj();
1528 }
1529 }
1530
1531 for (int igem = 0; igem < 2; ++igem) {
1532 auto iter = runs[igem].upper_bound(irun);
1533 if (iter != runs[igem].begin())
1534 --iter;
1535 cout << " ---> Using corrections for run " << *iter << " " << igem << endl;
1536 int ifirst = 0;
1537
1538 TDirectory* dir = (TDirectory*)histFile->Get(TString::Itoa(*iter, 10));
1539 // dir->cd();
1540 TIter nextHist(dir->GetListOfKeys());
1541
1542 while ((key = (TKey*)nextHist())) {
1543 TString hName = key->GetName();
1544 if (igem == 0 && !hName.Contains("hSil"))
1545 continue;
1546 if (igem == 1 && !hName.Contains("hGem"))
1547 continue;
1548 TH2D* hist = (TH2D*)key->ReadObj();
1549 // cout << hName << endl;
1550 TString cXY = (hName.Contains("X")) ? "X" : "Y";
1551 int ipos = hName.First("_");
1552 TString stat = hName(ipos + 1, hName.Length() - ipos);
1553 int ista = stat.Atoi() - 1;
1554
1555 // Split histogram into 2 halves for GEM (upper and lower) and modules for Si
1556 int nx = hist->GetNbinsX(), ny = hist->GetNbinsY(), ny12 = ny / 2;
1557 Double_t xmin = hist->GetXaxis()->GetXmin(), xmax = hist->GetXaxis()->GetXmax();
1558 Double_t ymin = hist->GetYaxis()->GetXmin(), ymax = hist->GetYaxis()->GetXmax();
1559 if (TMath::Abs(ymax + ymin) > 0.1)
1560 Fatal("FillLorentzHistost", "!!! Different ymin and ymax %f %f ", ymin, ymax);
1561 if (ifirst == 0) {
1562 ifirst = 1;
1563 Double_t dx = (xmax - xmin) / nx, dy = (ymax - ymin) / ny;
1564 cout << " Bin size: " << dx << "x" << dy << " cm" << endl;
1565 }
1566
1567 if (igem) {
1568 // GEM
1569
1570 for (int iupl = 0; iupl < 2; ++iupl) {
1571 TString hName12 = hName;
1572 // TString upl = (iupl == 0) ? "0" : "1";
1573 TString upl = to_string(iupl);
1574 hName12.Insert(ipos - 1, upl);
1575 TH2D* hnew = new TH2D(hName12, "", nx, xmin, xmax, ny12, 0, ymax);
1576 hnew->SetDirectory(nullptr); // AZ-010926
1577 if (cXY == "X")
1578 fhLorCorX[ista][iupl] = hnew;
1579 else
1580 fhLorCorY[ista][iupl] = hnew;
1581 int iyb = ny12 + 1, iye = ny;
1582 if (iupl) {
1583 iyb = 1;
1584 iye = ny12;
1585 }
1586
1587 // Fill histo
1588 for (int iy = iyb; iy <= iye; ++iy) {
1589 for (int ix = 1; ix <= nx; ++ix) {
1590 Double_t cont = hist->GetBinContent(ix, iy);
1591 int iy1 = (iupl == 0) ? iy - ny12 : ny12 - iy + 1;
1592 hnew->SetBinContent(ix, iy1, cont);
1593 }
1594 }
1595 //!!! AZ-310826
1596 // if (iupl) hnew->Reset();
1597 }
1598 } else {
1599 // Silicon
1600 int nsec = 2, nxsi = 0;
1601 Double_t rangex = xmax - xmin;
1602 if (ista == 0 && fVspStationSet)
1603 nsec = fVspStationSet->GetStation(ista)->GetNModules();
1604 else {
1605 int ista1 = ista;
1606 if (fVspStationSet)
1607 --ista1;
1608 nsec = SilStationSet->GetStation(ista1)->GetNModules();
1609 }
1610 nxsi = nx / (nsec / 2);
1611 // rangex = (xmax - xmin) / nx;
1612 rangex = (xmax - xmin) / (nsec / 2);
1613 Double_t xend = xmax + rangex; // sectors are counted from positive X
1614 // cout << " Stat " << ista << " " << nsec << " " << nxsi << " " << rangex << endl;
1615
1616 for (int isec = 0; isec < nsec; ++isec) {
1617 TString hName12 = hName;
1618 TString sec = to_string(isec);
1619 hName12.Insert(ipos, sec);
1620 if (isec == nsec / 2)
1621 xend = xmax + rangex;
1622 xend -= rangex;
1623 TH2D* hnew = new TH2D(hName12, "", nxsi, xend - rangex, xend, ny12, 0, ymax);
1624 hnew->SetDirectory(nullptr); // AZ-010926
1625 auto& hLorCor = (cXY == "X") ? fhLorCorX[ista] : fhLorCorY[ista];
1626 hLorCor[isec] = hnew;
1627 }
1628
1629 // Fill histos
1630
1631 for (int iy = ny; iy > 0; --iy) {
1632 int iy1 = (iy > ny12) ? iy - ny12 : ny12 - iy + 1;
1633
1634 for (int ix = 1; ix <= nx; ++ix) {
1635 int isec = (ix - 1) / nxsi;
1636 isec = nsec / 2 - isec - 1;
1637 if (iy <= ny12)
1638 isec += (nsec / 2);
1639 int ix1 = (ix - 1) % nxsi + 1;
1640 Double_t cont = hist->GetBinContent(ix, iy);
1641 TH2D* hnew = (cXY == "X") ? fhLorCorX[ista][isec] : fhLorCorY[ista][isec];
1642 hnew->SetBinContent(ix1, iy1, cont);
1643 }
1644 }
1645 // Debug
1646 /*
1647 TCanvas* c1 = (TCanvas*) gROOT->FindObject("c1lor");
1648 if (c1) {
1649 for (int isec = 0; isec < nsec; ++isec) {
1650 TH2D *hh = (cXY == "X") ? fhLorCorX[ista][isec] : fhLorCorY[ista][isec];
1651 hh->Draw("lego20");
1652 c1->Modified();
1653 c1->Update();
1654 cout << isec << " " << hh->GetMaximum() << endl;
1655 getchar();
1656 }
1657 }
1658 */
1659 } // if (igem)
1660 } // while ((key = (TKey*) nextHist()))
1661 } // for (int igem = 0; igem < 2;
1662 histFile->Close(); // AZ-010926
1663}
1664
1665// -------------------------------------------------------------------------
1666
1668{
1669 // AZ-260726 - apply Lorentz corrections (hit - after pre-alignment)
1670
1671 int ista = hit->GetStationNr() - 1;
1672 int isec = hit->GetSectorNr() - 1;
1673 // AZ-290826 const Double_t scale = 0.65;
1674 const Double_t scale = 0.95; // AZ-290826
1675
1676 if (fieldFlag && hit->GetSystemId() == kGEM) {
1677 // Lorentz corrections
1678 int iupd = isec / 4;
1679 Double_t xh = hit->GetX(), yh = TMath::Abs(hit->GetY()), xh1 = xh, yh1 = yh;
1680 // AZ-290726 Use original hit coordinates to define correction regions
1681 // if (fPeriod >= 9) {
1682 if (0) {
1683 if (hit->GetRefIndex() < 0) {
1684 int indx = -hit->GetRefIndex() - 1;
1685 BmnGemStripHit* ghit = (BmnGemStripHit*)fBmnGemHitsArray->UncheckedAt(indx);
1686 xh1 = ghit->GetX();
1687 yh1 = TMath::Abs(ghit->GetY());
1688 }
1689 }
1690 TH2D* h2 = fhLorCorX[ista][iupd];
1691 if (h2 == nullptr)
1692 return;
1693 TAxis *ax = h2->GetXaxis(), *ay = h2->GetYaxis();
1694 Double_t xmin = ax->GetXmin(), xmax = ax->GetXmax();
1695 Double_t ymin = ay->GetXmin(), ymax = ay->GetXmax();
1696 if (xh1 >= xmax)
1697 xh1 = xmax - 0.1;
1698 else if (xh1 < xmin)
1699 xh1 = xmin + 0.1;
1700 if (yh1 >= ymax)
1701 yh1 = ymax - 0.1;
1702 else if (yh1 < ymin)
1703 yh1 = ymin + 0.1;
1704 // AZ-290726 - trying this
1705 /*int ix = ax->FindBin(xh1);
1706 int iy = ay->FindBin(yh1);
1707 Double_t dx = h2->GetBinContent(ix, iy);*/
1708 Double_t dx = h2->Interpolate(xh1, yh1);
1709 // dx = 0; //AZ-060723 - no corrections
1710 hit->SetX(xh - dx * scale);
1711 h2 = fhLorCorY[ista][iupd];
1712 // Double_t dy = h2->GetBinContent(ix, iy); // AZ-290726 - trying this
1713 Double_t dy = h2->Interpolate(xh1, yh1);
1714 if (iupd)
1715 dy = -dy;
1716 Double_t ynew = yh - dy * scale;
1717 if (iupd)
1718 ynew = -ynew;
1719 hit->SetY(ynew);
1720 } else if (hit->GetSystemId() != kGEM) {
1721 /*
1722 TH2D* h2 = fhLorCorX[ista][isec];
1723 Double_t dx = h2->GetBinContent(1, 1);
1724 hit->SetX(hit->GetX() - dx * scale);
1725 h2 = fhLorCorY[ista][isec];
1726 Double_t dy = h2->GetBinContent(1, 1);
1727 hit->SetY(hit->GetY() - dy * scale);
1728 */
1729 TH2D* h2 = fhLorCorX[ista][isec];
1730 Double_t xh = hit->GetX(), yh = TMath::Abs(hit->GetY()), xh1 = xh, yh1 = yh;
1731 TAxis *ax = h2->GetXaxis(), *ay = h2->GetYaxis();
1732 Double_t xmin = ax->GetXmin(), xmax = ax->GetXmax();
1733 Double_t ymin = ay->GetXmin(), ymax = ay->GetXmax();
1734 if (xh1 >= xmax)
1735 xh1 = xmax - 0.1;
1736 else if (xh1 < xmin)
1737 xh1 = xmin + 0.1;
1738 if (yh1 >= ymax)
1739 yh1 = ymax - 0.1;
1740 else if (yh1 < ymin)
1741 yh1 = ymin + 0.1;
1742 /*int ix = ax->FindBin(xh1);
1743 int iy = ay->FindBin(yh1);
1744 Double_t dx = h2->GetBinContent(ix,iy);*/
1745 Double_t dx = h2->Interpolate(xh1, yh1);
1746 // dx = 0; //AZ-060723 - no corrections
1747 hit->SetX(xh - dx * scale);
1748 h2 = fhLorCorY[ista][isec];
1749 // Double_t dy = h2->GetBinContent(ix, iy); // AZ-290726 - trying this
1750 Double_t dy = h2->Interpolate(xh1, yh1);
1751 int nsec = fhLorCorY[ista].size();
1752 int iupd = isec / (nsec / 2);
1753 if (iupd)
1754 dy = -dy;
1755 Double_t ynew = yh - dy * scale;
1756 if (iupd)
1757 ynew = -ynew;
1758 hit->SetY(ynew);
1759 }
1760}
@ kSILICON
@ kGEM
@ kVSP
static Double_t workTime
int i
Definition P4_F32vec4.h:22
bool Bool_t
int Int_t
float Float_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
const char Option_t
void Fatal(const char *location, const char *msgfmt,...)
R__EXTERN TRandom * gRandom
R__EXTERN TSystem * gSystem
Bool_t IsPointInsideStripLayer(Double_t x, Double_t y)
Int_t GetModule()
Definition BmnHit.h:36
BmnMatch GetDigitNumberMatch()
Definition BmnHit.h:43
Bool_t IsPseudo()
Definition BmnHit.h:39
Int_t GetUpperClusterIndex()
Definition BmnHit.h:44
Int_t GetLowerClusterIndex()
Definition BmnHit.h:45
Short_t GetStation() const
Definition BmnHit.h:35
TClonesArray * GetMCTracks() const
rot. around z-axis [rad]
const BmnLink & GetLink(Int_t i) const
Definition BmnMatch.h:38
BmnTask()
Default constructor.
Definition BmnTask.cxx:3
virtual InitStatus Init()
TClonesArray * fBmnGemLowerClusters
void ApplyAlignment9(CbmStsHit *hit)
TClonesArray * fBmnVspLowerClusters
void SetFixedErrors(Float_t dXgem=0.015, Float_t dYgem=0.058, Float_t dXsil=0.003, Float_t dYsil=0.021)
TClonesArray * fBmnVspUpperClusters
void ApplyAlignment(CbmStsHit *hit)
TClonesArray * fBmnVspHitsArray
AZ-060625 Input array of VSP Silicon Hits.
Bool_t fUseFixedErrors
Entire VSP detector.
std::map< int, TH2D * > fhLorCorX[17]
Bool_t CorrectEffic(CbmStsHit *hit, int iq, Double_t tx=0, Double_t ty=0, Double_t pmom=0, int ikill=0)
virtual void OnlineWrite(const std::unique_ptr< TTree > &resultTree)
Write task resul to tree.
void KillHits(set< int > *hitSet, set< int > *killedSet)
void CorrectHitMC(CbmStsHit *hit, Double_t pmom, int iq)
virtual void Exec(Option_t *opt)
TClonesArray * fBmnGemUpperClusters
BmnGemStripStationSet * GemStationSet
BmnSiliconStationSet * SilStationSet
Entire GEM detector.
TClonesArray * fCbmHitsArray
Output array of CBM Hits.
TClonesArray * fBmnGemHitsArray
Input array of BNM GEM Hits.
TClonesArray * fBmnSilUpperClusters
TClonesArray * fBmnSilLowerClusters
std::map< int, TH2D * > fhLorCorY[17]
void ApplyLorentzCorr(CbmStsHit *hit)
TClonesArray * fBmnSilHitsArray
Input array of BNM Silicon Hits.
void ReadCorrections(int irun, int igem, std::map< int, std::vector< Double_t > > *locCorX, std::map< int, std::vector< Double_t > > *locCorY, int &nx, int &ny)
BmnVSPStationSet * fVspStationSet
Entire SILICON detector.
CbmMCTrack.h.
Definition CbmMCTrack.h:26
void GetMomentum(TVector3 &momentum) const
Definition CbmMCTrack.h:139
Double_t GetP() const
Definition CbmMCTrack.h:68
Int_t GetPdgCode() const
Accessors.
Definition CbmMCTrack.h:56
void SetStrips(Double_t s1, Double_t s2)
Definition CbmStsHit.h:92
virtual Int_t GetStationNr() const
Definition CbmStsHit.h:67
void SetSignalDiv(Double_t sigDiv)
Definition CbmStsHit.h:91
Int_t fDigiB
Definition CbmStsHit.h:102
void SetStatLayer(Int_t it)
Definition CbmStsHit.h:84
Int_t GetSectorNr() const
Definition CbmStsHit.h:68
Int_t GetSystemId() const
Accessors.
Definition CbmStsHit.h:66
Int_t fDigiF
Definition CbmStsHit.h:101
Double_t TotalSignal
Double_t MeanPosition
virtual Int_t FindBin(const char *label)
Double_t GetXmax() const
Double_t GetXmin() const
static TDatabasePDG * Instance()
T * Get(const char *namecycle)
TList * GetListOfKeys() const override
TObject * FindObjectAny(const char *name) const override
virtual TList * GetListOfKeys() const
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
void Close(Option_t *option="") override
virtual void SetDirectory(TDirectory *dir)
virtual Int_t GetNbinsY() const
TAxis * GetXaxis()
virtual Int_t GetNbinsX() const
TAxis * GetYaxis()
void SetBinContent(Int_t bin, Double_t content) override
Double_t Interpolate(Double_t x, Double_t y) const override
virtual Double_t GetBinContent(Int_t bin) const
Bool_t IsFolder() const override
virtual TObject * ReadObj()
const char * GetName() const override
Int_t GetEntriesFast() const
void Delete(Option_t *option="") override
TObject * UncheckedAt(Int_t i) const
Double_t RealTime()
void Start(Bool_t reset=kTRUE)
void Stop()
Ssiz_t Length() const
TString & Insert(Ssiz_t pos, const char *s)
Int_t Atoi() const
Ssiz_t First(char c) const
const char * Data() const
TObjArray * Tokenize(const TString &delim) const
static TString Itoa(Int_t value, Int_t base)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
std::istream & ReadLine(std::istream &str, Bool_t skipWhite=kTRUE)
Double_t Px() const
Double_t Py() const
Double_t Pz() const
Double_t Min(Double_t a, Double_t b)
Int_t Nint(T x)
Double_t Sign(Double_t a, Double_t b)
Double_t Log(Double_t x)
constexpr Double_t DegToRad()
Double_t Cos(Double_t)
Double_t Abs(Double_t d)
Double_t Sin(Double_t)
Double_t Max(Double_t a, Double_t b)
Double_t Tan(Double_t)