123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158 |
- #include "TROOT.h"
- #include "TSystem.h"
- #include "TChain.h"
- #include "TFile.h"
- #include "TString.h"
- #include <iostream>
- using namespace std;
- const Char_t *defaultInFile = "test.list";
- const Char_t *defaultOutFile = "oFemtoDstMesons_pp510_2011.root";
- class StFemtoDstMaker;
- StFemtoDstMaker *femtoMaker = NULL;
- //_________________
- void FemtoDstMaker_pp510_y2011(const Char_t* inFileList = defaultInFile,
- const Char_t* outFileName = defaultOutFile)
- {
- cout
- << "**************************\n"
- << "* FemtoDstMaker *\n"
- << "* p+p 510 GeV, year 2011 *\n"
- << "* Start *\n"
- << "**************************\n\n";
- //Constants, cut and initial parameters
- Float_t cVtxZ[2] = {-100., 100.};
- Float_t cVtxR[2] = {0., 3.};
- Float_t cVtxXShift = 0.;
- Float_t cVtxYShift = 0.;
- Float_t cVtxVpdVzDiff[2] = {-10., 10.};
- Float_t cParticleMom[2] = {0.1, 2.0};
- Float_t cTrackDcaGlobal[2] = {-0.01, 3.};
- Int_t cTrackNHits[2] = {5, 50};
- Int_t cTrackNHitsFit[2] = {5, 50};
- Float_t cTrackEta[2] = {-1.1, 1.1};
- Int_t cTrackFlag[2] = {0, 1000};
- //Load libraries
- cout << "Loading libraries..." << endl;
- gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
- loadSharedLibraries();
- gSystem->Load("libMinuit");
- gSystem->Load("StChain");
- gSystem->Load("StRefMultCorr");
- gSystem->Load("StFlowMaker");
- gSystem->Load("StHbtMaker");
- gSystem->Load("StPicoDstMakerRun11");
- gSystem->Load("StFemtoDstMaker");
- gSystem->Load("libStFemtoDstMaker.so");
- cout << "Libraries have been successfully loaded" << endl;
- //Create chain
- StChain *mChain = new StChain("StChain");
- mChain->SetDebug(0);
- StMuDebug::setLevel(0);
- //Create MuDst reader
- int nMaxFileToRead = 1e9;
- cout << Form("Try to read file: %s", inFileList) << 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);
- muDstMaker->SetStatus("BTofHit*", 1);
- TChain *mCurrentTree = muDstMaker->chain();
- Long64_t mNEvents = mCurrentTree->GetEntries();
- cout << Form("Number of events in TTree: %d", mNEvents) << endl;
- //StFemtoDstMaker initialization
- femtoMaker = new StFemtoDstMaker(muDstMaker, outFileName);
- femtoMaker->SetTriggerId(320000); //Trigger selection for pp500 y2011
- femtoMaker->SetTriggerId(320001);
- femtoMaker->SetTriggerId(320011);
- femtoMaker->SetTriggerId(320021);
- femtoMaker->SetTriggerId(330021);
- femtoMaker->SetTriggerId(330600);
- femtoMaker->SetTriggerId(330601);
- femtoMaker->SetTriggerId(330501);
- femtoMaker->SetTriggerId(330503);
- femtoMaker->SetTriggerId(330524);
- femtoMaker->SetTriggerId(320501);
- femtoMaker->SetTriggerId(320503);
- femtoMaker->SetTriggerId(320504);
- femtoMaker->SetTriggerId(320514);
- femtoMaker->SetTriggerId(320524);
- femtoMaker->SetTriggerId(320600);
- femtoMaker->SetTriggerId(320601);
- femtoMaker->SetTriggerId(320500);
- femtoMaker->SetVtxZCut(cVtxZ[0], cVtxZ[1]);
- femtoMaker->SetVtxRCut(cVtxR[0], cVtxR[1]);
- femtoMaker->SetVtxShift(cVtxXShift, cVtxYShift);
- femtoMaker->SetVtxVpdVzDiffCut(cVtxVpdVzDiff[0], cVtxVpdVzDiff[1]);
- femtoMaker->SetParticleMomentum(cParticleMom[0], cParticleMom[1]);
- femtoMaker->SetTrackDcaGlobal(cTrackDcaGlobal[0], cTrackDcaGlobal[1]);
- femtoMaker->SetTrackNHits(cTrackNHits[0], cTrackNHits[1]);
- femtoMaker->SetTrackNHitsFit(cTrackNHitsFit[0], cTrackNHitsFit[1]);
- femtoMaker->SetTrackEta(cTrackEta[0], cTrackEta[1]);
- femtoMaker->SetTrackFlag(cTrackFlag[0], cTrackFlag[1]);
- femtoMaker->SetCollisionType(false);
- femtoMaker->SetAuAuZdcCoincidenceEnergy(false);
- femtoMaker->SetMuDstMaker(muDstMaker);
- //Chain initialization and loop over events
- mChain->Init();
- Int_t iReturn = 0;
- Int_t mNEventsProcessed = 0;
- Float_t mPercentStep = 0.05;
- Float_t mPercentCounter = mPercentStep;
- Float_t mProgress = 0.;
- 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 += mPercentStep;
- mStopTime = time(0);
- mDiffTime = difftime(mStopTime, mStartTime);
- mFrac = (float)mDiffTime*(float)(mNEvents - iEvent)/(float)iEvent;
- cout << Form("Processing progress: %3.0f%%. ETA: %.1f sec", mProgress*100., mFrac)
- << endl;
- }
- mChain->Clear();
- iReturn = mChain->Make(iEvent);
- if(iReturn != 0) {
- cout << "Error has been occured. Event processing has been stopped"
- << endl;
- break;
- }
- } //for(Int_t iEvent=0; iEvent<mNEvents; iEvent++)
- mChain->Finish();
- delete femtoMaker;
- delete mChain;
- cout
- << "**************************\n"
- << "* FemtoDstMaker *\n"
- << "* p+p 510 GeV, year 2011 *\n"
- << "* Finish *\n"
- << "**************************\n\n";
- }
|