FairRoot/PandaRoot
Functions
runLumiPixel5cCombFilt.C File Reference

Go to the source code of this file.

Functions

int runLumiPixel5cCombFilt (const int nEvents=10, const int startEvent=0, TString storePath="tmpOutput", const int verboseLevel=0, const double mom=15, const double dX=0, const double dY=0)
 

Function Documentation

int runLumiPixel5cCombFilt ( const int  nEvents = 10,
const int  startEvent = 0,
TString  storePath = "tmpOutput",
const int  verboseLevel = 0,
const double  mom = 15,
const double  dX = 0,
const double  dY = 0 
)

Definition at line 1 of file runLumiPixel5cCombFilt.C.

References ctime, Double_t, fRun, PndLmdSigCleanTask::Init(), MCFile, mom, nEvents, outFile, parFile, parInput1, rtdb, rtime, PndLmdSigCleanTask::SetDX(), PndLmdSigCleanTask::SetDY(), PndLmdSigCleanTask::SetXY(), startEvent, storePath, timer, TString, and verboseLevel.

2 {
3  // ========================================================================
4  // Input file (MC events)
5  TString MCFile = storePath+"/Lumi_MC_";
6  MCFile += startEvent;
7  MCFile += ".root";
8  // TString DigiFile = storePath+"/Lumi_digi_";
9  // DigiFile += startEvent;
10  // DigiFile += ".root";
11  // // Digi file
12  // TString RecoFile = storePath;
13  // if(mergedHits)RecoFile+="/Lumi_recoMerged_";
14  // else RecoFile+="/Lumi_reco_";
15  // RecoFile += startEvent;
16  // RecoFile += ".root";
17  // // TCand file
18  // TString CandFile = storePath+"/Lumi_TCand_";
19  // CandFile += startEvent;
20  // CandFile += ".root";
21  // Parameter file
22  TString parFile = storePath+"/Lumi_Params_";
23  parFile += startEvent;
24  parFile += ".root";
25  // Track file
26  TString TrkFile = storePath+"/Lumi_Track_";
27  TrkFile += startEvent;
28  TrkFile += ".root";
29  // Geane output file
30  TString GeaneFile = storePath+"/Lumi_Geane_";
31  GeaneFile += startEvent;
32  GeaneFile += ".root";
33 
34  //Output file
35  TString outFile = storePath+"/Lumi_GeaneFiltered_";
36  outFile += startEvent;
37  outFile += ".root";
38 
39 
40  // // ---- Load libraries -------------------------------------------------
41  // gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
42  // gSystem->Load("libSds");
43  // gSystem->Load("libSdsReco");
44  // gSystem->Load("libLmd");
45  // gSystem->Load("libLmdReco");
46  // gSystem->Load("libLmdTrk");
47  // // ------------------------------------------------------------------------
48 
49  std::cout << "MCFile : " << MCFile.Data()<< std::endl;
50  // std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
51  // std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
52  // std::cout << "TCandFile: " << CandFile.Data()<< std::endl;
53  std::cout << "TrackFile: " << TrkFile.Data()<< std::endl;
54  std::cout << "GeaneFile: " << GeaneFile.Data()<< std::endl;
55  std::cout << "OutputFile: " << outFile.Data()<< std::endl;
56  // --- Now choose concrete engines for the different tasks -------------
57  // -----------------------------------------------------------------------------------
58 
59 
60  // In general, the following parts need not be touched
61  // ========================================================================
62 
63 
64 
65 
66  // ----- Timer ------ --------------------------------------------------
67  TStopwatch timer;
68  timer.Start();
69  // ------------------------------------------------------------------------
70 
71 
72  // ----- Reconstruction run -------------------------------------------
73  FairRunAna *fRun= new FairRunAna();
74  fRun->SetInputFile(MCFile);
75  // fRun->AddFriend(DigiFile);
76  // fRun->AddFriend(RecoFile);
77  // fRun->AddFriend(CandFile);
78  fRun->AddFriend(TrkFile);
79  fRun->AddFriend(GeaneFile);
80  fRun->SetOutputFile(outFile);
81  // ------------------------------------------------------------------------
82 
83 
84  // ----- Parameter database --------------------------------------------
85  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
86  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
87  parInput1->open(parFile.Data());
88  rtdb->setFirstInput(parInput1);
89 
90 
91  // =========================================================================
92  // ====== Cleaning ======
93  // =========================================================================
94  Double_t fpBeam = mom;
95  TString dir = "TMVAweights/";
96  PndLmdSigCleanTask* lmdclean = new PndLmdSigCleanTask(fpBeam, dir);
97  lmdclean->SetXY(true);
98  lmdclean->SetDX(dX);
99  lmdclean->SetDY(dY);
100  lmdclean->SetVerbose(verboseLevel);
101  fRun->AddTask(lmdclean);
102  rtdb->setOutput(parInput1);
103  rtdb->print();
104  // =========================================================================
105 
106  // ----- Intialise and run --------------------------------------------
107  fRun->Init();
108  fRun->Run(0,nEvents);
109  // ------------------------------------------------------------------------
110  rtdb->saveOutput();
111  rtdb->print();
112  // ----- Finish -------------------------------------------------------
113  timer.Stop();
114  Double_t rtime = timer.RealTime();
115  Double_t ctime = timer.CpuTime();
116  cout << endl << endl;
117  cout << "Macro finished succesfully." << endl;
118  cout << "Output file is " << outFile << endl;
119  cout << "Parameter file is " << parFile << endl;
120  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
121  cout << endl;
122  // ------------------------------------------------------------------------
123  return 0;
124 }
int verboseLevel
Definition: Lars/runMvdSim.C:7
virtual InitStatus Init()
TString outFile
Definition: hit_dirc.C:17
Int_t startEvent
TString storePath
Double_t mom
Definition: plot_dirc.C:14
FairRunAna * fRun
Definition: hit_dirc.C:58
void SetDX(double dx)
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
void SetXY(bool setXY)
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
void SetDY(double dy)
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113