123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230 |
- #include <Utility.h>
- #include <TDatabasePDG.h>
- #include <TParticlePDG.h>
- ClassImp(qaUtility);
- qaUtility *qaUtility::fUtility = nullptr;
- ;
- qaUtility::qaUtility() : Nevents(-1),
- debug(0),
- format("mctree"),
- Is_minbias(1),
- Is_refmult(1),
- Is_v1(1),
- Is_v2(1),
- Is_v3(1),
- Is_v4(1),
- Cut_minbias_Event_bmin(0.),
- Cut_minbias_Event_bmax(16.),
- Cut_minbias_Particle_ptmin(0.),
- Cut_minbias_Particle_ptmax(100.),
- Cut_minbias_Particle_etamin(-100.),
- Cut_minbias_Particle_etamax(100.),
- Cut_minbias_Particle_ymin(-100.),
- Cut_minbias_Particle_ymax(100.),
- Cut_refmult_Event_bmin(0.),
- Cut_refmult_Event_bmax(16.),
- Cut_refmult_Particle_ptmin(0.15),
- Cut_refmult_Particle_ptmax(3.),
- Cut_refmult_Particle_etamin(-0.5),
- Cut_refmult_Particle_etamax(0.5),
- Cut_refmult_Particle_isCharged(1),
- Cut_v1_Event_bmin(0.),
- Cut_v1_Event_bmax(16.),
- sCut_v1_Event_bCent(""),
- sCut_v1_Event_mCent(""),
- Cut_v1_Event_bCent({}),
- Cut_v1_Event_mCent({}),
- Cut_v1_Particle_ptmin(1.0),
- Cut_v1_Particle_ptmax(1.5),
- Cut_v1_Particle_etamin(-100.),
- Cut_v1_Particle_etamax(100.),
- Cut_v1_Particle_ymin(-0.25),
- Cut_v1_Particle_ymax(-0.15),
- Cut_v1_Particle_ptmin_pi(0.0),
- Cut_v1_Particle_ptmax_pi(0.5),
- Cut_v1_Particle_ymin_pi(-0.25),
- Cut_v1_Particle_ymax_pi(-0.15),
- Cut_v1_Particle_ptmin_ka(0.2),
- Cut_v1_Particle_ptmax_ka(0.9),
- Cut_v1_Particle_ymin_ka(-0.25),
- Cut_v1_Particle_ymax_ka(-0.15),
- Cut_v1_Particle_ptmin_pr(1.0),
- Cut_v1_Particle_ptmax_pr(1.5),
- Cut_v1_Particle_ymin_pr(-0.25),
- Cut_v1_Particle_ymax_pr(-0.15),
- Cut_v1_Particle_ptmin_ne(1.0),
- Cut_v1_Particle_ptmax_ne(1.5),
- Cut_v1_Particle_ymin_ne(-0.25),
- Cut_v1_Particle_ymax_ne(-0.15),
- Cut_v2_Event_bmin(0.),
- Cut_v2_Event_bmax(16.),
- sCut_v2_Event_bCent(""),
- sCut_v2_Event_mCent(""),
- Cut_v2_Event_bCent({}),
- Cut_v2_Event_mCent({}),
- Cut_v2_Particle_ptmin(1.0),
- Cut_v2_Particle_ptmax(1.5),
- Cut_v2_Particle_etamin(-100.),
- Cut_v2_Particle_etamax(100.),
- Cut_v2_Particle_ymin(-0.05),
- Cut_v2_Particle_ymax(0.05),
- Cut_v2_Particle_ptmin_pi(0.0),
- Cut_v2_Particle_ptmax_pi(0.5),
- Cut_v2_Particle_ymin_pi(-0.05),
- Cut_v2_Particle_ymax_pi(0.05),
- Cut_v2_Particle_ptmin_ka(0.2),
- Cut_v2_Particle_ptmax_ka(0.9),
- Cut_v2_Particle_ymin_ka(-0.05),
- Cut_v2_Particle_ymax_ka(0.05),
- Cut_v2_Particle_ptmin_pr(1.0),
- Cut_v2_Particle_ptmax_pr(1.5),
- Cut_v2_Particle_ymin_pr(-0.05),
- Cut_v2_Particle_ymax_pr(0.05),
- Cut_v2_Particle_ptmin_ne(1.0),
- Cut_v2_Particle_ptmax_ne(1.5),
- Cut_v2_Particle_ymin_ne(-0.05),
- Cut_v2_Particle_ymax_ne(0.05),
- Cut_v3_Event_bmin(0.),
- Cut_v3_Event_bmax(16.),
- sCut_v3_Event_bCent(""),
- sCut_v3_Event_mCent(""),
- Cut_v3_Event_bCent({}),
- Cut_v3_Event_mCent({}),
- Cut_v3_Particle_ptmin(1.0),
- Cut_v3_Particle_ptmax(1.5),
- Cut_v3_Particle_etamin(-100.),
- Cut_v3_Particle_etamax(100.),
- Cut_v3_Particle_ymin(-0.05),
- Cut_v3_Particle_ymax(0.05),
- Cut_v3_Particle_ptmin_pi(0.0),
- Cut_v3_Particle_ptmax_pi(0.5),
- Cut_v3_Particle_ymin_pi(-0.05),
- Cut_v3_Particle_ymax_pi(0.05),
- Cut_v3_Particle_ptmin_ka(0.2),
- Cut_v3_Particle_ptmax_ka(0.9),
- Cut_v3_Particle_ymin_ka(-0.05),
- Cut_v3_Particle_ymax_ka(0.05),
- Cut_v3_Particle_ptmin_pr(1.0),
- Cut_v3_Particle_ptmax_pr(1.5),
- Cut_v3_Particle_ymin_pr(-0.05),
- Cut_v3_Particle_ymax_pr(0.05),
- Cut_v3_Particle_ptmin_ne(1.0),
- Cut_v3_Particle_ptmax_ne(1.5),
- Cut_v3_Particle_ymin_ne(-0.05),
- Cut_v3_Particle_ymax_ne(0.05),
- Cut_v4_Event_bmin(0.),
- Cut_v4_Event_bmax(16.),
- sCut_v4_Event_bCent(""),
- sCut_v4_Event_mCent(""),
- Cut_v4_Event_bCent({}),
- Cut_v4_Event_mCent({}),
- Cut_v4_Particle_ptmin(1.0),
- Cut_v4_Particle_ptmax(1.5),
- Cut_v4_Particle_etamin(-100.),
- Cut_v4_Particle_etamax(100.),
- Cut_v4_Particle_ymin(-0.05),
- Cut_v4_Particle_ymax(0.05),
- Cut_v4_Particle_ptmin_pi(0.0),
- Cut_v4_Particle_ptmax_pi(0.5),
- Cut_v4_Particle_ymin_pi(-0.05),
- Cut_v4_Particle_ymax_pi(0.05),
- Cut_v4_Particle_ptmin_ka(0.2),
- Cut_v4_Particle_ptmax_ka(0.9),
- Cut_v4_Particle_ymin_ka(-0.05),
- Cut_v4_Particle_ymax_ka(0.05),
- Cut_v4_Particle_ptmin_pr(1.0),
- Cut_v4_Particle_ptmax_pr(1.5),
- Cut_v4_Particle_ymin_pr(-0.05),
- Cut_v4_Particle_ymax_pr(0.05),
- Cut_v4_Particle_ptmin_ne(1.0),
- Cut_v4_Particle_ptmax_ne(1.5),
- Cut_v4_Particle_ymin_ne(-0.05),
- Cut_v4_Particle_ymax_ne(0.05)
- {
- }
- qaUtility::~qaUtility()
- {
- }
- qaUtility *qaUtility::GetInstance()
- {
- if (fUtility == nullptr)
- {
- fUtility = new qaUtility();
- }
- return fUtility;
- }
- Bool_t qaUtility::ReadConfig(const TString &configFileName)
- {
- if (configFileName.Length() == 0)
- {
- return false;
- }
- TEnv env(configFileName);
- Nevents = env.GetValue("Nevents", 0);
- debug = env.GetValue("debug", 0);
- Is_minbias = env.GetValue("Is_minbias", 0);
- Cut_minbias_Event_bmin = env.GetValue("Cut_minbias_Event_bmin", 0.);
- Cut_minbias_Event_bmax = env.GetValue("Cut_minbias_Event_bmax", 0.);
- Cut_minbias_Particle_ptmin = env.GetValue("Cut_minbias_Particle_ptmin", 0.);
- Cut_minbias_Particle_ptmax = env.GetValue("Cut_minbias_Particle_ptmax", 0.);
- Cut_minbias_Particle_etamin = env.GetValue("Cut_minbias_Particle_etamin", 0.);
- Cut_minbias_Particle_etamax = env.GetValue("Cut_minbias_Particle_etamax", 0.);
- Cut_minbias_Particle_ymin = env.GetValue("Cut_minbias_Particle_ymin", 0.);
- Cut_minbias_Particle_ymax = env.GetValue("Cut_minbias_Particle_ymax", 0.);
- Is_refmult = env.GetValue("Is_refmult", 0);
- Cut_refmult_Event_bmin = env.GetValue("Cut_refmult_Event_bmin", 0.);
- Cut_refmult_Event_bmax = env.GetValue("Cut_refmult_Event_bmax", 0.);
- Cut_refmult_Particle_ptmin = env.GetValue("Cut_refmult_Particle_ptmin", 0.);
- Cut_refmult_Particle_ptmax = env.GetValue("Cut_refmult_Particle_ptmax", 0.);
- Cut_refmult_Particle_etamin = env.GetValue("Cut_refmult_Particle_etamin", 0.);
- Cut_refmult_Particle_etamax = env.GetValue("Cut_refmult_Particle_etamax", 0.);
- Cut_refmult_Particle_isCharged = env.GetValue("Cut_refmult_Particle_isCharged", 0);
- Is_v1 = env.GetValue("Is_v1", 0);
- Cut_v1_Event_bmin = env.GetValue("Cut_v1_Event_bmin", 0.);
- Cut_v1_Event_bmax = env.GetValue("Cut_v1_Event_bmax", 0.);
- sCut_v1_Event_bCent = env.GetValue("Cut_v1_Event_bCent", "");
- sCut_v1_Event_mCent = env.GetValue("Cut_v1_Event_mCent", "");
- Cut_v1_Particle_ptmin = env.GetValue("Cut_v1_Particle_ptmin", 0.);
- Cut_v1_Particle_ptmax = env.GetValue("Cut_v1_Particle_ptmax", 0.);
- Cut_v1_Particle_etamin = env.GetValue("Cut_v1_Particle_etamin", 0.);
- Cut_v1_Particle_etamax = env.GetValue("Cut_v1_Particle_etamax", 0.);
- Cut_v1_Particle_ymin = env.GetValue("Cut_v1_Particle_ymin", 0.);
- Cut_v1_Particle_ymax = env.GetValue("Cut_v1_Particle_ymax", 0.);
- Cut_v1_Particle_ptmin_pi = env.GetValue("Cut_v1_Particle_ptmin_pi", 0.);
- Cut_v1_Particle_ptmax_pi = env.GetValue("Cut_v1_Particle_ptmax_pi", 0.);
- Cut_v1_Particle_ymin_pi = env.GetValue("Cut_v1_Particle_ymin_pi", 0.);
- Cut_v1_Particle_ymax_pi = env.GetValue("Cut_v1_Particle_ymax_pi", 0.);
- Cut_v1_Particle_ptmin_ka = env.GetValue("Cut_v1_Particle_ptmin_ka", 0.);
- Cut_v1_Particle_ptmax_ka = env.GetValue("Cut_v1_Particle_ptmax_ka", 0.);
- Cut_v1_Particle_ymin_ka = env.GetValue("Cut_v1_Particle_ymin_ka", 0.);
- Cut_v1_Particle_ymax_ka = env.GetValue("Cut_v1_Particle_ymax_ka", 0.);
- Cut_v1_Particle_ptmin_pr = env.GetValue("Cut_v1_Particle_ptmin_pr", 0.);
- Cut_v1_Particle_ptmax_pr = env.GetValue("Cut_v1_Particle_ptmax_pr", 0.);
- Cut_v1_Particle_ymin_pr = env.GetValue("Cut_v1_Particle_ymin_pr", 0.);
- Cut_v1_Particle_ymax_pr = env.GetValue("Cut_v1_Particle_ymax_pr", 0.);
- Cut_v1_Particle_ptmin_ne = env.GetValue("Cut_v1_Particle_ptmin_ne", 0.);
- Cut_v1_Particle_ptmax_ne = env.GetValue("Cut_v1_Particle_ptmax_ne", 0.);
- Cut_v1_Particle_ymin_ne = env.GetValue("Cut_v1_Particle_ymin_ne", 0.);
- Cut_v1_Particle_ymax_ne = env.GetValue("Cut_v1_Particle_ymax_ne", 0.);
- Is_v2 = env.GetValue("Is_v2", 0);
- Cut_v2_Event_bmin = env.GetValue("Cut_v2_Event_bmin", 0.);
- Cut_v2_Event_bmax = env.GetValue("Cut_v2_Event_bmax", 0.);
- sCut_v2_Event_bCent = env.GetValue("Cut_v2_Event_bCent", "");
- sCut_v2_Event_mCent = env.GetValue("Cut_v2_Event_mCent", "");
- Cut_v2_Particle_ptmin = env.GetValue("Cut_v2_Particle_ptmin", 0.);
- Cut_v2_Particle_ptmax = env.GetValue("Cut_v2_Particle_ptmax", 0.);
- Cut_v2_Particle_etamin = env.GetValue("Cut_v2_Particle_etamin", 0.);
- Cut_v2_Particle_etamax = env.GetValue("Cut_v2_Particle_etamax", 0.);
- Cut_v2_Particle_ymin = env.GetValue("Cut_v2_Particle_ymin", 0.);
- Cut_v2_Particle_ymax = env.GetValue("Cut_v2_Particle_ymax", 0.);
- Cut_v2_Particle_ptmin_pi = env.GetValue("Cut_v2_Particle_ptmin_pi", 0.);
- Cut_v2_Particle_ptmax_pi = env.GetValue("Cut_v2_Particle_ptmax_pi", 0.);
- Cut_v2_Particle_ymin_pi = env.GetValue("Cut_v2_Particle_ymin_pi", 0.);
- Cut_v2_Particle_ymax_pi = env.GetValue("Cut_v2_Particle_ymax_pi", 0.);
- Cut_v2_Particle_ptmin_ka = env.GetValue("Cut_v2_Particle_ptmin_ka", 0.);
- Cut_v2_Particle_ptmax_ka = env.GetValue("Cut_v2_Particle_ptmax_ka", 0.);
- Cut_v2_Particle_ymin_ka = env.GetValue("Cut_v2_Particle_ymin_ka", 0.);
- Cut_v2_Particle_ymax_ka = env.GetValue("Cut_v2_Particle_ymax_ka", 0.);
- Cut_v2_Particle_ptmin_pr = env.GetValue("Cut_v2_Particle_ptmin_pr", 0.);
- Cut_v2_Particle_ptmax_pr = env.GetValue("Cut_v2_Particle_ptmax_pr", 0.);
- Cut_v2_Particle_ymin_pr = env.GetValue("Cut_v2_Particle_ymin_pr", 0.);
- Cut_v2_Particle_ymax_pr = env.GetValue("Cut_v2_Particle_ymax_pr", 0.);
- Cut_v2_Particle_ptmin_ne = env.GetValue("Cut_v2_Particle_ptmin_ne", 0.);
- Cut_v2_Particle_ptmax_ne = env.GetValue("Cut_v2_Particle_ptmax_ne", 0.);
- Cut_v2_Particle_ymin_ne = env.GetValue("Cut_v2_Particle_ymin_ne", 0.);
- Cut_v2_Particle_ymax_ne = env.GetValue("Cut_v2_Particle_ymax_ne", 0.);
- Is_v3 = env.GetValue("Is_v3", 0);
- Cut_v3_Event_bmin = env.GetValue("Cut_v3_Event_bmin", 0.);
- Cut_v3_Event_bmax = env.GetValue("Cut_v3_Event_bmax", 0.);
- sCut_v3_Event_bCent = env.GetValue("Cut_v3_Event_bCent", "");
- sCut_v3_Event_mCent = env.GetValue("Cut_v3_Event_mCent", "");
- Cut_v3_Particle_ptmin = env.GetValue("Cut_v3_Particle_ptmin", 0.);
- Cut_v3_Particle_ptmax = env.GetValue("Cut_v3_Particle_ptmax", 0.);
- Cut_v3_Particle_etamin = env.GetValue("Cut_v3_Particle_etamin", 0.);
- Cut_v3_Particle_etamax = env.GetValue("Cut_v3_Particle_etamax", 0.);
- Cut_v3_Particle_ymin = env.GetValue("Cut_v3_Particle_ymin", 0.);
- Cut_v3_Particle_ymax = env.GetValue("Cut_v3_Particle_ymax", 0.);
- Cut_v3_Particle_ptmin_pi = env.GetValue("Cut_v3_Particle_ptmin_pi", 0.);
- Cut_v3_Particle_ptmax_pi = env.GetValue("Cut_v3_Particle_ptmax_pi", 0.);
- Cut_v3_Particle_ymin_pi = env.GetValue("Cut_v3_Particle_ymin_pi", 0.);
- Cut_v3_Particle_ymax_pi = env.GetValue("Cut_v3_Particle_ymax_pi", 0.);
- Cut_v3_Particle_ptmin_ka = env.GetValue("Cut_v3_Particle_ptmin_ka", 0.);
- Cut_v3_Particle_ptmax_ka = env.GetValue("Cut_v3_Particle_ptmax_ka", 0.);
- Cut_v3_Particle_ymin_ka = env.GetValue("Cut_v3_Particle_ymin_ka", 0.);
- Cut_v3_Particle_ymax_ka = env.GetValue("Cut_v3_Particle_ymax_ka", 0.);
- Cut_v3_Particle_ptmin_pr = env.GetValue("Cut_v3_Particle_ptmin_pr", 0.);
- Cut_v3_Particle_ptmax_pr = env.GetValue("Cut_v3_Particle_ptmax_pr", 0.);
- Cut_v3_Particle_ymin_pr = env.GetValue("Cut_v3_Particle_ymin_pr", 0.);
- Cut_v3_Particle_ymax_pr = env.GetValue("Cut_v3_Particle_ymax_pr", 0.);
- Cut_v3_Particle_ptmin_ne = env.GetValue("Cut_v3_Particle_ptmin_ne", 0.);
- Cut_v3_Particle_ptmax_ne = env.GetValue("Cut_v3_Particle_ptmax_ne", 0.);
- Cut_v3_Particle_ymin_ne = env.GetValue("Cut_v3_Particle_ymin_ne", 0.);
- Cut_v3_Particle_ymax_ne = env.GetValue("Cut_v3_Particle_ymax_ne", 0.);
- Is_v4 = env.GetValue("Is_v4", 0);
- Cut_v4_Event_bmin = env.GetValue("Cut_v4_Event_bmin", 0.);
- Cut_v4_Event_bmax = env.GetValue("Cut_v4_Event_bmax", 0.);
- sCut_v4_Event_bCent = env.GetValue("Cut_v4_Event_bCent", "");
- sCut_v4_Event_mCent = env.GetValue("Cut_v4_Event_mCent", "");
- Cut_v4_Particle_ptmin = env.GetValue("Cut_v4_Particle_ptmin", 0.);
- Cut_v4_Particle_ptmax = env.GetValue("Cut_v4_Particle_ptmax", 0.);
- Cut_v4_Particle_etamin = env.GetValue("Cut_v4_Particle_etamin", 0.);
- Cut_v4_Particle_etamax = env.GetValue("Cut_v4_Particle_etamax", 0.);
- Cut_v4_Particle_ymin = env.GetValue("Cut_v4_Particle_ymin", 0.);
- Cut_v4_Particle_ymax = env.GetValue("Cut_v4_Particle_ymax", 0.);
- Cut_v4_Particle_ptmin_pi = env.GetValue("Cut_v4_Particle_ptmin_pi", 0.);
- Cut_v4_Particle_ptmax_pi = env.GetValue("Cut_v4_Particle_ptmax_pi", 0.);
- Cut_v4_Particle_ymin_pi = env.GetValue("Cut_v4_Particle_ymin_pi", 0.);
- Cut_v4_Particle_ymax_pi = env.GetValue("Cut_v4_Particle_ymax_pi", 0.);
- Cut_v4_Particle_ptmin_ka = env.GetValue("Cut_v4_Particle_ptmin_ka", 0.);
- Cut_v4_Particle_ptmax_ka = env.GetValue("Cut_v4_Particle_ptmax_ka", 0.);
- Cut_v4_Particle_ymin_ka = env.GetValue("Cut_v4_Particle_ymin_ka", 0.);
- Cut_v4_Particle_ymax_ka = env.GetValue("Cut_v4_Particle_ymax_ka", 0.);
- Cut_v4_Particle_ptmin_pr = env.GetValue("Cut_v4_Particle_ptmin_pr", 0.);
- Cut_v4_Particle_ptmax_pr = env.GetValue("Cut_v4_Particle_ptmax_pr", 0.);
- Cut_v4_Particle_ymin_pr = env.GetValue("Cut_v4_Particle_ymin_pr", 0.);
- Cut_v4_Particle_ymax_pr = env.GetValue("Cut_v4_Particle_ymax_pr", 0.);
- Cut_v4_Particle_ptmin_ne = env.GetValue("Cut_v4_Particle_ptmin_ne", 0.);
- Cut_v4_Particle_ptmax_ne = env.GetValue("Cut_v4_Particle_ptmax_ne", 0.);
- Cut_v4_Particle_ymin_ne = env.GetValue("Cut_v4_Particle_ymin_ne", 0.);
- Cut_v4_Particle_ymax_ne = env.GetValue("Cut_v4_Particle_ymax_ne", 0.);
- if (!initCentrality())
- return false;
- return true;
- }
- TChain *qaUtility::initChain(const TString &inputFileName, const char *chainName)
- {
- TChain *chain = new TChain(chainName);
- std::ifstream file(inputFileName.Data());
- std::string line;
- while (std::getline(file, line))
- {
- chain->Add(line.c_str());
- }
- return chain;
- }
- std::vector<Float_t> qaUtility::ParseVector(std::string _input)
- {
- std::vector<Float_t> vB;
- std::istringstream iss(_input);
- std::copy(std::istream_iterator<Float_t>(iss),
- std::istream_iterator<Float_t>(),
- std::back_inserter(vB));
- return vB;
- }
- Bool_t qaUtility::initCentrality()
- {
- Cut_v1_Event_bCent = ParseVector(sCut_v1_Event_bCent);
- Cut_v2_Event_bCent = ParseVector(sCut_v2_Event_bCent);
- Cut_v3_Event_bCent = ParseVector(sCut_v3_Event_bCent);
- Cut_v4_Event_bCent = ParseVector(sCut_v4_Event_bCent);
- Cut_v1_Event_mCent = ParseVector(sCut_v1_Event_mCent);
- Cut_v2_Event_mCent = ParseVector(sCut_v2_Event_mCent);
- Cut_v3_Event_mCent = ParseVector(sCut_v3_Event_mCent);
- Cut_v4_Event_mCent = ParseVector(sCut_v4_Event_mCent);
- if (Cut_v1_Event_bCent.size() == 0 ||
- Cut_v2_Event_bCent.size() == 0 ||
- Cut_v3_Event_bCent.size() == 0 ||
- Cut_v4_Event_bCent.size() == 0 ||
- Cut_v1_Event_mCent.size() == 0 ||
- Cut_v2_Event_mCent.size() == 0 ||
- Cut_v3_Event_mCent.size() == 0 ||
- Cut_v4_Event_mCent.size() == 0)
- {
- return false;
- }
- return true;
- }
- Bool_t qaUtility::Cut_Event_minbias(qaEvent *const &event)
- {
- if (event->GetB() < Cut_minbias_Event_bmin)
- return false;
- if (event->GetB() > Cut_minbias_Event_bmax)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Event_refmult(qaEvent *const &event)
- {
- if (event->GetB() < Cut_refmult_Event_bmin)
- return false;
- if (event->GetB() > Cut_refmult_Event_bmax)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Event_v1(qaEvent *const &event)
- {
- if (event->GetB() < Cut_v1_Event_bmin)
- return false;
- if (event->GetB() > Cut_v1_Event_bmax)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Event_v2(qaEvent *const &event)
- {
- if (event->GetB() < Cut_v2_Event_bmin)
- return false;
- if (event->GetB() > Cut_v2_Event_bmax)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Event_v3(qaEvent *const &event)
- {
- if (event->GetB() < Cut_v3_Event_bmin)
- return false;
- if (event->GetB() > Cut_v3_Event_bmax)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Event_v4(qaEvent *const &event)
- {
- if (event->GetB() < Cut_v4_Event_bmin)
- return false;
- if (event->GetB() > Cut_v4_Event_bmax)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Particle_minbias(qaParticle *const &particle)
- {
- if (particle->GetPt() < Cut_minbias_Particle_ptmin)
- return false;
- if (particle->GetPt() > Cut_minbias_Particle_ptmax)
- return false;
- if (particle->GetEta() < Cut_minbias_Particle_etamin)
- return false;
- if (particle->GetEta() > Cut_minbias_Particle_etamax)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Particle_refmult(qaParticle *const &particle)
- {
- if (particle->GetPt() < Cut_refmult_Particle_ptmin)
- return false;
- if (particle->GetPt() > Cut_refmult_Particle_ptmax)
- return false;
- if (particle->GetEta() < Cut_refmult_Particle_etamin)
- return false;
- if (particle->GetEta() > Cut_refmult_Particle_etamax)
- return false;
- Double_t charge = GetCharge(particle->GetPdg());
- if (Cut_refmult_Particle_isCharged)
- {
- if (charge == error_code)
- return false;
- if (charge == 0)
- return false;
- }
- return true;
- }
- Bool_t qaUtility::Cut_Particle_v1_acceptance(qaParticle *const &particle)
- {
- if (particle->GetEta() < Cut_v1_Particle_etamin)
- return false;
- if (particle->GetEta() > Cut_v1_Particle_etamax)
- return false;
- if (particle->GetPt() < Cut_v1_Particle_ptmin)
- return false;
- if (particle->GetPt() > Cut_v1_Particle_ptmax)
- return false;
- Double_t charge = GetCharge(particle->GetPdg());
- if (charge == error_code)
- return false;
- if (charge == 0 && TMath::Abs(particle->GetPdg()) != 2112)
- return false;
- return true;
- }
- // Bool_t qaUtility::Cut_Particle_v1_PID_pt(qaParticle *const &particle, Int_t _pid)
- // {
- // if (particle->GetPdg() != vpdg.at(_pid) && _pid != 0 && _pid != 4)
- // return false;
- // // PID related kinematics cut
- // Double_t y = 0.5 * TMath::Log( (particle->GetEnergy() + particle->GetPz())/(particle->GetEnergy() - particle->GetPz()) );
- // if (_pid == 1 && y < Cut_v1_Particle_ymin_pi)
- // return false;
- // if (_pid == 1 && y > Cut_v1_Particle_ymax_pi)
- // return false;
- // if (_pid == 2 && y < Cut_v1_Particle_ymin_ka)
- // return false;
- // if (_pid == 2 && y > Cut_v1_Particle_ymax_ka)
- // return false;
- // if (_pid == 3 && y < Cut_v1_Particle_ymin_pr)
- // return false;
- // if (_pid == 3 && y > Cut_v1_Particle_ymax_pr)
- // return false;
- // if (_pid == 5 && y < Cut_v1_Particle_ymin_pi)
- // return false;
- // if (_pid == 5 && y > Cut_v1_Particle_ymax_pi)
- // return false;
- // if (_pid == 6 && y < Cut_v1_Particle_ymin_ka)
- // return false;
- // if (_pid == 6 && y > Cut_v1_Particle_ymax_ka)
- // return false;
- // if (_pid == 7 && y < Cut_v1_Particle_ymin_pr)
- // return false;
- // if (_pid == 7 && y > Cut_v1_Particle_ymax_pr)
- // return false;
- // Double_t charge = GetCharge(particle->GetPdg());
- // if (charge == error_code)
- // return false;
- // if (charge == 0)
- // return false;
- // if (_pid == 0 && charge < 0)
- // return false;
- // if (_pid == 4 && charge > 0)
- // return false;
- // return true;
- // }
- // Bool_t qaUtility::Cut_Particle_v1_PID_y(qaParticle *const &particle, Int_t _pid)
- // {
- // if (particle->GetPdg() != vpdg.at(_pid) && _pid != 0 && _pid != 4)
- // return false;
- // // PID related kinematics cut
- // if (_pid == 1 && particle->GetPt() < Cut_v1_Particle_ptmin_pi)
- // return false;
- // if (_pid == 1 && particle->GetPt() > Cut_v1_Particle_ptmax_pi)
- // return false;
- // if (_pid == 2 && particle->GetPt() < Cut_v1_Particle_ptmin_ka)
- // return false;
- // if (_pid == 2 && particle->GetPt() > Cut_v1_Particle_ptmax_ka)
- // return false;
- // if (_pid == 3 && particle->GetPt() < Cut_v1_Particle_ptmin_pr)
- // return false;
- // if (_pid == 3 && particle->GetPt() > Cut_v1_Particle_ptmax_pr)
- // return false;
- // if (_pid == 5 && particle->GetPt() < Cut_v1_Particle_ptmin_pi)
- // return false;
- // if (_pid == 5 && particle->GetPt() > Cut_v1_Particle_ptmax_pi)
- // return false;
- // if (_pid == 6 && particle->GetPt() < Cut_v1_Particle_ptmin_ka)
- // return false;
- // if (_pid == 6 && particle->GetPt() > Cut_v1_Particle_ptmax_ka)
- // return false;
- // if (_pid == 7 && particle->GetPt() < Cut_v1_Particle_ptmin_pr)
- // return false;
- // if (_pid == 7 && particle->GetPt() > Cut_v1_Particle_ptmax_pr)
- // return false;
- // Double_t charge = GetCharge(particle->GetPdg());
- // if (charge == error_code)
- // return false;
- // if (charge == 0)
- // return false;
- // if (_pid == 0 && charge < 0)
- // return false;
- // if (_pid == 4 && charge > 0)
- // return false;
- // return true;
- // }
- Bool_t qaUtility::Cut_Particle_v1_PID_pt(qaParticleLight const &particle, Int_t _pid)
- {
- if (_pid == -1)
- return false;
- if (particle.GetPdg() != vpdg.at(_pid) && _pid != 0 && _pid != 5)
- return false;
- // PID related kinematics cut
- Double_t y = particle.GetRapidity(); //0.5 * TMath::Log((particle.GetEnergy() + particle.GetPz()) / (particle.GetEnergy() - particle.GetPz()));
- if (_pid == 1 && y < Cut_v1_Particle_ymin_pi)
- return false;
- if (_pid == 1 && y > Cut_v1_Particle_ymax_pi)
- return false;
- if (_pid == 2 && y < Cut_v1_Particle_ymin_ka)
- return false;
- if (_pid == 2 && y > Cut_v1_Particle_ymax_ka)
- return false;
- if (_pid == 3 && y < Cut_v1_Particle_ymin_pr)
- return false;
- if (_pid == 3 && y > Cut_v1_Particle_ymax_pr)
- return false;
- if (_pid == 4 && y < Cut_v1_Particle_ymin_ne)
- return false;
- if (_pid == 4 && y > Cut_v1_Particle_ymax_ne)
- return false;
- if (_pid == 6 && y < Cut_v1_Particle_ymin_pi)
- return false;
- if (_pid == 6 && y > Cut_v1_Particle_ymax_pi)
- return false;
- if (_pid == 7 && y < Cut_v1_Particle_ymin_ka)
- return false;
- if (_pid == 7 && y > Cut_v1_Particle_ymax_ka)
- return false;
- if (_pid == 8 && y < Cut_v1_Particle_ymin_pr)
- return false;
- if (_pid == 8 && y > Cut_v1_Particle_ymax_pr)
- return false;
- if (_pid == 9 && y < Cut_v1_Particle_ymin_ne)
- return false;
- if (_pid == 9 && y > Cut_v1_Particle_ymax_ne)
- return false;
- Double_t charge = GetCharge(particle.GetPdg());
- if (charge == error_code)
- return false;
- if (charge == 0 && TMath::Abs(particle.GetPdg()) != 2112)
- return false;
- if (_pid == 0 && charge < 0)
- return false;
- if (_pid == 5 && charge > 0)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Particle_v1_PID_y(qaParticleLight const &particle, Int_t _pid)
- {
- if (_pid == -1)
- return false;
- if (particle.GetPdg() != vpdg.at(_pid) && _pid != 0 && _pid != 5)
- return false;
- // PID related kinematics cut
- if (_pid == 1 && particle.GetPt() < Cut_v1_Particle_ptmin_pi)
- return false;
- if (_pid == 1 && particle.GetPt() > Cut_v1_Particle_ptmax_pi)
- return false;
- if (_pid == 2 && particle.GetPt() < Cut_v1_Particle_ptmin_ka)
- return false;
- if (_pid == 2 && particle.GetPt() > Cut_v1_Particle_ptmax_ka)
- return false;
- if (_pid == 3 && particle.GetPt() < Cut_v1_Particle_ptmin_pr)
- return false;
- if (_pid == 3 && particle.GetPt() > Cut_v1_Particle_ptmax_pr)
- return false;
- if (_pid == 4 && particle.GetPt() < Cut_v1_Particle_ptmin_ne)
- return false;
- if (_pid == 4 && particle.GetPt() > Cut_v1_Particle_ptmax_ne)
- return false;
- if (_pid == 6 && particle.GetPt() < Cut_v1_Particle_ptmin_pi)
- return false;
- if (_pid == 6 && particle.GetPt() > Cut_v1_Particle_ptmax_pi)
- return false;
- if (_pid == 7 && particle.GetPt() < Cut_v1_Particle_ptmin_ka)
- return false;
- if (_pid == 7 && particle.GetPt() > Cut_v1_Particle_ptmax_ka)
- return false;
- if (_pid == 8 && particle.GetPt() < Cut_v1_Particle_ptmin_pr)
- return false;
- if (_pid == 8 && particle.GetPt() > Cut_v1_Particle_ptmax_pr)
- return false;
- if (_pid == 9 && particle.GetPt() < Cut_v1_Particle_ptmin_ne)
- return false;
- if (_pid == 9 && particle.GetPt() > Cut_v1_Particle_ptmax_ne)
- return false;
- Double_t charge = GetCharge(particle.GetPdg());
- if (charge == error_code)
- return false;
- if (charge == 0 && TMath::Abs(particle.GetPdg()) != 2112)
- return false;
- if (_pid == 0 && charge < 0)
- return false;
- if (_pid == 5 && charge > 0)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Particle_v2_acceptance(qaParticle *const &particle)
- {
- if (particle->GetEta() < Cut_v2_Particle_etamin)
- return false;
- if (particle->GetEta() > Cut_v2_Particle_etamax)
- return false;
- if (particle->GetPt() < Cut_v2_Particle_ptmin)
- return false;
- if (particle->GetPt() > Cut_v2_Particle_ptmax)
- return false;
- Double_t charge = GetCharge(particle->GetPdg());
- if (charge == error_code)
- return false;
- if (charge == 0 && TMath::Abs(particle->GetPdg()) != 2112)
- return false;
- return true;
- }
- // Bool_t qaUtility::Cut_Particle_v2_PID_pt(qaParticle *const &particle, Int_t _pid)
- // {
- // if (particle->GetPdg() != vpdg.at(_pid) && _pid != 0 && _pid != 4)
- // return false;
- // // PID related kinematics cut
- // Double_t y = 0.5 * TMath::Log( (particle->GetEnergy() + particle->GetPz())/(particle->GetEnergy() - particle->GetPz()) );
- // if (_pid == 1 && y < Cut_v2_Particle_ymin_pi)
- // return false;
- // if (_pid == 1 && y > Cut_v2_Particle_ymax_pi)
- // return false;
- // if (_pid == 2 && y < Cut_v2_Particle_ymin_ka)
- // return false;
- // if (_pid == 2 && y > Cut_v2_Particle_ymax_ka)
- // return false;
- // if (_pid == 3 && y < Cut_v2_Particle_ymin_pr)
- // return false;
- // if (_pid == 3 && y > Cut_v2_Particle_ymax_pr)
- // return false;
- // if (_pid == 5 && y < Cut_v2_Particle_ymin_pi)
- // return false;
- // if (_pid == 5 && y > Cut_v2_Particle_ymax_pi)
- // return false;
- // if (_pid == 6 && y < Cut_v2_Particle_ymin_ka)
- // return false;
- // if (_pid == 6 && y > Cut_v2_Particle_ymax_ka)
- // return false;
- // if (_pid == 7 && y < Cut_v2_Particle_ymin_pr)
- // return false;
- // if (_pid == 7 && y > Cut_v2_Particle_ymax_pr)
- // return false;
- // Double_t charge = GetCharge(particle->GetPdg());
- // if (charge == error_code)
- // return false;
- // if (charge == 0)
- // return false;
- // if (_pid == 0 && charge < 0)
- // return false;
- // if (_pid == 4 && charge > 0)
- // return false;
- // return true;
- // }
- // Bool_t qaUtility::Cut_Particle_v2_PID_y(qaParticle *const &particle, Int_t _pid)
- // {
- // if (particle->GetPdg() != vpdg.at(_pid) && _pid != 0 && _pid != 4)
- // return false;
- // // PID related kinematics cut
- // if (_pid == 1 && particle->GetPt() < Cut_v2_Particle_ptmin_pi)
- // return false;
- // if (_pid == 1 && particle->GetPt() > Cut_v2_Particle_ptmax_pi)
- // return false;
- // if (_pid == 2 && particle->GetPt() < Cut_v2_Particle_ptmin_ka)
- // return false;
- // if (_pid == 2 && particle->GetPt() > Cut_v2_Particle_ptmax_ka)
- // return false;
- // if (_pid == 3 && particle->GetPt() < Cut_v2_Particle_ptmin_pr)
- // return false;
- // if (_pid == 3 && particle->GetPt() > Cut_v2_Particle_ptmax_pr)
- // return false;
- // if (_pid == 5 && particle->GetPt() < Cut_v2_Particle_ptmin_pi)
- // return false;
- // if (_pid == 5 && particle->GetPt() > Cut_v2_Particle_ptmax_pi)
- // return false;
- // if (_pid == 6 && particle->GetPt() < Cut_v2_Particle_ptmin_ka)
- // return false;
- // if (_pid == 6 && particle->GetPt() > Cut_v2_Particle_ptmax_ka)
- // return false;
- // if (_pid == 7 && particle->GetPt() < Cut_v2_Particle_ptmin_pr)
- // return false;
- // if (_pid == 7 && particle->GetPt() > Cut_v2_Particle_ptmax_pr)
- // return false;
- // Double_t charge = GetCharge(particle->GetPdg());
- // if (charge == error_code)
- // return false;
- // if (charge == 0)
- // return false;
- // if (_pid == 0 && charge < 0)
- // return false;
- // if (_pid == 4 && charge > 0)
- // return false;
- // return true;
- // }
- Bool_t qaUtility::Cut_Particle_v2_PID_pt(qaParticleLight const &particle, Int_t _pid)
- {
- if (_pid == -1)
- return false;
- if (particle.GetPdg() != vpdg.at(_pid) && _pid != 0 && _pid != 5)
- return false;
- // PID related kinematics cut
- Double_t y = particle.GetRapidity(); //0.5 * TMath::Log((particle.GetEnergy() + particle.GetPz()) / (particle.GetEnergy() - particle.GetPz()));
- if (_pid == 1 && y < Cut_v2_Particle_ymin_pi)
- return false;
- if (_pid == 1 && y > Cut_v2_Particle_ymax_pi)
- return false;
- if (_pid == 2 && y < Cut_v2_Particle_ymin_ka)
- return false;
- if (_pid == 2 && y > Cut_v2_Particle_ymax_ka)
- return false;
- if (_pid == 3 && y < Cut_v2_Particle_ymin_pr)
- return false;
- if (_pid == 3 && y > Cut_v2_Particle_ymax_pr)
- return false;
- if (_pid == 4 && y < Cut_v2_Particle_ymin_ne)
- return false;
- if (_pid == 4 && y > Cut_v2_Particle_ymax_ne)
- return false;
- if (_pid == 6 && y < Cut_v2_Particle_ymin_pi)
- return false;
- if (_pid == 6 && y > Cut_v2_Particle_ymax_pi)
- return false;
- if (_pid == 7 && y < Cut_v2_Particle_ymin_ka)
- return false;
- if (_pid == 7 && y > Cut_v2_Particle_ymax_ka)
- return false;
- if (_pid == 8 && y < Cut_v2_Particle_ymin_pr)
- return false;
- if (_pid == 8 && y > Cut_v2_Particle_ymax_pr)
- return false;
- if (_pid == 9 && y < Cut_v2_Particle_ymin_ne)
- return false;
- if (_pid == 9 && y > Cut_v2_Particle_ymax_ne)
- return false;
- Double_t charge = GetCharge(particle.GetPdg());
- if (charge == error_code)
- return false;
- if (charge == 0 && TMath::Abs(particle.GetPdg()) != 2112)
- return false;
- if (_pid == 0 && charge < 0)
- return false;
- if (_pid == 5 && charge > 0)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Particle_v2_PID_y(qaParticleLight const &particle, Int_t _pid)
- {
- if (_pid == -1)
- return false;
- if (particle.GetPdg() != vpdg.at(_pid) && _pid != 0 && _pid != 5)
- return false;
- // PID related kinematics cut
- if (_pid == 1 && particle.GetPt() < Cut_v2_Particle_ptmin_pi)
- return false;
- if (_pid == 1 && particle.GetPt() > Cut_v2_Particle_ptmax_pi)
- return false;
- if (_pid == 2 && particle.GetPt() < Cut_v2_Particle_ptmin_ka)
- return false;
- if (_pid == 2 && particle.GetPt() > Cut_v2_Particle_ptmax_ka)
- return false;
- if (_pid == 3 && particle.GetPt() < Cut_v2_Particle_ptmin_pr)
- return false;
- if (_pid == 3 && particle.GetPt() > Cut_v2_Particle_ptmax_pr)
- return false;
- if (_pid == 4 && particle.GetPt() < Cut_v2_Particle_ptmin_ne)
- return false;
- if (_pid == 4 && particle.GetPt() > Cut_v2_Particle_ptmax_ne)
- return false;
- if (_pid == 6 && particle.GetPt() < Cut_v2_Particle_ptmin_pi)
- return false;
- if (_pid == 6 && particle.GetPt() > Cut_v2_Particle_ptmax_pi)
- return false;
- if (_pid == 7 && particle.GetPt() < Cut_v2_Particle_ptmin_ka)
- return false;
- if (_pid == 7 && particle.GetPt() > Cut_v2_Particle_ptmax_ka)
- return false;
- if (_pid == 8 && particle.GetPt() < Cut_v2_Particle_ptmin_pr)
- return false;
- if (_pid == 8 && particle.GetPt() > Cut_v2_Particle_ptmax_pr)
- return false;
- if (_pid == 9 && particle.GetPt() < Cut_v2_Particle_ptmin_ne)
- return false;
- if (_pid == 9 && particle.GetPt() > Cut_v2_Particle_ptmax_ne)
- return false;
- Double_t charge = GetCharge(particle.GetPdg());
- if (charge == error_code)
- return false;
- if (charge == 0 && TMath::Abs(particle.GetPdg()) != 2112)
- return false;
- if (_pid == 0 && charge < 0)
- return false;
- if (_pid == 5 && charge > 0)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Particle_v3_acceptance(qaParticle *const &particle)
- {
- if (particle->GetEta() < Cut_v3_Particle_etamin)
- return false;
- if (particle->GetEta() > Cut_v3_Particle_etamax)
- return false;
- if (particle->GetPt() < Cut_v3_Particle_ptmin)
- return false;
- if (particle->GetPt() > Cut_v3_Particle_ptmax)
- return false;
- Double_t charge = GetCharge(particle->GetPdg());
- if (charge == error_code)
- return false;
- if (charge == 0 && TMath::Abs(particle->GetPdg()) != 2112)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Particle_v3_PID_pt(qaParticleLight const &particle, Int_t _pid)
- {
- if (_pid == -1)
- return false;
- if (particle.GetPdg() != vpdg.at(_pid) && _pid != 0 && _pid != 5)
- return false;
- // PID related kinematics cut
- Double_t y = particle.GetRapidity(); //0.5 * TMath::Log((particle.GetEnergy() + particle.GetPz()) / (particle.GetEnergy() - particle.GetPz()));
- if (_pid == 1 && y < Cut_v3_Particle_ymin_pi)
- return false;
- if (_pid == 1 && y > Cut_v3_Particle_ymax_pi)
- return false;
- if (_pid == 2 && y < Cut_v3_Particle_ymin_ka)
- return false;
- if (_pid == 2 && y > Cut_v3_Particle_ymax_ka)
- return false;
- if (_pid == 3 && y < Cut_v3_Particle_ymin_pr)
- return false;
- if (_pid == 3 && y > Cut_v3_Particle_ymax_pr)
- return false;
- if (_pid == 4 && y < Cut_v3_Particle_ymin_ne)
- return false;
- if (_pid == 4 && y > Cut_v3_Particle_ymax_ne)
- return false;
- if (_pid == 6 && y < Cut_v3_Particle_ymin_pi)
- return false;
- if (_pid == 6 && y > Cut_v3_Particle_ymax_pi)
- return false;
- if (_pid == 7 && y < Cut_v3_Particle_ymin_ka)
- return false;
- if (_pid == 7 && y > Cut_v3_Particle_ymax_ka)
- return false;
- if (_pid == 8 && y < Cut_v3_Particle_ymin_pr)
- return false;
- if (_pid == 8 && y > Cut_v3_Particle_ymax_pr)
- return false;
- if (_pid == 9 && y < Cut_v3_Particle_ymin_ne)
- return false;
- if (_pid == 9 && y > Cut_v3_Particle_ymax_ne)
- return false;
- Double_t charge = GetCharge(particle.GetPdg());
- if (charge == error_code)
- return false;
- if (charge == 0 && TMath::Abs(particle.GetPdg()) != 2112)
- return false;
- if (_pid == 0 && charge < 0)
- return false;
- if (_pid == 5 && charge > 0)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Particle_v3_PID_y(qaParticleLight const &particle, Int_t _pid)
- {
- if (_pid == -1)
- return false;
- if (particle.GetPdg() != vpdg.at(_pid) && _pid != 0 && _pid != 5)
- return false;
- // PID related kinematics cut
- if (_pid == 1 && particle.GetPt() < Cut_v3_Particle_ptmin_pi)
- return false;
- if (_pid == 1 && particle.GetPt() > Cut_v3_Particle_ptmax_pi)
- return false;
- if (_pid == 2 && particle.GetPt() < Cut_v3_Particle_ptmin_ka)
- return false;
- if (_pid == 2 && particle.GetPt() > Cut_v3_Particle_ptmax_ka)
- return false;
- if (_pid == 3 && particle.GetPt() < Cut_v3_Particle_ptmin_pr)
- return false;
- if (_pid == 3 && particle.GetPt() > Cut_v3_Particle_ptmax_pr)
- return false;
- if (_pid == 4 && particle.GetPt() < Cut_v3_Particle_ptmin_ne)
- return false;
- if (_pid == 4 && particle.GetPt() > Cut_v3_Particle_ptmax_ne)
- return false;
- if (_pid == 6 && particle.GetPt() < Cut_v3_Particle_ptmin_pi)
- return false;
- if (_pid == 6 && particle.GetPt() > Cut_v3_Particle_ptmax_pi)
- return false;
- if (_pid == 7 && particle.GetPt() < Cut_v3_Particle_ptmin_ka)
- return false;
- if (_pid == 7 && particle.GetPt() > Cut_v3_Particle_ptmax_ka)
- return false;
- if (_pid == 8 && particle.GetPt() < Cut_v3_Particle_ptmin_pr)
- return false;
- if (_pid == 8 && particle.GetPt() > Cut_v3_Particle_ptmax_pr)
- return false;
- if (_pid == 9 && particle.GetPt() < Cut_v3_Particle_ptmin_ne)
- return false;
- if (_pid == 9 && particle.GetPt() > Cut_v3_Particle_ptmax_ne)
- return false;
- Double_t charge = GetCharge(particle.GetPdg());
- if (charge == error_code)
- return false;
- if (charge == 0 && TMath::Abs(particle.GetPdg()) != 2112)
- return false;
- if (_pid == 0 && charge < 0)
- return false;
- if (_pid == 5 && charge > 0)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Particle_v4_acceptance(qaParticle *const &particle)
- {
- if (particle->GetEta() < Cut_v4_Particle_etamin)
- return false;
- if (particle->GetEta() > Cut_v4_Particle_etamax)
- return false;
- if (particle->GetPt() < Cut_v4_Particle_ptmin)
- return false;
- if (particle->GetPt() > Cut_v4_Particle_ptmax)
- return false;
- Double_t charge = GetCharge(particle->GetPdg());
- if (charge == error_code)
- return false;
- if (charge == 0 && TMath::Abs(particle->GetPdg()) != 2112)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Particle_v4_PID_pt(qaParticleLight const &particle, Int_t _pid)
- {
- if (_pid == -1)
- return false;
- if (particle.GetPdg() != vpdg.at(_pid) && _pid != 0 && _pid != 5)
- return false;
- // PID related kinematics cut
- Double_t y = 0.5 * TMath::Log((particle.GetEnergy() + particle.GetPz()) / (particle.GetEnergy() - particle.GetPz()));
- if (_pid == 1 && y < Cut_v4_Particle_ymin_pi)
- return false;
- if (_pid == 1 && y > Cut_v4_Particle_ymax_pi)
- return false;
- if (_pid == 2 && y < Cut_v4_Particle_ymin_ka)
- return false;
- if (_pid == 2 && y > Cut_v4_Particle_ymax_ka)
- return false;
- if (_pid == 3 && y < Cut_v4_Particle_ymin_pr)
- return false;
- if (_pid == 3 && y > Cut_v4_Particle_ymax_pr)
- return false;
- if (_pid == 4 && y < Cut_v4_Particle_ymin_ne)
- return false;
- if (_pid == 4 && y > Cut_v4_Particle_ymax_ne)
- return false;
- if (_pid == 6 && y < Cut_v4_Particle_ymin_pi)
- return false;
- if (_pid == 6 && y > Cut_v4_Particle_ymax_pi)
- return false;
- if (_pid == 7 && y < Cut_v4_Particle_ymin_ka)
- return false;
- if (_pid == 7 && y > Cut_v4_Particle_ymax_ka)
- return false;
- if (_pid == 8 && y < Cut_v4_Particle_ymin_pr)
- return false;
- if (_pid == 8 && y > Cut_v4_Particle_ymax_pr)
- return false;
- if (_pid == 9 && y < Cut_v4_Particle_ymin_ne)
- return false;
- if (_pid == 9 && y > Cut_v4_Particle_ymax_ne)
- return false;
- Double_t charge = GetCharge(particle.GetPdg());
- if (charge == error_code)
- return false;
- if (charge == 0 && TMath::Abs(particle.GetPdg()) != 2112)
- return false;
- if (_pid == 0 && charge < 0)
- return false;
- if (_pid == 5 && charge > 0)
- return false;
- return true;
- }
- Bool_t qaUtility::Cut_Particle_v4_PID_y(qaParticleLight const &particle, Int_t _pid)
- {
- if (_pid == -1)
- return false;
- if (particle.GetPdg() != vpdg.at(_pid) && _pid != 0 && _pid != 5)
- return false;
- // PID related kinematics cut
- if (_pid == 1 && particle.GetPt() < Cut_v4_Particle_ptmin_pi)
- return false;
- if (_pid == 1 && particle.GetPt() > Cut_v4_Particle_ptmax_pi)
- return false;
- if (_pid == 2 && particle.GetPt() < Cut_v4_Particle_ptmin_ka)
- return false;
- if (_pid == 2 && particle.GetPt() > Cut_v4_Particle_ptmax_ka)
- return false;
- if (_pid == 3 && particle.GetPt() < Cut_v4_Particle_ptmin_pr)
- return false;
- if (_pid == 3 && particle.GetPt() > Cut_v4_Particle_ptmax_pr)
- return false;
- if (_pid == 4 && particle.GetPt() < Cut_v4_Particle_ptmin_ne)
- return false;
- if (_pid == 4 && particle.GetPt() > Cut_v4_Particle_ptmax_ne)
- return false;
- if (_pid == 6 && particle.GetPt() < Cut_v4_Particle_ptmin_pi)
- return false;
- if (_pid == 6 && particle.GetPt() > Cut_v4_Particle_ptmax_pi)
- return false;
- if (_pid == 7 && particle.GetPt() < Cut_v4_Particle_ptmin_ka)
- return false;
- if (_pid == 7 && particle.GetPt() > Cut_v4_Particle_ptmax_ka)
- return false;
- if (_pid == 8 && particle.GetPt() < Cut_v4_Particle_ptmin_pr)
- return false;
- if (_pid == 8 && particle.GetPt() > Cut_v4_Particle_ptmax_pr)
- return false;
- if (_pid == 9 && particle.GetPt() < Cut_v4_Particle_ptmin_ne)
- return false;
- if (_pid == 9 && particle.GetPt() > Cut_v4_Particle_ptmax_ne)
- return false;
- Double_t charge = GetCharge(particle.GetPdg());
- if (charge == error_code)
- return false;
- if (charge == 0 && TMath::Abs(particle.GetPdg()) != 2112)
- return false;
- if (_pid == 0 && charge < 0)
- return false;
- if (_pid == 5 && charge > 0)
- return false;
- return true;
- }
- Double_t qaUtility::GetCharge(Int_t pdg)
- {
- auto particle = (TParticlePDG *)TDatabasePDG::Instance()->GetParticle(pdg);
- if (!particle)
- return error_code;
- return particle->Charge() / 3.;
- }
- Int_t qaUtility::GetPdgId(Int_t pdg)
- {
- if (pdg == vpdg.at(1))
- return 1;
- if (pdg == vpdg.at(2))
- return 2;
- if (pdg == vpdg.at(3))
- return 3;
- if (pdg == vpdg.at(4))
- return 4;
- if (pdg == vpdg.at(6))
- return 6;
- if (pdg == vpdg.at(7))
- return 7;
- if (pdg == vpdg.at(8))
- return 8;
- if (pdg == vpdg.at(9))
- return 9;
- return -1;
- }
- Int_t qaUtility::GetCentralityBin(Float_t b, std::vector<Float_t> vcent)
- {
- if (vcent.size() == 0)
- return -1;
- for (int i = 0; i < (int)vcent.size() - 1; i++)
- {
- if (b >= vcent.at(i) && b < vcent.at(i + 1))
- return i;
- }
- return -1;
- }
- Int_t qaUtility::GetCentMultBin(Int_t mult, std::vector<Float_t> vcent)
- {
- if (vcent.size() == 0)
- return -1;
- for (int i = 0; i < (int)vcent.size() - 1; i++)
- {
- if (mult >= vcent.at(i) && mult < vcent.at(i + 1))
- return i;
- }
- return -1;
- }
|