// Macro created by Radoslaw Karabowicz // This macro takes the digis and find hits Int_t gem_digi(char* type="local") { Int_t nStations = 3; Double_t momentum = 15.; Int_t nEvents = 1000; int verboseLevel = 0; // TProof* proof = TProof::Open(""); // proof->ClearPackages(); // proof->UploadPackage("/misc/karabowi/pandaroot_13510/trunk/macro/proof/libPndRoot.par"); // proof->EnablePackage("libPndRoot"); // proof->ShowPackages(); if ( nStations != 3 && nStations != 4 ) { cout << "WRONG number of stations, only 3 or 4 allowed." << endl; return; } // ---- Load libraries ------------------------------------------------- gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C"); TString sysFile = gSystem->Getenv("VMCWORKDIR"); // Input file (MC events) TString baseName; baseName.Form("/misc/karabowi/pandaroot_13510/trunk/macro/proof/Gem_%dStations_%gGeV_n%d",nStations,momentum,nEvents); TString parFile = baseName + "_par.root"; TString digFile = baseName + ".root"; // ------------------------------------------------------------------------ TString outFile = baseName + "_digi.root"; // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); // ----- Reconstruction run ------------------------------------------- FairRunAna *fRun= new FairRunAna(); // fRun->SetInputFile(digFile); fRun->SetOutputFile(Form("Gem_%dStations_%gGeV_n6000_digi_%s.root",nStations,momentum,type)); fRun->SetInputFile(Form("/misc/karabowi/pandaroot_13510/trunk/macro/proof/Gem_%dStations_%gGeV_n1000.root",nStations,momentum)); fRun->AddFile (Form("/misc/karabowi/pandaroot_13510/trunk/macro/proof/Gem_%dStations_%gGeV_n1100.root",nStations,momentum)); fRun->AddFile (Form("/misc/karabowi/pandaroot_13510/trunk/macro/proof/Gem_%dStations_%gGeV_n1200.root",nStations,momentum)); fRun->AddFile (Form("/misc/karabowi/pandaroot_13510/trunk/macro/proof/Gem_%dStations_%gGeV_n1300.root",nStations,momentum)); fRun->AddFile (Form("/misc/karabowi/pandaroot_13510/trunk/macro/proof/Gem_%dStations_%gGeV_n1400.root",nStations,momentum)); // ----- Parameter database -------------------------------------------- TString allDigiFile = sysFile+"/macro/params/gem_3Stations.digi.par"; if ( nStations == 4 ) allDigiFile = sysFile+"/macro/params/gem_4Stations.digi.par"; FairRuntimeDb* rtdb = fRun->GetRuntimeDb(); FairParRootFileIo* parInput1 = new FairParRootFileIo(); parInput1->open(parFile.Data()); FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo(); parIo1->open(allDigiFile.Data(),"in"); rtdb->setFirstInput(parInput1); rtdb->setSecondInput(parIo1); // ------------------------------------------------------------------------ // ----- GEM Digitizer ----------------------------------------------- PndGemDigitize* gemDigitize = new PndGemDigitize("GEM Digitizer", verboseLevel); fRun->AddTask(gemDigitize); // ----- Intialise and run -------------------------------------------- fRun->Init(); fRun->Run(0,10);//nEvents); // fRun->Run(type,0,nEvents); // ----- Finish ------------------------------------------------------- timer.Stop(); Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); cout << endl << endl; cout << "Macro finished succesfully." << endl; cout << "Output file is " << outFile << endl; cout << "Parameter file is " << parFile << endl; cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl; cout << endl; }