Skip to content
Snippets Groups Projects
Commit 22198fdf authored by Thomas Michael Carter's avatar Thomas Michael Carter
Browse files

now correctly chooses bin

parent 9aac6307
No related branches found
No related tags found
No related merge requests found
......@@ -168,16 +168,12 @@ StatusCode ISF::FastCaloSimSvcV2::simulate(const ISF::ISFParticle& isfp)
if (m_doPunchThrough) {
// call punch-through simulation
const ISF::ISFParticleContainer* isfpVec = m_punchThroughTool->computePunchThroughParticles(isfp);
// add punch-through particles to the ISF particle broker
if (isfpVec) {
ISF::ISFParticleContainer::const_iterator partIt = isfpVec->begin();
ISF::ISFParticleContainer::const_iterator partItEnd = isfpVec->end();
for ( ; partIt!=partItEnd; ++partIt) {
<<<<<<< HEAD
=======
//std::cout << "pdg: " << partIt.pdgCode() << " momentum: " << partIt.momentum().x() << " " << partIt.momentum().y() << " " << partIt.momentum().z()<< std::endl;
>>>>>>> add broker check to SVC, param working
m_particleBroker->push( *partIt, &isfp);
}
}
......
......@@ -50,6 +50,7 @@ double ISF::PDFcreator::getRand(std::vector<double> inputParameters, bool discre
// get the center of the closest bin to the input inputParameter
double closestCenter = curaxis->GetBinCenter(bin);
// get the bins edge closest to the current value
// and find out if the next closest bin has id bin+1 or bin-1
double closestEdge = (curvalue <= closestCenter) ? curaxis->GetBinLowEdge(bin) : curaxis->GetBinUpEdge(bin);
......@@ -79,8 +80,9 @@ double ISF::PDFcreator::getRand(std::vector<double> inputParameters, bool discre
// of them)
Int_t bin = 0;
if (numInputPar == 1) bin = m_par[0]->GetBin( chosenBin[0] );
else if (numInputPar ==2 ) bin = m_par[0]->GetBin( chosenBin[0], chosenBin[1], 1 ); //Hack here to choose z axis bin 1
else if (numInputPar == 3) bin = m_par[0]->GetBin( chosenBin[0], chosenBin[1], chosenBin[2] ); //Select Z bin as 1 to choose pions for now
else if (numInputPar ==2 ) bin = m_par[0]->GetBin( chosenBin[0], chosenBin[1], 1 ); // z = 1 for Pion, 2 for photon, 3 for electron
else if (numInputPar == 3) bin = m_par[0]->GetBin( chosenBin[0], chosenBin[1], 1 ); //Select Z bin as 1 to choose pions for now
//else if (numInputPar == 3) bin = m_par[0]->GetBin( chosenBin[0], chosenBin[1], chosenBin[2] );
// TODO: implement case of >3 input parameters
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment