Pluto v6.3.0
Loading...
Searching...
No Matches
urqmd_f15_input.C
Go to the documentation of this file.
1#include "PHUrReader.h"
2#include "PReaction.h"
3#include "PPlutoBulkDecay.h"
4#include "PChannel.h"
5#include "PParticle.h"
6#include "PData.h"
7
8
9#include "TString.h"
10#include "TClonesArray.h"
11
12
13#include "hphysicsconstants.h"
14
15#include <iostream>
16
17#include <iostream>
18using namespace std;
19
20Int_t UserAnalysis(PParticle** pA,Int_t size){
21
22
23 TClonesArray* addon = PHUrReader::getAddon();
24 TClonesArray* event = PHUrReader::getEvent();
25 if(!addon) return 1;
26
27 Int_t sizeAdd = addon->GetEntries();
28 cout<<"UserAnalysis : nparticle ="<<size<<" ninput ="<<sizeAdd<<endl;
29 for(Int_t i = 0; i < size; i ++){
30 PParticle* p = pA[i];
31 if(0&&i<sizeAdd) {
32 PParticle* p1 = (PParticle*)event->At(i);
33 cout<<i<<" "<<p->ID()<<" "<<p1->ID()<<endl;
34 }
35 if(i >= sizeAdd) {
36 PParticle* p1=0;
37 Int_t parentIndex = p->GetParentIndex() ;
38 cout<<"daughter "<<i<<" id "<<HPhysicsConstants::pid(p->ID())<<flush;
39 while(parentIndex!=-1){
40 p1=0;
41 if(parentIndex < sizeAdd ){
42 p1 = (PParticle*) event->At(parentIndex);
43 } else {
44 p1 = pA[parentIndex];
45 }
46 if(p1) {
47 cout<<" -> "<<parentIndex<<" id "<<HPhysicsConstants::pid(p1->ID())<<flush;
48 parentIndex = p1->GetParentIndex();
49 } else cout<<"p1=0, should not happen"<<endl;
50 }
51 cout<<endl;
52 }
53 }
54 return 1;
55}
56
57void urqmd_f15_input(TString infile = "/hera/hades/dstsim/apr12/urqmd/bmax9/f15/Au_Au_1230MeV_1000evts_1.f15",
58 TString outfile ="out-dilep_pluto",
59 Int_t nEvents=10
60 )
61{
62 // Read in urqmd f15 file (collision history) and put the particles
63 // on the PLUTO bulk stack. Either dileptons (D0,D+,w,rho0,phi,eta,eta' and pi0)
64 // can be decayed via shining (translated for original UrQMD fortran routines,
65 // authors: Katharina Schmidt, Sascha Vogel, Christian Sturm 2007-2009) into
66 // e+/e- or by PLUTO bulk decay. Optional stable non dileptons can be
67 // written out. PHUrReader adds a TClonesArray "Addon" to the PLUTO Tree
68 // that contains original UrQMD infos about creation and absorbtion times , densities etc.
69 //
70
71 Int_t maxnum = 19999;
72 Int_t writeNonLeptons = 2; // default : 0=no nonleptons, 1=stable non leptons, 2=all nonlepton
73 Bool_t runUrmdShining = kFALSE; // default : kTRUE = run urqmd dilep shining code
74 Bool_t writeFreezeOutLeptonsOnly = kFALSE; // default : kFALSE = store intermediate dileptons to output
75 Bool_t doPlutoDecay = kFALSE; // default : kFALSE = do not decay dileptons with PLUTO
76 TString outputUrmdDilepton = "test_dilep.dat";
77
78 if(doPlutoDecay && runUrmdShining){
79 cout<<"WRONG CONFIG: RUNNING UrQMD SHINING and PLUTO DECAY AT THE SAME TIME MAKES NO SENSE! PLUTO SELECTED! "<<endl;
80 runUrmdShining = kFALSE;
81 }
82
83 makeStaticData()->AddDecay(-1,"eta' -> dilepton, gamma","eta'","dilepton,gamma",0.0009); // missing channel: BR from PDG upper limit
84 *(makeStaticData()->GetBatchValue("_system_particle_stacksize")) = maxnum; // we have a lot of particles from urqmd
85
86 //------------------------------------------------------
87 // setup Urqmd Reader
89 input->Input (infile);
90 input->Output (outputUrmdDilepton);
91 input->SetOutputNonDileptons (writeNonLeptons);
92 input->SetOutputLeptons (runUrmdShining );
93 input->SetOutputFreezeoutDileptons(writeFreezeOutLeptonsOnly);
94 input->SetMaxNumParticles(maxnum);
95 //------------------------------------------------------
96 // setup PLUTO
97
98 //######################################################
99 // Database work for selected channels of bulk decay (needed for PLUTO decay only)
100 //------------------------------------------------------
101 // switch all channels off
110
111
112 //------------------------------------------------------
113 // switch all wanted channels on
114 makeStaticData()->SetEnhanceChannelBR("D0" , "dilepton, n" ,1.);
115 makeStaticData()->SetEnhanceChannelBR("D+" , "dilepton, p" ,1.);
116 makeStaticData()->SetEnhanceChannelBR("w" , "dilepton, pi0" ,0.000595/(0.000595+0.000071)); // both dal +dir : Branching ratio=0.000595
117 makeStaticData()->SetEnhanceChannelBR("eta" , "dilepton, gamma",1.);
118 makeStaticData()->SetEnhanceChannelBR("eta'", "dilepton, gamma",1.); // missing channel!!
119 makeStaticData()->SetEnhanceChannelBR("pi0" , "dilepton, gamma",1.);
120
121 makeStaticData()->SetEnhanceChannelBR("phi" , "e+, e-" ,1.);
122 makeStaticData()->SetEnhanceChannelBR("w" , "e+, e-" ,0.000071/(0.000595+0.000071)); // both dal +dir : Branching ratio=0.000071
123 makeStaticData()->SetEnhanceChannelBR("rho0", "e+, e-" ,1.);
124 //######################################################
125
126 PPlutoBulkDecay *pl = new PPlutoBulkDecay(); // needed to decay Dileptons with PLUTO
127 pl->SetRecursiveMode(1); // Let also the products decay
128 pl->SetTauMax(0.001); // maxTau in ns
129
130
131 PReaction my_reaction((Char_t*)outfile.Data());
132 //my_reaction.SetUserAnalysis(UserAnalysis);
133 my_reaction.AddBulk(input);
134 if(doPlutoDecay){
135 my_reaction.AddBulk(pl);
136 }
137
138 my_reaction.Print();
139
140 cout << my_reaction.Loop(nEvents) << " events converted" << endl;
141
142
143}
PStaticData * makeStaticData()
PPlutoBulkDecay * pl
Definition bulk_decay.C:6
static TClonesArray * getAddon()
Definition PHUrReader.h:105
static TClonesArray * getEvent()
Definition PHUrReader.h:106
int AddDecay(int didx, const char *name, const char *parent, const char *daughters, double br)
void SetEnhanceChannelBR(const int id, const double factor)
Double_t * GetBatchValue(const char *name, Int_t make_val=1)
void DisableAllChannelBR(const char *parent)
PParticle p1("p", beam_energy)
PParticle * p
Definition dp_mult.C:24
void pA(void)
Definition pA.C:3
PReaction my_reaction("3.5","p","7Li","p (n) phi [K+ K-] (6Li)","delme")
PUniGenInput * input
Definition unigen_input.C:7
void urqmd_f15_input(TString infile="/hera/hades/dstsim/apr12/urqmd/bmax9/f15/Au_Au_1230MeV_1000evts_1.f15", TString outfile="out-dilep_pluto", Int_t nEvents=10)
Int_t UserAnalysis(PParticle **pA, Int_t size)