Changeset View
Changeset View
Standalone View
Standalone View
test/evtgenlhc_test1.cc
Show First 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | |||||
int countInclusive( std::string name, EvtParticle* root, TH1F* mom = 0, | int countInclusive( std::string name, EvtParticle* root, TH1F* mom = 0, | ||||
TH1F* mass = 0 ); | TH1F* mass = 0 ); | ||||
int countInclusiveParent( std::string name, EvtParticle* root, EvtIdSet setIds, | int countInclusiveParent( std::string name, EvtParticle* root, EvtIdSet setIds, | ||||
TH1F* mom = 0 ); | TH1F* mom = 0 ); | ||||
int countInclusiveSubTree( std::string name, EvtParticle* root, EvtIdSet setIds, | int countInclusiveSubTree( std::string name, EvtParticle* root, EvtIdSet setIds, | ||||
TH1F* mom = 0 ); | TH1F* mom = 0 ); | ||||
void runBaryonic( int nEvent, EvtGen& myGenerator ); | void runBaryonic( int nEvent, EvtGen& myGenerator ); | ||||
void run3BPhspRegion( int nEvent, EvtGen& myGenerator ); | void run3BPhspRegion( int nEvent, EvtGen& myGenerator ); | ||||
void runFlatSqDalitz( int nEvent, EvtGen& myGenerator ); | |||||
int main( int argc, char* argv[] ) | int main( int argc, char* argv[] ) | ||||
{ | { | ||||
// Define the random number generator | // Define the random number generator | ||||
EvtRandomEngine* myRandomEngine = 0; | EvtRandomEngine* myRandomEngine = 0; | ||||
#ifdef EVTGEN_CPP11 | #ifdef EVTGEN_CPP11 | ||||
// Use the Mersenne-Twister generator (C++11 only) | // Use the Mersenne-Twister generator (C++11 only) | ||||
▲ Show 20 Lines • Show All 361 Lines • ▼ Show 20 Lines | #endif | ||||
} | } | ||||
if ( !strcmp( argv[1], "3bodyPhsp" ) ) { | if ( !strcmp( argv[1], "3bodyPhsp" ) ) { | ||||
int nevent = atoi( argv[2] ); | int nevent = atoi( argv[2] ); | ||||
EvtRadCorr::setNeverRadCorr(); | EvtRadCorr::setNeverRadCorr(); | ||||
run3BPhspRegion( nevent, myGenerator); | run3BPhspRegion( nevent, myGenerator); | ||||
} | } | ||||
if ( !strcmp( argv[1], "flatSqDalitz" ) ) { | |||||
int nevent = atoi( argv[2] ); | |||||
EvtRadCorr::setNeverRadCorr(); | |||||
runFlatSqDalitz( nevent, myGenerator); | |||||
} | |||||
//******************************************************* | //******************************************************* | ||||
//test of the rotations and boosts performed in EvtGen. | //test of the rotations and boosts performed in EvtGen. | ||||
// Added by Lange and Ryd Jan 5,2000. | // Added by Lange and Ryd Jan 5,2000. | ||||
//******************************************************* | //******************************************************* | ||||
if ( !strcmp( argv[1], "checkrotboost" ) ) { | if ( !strcmp( argv[1], "checkrotboost" ) ) { | ||||
runCheckRotBoost(); | runCheckRotBoost(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 5,203 Lines • ▼ Show 20 Lines | do { | ||||
root_part->deleteTree(); | root_part->deleteTree(); | ||||
} while ( count++ < nevent ); | } while ( count++ < nevent ); | ||||
file->Write(); | file->Write(); | ||||
file->Close(); | file->Close(); | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n"; | EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n"; | ||||
} | } | ||||
void runFlatSqDalitz( int nevent, EvtGen& myGenerator ) | |||||
{ | |||||
TFile* file = new TFile( "flatSqDalitz.root", "RECREATE" ); | |||||
TH2F* dalitz = new TH2F( "h4", "Dalitz", 50, 0.0, 1.0, 50, 0.0, 1.0 ); | |||||
int count = 1; | |||||
char udecay_name[100]; | |||||
strcpy( udecay_name, "exampleFiles/flatSqDalitz.dec" ); | |||||
myGenerator.readUDecay( udecay_name ); | |||||
static EvtId B = EvtPDL::getId( std::string( "Lambda_b0" ) ); | |||||
do { | |||||
EvtVector4R pinit( EvtPDL::getMass( B ), 0.0, 0.0, 0.0 ); | |||||
EvtParticle* root_part = EvtParticleFactory::particleFactory( B, pinit ); | |||||
myGenerator.generateDecay( root_part ); | |||||
double mB = root_part->mass(); | |||||
jback: Different line tab indentations here (and later on); maybe just a browser viewer issue? | |||||
tlathamUnsubmitted Not Done Inline ActionsLooks to be a genuine difference - please run clang-format on all C++ files when preparing the next revision. tlatham: Looks to be a genuine difference - please run clang-format on all C++ files when preparing the… | |||||
double m1 = root_part->getDaug( 0 )->mass(); | |||||
double m2 = root_part->getDaug( 1 )->mass(); | |||||
double m3 = root_part->getDaug( 2 )->mass(); | |||||
EvtParticle* daug1 = root_part->getDaug( 0 ); | |||||
EvtParticle* daug2 = root_part->getDaug( 1 ); | |||||
EvtParticle* daug3 = root_part->getDaug( 2 ); | |||||
double m12 = ( daug1->getP4() + daug2->getP4() ).mass(); | |||||
double m13 = ( daug1->getP4() + daug3->getP4() ).mass(); | |||||
double m23 = ( daug2->getP4() + daug3->getP4() ).mass(); | |||||
double m12norm = 2 * ( ( m12 - ( m1 + m2 ) ) / ( mB - ( m1 + m2 + m3 ) ) ) - | |||||
1; | |||||
double mPrime = acos( m12norm ) / EvtConst::pi; | |||||
double thPrime = acos( ( m12 * m12 * ( m23 * m23 - m13 * m13 ) - | |||||
jbackUnsubmitted Not Done Inline ActionsWe could reuse variables here to make the expression more easier to read. jback: We could reuse variables here to make the expression more easier to read. | |||||
tlathamUnsubmitted Not Done Inline ActionsYes, I think this could be simplified along the lines of how c12 is calculated in LauKinematics::calcHelicities tlatham: Yes, I think this could be simplified along the lines of how c12 is calculated in [[ https… | |||||
krepsAuthorUnsubmitted Done Inline ActionsI changed to use the same way as is done in Laura++ as it is more transparent compared to the original one. kreps: I changed to use the same way as is done in Laura++ as it is more transparent compared to the… | |||||
( m2 * m2 - m1 * m1 ) * ( mB * mB - m3 * m3 ) ) / | |||||
( sqrt( pow( m12 * m12 + m1 * m1 - m2 * m2, 2 ) - | |||||
4 * m12 * m12 * m1 * m1 ) * | |||||
sqrt( pow( -m12 * m12 + mB * mB - m3 * m3, 2 ) - | |||||
4 * m12 * m12 * m3 * m3 ) ) ) / | |||||
EvtConst::pi; | |||||
dalitz->Fill( mPrime, thPrime ); | |||||
root_part->deleteTree(); | |||||
} while ( count++ < nevent ); | |||||
file->Write(); | |||||
file->Close(); | |||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n"; | |||||
} |
Different line tab indentations here (and later on); maybe just a browser viewer issue?