FairRoot/PandaRoot
Functions
runLumiPixel7TrksQA.C File Reference

Go to the source code of this file.

Functions

int runLumiPixel7TrksQA (const int nEvents=100000, const int startEvent=0, TString storePath="tmpOutnewDesign", const int verboseLevel=5, const double Plab=15, const bool wrAllMC=true, const bool isClean=false)
 

Function Documentation

int runLumiPixel7TrksQA ( const int  nEvents = 100000,
const int  startEvent = 0,
TString  storePath = "tmpOutnewDesign",
const int  verboseLevel = 5,
const double  Plab = 15,
const bool  wrAllMC = true,
const bool  isClean = false 
)

Definition at line 1 of file runLumiPixel7TrksQA.C.

References ctime, Double_t, fRun, gGeoManager, MCFile, nEvents, parFile, parInput1, RecoFile, rtdb, rtime, PndLmdTrkQTask::SetWriteMC(), 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 RecoMergedFile = storePath+"/Lumi_recoMerged_";
9  RecoMergedFile += startEvent;
10  RecoMergedFile += ".root";
11  TString RecoFile = storePath+"/Lumi_reco_";
12  RecoFile += startEvent;
13  RecoFile += ".root";
14  // TCand file
15  TString CandFile = storePath+"/Lumi_TCand_";
16  CandFile += startEvent;
17  CandFile += ".root";
18  // Parameter file
19  TString parFile = storePath+"/Lumi_Params_";
20  parFile += startEvent;
21  parFile += ".root";
22  // Track file
23  TString TrkFile = storePath+"/Lumi_Track_";
24  TrkFile += startEvent;
25  TrkFile += ".root";
26  // Geane file
27  TString GeaFile;
28  if(isClean){
29  GeaFile = storePath+"/Lumi_GeaneFiltered_";
30  GeaFile += startEvent;
31  GeaFile += ".root";
32  }
33  else{
34  GeaFile = storePath+"/Lumi_Geane_";
35  GeaFile += startEvent;
36  GeaFile += ".root";
37  }
38  // Output file
39  TString DumFile = storePath+"/Lumi_TrksQA_";
40  DumFile += startEvent;
41  DumFile += ".root";
42 
43  // // ---- Load libraries -------------------------------------------------
44 // gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
45 // //-lRooFit –lRooFitCore -lMinuit
46 
47 // gSystem->Load("libSds");
48 // gSystem->Load("libSdsReco");
49 // gSystem->Load("libLmd");
50 // gSystem->Load("libLmdReco");
51 // gSystem->Load("libLmdTrk");
52 // gSystem->Load("libLmdTool");
53 // // ------------------------------------------------------------------------
54 
55  std::cout << "MCFile : " << MCFile.Data()<< std::endl;
56  std::cout << "RecoFile: " << RecoFile.Data()<< std::endl;
57  std::cout << "TCandFile: " << CandFile.Data()<< std::endl;
58  std::cout << "TrackFile: " << TrkFile.Data()<< std::endl;
59  std::cout << "GeaneFile: " << GeaFile.Data()<< std::endl;
60 
61 
62  // ----- Timer --------------------------------------------------------
63  TStopwatch timer;
64  timer.Start();
65  // ------------------------------------------------------------------------
66 
67  FairRunAna *fRun= new FairRunAna();
68  FairFileSource input_source(GeaFile);
69  input_source.AddFriend(TrkFile);
70  input_source.AddFriend(CandFile);
71  input_source.AddFriend(RecoFile);
72  input_source.AddFriend(MCFile);
73  input_source.AddFriend(RecoMergedFile);
74 
75  fRun->SetSource(&input_source);
76  fRun->SetOutputFile(DumFile);
77 
78  // ----- Parameter database --------------------------------------------
79  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
80  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
81  parInput1->open(parFile.Data(),"UPDATE");
82  rtdb->setFirstInput(parInput1);
83 
84  PndLmdTrkQTask *lmdqa;
85  if(isClean){
86  lmdqa = new PndLmdTrkQTask(Plab,"LMDCleanTrack", "LMDPndTrackFilt");//clean reconstructed (with runLumiPixel5bCleanSig.C applied before!)
87  }
88  else{
89  lmdqa = new PndLmdTrkQTask(Plab,"GeaneTrackFinal", "LMDPndTrack");//raw reconstructed
90  }
91  //PndLmdTrkQTask *lmdqa = new PndLmdTrkQTask(Plab,"GeaneTrackFinal");//raw reconstructed
92  // PndLmdTrkQTask *lmdqa = new PndLmdTrkQTask(Plab,"LMDCleanTrack");//clean reconstructed (with runLumiPixel5bCleanSig.C applied before!)
93 
94  lmdqa->SetVerbose(verboseLevel);
95  lmdqa->SetWriteMC(wrAllMC);
96  fRun->AddTask(lmdqa);
97  fRun->SetGenerateRunInfo(kFALSE);
98  //rtdb->setOutput(parInput1);
99  // rtdb->print();
100  fRun->Init();
101  fRun->Run(0,nEvents);
102  // ----- Finish -------------------------------------------------------
103  timer.Stop();
104  Double_t rtime = timer.RealTime();
105  Double_t ctime = timer.CpuTime();
106  cout << endl << endl;
107  cout << "Macro finished succesfully." << endl;
108  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
109  cout << endl;
110  // ------------------------------------------------------------------------
111 
112 
113  // temporary fix to avoid double frees at the destruction of te program for pandaroot/fairroot with root6
114  gGeoManager->GetListOfVolumes()->Delete();
115  gGeoManager->GetListOfShapes()->Delete();
116  delete gGeoManager;
117 
118  return 0;
119 }
int verboseLevel
Definition: Lars/runMvdSim.C:7
TString RecoFile
void SetWriteMC(bool wr)
Int_t startEvent
TString storePath
TGeoManager * gGeoManager
FairRunAna * fRun
Definition: hit_dirc.C:58
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
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
TString MCFile
Double_t rtime
Definition: hit_dirc.C:113