FairRoot/PandaRoot
prod_sof.C
Go to the documentation of this file.
1 int prod_sof(TString outpre="", Float_t Mom=15.15, int mode=9999, int run=-1, int applyfull=0)
2 {
3  // Parameter file
4  TString inParFile = outpre+"_par.root";
5 
6  // PID table with selection thresholds; can be modified by the user
7  TString pidParFile = TString(gSystem->Getenv("VMCWORKDIR"))+"/macro/params/all.par";
8 
9  // Output file
10  TString outFile = outpre+"_sof.root";
11 
12  // ------------------------------------------------------------------------
13  FairLogger::GetLogger()->SetLogToFile(kFALSE);
14 
15  // ----- Reconstruction run -------------------------------------------
16  FairRunAna *fRun= new FairRunAna();
17  fRun->SetInputFile(outpre+"_pid.root");
18  fRun->SetOutputFile(outFile);
19  fRun->SetGenerateRunInfo(kFALSE);
20 
21  // *** initialization
22  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
23 
24  // *** setup parameter database
25  FairParRootFileIo* parIO = new FairParRootFileIo();
26  parIO->open(inParFile);
27  FairParAsciiFileIo* parIOPid = new FairParAsciiFileIo();
28  parIOPid->open(pidParFile.Data(),"in");
29 
30  rtdb->setFirstInput(parIO);
31  rtdb->setSecondInput(parIOPid);
32  rtdb->setOutput(parIO);
33 
34  //---------------------Create and Set the Field(s)----------
35  PndMultiField *fField= new PndMultiField("AUTO");
36  fRun->SetField(fField);
37 
38  //RhoCalculationTools::ForceConstantBz(20.0);
39 
40  // ***********************
41  // *** SoftTriggerTask ***
42  // ***********************
43 
44  int modeshort = mode;
45  if (modeshort>1000000) modeshort /= 1000;
46  if (modeshort>1000) modeshort %= 1000;
47 
48  cout <<" ****** mode:"<<mode<<" modeshort:"<<modeshort<<endl;
49 
50  // this file contains the trigger line definitions
51  //TString triggercfg = TString(gSystem->Getenv("VMCWORKDIR"))+"/macro/softrig/triggerlines_10ch.cfg";
52  TString triggercfg = TString(gSystem->Getenv("VMCWORKDIR"))+"/softrig/triggerlines.cfg";
53 
54  // this file contains the cut setup for various modes
55  //TString selectioncfg = TString(gSystem->Getenv("VMCWORKDIR"))+"/softrig/selection_10ch_tight.cfg";
56  TString selectioncfg = TString(gSystem->Getenv("VMCWORKDIR"))+"/softrig/selection.cfg";
57 
58  PndSoftTriggerTask *stTask = new PndSoftTriggerTask(Mom, mode, run, triggercfg);
59  stTask->SetConfigurationFile(selectioncfg);
60 
61  //stTask->McMatchAllowPhotos(10, 1.0);
62 
63  stTask->ApplyFullSelection(applyfull);
64 
65  stTask->SetPi0SignalParams(0.134, 0.0045);
66  stTask->SetKs0SignalParams(0.497, 0.0085);
67  stTask->SetEtaSignalParams(0.549, 0.0055); // needs to be refined!
68 
69  // set PID algos
70  TString algo = "PidAlgoEmcBayes;PidAlgoDrc;PidAlgoDisc;PidAlgoStt;PidAlgoMdtHardCuts;PidAlgoMvd";
71  stTask->SetPidAlgoAll(algo);
72 
73  stTask->SetTagAll(true); // tag all modes
74  //stTask->SetTagMode(modeshort); // switch single tags on/off; mode number has to match one from config file
75 
76  if (modeshort==900)
77  {
78  stTask->SetQAAll(true); // ntuple output for all modes
79  }
80  else
81  {
82  stTask->SetQAAll(false);
83  stTask->SetQAMode(modeshort);
84  stTask->SetQAMctOnly();
85  }
86 
87  stTask->SetQAEvent(true); // event info
88  stTask->SetQAMc(true);
89 
90  stTask->SetGammaMinE(0.10); // global energy pre-cut for neutrals
91  stTask->SetTrackMinP(0.10); // global momentum pre-cut for charged
92  stTask->SetInitialPidCut(0.1); // global PID pre-cut for charged
93  stTask->SetDstMDiffCut(0.1); // special cut on D*-D mass difference (to reduce comb and output file size)
94 
95  //stTask->McMatchAllowPhotos(1,0.05); // MC truth match shall partially ignore photos photons (here max 1 with E<50 MeV)
96 
97  fRun->AddTask(stTask);
98 
99  // ***********************
100  // *** SoftTriggerTask ***
101  // ***********************
102 
103 
104  // *** and run analysis
105  fRun->Init();
106  fRun->Run(0,0);
107 
108  //gObjectTable->Print();
109  return 0;
110 }
PndMultiField * fField
Definition: sim_emc_apd.C:97
Int_t run
Definition: autocutx.C:47
TString outFile
Definition: hit_dirc.C:17
FairRunAna * fRun
Definition: hit_dirc.C:58
Int_t mode
Definition: autocutx.C:47
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
int prod_sof(TString outpre="", Float_t Mom=15.15, int mode=9999, int run=-1, int applyfull=0)
Definition: prod_sof.C:1