gaussian straggling

This commit is contained in:
James Szalkie 2026-08-26 14:21:47 -04:00
parent 55e04f228d
commit 3567f84f82

View File

@ -61,7 +61,9 @@ bool IsDeadCathode(int id){
} }
bool IsDeadSX3(int id){ bool IsDeadSX3(int id){
static std::set<int> dead = {};//{0, 2, 4, 5, 6, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23}; // add dead SX3 IDs here, 0-23 1,7,9,3 static std::set<int> dead = {
//0, 2, 4, 5, 6, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
}; // add dead SX3 IDs here, 0-23 1,7,9,3
return dead.count(id); return dead.count(id);
} }
@ -158,7 +160,7 @@ int main(int argc, char **argv){
// Excited state lists (projectile and heavy-product excitation states) // Excited state lists (projectile and heavy-product excitation states)
std::vector<float> ExAList = {0}; // Beam excited energy std::vector<float> ExAList = {0}; // Beam excited energy
std::vector<float> ExList = {0.0}; // Heavy product excited energy std::vector<float> ExList = {0.0, 2.2, 3.4, 6.0}; // Heavy product excited energy
const int kMBeam = reactionConfig.beamA; // mass number of beam const int kMBeam = reactionConfig.beamA; // mass number of beam
const int kMTarget = reactionConfig.targetA; // mass number of target const int kMTarget = reactionConfig.targetA; // mass number of target
@ -488,9 +490,14 @@ int main(int argc, char **argv){
vertexZ = beamEntranceZ + beamPath_cm * 10.0; // cm -> mm vertexZ = beamEntranceZ + beamPath_cm * 10.0; // cm -> mm
// transverse sampling range from the beam's distance straggle at this energy // transverse sampling range from the beam's distance straggle at this energy
const double sigmaX_mm = std::max(0.0, sigmaXBeam->Eval(beamEnergy)) * 10.0; // cm -> mm const double sigmaX_mm = std::max(0.0, sigmaXBeam->Eval(beamEnergy)) * 100.0; // cm -> mm
vertexX = 2.0 * sigmaX_mm * gRandom->Rndm() - sigmaX_mm; //vertexX = 2.0 * sigmaX_mm * gRandom->Rndm() - sigmaX_mm;
vertexY = 2.0 * sigmaX_mm * gRandom->Rndm() - sigmaX_mm; //vertexY = 2.0 * sigmaX_mm * gRandom->Rndm() - sigmaX_mm;
double vertexRangeX = std::sqrt((vertexXRange[1] * vertexXRange[1]) + (sigmaX_mm * sigmaX_mm));
double vertexRangeY = std::sqrt((vertexYRange[1] * vertexYRange[1]) + (sigmaX_mm * sigmaX_mm));
//std::cout << "vertexRangeX: " << vertexRangeX << ", vertexRangeY: " << vertexRangeY << std::endl;
vertexX = gRandom->Gaus(0, vertexRangeX); // mean and standard deviation
vertexY = gRandom->Gaus(0, vertexRangeY); // mean and standard deviation
//vertexX = (vertexXRange[1]- vertexXRange[0])*gRandom->Rndm() + vertexXRange[0]; //vertexX = (vertexXRange[1]- vertexXRange[0])*gRandom->Rndm() + vertexXRange[0];
//vertexY = (vertexYRange[1]- vertexYRange[0])*gRandom->Rndm() + vertexYRange[0]; //vertexY = (vertexYRange[1]- vertexYRange[0])*gRandom->Rndm() + vertexYRange[0];