1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #include <TFile.h>
- #include "TROOT.h"
- #include "TSystem.h"
- #include "TChain.h"
- #include "TTree.h"
- void sphericityFemto(const char *flist = "test.list",
- const char *ofile = "femtoQA_pp200_y2012.root")
- {
- std::cout << "Input file list = " << flist << '\n';
- if (!flist) {
- std::cout << "Input file list = NULL!\n";
- return;
- }
- //
- // Load libraries
- //
- gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
- loadSharedLibraries();
- gSystem->Load("libMinuit");
- gSystem->Load("StMuDSTMaker");
- gSystem->Load("StChain");
- gSystem->Load("StRefMultCorr");
- gSystem->Load("StFlowMaker");
- gSystem->Load("StFlowAnalysisMaker");
- gSystem->Load("StHbtMaker");
- gSystem->Load("StPicoDstMakerRun12");
- gSystem->Load("StFemtoDstMaker");
- gSystem->Load("StSphericity");
- StChain *chain = 0;
- StSphericity *maker = 0;
- //
- // List of member links in the chain
- //
- chain = new StChain("StChain");
- maker = new StSphericity("", flist, ".", 1e9);
- maker->SetOutFileName(ofile);
- maker->AddTrigId(370011); // vpdmb -nobsmd
- maker->AddTrigId(370001); // vpdmb
- maker->AddTrigId(370022); // bbcmb
- maker->AddTrigId(370501); // bht0 -vpdmb
- maker->AddTrigId(370511); // bht1 -vpdmb
- maker->AddTrigId(370531); // bht2
- maker->AddTrigId(370542); // bht0 -bbcmb -tof0
- maker->AddTrigId(370546); // bht1 -bbcmb -tof0
- maker->AddTrigId(370522); // bht2 -bbcmb
- maker->AddTrigId(370601); // jp0
- maker->AddTrigId(370611); // jp1
- maker->AddTrigId(370621); // jp2
- maker->AddTrigId(370641); // ajp
- maker->AddTrigId(370301); // bbcmb -tof0
- maker->AddTrigId(370361); // tofmult3 -vpd
- maker->AddTrigId(370341); // tofmult4
- maker->SetTrigger(370011, 1); // VPDMB triggers
- maker->SetTrigger(370001, 1);
- chain->Init();
- //
- // Loop over the links in the chain
- //
- int iret = 0;
- int nEvents = maker->GetNEvents();
- std::cout << "Entries in chain = " << nEvents << std::endl;
- for(int iev = 0; iev < nEvents; iev++) {
- chain->Clear();
- iret = chain->Make(iev);
- if(iret) {
- std::cout << "Error in Make occured. Error code: " << iret << std::endl;
- std::cout << "iev = " << iev << '\n';
- break;
- }
- }
- chain->Finish();
- //Cleanup
- delete maker;
- delete chain;
- }
|