// ------------------------------------------------------------------------- // // ----- General Macro for R3B CALIFA Analysis // Author: Hector Alvarez // Last Update: 01/09/10 // Comments: // Runs the CALIFA Hit Finder. Outputs a root file with // a collection (TClonesArray) of R3BCaloHits // // ------------------------------------------------------------------------- // // Usage: // > root -l califaAna.C // // // ------------------------------------------------------------------------- void califaAna(Int_t nEvents = 1) { /*TString dir = getenv("VMCWORKDIR"); TString r3b_geomdir = dir + "/geometry"; gSystem->Setenv("GEOMPATH",r3b_geomdir.Data()); TString r3b_confdir = dir + "gconfig"; gSystem->Setenv("CONFIG_DIR",r3b_confdir.Data()); */ // Input and output files //TString InFile = "r3bsim.root"; //TString OutFile = "califaAna.root"; // In general, the following parts need not be touched // ======================================================================== // ---- Debug option ------------------------------------------------- gDebug = 0; // ------------------------------------------------------------------------ // ----- Timer -------------------------------------------------------- TStopwatch timer; timer.Start(); // ------------------------------------------------------------------------ // ----- Create analysis run ---------------------------------------- FairRunAna* fRun = new FairRunAna(); TFile* file = new TFile("r3bpar.root"); file->Get("FairBaseParSet"); // ----- Runtime database --------------------------------------------- /* FairRuntimeDb* rtdb = fRun->GetRuntimeDb(); FairParRootFileIo* parIn = new FairParRootFileIo(); parIn->open("r3bpar.root"); rtdb->print(); */ // ----- Analysis routines for CALIFA fRun->SetInputFile("r3bsim.root"); fRun->SetOutputFile("califaAna.root"); //fRun->LoadGeometry(); //Needed for what?? R3BCaloHitFinder* caloHF = new R3BCaloHitFinder(); //Selecting the geometry version // 0- CALIFA 5.0, including BARREL and ENDCAP. // 1- CALIFA 7.05, only BARREL // 2- CALIFA 7.07, only BARREL // 3- CALIFA 7.09, only BARREL (ongoing work) // 4- CALIFA 7.17, only ENDCAP (in CsI[Tl]) // 5- CALIFA 7.07+7.17, // 6- CALIFA 7.09+7.17, (ongoing work) // 10- CALIFA 8.00, (ongoing work) // ... caloHF->SelectGeometryVersion(15); caloHF->SetDetectionThreshold(0.000050);//50 KeV caloHF->SetExperimentalResolution(5.); //5% at 1 MeV caloHF->SetAngularWindow(3.2,3.2); //[0.25 around 14.3 degrees, 3.2 for the complete calorimeter] fRun->AddTask(caloHF); // Number of events to process Int_t nEvents = 100000; fRun->Init(); fRun->Run(0, nEvents); // ----- Finish ------------------------------------------------------- timer.Stop(); Double_t rtime = timer.RealTime(); Double_t ctime = timer.CpuTime(); cout << endl << endl; cout << "Macro finished succesfully." << endl; cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl; cout << endl; // ------------------------------------------------------------------------ }