BmnRoot
Loading...
Searching...
No Matches
BmnFillDstTask.cxx
Go to the documentation of this file.
1/********************************************************************************
2 * BmnFillDstTask.cxx *
3 * BM@N Fill DST Task class implementation *
4 * Add necessary data and event header to the DST file after reconstruction *
5 *******************************************************************************/
6
7#define ANSI_COLOR_RED "\x1b[91m"
8#define ANSI_COLOR_BLUE "\x1b[94m"
9#define ANSI_COLOR_RESET "\x1b[0m"
10
11#include "BmnFillDstTask.h"
12
13#include "BmnFieldConst.h"
14#include "BmnFieldMap.h"
15#include "BmnTrigDigit.h"
16#include "ExtractZ2.h"
17#include "FairGeoParSet.h"
18#include "FairLogger.h"
19#include "FairRunAna.h"
20#include "FairRuntimeDb.h"
21#include "TGeoManager.h"
22#include "TROOT.h"
23#include "TSystem.h"
24#include "UniRun.h"
25#include "function_set.h"
26
27#include <TStopwatch.h>
28#include <fstream>
29#include <iostream>
30using namespace std;
31
32static Double_t workTime = 0.0;
33
34// ---- Default constructor -------------------------------------------
36 : BmnTask("BmnFillDstTask")
37 , isExpData(-1)
38 , fPeriodNumber(-1)
39 , fRunNumber(-1)
40 , fMCEventHeader(nullptr)
41 , fMCTracks(nullptr)
42 , fMCInfoDst(nullptr)
43 , fEventHeader(nullptr)
44 , fDstHeader(nullptr)
45 , fRunHeader(nullptr)
46 , fNStartEvent(0)
47 , fNEvents(-1)
48 , fIEvent(0)
49 , fPrimaryVertex(nullptr)
50 , fGlobalTracks(nullptr)
51 , fZCalib1(1)
52 , fZCalib2(0)
53 , fBC1Calib(0)
54 , fBC2Calib(0)
55 , fDoCalibration(kFALSE)
56 , fT0(nullptr)
57 , fBC1(nullptr)
58 , fBC2(nullptr)
59 , fBC3(nullptr)
60 , fBC4(nullptr)
61{
62 LOG(debug) << "Defaul Constructor of BmnFillDstTask";
63}
64
65// ---- Constructor with start event and event number to be processed, and autodefinition whether experimental data are
66// used -------
67BmnFillDstTask::BmnFillDstTask(Long64_t nStartEvent, Long64_t nEvents)
68 : BmnTask("BmnFillDstTask")
69 , isExpData(-1)
70 , fPeriodNumber(-1)
71 , fRunNumber(-1)
72 , fMCEventHeader(nullptr)
73 , fMCTracks(nullptr)
74 , fMCInfoDst(nullptr)
75 , fEventHeader(nullptr)
76 , fDstHeader(nullptr)
77 , fRunHeader(nullptr)
78 , fNStartEvent(nStartEvent)
79 , fNEvents(nEvents)
80 , fIEvent(0)
81 , fPrimaryVertex(nullptr)
82 , fGlobalTracks(nullptr)
83 , fZCalib1(1)
84 , fZCalib2(0)
85 , fBC1Calib(0)
86 , fBC2Calib(0)
87 , fDoCalibration(kFALSE)
88 , fT0(nullptr)
89 , fBC1(nullptr)
90 , fBC2(nullptr)
91 , fBC3(nullptr)
92 , fBC4(nullptr)
93{
94 LOG(debug) << "Constructor of BmnFillDstTask";
95}
96
97// Constructor with start event and event number to be processed, experimental data flag, period and run numbers
98BmnFillDstTask::BmnFillDstTask(Long64_t nStartEvent,
99 Long64_t nEvents,
100 Bool_t isExp,
101 Int_t period_number,
102 Int_t run_number)
103 : BmnTask("BmnFillDstTask")
104 , fPeriodNumber(period_number)
105 , fRunNumber(run_number)
106 , fMCEventHeader(nullptr)
107 , fMCTracks(nullptr)
108 , fMCInfoDst(nullptr)
109 , fEventHeader(nullptr)
110 , fDstHeader(nullptr)
111 , fRunHeader(nullptr)
112 , fNStartEvent(nStartEvent)
113 , fNEvents(nEvents)
114 , fIEvent(0)
115 , fPrimaryVertex(nullptr)
116 , fGlobalTracks(nullptr)
117 , fZCalib1(1)
118 , fZCalib2(0)
119 , fBC1Calib(0)
120 , fBC2Calib(0)
121 , fDoCalibration(kFALSE)
122 , fT0(nullptr)
123 , fBC1(nullptr)
124 , fBC2(nullptr)
125 , fBC3(nullptr)
126 , fBC4(nullptr)
127{
128 LOG(debug) << "Constructor of BmnFillDstTask";
129 if (isExp)
130 isExpData = 1;
131 else
132 isExpData = 0;
133}
134
135// ---- Destructor ----------------------------------------------------
137{
138 LOG(debug) << "Destructor of BmnFillDstTask";
139 if (fMCInfoDst)
140 delete fMCInfoDst;
141 if (fRunHeader)
142 delete fRunHeader;
143}
144
145// Set headers with autodefinition whether experimental or simulation data are used
146bool BmnFillDstTask::autoSetHeaders()
147{
148 FairRootManager* ioman = FairRootManager::Instance();
149
150 isExpData = 1;
151 // Get a pointer to the input Event Header
152 TObject* pObj = ioman->GetObject("BmnEventHeader.");
153 if (!pObj) {
154 // if no input Event Header was found, searching for "MCEventHeader."
155 fMCEventHeader = (FairMCEventHeader*)ioman->GetObject("MCEventHeader.");
156 if (!fMCEventHeader)
157 return false;
158 isExpData = 0;
159 } else {
160 if (pObj->InheritsFrom(FairMCEventHeader::Class())) {
161 fMCEventHeader = (FairMCEventHeader*)pObj;
162 isExpData = 0;
163 } else
164 fEventHeader = (BmnEventHeader*)pObj;
165 }
166
167 return true;
168}
169
170// ---- Initialization of task at the beginning ------------------------
172{
173 LOG(debug) << "Initialization of BmnFillDstTask";
174
175 fRunHeader = new DstRunHeader();
176
177 // Get a handle from the IO manager
178 FairRootManager* ioman = FairRootManager::Instance();
179 if (!ioman) {
180 LOG(error) << "Init: FairRootManager is not instantiated! BmnFillDstTask task will be deactivated";
181 SetActive(kFALSE);
182 return kERROR;
183 }
184
185 if (isExpData == -1) {
186 if (!autoSetHeaders()) {
187 LOG(error) << "No input Event Header (BmnEventHeader. or MCEventHeader.) found! BmnFillDstTask task will "
188 "be deactivated";
189 return kERROR;
190 }
191 } else {
192 if (isExpData == 0)
193 fMCEventHeader = (FairMCEventHeader*)ioman->GetObject("MCEventHeader.");
194 else
195 fEventHeader = (BmnEventHeader*)ioman->GetObject("BmnEventHeader.");
196 }
197
198 applyZCalibration();
199
200 // Get input branches
201 if (isExpData == 1) {
202 fT0 = (TClonesArray*)ioman->GetObject("BC2");
203 fBC1 = (TClonesArray*)ioman->GetObject("TQDC_BC1");
204 fBC2 = (TClonesArray*)ioman->GetObject("TQDC_BC2");
205 fBC3 = (TClonesArray*)ioman->GetObject("TQDC_BC3");
206 fBC4 = (TClonesArray*)ioman->GetObject("TQDC_BC4");
207 }
208 // Get a pointer to the output DST Event Header
209 fDstHeader = (DstEventHeader*)ioman->GetObject("DstEventHeader.");
210 if (!fDstHeader) {
211 LOG(error) << "No DstEventHeader prepared for the output DST file! BmnFillDstTask task will be deactivated";
212 return kERROR;
213 }
214
215 if (ioman->CheckMaxEventNo(fNEvents) < fNEvents)
216 fNEvents = ioman->CheckMaxEventNo(fNEvents);
217
218 // Fill Run Header with the magnetic field and geometry to simply use in physics analyses
219 FairField* fField = FairRunAna::Instance()->GetField();
220 if (fField != nullptr) {
221 fRunHeader->SetFieldType(fField->GetType());
222 if (fField->GetType() == 0) {
223 BmnFieldConst* fFieldConst = reinterpret_cast<BmnFieldConst*>(fField);
224 fRunHeader->SetFieldScale(-1);
225 fRunHeader->SetFieldName(TString::Format(
226 "%f:%f:%f:%f:%f:%f:%f:%f:%f", fFieldConst->GetXmin(), fFieldConst->GetXmax(), fFieldConst->GetYmin(),
227 fFieldConst->GetYmax(), fFieldConst->GetZmin(), fFieldConst->GetZmax(), fFieldConst->GetBx(),
228 fFieldConst->GetBy(), fFieldConst->GetBz()));
229 } else {
230 BmnFieldMap* fFieldMap = reinterpret_cast<BmnFieldMap*>(fField);
231 fRunHeader->SetFieldScale(fFieldMap->GetScale());
232 fRunHeader->SetFieldName(fFieldMap->GetName());
233 }
234 }
235
236 // Fill Run Header for the experimental data from the Condition Database
237 if (fRunNumber > 0) {
239
240 // Save gGeoManager in the container (this call creates the container if it does not exist)
241 FairGeoParSet* geopar = dynamic_cast<FairGeoParSet*>(FairRuntimeDb::instance()->getContainer("FairGeoParSet"));
242 if (geopar) {
243 geopar->SetGeometry(gGeoManager);
244 geopar->setChanged();
245 // geopar->setInputVersion(version, index);
246 }
247
248 UniRun* pCurrentRun = UniRun::GetRun(fPeriodNumber, fRunNumber);
249 if (pCurrentRun != 0) {
250 fRunHeader->SetPeriodRun(fPeriodNumber, fRunNumber);
251 TDatime start_date = pCurrentRun->GetStartDatetime();
252 TTimeStamp tsStartTime(start_date.GetYear(), start_date.GetMonth(), start_date.GetDay(),
253 start_date.GetHour(), start_date.GetMinute(), start_date.GetSecond());
254 fRunHeader->SetStartTime(tsStartTime);
255 TDatime* end_date = pCurrentRun->GetEndDatetime();
256 if (end_date != NULL) {
257
258 // TTimeStamp tsEndTime((time_t) pCurrentRun->GetEndDatetime()->Convert(), 0);
259
260 TTimeStamp tsEndTime(end_date->GetYear(), end_date->GetMonth(), end_date->GetDay(), end_date->GetHour(),
261 end_date->GetMinute(), end_date->GetSecond());
262 fRunHeader->SetFinishTime(tsEndTime);
263 }
264 delete end_date;
265 TString beam = pCurrentRun->GetBeamParticle();
266 beam.ToLower();
267 map<TString, stParticleInfo>::iterator it = mapParticleInfo.find(beam);
268 if (it != mapParticleInfo.end()) {
269 fRunHeader->SetBeamA(it->second.A);
270 fRunHeader->SetBeamZ(it->second.Z);
271 }
272 double* energy = pCurrentRun->GetEnergy();
273 if (energy != NULL) {
274 fRunHeader->SetBeamEnergy(*energy);
275 delete energy;
276 }
277
278 TString target = pCurrentRun->GetTargetParticle();
279 if (target != "") {
280 target.ToLower();
281 it = mapParticleInfo.find(target);
282 if (it != mapParticleInfo.end()) {
283 fRunHeader->SetTargetA(it->second.A);
284 fRunHeader->SetTargetZ(it->second.Z);
285 }
286 }
287 } // if (pCurrentRun != 0)
288 delete pCurrentRun;
289 } else {
290 // FIll Run Header from the Database for MC data
291 if (fPeriodNumber > 0)
292 fRunHeader->SetPeriodRun(fPeriodNumber, 0); // set period number (run_number = 0 for MC data)
293 }
294
295 // Get summary event info to print
296 fPrimaryVertex = (CbmVertex*)ioman->GetObject("PrimaryVertex.");
297 if (!fPrimaryVertex) {
298 LOG(debug) << "BmnFillDstTask::Init(): branch PrimaryVertex not found! The task is deactivated" << endl;
299 // SetActive(kFALSE);
300 // return kERROR;
301 }
302 fGlobalTracks = (TClonesArray*)ioman->GetObject("BmnGlobalTrack");
303 if (!fGlobalTracks) {
304 LOG(debug) << "BmnFfBC1illDstTask::Init(): branch BmnGlobalTrack not found! The task is deactivated" << endl;
305 // SetActive(kFALSE);
306 // return kERROR;
307 }
308
309 // Add MC information (header and tracks)
310 if (isExpData == 0) {
311 fMCTracks = (TClonesArray*)ioman->GetObject("MCTrack");
312 if (!fMCTracks)
313 LOG(debug) << "BmnFillDstTask::Init(): branch MCTrack not found" << endl;
314
315 // Create and register MCInfo object for MC output data
316 fMCInfoDst = new BmnMCInfoDst();
317 ioman->Register("BmnMCInfo.", "MC", fMCInfoDst, kTRUE);
318 }
319
320 return kSUCCESS;
321}
322
323// ---- ReInit -------------------------------------------------------
325{
326 LOG(debug) << "Re-initilization of BmnFillDstTask";
327 return kSUCCESS;
328}
329
330// ---- ReInit -------------------------------------------------------
331void BmnFillDstTask::Reset()
332{
333 if (fMCInfoDst != nullptr)
334 if (fMCInfoDst->GetMCTracks() != nullptr)
335 fMCInfoDst->GetMCTracks()->Delete();
336}
337
338// ---- Exec ----------------------------------------------------------
339void BmnFillDstTask::Exec(Option_t* /*option*/)
340{
341
342 TStopwatch sw;
343 sw.Start();
344
345 LOG(debug) << "Exec of BmnFillDstTask";
346 Reset();
347
348 // fill output DST event header
349 if (isExpData == 0) { // MC data
350 fDstHeader->SetPeriodId(fPeriodNumber);
351 fDstHeader->SetRunId(fMCEventHeader->GetRunID());
352 fDstHeader->SetEventId(fMCEventHeader->GetEventID());
353 fDstHeader->SetEventTime(fMCEventHeader->GetT());
354 fDstHeader->SetEventTimeTS((TTimeStamp)convert_double_to_timespec(fMCEventHeader->GetT()));
355 fDstHeader->SetB(fMCEventHeader->GetB());
356
357 // copy MC information to DST branch in case of simulated data
358 fMCInfoDst->SetB(fMCEventHeader->GetB());
359 fMCInfoDst->SetVertex(fMCEventHeader->GetX(), fMCEventHeader->GetY(), fMCEventHeader->GetZ());
360 fMCInfoDst->SetRotX(fMCEventHeader->GetRotX());
361 fMCInfoDst->SetRotY(fMCEventHeader->GetRotY());
362 fMCInfoDst->SetRotZ(fMCEventHeader->GetRotZ());
363 fMCInfoDst->GetMCTracks()->AbsorbObjects(fMCTracks);
364 } else { // experimental data
365 fDstHeader->SetRunId(fEventHeader->GetRunId());
366 fDstHeader->SetEventId(fEventHeader->GetEventId());
367 fDstHeader->SetEventTime(fEventHeader->GetEventTime());
368 fDstHeader->SetEventTimeTS(fEventHeader->GetEventTimeTS());
369 }
370
371 // calculate Z2in and Z2out:
372 Double_t Z2in = -100.0, Z2out = -100.0;
373 Double_t adcIn = -100.0, adcOut = -100.0;
374 Short_t Zin = -100;
375 Short_t Zout = -100;
376 if (fT0 && fBC1 && fBC2 && fBC3 && fBC4) {
377 BmnTrigDigit* digT0 = NULL;
378 Int_t t0Count = 0;
379 for (Int_t i = 0; i < fT0->GetEntriesFast(); i++) {
380 digT0 = (BmnTrigDigit*)fT0->At(i);
381 if (digT0->GetMod() == 0)
382 t0Count++;
383 }
384 if (t0Count == 1) {
385 Double_t t0Time = digT0->GetTime();
386
387 grabZ2(fBC1, fBC2, t0Time, Z2in, adcIn, fBC1Calib, fBC2Calib, Zin, true);
388 grabZ2(fBC3, fBC4, t0Time, Z2out, adcOut, 0, 0, Zout, false);
389 if (Z2out != -1000) {
390 Z2out = sqrt(Z2out);
391 Z2out = Z2out * fZCalib1 + fZCalib2;
392 Z2out = Z2out * Z2out;
393 }
394 // cout<<Z2out;
395 }
396 fDstHeader->SetZ2in(Z2in);
397 fDstHeader->SetZ2out(Z2out);
398 fDstHeader->SetADCin(adcIn);
399 fDstHeader->SetADCout(adcOut);
400 fDstHeader->SetZin(Zin);
401 } else if (fT0 && fBC1 && fBC2) {
402 BmnTrigDigit* digT0 = NULL;
403 Int_t t0Count = 0;
404 for (Int_t i = 0; i < fT0->GetEntriesFast(); i++) {
405 digT0 = (BmnTrigDigit*)fT0->At(i);
406 if (digT0->GetMod() == 0)
407 t0Count++;
408 }
409 if (t0Count == 1) {
410 Double_t t0Time = digT0->GetTime();
411
412 grabZ2(fBC1, fBC2, t0Time, Z2in, adcIn, fBC1Calib, fBC2Calib, Zin, true);
413 }
414 fDstHeader->SetZ2in(Z2in);
415 // fDstHead->SetZ2out(Z2out);
416 fDstHeader->SetADCin(adcIn);
417 // fDstHead->SetADCout(adcOut);
418 fDstHeader->SetZin(Zin);
419 }
420
421 Double_t Z1 = -100.0, Z2 = -100.0, Z3 = -100.0, Z4 = -100.0, ADC1 = -100.0, ADC2 = -100.0, ADC3 = -100.0,
422 ADC4 = -100.0;
423 if (fT0) {
424 Int_t t0Count = 0;
425 BmnTrigDigit* digT0 = NULL;
426 Double_t t0Time = -100000;
427 for (Int_t i = 0; i < fT0->GetEntriesFast(); i++) {
428 digT0 = (BmnTrigDigit*)fT0->At(i);
429 if (digT0->GetMod() == 0) {
430 t0Count++;
431 t0Time = digT0->GetTime();
432 }
433 }
434 if (t0Count == 1) {
435 if (fBC1 && fBC2) {
436 grabZ2OR(fBC1, fBC2, t0Time, Z1, Z2, ADC1, ADC2, true);
437 }
438 if (fBC3 && fBC4) {
439 grabZ2OR(fBC3, fBC4, t0Time, Z3, Z4, ADC3, ADC4, false);
440 }
441 }
442
443 // no calibration from single adc to charge yet
444 // fDstHeader->SetZ1(Z1);
445 // fDstHeader->SetZ2(Z2);
446 // fDstHeader->SetZ3(Z3);
447 // fDstHeader->SetZ4(Z4);
448
449 fDstHeader->SetADC1(ADC1);
450 fDstHeader->SetADC2(ADC2);
451 fDstHeader->SetADC3(ADC3);
452 fDstHeader->SetADC4(ADC4);
453 }
454
455 // printing progress bar in terminal (hidden option now)
456 if (fVerbose == -9999) {
457 if (gROOT->IsBatch()) {
458 if (fIEvent % 1000 == 0)
459 printf("%lld/%lld\n", fIEvent, fNEvents);
460 } else {
461 UInt_t fRunId = (fDstHeader) ? fDstHeader->GetRunId() : 0;
462
463 if (isExpData == 0)
464 printf(ANSI_COLOR_RED "SIMULATION RUN" ANSI_COLOR_RESET);
465 else {
466 printf(ANSI_COLOR_BLUE "RUN-" ANSI_COLOR_RESET);
467 printf(ANSI_COLOR_RED "%d" ANSI_COLOR_RESET, fRunId);
468 }
469 printf(ANSI_COLOR_BLUE ": [");
470
471 Float_t progress = fIEvent * 1.0 / fNEvents;
472 Int_t barWidth = 70;
473
474 Int_t pos = barWidth * progress;
475 for (Int_t i = 0; i < barWidth; ++i) {
476 if (i < pos)
477 printf("=");
478 else if (i == pos)
479 printf(">");
480 else
481 printf(" ");
482 }
483
484 printf("] " ANSI_COLOR_RESET);
485 printf(ANSI_COLOR_RED "%d%%\r" ANSI_COLOR_RESET, Int_t(progress * 100.0 + 0.5));
486 cout.flush();
487 }
488 } else {
489 LOG(info) << "Event #" << fNStartEvent + fIEvent;
490 if (fPrimaryVertex) {
491 TString strVertex = TString::Format(" vertex = %.3f:%.3f:%.3f", fPrimaryVertex->GetX(),
492 fPrimaryVertex->GetY(), fPrimaryVertex->GetZ());
493 LOG(info) << strVertex.Data();
494 }
495 if (fGlobalTracks)
496 LOG(info) << "\tglobal tracks = " << fGlobalTracks->GetEntries();
497 }
498 fIEvent++;
499
500 if (fIEvent == fNEvents)
501 printf("\n");
502
503 sw.Stop();
504 workTime += sw.RealTime();
505}
506
507// ---- Finish --------------------------------------------------------
509{
510 LOG(debug) << "Finish of BmnFillDstTask";
511
512 FairRootManager* ioman = FairRootManager::Instance();
513 FairSink* fSink = ioman->GetSink();
514 fSink->WriteObject(fRunHeader, "DstRunHeader", TObject::kSingleKey);
515
516 printf("Work time of BmnFillDstTask: %4.2f sec.\n", workTime);
517}
518
519// ---- Load the parameter container from the runtime database ------
521{
522 LOG(debug) << "SetParContainers of BmnFillDstTask";
523 // Load all necessary parameter containers from the runtime data base
524 /*
525 FairRunAna* ana = FairRunAna::Instance();
526 FairRuntimeDb* rtdb=ana->GetRuntimeDb();
527
528 <BmnFillDstTaskDataMember> = (<ClassPointer>*)
529 (rtdb->getContainer("<ContainerName>"));
530 */
531}
532
533void BmnFillDstTask::applyZCalibration()
534{
535 if (!fDoCalibration)
536 return;
537
538 // Read in the z-calibration file
539 TString gPathWorkdir = gSystem->Getenv("VMCWORKDIR");
540 TString gPathFullBC = gPathWorkdir + "/input/BC12Corrections.txt";
541 ifstream fin(gPathFullBC.Data());
542 int runBC = 0;
543 int safeindex = 0;
544 while (runBC != fRunNumber && safeindex != 20000) {
545 fin >> runBC;
546 fin >> fBC1Calib;
547 fin >> fBC2Calib;
548 safeindex = safeindex + 1;
549 }
550 if (fVerbose > 0)
551 if (safeindex == 20000)
552 cout << "run number not found in file " << gPathFullBC << endl;
553
554 TString gPathFull = gPathWorkdir + "/input/ZOutCorrections5.txt";
555
556 string line;
557 ifstream f(gPathFull.Data(), ios::in);
558 vector<Double_t> axisAttr;
559
560 while (!f.eof()) {
561 getline(f, line);
562
563 TString currString(line);
564 int run;
565 TString str_run(currString(0, 4));
566 run = str_run.Atoi();
567
568 if (run == fRunNumber) {
569 // cout<<"++++++++++++FILLDSTTASK!!!!"<<endl;
570 cout << currString.Data() << endl;
571 TString ab(currString(5, currString.Length()));
572 TString a(ab(0, ab.First(" ")));
573 // float a_float;
574 fZCalib1 = a.Atof();
575 TString c(ab(a.Length() + 1, ab.Length()));
576 // cout<<"c = "<<c.Data()<<endl;
577 TString b(c(0, c.First(" ")));
578 fZCalib2 = b.Atof();
579 // cout<<"ab = "<<ab.Data()<<", a = "<<fZCalib1<<", b = "<<fZCalib2<<endl;
580 }
581 }
582 // f.close();
583}
584
586{
587 stParticleInfo particle_info;
588 particle_info.A = 2;
589 particle_info.Z = 1;
590 mapParticleInfo.insert(pair<TString, stParticleInfo>("d", particle_info));
591 particle_info.A = 12;
592 particle_info.Z = 6;
593 mapParticleInfo.insert(pair<TString, stParticleInfo>("c", particle_info));
594 particle_info.A = 40;
595 particle_info.Z = 18;
596 mapParticleInfo.insert(pair<TString, stParticleInfo>("ar", particle_info));
597 particle_info.A = 84;
598 particle_info.Z = 36;
599 mapParticleInfo.insert(pair<TString, stParticleInfo>("kr", particle_info));
600 particle_info.A = 27;
601 particle_info.Z = 13;
602 mapParticleInfo.insert(pair<TString, stParticleInfo>("al", particle_info));
603 particle_info.A = 207;
604 particle_info.Z = 82;
605 mapParticleInfo.insert(pair<TString, stParticleInfo>("pb", particle_info));
606 particle_info.A = 119;
607 particle_info.Z = 50;
608 mapParticleInfo.insert(pair<TString, stParticleInfo>("sn", particle_info));
609 particle_info.A = 64;
610 particle_info.Z = 29;
611 mapParticleInfo.insert(pair<TString, stParticleInfo>("cu", particle_info));
612 particle_info.A = 1;
613 particle_info.Z = 1;
614 mapParticleInfo.insert(pair<TString, stParticleInfo>("h2", particle_info));
615 particle_info.A = 29;
616 particle_info.Z = 0;
617 mapParticleInfo.insert(pair<TString, stParticleInfo>("c2h4", particle_info));
618
619 return;
620}
void grabZ2(TClonesArray *TQDC_BC1, TClonesArray *bc2Data, double t0Time, double &z2, double &x, double BC1calib, double BC2calib, short &Z, bool isIncoming)
Definition ExtractZ2.h:41
void grabZ2OR(TClonesArray *TQDC_BC1, TClonesArray *bc2Data, double t0Time, double &z2A, double &z2B, double &x, double &y, bool isIncoming)
Definition ExtractZ2.h:82
friend F32vec4 sqrt(const F32vec4 &a)
Definition P4_F32vec4.h:34
int i
Definition P4_F32vec4.h:22
float f
Definition P4_F32vec4.h:21
#define ANSI_COLOR_RED
Definition BmnMath.h:16
#define ANSI_COLOR_RESET
Definition BmnMath.h:18
#define ANSI_COLOR_BLUE
Definition BmnMath.h:17
UInt_t GetEventId()
TTimeStamp GetEventTimeTS()
Double_t GetZmin() const
Double_t GetYmin() const
virtual Double_t GetBz(Double_t x, Double_t y, Double_t z)
Double_t GetZmax() const
Double_t GetYmax() const
Double_t GetXmin() const
virtual Double_t GetBy(Double_t x, Double_t y, Double_t z)
Double_t GetXmax() const
virtual Double_t GetBx(Double_t x, Double_t y, Double_t z)
Double_t GetScale() const
Definition BmnFieldMap.h:90
virtual void SetParContainers()
virtual void Finish()
virtual InitStatus Init()
virtual void Exec(Option_t *opt)
virtual InitStatus ReInit()
void SetB(Double_t b)
TClonesArray * GetMCTracks() const
rot. around z-axis [rad]
void SetRotX(Double_t rotx)
void SetRotZ(Double_t rotz)
void SetVertex(Double_t x, Double_t y, Double_t z)
void SetRotY(Double_t roty)
BmnTask.
Definition BmnTask.h:13
Double_t GetTime() const
Short_t GetMod() const
Double_t GetZ() const
Definition CbmVertex.h:60
Double_t GetX() const
Definition CbmVertex.h:58
Double_t GetY() const
Definition CbmVertex.h:59
void SetEventId(UInt_t event_id)
void SetADCin(Double_t adcin)
void SetADC3(Double_t adc3)
void SetADCout(Double_t adcout)
void SetZ2out(Double_t z2out)
void SetB(Double_t b)
void SetADC4(Double_t adc4)
void SetZin(Short_t Zin)
void SetADC1(Double_t adc1)
void SetADC2(Double_t adc2)
void SetZ2in(Double_t z2in)
void SetPeriodId(UInt_t period_id)
void SetEventTimeTS(TTimeStamp event_time)
void SetTargetZ(Int_t target_z)
void SetFieldName(TString field_name)
void SetFieldType(Int_t field_type)
void SetPeriodRun(UInt_t period_number, UInt_t run_number)
void SetTargetA(Int_t target_a)
void SetStartTime(TTimeStamp start_time)
void SetBeamZ(Int_t beam_z)
void SetBeamA(Int_t beam_a)
void SetFieldScale(Double_t field_scale)
void SetFinishTime(TTimeStamp end_time)
void SetBeamEnergy(Float_t beam_energy)
double * GetEnergy()
get energy of the current run
Definition UniRun.h:117
static UniRun * GetRun(int period_number, int run_number)
get run from the database
Definition UniRun.cxx:177
TDatime * GetEndDatetime()
get end datetime of the current run
Definition UniRun.h:105
TString GetBeamParticle()
get beam particle of the current run
Definition UniRun.h:113
TDatime GetStartDatetime()
get start datetime of the current run
Definition UniRun.h:103
TString GetTargetParticle()
get target particle of the current run
Definition UniRun.h:115
struct timespec convert_double_to_timespec(double sec)
-clang-format
STL namespace.