exp1803_reco_BeamDetEloss.C
1 |
void exp1803_reco_BeamDetEloss(Int_t nEvents = 100) { |
---|---|
2 |
//---------------------Files-----------------------------------------------
|
3 |
TString inFile = "sim.root";
|
4 |
TString outFile = "reco.root";
|
5 |
TString parFile = "par.root";
|
6 |
TString parOutFile = "parOut.root";
|
7 |
// ----- Timer --------------------------------------------------------
|
8 |
TStopwatch timer; |
9 |
timer.Start(); |
10 |
// ----- Digitization run ---------------------------------------------
|
11 |
ERRunAna *run= new ERRunAna();
|
12 |
run->SetInputFile(inFile); |
13 |
run->SetOutputFile(outFile); |
14 |
// ------------------------------------------------------------------------
|
15 |
//-------- Set MC event header --------------------------------------------
|
16 |
EREventHeader* header = new EREventHeader();
|
17 |
run->SetEventHeader(header); |
18 |
|
19 |
|
20 |
ERBeamDetDigitizer* beamDetDigitizer = new ERBeamDetDigitizer(1); |
21 |
// beamDetDigitizer->SetMWPCElossThreshold(0.006);
|
22 |
// beamDetDigitizer->SetToFElossThreshold(0.006);
|
23 |
// beamDetDigitizer->SetToFElossSigmaOverEloss(0);
|
24 |
// beamDetDigitizer->SetToFTimeSigma(1e-10);
|
25 |
run->AddTask(beamDetDigitizer); |
26 |
|
27 |
|
28 |
// ------------------------BeamDetDigitizer--------------------------------
|
29 |
Int_t verbose = 1; // 1 - only standard log print, 2 - print digi information |
30 |
ERBeamDetTrackFinder* trackFinder = new ERBeamDetTrackFinder(verbose);
|
31 |
run->AddTask(trackFinder); |
32 |
// -----------------------BeamDetTrackPID----------------------------------
|
33 |
Int_t Z = 2, A = 6, Q = 2; |
34 |
TString ionName = "6He";
|
35 |
ERBeamDetPID* pid = new ERBeamDetPID(verbose);
|
36 |
pid->SetIonMass(5.60554); |
37 |
pid->SetBoxPID(0., 1000., 0., 1000.); |
38 |
pid->SetOffsetToF(0.);
|
39 |
pid->SetProbabilityThreshold(0);
|
40 |
pid->SetPID(1000020060);
|
41 |
run->AddTask(pid); |
42 |
// -----------Runtime DataBase info ---------------------------------------
|
43 |
FairRuntimeDb* rtdb = run->GetRuntimeDb(); |
44 |
FairParRootFileIo* parInput = new FairParRootFileIo();
|
45 |
parInput->open(parFile.Data(), "UPDATE");
|
46 |
rtdb->setFirstInput(parInput); |
47 |
// ----- Intialise and run --------------------------------------------
|
48 |
FairLogger::GetLogger()->SetLogScreenLevel("DEBUG");
|
49 |
|
50 |
run->Init(); |
51 |
run->Run(0, nEvents);
|
52 |
// ------------------------------------------------------------------------;
|
53 |
rtdb->setOutput(parInput); |
54 |
rtdb->saveOutput(); |
55 |
// ----- Finish -------------------------------------------------------
|
56 |
timer.Stop(); |
57 |
Double_t rtime = timer.RealTime(); |
58 |
Double_t ctime = timer.CpuTime(); |
59 |
cout << endl << endl; |
60 |
cout << "Macro finished succesfully." << endl;
|
61 |
cout << "Output file writen: " << outFile << endl;
|
62 |
cout << "Parameter file writen " << parFile << endl;
|
63 |
cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl; |
64 |
cout << endl; |
65 |
// ------------------------------------------------------------------------
|
66 |
|
67 |
} |