123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- #include "TROOT.h"
- #include "TSystem.h"
- #include "TChain.h"
- #include "TFile.h"
- #include "TString.h"
- #include <iostream>
- const Char_t* defaultInFile = "test.list";
- const Char_t *defaultOutFile = "oFemtoDst_CuAu200_2012.root";
- class StFemtoDstMaker;
- StFemtoDstMaker *mFemtoDst = NULL;
- //_________________
- void FemtoDstMaker_CuAu200(const Char_t* inFileList = defaultInFile,
- const Char_t* outFileName = defaultOutFile,
- const Char_t* calibPath = "calib",
- const Bool_t isAA = true) {
- std::cout << "**************************" << std::endl
- << "* FemtoDstMaker *" << std::endl
- << "* Start *" << std::endl
- << "**************************" << std::endl << endl;
- //Constants, cut and initial parameters
- Float_t cVtxZ[2] = {-30., 30.};
- Float_t cVtxR[2] = {0., 3.};
- Float_t cVtxXShift = 0.;
- Float_t cVtxYShift = 0.;
- Float_t cVtxVpdVzDiff[2] = {-7., 7.};
- Float_t cParticleMom[2] = {0.15, 1.65};
- Float_t cTrackDcaGlobal[2] = {-0.01, 3.};
- Int_t cTrackNHits[2] = {15, 50};
- Int_t cTrackNHitsFit[2] = {15, 50};
- Float_t cTrackEta[2] = {-1., 1.};
- Int_t cTrackFlag[2] = {0, 1000};
- Bool_t cZdcRefmultCorrection = true; //Should be false for low energies
- //Load libraries
- std::cout << "Loading libraries..." << std::endl;
- 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("QVMaker");
- gSystem->Load("StFemtoDstMaker");
- //Create chain
- StChain *mChain = new StChain("StChain");
- mChain->SetDebug(0);
- StMuDebug::setLevel(0);
- //Create MuDst reader
- int nMaxFileToRead = 1e9;
- std::cout << Form("Try to read file: %s", inFileList) << std::endl;
- StMuDstMaker *muDstMaker =
- new StMuDstMaker(0, 0, "", inFileList, "MuDst", nMaxFileToRead);
- muDstMaker->SetStatus("*",0);
- muDstMaker->SetStatus("Event*",1);
- muDstMaker->SetStatus("MuEvent*",1);
- muDstMaker->SetStatus("PrimaryVertices*",1);
- muDstMaker->SetStatus("PrimaryTracks*",1);
- muDstMaker->SetStatus("GlobalTracks*",1);
- muDstMaker->SetStatus("BTofHeader*",1);
- TChain *mCurrentTree = muDstMaker->chain();
- Long64_t mNEvents = mCurrentTree->GetEntries();
- std::cout << Form("Number of events in TTree: %d", mNEvents) << std::endl;
- //Heavy ion related makers
- StRefMultCorr *mRefMult = new StRefMultCorr("refmult");
- //StFemtoDstMaker initialization
- mFemtoDst = new StFemtoDstMaker(muDstMaker,
- calibPath,
- outFileName);
-
- mFemtoDst->SetTriggerId(410008); // vpd-zdce-tac-protected
- mFemtoDst->SetTriggerId(410005); // vpd-zdc-mb-protected
- mFemtoDst->SetVtxZCut(cVtxZ[0], cVtxZ[1]);
- mFemtoDst->SetVtxRCut(cVtxR[0], cVtxR[1]);
- mFemtoDst->SetVtxShift(cVtxXShift, cVtxYShift);
- mFemtoDst->SetVtxVpdVzDiffCut(cVtxVpdVzDiff[0], cVtxVpdVzDiff[1]);
- mFemtoDst->SetParticleMomentum(cParticleMom[0], cParticleMom[1]);
- mFemtoDst->SetTrackDcaGlobal(cTrackDcaGlobal[0], cTrackDcaGlobal[1]);
- mFemtoDst->SetTrackNHits(cTrackNHits[0], cTrackNHits[1]);
- mFemtoDst->SetTrackNHitsFit(cTrackNHitsFit[0], cTrackNHitsFit[1]);
- mFemtoDst->SetTrackEta(cTrackEta[0], cTrackEta[1]);
- mFemtoDst->SetTrackFlag(cTrackFlag[0], cTrackFlag[1]);
- mFemtoDst->SetCollisionType(isAA);
- mFemtoDst->SetAuAuZdcCoincidenceEnergy(cZdcRefmultCorrection);
- mFemtoDst->SetMuDstMaker(muDstMaker);
- //Chain initialization and loop over events
- mChain->Init();
- Int_t iReturn = 0;
- Int_t mNEventsProcessed = 0;
- Float_t mPercentCounter = 0.05;
- Float_t mProgress = 0.;
- unsigned int mSubCounter = 1; // time
- time_t mStartTime, mStopTime, mDiffTime; // time
- float mFrac; // time
- mStartTime = time(0); // time
- for (Int_t iEvent=0; iEvent<mNEvents; iEvent++) {
- mProgress = (Float_t)iEvent / (Float_t)mNEvents;
- mNEventsProcessed++;
-
- if (mProgress >= mPercentCounter) {
-
- mPercentCounter += mPercentCounter;
- mStopTime = time(0);
- mDiffTime = difftime(mStopTime, mStartTime);
- mFrac = (float)mDiffTime*(float)(mNEvents - iEvent)/(float)iEvent;
- mSubCounter++;
- std::cout << Form("Processing progress: %4.2f%%. Time left: %.1 sec", mProgress*100., mFrac)
- << std::endl;
- }
- mChain->Clear();
- iReturn = mChain->Make(iEvent);
- if(iReturn != 0) {
- std::cout << "Error has been occured. Event processing has been stopped"
- << std::endl;
- break;
- }
- } //for(Int_t iEvent=0; iEvent<mNEvents; iEvent++)
- mChain->Finish();
- delete mFemtoDst;
- delete mChain;
- std::cout << "**************************" << std::endl
- << "* FemtoDstMaker *" << std::endl
- << "* Finish *" << std::endl
- << "**************************" << std::endl << endl;
- }
|