Changeset View
Changeset View
Standalone View
Standalone View
test/evtgenlhc_test1.cc
Show First 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | |||||
void runBtoXsgamma( int nevent, EvtGen& myGenerator ); | void runBtoXsgamma( int nevent, EvtGen& myGenerator ); | ||||
void runBtoK1273gamma( int nevent, EvtGen& myGenerator ); | void runBtoK1273gamma( int nevent, EvtGen& myGenerator ); | ||||
void runCheckRotBoost(); | void runCheckRotBoost(); | ||||
void runMassCheck( int nevent, EvtGen& myGenerator, int partnum ); | void runMassCheck( int nevent, EvtGen& myGenerator, int partnum ); | ||||
void runJpsiPolarization( int nevent, EvtGen& myGenerator ); | void runJpsiPolarization( int nevent, EvtGen& myGenerator ); | ||||
void runDDK( int nevent, EvtGen& myGenerator ); | void runDDK( int nevent, EvtGen& myGenerator ); | ||||
void runPhspDecaytimeCut( int nevent, EvtGen& myGenerator ); | void runPhspDecaytimeCut( int nevent, EvtGen& myGenerator ); | ||||
int countInclusive( std::string name, EvtParticle* root, TH1F* mom = 0, | int countInclusive( std::string name, EvtParticle* root, TH1F* mom = nullptr, | ||||
TH1F* mass = 0 ); | TH1F* mass = nullptr ); | ||||
int countInclusiveParent( std::string name, EvtParticle* root, EvtIdSet setIds, | int countInclusiveParent( std::string name, EvtParticle* root, EvtIdSet setIds, | ||||
TH1F* mom = 0 ); | TH1F* mom = nullptr ); | ||||
int countInclusiveSubTree( std::string name, EvtParticle* root, EvtIdSet setIds, | int countInclusiveSubTree( std::string name, EvtParticle* root, EvtIdSet setIds, | ||||
TH1F* mom = 0 ); | TH1F* mom = nullptr ); | ||||
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 runFourBody( int nevent, EvtGen& myGenerator ); | void runFourBody( 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 = 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 | ||||
Show All 10 Lines | if ( argc == 1 ) { | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "k:" << k << std::endl; | EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "k:" << k << std::endl; | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
<< "T=dual(directProd(p,k)):" << T << std::endl; | << "T=dual(directProd(p,k)):" << T << std::endl; | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
<< "T03:" << T.get( 0, 3 ) << std::endl; | << "T03:" << T.get( 0, 3 ) << std::endl; | ||||
return 1; | return 1; | ||||
} | } | ||||
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 ); | ||||
bool useEvtGenRandom( true ); | bool useEvtGenRandom( true ); | ||||
EvtExternalGenList genList( convertPythiaCodes, "", "gamma", useEvtGenRandom ); | EvtExternalGenList genList( convertPythiaCodes, "", "gamma", useEvtGenRandom ); | ||||
radCorrEngine = genList.getPhotosModel(); | radCorrEngine = genList.getPhotosModel(); | ||||
extraModels = genList.getListOfModels(); | extraModels = genList.getListOfModels(); | ||||
▲ Show 20 Lines • Show All 483 Lines • ▼ Show 20 Lines | do { | ||||
coshel->Fill( dcostheta ); | coshel->Fill( dcostheta ); | ||||
if ( p4psi.d3mag() > 1.1 ) { | if ( p4psi.d3mag() > 1.1 ) { | ||||
coshelHigh->Fill( dcostheta ); | coshelHigh->Fill( dcostheta ); | ||||
} else { | } else { | ||||
coshelLow->Fill( dcostheta ); | coshelLow->Fill( dcostheta ); | ||||
} | } | ||||
} | } | ||||
p = p->nextIter( root_part ); | p = p->nextIter( root_part ); | ||||
} while ( p != 0 ); | } while ( p != nullptr ); | ||||
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"; | ||||
▲ Show 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | do { | ||||
do { | do { | ||||
EvtId type = p->getId(); | EvtId type = p->getId(); | ||||
EvtId typePar = p->getParent()->getId(); | EvtId typePar = p->getParent()->getId(); | ||||
if ( theDs.contains( type ) ) | if ( theDs.contains( type ) ) | ||||
nD++; | nD++; | ||||
if ( theKs.contains( type ) && theBs.contains( typePar ) ) | if ( theKs.contains( type ) && theBs.contains( typePar ) ) | ||||
nK++; | nK++; | ||||
p = p->nextIter( theB01 ); | p = p->nextIter( theB01 ); | ||||
} while ( p != 0 ); | } while ( p != nullptr ); | ||||
if ( nD == 2 && nK == 1 ) | if ( nD == 2 && nK == 1 ) | ||||
nDDK++; | nDDK++; | ||||
nD = 0; | nD = 0; | ||||
nK = 0; | nK = 0; | ||||
p = theB02; | p = theB02; | ||||
do { | do { | ||||
EvtId type = p->getId(); | EvtId type = p->getId(); | ||||
EvtId typePar = p->getParent()->getId(); | EvtId typePar = p->getParent()->getId(); | ||||
if ( theDs.contains( type ) ) | if ( theDs.contains( type ) ) | ||||
nD++; | nD++; | ||||
if ( theKs.contains( type ) && theBs.contains( typePar ) ) | if ( theKs.contains( type ) && theBs.contains( typePar ) ) | ||||
nK++; | nK++; | ||||
p = p->nextIter( theB02 ); | p = p->nextIter( theB02 ); | ||||
} while ( p != 0 ); | } while ( p != nullptr ); | ||||
if ( nD == 2 && nK == 1 ) | if ( nD == 2 && nK == 1 ) | ||||
nDDK++; | nDDK++; | ||||
root_part->deleteTree(); | root_part->deleteTree(); | ||||
} while ( count++ < nevent ); | } while ( count++ < nevent ); | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
▲ Show 20 Lines • Show All 331 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
//Parse the table of particles to find.. | //Parse the table of particles to find.. | ||||
EvtParser parser; | EvtParser parser; | ||||
parser.read( std::string( "exampleFiles/finalstates.list" ) ); | parser.read( std::string( "exampleFiles/finalstates.list" ) ); | ||||
std::vector<std::string> dList[20]; | std::vector<std::string> dList[20]; | ||||
int dListNum[20]; | int dListNum[20]; | ||||
std::vector<std::string>* dListItem = 0; | std::vector<std::string>* dListItem = nullptr; | ||||
std::string dListName[20]; | std::string dListName[20]; | ||||
int ik, lk; | int ik, lk; | ||||
std::string tk = ""; | std::string tk = ""; | ||||
int tline = -1; | int tline = -1; | ||||
std::string parent; | std::string parent; | ||||
for ( ik = 0; ik < parser.getNToken(); ik++ ) { | for ( ik = 0; ik < parser.getNToken(); ik++ ) { | ||||
lk = tline; | lk = tline; | ||||
tline = parser.getLineofToken( ik ); | tline = parser.getLineofToken( ik ); | ||||
▲ Show 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | do { | ||||
fs.push_back( std::string( "anti-p-" ) ); | fs.push_back( std::string( "anti-p-" ) ); | ||||
if ( type == ne ) | if ( type == ne ) | ||||
fs.push_back( std::string( "n0" ) ); | fs.push_back( std::string( "n0" ) ); | ||||
if ( type == ane ) | if ( type == ane ) | ||||
fs.push_back( std::string( "anti-n0" ) ); | fs.push_back( std::string( "anti-n0" ) ); | ||||
p = p->nextIter(); | p = p->nextIter(); | ||||
} while ( p != 0 ); | } while ( p != nullptr ); | ||||
return fs; | return fs; | ||||
} | } | ||||
void runTrackMult( int nevent, EvtGen& myGenerator ) | void runTrackMult( int nevent, EvtGen& myGenerator ) | ||||
{ | { | ||||
TFile* file = new TFile( "trackmult.root", "RECREATE" ); | TFile* file = new TFile( "trackmult.root", "RECREATE" ); | ||||
TH1F* trackAll = new TH1F( "trackAll", "trackAll", 12, 1.0, 25.0 ); | TH1F* trackAll = new TH1F( "trackAll", "trackAll", 12, 1.0, 25.0 ); | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | do { | ||||
if ( theLeptons.contains( p->getId() ) ) { | if ( theLeptons.contains( p->getId() ) ) { | ||||
if ( p->getParent() ) { | if ( p->getParent() ) { | ||||
if ( theBs.contains( p->getParent()->getId() ) ) | if ( theBs.contains( p->getParent()->getId() ) ) | ||||
howManySL += 1; | howManySL += 1; | ||||
} | } | ||||
} | } | ||||
p = p->nextIter( root_part ); | p = p->nextIter( root_part ); | ||||
} while ( p != 0 ); | } while ( p != nullptr ); | ||||
//Now need to figure out which histogram to book | //Now need to figure out which histogram to book | ||||
trackAll->Fill( evTracks ); | trackAll->Fill( evTracks ); | ||||
if ( howManySL == 0 ) { | if ( howManySL == 0 ) { | ||||
trackNoSL->Fill( evTracks ); | trackNoSL->Fill( evTracks ); | ||||
totNoSL += 1; | totNoSL += 1; | ||||
totTracksNoSL += evTracks; | totTracksNoSL += evTracks; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 122 Lines • ▼ Show 20 Lines | if ( listfile != "" ) { | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << count << std::endl; | EvtGenReport( EVTGEN_INFO, "EvtGen" ) << count << std::endl; | ||||
//EvtGenReport(EVTGEN_INFO,"EvtGen") << HepRandom::getTheSeed()<<std::endl; | //EvtGenReport(EVTGEN_INFO,"EvtGen") << HepRandom::getTheSeed()<<std::endl; | ||||
} | } | ||||
EvtVector4R p_init( sqrt( EvtPDL::getMass( UPS4 ) * | EvtVector4R p_init( sqrt( EvtPDL::getMass( UPS4 ) * | ||||
EvtPDL::getMass( UPS4 ) + | EvtPDL::getMass( UPS4 ) + | ||||
5.9 * 5.9 ), | 5.9 * 5.9 ), | ||||
0.0, 0.0, 5.9 ); | 0.0, 0.0, 5.9 ); | ||||
EvtParticle* root_part = 0; | EvtParticle* root_part = nullptr; | ||||
if ( neventOrig > 0 ) { | if ( neventOrig > 0 ) { | ||||
root_part = EvtParticleFactory::particleFactory( UPS4, p_init ); | root_part = EvtParticleFactory::particleFactory( UPS4, p_init ); | ||||
} else { | } else { | ||||
root_part = EvtParticleFactory::particleFactory( VPHO, p_init ); | root_part = EvtParticleFactory::particleFactory( VPHO, p_init ); | ||||
} | } | ||||
root_part->setVectorSpinDensity(); | root_part->setVectorSpinDensity(); | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | if ( listfile != "" ) { | ||||
count = 1; | count = 1; | ||||
do { | do { | ||||
if ( count == 1000 * ( count / 1000 ) ) { | if ( count == 1000 * ( count / 1000 ) ) { | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << count << std::endl; | EvtGenReport( EVTGEN_INFO, "EvtGen" ) << count << std::endl; | ||||
//EvtGenReport(EVTGEN_INFO,"EvtGen") << HepRandom::getTheSeed()<<std::endl; | //EvtGenReport(EVTGEN_INFO,"EvtGen") << HepRandom::getTheSeed()<<std::endl; | ||||
} | } | ||||
EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 ); | EvtVector4R p_init( EvtPDL::getMass( UPS4 ), 0.0, 0.0, 0.0 ); | ||||
EvtParticle* root_part = 0; | EvtParticle* root_part = nullptr; | ||||
if ( neventOrig > 0 ) { | if ( neventOrig > 0 ) { | ||||
root_part = EvtParticleFactory::particleFactory( UPS4, p_init ); | root_part = EvtParticleFactory::particleFactory( UPS4, p_init ); | ||||
} else { | } else { | ||||
root_part = EvtParticleFactory::particleFactory( VPHO, p_init ); | root_part = EvtParticleFactory::particleFactory( VPHO, p_init ); | ||||
} | } | ||||
root_part->setVectorSpinDensity(); | root_part->setVectorSpinDensity(); | ||||
▲ Show 20 Lines • Show All 2,072 Lines • ▼ Show 20 Lines | do { | ||||
EvtParticle *p_b, *p_jpsi, *p_rho, *p_pi1, *p_pi2; | EvtParticle *p_b, *p_jpsi, *p_rho, *p_pi1, *p_pi2; | ||||
EvtVector4R p4_b, p4_jpsi, p4_rho, p4_pi1, p4_pi2; | EvtVector4R p4_b, p4_jpsi, p4_rho, p4_pi1, p4_pi2; | ||||
p_b = root_part; | p_b = root_part; | ||||
p_jpsi = root_part->getDaug( 0 ); | p_jpsi = root_part->getDaug( 0 ); | ||||
p_rho = 0; | p_rho = nullptr; | ||||
if ( p_jpsi->getDaug( 0 )->getNDaug() == 2 ) { | if ( p_jpsi->getDaug( 0 )->getNDaug() == 2 ) { | ||||
p_rho = p_jpsi->getDaug( 0 ); | p_rho = p_jpsi->getDaug( 0 ); | ||||
} | } | ||||
if ( p_jpsi->getDaug( 1 )->getNDaug() == 2 ) { | if ( p_jpsi->getDaug( 1 )->getNDaug() == 2 ) { | ||||
p_rho = p_jpsi->getDaug( 1 ); | p_rho = p_jpsi->getDaug( 1 ); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Lines | do { | ||||
if ( !( nDaug == 0 || nDaug == 2 ) ) { | if ( !( nDaug == 0 || nDaug == 2 ) ) { | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
<< "nDaug=" << nDaug << " but can only handle 0 or 2!" | << "nDaug=" << nDaug << " but can only handle 0 or 2!" | ||||
<< std::endl; | << std::endl; | ||||
abort(); | abort(); | ||||
} | } | ||||
if ( nDaug == 2 ) { | if ( nDaug == 2 ) { | ||||
if ( p->getParent() == 0 ) { | if ( p->getParent() == nullptr ) { | ||||
EvtVector4R p4 = p->getDaug( 0 )->getP4(); | EvtVector4R p4 = p->getDaug( 0 )->getP4(); | ||||
double ctheta = p4.get( 3 ) / p4.d3mag(); | double ctheta = p4.get( 3 ) / p4.d3mag(); | ||||
double phi = atan2( p4.get( 2 ), p4.get( 1 ) ); | double phi = atan2( p4.get( 2 ), p4.get( 1 ) ); | ||||
if ( count == 0 ) { | if ( count == 0 ) { | ||||
histograms.push_back( | histograms.push_back( | ||||
new TH1F( "h1", "cos theta", 50, -1.0, 1.0 ) ); | new TH1F( "h1", "cos theta", 50, -1.0, 1.0 ) ); | ||||
histograms.push_back( new TH1F( | histograms.push_back( new TH1F( | ||||
"h2", "phi", 50, -EvtConst::pi, EvtConst::pi ) ); | "h2", "phi", 50, -EvtConst::pi, EvtConst::pi ) ); | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | do { | ||||
} | } | ||||
histograms[nhist++]->Fill( costhetan ); | histograms[nhist++]->Fill( costhetan ); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
p = p->nextIter( root_part ); | p = p->nextIter( root_part ); | ||||
} while ( p != 0 ); | } while ( p != nullptr ); | ||||
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"; | ||||
▲ Show 20 Lines • Show All 282 Lines • ▼ Show 20 Lines | do { | ||||
( b2Id == -531 ) ) { | ( b2Id == -531 ) ) { | ||||
strangeid = 30363; | strangeid = 30363; | ||||
antistrangeid = -30363; | antistrangeid = -30363; | ||||
} | } | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
<< "bId1a " << bId1a << " bId1b " << bId1b << " bId2a " << bId2a | << "bId1a " << bId1a << " bId1b " << bId1b << " bId2a " << bId2a | ||||
<< " bId2b " << bId2b << " for event " << count << std::endl; | << " bId2b " << bId2b << " for event " << count << std::endl; | ||||
EvtParticle* Bpeng = 0; | EvtParticle* Bpeng = nullptr; | ||||
//int bnum=0; | //int bnum=0; | ||||
int pengcount = 0; | int pengcount = 0; | ||||
if ( ( ( bId1a == strangeid ) && ( bId1b == 22 ) ) || | if ( ( ( bId1a == strangeid ) && ( bId1b == 22 ) ) || | ||||
( ( bId1a == antistrangeid ) && ( bId1b == 22 ) ) || | ( ( bId1a == antistrangeid ) && ( bId1b == 22 ) ) || | ||||
( ( bId1b == strangeid ) && ( bId1a == 22 ) ) || | ( ( bId1b == strangeid ) && ( bId1a == 22 ) ) || | ||||
( ( bId1b == antistrangeid ) && ( bId1a == 22 ) ) ) { | ( ( bId1b == antistrangeid ) && ( bId1a == 22 ) ) ) { | ||||
Bpeng = B1; | Bpeng = B1; | ||||
//bnum=1; | //bnum=1; | ||||
▲ Show 20 Lines • Show All 198 Lines • ▼ Show 20 Lines | do { | ||||
( b2Id == -521 ) ) { | ( b2Id == -521 ) ) { | ||||
strangeid = 10323; | strangeid = 10323; | ||||
antistrangeid = -10323; | antistrangeid = -10323; | ||||
} | } | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) | EvtGenReport( EVTGEN_INFO, "EvtGen" ) | ||||
<< "bId1a " << bId1a << " bId1b " << bId1b << " bId2a " << bId2a | << "bId1a " << bId1a << " bId1b " << bId1b << " bId2a " << bId2a | ||||
<< " bId2b " << bId2b << " for event " << count << std::endl; | << " bId2b " << bId2b << " for event " << count << std::endl; | ||||
EvtParticle* Bpeng = 0; | EvtParticle* Bpeng = nullptr; | ||||
//int bnum=0; | //int bnum=0; | ||||
int pengcount = 0; | int pengcount = 0; | ||||
if ( ( ( bId1a == strangeid ) && ( bId1b == 22 ) ) || | if ( ( ( bId1a == strangeid ) && ( bId1b == 22 ) ) || | ||||
( ( bId1a == antistrangeid ) && ( bId1b == 22 ) ) || | ( ( bId1a == antistrangeid ) && ( bId1b == 22 ) ) || | ||||
( ( bId1b == strangeid ) && ( bId1a == 22 ) ) || | ( ( bId1b == strangeid ) && ( bId1a == 22 ) ) || | ||||
( ( bId1b == antistrangeid ) && ( bId1a == 22 ) ) ) { | ( ( bId1b == antistrangeid ) && ( bId1a == 22 ) ) ) { | ||||
Bpeng = B1; | Bpeng = B1; | ||||
//bnum=1; | //bnum=1; | ||||
▲ Show 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | do { | ||||
//if ( theBs.contains(p->getParent()->getId()) ) { | //if ( theBs.contains(p->getParent()->getId()) ) { | ||||
//dirPsimom->Fill(p->getP4Lab().d3mag()); | //dirPsimom->Fill(p->getP4Lab().d3mag()); | ||||
//} | //} | ||||
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "LANGE " << p->getP4Lab().d3mag() << " " << p->getP4Lab().get(3)/p->getP4Lab().d3mag() << std::endl; | //EvtGenReport(EVTGEN_INFO,"EvtGen") << "LANGE " << p->getP4Lab().d3mag() << " " << p->getP4Lab().get(3)/p->getP4Lab().d3mag() << std::endl; | ||||
} | } | ||||
p = p->nextIter( root_part ); | p = p->nextIter( root_part ); | ||||
} while ( p != 0 ); | } while ( p != nullptr ); | ||||
return temp; | return temp; | ||||
} | } | ||||
int countInclusiveSubTree( std::string name, EvtParticle* root_part, | int countInclusiveSubTree( std::string name, EvtParticle* root_part, | ||||
EvtIdSet setIds, TH1F* /*mom*/ ) | EvtIdSet setIds, TH1F* /*mom*/ ) | ||||
{ | { | ||||
int temp = 0; | int temp = 0; | ||||
EvtParticle* p = root_part; | EvtParticle* p = root_part; | ||||
do { | do { | ||||
if ( setIds.contains( p->getId() ) ) { | if ( setIds.contains( p->getId() ) ) { | ||||
temp += countInclusive( name, p ); | temp += countInclusive( name, p ); | ||||
} | } | ||||
//p->printTree(); | //p->printTree(); | ||||
p = p->nextIter( root_part ); | p = p->nextIter( root_part ); | ||||
} while ( p != 0 ); | } while ( p != nullptr ); | ||||
//EvtGenReport(EVTGEN_INFO,"EvtGen") << "done"<<std::endl; | //EvtGenReport(EVTGEN_INFO,"EvtGen") << "done"<<std::endl; | ||||
return temp; | return temp; | ||||
} | } | ||||
int countInclusiveParent( std::string name, EvtParticle* root_part, | int countInclusiveParent( std::string name, EvtParticle* root_part, | ||||
EvtIdSet setIds, TH1F* mom ) | EvtIdSet setIds, TH1F* mom ) | ||||
{ | { | ||||
EvtParticle* p = root_part; | EvtParticle* p = root_part; | ||||
Show All 9 Lines | do { | ||||
temp += 1; | temp += 1; | ||||
if ( mom ) | if ( mom ) | ||||
mom->Fill( p->getP4Lab().d3mag() ); | mom->Fill( p->getP4Lab().d3mag() ); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
p = p->nextIter( root_part ); | p = p->nextIter( root_part ); | ||||
} while ( p != 0 ); | } while ( p != nullptr ); | ||||
return temp; | return temp; | ||||
} | } | ||||
void runBMix( int nevent, EvtGen& myGenerator, std::string userFile, | void runBMix( int nevent, EvtGen& myGenerator, std::string userFile, | ||||
std::string rootFile ) | std::string rootFile ) | ||||
{ | { | ||||
TFile* file = new TFile( rootFile.c_str(), "RECREATE" ); | TFile* file = new TFile( rootFile.c_str(), "RECREATE" ); | ||||
▲ Show 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | do { | ||||
p = root_part; | p = root_part; | ||||
do { | do { | ||||
outmix << p->getId().getId() << " " << p->getP4Lab().d3mag() | outmix << p->getId().getId() << " " << p->getP4Lab().d3mag() | ||||
<< std::endl; | << std::endl; | ||||
p = p->nextIter(); | p = p->nextIter(); | ||||
} while ( p != 0 ); | } while ( p != nullptr ); | ||||
root_part->deleteTree(); | root_part->deleteTree(); | ||||
} while ( count++ < nevent ); | } while ( count++ < nevent ); | ||||
outmix.close(); | outmix.close(); | ||||
EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n"; | EvtGenReport( EVTGEN_INFO, "EvtGen" ) << "SUCCESS\n"; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 489 Lines • ▼ Show 20 Lines | do { | ||||
outmix << "neu" | outmix << "neu" | ||||
<< " " << p->getP4Lab().get( 1 ) << " " | << " " << p->getP4Lab().get( 1 ) << " " | ||||
<< p->getP4Lab().get( 2 ) << " " | << p->getP4Lab().get( 2 ) << " " | ||||
<< p->getP4Lab().get( 3 ) << std::endl; | << p->getP4Lab().get( 3 ) << std::endl; | ||||
} | } | ||||
p = p->nextIter(); | p = p->nextIter(); | ||||
} while ( p != 0 ); | } while ( p != nullptr ); | ||||
outmix << "event" << std::endl; | outmix << "event" << std::endl; | ||||
root_part->deleteTree(); | root_part->deleteTree(); | ||||
} while ( count++ < nevent ); | } while ( count++ < nevent ); | ||||
outmix.close(); | outmix.close(); | ||||
Show All 32 Lines | do { | ||||
p = root_part; | p = root_part; | ||||
do { | do { | ||||
outmix << p->getId().getId() << " " << p->getP4Lab().d3mag() | outmix << p->getId().getId() << " " << p->getP4Lab().d3mag() | ||||
<< std::endl; | << std::endl; | ||||
p = p->nextIter(); | p = p->nextIter(); | ||||
} while ( p != 0 ); | } while ( p != nullptr ); | ||||
//root_part->printTree(); | //root_part->printTree(); | ||||
root_part->deleteTree(); | root_part->deleteTree(); | ||||
} while ( count++ < nevent ); | } while ( count++ < nevent ); | ||||
outmix.close(); | outmix.close(); | ||||
▲ Show 20 Lines • Show All 336 Lines • Show Last 20 Lines |