Changeset View
Changeset View
Standalone View
Standalone View
validation/genExampleRootFiles.cc
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | int main( int argc, char** argv ) | ||||
dalitzTree->Branch( "invMass12", &inv12, "invMass12/D" ); | dalitzTree->Branch( "invMass12", &inv12, "invMass12/D" ); | ||||
dalitzTree->Branch( "invMass13", &inv13, "invMass13/D" ); | dalitzTree->Branch( "invMass13", &inv13, "invMass13/D" ); | ||||
dalitzTree->Branch( "invMass23", &inv23, "invMass23/D" ); | dalitzTree->Branch( "invMass23", &inv23, "invMass23/D" ); | ||||
dalitzTree->Branch( "invMass12Sq", &inv12Sq, "invMass12Sq/D" ); | dalitzTree->Branch( "invMass12Sq", &inv12Sq, "invMass12Sq/D" ); | ||||
dalitzTree->Branch( "invMass13Sq", &inv13Sq, "invMass13Sq/D" ); | dalitzTree->Branch( "invMass13Sq", &inv13Sq, "invMass13Sq/D" ); | ||||
dalitzTree->Branch( "invMass23Sq", &inv23Sq, "invMass23Sq/D" ); | dalitzTree->Branch( "invMass23Sq", &inv23Sq, "invMass23Sq/D" ); | ||||
EvtParticle* baseParticle( 0 ); | EvtParticle* baseParticle( nullptr ); | ||||
EvtParticle* theParent( 0 ); | EvtParticle* theParent( nullptr ); | ||||
// Define the random number generator | // Define the random number generator | ||||
EvtRandomEngine* myRandomEngine = 0; | EvtRandomEngine* myRandomEngine = nullptr; | ||||
#ifdef EVTGEN_CPP11 | #ifdef EVTGEN_CPP11 | ||||
// Use the Mersenne-Twister generator (C++11 only) | // Use the Mersenne-Twister generator (C++11 only) | ||||
myRandomEngine = new EvtMTRandomEngine(); | myRandomEngine = new EvtMTRandomEngine(); | ||||
#else | #else | ||||
myRandomEngine = new EvtSimpleRandomEngine(); | myRandomEngine = new EvtSimpleRandomEngine(); | ||||
#endif | #endif | ||||
// Initialize the generator - read in the decay table and particle properties. | // Initialize the generator - read in the decay table and particle properties. | ||||
// For our validation purposes, we just want to read in one decay file and create | // For our validation purposes, we just want to read in one decay file and create | ||||
// plots from that. | // plots from that. | ||||
EvtAbsRadCorr* radCorrEngine = 0; | EvtAbsRadCorr* radCorrEngine = nullptr; | ||||
std::list<EvtDecayBase*> extraModels; | std::list<EvtDecayBase*> extraModels; | ||||
#ifdef EVTGEN_EXTERNAL | #ifdef EVTGEN_EXTERNAL | ||||
bool convertPythiaCodes( false ); | bool convertPythiaCodes( false ); | ||||
EvtExternalGenList genList( convertPythiaCodes, "", "gamma", useEvtGenRandom ); | EvtExternalGenList genList( convertPythiaCodes, "", "gamma", useEvtGenRandom ); | ||||
radCorrEngine = genList.getPhotosModel(); | radCorrEngine = genList.getPhotosModel(); | ||||
extraModels = genList.getListOfModels(); | extraModels = genList.getListOfModels(); | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | for ( i = 0; i < nEvents; i++ ) { | ||||
// Now get the particle decay information, looping through daughter tracks (1st generation only) | // Now get the particle decay information, looping through daughter tracks (1st generation only) | ||||
// Find out if the first daughter is a string. | // Find out if the first daughter is a string. | ||||
// If so, set this as the new parent particle. | // If so, set this as the new parent particle. | ||||
EvtId daugEvtId( -1, -1 ); | EvtId daugEvtId( -1, -1 ); | ||||
EvtParticle* baseDaughter = baseParticle->getDaug( 0 ); | EvtParticle* baseDaughter = baseParticle->getDaug( 0 ); | ||||
if ( baseDaughter != 0 ) { | if ( baseDaughter != nullptr ) { | ||||
daugEvtId = baseDaughter->getId(); | daugEvtId = baseDaughter->getId(); | ||||
} | } | ||||
if ( daugEvtId == stringId ) { | if ( daugEvtId == stringId ) { | ||||
theParent = baseDaughter; | theParent = baseDaughter; | ||||
} else { | } else { | ||||
theParent = baseParticle; | theParent = baseParticle; | ||||
} | } | ||||
nDaug = theParent->getNDaug(); | nDaug = theParent->getNDaug(); | ||||
int iDaug( 0 ); | int iDaug( 0 ); | ||||
nDaugTree->Fill(); | nDaugTree->Fill(); | ||||
//theParent->printTree(); | //theParent->printTree(); | ||||
// Loop over the daughter tracks | // Loop over the daughter tracks | ||||
for ( iDaug = 0; iDaug < nDaug; iDaug++ ) { | for ( iDaug = 0; iDaug < nDaug; iDaug++ ) { | ||||
EvtParticle* daug = theParent->getDaug( iDaug ); | EvtParticle* daug = theParent->getDaug( iDaug ); | ||||
if ( daug != 0 ) { | if ( daug != nullptr ) { | ||||
EvtVector4R p4Lab = daug->getP4Lab(); | EvtVector4R p4Lab = daug->getP4Lab(); | ||||
EvtVector4R pos4 = daug->get4Pos(); | EvtVector4R pos4 = daug->get4Pos(); | ||||
// PDG id | // PDG id | ||||
daugId = EvtPDL::getStdHep( daug->getId() ); | daugId = EvtPDL::getStdHep( daug->getId() ); | ||||
// 4-momenta | // 4-momenta | ||||
E = p4Lab.get( 0 ); | E = p4Lab.get( 0 ); | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |