13 using namespace genie;
14 using namespace genie::hnl;
15 using namespace genie::hnl::enums;
18 FluxCreator::FluxCreator() :
52 gGeoManager = TGeoManager::Import(
fGeomFile.c_str() );
54 TGeoVolume * top_volume = gGeoManager->GetTopVolume();
56 TGeoShape * ts = top_volume->GetShape();
57 TGeoBBox * box = (TGeoBBox *) ts;
123 <<
"No input dk2nu flux detected. Cannot proceed.";
130 LOG(
"HNL",
pDEBUG ) <<
"Setting input path to " << finpath;
176 TVector3 dumori( 0.0, 0.0, 0.0 );
186 ctree->GetEntry(iEntry);
189 bool canGoForward =
true;
222 fDx = tmpVec.X();
fDy = tmpVec.Y();
fDz = tmpVec.Z();
228 TVector3 fDvec_user( fDvec_beam.X() -
fCx, fDvec_beam.Y() -
fCy, fDvec_beam.Z() -
fCz );
235 TVector3 detO_beam( fCvec_beam.X() - fDvec_beam.X(),
236 fCvec_beam.Y() - fDvec_beam.Y(),
237 fCvec_beam.Z() - fDvec_beam.Z() );
238 TVector3 detO( fCvec.X() - fDvec.X(),
239 fCvec.Y() - fDvec.Y(),
240 fCvec.Z() - fDvec.Z() );
241 TVector3 detO_user( detO_beam.X(), detO_beam.Y(), detO_beam.Z() );
251 TVector3 tmpVec( dpdpx, dpdpy, dpdpz );
253 dpdpx = tmpVec.X(); dpdpy = tmpVec.Y(); dpdpz = tmpVec.Z();
261 <<
"\n\tProceeding, but results are possibly unphysical.";
264 parentMomentum = std::sqrt( dpdpx*dpdpx + dpdpy*dpdpy + dpdpz*dpdpz );
268 TLorentzVector( parentMomentum * (detO.Unit()).X(),
269 parentMomentum * (detO.Unit()).Y(),
270 parentMomentum * (detO.Unit()).Z(),
274 TLorentzVector p4par_beam( dpdpx, dpdpy, dpdpz,
parentEnergy );
275 TVector3 p3par_beam = p4par_beam.Vect();
277 TLorentzVector p4par_near( p3par_near.X(), p3par_near.Y(), p3par_near.Z(),
parentEnergy );
284 p4par.SetPxPyPzE( tmpv3.Px(), tmpv3.Py(), tmpv3.Pz(), p4par.E() );
287 TLorentzVector p4par_user = p4par_near;
289 TVector3 ppar_user = p4par_user.Vect();
291 p4par_user.SetPxPyPzE( ppar_user.Px(), ppar_user.Py(), ppar_user.Pz(), p4par_user.E() );
293 TVector3 boost_beta = p4par_beam.BoostVector();
304 double score = rnd->
RndGen().Uniform( 0.0, 1.0 );
308 unsigned int imap = 0;
double s1 = 0.0;
309 std::map< HNLProd_t, double >::iterator pdit =
dynamicScores.begin();
311 s1 += (*pdit).second;
315 <<
" : (*pdit).second = " << (*pdit).second;
322 prodChan = (*pdit).first;
345 TLorentzVector p4HNL_rest =
HNLEnergy( prodChan, p4par );
347 fECM = p4HNL_rest.E();
350 double boost_correction_two = 0.0;
355 double betaMag = boost_beta.Mag();
356 double gamma = std::sqrt( 1.0 / ( 1.0 - betaMag * betaMag ) );
357 double betaLab = 1.0;
360 double timeBit = detO.Mag();
361 TLorentzVector detO_4v( detO.X(), detO.Y(), detO.Z(), timeBit ); detO_4v.Boost( -boost_beta );
362 TVector3 detO_rest_unit = (detO_4v.Vect()).Unit();
363 TLorentzVector p4HNL_rest_good( p4HNL_rest.P() * detO_rest_unit.X(),
364 p4HNL_rest.P() * detO_rest_unit.Y(),
365 p4HNL_rest.P() * detO_rest_unit.Z(),
369 TLorentzVector p4Lep_rest_good( -1.0 * pLep_rest * detO_rest_unit.X(),
370 -1.0 * pLep_rest * detO_rest_unit.Y(),
371 -1.0 * pLep_rest * detO_rest_unit.Z(),
376 TLorentzVector p4HNL_good = p4HNL_rest_good;
377 p4HNL_good.Boost( boost_beta );
378 boost_correction_two = p4HNL_good.E() / p4HNL_rest.E();
380 TVector3 detO_unit = detO.Unit();
382 TVector3 p4HNL_good_vect = p4HNL_good.Vect();
383 TVector3 p4HNL_good_unit = p4HNL_good_vect.Unit();
387 TVector3 distNum = detO.Cross( p4HNL_good_unit );
388 double dist = distNum.Mag();
390 double prevDist = 2.0 * dist;
392 while( betaLab > 0.0 && ( dist > 1.0
e-3 && dist < prevDist &&
393 std::abs(dist - prevDist) > 1.0
e-3 * prevDist ) ){
398 timeBit = detO.Mag() / ( betaLab );
399 detO_4v.SetXYZT( detO.X(), detO.Y(), detO.Z(), timeBit );
400 detO_4v.Boost( -boost_beta );
401 detO_rest_unit = (detO_4v.Vect()).Unit();
402 p4HNL_rest_good.SetPxPyPzE( p4HNL_rest.P() * detO_rest_unit.X(),
403 p4HNL_rest.P() * detO_rest_unit.Y(),
404 p4HNL_rest.P() * detO_rest_unit.Z(),
408 p4HNL_good = p4HNL_rest_good;
409 p4HNL_good.Boost( boost_beta );
411 detO_unit = detO.Unit();
412 p4HNL_good_vect = p4HNL_good.Vect();
413 p4HNL_good_unit = p4HNL_good_vect.Unit();
415 distNum = detO.Cross( p4HNL_good_unit );
416 dist = distNum.Mag();
431 double betaHNL = p4HNL_good.P() / p4HNL_good.E();
432 double costh_pardet = 0.0;
433 double boost_correction = 0.0;
434 if( parentMomentum > 0.0 ){
435 costh_pardet = ( p4par_beam.X() * detO.X() +
436 p4par_beam.Y() * detO.Y() +
437 p4par_beam.Z() * detO.Z() ) / ( parentMomentum * detO.Mag() );
438 if( costh_pardet < -1.0 ) costh_pardet = -1.0;
439 if( costh_pardet > 1.0 ) costh_pardet = 1.0;
440 boost_correction = 1.0 / ( gamma * ( 1.0 - betaMag * betaHNL * costh_pardet ) );
442 if(
true && boost_correction * p4HNL_rest.E() > p4HNL_rest.M() ) {
443 boost_correction = 1.0 / ( gamma * ( 1.0 - betaMag * betaHNL * costh_pardet ) );
445 boost_correction = p4HNL_good.E() / p4HNL_rest_good.E();
449 assert( boost_correction > 0.0 && boost_correction_two > 0.0 );
452 double EHNL = p4HNL_rest.E() * boost_correction;
453 double MHNL = p4HNL_rest.M();
454 double PHNL = std::sqrt( EHNL * EHNL - MHNL * MHNL );
455 TVector3 pdu = ( p4par.Vect() ).Unit();
456 TLorentzVector p4HNL_rand( PHNL * pdu.X(), PHNL * pdu.Y(), PHNL * pdu.Z(), EHNL );
460 double FDx = fDvec_beam.X();
461 double FDy = fDvec_beam.Y();
462 double FDz = fDvec_beam.Z();
465 TVector3 fRVec_beam( absolutePoint.X() - FDx, absolutePoint.Y() - FDy, absolutePoint.Z() - FDz );
472 TVector3 rRVec_near( fRVec_beam.X() + FDx, fRVec_beam.Y() + FDy, fRVec_beam.Z() + FDz );
480 rRVec_user.SetXYZ( rRVec_user.X() + (
fCx),
481 rRVec_user.Y() + (
fCy),
482 rRVec_user.Z() + (
fCz) );
485 TLorentzVector p4HNL( p4HNL_rand.P() * fRVec_unit.X(),
486 p4HNL_rand.P() * fRVec_unit.Y(),
487 p4HNL_rand.P() * fRVec_unit.Z(),
491 TLorentzVector p4HNL_near( pHNL_near.X(), pHNL_near.Y(), pHNL_near.Z(), p4HNL.E() );
499 TLorentzVector p4Lep_good = p4Lep_rest_good;
500 p4Lep_good.Boost( boost_beta );
501 TVector3 boost_beta_HNL = p4HNL_near.BoostVector();
502 p4Lep_good.Boost( -boost_beta_HNL );
510 double zm = 0.0, zp = 0.0;
518 if( zm == -999.9 && zp == 999.9 ){
523 double tzm = zm, tzp = zp;
525 zp = (tzp - tzm)/2.0;
536 int iAccFail = 0;
const int iAccFailBail = 10;
537 while( iAccFail < iAccFailBail && accCorr == 0.0 ){
541 <<
"\nRerolling point. This is the " << iAccFail <<
"th try out of " << iAccFailBail;
551 fRVec_beam.SetXYZ( absolutePoint.X() - (
fCx),
552 absolutePoint.Y() - (
fCy),
553 absolutePoint.Z() - (
fCz) );
557 p4HNL.SetPxPyPzE( p4HNL_rand.P() * fRVec_unit.X(),
558 p4HNL_rand.P() * fRVec_unit.Y(),
559 p4HNL_rand.P() * fRVec_unit.Z(),
563 p4HNL_near.SetPxPyPzE( pHNL_near.X(), pHNL_near.Y(), pHNL_near.Z(), p4HNL.E() );
571 p4Lep_good = p4Lep_rest_good;
572 p4Lep_good.Boost( boost_beta );
573 boost_beta_HNL = p4HNL_near.BoostVector();
574 p4Lep_good.Boost( -boost_beta_HNL );
590 if( zm == -999.9 && zp == 999.9 ){
595 double tzm = zm, tzp = zp;
597 zp = (tzp - tzm)/2.0;
604 if( accCorr == 0.0 ){
610 double acceptance = acc_saa * boost_correction * boost_correction * accCorr;
615 double detDist = std::sqrt( detO.X() * detO.X() +
616 detO.Y() * detO.Y() +
617 detO.Z() * detO.Z() );
619 double delay = detDist / kSpeedOfLightNs * ( 1.0 / betaHNL - 1.0 );
634 TVector3 tmpVec( dxvx, dxvy, dxvz );
636 dxvx = tmpVec.X(); dxvy = tmpVec.Y(); dxvz = tmpVec.Z();
639 TLorentzVector x4HNL_beam( dxvx, dxvy, dxvz, delay );
640 TVector3 x3HNL_beam = x4HNL_beam.Vect();
642 TLorentzVector x4HNL_near( x3HNL_near.X(), x3HNL_near.Y(), x3HNL_near.Z(), delay );
644 TLorentzVector x4HNL( fDvec_user.X(), fDvec_user.Y(), fDvec_user.Z(), delay );
649 LOG(
"HNL",
pDEBUG ) <<
"Filling gnmf...";
657 if( std::abs(parPdg) ==
kPdgMuon ) typeMod *= -1;
669 gnmf.
startPoint.SetXYZ( fDvec_beam.X(), fDvec_beam.Y(), fDvec_beam.Z() );
677 TLorentzVector p4HNL_user = p4HNL_near;
679 TVector3 pHNL_user = p4HNL_user.Vect();
681 p4HNL_user.SetPxPyPzE( pHNL_user.Px(), pHNL_user.Py(), pHNL_user.Pz(), p4HNL_user.E() );
683 gnmf.
p4 = p4HNL_near;
684 gnmf.
parp4 = p4par_near;
691 gnmf.
XYWgt = acc_saa;
715 gnmf.
startPoint.SetXYZ(-9999.9, -9999.9, -9999.9);
716 gnmf.
targetPoint.SetXYZ(-9999.9, -9999.9, -9999.9);
720 gnmf.
polz.SetXYZ(-9999.9, -9999.9, -9999.9);
722 gnmf.
p4.SetPxPyPzE(-9999.9, -9999.9, -9999.9, -9999.9);
723 gnmf.
parp4.SetPxPyPzE(-9999.9, -9999.9, -9999.9, -9999.9);
724 gnmf.
p4User.SetPxPyPzE(-9999.9, -9999.9, -9999.9, -9999.9);
725 gnmf.
parp4User.SetPxPyPzE(-9999.9, -9999.9, -9999.9, -9999.9);
728 gnmf.
nuEcm = -9999.9;
729 gnmf.
XYWgt = -9999.9;
750 <<
"Getting flux input from finpath = " << finpath.c_str();
754 ctree =
new TChain(
"dkTree" );
755 cmeta =
new TChain(
"dkMeta" );
760 TSystemDirectory
dir( finpath.c_str(), finpath.c_str() );
761 TList * files =
dir.GetListOfFiles();
int nFiles = 0;
769 while( (file=( TSystemFile * ) next()) && !
fPathLoaded ){
770 fname = file->GetName();
771 if( !file->IsDirectory() ){
772 TString fullpath = TString( finpath.c_str() ) + fname;
774 ctree->Add( fullpath );
775 cmeta->Add( fullpath );
779 if( !
ctree ){
LOG(
"HNL",
pFATAL ) <<
"Could not open flux tree!"; }
780 if( !
cmeta ){
LOG(
"HNL",
pFATAL ) <<
"Could not open meta tree!"; }
783 const int nEntriesInMeta =
cmeta->GetEntries();
784 int nEntries =
ctree->GetEntries();
789 <<
"\nThere were " << nEntriesInMeta <<
" entries in meta with " << nEntries <<
" total nus"
790 <<
"\n got from " << nFiles <<
" files";
818 for(
int i = 0; i <
maxArray; i++ ){
850 for(
int j = 0; j <
maxC; j++ ){
870 if(
ctree->GetBranch(
"job" ) )
ctree->SetBranchAddress(
"job", &
djob );
885 if(
ctree->GetBranch(
"nuray_size" ) )
ctree->SetBranchAddress(
"nuray_size", &
arSize );
889 if(
ctree->GetBranch(
"nuray_E" ) )
ctree->SetBranchAddress(
"nuray_E",
nuray_E );
892 if(
ctree->GetBranch(
"ancestor_size" ) )
ctree->SetBranchAddress(
"ancestor_size", &
anArSize );
913 if(
ctree->GetBranch(
"ppvx" ) )
ctree->SetBranchAddress(
"ppvx", &
ppvx );
914 if(
ctree->GetBranch(
"ppvy" ) )
ctree->SetBranchAddress(
"ppvy", &
ppvy );
915 if(
ctree->GetBranch(
"ppvz" ) )
ctree->SetBranchAddress(
"ppvz", &
ppvz );
928 if(
ctree->GetBranch(
"traj_size" ) )
ctree->SetBranchAddress(
"traj_size", &
trArSize );
952 for(
int i = 0; i <
maxC; i++ ){
961 for(
int i = 0; i <
maxArray; i++ ){
970 cmeta->SetBranchAddress(
"job", &
job );
971 cmeta->SetBranchAddress(
"pots", &
pots );
974 if(
cmeta->GetBranch(
"beamsim" ) )
cmeta->SetBranchAddress(
"beamsim",
beamsim );
975 if(
cmeta->GetBranch(
"physics" ) )
cmeta->SetBranchAddress(
"physics",
physics );
977 if(
cmeta->GetBranch(
"tgtcfg" ) )
cmeta->SetBranchAddress(
"tgtcfg",
tgtcfg );
978 if(
cmeta->GetBranch(
"horncfg" ) )
cmeta->SetBranchAddress(
"horncfg",
horncfg );
980 if(
cmeta->GetBranch(
"beam0x" ) )
cmeta->SetBranchAddress(
"beam0x", &
beam0x );
981 if(
cmeta->GetBranch(
"beam0y" ) )
cmeta->SetBranchAddress(
"beam0y", &
beam0y );
982 if(
cmeta->GetBranch(
"beam0z" ) )
cmeta->SetBranchAddress(
"beam0z", &
beam0z );
985 if(
cmeta->GetBranch(
"beamdxdz" ) )
cmeta->SetBranchAddress(
"beamdxdz", &
beamdxdz );
986 if(
cmeta->GetBranch(
"beamdydz" ) )
cmeta->SetBranchAddress(
"beamdydz", &
beamdydz );
987 if(
cmeta->GetBranch(
"arSize" ) )
cmeta->SetBranchAddress(
"arSize", &
mArSize );
1000 TObjArray * pionDecayList = pionParticle->DecayList();
1001 TObjArray * kaonDecayList = kaonParticle->DecayList();
1002 TObjArray * neukDecayList = neukParticle->DecayList();
1004 TDecayChannel * pion2muChannel = ( TDecayChannel * ) pionDecayList->At(0);
1005 TDecayChannel * pion2elChannel = ( TDecayChannel * ) pionDecayList->At(1);
1007 TDecayChannel * kaon2muChannel = ( TDecayChannel * ) kaonDecayList->At(0);
1009 TDecayChannel * kaon3muChannel = ( TDecayChannel * ) kaonDecayList->At(5);
1010 TDecayChannel * kaon3elChannel = ( TDecayChannel * ) kaonDecayList->At(4);
1012 TDecayChannel * neuk3muChannel = ( TDecayChannel * ) neukDecayList->At(4);
1013 TDecayChannel * neuk3elChannel = ( TDecayChannel * ) neukDecayList->At(2);
1015 BR_pi2mu = pion2muChannel->BranchingRatio();
1016 BR_pi2e = pion2elChannel->BranchingRatio();
1018 BR_K2mu = kaon2muChannel->BranchingRatio();
1020 BR_K3mu = kaon3muChannel->BranchingRatio();
1021 BR_K3e = kaon3elChannel->BranchingRatio();
1023 BR_K03mu = 2.0 * neuk3muChannel->BranchingRatio();
1024 BR_K03e = 2.0 * neuk3elChannel->BranchingRatio();
1030 switch( std::abs( parPDG ) ){
1035 default:
LOG(
"HNL",
pWARN ) <<
"Unknown parent. Proceeding, but results may be unphysical";
break;
1038 std::map< HNLProd_t, double > dynScores;
1044 double Ue42 =
fU4l2s.at(0);
1045 double Um42 =
fU4l2s.at(1);
1046 double Ut42 =
fU4l2s.at(2);
1053 double KScale[4] = { -1.0, -1.0, -1.0, -1.0 }, mixScale[4] = { -1.0, -1.0, -1.0, -1.0 };
1054 double totalMix = 0.0;
1055 switch( std::abs( parPDG ) ){
1060 mixScale[0] = 1.0 * Um42 * KScale[0]; totalMix += mixScale[0];
1061 mixScale[1] = 1.0 * Ue42 * KScale[1]; totalMix += mixScale[1];
1062 mixScale[2] = 1.0 * Ut42 * KScale[2]; totalMix += mixScale[2];
1064 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdMuon3Numu, mixScale[0] / totalMix } ) );
1065 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdMuon3Nue, mixScale[1] / totalMix } ) );
1066 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdMuon3Nutau, mixScale[2] / totalMix } ) );
1070 if( totalMix <= 0.0 ){
1071 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdNull, -999.9 } ) );
1083 mixScale[0] =
BR_K2mu * Um42 * KScale[0]; totalMix += mixScale[0];
1084 mixScale[1] =
BR_K2e * Ue42 * KScale[1]; totalMix += mixScale[1];
1085 mixScale[2] =
BR_K3mu * Um42 * KScale[2]; totalMix += mixScale[2];
1086 mixScale[3] =
BR_K3e * Ue42 * KScale[3]; totalMix += mixScale[3];
1088 if( totalMix <= 0.0 ){
1089 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdNull, -999.9 } ) );
1094 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdKaon2Muon, mixScale[0] / totalMix } ) );
1095 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdKaon2Electron, mixScale[1] / totalMix } ) );
1096 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdKaon3Muon, mixScale[2] / totalMix } ) );
1097 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdKaon3Electron, mixScale[3] / totalMix } ) );
1105 mixScale[0] =
BR_pi2mu * Um42 * KScale[0]; totalMix += mixScale[0];
1106 mixScale[1] =
BR_pi2e * Ue42 * KScale[1]; totalMix += mixScale[1];
1108 if( totalMix <= 0.0 ){
1109 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdNull, -999.9 } ) );
1114 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdPion2Muon, mixScale[0] / totalMix } ) );
1115 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdPion2Electron, mixScale[1] / totalMix } ) );
1123 mixScale[0] =
BR_K03mu * Um42 * KScale[0]; totalMix += mixScale[0];
1124 mixScale[1] =
BR_K03e * Ue42 * KScale[1]; totalMix += mixScale[1];
1126 if( totalMix <= 0.0 ){
1127 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdNull, -999.9 } ) );
1132 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdNeuk3Muon, mixScale[0] / totalMix } ) );
1133 dynScores.insert( std::pair< HNLProd_t, double >( {
kHNLProdNeuk3Electron, mixScale[1] / totalMix } ) );
1139 <<
"Unknown parent particle. Cannot make scales, exiting."; exit(1);
1143 <<
"Score map now has " << dynScores.size() <<
" elements. Returning.";
1151 TLorentzVector p4par_rest = p4par;
1152 TVector3 boost_beta = p4par.BoostVector();
1153 p4par_rest.Boost( -boost_beta );
1161 bool allow_duplicate =
true;
1163 double * mass =
new double[decayList.size()];
1166 for( std::vector<int>::const_iterator pdg_iter = fullList.begin(); pdg_iter != fullList.end(); ++pdg_iter )
1168 if( pdg_iter != fullList.begin() ){
1169 int pdgc = *pdg_iter;
1175 for( std::vector<int>::const_iterator pdg_iter = decayList.begin(); pdg_iter != decayList.end(); ++pdg_iter )
1177 int pdgc = *pdg_iter;
1179 mass[iv++] =
m; sum +=
m;
1183 TGenPhaseSpace fPhaseSpaceGenerator;
1184 bool permitted = fPhaseSpaceGenerator.SetDecay( p4par_rest, decayList.size(), mass );
1187 <<
" *** Phase space decay is not permitted \n"
1188 <<
" Total particle mass = " << sum <<
"\n"
1194 exception.
SetReason(
"Decay not permitted kinematically");
1201 for(
int idec=0; idec<200; idec++) {
1202 double w = fPhaseSpaceGenerator.Generate();
1203 wmax = TMath::Max(wmax,w);
1209 <<
"Max phase space gen. weight @ current HNL system: " << wmax;
1214 bool accept_decay=
false;
1215 unsigned int itry=0;
1216 while(!accept_decay)
1223 <<
"Couldn't generate an unweighted phase space decay after "
1224 << itry <<
" attempts";
1229 exception.
SetReason(
"Couldn't select decay after N attempts");
1233 double w = fPhaseSpaceGenerator.Generate();
1236 <<
"Decay weight = " << w <<
" > max decay weight = " << wmax;
1238 double gw = wmax * rnd->
RndHadro().Rndm();
1239 accept_decay = (gw<=w);
1242 <<
"Decay weight = " << w <<
" / R = " << gw
1243 <<
" - accepted: " << accept_decay;
1248 int idp = 0; TLorentzVector p4HNL, p4HNL_rest;
1250 TLorentzVector p4Lep, p4Lep_HNLRest;
1252 p4HNL.SetPxPyPzE( 0.0, 0.0, 0.0, 0.0 );
1253 p4HNL_rest.SetPxPyPzE( 0.0, 0.0, 0.0, 0.0 );
1254 p4Lep.SetPxPyPzE( 0.0, 0.0, 0.0, 0.0 );
1255 p4Lep_HNLRest.SetPxPyPzE( 0.0, 0.0, 0.0, 0.0 );
1257 for(std::vector<int>::const_iterator pdg_iter = decayList.begin(); pdg_iter != decayList.end(); ++pdg_iter) {
1258 int pdgc = *pdg_iter;
1259 TLorentzVector * p4fin = fPhaseSpaceGenerator.GetDecay(idp);
1261 if( std::abs( pdgc ) ==
kPdgHNL ) p4HNL = *p4fin;
1264 std::abs( pdgc ) ==
kPdgTau ){
1273 TVector3 boostHNL = p4HNL.BoostVector();
1274 p4Lep_HNLRest = p4Lep;
fLPE = p4Lep_HNLRest.E();
1275 p4Lep_HNLRest.Boost( boostHNL );
1298 double rx = (rnd->
RndGen()).Uniform( -
fLx/2.0,
fLx/2.0 ),
1305 TVector3 checkPoint( ux, uy, uz );
1307 TVector3 originPoint( -ox, -oy, -oz );
1308 TVector3 dumori( 0.0, 0.0, 0.0 );
1317 std::string pathString = this->
CheckGeomPoint( ux, uy, uz );
int iNode = 1;
1319 while( pathString.find(
"/", iNode ) == string::npos && iBad < 10 ){
1323 checkPoint.SetXYZ( ux, uy, uz );
1327 assert( pathString.find(
"/", iNode ) != string::npos );
1333 checkPoint.SetXYZ( ux, uy, uz );
1335 checkPoint.SetXYZ( checkPoint.X() + ox, checkPoint.Y() + oy, checkPoint.Z() + oz );
1337 TVector3 vec( ux, uy, uz );
1350 TVector3 ppar = p4par.Vect(); assert( ppar.Mag() > 0.0 );
1351 TVector3 pparUnit = ppar.Unit();
1354 double Qx = 0.0, Qy = 0.0, Qz = 1.0;
1360 double nterm = Qx * detO.X() + Qy * detO.Y() + Qz * detO.Z();
1361 double dterm = Qx * ppar.X() + Qy * ppar.Y() + Qz * ppar.Z();
1362 double t = nterm / dterm;
1363 double x_incp = t * pparUnit.X(), y_incp = t * pparUnit.Y(), z_incp = t * pparUnit.Z();
1367 TVector3 IPdev( detO.X() - x_incp, detO.Y() - y_incp, detO.Z() - z_incp );
1374 double ttx = ( IPdev.X() != 0.0 ) ?
fLx / std::abs( IPdev.X() ) : 99999.9;
1375 double tty = ( IPdev.Y() != 0.0 ) ?
fLy / std::abs( IPdev.Y() ) : 99999.9;
1376 double tt = std::max( ttx, tty );
1377 TVector3 atilde( tt * IPdev.X(), tt * IPdev.Y(), tt * IPdev.Z() );
1379 double fLT = IPdev.Mag();
1380 double dist = atilde.Mag();
1382 assert( fLT > 0.0 );
1383 double detRadius = std::max(
fLx,
fLy ) / 2.0;
1385 if( parentHitsCentre ){
1390 TVector3 r1VecPrim( -pparUnit.Y(), pparUnit.X(), 0.0 );
1391 TVector3 r1Vec = r1VecPrim.Unit();
1392 r1Vec.Rotate( phi, pparUnit );
1393 TVector3 r2Vec( r1Vec ); r2Vec.Rotate( 0.5 *
constants::kPi, pparUnit );
1395 double rprod = r1Vec.X() * r2Vec.X() + r1Vec.Y() * r2Vec.Y() + r1Vec.Z() * r2Vec.Z();
1400 TVector3 p1( detO.X() + detRadius*r1Vec.X(),
1401 detO.Y() + detRadius*r1Vec.Y(),
1402 detO.Z() + detRadius*r1Vec.Z() );
1403 TVector3 p2( detO.X() - detRadius*r1Vec.X(),
1404 detO.Y() - detRadius*r1Vec.Y(),
1405 detO.Z() - detRadius*r1Vec.Z() );
1406 TVector3 p3( detO.X() + detRadius*r2Vec.X(),
1407 detO.Y() + detRadius*r2Vec.Y(),
1408 detO.Z() + detRadius*r2Vec.Z() );
1409 TVector3 p4( detO.X() - detRadius*r2Vec.X(),
1410 detO.Y() - detRadius*r2Vec.Y(),
1411 detO.Z() - detRadius*r2Vec.Z() );
1414 double thLarge = -999.9;
double thSmall = 999.9;
1415 double th1 = TMath::ACos( ( p1.X()*pparUnit.X() + p1.Y()*pparUnit.Y() + p1.Z()*pparUnit.Z() ) / p1.Mag() );
if( th1 > thLarge ){ thLarge = th1; }
else if( th1 < thSmall ){ thSmall = th1; }
1416 double th2 = TMath::ACos( ( p2.X()*pparUnit.X() + p2.Y()*pparUnit.Y() + p2.Z()*pparUnit.Z() ) / p2.Mag() );
if( th2 > thLarge ){ thLarge = th2; }
else if( th2 < thSmall ){ thSmall = th2; }
1417 double th3 = TMath::ACos( ( p3.X()*pparUnit.X() + p3.Y()*pparUnit.Y() + p3.Z()*pparUnit.Z() ) / p3.Mag() );
if( th3 > thLarge ){ thLarge = th3; }
else if( th3 < thSmall ){ thSmall = th3; }
1418 double th4 = TMath::ACos( ( p4.X()*pparUnit.X() + p4.Y()*pparUnit.Y() + p4.Z()*pparUnit.Z() ) / p4.Mag() );
if( th4 > thLarge ){ thLarge = th4; }
else if( th4 < thSmall ){ thSmall = th4; }
1423 TVector3 rVec = IPdev.Unit();
1426 double dh = fLT + dist, dl = fLT - dist;
1428 TVector3 ph( x_incp + dh * rVec.X(), y_incp + dh * rVec.Y(), z_incp + dh * rVec.Z() );
1429 TVector3 pl( x_incp - dl * rVec.X(), y_incp - dl * rVec.Y(), z_incp - dl * rVec.Z() );
1430 double thh = TMath::ACos( ( ph.X()*pparUnit.X() + ph.Y()*pparUnit.Y() + ph.Z()*pparUnit.Z() ) / ph.Mag() );
1431 double thl = TMath::ACos( ( pl.X()*pparUnit.X() + pl.Y()*pparUnit.Y() + pl.Z()*pparUnit.Z() ) / pl.Mag() );
1437 <<
"Could not calculate the angle range for detector at ( " << detO.X() <<
", "
1438 << detO.Y() <<
", " << detO.Z() <<
" ) [m] from HNL production point with parent momentum = ( "
1439 << ppar.X() <<
", " << ppar.Y() <<
", " << ppar.Z() <<
" ) [GeV]. Returning zero.";
1448 TVector3 ppar = p4par.Vect(); assert( ppar.Mag() > 0.0 );
1449 TVector3 pparUnit = ppar.Unit();
1451 const double sx1 = TMath::Sin(
fBx1), cx1 = TMath::Cos(
fBx1);
1452 const double sz = TMath::Sin(
fBz), cz = TMath::Cos(
fBz);
1453 const double sx2 = TMath::Sin(
fBx2), cx2 = TMath::Cos(
fBx2);
1455 const double xun[3] = { cz, -cx1*sz, sx1*sz };
1456 const double yun[3] = { sz*cx2, cx1*cz*cx2 - sx1*sx2, -sx1*cz*cx2 - cx1*sx2 };
1457 const double zun[3] = { sz*sx2, cx1*cz*sx2 + sx1*cx2, -sx1*cz*sx2 + cx1*cx2 };
1460 <<
"\nxun = ( " << xun[0] <<
", " << xun[1] <<
", " << xun[2] <<
" )"
1461 <<
"\nyun = ( " << yun[0] <<
", " << yun[1] <<
", " << yun[2] <<
" )"
1462 <<
"\nzun = ( " << zun[0] <<
", " << zun[1] <<
", " << zun[2] <<
" )";
1472 double inProd = zun[0] * detO_cm.X() + zun[1] * detO_cm.Y() + zun[2] * detO_cm.Z();
1473 assert( pparUnit.X() * zun[0] + pparUnit.Y() * zun[1] + pparUnit.Z() * zun[2] != 0.0 );
1474 inProd /= ( pparUnit.X() * zun[0] + pparUnit.Y() * zun[1] + pparUnit.Z() * zun[2] );
1479 TVector3 dumori(0.0, 0.0, 0.0);
1489 TVector3 detO_near( fCvec_near.X() - fDvec_beam.X(),
1490 fCvec_near.Y() - fDvec_beam.Y(),
1491 fCvec_near.Z() - fDvec_beam.Z() );
1494 const double aConst[3] = { fDvec_beam.X(), fDvec_beam.Y(), fDvec_beam.Z() };
1495 const double aConstUser[3] = { -detO_user.X(), -detO_user.Y(), -detO_user.Z() };
1499 const double dConst[3] = {
fCx,
fCy,
fCz };
1500 const double nConst[3] = { pparUnit.X(), pparUnit.Y(), pparUnit.Z() };
1503 const double nMult = nConst[0] * (dConst[0] - aConst[0]) +
1504 nConst[1] * (dConst[1] - aConst[1]) +
1505 nConst[2] * (dConst[2] - aConst[2]);
1510 const double POCA_m[3] = { aConst[0] + nMult * nConst[0],
1511 aConst[1] + nMult * nConst[1],
1512 aConst[2] + nMult * nConst[2] };
1516 const double zConstMult = ((
fCz) - aConst[2]) / (POCA_m[2] - aConst[2]);
1517 const double startPoint_m[3] = { aConst[0] + nMult * zConstMult * nConst[0],
1518 aConst[1] + nMult * zConstMult * nConst[1],
1519 aConst[2] + nMult * zConstMult * nConst[2] };
1537 const double swvMag = std::sqrt( sweepVect[0]*sweepVect[0] + sweepVect[1]*sweepVect[1] + sweepVect[2]*sweepVect[2] ); assert( swvMag > 0.0 );
1548 TVector3 detSweepVect( sweepVect[0], sweepVect[1], sweepVect[2] );
1550 TVector3 detPpar = ppar;
1562 std::string detPathString = this->
CheckGeomPoint( detStartPoint.X(), detStartPoint.Y(), detStartPoint.Z() );
int iDNode = 1;
1563 bool startsInsideDet = ( detPathString.find(
"/", iDNode) != string::npos );
1565 TLorentzVector detPpar_4v( detPpar.X(), detPpar.Y(), detPpar.Z(), p4par.E() );
1570 double minusPoint[3] = { 0.0, 0.0, 0.0 };
double plusPoint[3] = { 0.0, 0.0, 0.0 };
1571 if( startsInsideDet ){
1572 minusPoint[0] = (gGeoManager->GetCurrentPoint())[0];
1573 minusPoint[1] = (gGeoManager->GetCurrentPoint())[1];
1574 minusPoint[2] = (gGeoManager->GetCurrentPoint())[2];
1577 gGeoManager->SetCurrentPoint( detStartPoint.X(), detStartPoint.Y(), detStartPoint.Z() );
1578 gGeoManager->SetCurrentDirection( detSweepVect.X() / swvMag, detSweepVect.Y() / swvMag, detSweepVect.Z() / swvMag );
1579 const double sStepSize = 0.05 * std::min( std::min(
fLx,
fLy ),
fLz );
1583 if( startsInsideDet ){
1588 double currx = (gGeoManager->GetCurrentPoint())[0];
1589 double curry = (gGeoManager->GetCurrentPoint())[1];
1590 double currz = (gGeoManager->GetCurrentPoint())[2];
1591 double currDist = std::sqrt( currx*currx + curry*curry + currz*currz );
1593 double curdx = (gGeoManager->GetCurrentDirection())[0];
1594 double curdy = (gGeoManager->GetCurrentDirection())[1];
1595 double curdz = (gGeoManager->GetCurrentDirection())[2];
1597 double stepMod = 0.99;
1599 double halfBoxSize = boxSize/2.0;
1605 double largeStep = currDist + desiredDist;
1607 gGeoManager->SetCurrentPoint( currx + largeStep * curdx,
1608 curry + largeStep * curdy,
1609 currz + largeStep * curdz );
1620 plusPoint[0] = (gGeoManager->GetCurrentPoint())[0];
1621 plusPoint[1] = (gGeoManager->GetCurrentPoint())[1];
1622 plusPoint[2] = (gGeoManager->GetCurrentPoint())[2];
1630 double currx = (gGeoManager->GetCurrentPoint())[0];
1631 double curry = (gGeoManager->GetCurrentPoint())[1];
1632 double currz = (gGeoManager->GetCurrentPoint())[2];
1633 double currDist = std::sqrt( currx*currx + curry*curry + currz*currz );
1635 double stepMod = 0.99;
1637 double halfBoxSize = boxSize / 2.0;
1642 double largeStep = currDist - desiredDist;
1644 double curdx = (gGeoManager->GetCurrentDirection())[0];
1645 double curdy = (gGeoManager->GetCurrentDirection())[1];
1646 double curdz = (gGeoManager->GetCurrentDirection())[2];
1648 gGeoManager->SetCurrentPoint( currx + largeStep * curdx,
1649 curry + largeStep * curdy,
1650 currz + largeStep * curdz );
1661 minusPoint[0] = (gGeoManager->GetCurrentPoint())[0];
1662 minusPoint[1] = (gGeoManager->GetCurrentPoint())[1];
1663 minusPoint[2] = (gGeoManager->GetCurrentPoint())[2];
1669 currx = (gGeoManager->GetCurrentPoint())[0];
1670 curry = (gGeoManager->GetCurrentPoint())[1];
1671 currz = (gGeoManager->GetCurrentPoint())[2];
1682 gGeoManager->SetCurrentPoint( -currx, -curry, -currz );
1693 plusPoint[0] = (gGeoManager->GetCurrentPoint())[0];
1694 plusPoint[1] = (gGeoManager->GetCurrentPoint())[1];
1695 plusPoint[2] = (gGeoManager->GetCurrentPoint())[2];
1732 vMNear.SetXYZ( vMNear.X() + (
fCx),
1734 vMNear.Z() + (
fCz) );
1741 vPNear.SetXYZ( vPNear.X() + (
fCx),
1743 vPNear.Z() + (
fCz) );
1768 TVector3 minusVec( minusPoint[0] - decayPoint_user.X(), minusPoint[1] - decayPoint_user.Y(), minusPoint[2] - decayPoint_user[2] );
1769 TVector3 plusVec( plusPoint[0] - decayPoint_user.X(), plusPoint[1] - decayPoint_user.Y(), plusPoint[2] - decayPoint_user[2] );
1770 TVector3 startVec( detStartPoint[0] - decayPoint_user.X(), detStartPoint[1] - decayPoint_user.Y(), detStartPoint[2] - decayPoint_user.Z() );
1776 double minusNum = startVec.X() * minusVec.X() + startVec.Y() * minusVec.Y() + startVec.Z() * minusVec.Z();
1777 double minusDen = startVec.Mag() * minusVec.Mag(); assert( minusDen > 0.0 );
1779 zm = TMath::ACos( minusNum / minusDen ) * TMath::RadToDeg();
1781 double plusNum = startVec.X() * plusVec.X() + startVec.Y() * plusVec.Y() + startVec.Z() * plusVec.Z();
1782 double plusDen = startVec.Mag() * plusVec.Mag(); assert( plusDen > 0.0 );
1784 zp = TMath::ACos( plusNum / plusDen ) * TMath::RadToDeg();
1804 double SMECM,
double zm,
double zp )
const
1815 assert( zm >= 0.0 && zp >= zm );
1816 if( zp == zm )
return 1.0;
1818 double M = p4HNL.M();
1819 if( M < 1.0
e-3 )
return 1.0;
1821 TF1 * fHNL = ( TF1* ) gROOT->GetListOfFunctions()->FindObject(
"fHNL" );
1822 if( !fHNL ){ fHNL =
new TF1(
"fHNL",
labangle, 0.0, 180.0, 6 ); }
1823 fHNL->SetParameter( 0, p4par.E() );
1824 fHNL->SetParameter( 1, p4par.Px() );
1825 fHNL->SetParameter( 2, p4par.Py() );
1826 fHNL->SetParameter( 3, p4par.Pz() );
1827 fHNL->SetParameter( 4, p4HNL.P() );
1828 fHNL->SetParameter( 5, p4HNL.E() );
1830 double ymax = fHNL->GetMaximum(), xmax = fHNL->GetMaximumX();
1831 double range1 = 0.0;
1833 if( fHNL->GetMinimum() >= fHNL->GetMaximum() )
return 1.0;
1835 if( zm < fHNL->GetMinimum() ){
1836 double z0 = fHNL->GetMinimum();
1837 if( ymax > zp && xmax < 180.0 ){
1841 double xl1 = fHNL->GetX( z0, 0.0, xmax );
1842 double xh1 = fHNL->GetX( zp, 0.0, xmax );
1843 double xl2 = fHNL->GetX( z0, xmax, 180.0 );
1844 double xh2 = fHNL->GetX( zp, xmax, 180.0 );
1846 range1 += std::abs( xl1 - xh1 ) + std::abs( xh2 - xl2 ); nPreim = 2;
1847 }
else if( ymax > zp && xmax == 180.0 ){
1848 double xl = fHNL->GetX( z0 ), xh = fHNL->GetX( zp );
1849 range1 = std::abs( xh - xl );
1851 }
else if( ymax <= zp ){
1858 }
else if( ymax > zp && xmax < 180.0 ){
1862 double xl1 = fHNL->GetX( zm, 0.0, xmax );
1863 double xh1 = fHNL->GetX( zp, 0.0, xmax );
1864 double xl2 = fHNL->GetX( zm, xmax, 180.0 );
1865 double xh2 = fHNL->GetX( zp, xmax, 180.0 );
1867 range1 += std::abs( xl1 - xh1 ) + std::abs( xh2 - xl2 ); nPreim = 2;
1868 }
else if( ymax > zp && xmax == 180.0 ){
1869 double xl = fHNL->GetX( zm ), xh = fHNL->GetX( zp );
1870 range1 = std::abs( xh - xl );
1872 }
else if( zm < ymax && ymax <= zp ){
1873 double xl = fHNL->GetX( zm, 0., xmax ), xh = fHNL->GetX( zm, xmax, 180.0 );
1874 range1 = std::abs( xh - xl );
1878 TF1 * fSMv = ( TF1* ) gROOT->GetListOfFunctions()->FindObject(
"fSMv" );
1880 fSMv =
new TF1(
"fSMv",
labangle, 0.0, 180.0, 6 );
1882 fSMv->SetParameter( 0, p4par.E() );
1883 fSMv->SetParameter( 1, p4par.Px() );
1884 fSMv->SetParameter( 2, p4par.Py() );
1885 fSMv->SetParameter( 3, p4par.Pz() );
1886 fSMv->SetParameter( 4, SMECM );
1887 fSMv->SetParameter( 5, SMECM );
1888 double range2 = -1.0;
1890 if( fSMv->GetMaximum() == fSMv->GetMinimum() )
return 1.0;
1896 if( fSMv->GetMinimum() < zp ){
1897 if( fSMv->GetMinimum() < zm ){
1898 range2 = std::abs( fSMv->GetX( zp ) - fSMv->GetX( zm ) );
1900 range2 = fSMv->GetX( zp );
1902 if( range2 < 1.0e-6 || range1 / range2 > 10.0 )
return 1.0;
1904 TVector3 bv = p4par.BoostVector();
1906 TLorentzVector vcx( p4HNL.P(), 0.0, 0.0, p4HNL.E() ),
1907 vcy( 0.0, p4HNL.P(), 0.0, p4HNL.E() ),
1908 vcz( 0.0, 0.0, p4HNL.P(), p4HNL.E() );
1909 vcx.Boost( bv ); vcy.Boost( bv ); vcz.Boost( bv );
1911 TLorentzVector vsx( SMECM, 0.0, 0.0, SMECM ),
1912 vsy( 0.0, SMECM, 0.0, SMECM ),
1913 vsz( 0.0, 0.0, SMECM, SMECM );
1914 vsx.Boost( bv ); vsy.Boost( bv ); vsz.Boost( bv );
1916 double xpart = std::abs( ( vcx.X() / vcz.Z() ) / ( vsx.X() / vsz.Z() ) );
1917 double ypart = std::abs( ( vcy.Y() / vcz.Z() ) / ( vsy.Y() / vsz.Z() ) );
1919 return 1.0 / ( xpart * ypart );
1922 assert( range2 > 0.0 );
1924 return range1 / range2;
1930 double xrad = x[0] * TMath::DegToRad();
1931 double Ehad = par[0], pxhad = par[1], pyhad = par[2], pzhad = par[3];
1932 double phnl = par[4], Ehnl = par[5];
1934 TLorentzVector p4had( pxhad, pyhad, pzhad, Ehad );
1935 TVector3 boost_vec = p4had.BoostVector();
1938 TLorentzVector pncm( 0.0, phnl * TMath::Sin( xrad ), phnl * TMath::Cos( xrad ), Ehnl );
1941 pncm.Boost( boost_vec );
1944 double num = pxhad * pncm.X() + pyhad * pncm.Y() + pzhad * pncm.Z();
1945 double den = p4had.P() * pncm.P();
1946 double theta = TMath::ACos( num / den ) * 180.0 /
constants::kPi;
1954 <<
"WARNING: This is a bounding box centred at config-given point and radius " <<
fRadius <<
" m";
1961 double vx = vec.X(), vy = vec.Y(), vz = vec.Z();
1963 double Ax2 = ( doBackwards ) ? -
fAx2 :
fAx2;
1964 double Az = ( doBackwards ) ? -
fAz :
fAz;
1965 double Ax1 = ( doBackwards ) ? -
fAx1 :
fAx1;
1968 double x = vx, y = vy, z = vz;
1969 vy = y * std::cos( Ax2 ) - z * std::sin( Ax2 );
1970 vz = y * std::sin( Ax2 ) + z * std::cos( Ax2 );
1973 vx = x * std::cos( Az ) - y * std::sin( Az );
1974 vy = x * std::sin( Az ) + y * std::cos( Az );
1977 vy = y * std::cos( Ax1 ) - z * std::sin( Ax1 );
1978 vz = y * std::sin( Ax1 ) + z * std::cos( Ax1 );
1980 TVector3 nvec( vx, vy, vz );
1986 double vx = vec.X(), vy = vec.Y(), vz = vec.Z();
1987 double ox = oriVec.X(), oy = oriVec.Y(), oz = oriVec.Z();
1989 vx -= ox; vy -= oy; vz -= oz;
1991 assert( rotVec.size() == 3 );
1992 double Ax2 = ( doBackwards ) ? -rotVec.at(2) : rotVec.at(2);
1993 double Az = ( doBackwards ) ? -rotVec.at(1) : rotVec.at(1);
1994 double Ax1 = ( doBackwards ) ? -rotVec.at(0) : rotVec.at(0);
1997 double x = vx, y = vy, z = vz;
1998 vy = y * std::cos( Ax2 ) - z * std::sin( Ax2 );
1999 vz = y * std::sin( Ax2 ) + z * std::cos( Ax2 );
2002 vx = x * std::cos( Az ) - y * std::sin( Az );
2003 vy = x * std::sin( Az ) + y * std::cos( Az );
2006 vy = y * std::cos( Ax1 ) - z * std::sin( Ax1 );
2007 vz = y * std::sin( Ax1 ) + z * std::cos( Ax1 );
2010 vx += ox; vy += oy; vz += oz;
2011 TVector3 nvec( vx, vy, vz );
2018 double rad = std::sqrt( detO.X() * detO.X() + detO.Y() * detO.Y() + detO.Z() * detO.Z() );
2019 double sang = 1.0 - TMath::Cos( TMath::ATan(
kRDET / rad ) ); sang *= 0.5;
2047 <<
"Loading flux-creation parameters from file...";
2112 LOG(
"HNL",
pDEBUG ) <<
"Setting geometry file to " << geomfile;
2123 LOG(
"HNL",
pDEBUG ) <<
"Importing bounding box...";
2130 fLx = std::min( testRadius,
fLxR );
2131 fLy = std::min( testRadius,
fLyR );
2132 fLz = std::min( testRadius,
fLzR );
2143 TGeoVolume *vol = gGeoManager->GetTopVolume();
2144 TGeoNode *node = gGeoManager->FindNode(point[0], point[1], point[2]);
2145 gGeoManager->MasterToLocal(point, local);
2146 return gGeoManager->GetPath();
static constexpr double cm
enum genie::hnl::t_HNLProd HNLProd_t
TLorentzVector parp4
parent momentum at HNL production in NEAR coords [GeV/c]
std::vector< double > fFixedPolarisation
virtual void SetXSec(double xsec)
double CalculateAreaNormalisation()
static constexpr double rad
virtual GHepParticle * Particle(int position) const
virtual void SetWeight(double wght)
int decay_ptype
PDG code of parent.
TLorentzVector * GetX4(void) const
double Ecm
Parent rest-frame energy of HNL [GeV].
static const int maxArray
double zetaMinus
minimum angular deviation from parent momentum to reach detector [deg]
std::map< genie::hnl::HNLProd_t, double > dynamicScores_neuk
double nuEcm
Parent rest-frame energy of equivalent SM neutrino [GeV].
double nuray_px[maxArray]
TVector3 PointToRandomPointInBBox() const
static double labangle(double *x, double *par)
Manages HNL BR (prod and decay)
double delay
delay HNL would have wrt SMv [ns]
double potnum
N POT for this SM-v.
double pots
how many pot in this job?
std::vector< double > fB2UTranslation
double ancestor_polz[maxArray]
static RandomGen * Instance()
Access instance.
void ProcessEventRecord(GHepRecord *event_rec) const
std::vector< double > fDetOffset
PDGCodeList ProductionProductList(genie::hnl::HNLProd_t hnldm)
void ImportBoundingBox(TGeoBBox *box) const
double decay_vz
coordinates of prod vtx [cm]
double GetAngDeviation(TLorentzVector p4par, TVector3 detO, bool seekingMax) const
double location_y[maxArray]
TVector3 startPoint
parent decay vertex in NEAR coords [m]
double ancestor_startz[maxArray]
double traj_trkpx[maxArray]
int job
beamsim MC job number
int lepPdg
PDG code of lepton produced with HNL on parent decay.
int GetNFluxEntries() const
TVector3 polz
HNL polarisation vector, in HNL rest frame, in NEAR coords.
int parPdg
parent PDG code
int GetParamVect(const std::string &comm_name, std::vector< T > &v, bool is_top_call=true) const
Handle to load vectors of parameters.
char location_name[maxArray *maxC]
static constexpr double s
double CalculateDetectorAcceptanceSAA(TVector3 detO) const
A GENIE flux container specific for HNL containers. Based on the dk2nu flux paradigm and genie::flux:...
string P4AsString(const TLorentzVector *p)
static const unsigned int kMaxUnweightDecayIterations
Algorithm abstract base class.
double zetaPlus
maximum angular deviation from parent momentum to reach detector [deg]
virtual double Weight(void) const
static constexpr double ns
TVector3 startPointUser
parent decay vertex in USER coords [m]
genie::hnl::FluxContainer fGnmf
double decay_necm
SM v CM energy [GeV].
A singleton holding random number generator classes. All random number generation in GENIE should tak...
double ancestor_pprodpx[maxArray]
TLorentzVector parp4User
parent momentum at HNL production in USER coords [GeV/c]
double traj_trkz[maxArray]
double decay_nimpwt
Importance weight from beamsim.
std::vector< double > fB2URotation
double ancestor_startx[maxArray]
double traj_trkpy[maxArray]
double CalculateAcceptanceCorrection(TLorentzVector p4par, TLorentzVector p4HNL, double SMECM, double zm, double zp) const
void SetUsingRootGeom(bool IsUsingRootGeom) const
std::vector< double > fDetRotation
std::map< genie::hnl::HNLProd_t, double > dynamicScores
void SetPosition(const TLorentzVector &v4)
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
double ancestor_stoppx[maxArray]
double KinematicScaling(genie::hnl::HNLProd_t hnlprod) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
TLorentzVector p4
HNL momentum in NEAR coords [GeV/c].
double ancestor_starty[maxArray]
TLorentzVector p4User
HNL momentum in USER coords [GeV/c].
std::map< genie::hnl::HNLProd_t, double > dynamicScores_muon
double traj_trkx[maxArray]
std::string CheckGeomPoint(Double_t x, Double_t y, Double_t z) const
double location_z[maxArray]
virtual void Configure(const Registry &config)
int prodChan
Decay mode that produced HNL.
const Algorithm * GetAlgorithm(const AlgId &algid)
TVector3 ApplyUserRotation(TVector3 vec, bool doBackwards=false) const
void OpenFluxInput(std::string finpath) const
std::map< genie::hnl::HNLProd_t, double > GetProductionProbs(int parPDG) const
static const double kASmallNum
std::map< genie::hnl::HNLProd_t, double > dynamicScores_pion
void InitialiseMeta() const
FluxContainer RetrieveFluxInfo() const
string ProdAsString(genie::hnl::HNLProd_t hnlprod)
double acceptance
full acceptance == XYWgt * boostCorr^2 * accCorr
std::map< genie::hnl::HNLProd_t, double > dynamicScores_kaon
double ancestor_startpx[maxArray]
TVector3 targetPointUser
point in detector HNL is forced towards in USER coords [m]
double nuray_py[maxArray]
double decay_pdpz
final parent momentum [GeV]
TVector3 targetPoint
point in detector HNL is forced towards in NEAR coords [m]
double nimpwt
Weight of parent.
char ancestor_imat[maxArray *maxC]
Expands the EventRecordVisitorI interface to include public interfaces for the HNL FluxCreator module...
void FillNonsense(int iEntry, genie::hnl::FluxContainer &gnmf) const
char ancestor_proc[maxArray *maxC]
double accCorr
acceptance correction (collimation effect. SM v == 1)
double ancestor_startpz[maxArray]
FluxContainer MakeTupleFluxEntry(int iEntry, std::string finpath) const
double traj_trkpz[maxArray]
TRandom3 & RndHadro(void) const
rnd number generator used by hadronization models
void SwitchOnFastForward(void)
double ancestor_pprodpz[maxArray]
static PDGLibrary * Instance(void)
bool IsProdKinematicallyAllowed(genie::hnl::HNLProd_t hnlprod)
void SetReason(string reason)
static AlgFactory * Instance()
std::vector< double > fU4l2s
int nuPdg
PDG code of SM neutrino that would have been produced.
double XYWgt
geometric acceptance (angular size of detector in parent rest frame)
A registry. Provides the container for algorithm configuration parameters.
double ancestor_stoppz[maxArray]
virtual void SetVertex(double x, double y, double z, double t)
TRandom3 & RndGen(void) const
rnd number generator for generic usage
void SetFirstFluxEntry(int iFirst) const
double location_x[maxArray]
std::vector< double > fScales
double nuray_wgt[maxArray]
double ancestor_stoppy[maxArray]
virtual double XSec(void) const
int nuProdChan
Decay mode that would have produced SM neutrino.
void InitialiseTree() const
virtual void AddParticle(const GHepParticle &p)
double ancestor_startpy[maxArray]
double ancestor_pprodpy[maxArray]
TParticlePDG * Find(int pdgc, bool must_exist=true)
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
double boostCorr
boost correction wrt parent rest-frame (ELAB = ECM * boostCorr)
void Configure(const Registry &config)
int ancestor_nucleus[maxArray]
double nuray_pz[maxArray]
static constexpr double kSpeedOfLight
char ancestor_ivol[maxArray *maxC]
TLorentzVector HNLEnergy(genie::hnl::HNLProd_t hnldm, TLorentzVector p4par) const
GENIE's GHEP MC event record.
double ancestor_poly[maxArray]
static constexpr double m
STDHEP-like event record entry that can fit a particle or a nucleus.
void SetCurrentEntry(int iCurr) const
int ancestor_pdg[maxArray]
string Vec3AsString(const TVector3 *vec)
double traj_trky[maxArray]
void SetInputFluxPath(std::string finpath) const
void push_back(int pdg_code)
double ancestor_polx[maxArray]
void SetGeomFile(string geomfile) const