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