FairRoot/PandaRoot
tracks_BARREL_1000.C
Go to the documentation of this file.
1 int tracks_BARREL_1000(char* type="proof", Int_t nofFiles = 1, TString proofName="") {
2 
3  Int_t nparts = 22;
4  Int_t pid = 13;
5  Int_t nStations = 3;
6 
7  Int_t nEvents = 0;
8 
9  nEvents = nofFiles*1000;
10  TString workDir = gSystem->WorkingDirectory();
11 
12  if ( nStations != 3 && nStations != 4 ) {
13  cout << "WRONG number of stations, only 3 or 4 allowed." << endl;
14  return;
15  }
16 
17  // ========================================================================
18  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
19  Int_t iVerbose = 0;
20 
21  // Parameter file
22  TString parFile = Form("%s/params_%dPart_n1000.root",workDir.Data(),nparts);
23 
24  // Output file
25  TString outFile = Form("tracks_%dPart_n%d.root",nparts,nEvents);
26 
27  // ---- Load libraries -------------------------------------------------
28  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
29  rootlogon();
30  TString sysFile = gSystem->Getenv("VMCWORKDIR");
31  // ------------------------------------------------------------------------
32 
33  // --- Now choose concrete engines for the different tasks -------------
34  // ------------------------------------------------------------------------
35 
36  // In general, the following parts need not be touched
37  // ========================================================================
38 
39  // ----- Timer --------------------------------------------------------
40  TStopwatch timer;
41  timer.Start();
42  // ------------------------------------------------------------------------
43 
44  // ----- Digitization run -------------------------------------------
45  FairRunAna *fRun= new FairRunAna(type,proofName.Data());
46  fRun->SetOutputFile(outFile.Data());
47 
48  fRun->SetInputFile(Form("file://%s/points_%dPart_n1000_f%d.root",workDir.Data(),nparts,0));
49  for ( Int_t ifile = 1 ; ifile < nofFiles ; ifile++ )
50  fRun->AddFile (Form("file://%s/points_%dPart_n1000_f%d.root",workDir.Data(),nparts,ifile));
51 
52 
53  // ------------------------------------------------------------------------
54 
55  // ----- Parameter database --------------------------------------------
56  TString allDigiFile = sysFile+"/macro/params/all.par";
57  if ( nStations == 4 ) allDigiFile = sysFile+"/macro/params/all4.par";
58 
59  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
60  FairParRootFileIo* parInput1 = new FairParRootFileIo();
61  parInput1->open(parFile.Data());
62 
63  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
64  parIo1->open(allDigiFile.Data(),"in");
65 
66  rtdb->setFirstInput(parInput1);
67  rtdb->setSecondInput(parIo1);
68  // ------------------------------------------------------------------------
69 
70  // ################################################################## MVD
71  // ----- MDV digi producer ----------------------------------------
73  mvddigi->SetVerbose(iVerbose);
74  fRun->AddTask(mvddigi);
75  // ----- MDV cluster producer -----------------------------------
76  Double_t chargecut = 5000., pixelrad=1.8; // one day this will move to the parameter db.
78  mvdmccls->SetVerbose(iVerbose);
79  fRun->AddTask(mvdmccls);
80 
81  // ################################################################## STT
83  // PndSttHitProducerRealFast* sttHitProducer = new PndSttHitProducerRealFast();
84  fRun->AddTask(sttHitProducer);
85 
86  // ################################################################## GEM
87  // ----- GEM digi producer --------------------------------------
88  Int_t verboseLevel = 0;
89  PndGemDigitize* gemDigitize = new PndGemDigitize("GEM Digitizer", verboseLevel);
90  fRun->AddTask(gemDigitize);
91  // ----- GEM hit producer ---------------------------------------
92  PndGemFindHits* gemFindHits = new PndGemFindHits("GEM Hit Finder", verboseLevel);
93  fRun->AddTask(gemFindHits);
94 
95  // ----- GEM Ideal Hit Producer ---------------------------------------
96  //PndGemIdealHitProducer* gemHitProducer = new PndGemIdealHitProducer("GEM Ideal hit producer", verboseLevel);
97  //fRun->AddTask(gemHitProducer);
98 
99  // ##################################################################
100 
101  PndBarrelTrackFinder* barrelTF = new PndBarrelTrackFinder();
102  barrelTF->SetVerbose(0);
103  barrelTF->UseMvdSttGem(kTRUE,kTRUE,kTRUE);
104  fRun->AddTask(barrelTF);
105 
106  PndBarrelTrackFinderQA* barrelQA = new PndBarrelTrackFinderQA();
107  barrelQA->SetVerbose(0);
108  barrelQA->UseMvdSttGem(kTRUE,kTRUE,kTRUE);
109  fRun->AddTask(barrelQA);
110 
111  // ----- Intialise and run --------------------------------------------
112  fRun->Init();
113 
114  // fRun->SetProofServerName(proofName);
115  // TString anaType = type;
116  // if ( anaType.Contains("local") )
117  fRun->Run(0,nEvents);
118  // else
119  // fRun->Run(type,0,nEvents);
120 
121  rtdb->saveOutput();
122  rtdb->print();
123  // ------------------------------------------------------------------------
124 
125  // ----- Finish -------------------------------------------------------
126  timer.Stop();
127  Double_t rtime = timer.RealTime();
128  Double_t ctime = timer.CpuTime();
129  cout << endl << endl;
130  cout << "Macro finished succesfully." << endl;
131  cout << "Output file is " << outFile << endl;
132  cout << "Parameter file is " << parFile << endl;
133  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
134  cout << endl;
135  // ------------------------------------------------------------------------
136 
137 
138  return 0;
139 }
140 
141 
142 
143 /*
144 
145 Warning in <TClass::TClass>: no dictionary for class pair<double,FairTimeStamp*> is available
146 Error in <Pair Emulation Building>: const char* is not yet supported in pair emulation
147 Error in <Pair Emulation Building>: const char* is not yet supported in pair emulation
148 Error in <Pair Emulation Building>: const char* is not yet supported in pair emulation
149 Error in <Pair Emulation Building>: const char* is not yet supported in pair emulation
150 Error in <TClass::BuildRealData>: Cannot find any ShowMembers function for PndSdsCalcStrip!
151 
152 */
153 
154 /*
155 
156 Warning in <TClass::TClass>: no dictionary for class pair<double,FairTimeStamp*> is available
157 Error in <Pair Emulation Building>: const char* is not yet supported in pair emulation
158 Error in <Pair Emulation Building>: const char* is not yet supported in pair emulation
159 Error in <Pair Emulation Building>: const char* is not yet supported in pair emulation
160 Error in <Pair Emulation Building>: const char* is not yet supported in pair emulation
161 Error in <TClass::BuildRealData>: Cannot find any ShowMembers function for PndSdsCalcStrip!
162 Warning in <TClass::TClass>: no dictionary for class BinaryFunctor is available
163 Error in <TStreamerInfo::Build:>: PndSdsPixelClusterTask: BinaryFunctor* has no streamer or dictionary, data member fFunctor will not be saved
164 Error in <TStreamerInfo::Build:>: PndSdsPixelClusterTask: BinaryFunctor* has no streamer or dictionary, data member fStartFunctor will not be saved
165 Warning in <TClass::TClass>: no dictionary for class PndSdsPixelBackMapping is available
166 Error in <TStreamerInfo::Build:>: PndSdsPixelClusterTask: PndSdsPixelBackMapping* has no streamer or dictionary, data member fBackMapping will not be saved
167 Warning in <TClass::TClass>: no dictionary for class PndSdsFEAmpModelSimple is available
168 Error in <TStreamerInfo::Build:>: PndSdsFE: PndSdsFEAmpModelSimple* has no streamer or dictionary, data member fFrontEndModel will not be saved
169 Error in <Pair Emulation Building>: const char* is not yet supported in pair emulation
170 Error in <Pair Emulation Building>: const char* is not yet supported in pair emulation
171 Error in <TStreamerInfo::Build:>: PndSdsStripClusterTask: BinaryFunctor* has no streamer or dictionary, data member fFunctor will not be saved
172 Error in <TClass::New>: cannot create object of class PndSdsChargeWeightingAlgorithms
173 
174 */
PndGemFindHits * gemFindHits
int verboseLevel
Definition: Lars/runMvdSim.C:7
TString outFile
Definition: hit_dirc.C:17
int pid()
Double_t chargecut
Definition: runclust.C:44
PndMvdStripClusterTask * mvdmccls
Definition: runclust.C:45
PndSttHitProducerRealFast * sttHitProducer
TString allDigiFile
Definition: hit_muo.C:36
FairRunAna * fRun
Definition: hit_dirc.C:58
TString sysFile
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
int tracks_BARREL_1000(char *type="proof", Int_t nofFiles=1, TString proofName="")
void SetVerbose(Int_t iVerbose)
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
PndGemDigitize * gemDigitize
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
void UseMvdSttGem(const Bool_t useMvd, const Bool_t useStt, const Bool_t useGem)
Int_t iVerbose
PndMvdDigiTask * mvddigi
Double_t rtime
Definition: hit_dirc.C:113