// // Pibero Djawotho // Indiana University Cyclotron Facility // July 30, 2006 // void RunPhotonFinder(Int_t nEvents = 5000, const Char_t* fileList = "ppProduction.list") { // Load shared libraries gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C"); loadSharedLibraries(); gSystem->Load("StDbLib"); gSystem->Load("StDbBroker"); gSystem->Load("St_db_Maker"); gSystem->Load("StEEmcDbMaker"); gSystem->Load("StEEmcUtil"); gSystem->Load("StEEmcSimulatorMaker"); gSystem->Load("StEEmcA2EMaker"); gSystem->Load("StEEmcClusterMaker"); gSystem->Load("StEEmcPointMaker"); gSystem->Load("StPhotonFinder"); // Create chain StChain* chain = new StChain; // Parse input file list StFile* files = new StFile; ifstream in(fileList); string filename; while (getline(in, filename)) files->AddFile(filename.c_str()); in.close(); // Add I/O maker to the chain StIOMaker* ioMaker = new StIOMaker("IO", "r", files, "bfcTree"); ioMaker->SetIOMode("r"); ioMaker->SetBranch("*", 0, "0"); // Deactivate all branches ioMaker->SetBranch("eventBranch", 0, "r"); // Activate Event Branch // Connect to STAR database St_db_Maker* db = new St_db_Maker("StarDb", "MySQL:StarDb"); //db->SetFlavor("sim", "eemcPMTcal"); //db->SetFlavor("sim", "eemcPIXcal"); #if 0 db->SetFlavor("sim", "eemcPMTped"); db->SetFlavor("sim", "eemcPMTstat"); db->SetFlavor("sim", "eemcPMTname"); db->SetFlavor("sim", "eemcADCconf"); db->SetDateTime(20050101, 0); #endif // Initialize EEMC database StEEmcDbMaker* eemcDb = new StEEmcDbMaker("eemcDb"); // ADC to E maker StEEmcA2EMaker* a2e = new StEEmcA2EMaker("AandE"); a2e->database("eemcDb"); // sets db connection a2e->source("MuDst", 1); // sets MuDst as input //a2e->source("StEvent", 2); // sets StEvent as input a2e->threshold(3.0, 0); // tower threshold a2e->threshold(3.0, 1); // preshower1 threshold a2e->threshold(3.0, 2); // preshower2 threshold a2e->threshold(3.0, 3); // postshower threshold a2e->threshold(5.0, 4); // smdu threshold a2e->threshold(5.0, 5); // smdv threshold // Cluster maker StEEmcGenericClusterMaker* clu = new StEEmcGenericClusterMaker("StEEmcGenericClusterMaker", a2e); // Add my makers to the chain StPhotonFinder* gFinder = new StPhotonFinder("StPhotonFinder", a2e, clu); // Initialize the chain Int_t status = chain->Init(); if (status) chain->Fatal(status, "Init"); // Event loop gMessMgr->SwitchOff("Q"); gMessMgr->SwitchOff("I"); //gMessMgr->SwitchOff("W"); chain->EventLoop(1, nEvents); }