FairRoot/PandaRoot
recoJPsi.C
Go to the documentation of this file.
1 /***
2 Reconstruct the JPsi from the TPC tracks : Dipak
3 ***/
4 {
5 
6  // ========================================================================
7  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
8  Int_t iVerbose = 1;
9 
10  // Input file (MC events)
11  // TString inFile = "dpmtest.root";
12  TString inFile = "../../macro/lhetrack/test.raw.root";
13 
14 
15  // Output file
16  TString outFile = "test.reco.root";
17 
18 
19 
20  // ---- Load libraries -------------------------------------------------
21  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
22  basiclibs();
23  gSystem->Load("libGeoBase");
24  gSystem->Load("libParBase");
25  gSystem->Load("libBase");
26  gSystem->Load("libPndData");
27  gSystem->Load("libField");
28  gSystem->Load("libGen");
29  gSystem->Load("libPassive");
30  gSystem->Load("libtpc");
31  gSystem->Load("libLHETrack");
32  // gSystem->Load("libfastsim");
33  gSystem->Load("libcharmtask");
34 
35  // ------------------------------------------------------------------------
36 
37 
38  // --- Now choose concrete engines for the different tasks -------------
39  // ------------------------------------------------------------------------
40 
41 
42  // In general, the following parts need not be touched
43  // ========================================================================
44 
45 
46  // ----- Timer --------------------------------------------------------
47  TStopwatch timer;
48  timer.Start();
49  // ------------------------------------------------------------------------
50 
51 
52 
53  // ----- Digitization run -------------------------------------------
54  FairRunAna *fRun= new FairRunAna();
55  fRun->SetInputFile(inFile);
56  fRun->SetOutputFile(outFile);
57  // ------------------------------------------------------------------------
58 
59 
60  /*
61  // ----- Parameter database --------------------------------------------
62  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
63  FairParRootFileIo* parInput1 = new FairParRootFileIo();
64  parInput1->open(parFile.Data());
65  //FairParAsciiFileIo* parInput2 = new FairParAsciiFileIo();
66  //TString stsDigiFile = gSystem->Getenv("VMCWORKDIR");
67  //stsDigiFile += "/parameters/sts/sts_digi_new_standard.par";
68  //parInput2->open(stsDigiFile.Data(),"in");
69  rtdb->setFirstInput(parInput1);
70  //rtdb->setSecondInput(parInput2);
71  */
72  // fRun->LoadGeometry();
73  // ------------------------------------------------------------------------
74 
75  //Add your Task
77  fRun->AddTask(jpsiexample);
78 
79 
80  // Number of events to process
81  Int_t nEvents = 3000;
82 
83  // ----- Intialise and run --------------------------------------------
84  fRun->Init();
85  fRun->Run(0, nEvents); //process the number selected
86  // fRun->Run(); // process all the events
87  // ------------------------------------------------------------------------
88 
89 
90 
91  // ----- Finish -------------------------------------------------------
92 
93 
94  timer.Stop();
95  Double_t rtime = timer.RealTime();
96  Double_t ctime = timer.CpuTime();
97  cout << endl << endl;
98  cout << "Macro finished succesfully." << endl;
99  // cout << "Output file is " << outFile << endl;
100  // cout << "Parameter file is " << parFile << endl;
101  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
102  cout << endl;
103  // ------------------------------------------------------------------------
104 
105 
106 }
TString inFile
Definition: recoJPsi.C:12
basiclibs()
TStopwatch timer
Definition: recoJPsi.C:47
FairRunAna * fRun
Definition: recoJPsi.C:54
TString outFile
Definition: recoJPsi.C:16
Double_t
PndJPsiExample * jpsiexample
Definition: recoJPsi.C:76
Int_t iVerbose
Double_t ctime
Definition: recoJPsi.C:96
Double_t rtime
Definition: recoJPsi.C:95
Int_t nEvents
Definition: recoJPsi.C:81