Quasi-free reactions: A (dummy) model for fermi samping inside a nucleus


//This class is here only for didactical reasons. It has no real physics content
//See nucleus_fermi plugin for a real implementation

//#include "../include/PChannelModel.h"

//Class definition

class PFermiNucleus : public PChannelModel  {
    
public:
    
    using PDistribution::GetWeight;
    PFermiNucleus(const Char_t *id, const Char_t *de, Int_t key);
    PDistribution *Clone(const char *delme=NULL) const;
    Bool_t Init(void);
    Bool_t SampleMass(void);
    Bool_t SampleMomentum(void);

 private:

    double SampleFermi(double &px, double &py, double &pz);
    PParticle *beam;
    PParticle *target;
    PParticle *spectator;
    PParticle *parent;
    PParticle *p2, *participant;
    PParticle *composite;
    
    ClassDef(PFermiNucleus, 0)  //
};

PDistribution *PFermiNucleus::Clone(const char*) const {
    //clone the object
    return new PFermiNucleus((const PFermiNucleus &)* this);
};

PFermiNucleus::PFermiNucleus(const Char_t *id, const Char_t *de, Int_t key) : PChannelModel(id, de,key) {
    //Constructor
    beam = NULL;
    target = NULL;
    spectator = NULL;
    parent = NULL;
    participant = NULL;
    p2 = NULL;
    composite = NULL;
} ;


double PFermiNucleus::SampleFermi(double &px, double &py, double &pz) {
    // dummy function
  
    double p = 0.5; //150 MeV
    //double p = 0.;
    double theta = acos(1.-2.*PUtils::sampleFlat());
    double phi = 2.*TMath::Pi()*PUtils::sampleFlat();
    double sth=sin(theta);
    px = p*cos(phi)*sth;
    py = p*sin(phi)*sth;
    pz = p*cos(theta);
    return p;
}

Bool_t PFermiNucleus::Init(void) {
    
    beam   = GetParticle("beam");
    target = GetParticle("target");
    parent = GetParticle("parent");

    if (!beam || !target) {
	Warning("Init", "beam or target not found");
	return kFALSE;
    }

    spectator = GetParticle("spectator");
    participant = GetParticle("participant");
    p2 = GetParticle("p2");

    composite = GetParticle("composite");

    return kTRUE;
}

Bool_t PFermiNucleus::SampleMass(void) {

    Double_t massS, eS, eP, ptot, px, py, pz, t=-1., mtarget;
    while (t<0.) {
	ptot = SampleFermi(px,py,pz);                  // Fermi momentum
	massS = spectator->M();                        // mass of spectator nucleon
	eS = sqrt(ptot*ptot + massS*massS);            // spectator total energy in deuteron c.m.
	mtarget = target->M();
	t = pow(mtarget-massS,2) - 2.*mtarget*(eS-massS);  // off-shell mass**2 of participant
    }

    eP = sqrt(ptot*ptot + t);         // participant total energy

    participant->SetPxPyPzE(-px,-py,-pz,eP);  // initialize participant nucleon
    spectator->SetPxPyPzE(px,py,pz,eS);      // initialize spectator nucleon

//     participant->Print();
//     spectator->Print();

    participant->Boost(target->BoostVector()); 
    spectator->Boost(target->BoostVector());  

    *p2 = *beam;

    //go into parent frame
    participant->Boost(-parent->BoostVector());
    p2->Boost(-parent->BoostVector());
    spectator->Boost(-parent->BoostVector());

    composite->Reconstruct(); //reset mass after p1 and p2 have been setted

    //boost scatter back to lab
    participant->Boost(parent->BoostVector());
    p2->Boost(parent->BoostVector());

    spectator->SetW(parent->W());                  // copy parent weight to spectator
    
    return kTRUE;
}

Bool_t PFermiNucleus::SampleMomentum(void) {
    return kTRUE;
}


ClassImp(PFermiNucleus)


 PFermiNucleus.C:1
 PFermiNucleus.C:2
 PFermiNucleus.C:3
 PFermiNucleus.C:4
 PFermiNucleus.C:5
 PFermiNucleus.C:6
 PFermiNucleus.C:7
 PFermiNucleus.C:8
 PFermiNucleus.C:9
 PFermiNucleus.C:10
 PFermiNucleus.C:11
 PFermiNucleus.C:12
 PFermiNucleus.C:13
 PFermiNucleus.C:14
 PFermiNucleus.C:15
 PFermiNucleus.C:16
 PFermiNucleus.C:17
 PFermiNucleus.C:18
 PFermiNucleus.C:19
 PFermiNucleus.C:20
 PFermiNucleus.C:21
 PFermiNucleus.C:22
 PFermiNucleus.C:23
 PFermiNucleus.C:24
 PFermiNucleus.C:25
 PFermiNucleus.C:26
 PFermiNucleus.C:27
 PFermiNucleus.C:28
 PFermiNucleus.C:29
 PFermiNucleus.C:30
 PFermiNucleus.C:31
 PFermiNucleus.C:32
 PFermiNucleus.C:33
 PFermiNucleus.C:34
 PFermiNucleus.C:35
 PFermiNucleus.C:36
 PFermiNucleus.C:37
 PFermiNucleus.C:38
 PFermiNucleus.C:39
 PFermiNucleus.C:40
 PFermiNucleus.C:41
 PFermiNucleus.C:42
 PFermiNucleus.C:43
 PFermiNucleus.C:44
 PFermiNucleus.C:45
 PFermiNucleus.C:46
 PFermiNucleus.C:47
 PFermiNucleus.C:48
 PFermiNucleus.C:49
 PFermiNucleus.C:50
 PFermiNucleus.C:51
 PFermiNucleus.C:52
 PFermiNucleus.C:53
 PFermiNucleus.C:54
 PFermiNucleus.C:55
 PFermiNucleus.C:56
 PFermiNucleus.C:57
 PFermiNucleus.C:58
 PFermiNucleus.C:59
 PFermiNucleus.C:60
 PFermiNucleus.C:61
 PFermiNucleus.C:62
 PFermiNucleus.C:63
 PFermiNucleus.C:64
 PFermiNucleus.C:65
 PFermiNucleus.C:66
 PFermiNucleus.C:67
 PFermiNucleus.C:68
 PFermiNucleus.C:69
 PFermiNucleus.C:70
 PFermiNucleus.C:71
 PFermiNucleus.C:72
 PFermiNucleus.C:73
 PFermiNucleus.C:74
 PFermiNucleus.C:75
 PFermiNucleus.C:76
 PFermiNucleus.C:77
 PFermiNucleus.C:78
 PFermiNucleus.C:79
 PFermiNucleus.C:80
 PFermiNucleus.C:81
 PFermiNucleus.C:82
 PFermiNucleus.C:83
 PFermiNucleus.C:84
 PFermiNucleus.C:85
 PFermiNucleus.C:86
 PFermiNucleus.C:87
 PFermiNucleus.C:88
 PFermiNucleus.C:89
 PFermiNucleus.C:90
 PFermiNucleus.C:91
 PFermiNucleus.C:92
 PFermiNucleus.C:93
 PFermiNucleus.C:94
 PFermiNucleus.C:95
 PFermiNucleus.C:96
 PFermiNucleus.C:97
 PFermiNucleus.C:98
 PFermiNucleus.C:99
 PFermiNucleus.C:100
 PFermiNucleus.C:101
 PFermiNucleus.C:102
 PFermiNucleus.C:103
 PFermiNucleus.C:104
 PFermiNucleus.C:105
 PFermiNucleus.C:106
 PFermiNucleus.C:107
 PFermiNucleus.C:108
 PFermiNucleus.C:109
 PFermiNucleus.C:110
 PFermiNucleus.C:111
 PFermiNucleus.C:112
 PFermiNucleus.C:113
 PFermiNucleus.C:114
 PFermiNucleus.C:115
 PFermiNucleus.C:116
 PFermiNucleus.C:117
 PFermiNucleus.C:118
 PFermiNucleus.C:119
 PFermiNucleus.C:120
 PFermiNucleus.C:121
 PFermiNucleus.C:122
 PFermiNucleus.C:123
 PFermiNucleus.C:124
 PFermiNucleus.C:125
 PFermiNucleus.C:126
 PFermiNucleus.C:127
 PFermiNucleus.C:128
 PFermiNucleus.C:129
 PFermiNucleus.C:130
 PFermiNucleus.C:131
 PFermiNucleus.C:132