123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378 |
- #include "StHbtMaker/Cut/gregsEventCut.h"
- #include <sstream>
- #ifdef __ROOT__
- ClassImp(gregsEventCut)
- #endif
- //_________________
- gregsEventCut::gregsEventCut() {
- mKLo = -1.e9;
- mKHi = 1.e9;
- mBLo = 0.;
- mBHi = 0.;
- mSphCut[0] = -1e6;
- mSphCut[1] = +1e6;
- mRPeast[0] = -1e6;
- mRPeast[1] = +1e6;
- mRPwest[0] = -1e6;
- mRPwest[1] = +1e6;
- mRefMult[0] = -1;
- mRefMult[1] = +1000000;
- mVtxX[0] = -1e9;
- mVtxX[1] = +1e9;
- mVtxY[0] = -1e9;
- mVtxY[1] = +1e9;
- mVtxZ[0] = -1e9;
- mVtxZ[1] = +1e9;
- mVtxR = 1e9;
- mVzVpdVzDiff[0] = -1e6;
- mVzVpdVzDiff[1] = +1e6;
- //0-p+p; 1-A+A
- mCollisionType = 0;
- mNumberOfCentralityBins = 9;
- mCentralityBinRange[0] = 0;
- mCentralityBinRange[1] = 8;
- mRefMultCorrUtil_curInitRunNumber = -1;
- mUseZdcRefMultCorr = false;
- mCheckBadRuns = true;
- //Do not forget to add: gSystem->Load("StRefMultCorr"); in the running macro
- //in case you want to run AuAu
- //The instance of the StRefMultCorr is now creating in the
- //gregsEventCut::SetCollisionType method.
- //Also you need to check the correspondence of the
- //centrality bin number and mNumberOfCentralityBins. There is an assert method...
- mVtxXShift = 0.;
- mVtxYShift = 0.;
- mNEventsPassed = mNEventsFailed = 0;
- }
- //_________________
- gregsEventCut::gregsEventCut(const gregsEventCut& c) : StHbtEventCut(c) {
- mRefMult[0] = c.mRefMult[0];
- mRefMult[1] = c.mRefMult[1];
- mVtxX[0] = c.mVtxX[0];
- mVtxX[1] = c.mVtxX[1];
- mVtxY[0] = c.mVtxY[0];
- mVtxY[1] = c.mVtxY[1];
- mVtxZ[0] = c.mVtxZ[0];
- mVtxZ[1] = c.mVtxZ[1];
- mRPeast[0] = c.mRPeast[0];
- mRPeast[1] = c.mRPeast[1];
- mRPwest[0] = c.mRPwest[0];
- mRPwest[1] = c.mRPwest[1];
- mKLo = c.mKLo;
- mKHi = c.mKHi;
- mBLo = c.mBLo;
- mBHi = c.mBHi;
- mVtxR = c.mVtxR;
- mVzVpdVzDiff[0] = c.mVzVpdVzDiff[0];
- mVzVpdVzDiff[1] = c.mVzVpdVzDiff[1];
- mCollisionType = c.mCollisionType;
- mNumberOfCentralityBins = c.mNumberOfCentralityBins;
- mCentralityBinRange[0] = c.mCentralityBinRange[0];
- mCentralityBinRange[1] = c.mCentralityBinRange[1];
- mCheckBadRuns = c.mCheckBadRuns;
- if(mCollisionType != 0) {
- mRefMultCorrUtil_curInitRunNumber = c.mRefMultCorrUtil_curInitRunNumber;
- mUseZdcRefMultCorr = c.mUseZdcRefMultCorr;
- }
- mVtxXShift = c.mVtxXShift;
- mVtxYShift = c.mVtxYShift;
- mNEventsPassed = 0;
- mNEventsFailed = 0;
- }
- //____________
- gregsEventCut::~gregsEventCut() {
- #ifdef STHBTDEBUG
- std::cout << "Event cut destructor" << std::endl;
- #endif
- if(mCollisionType != 0) {
- if(mRefMultCorrUtil != NULL) {
- delete mRefMultCorrUtil;
- mRefMultCorrUtil = NULL;
- }
- }
- #ifdef STHBTDEBUG
- std::cout << "Event cut is killed" << std::endl;
- #endif
- }
- //_________________
- bool gregsEventCut::Pass(const StHbtEvent* event) {
- //added by gnigmat
- #ifdef STHBTDEBUG
- std::cout << "gregsEventCut::Pass" << std::endl;
- #endif
- int mult = event->RefMult();
- int tofMult = event->TofMult();
- float multLo = (float)tofMult*mKLo + mBLo;
- float multHi = (float)tofMult*mKHi + mBHi;
- float vtxX = event->PrimVertPos().x();
- float vtxY = event->PrimVertPos().y();
- float vtxZ = event->PrimVertPos().z();
- float vtxXCorrected = vtxX - mVtxXShift;
- float vtxYCorrected = vtxY - mVtxYShift;
- float vtxR = ::sqrt(vtxXCorrected * vtxXCorrected +
- vtxYCorrected * vtxYCorrected);
- float vzVpdVzDiff = vtxZ - event->VpdVz();
- float sph = event->Sphericity();
- int mRunNumber = event->RunNumber();
- float rpEast = event->PsiRP1(0);
- float rpWest = event->PsiRP1(1);
- //added by gnigmat
- #ifdef STHBTDEBUG
- std::cout << "Sphericity: " << sph << std::endl;
- << "RefMult: " << mult << std::endl
- << "TofMult: " << tofMult << std::endl
- << "vtxX: " << vtxX
- << "\tvtxXCorrected: " << vtxXCorrected << std::endl
- << "vtxY: " << vtxY
- << "\tvtxYCorrected: " << vtxYCorrected << std::endl
- << "vtxZ: " << vtxZ
- <<"\tvtxR: " << vtxR
- << "\tvzVpdDiff: " <<vzVpdVzDiff
- << "\tCollisionType: " << mCollisionType << std::endl;
- #endif
- bool mGoodEvent = false;
- bool mGoodPrimVtx = false;
- bool mGoodRefMult = false;
- bool mIsBadRun = false;
- int mCentBin = mNumberOfCentralityBins == 9 ? event->Cent9() : event->Cent16();
- if(mCollisionType==0) { //mCollisionType=0 - pp collisions
- if (mCheckBadRuns)
- {
- mIsBadRun = isOnList(mRunNumber, pp_bad_run_list_200GeV, sizeof(pp_bad_run_list_200GeV)/sizeof(pp_bad_run_list_200GeV[0]));
- if (mIsBadRun) return false;
- }
- mGoodPrimVtx = ((vtxXCorrected >= mVtxX[0]) &&
- (vtxXCorrected <= mVtxX[1]) &&
- (vtxYCorrected >= mVtxY[0]) &&
- (vtxYCorrected <= mVtxY[1]) &&
- (vtxZ >= mVtxZ[0]) && (vtxZ <= mVtxZ[1]) &&
- (vtxR <= mVtxR) &&
- (vzVpdVzDiff >= mVzVpdVzDiff[0]) &&
- (vzVpdVzDiff <= mVzVpdVzDiff[1]) &&
- (mult <= multHi) &&
- (mult >= multLo) &&
- (mSphCut[0] < sph && sph <= mSphCut[1]) &&
- (mRPeast[0] < rpEast && mRPeast[1] > rpEast) &&
- (mRPwest[0] < rpWest && mRPwest[1] > rpWest));
- mGoodRefMult = ( (mult >= mRefMult[0]) && (mult<= mRefMult[1]) );
- //Main decision
- if(mGoodPrimVtx && mGoodRefMult) {
- mGoodEvent = true;
- }
- else { //This is not needed but it's easy to check
- mGoodEvent = false;
- }
- }
- else { //mCollisionType=1 - AuAu
- mGoodPrimVtx = ( (vtxZ >= mVtxZ[0]) && (vtxZ <= mVtxZ[1]) &&
- (vtxR <= mVtxR) &&
- (vzVpdVzDiff >= mVzVpdVzDiff[0]) &&
- (vzVpdVzDiff <= mVzVpdVzDiff[1]) );
- //If primary vertex is good then we try to
- //check bad runs and centrality bin
- if(mGoodPrimVtx) {
- if (event->IsSimulation()) {
- //
- // Temporary stub
- //
- mGoodRefMult = true;
- }
- else {
- mIsBadRun = ( isOnList( mRunNumber, bad_run_list_7GeV, n_bad_run_numbers[0] ) ||
- isOnList( mRunNumber, bad_run_list_11GeV, n_bad_run_numbers[1] ) ||
- isOnList( mRunNumber, bad_run_list_19GeV, n_bad_run_numbers[2] ) ||
- isOnList( mRunNumber, bad_run_list_27GeV, n_bad_run_numbers[3] ) ||
- isOnList( mRunNumber, bad_run_list_39GeV, n_bad_run_numbers[4] ) ||
- isOnList( mRunNumber, bad_run_list_62GeV, n_bad_run_numbers[5] ) ||
- isOnList( mRunNumber, bad_run_list_200GeV, n_bad_run_numbers[6] ) );
- if (!mIsBadRun) {
- mGoodRefMult = ( (mCentBin >= mCentralityBinRange[0]) &&
- (mCentBin <= mCentralityBinRange[1]) );
- }
- } // if (event->IsSimulation())
- } //if(mGoodPrimVtx)
- //Main decision
- if(mGoodPrimVtx && mGoodRefMult) {
- mGoodEvent = true;
- }
- else {
- mGoodEvent = false;
- }
- } //else for if(mCollisionType==0)
- mGoodEvent ? mNEventsPassed++ : mNEventsFailed++;
- return (mGoodEvent);
- }
- //_________________
- string gregsEventCut::Report() {
- stringstream rep_stream;
- if(mCollisionType==0) {
- rep_stream << mRefMult[0] << " <= Multiplicity <= " << mRefMult[1]
- << std::endl;
- }
- else {
- rep_stream << mCentralityBinRange[0] << " <= CentralityBin <= "
- << mCentralityBinRange[1] << std::endl;
- }
- rep_stream << mVtxX[0] << " <= VertexX <= " << mVtxX[1] << std::endl
- << mVtxY[0] << " <= VertexY <= " << mVtxY[1] << std::endl
- << mVtxZ[0] << " <= VertexZ <= " << mVtxZ[1] << std::endl
- << "VtxXShift: " << mVtxXShift << "\tVtxYShift: "
- << mVtxYShift << std::endl
- << "Vertex R <= " << mVtxR << std::endl
- << mVzVpdVzDiff[0] << " <= VpdVzDifference <= "
- << mVzVpdVzDiff[1] << std::endl
- << "Number of events passed: " << mNEventsPassed << std::endl
- << "Number of events failed: " << mNEventsFailed << std::endl;
- return ( rep_stream.str() );
- }
- //_________________
- Bool_t gregsEventCut::isOnList(int runNumber, const Int_t *list, int listSize) {
- for(Int_t iSize=0; iSize<listSize; iSize++) {
- if(list[iSize] == runNumber) {
- return true;
- }
- }
- return false;
- }
- //_________________
- void gregsEventCut::SetTofVsRef(float kLo, float kHi, float bLo, float bHi)
- {
- mKLo = kLo;
- mKHi = kHi;
- mBLo = bLo;
- mBHi = bHi;
- }
- //_________________
- const Int_t gregsEventCut::n_bad_run_numbers[7] = {328,27,38,105,35,34,219};
- //_________________
- const Int_t gregsEventCut::bad_run_list_7GeV[328] = {11114084,11114085,11114086,11114088,11114089,11114094,
- 11114095,11114100,11114109,11115005,11115007,11115013,
- 11115019,11115025,11115027,11115028,11115030,11115032,
- 11115051,11115062,11115064,11115069,11115072,11115078,
- 11115079,11115080,11115086,11115088,11115094,11116001,
- 11116002,11116005,11116006,11116010,11116014,11116020,
- 11116023,11116028,11116060,11116061,11116062,11116064,
- 11116068,11116070,11116072,11116073,11116075,11117002,
- 11117006,11117031,11117033,11117034,11117036,11117039,
- 11117044,11117045,11117046,11117052,11117055,11117063,
- 11117064,11117071,11117075,11117085,11117088,11117089,
- 11117090,11117093,11117094,11117095,11117098,11117100,
- 11117103,11117104,11117107,11118007,11118008,11118016,11118024,11118025,11118026,11118039,11118044,
- 11119001,11119003,11119006,11119007,11119009,11119012,11119013,11119015,11119016,11119017,11119022,
- 11119024,11119026,11119029,11119030,11119056,11119057,11119060,11119062,11119067,11119069,11119070,
- 11119071,11119074,11119075,11119077,11119079,11119081,11119090,11119091,11119100,11119101,11120003,
- 11120006,11120008,11120011,11120014,11120019,11120023,11120030,11120034,11120037,11120039,11120040,
- 11120045,11120052,11120057,11120062,11120063,11120069,11120070,11120071,11120074,11120077,11120078,
- 11120084,11120092,11121006,11121014,11121015,11121019,11121029,11121030,11121034,11121035,11121043,
- 11121044,11121054,11121058,11121066,11121067,11121070,11121075,11121082,11122001,11122007,11122008,
- 11122010,11122017,11122024,11122037,11122038,11122047,11122048,11122049,11122050,11122053,11122058,
- 11122062,11122069,11122073,11122078,11122085,11122097,11123003,11123004,11123015,11123026,11123028,
- 11123040,11123044,11123055,11123057,11123058,11123059,11123067,11123075,11123076,11123077,11123079,
- 11123081,11123084,11123086,11123088,11123089,11123093,11123094,11123095,11123100,11123101,11123102,
- 11123104,11124001,11124005,11124007,11124008,11124015,11124016,11124018,11124041,11124046,11124050,
- 11124051,11124052,11124053,11124058,11124060,11124061,11124062,11124063,11124064,11124065,11124066,
- 11124069,11125002,11125003,11125004,11125005,11125006,11125008,11125012,11125013,11125014,11125015,
- 11125016,11125017,11125020,11125021,11125022,11125023,11125073,11125081,11125089,11125090,11125096,
- 11125097,11126005,11126006,11126007,11126016,11126018,11126022,11126023,11127001,11127002,11127043,
- 11128005,11128012,11128018,11128050,11128056,11128072,11129018,11129022,11129028,11129051,11130027,
- 11130034,11130057,11131038,11131062,11132013,11132070,11133006,11133019,11134053,11134060,11134067,
- 11134076,11135068,11136003,11136005,11136006,11136007,11136008,11136012,11136013,11136014,11136061,
- 11136076,11136101,11136130,11136160,11136163,11137019,11138027,11138049,11138086,11138124,11139014,
- 11140076,11140086,11141063,11142117,11143026,11143028,11144001,11144009,11144031,11144033,11144040,
- 11144043,11144052,11145008,11145028,11145035,11146061,11146076,11146079,11147004,11147006,11147014,
- 11147017,11147021,11147023};
- //_________________
- const Int_t gregsEventCut::bad_run_list_11GeV[27] = {11148039,11148045,11149001,11149008,11149010,11149011,11149015,11149047,11150016,11150025,11150028,
- 11151036,11151040,11151050,11152016,11152036,11152078,11153032,11153042,11155001,11155009,11156003,
- 11156009,11157012,11158006,11158022,11158024};
- //_________________
- const Int_t gregsEventCut::bad_run_list_19GeV[35] = {12113091,12114007,12114035,12114078,12114092,12114116,12115009,12115014,12115015,12115016,12115018,
- 12115019,12115020,12115022,12115023,12115062,12115073,12115093,12115094,12116012,12116054,12117010,
- 12117016,12117020,12117065,12119040,12119042,12120017,12120026,12121017,12121022,12121034,12121050,
- 12121067,12122019};
- //_________________
- const Int_t gregsEventCut::bad_run_list_27GeV[34] = {12172050,12172051,12172055,12173030,12173031,12173032,12173033,12173034,12174067,12174085,12175062,
- 12175087,12175113,12175114,12175115,12176001,12176044,12176054,12176071,12177015,12177061,12177092,
- 12177099,12177101,12177106,12177107,12177108,12178003,12178004,12178005,12178006,12178013,12178099,
- 12178120};
- //_________________
- const Int_t gregsEventCut::bad_run_list_39GeV[38] = {11199124,11100002,11100045,11101046,11102012,11102051,11102052,11102053,11102054,11102055,11102058,
- 11103035,11103056,11103058,11103092,11103093,11105052,11105053,11105054,11105055,11107007,11107042,
- 11107057,11107061,11107065,11107074,11108101,11109013,11109077,11109088,11109090,11109127,11110013,
- 11110034,11110073,11110076,11111084,11111085};
- //_________________
- const Int_t gregsEventCut::bad_run_list_62GeV[105] = {11080072,11081023,11081025,11082012,11082013,11082046,11082056,11082057,11084009,11084011,11084012,
- 11084013,11084020,11084021,11084035,11084044,11084064,11085015,11085025,11085030,11085046,11085055,
- 11085056,11085057,11086005,11086007,11087001,11087002,11087003,11087004,11088013,11089026,11089028,
- 11089029,11089055,11089068,11089072,11091007,11091015,11091021,11091078,11092010,11092011,11092012,
- 11092032,11092033,11092034,11092067,11092096,11093001,11094016,11094017,11094018,11094019,11094020,
- 11094021,11094022,11094023,11094024,11094027,11094028,11094042,11094044,11094045,11094046,11094047,
- 11094048,11094050,11094051,11094052,11094053,11094054,11094055,11094074,11094075,11094077,11095001,
- 11095002,11095003,11095004,11095005,11095006,11095009,11095010,11095011,11095012,11095013,11095014,
- 11095015,11095022,11095040,11095048,11095050,11095051,11095061,11095062,11095063,11095064,11095082,
- 11095087,11096024,11096039,11096043,11096044,11097093};
- //_________________
- const Int_t gregsEventCut::bad_run_list_200GeV[219] = { 11002120, 11002121, 11002126, 11002127, 11002129, 11003010, 11003011, 11003101, 11003102, 11004007,
- 11004008, 11004009, 11004010, 11004011, 11004012, 11004013, 11004014, 11004015, 11004016, 11004018,
- 11004020, 11004021, 11004023, 11004024, 11004025, 11004026, 11004028, 11004029, 11004030, 11004032,
- 11004033, 11004034, 11004035, 11004037, 11004038, 11005042, 11006004, 11006005, 11006008, 11007015,
- 11010031, 11011019, 11011053, 11015069, 11015071, 11016024, 11017006, 11018003, 11018007, 11018008,
- 11018036, 11019001, 11019080, 11019081, 11021027, 11021028, 11021031, 11023048, 11025034, 11025038,
- 11025054, 11025067, 11025069, 11026005, 11026008, 11026021, 11026022, 11026023, 11026025, 11026067,
- 11026068, 11028004, 11028005, 11028006, 11028007, 11028008, 11028009, 11028010, 11028011, 11028012,
- 11028013, 11028018, 11028019, 11028020, 11028021, 11028022, 11028023, 11028024, 11028025, 11028026,
- 11028027, 11030041, 11030080, 11031061, 11031064, 11035008, 11035009, 11035072, 11036026, 11037035,
- 11037037, 11037060, 11037066, 11037067, 11038048, 11038049, 11038050, 11039047, 11039067, 11040078,
- 11040083, 11041022, 11041023, 11041040, 11041041, 11042001, 11042002, 11042003, 11042004, 11042005,
- 11042006, 11042007, 11042008, 11042011, 11042012, 11042018, 11042019, 11042020, 11042021, 11042022,
- 11042023, 11042024, 11042025, 11042026, 11042027, 11042042, 11042043, 11042044, 11042045, 11042046,
- 11042047, 11042048, 11042049, 11044029, 11047059, 11047065, 11047066, 11047067, 11048037, 11049001,
- 11049002, 11049005, 11049023, 11051038, 11051049, 11051051, 11051055, 11051063, 11051064, 11051068,
- 11052011, 11053057, 11054021, 11054022, 11054024, 11054059, 11054062, 11054066, 11057012, 11057035,
- 11057036, 11058005, 11058050, 11058083, 11059043, 11059055, 11059060, 11059075, 11059076, 11059077,
- 11060008, 11060049, 11060059, 11060069, 11060076, 11061008, 11061009, 11061021, 11061034, 11061037,
- 11061038, 11061095, 11063006, 11063007, 11063008, 11063011, 11063013, 11063014, 11063015, 11063016,
- 11063017, 11063036, 11063083, 11064003, 11064023, 11065038, 11066024, 11066045, 11071056, 11072032,
- 11072044, 11072045, 11073001, 11073002, 11073003, 11073049, 11075039, 11075045, 11075048};
- const Int_t gregsEventCut::pp_bad_run_list_200GeV[11] = {13044118,13047055,13049007,13049052,13049075,13052063,13054046,13054057,13057038,13058047,13058048};
|