FairRoot/PandaRoot
Functions
ana_jpsi_task_ST.C File Reference

Go to the source code of this file.

Functions

int ana_jpsi_task_ST (TString Fname="test", int nevts=0, double pbarmom=6.232069)
 

Function Documentation

int ana_jpsi_task_ST ( TString  Fname = "test",
int  nevts = 0,
double  pbarmom = 6.232069 
)

Definition at line 6 of file ana_jpsi_task_ST.C.

References PndSoftTriggerTask::ApplyFullSelection(), RhoCalculationTools::ForceConstantBz(), fRun, PndSoftTriggerTask::McMatchAllowPhotos(), PndSoftTriggerTask::SetConfigurationFile(), PndSoftTriggerTask::SetEtaSignalParams(), PndSoftTriggerTask::SetGammaMinE(), PndSoftTriggerTask::SetInitialPidCut(), PndSoftTriggerTask::SetKs0SignalParams(), PndSoftTriggerTask::SetPi0SignalParams(), PndSoftTriggerTask::SetPidAlgoAll(), PndSoftTriggerTask::SetQAAll(), PndSoftTriggerTask::SetQAEvent(), PndSoftTriggerTask::SetQAMode(), PndSoftTriggerTask::SetTagAll(), PndSoftTriggerTask::SetTrackMinP(), and TString.

7 {
8  // *** set this to your output path
9  TString WorkDir = TString(gSystem->Getenv("VMCWORKDIR"));
10  TString OutPath = WorkDir+"/macro/softrig";
11  TString OutFile = OutPath + "/" + Fname(Fname.Last('/')+1,Fname.Length()); // cut away input path
12 
13  // *** the output file for FairRunAna
14  TString InFile = Fname;
15  if (!InFile.EndsWith(".root")) InFile+="_fast.root";
16 
17  // *** initialization
18  FairLogger::GetLogger()->SetLogToFile(kFALSE);
19 
20  FairRunAna* fRun = new FairRunAna();
21  fRun->SetGenerateRunInfo(kFALSE);
22  fRun->SetInputFile(InFile);
23  fRun->SetOutputFile(OutFile+"_loose.root");
24 
25  // *** take constant field; needed for PocaVtx
27 
28  // --------------------------------
29  // *** SoftTriggerTask ***
30  // --------------------------------
31 
32  // this file contains the trigger line definitions
33  TString triggercfg = WorkDir+"/softrig/triggerlines.cfg";
34 
35  // this file contains the cut setup for the 10 channels from soft trigger report
36  TString selectioncfg = WorkDir+"/softrig/selection_10ch_loose.cfg";
37 
38  PndSoftTriggerTask *stTask = new PndSoftTriggerTask(pbarmom,0,0,triggercfg);
39  stTask->SetConfigurationFile(selectioncfg);
40 
41  // set parameters for pi0, KS, eta selection
42  stTask->SetPi0SignalParams(0.136, 0.0045);
43  stTask->SetEtaSignalParams(0.552, 0.009);
44  stTask->SetKs0SignalParams(0.497, 0.008);
45 
46  //TString algo = "PidAlgoEmcBayes;PidAlgoDrc;PidAlgoDisc;PidAlgoStt;PidAlgoMdtHardCuts"; // FullSim
47  TString algo = "PidChargedProbability"; // Fast Sim
48  stTask->SetPidAlgoAll(algo);
49 
50  // Full selection switch
51  // 0: detailed selection turned off
52  // 1: exclusive mode (modes w/o detailed cut definitions are rejected)
53  // 2: open mode (modes w/o detailed cut definitions just have to fulfill their mass window criterion)
54  stTask->ApplyFullSelection(1);
55 
56  stTask->SetTagAll(true); // tag all modes
57  //stTask->SetTagMode(120,true); // example to switch single tags on/off; mode number has to match one from config file
58 
59  stTask->SetQAAll(true); // ntuple output for all modes off
60  stTask->SetQAEvent(true); // ntuple output for event info
61  stTask->SetQAMode(201,true); // example to switch single QA on/off
62 
63  stTask->SetGammaMinE(0.15); // global energy pre-cut for neutrals
64  stTask->SetTrackMinP(0.15); // global momentum pre-cut for charged
65  stTask->SetInitialPidCut(0.1); // global PID pre-cut for charged
66 
67  stTask->McMatchAllowPhotos(1,0.05); // MC truth match shall partially ignore photos photons (here max 1 with E<50 MeV)
68 
69  fRun->AddTask(stTask);
70 
71  // --------------------------------
72  // *** Analysis Task ***
73  // --------------------------------
74 
75  PndAnaWithTrigger *anaTask = new PndAnaWithTrigger(pbarmom, OutFile+"_ana.root");
76  fRun->AddTask(anaTask);
77 
78  // *** and run analysis
79  fRun->Init();
80  fRun->Run(0,nevts);
81  return 0;
82 }
void SetConfigurationFile(TString fname)
void SetKs0SignalParams(double mean, double sigma)
void SetPi0SignalParams(double mean, double sigma)
static void ForceConstantBz(Double_t bz=0.)
Force a constant B field value for all positions.
FairRunAna * fRun
Definition: hit_dirc.C:58
void SetEtaSignalParams(double mean, double sigma)
void SetQAMode(int mode, bool qa=true)
void SetInitialPidCut(double cut)
void McMatchAllowPhotos(int maxn=1, double thresh=0.05)
void ApplyFullSelection(int selmode=1)