Skip to content
Snippets Groups Projects
Commit 24bb56e2 authored by Anna Senger's avatar Anna Senger
Browse files

Update macro/much/run_ana.C

parent bd7a7d62
No related branches found
No related tags found
1 merge request!110ANN for muon selection
...@@ -4,32 +4,32 @@ ...@@ -4,32 +4,32 @@
// //
//--------------------------------------------------- //---------------------------------------------------
void run_ana(Int_t nEvents = 3, void run_ana(Int_t nEvents=1000, TString dataSet = "muons",
TString dataSet = "muons", TString setup = "sis100_muon_lmvm", Bool_t useMC = kTRUE, TString pluto = "", Double_t ANN=-1)
TString setup = "sis100_muon_lmvm", {
Bool_t useMC = kTRUE, TString dir = "";
TString pluto = "") { TString traFile = dir + dataSet + ".tra.root";
TString traFile = dataSet + ".tra.root"; TString parFile = dir + dataSet + ".par.root";
TString parFile = dataSet + ".par.root"; TString recoFile = dir + dataSet + ".rec.root";
TString recoFile = dataSet + ".rec.root"; TString outFile;
TString outFile = dataSet + ".ana.root"; if(ANN<0)outFile = dataSet + ".ana.root";
else outFile = Form("%s.ana.ANN_%1.2f.root",dataSet.Data(), ANN);
FairRunAna* run = new FairRunAna(); FairRunAna* run = new FairRunAna();
run->SetInputFile(recoFile); run->SetInputFile(recoFile);
run->AddFriend(traFile); run->AddFriend(traFile);
run->SetOutputFile(outFile); run->SetOutputFile(outFile);
// run->SetGenerateRunInfo(kTRUE); // run->SetGenerateRunInfo(kTRUE);
// ----- Load the geometry setup ------------------------------------- // ----- Load the geometry setup -------------------------------------
// ----- Environment -------------------------------------------------- // ----- Environment --------------------------------------------------
TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory TString srcDir = gSystem->Getenv("VMCWORKDIR"); // top source directory
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
std::cout << std::endl; std::cout << std::endl;
TString setupFile = srcDir + "/geometry/setup/setup_" + setup + ".C"; TString setupFile = srcDir + "/geometry/setup/setup_" + setup + ".C";
TString setupFunct = "setup_"; TString setupFunct = "setup_";
setupFunct = setupFunct + setup + "()"; setupFunct = setupFunct + setup + "()";
std::cout << "-I- " std::cout << "-I- " << ": Loading macro " << setupFile << std::endl;
<< ": Loading macro " << setupFile << std::endl;
gROOT->LoadMacro(setupFile); gROOT->LoadMacro(setupFile);
gROOT->ProcessLine(setupFunct); gROOT->ProcessLine(setupFunct);
// You can modify the pre-defined setup by using // You can modify the pre-defined setup by using
...@@ -43,7 +43,7 @@ void run_ana(Int_t nEvents = 3, ...@@ -43,7 +43,7 @@ void run_ana(Int_t nEvents = 3,
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
CbmKF* kf = new CbmKF(); CbmKF* kf = new CbmKF();
run->AddTask(kf); run->AddTask(kf);
/* (VF) Not much sense in running L1 witout STS local reconstruction /* (VF) Not much sense in running L1 witout STS local reconstruction
CbmL1* L1 = new CbmL1(); CbmL1* L1 = new CbmL1();
TString stsGeoTag; TString stsGeoTag;
...@@ -56,24 +56,25 @@ void run_ana(Int_t nEvents = 3, ...@@ -56,24 +56,25 @@ void run_ana(Int_t nEvents = 3,
} }
run->AddTask(L1); run->AddTask(L1);
*/ */
CbmAnaDimuonAnalysis* ana = new CbmAnaDimuonAnalysis(pluto, setup); CbmAnaDimuonAnalysis* ana = new CbmAnaDimuonAnalysis(pluto,setup);
/* /*
ana->SetChi2MuChCut(2.); ana->SetChi2MuchCut(3.);
ana->SetChi2StsCut(2.); ana->SetChi2StsCut(2.);
ana->SetChi2VertexCut(3.); ana->SetChi2VertexCut(3.);
ana->SetNofMuchCut(11); ana->SetNofMuchCut(10);
ana->SetNofStsCut(7); ana->SetNofStsCut(7);
ana->SetNofTrdCut(1); ana->SetNofTrdCut(1);
ana->SetSigmaTofCut(2); ana->SetSigmaTofCut(2);
*/ */
ana->UseCuts(kTRUE); ana->UseCuts(kFALSE);
// ana->SetAnnCut(ANN, 5); // if SetAnnCut, than UseCuts(kFALSE) !
ana->UseMC(useMC); ana->UseMC(useMC);
run->AddTask(ana); run->AddTask(ana);
// ----- Parameter database -------------------------------------------- // ----- Parameter database --------------------------------------------
FairRuntimeDb* rtdb = run->GetRuntimeDb(); FairRuntimeDb* rtdb = run->GetRuntimeDb();
FairParRootFileIo* parIo1 = new FairParRootFileIo(); FairParRootFileIo* parIo1 = new FairParRootFileIo();
//FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo(); //FairParAsciiFileIo* parIo2 = new FairParAsciiFileIo();
parIo1->open(parFile.Data()); parIo1->open(parFile.Data());
...@@ -84,13 +85,13 @@ void run_ana(Int_t nEvents = 3, ...@@ -84,13 +85,13 @@ void run_ana(Int_t nEvents = 3,
rtdb->saveOutput(); rtdb->saveOutput();
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// ----- Initialize and run -------------------------------------------- // ----- Initialize and run --------------------------------------------
run->Init(); run->Init();
run->Run(0, nEvents); run->Run(0, nEvents);
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
cout << " Test passed" << endl; cout << " Test passed" << endl;
cout << " All ok " << endl; cout << " All ok " << endl;
RemoveGeoManager(); // RemoveGeoManager();
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment