#ifndef ___PID_CONVERTERS_STRUCT__ #define ___PID_CONVERTERS_STRUCT__ //###########################HELPERS FOR PID ############################# Int_t createSourceID(Int_t mId,vector& d) { //---------------------------------------------------- // creating the sourceID for this decay (Using Geant IDs) UInt_t ndau = d.size(); if(mId > 20 && ndau > 3) { ndau = 3; cout<<"createSourceID() : sourceID needed truncation from ndaughter = "< 4) { ndau = 4; cout<<"createSourceID() : sourceID needed truncation from ndaughter = "<geantID; } return sourceID; } void K0_S_L_distributor(smash_p& p){ //---------------------------------------------------------------------- // K0_S and K0_L should be equaly distributed 50:50 if (p.geantID == 16 || p.geantID == 10) { p.geantID = (gRandom->Rndm()<0.5)? 10 : 16; } //---------------------------------------------------------------------- } Int_t getPdgPIDtoGeant3(TDatabasePDG& PDG,smash_p& p, Bool_t redistribute_Kaons = kFALSE) { // set mass,charge,weight,geantID of p using TDatabasePDG // Missing particles in conversion PDG -> geant3 are handled // In case of Error 0 is returned and set to geantID TParticlePDG* pdg = PDG.GetParticle(p.pdg); if(!pdg){ return p.pdg + 10000000; cerr <<"ERROR : mapPdgPIDtoGeant3() : Particle not available in TDatabasePDG (in output id = pdgID + 10000000)"<K0S else if ( p.pdg == 113 ){ geantID = 41;} // rho0 else if ( p.pdg == 213 ){ geantID = 42;} // rho+ else if ( p.pdg == -213 ){ geantID = 43;} // rho- else if ( p.pdg == 223 ){ geantID = 52;} // omega else if ( p.pdg == 331 ){ geantID = 53;} // eta' else if ( p.pdg == 333 ){ geantID = 55;} // phi else if ( p.pdg == 2114 ){ geantID = 34;} // D0 else if ( p.pdg == 2224 ){ geantID = 35;} // D++ else if ( p.pdg == 2214 ){ geantID = 36;} // D+ else if ( p.pdg == 1114 ){ geantID = 37;} // D- //--------------------Additional particle rarely seen in output ------------------------ else if ( p.pdg == -12 || p.pdg == -14 || p.pdg == 14 || p.pdg == -16 || p.pdg == 16 ){ geantID = 4;} // nu_e_bar,nu_mu_bar,nu_mu,nu_tau_bar,nu_tau_bar --> nu_e else { TString msg = PDG.GetParticle(p.pdg)->GetName(); cerr<<"ERROR : mapMissingPIDtoGeant3(): unknow PID "<Rndm()<0.5)? 10 : 16; } } return geantID; } Int_t mapPdgPIDtoGeant3(TDatabasePDG& PDG,smash_p& p, Bool_t redistribute_Kaons = kTRUE) { // set mass,charge,weight,geantID of p using TDatabasePDG // Missing particles in conversion PDG -> geant3 are handled // In case of Error 0 is returned and set to geantID p.geantID = getPdgPIDtoGeant3(PDG,p,redistribute_Kaons); return p.geantID; } Bool_t setGenInfoSmash(TDatabasePDG& PDG,smash_p& p, Bool_t redistribute_Kaons = kTRUE){ // sets the geninfo in smash_p from infos // of smash vars Int_t parentID1 = getPdgPIDtoGeant3(PDG,p,redistribute_Kaons); Int_t parentID2 = getPdgPIDtoGeant3(PDG,p,redistribute_Kaons); if(parentID1 > 100 || parentID2 > 100) { p.genInfo1 = 10000; //sourceID p.genInfo2 = 10000; //parentID p.genInfo3 = 10000; //parentIndex return kFALSE; } else { Int_t sourceID = pow(10,1*2) * parentID1; sourceID += pow(10,0*2) * parentID2; p.genInfo1 = sourceID; p.genInfo2 = 1000000 + p.proc_type_origin; //parentID p.genInfo3 = 1000000 + p.proc_id_origin; //parentIndex } return kTRUE; } Int_t mapGeant3ToPDG(TDatabasePDG& PDG,smash_p& p) { // In case of Error 0 is returned and set to pdg Int_t id = PDG.ConvertGeant3ToPdg(p.geantID); if(id == 0){ // take care about the unknown pdg pids cerr<<"ERROR : mapGeant3ToPDG(): unknow geantPID "<