123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- #include <TFile.h>
- #include "TROOT.h"
- #include "TSystem.h"
- #include "TChain.h"
- #include "TTree.h"
- //_____________________
- void FemtoDstQA(const char *flist = "sample.list",
- const char *ofile = "femtoQA.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("StRefMultCorr");
- gSystem->Load("StFlowMaker"); // should be placed before HBT
- gSystem->Load("StHbtMaker");
- gSystem->Load("StarClassLibrary");
- gSystem->Load("libgsl");
- gSystem->Load("libgslcblas");
- gSystem->Load("StPicoDstMakerRun12");
- gSystem->Load("StarClassLibrary");
- gSystem->Load("libgsl");
- gSystem->Load("libgslcblas");
- gSystem->Load("libVMC.so");
- gSystem->Load("libStDb_Tables.so");
- gSystem->Load("libgen_Tables.so");
- gSystem->Load("libgeometry_Tables.so");
- gSystem->Load("libsim_Tables.so");
- gSystem->Load("libStarMagField.so");
- gSystem->Load("libSt_db_Maker.so");
- gSystem->Load("libSt_g2t.so");
- gSystem->Load("libSt_geant_Maker.so");
- gSystem->Load("StarGeneratorUtil.so");
- gSystem->Load("StarGeneratorEvent.so");
- gSystem->Load("StarGeneratorBase.so");
- gSystem->Load("StFemtoDstMakerSph");
- StChain *chain = 0;
- StFemtoDstQAMaker *maker = 0;
- //
- // List of member links in the chain
- //
- chain = new StChain("StChain");
- maker = new StFemtoDstQAMaker("", flist, ".", -1);
- maker->SetOutFileName(ofile);
- //
- // Trigger for pp200 y2012
- //
- femtoReader->AddTrigId(370011); // vpdmb-nobsmd
- femtoReader->AddTrigId(370001); // vpdmb
- femtoReader->AddTrigId(370022); // bbcmb
- femtoReader->AddTrigId(370501); // bht0-vpdmb
- femtoReader->AddTrigId(370511); // bht1-vpdmb
- femtoReader->AddTrigId(370531); // bht2
- femtoReader->AddTrigId(370542); // bht0-bbcmb-tof0
- femtoReader->AddTrigId(370546); // bht1-bbcmb-tof0
- femtoReader->AddTrigId(370522); // bht2-bbcmb
- femtoReader->AddTrigId(370601); // jp0
- femtoReader->AddTrigId(370611); // jp1
- femtoReader->AddTrigId(370621); // jp2
- femtoReader->AddTrigId(370641); // ajp
- femtoReader->AddTrigId(370301); // bbcmb-tof0
- femtoReader->AddTrigId(370361); // tofmult3-vpd
- femtoReader->AddTrigId(370341); // tofmult4
- //
- // Turn on only min-bias triggers
- //
- femtoReader->SetTrigger(370011, 1);
- femtoReader->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;
- }
|