|
@@ -1,142 +0,0 @@
|
|
|
-#include <mciReader_phqmd.h>
|
|
|
-
|
|
|
-ClassImp(mciReader_phqmd);
|
|
|
-
|
|
|
-mciReader_phqmd::mciReader_phqmd(/* args */) : is_init(false), fCurrentEvent(-1), fEvent(nullptr), fParticle(nullptr), fNpart(0)
|
|
|
-{
|
|
|
-}
|
|
|
-
|
|
|
-mciReader_phqmd::~mciReader_phqmd()
|
|
|
-{
|
|
|
-}
|
|
|
-
|
|
|
-Bool_t mciReader_phqmd::ChainCheck()
|
|
|
-{
|
|
|
- if (!is_init)
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (fCurrentEvent == -1)
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- if (!fChainPHSD->GetEntry(fCurrentEvent))
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (!fChainFrag->GetEntry(fCurrentEvent))
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- return true;
|
|
|
-}
|
|
|
-
|
|
|
-void mciReader_phqmd::SetChain(const TString &inputFileName)
|
|
|
-{
|
|
|
- fChainPHSD = (TChain *)mciUtility::GetInstance()->initChain(inputFileName, fChainPHSDName);
|
|
|
-
|
|
|
- fChainPHSD->SetBranchAddress("event", &fEvent);
|
|
|
-
|
|
|
- fChainFrag = (TChain *)mciUtility::GetInstance()->initChain(inputFileName, fChainFragName);
|
|
|
-
|
|
|
- fChainFrag->SetBranchAddress("eventFrag", &fEventFrag);
|
|
|
-
|
|
|
- is_init = kTRUE;
|
|
|
-}
|
|
|
-
|
|
|
-mciEvent *mciReader_phqmd::ReadEvent(Long64_t iev)
|
|
|
-{
|
|
|
- fCurrentEvent = iev;
|
|
|
-
|
|
|
- if (!ChainCheck())
|
|
|
- {
|
|
|
- return nullptr;
|
|
|
- }
|
|
|
-
|
|
|
- mciEvent *event = new mciEvent();
|
|
|
-
|
|
|
- event->SetB(fEvent->GetB());
|
|
|
- // event->SetPhiRP(0.); // in PHQMD axis orientation is rotated by 180 deg. In HSD/PHSD it's ok.
|
|
|
- event->SetPhiRP(TMath::Pi()); // in PHQMD axis orientation is rotated by 180 deg. In HSD/PHSD it's ok.
|
|
|
- event->SetNparticles(fEvent->GetNpart() + fEventFrag->GetNfragMST()); // number of particles from PHSD and number of MST fragments
|
|
|
-
|
|
|
- return event;
|
|
|
-}
|
|
|
-
|
|
|
-mciParticle *mciReader_phqmd::ReadParticle(Int_t ipart)
|
|
|
-{
|
|
|
- mciParticle *particle = new mciParticle();
|
|
|
-
|
|
|
- if (!ChainCheck())
|
|
|
- {
|
|
|
- if (mciUtility::GetInstance()->debug) std::cerr << "mciReader_phqmd::ReadParticle: Failed chain check!" << std::endl;
|
|
|
- return particle;
|
|
|
- }
|
|
|
-
|
|
|
- if (ipart >= fEvent->GetNpart() + fEventFrag->GetNfragMST())
|
|
|
- {
|
|
|
- if (mciUtility::GetInstance()->debug) std::cerr << "mciReader_phqmd::ReadParticle: ipart >= Nparticlpants + Nfragments (" << ipart << " >= " << fEvent->GetNpart() << " + " << fEventFrag->GetNfragMST() << ")!" << std::endl;
|
|
|
- return particle;
|
|
|
- }
|
|
|
-
|
|
|
- if (ipart < 0)
|
|
|
- {
|
|
|
- if (mciUtility::GetInstance()->debug) std::cerr << "mciReader_phqmd::ReadParticle: ipart < 0!" << std::endl;
|
|
|
- return particle;
|
|
|
- }
|
|
|
-
|
|
|
- bool is_particle = false;
|
|
|
- bool is_fragment = false;
|
|
|
-
|
|
|
- if (ipart < fEvent->GetNpart())
|
|
|
- {
|
|
|
- is_particle = true;
|
|
|
- }
|
|
|
- if (ipart >= fEvent->GetNpart())
|
|
|
- {
|
|
|
- is_fragment = true;
|
|
|
- }
|
|
|
-
|
|
|
- if (!is_particle && !is_fragment)
|
|
|
- {
|
|
|
- if (mciUtility::GetInstance()->debug) std::cerr << "mciReader_phqmd::ReadParticle: particle is neither participant nor spectator!" << std::endl;
|
|
|
- return particle;
|
|
|
- }
|
|
|
-
|
|
|
- if (is_particle && is_fragment)
|
|
|
- {
|
|
|
- if (mciUtility::GetInstance()->debug) std::cerr << "mciReader_phqmd::ReadParticle: particle is both participant and spectator!" << std::endl;
|
|
|
- return particle;
|
|
|
- }
|
|
|
-
|
|
|
- if (is_particle)
|
|
|
- {
|
|
|
- fParticle = fEvent->GetParticle(ipart);
|
|
|
- if (fParticle->IsInMST()) // Check whether the particle from PHSD was used to create MST fragment
|
|
|
- {
|
|
|
- if (mciUtility::GetInstance()->debug) std::cerr << "mciReader_phqmd::ReadParticle: particle was used to create MST fragment!" << std::endl;
|
|
|
- return particle;
|
|
|
- }
|
|
|
- particle->SetEnergy(fParticle->E());
|
|
|
- particle->SetPdg(fParticle->GetPdg());
|
|
|
- particle->SetPxPyPz(fParticle->Px(), fParticle->Py(), fParticle->Pz());
|
|
|
- particle->SetTime(0.);
|
|
|
- particle->SetXYZ(0., 0., 0.);
|
|
|
- particle->SetCharge(fParticle->GetCharge());
|
|
|
- }
|
|
|
- if (is_fragment)
|
|
|
- {
|
|
|
- fFragmentMST = fEventFrag->GetFragmentMST(ipart - fEvent->GetNpart());
|
|
|
- particle->SetEnergy(fFragmentMST->E());
|
|
|
- particle->SetPdg(fFragmentMST->GetPdg());
|
|
|
- particle->SetPxPyPz(fFragmentMST->Px(), fFragmentMST->Py(), fFragmentMST->Pz());
|
|
|
- particle->SetTime(0.);
|
|
|
- particle->SetXYZ(0., 0., 0.);
|
|
|
- particle->SetCharge(fFragmentMST->GetZ());
|
|
|
- }
|
|
|
-
|
|
|
- return particle;
|
|
|
-}
|