exp1803_reco.C

макрос реконструкции - Vitaliy Schetinin, 04/12/2018 06:35 PM

Download (3.51 KB)

 
1
void exp1803_reco(Int_t nEvents = 1000) {
2
  //---------------------Files-----------------------------------------------
3
  TString inFile = "sim_digi.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
  // ------------------------BeamDetTrackFinger--------------------------------
19
  Int_t verbose = 1; // 1 - only standard log print, 2 - print digi information 
20
  ERBeamDetTrackFinder* trackFinder = new ERBeamDetTrackFinder(verbose);
21
  run->AddTask(trackFinder);
22
  // -----------------------BeamDetTrackPID----------------------------------
23
  Int_t Z = 2, A = 6, Q = 2;
24
  TString ionName = "6He";
25
  ERBeamDetPID* pid = new ERBeamDetPID(verbose);
26
  pid->SetBoxPID(0., 1000., 0., 1000.);
27
  pid->SetOffsetToF(0.);
28
  pid->SetProbabilityThreshold(0);
29
  pid->SetIonMass(5.60554);
30
  pid->SetPID(1000020060);
31
  run->AddTask(pid);  
32
  // ------- QTelescope TrackFinder -------------------------------------------
33
  ERQTelescopeTrackFinder* qtelescopeTrackFinder = new ERQTelescopeTrackFinder(verbose);
34

    
35
  qtelescopeTrackFinder->SetHitStation("T1", "T1_DoubleSi_SD2_XY_0");
36
  qtelescopeTrackFinder->SetHitStation("T2", "T2_DoubleSi_SD2_XY_1");
37

    
38
  qtelescopeTrackFinder->SetStripEdepRange(0., 100.);          // [GeV]
39
  //qtelescopeTrackFinder->SetTargetPoint(0., 0., 0.);
40
  // qtelescopeTrackFinder->SetStripEdepRange(0.0097, 100.);   // [GeV]
41
  // qtelescopeTrackFinder->SetEdepDiffXY(5.);                 // [GeV]
42
  qtelescopeTrackFinder->SetEdepMaxDiffXY(0.5); 
43
  run->AddTask(qtelescopeTrackFinder);
44

    
45
  // ------- QTelescope PID -------------------------------------------
46
  ERQTelescopePID* qtelescopePID = new ERQTelescopePID(verbose);
47

    
48
  //qtelescopePID->SetUserCut("CUTG && ERQTelescopeSiDigi_T2_DoubleSi_SD2_XY_1_X.fEdep>0.003");
49

    
50
  qtelescopePID->SetStationParticle("T1_DoubleSi_SD2_XY_0",1000020030);
51
  qtelescopePID->SetStationParticle("T2_DoubleSi_SD2_XY_1",1000010030);
52
  run->AddTask(qtelescopePID); 
53

    
54
  // -----------Runtime DataBase info ---------------------------------------
55
  FairRuntimeDb* rtdb = run->GetRuntimeDb();
56
  FairParRootFileIo*  parInput = new FairParRootFileIo();
57
  parInput->open(parFile.Data(), "UPDATE");
58
  rtdb->setFirstInput(parInput);
59
  // -----   Intialise and run   --------------------------------------------
60
  FairLogger::GetLogger()->SetLogScreenLevel("INFO");
61
  
62
  run->Init();
63
  run->Run(0, nEvents);
64
  //run->Run(27, 28);
65
  // ------------------------------------------------------------------------;
66
  rtdb->setOutput(parInput);
67
  rtdb->saveOutput();
68
  // -----   Finish   -------------------------------------------------------
69
  timer.Stop();
70
  Double_t rtime = timer.RealTime();
71
  Double_t ctime = timer.CpuTime();
72
  cout << endl << endl;
73
  cout << "Macro finished succesfully." << endl;
74
  cout << "Output file writen:  "    << outFile << endl;
75
  cout << "Parameter file writen " << parFile << endl;
76
  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
77
  cout << endl;
78
  // ------------------------------------------------------------------------
79

    
80
}