NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcCollider.cxx
Go to the documentation of this file.
1
31
33
223
224#include "NcCollider.h"
225#include "Riostream.h"
226
227ClassImp(NcCollider); // Class implementation to enable ROOT I/O
228
231{
249
250 fVertexmode=0; // No vertex structure creation
251 fResolution=1e-7; // Standard resolution is 0.1 micron
252 fRunnum=0;
253 fEventnum=0;
254 fPrintfreq=1;
255 fUserctrl=0; // Automatic optimisation of some MC parameters
256 fElastic=0; // No elastic and diffractive processes
257 fMultiple=1; // Include multiple interactions
258 fEcmsmin=2.7; // Minimal CMS energy (in GeV) for events to get generated
259
260 fEvent=0;
261
262 fSpecpmin=0;
263
264 fFrame="none";
265 fWin=-1;
266 fWxsec=0;
267
268 fNucl=0;
269 fZproj=0;
270 fAproj=0;
271 fZtarg=0;
272 fAtarg=0;
273 fFracpp=0;
274 fFracnp=0;
275 fFracpn=0;
276 fFracnn=0;
277
278 fOutFile=0;
279 fOutTree=0;
280 fMktree=0;
281 fJob=0;
282 fEvtuser.AddNamedSlot("BeamP");
283 fEvtuser.AddNamedSlot("BeamTheta");
284 fEvtuser.AddNamedSlot("BeamPhi");
285 fEvtuser.AddNamedSlot("TargetP");
286 fEvtuser.AddNamedSlot("TargetTheta");
287 fEvtuser.AddNamedSlot("TargetPhi");
288
289 fSelections=0;
290 fSelect=0;
291
292 fJetPpmin=0;
293 fJetPpmax=0;
294 fJetGpmin=0;
295 fJetGpmax=0;
297 fJetPscale=0;
299 fJetGscale=0;
300
301 TString s=GetName();
302 s+=" (NcCollider)";
303 SetName(s.Data());
304 SetTitle("");
305}
306
308{
314
315 if (fEvent)
316 {
317 delete fEvent;
318 fEvent=0;
319 }
320
321 if (fSelections)
322 {
323 delete fSelections;
324 fSelections=0;
325 }
326
327 // Deletion of the NcEvent output file also deletes the corresponding Tree
328 if (fOutFile)
329 {
330 delete fOutFile;
331 fOutFile=0;
332 fOutTree=0;
333 }
334
335 if (fJob)
336 {
337 delete fJob;
338 fJob=0;
339 }
340
341 if (fMktree)
342 {
343 delete fMktree;
344 fMktree=0;
345 }
346
347 if (fJetPspectrum)
348 {
349 delete fJetPspectrum;
351 }
352
353 if (fJetGspectrum)
354 {
355 delete fJetGspectrum;
357 }
358}
359
360NcTreeMaker* NcCollider::SetOutputFile(TString name,Int_t mode)
361{
387
388 // Expand the path name of the provided output filename
389 name=gSystem->ExpandPathName(name.Data());
390
391 // Flush and delete the current existing output file (if any) for the NcEvent data structures.
392 // This will also delete the existing output tree connected to this file
393 if (fOutFile)
394 {
395 if (fOutFile->IsOpen())
396 {
397 fOutFile->Write();
398 delete fOutFile;
399 fOutFile=0;
400 fOutTree=0;
401 }
402 }
403
404 // Close and delete the current existing output file (if any) for the plain ROOT tree data structures
405 if (fMktree)
406 {
407 fMktree->CloseTree();
408 delete fMktree;
409 fMktree=0;
410 }
411
412 // Delete the NcJob environment
413 if (fJob)
414 {
415 delete fJob;
416 fJob=0;
417 }
418
419 TString fname;
420
421 // Create the output file for the NcTreeMaker data structures
422 if (mode>0)
423 {
424 fname=name;
425 // Generate the corresponding file extension
426 if (mode==2) fname+=".root";
427
428 fMktree=new NcTreeMaker();
429 fMktree->SetOutputFile(fname,"NcCollider event/track data in plain ROOT tree format");
430
431 fJob=new NcJob("NcJob","NcCollider job (task) environment");
432 fJob->Add(fMktree);
433
434 printf(" *%-s::SetOutputFile* Plain ROOT tree event/track data will be written to output file: %-s \n",ClassName(),fname.Data());
435 }
436
437 // Create the output file for the NcEvent data structures
438 if (mode==0 || mode==2)
439 {
440 fname=name;
441 // Generate the corresponding file extension
442 if (mode==2) fname+=".ncfspack";
443
444 // Create a new NcEvent structure
445 if (fEvent)
446 {
447 delete fEvent;
448 fEvent=0;
449 }
450 fEvent=new NcEvent();
451 fEvent->SetOwner();
452 fEvent->SetName(GetName());
453 fEvent->SetTitle(GetTitle());
454
455 // Create a new output file
456 fOutFile=new TFile(fname,"RECREATE","NcCollider NcEvent data");
457
458 // Create a new output Tree in the output file
459 fOutTree=new TTree("T","NcCollider NcEvent data");
460 Int_t bsize=32000;
461 Int_t split=0;
462 fOutTree->Branch("Events","NcEvent",&fEvent,bsize,split);
463
464 printf(" *%-s::SetOutputFile* NcEvent data structures will be written to output file: %-s \n",ClassName(),fname.Data());
465 }
466
467 gROOT->cd(); // Make sure to work in the memory
468
469 cout << endl;
470 cout << endl;
471
472 return fMktree;
473}
474
476{
524
525 if (mode<0 || mode >3)
526 {
527 cout << " *NcCollider::SetVertexMode* Invalid argument mode : " << mode << endl;
528 fVertexmode=0;
529 }
530 else
531 {
532 fVertexmode=mode;
533 }
534}
535
537{
543
544 return fVertexmode;
545}
546
548{
557
558 fResolution=fabs(res);
559}
560
562{
568
569 return fResolution;
570}
571
573{
580
581 fRunnum=run;
582}
583
585{
591
592 return fRunnum;
593}
594
596{
604
605 fPrintfreq=n;
606}
607
609{
615
616 return fPrintfreq;
617}
618
620{
632
633 fUserctrl=flag;
634}
635
637{
643
644 return fUserctrl;
645}
646
648{
657
658 fElastic=flag;
659}
660
662{
668
669 return fElastic;
670}
671
673{
682
683 fMultiple=flag;
684}
685
687{
693
694 return fMultiple;
695}
696
697void NcCollider::SetEcmsMin(Double_t ecms)
698{
711
712 fEcmsmin=ecms;
713}
714
716{
722
723 return fEcmsmin;
724}
725
727{
747
748 if (iseed>900000000) return;
749
750 if (iseed<0)
751 {
752 NcTimestamp ts;
753 Int_t mjd,sec,ns;
754 ts.GetMJD(mjd,sec,ns);
755 iseed=10000*sec+(mjd%10000);
756 }
757 SetMRPY(1,iseed);
758 SetMRPY(2,0);
759}
760
762{
768
769 Int_t iseed=GetMRPY(1);
770 return iseed;
771}
772
773Float_t NcCollider::GetWin() const
774{
782
783 return fWin;
784}
785
786Int_t NcCollider::Init(TString frame,TString beam,TString target,Float_t win,Nc3Vector* pbeam,Nc3Vector* ptarget,Int_t wxsec,Double_t fact)
787{
902
903 Int_t ier=0;
904 if (frame!="cms" && frame!="fixt" && frame!="free") ier=1;
905 if (frame!="free" && win<=0) ier=1;
906 if (frame=="free" && (!pbeam || !ptarget)) ier=1;
907 if (frame=="free" && (beam.Contains("gamma/") || target.Contains("gamma/"))) ier=1;
908 if (ier)
909 {
910 cout << " *NcCollider::Init* Standard Pythia initialisation ==> Inconsistent input." << endl;
911 return ier;
912 }
913
914 if (!fUserctrl) // Optimisation of some MC parameters
915 {
916 if (beam=="gamma" || target=="gamma")
917 {
918 SetMSTP(14,10); // Real photons for photon beams or targets
919 }
920 SetPARP(2,0); // No minimum CMS energy required at initialisation
921 SetMSTP(33,2); // Activate K factor. Separate for ordinary and color annih. graphs
922 SetPMAS(25,1,125.09); // Setting the Higgs mass
923 }
924
925 fWxsec=0;
926 if (frame=="free")
927 {
928 SetMSTP(171,1); // Enable variation of beam and/or target momenta
929 SetMSTP(82,1); // Select abrupt pt_min cut-off (see Pythia parameter PARP(81)) for multiple interactions
930 if (wxsec)
931 {
932 SetMSTP(172,2); // Weight event production by cross section
933 fWxsec=1;
934 }
935 else
936 {
937 SetMSTP(172,1); // Just always generate an event at the requested energy
938 }
939 }
940 else
941 {
942 SetMSTP(171,0); // Disable variation of beam and/or target momenta
943 }
944
945 if (fElastic) SetMSEL(2); // Include low-Pt, elastic and diffractive events
946
947 if (!fMultiple) // Disable multiple interactions
948 {
949 SetMSTP(81,0);
950 SetMSTP(82,1);
951 }
952
953 fEventnum=0;
954 fNucl=0;
955 fFrame=frame;
956 fWin=-1;
957 if (win>0) fWin=win;
958 Double_t s;
959 Double_t ecms;
960 fBeam.SetNameTitle(beam.Data(),"Beam");
961 fTarget.SetNameTitle(target.Data(),"Target");
962
963 // Set initial beam and target specifications for user defined system via "pbeam" and "ptarget"
964 if (fFrame=="free")
965 {
966 Double_t bmass=0;
967 Double_t tmass=0;
968
969 if (beam=="e-" || beam=="e+") bmass=0.510998928e-3;
970 if (beam=="mu-" || beam=="mu+") bmass=105.6583715e-3;
971 if (beam=="tau-" || beam=="tau+") bmass=1.77686;
972 if (beam=="pi+" || beam=="pi-") bmass=139.57018e-3;
973 if (beam=="pi0") bmass=134.9766e-3;
974 if (beam=="K+" || beam=="K-") bmass=493.677e-3;
975 if (beam=="KS0" || beam=="KL0") bmass=497.611e-3;
976 if (beam=="p") bmass=938.272046e-3;
977 if (beam=="n") bmass=939.565379e-3;
978 if (beam=="Lambda0") bmass=1.115683;
979 if (beam=="Sigma+") bmass=1.18937;
980 if (beam=="Sigma0") bmass=1.192642;
981 if (beam=="Sigma-") bmass=1.197449;
982 if (beam=="Xi-") bmass=1.32171;
983 if (beam=="Xi0") bmass=1.31486;
984 if (beam=="Omega-") bmass=1.67245;
985
986 if (target=="e-" || target=="e+") tmass=0.510998928e-3;
987 if (target=="mu-" || target=="mu+") tmass=105.6583715e-3;
988 if (target=="tau-" || target=="tau+") tmass=1.77686;
989 if (target=="pi+" || target=="pi-") tmass=139.57018e-3;
990 if (target=="pi0") tmass=134.9766e-3;
991 if (target=="K+" || target=="K-") tmass=493.677e-3;
992 if (target=="KS0" || target=="KL0") tmass=497.611e-3;
993 if (target=="p") tmass=938.272046e-3;
994 if (target=="n") tmass=939.565379e-3;
995 if (target=="Lambda0") tmass=1.115683;
996 if (target=="Sigma+") tmass=1.18937;
997 if (target=="Sigma0") tmass=1.192642;
998 if (target=="Sigma-") tmass=1.197449;
999 if (target=="Xi-") tmass=1.32171;
1000 if (target=="Xi0") tmass=1.31486;
1001 if (target=="Omega-") tmass=1.67245;
1002
1003 fBeam.SetMass(bmass);
1004 fTarget.SetMass(tmass);
1005
1006 Nc3Vector vinit;
1007 if (fact>0 && fWin<0) // Modify beam 3-momentum for initialisation only
1008 {
1009 vinit.Load(*pbeam);
1010 vinit*=fact;
1011 SetMomentum(vinit,1);
1012 SetMomentum(*ptarget,2);
1013 cout << endl;
1014 cout << " ************************************* NcCollider::Init ************************************" << endl;
1015 cout << " *** Beam momentum artificially increased for intialisation only. Increase factor : " << fact << endl;
1016 cout << " *******************************************************************************************" << endl;
1017 cout << endl;
1018 }
1019 else if (fact<0 && fWin<0) // Modify target 3-momentum for initialisation only
1020 {
1021 vinit.Load(*ptarget);
1022 vinit*=fabs(fact);
1023 SetMomentum(*pbeam,1);
1024 SetMomentum(vinit,2);
1025 cout << endl;
1026 cout << " ************************************** NcCollider::Init *************************************" << endl;
1027 cout << " *** Target momentum artificially increased for intialisation only. Increase factor : " << fabs(fact) << endl;
1028 cout << " *********************************************************************************************" << endl;
1029 cout << endl;
1030 }
1031 else // Use the provided beam and target 3-momenta for initialisation
1032 {
1033 SetMomentum(*pbeam,1);
1034 SetMomentum(*ptarget,2);
1035 }
1036 frame="3mom"; // Use the Pythia convention for the frame name
1037 if (win>=0) // Forced event generation in the CMS
1038 {
1039 frame="cms";
1040 if (!win) // Set CM energy according to "pbeam", "ptarget" and "fact"
1041 {
1042 s=fBeam.GetInvariant()+fTarget.GetInvariant()+2.*fBeam.Dot(fTarget);
1043 ecms=sqrt(s);
1044 fWin=ecms;
1045 }
1046 }
1047 }
1048
1049 // Prevent title overwriting by Initialize()
1050 TString title=GetTitle();
1051
1052 Initialize(frame.Data(),beam.Data(),target.Data(),fWin);
1053
1054 SetTitle(title.Data());
1055
1056 // Use the Pythia beam and target specifications for consistency
1057 fBeam.SetMass(GetP(1,5));
1058 fTarget.SetMass(GetP(2,5));
1059
1060 if (fFrame=="cms")
1061 {
1062 fBeam.Set3Vector(GetP(1,1),GetP(1,2),GetP(1,3),"car");
1063 fTarget.Set3Vector(GetP(2,1),GetP(2,2),GetP(2,3),"car");
1064 }
1065 if (fFrame=="fixt")
1066 {
1067 fBeam.Set3Vector(0,0,win,"car");
1068 fTarget.Set3Vector(0,0,0,"car");
1069 }
1070 if (fFrame=="free")
1071 {
1072 SetMomentum(*pbeam,1);
1073 SetMomentum(*ptarget,2);
1074 }
1075
1076 TString sweight="Yes";
1077 if (!wxsec) sweight="No";
1078
1079 s=fBeam.GetInvariant()+fTarget.GetInvariant()+2.*fBeam.Dot(fTarget);
1080 ecms=sqrt(s);
1081
1082 cout << endl;
1083 cout << endl;
1084 cout << " ********************************************************" << endl;
1085 cout << " *** NcCollider::Init Standard Pythia initialisation ***" << endl;
1086 cout << " ********************************************************" << endl;
1087 cout << " *** Beam particle: " << beam.Data() << " Target particle: " << target.Data() << " Frame: " << fFrame.Data() << endl;
1088 if (fFrame=="cms") cout << " *** Total CMS energy: " << win << " GeV" << endl;
1089 if (fFrame=="fixt") cout << " *** Beam particle momentum: " << win << " GeV/c" << endl;
1090 if (fFrame=="free") cout << " *** Event weighting by cross section: " << sweight.Data() << endl;
1091 cout << " *** Beam particle 3-momentum (GeV/c): px=" << fBeam.GetX(1,"car") << " py=" << fBeam.GetX(2,"car") << " pz=" << fBeam.GetX(3,"car") << endl;
1092 cout << " *** Target particle 3-momentum (GeV/c): px=" << fTarget.GetX(1,"car") << " py=" << fTarget.GetX(2,"car") << " pz=" << fTarget.GetX(3,"car") << endl;
1093 if (fFrame!="cms") cout << " *** Total CMS energy: " << ecms << " GeV" << endl;
1094 if (fFrame=="free" && fWin>0) cout << " *** Forced CMS processing. Cross sections initialised for a CMS energy of " << fWin << " GeV" << endl;
1095 if (fOutFile) cout << " *** NcEvent data structures will be written to output file: " << fOutFile->GetName() << endl;
1096 cout << endl;
1097 cout << endl;
1098
1099 return ier;
1100}
1101
1102Int_t NcCollider::Init(TString frame,Int_t zp,Int_t ap,Int_t zt,Int_t at,Float_t win,Nc3Vector* pbeam,Nc3Vector* ptarget,Int_t wxsec)
1103{
1176
1177 Int_t ier=0;
1178 if (frame!="cms" && frame!="fixt" && frame!="free") ier=1;
1179 if (frame!="free" && win<=0) ier=1;
1180 if (frame=="free" && (!pbeam || !ptarget)) ier=1;
1181 if (ier)
1182 {
1183 cout << " *NcCollider::Init* Nucleus-Nucleus generator initialisation ==> Inconsistent input." << endl;
1184 return ier;
1185 }
1186
1187 if (!fUserctrl) // Optimisation of some MC parameters
1188 {
1189 SetPARP(2,0); // No minimum CMS energy required at initialisation
1190 SetMSTP(33,2); // Activate K factor. Separate for ordinary and color annih. graphs
1191 SetPMAS(25,1,125.09); // Setting the Higgs mass
1192 }
1193
1194 fWxsec=0;
1195 if (frame=="free")
1196 {
1197 SetMSTP(171,1); // Enable variation of beam and/or target momenta
1198 SetMSTP(82,1); // Select abrupt pt_min cut-off (see Pythia parameter PARP(81)) for multiple interactions
1199 if (wxsec)
1200 {
1201 SetMSTP(172,2); // Weight event production by cross section
1202 fWxsec=1;
1203 }
1204 else
1205 {
1206 SetMSTP(172,1); // Just always generate an event at the requested energy
1207 }
1208 }
1209 else
1210 {
1211 SetMSTP(171,0); // Disable variation of beam and/or target momenta
1212 }
1213
1214 if (fElastic) SetMSEL(2); // Include low-Pt, elastic and diffractive events
1215
1216 if (!fMultiple) // Disable multiple interactions
1217 {
1218 SetMSTP(81,0);
1219 SetMSTP(82,1);
1220 }
1221
1222 fEventnum=0;
1223 fNucl=1;
1224 fFrame=frame;
1225 fWin=-1;
1226 if (win>0) fWin=win;
1227 fZproj=0;
1228 fAproj=0;
1229 fZtarg=0;
1230 fAtarg=0;
1231 fFracpp=0;
1232 fFracnp=0;
1233 fFracpn=0;
1234 fFracnn=0;
1235
1236 if (ap<1 || at<1 || zp>ap || zt>at)
1237 {
1238 cout << endl;
1239 cout << " *NcCollider::Init* Invalid input value(s). Zproj = " << zp
1240 << " Aproj = " << ap << " Ztarg = " << zt << " Atarg = " << at << endl;
1241 return 1;
1242 }
1243
1244 fZproj=zp;
1245 fAproj=ap;
1246 fZtarg=zt;
1247 fAtarg=at;
1248
1249 TString beam="(Z=";
1250 beam+=zp;
1251 beam+=",A=";
1252 beam+=ap;
1253 beam+=")";
1254 fBeam.SetNameTitle(beam.Data(),"Beam");
1255
1256 TString target="(Z=";
1257 target+=zt;
1258 target+=",A=";
1259 target+=at;
1260 target+=")";
1261 fTarget.SetNameTitle(target.Data(),"Target");
1262
1263 Float_t mnuc=(0.9382720+0.9395654)/2.;
1264 fBeam.SetMass(mnuc);
1265 fTarget.SetMass(mnuc);
1266
1267 if (fFrame=="cms")
1268 {
1269 Float_t pcms=sqrt((win*win/4.)-mnuc*mnuc);
1270 fBeam.Set3Vector(0,0,pcms,"car");
1271 fTarget.Set3Vector(0,0,-pcms,"car");
1272 }
1273 if (fFrame=="fixt")
1274 {
1275 fBeam.Set3Vector(0,0,win,"car");
1276 fTarget.Set3Vector(0,0,0,"car");
1277 }
1278 if (fFrame=="free")
1279 {
1280 SetMomentum(*pbeam,1);
1281 SetMomentum(*ptarget,2);
1282 }
1283
1284 TString sweight="Yes";
1285 if (!wxsec) sweight="No";
1286
1287 Double_t s=fBeam.GetInvariant()+fTarget.GetInvariant()+2.*fBeam.Dot(fTarget);
1288 Double_t ecms=sqrt(s);
1289
1290 // Set CM energy according to "pbeam" and "ptarget" for forced CMS event generation
1291 if (fFrame=="free" && !win) fWin=ecms;
1292
1293 cout << endl;
1294 cout << endl;
1295 cout << " ******************************************************************" << endl;
1296 cout << " *** NcCollider::Init Nucleus-Nucleus generator initialisation ***" << endl;
1297 cout << " ******************************************************************" << endl;
1298 cout << " *** Beam nucleus: " << fBeam.GetName() << " Target nucleus: " << fTarget.GetName() << " Frame: " << fFrame.Data() << endl;
1299 if (fFrame=="cms") cout << " *** Total CMS energy per nucleon-nucleon collision: " << win << " GeV" << endl;
1300 if (fFrame=="fixt") cout << " *** Beam momentum: " << win << " GeV/c per nucleon" << endl;
1301 if (fFrame=="free") cout << " *** Event weighting by cross section: " << sweight.Data() << endl;
1302 cout << " *** Beam 3-momentum in GeV/c per nucleon: px=" << fBeam.GetX(1,"car") << " py=" << fBeam.GetX(2,"car") << " pz=" << fBeam.GetX(3,"car") << endl;
1303 cout << " *** Target 3-momentum in GeV/c per nucleon: px=" << fTarget.GetX(1,"car") << " py=" << fTarget.GetX(2,"car") << " pz=" << fTarget.GetX(3,"car") << endl;
1304 if (fFrame!="cms") cout << " *** Total CMS energy per nucleon-nucleon collision: " << ecms << " GeV" << endl;
1305 if (fFrame=="free" && fWin>0) cout << " *** Forced CMS processing. Cross sections initialised for a nucleon-nucleon CMS energy of " << fWin << " GeV" << endl;
1306 if (fOutFile) cout << " *** Event data will be written to output file: " << fOutFile->GetName() << endl;
1307 cout << endl;
1308 cout << endl;
1309
1310 return ier;
1311}
1312
1313void NcCollider::GetFractions(Float_t zp,Float_t ap,Float_t zt,Float_t at)
1314{
1321
1322 if (zp<0) zp=0;
1323 if (zt<0) zt=0;
1324
1325 fFracpp=0;
1326 fFracnp=0;
1327 fFracpn=0;
1328 fFracnn=0;
1329
1330 if (ap>0 && at>0)
1331 {
1332 fFracpp=(zp/ap)*(zt/at);
1333 fFracnp=(1.-zp/ap)*(zt/at);
1334 fFracpn=(zp/ap)*(1.-zt/at);
1335 fFracnn=(1.-zp/ap)*(1.-zt/at);
1336 }
1337}
1338
1340{
1353
1354 if (mode!=1 && mode!=2)
1355 {
1356 cout << " *NcCollider::SetMomentum* Invalid input value. mode = " << mode << endl;
1357 return;
1358 }
1359
1360 if (fFrame!="free")
1361 {
1362 cout << " *NcCollider::SetMomentum* Not valid for frame = " << fFrame.Data() << endl;
1363 return;
1364 }
1365
1366 if (mode==1) fBeam.Set3Momentum(p);
1367 if (mode==2) fTarget.Set3Momentum(p);
1368
1369
1370 if (fWin<0) // Update the internal Pythia beam c.q. target momentum
1371 {
1372 SetP(mode,1,p.GetX(1,"car"));
1373 SetP(mode,2,p.GetX(2,"car"));
1374 SetP(mode,3,p.GetX(3,"car"));
1375 }
1376 else // Update the corresponding Ecms scaling factor in case of forced CMS processing
1377 {
1378 Double_t s=fBeam.GetInvariant()+fTarget.GetInvariant()+2.*fBeam.Dot(fTarget);
1379 Double_t ecms=sqrt(s);
1380 SetPARP(171,ecms/fWin);
1381 }
1382}
1383
1384Int_t NcCollider::MakeEvent(Int_t npt,Int_t mlist,Int_t medit)
1385{
1425
1426 fEventnum++;
1427
1428 Int_t specmode=1;
1429 if (npt<0)
1430 {
1431 specmode=0;
1432 npt=abs(npt);
1433 }
1434
1435 // Counters for the various (proj,targ) combinations : p+p, n+p, p+n and n+n
1436 Int_t ncols[4]={0,0,0,0};
1437
1438 Int_t zp=0;
1439 Int_t ap=0;
1440 Int_t zt=0;
1441 Int_t at=0;
1442
1443 Int_t ncol=1;
1444
1445 if (fNucl)
1446 {
1447 if (npt<2 || npt>(fAproj+fAtarg))
1448 {
1449 cout << " *NcCollider::MakeEvent* Invalid input value. npt = " << npt
1450 << " Aproj = " << fAproj << " Atarg = " << fAtarg << endl;
1451 return -1;
1452 }
1453
1454 // Determine the number of nucleon-nucleon collisions
1455 ncol=npt/2;
1456 if (npt%2 && fRan.Uniform()>0.5) ncol+=1;
1457
1458 // Determine the number of the various types of N+N interactions
1459 zp=fZproj;
1460 ap=fAproj;
1461 zt=fZtarg;
1462 at=fAtarg;
1463 Int_t maxa=2; // Indicator whether proj (1) or target (2) has maximal A left
1464 if (ap>at) maxa=1;
1465 Float_t* rans=new Float_t[ncol];
1466 fRan.Uniform(rans,ncol);
1467 Float_t rndm=0;
1468 for (Int_t i=0; i<ncol; i++)
1469 {
1470 GetFractions(zp,ap,zt,at);
1471 rndm=rans[i];
1472 if (rndm<=fFracpp) // p+p interaction
1473 {
1474 ncols[0]++;
1475 if (maxa==2)
1476 {
1477 at--;
1478 zt--;
1479 }
1480 else
1481 {
1482 ap--;
1483 zp--;
1484 }
1485 }
1486 if (rndm>fFracpp && rndm<=(fFracpp+fFracnp)) // n+p interaction
1487 {
1488 ncols[1]++;
1489 if (maxa==2)
1490 {
1491 at--;
1492 zt--;
1493 }
1494 else
1495 {
1496 ap--;
1497 }
1498 }
1499 if (rndm>(fFracpp+fFracnp) && rndm<=(fFracpp+fFracnp+fFracpn)) // p+n interaction
1500 {
1501 ncols[2]++;
1502 if (maxa==2)
1503 {
1504 at--;
1505 }
1506 else
1507 {
1508 ap--;
1509 zp--;
1510 }
1511 }
1512 if (rndm>(fFracpp+fFracnp+fFracpn)) // n+n interaction
1513 {
1514 ncols[3]++;
1515 if (maxa==2)
1516 {
1517 at--;
1518 }
1519 else
1520 {
1521 ap--;
1522 }
1523 }
1524 }
1525 delete [] rans;
1526 }
1527
1528 TString sweight="Yes";
1529 if (!fWxsec) sweight="No";
1530
1531 Double_t s=fBeam.GetInvariant()+fTarget.GetInvariant()+2.*fBeam.Dot(fTarget);
1532 Double_t ecms=sqrt(s);
1533
1534 if (fPrintfreq)
1535 {
1536 if (!(fEventnum%fPrintfreq))
1537 {
1538 cout << " *NcCollider::MakeEvent* Run : " << fRunnum << " Event : " << fEventnum << endl;
1539 if (fFrame=="free") cout << " Event weighting by cross section: " << sweight.Data() << endl;
1540
1541 if (fNucl)
1542 {
1543 cout << " Beam nucleus: " << fBeam.GetName() << " Target nucleus: " << fTarget.GetName() << " Frame: " << fFrame.Data() << endl;
1544 cout << " Beam 3-momentum in GeV/c per nucleon: px=" << fBeam.GetX(1,"car") << " py=" << fBeam.GetX(2,"car") << " pz=" << fBeam.GetX(3,"car") << endl;
1545 cout << " Target 3-momentum in GeV/c per nucleon: px=" << fTarget.GetX(1,"car") << " py=" << fTarget.GetX(2,"car") << " pz=" << fTarget.GetX(3,"car") << endl;
1546 cout << " Total CMS energy per nucleon-nucleon collision: " << ecms << " GeV" << endl;
1547 cout << " # participants and collisions: npart=" << npt << " ncol=" << ncol
1548 << " ncolpp=" << ncols[0] << " ncolnp=" << ncols[1] << " ncolpn=" << ncols[2] << " ncolnn=" << ncols[3] << endl;
1549 }
1550 else
1551 {
1552 cout << " Beam particle: " << fBeam.GetName() << " Target particle: " << fTarget.GetName() << " Frame: " << fFrame.Data() << endl;
1553 cout << " Beam particle 3-momentum (GeV/c): px=" << fBeam.GetX(1,"car") << " py=" << fBeam.GetX(2,"car") << " pz=" << fBeam.GetX(3,"car") << endl;
1554 cout << " Target particle 3-momentum (GeV/c): px=" << fTarget.GetX(1,"car") << " py=" << fTarget.GetX(2,"car") << " pz=" << fTarget.GetX(3,"car") << endl;
1555 cout << " Total CMS energy: " << ecms << " GeV" << endl;
1556 }
1557
1558 if (ecms<fEcmsmin) printf(" *** No event generated. Ecms is below the minimal requirement of : %-g GeV. \n \n",fEcmsmin);
1559 }
1560 }
1561
1562 if (ecms<fEcmsmin) return 0;
1563
1564 if (!fEvent)
1565 {
1566 fEvent=new NcEvent();
1567 fEvent->SetOwner();
1568 fEvent->SetName(GetName());
1569 fEvent->SetTitle(GetTitle());
1570 }
1571 else
1572 {
1573 fEvent->Reset();
1574 }
1575 fEvent->SetRunNumber(fRunnum);
1576 fEvent->SetEventNumber(fEventnum);
1577
1578 // Set event title text if not provided by the user
1579 TString title=GetTitle();
1580 if (title=="")
1581 {
1582 title=fBeam.GetName();
1583 title+=" on ";
1584 title+=fTarget.GetName();
1585 title+=" collision";
1586 fEvent->SetTitle(title.Data());
1587 }
1588
1589 NcTrack t;
1590 Nc3Vector p;
1591 NcPosition r,rx;
1592 Float_t v[3];
1593 NcVertex vert;
1594 Nc3Vector pproj,ptarg;
1595 Nc3Vector v3;
1596 Nc4Vector v4;
1597 Double_t ct=0;
1598
1599 // The Lorentz boost for the case of forced CMS processing
1600 Nc4Vector ptot;
1601 ptot.SetInvariant(s);
1602 p=fBeam.Get3Momentum();
1603 v3=fTarget.Get3Momentum();
1604 p+=v3;
1605 ptot.Set3Vector(p);
1606 fLorbo.Set4Momentum(ptot);
1607
1608 if (fVertexmode)
1609 {
1610 // Make sure the primary vertex gets correct location and Id=1
1611 v[0]=0;
1612 v[1]=0;
1613 v[2]=0;
1614 r.SetPosition(v,"car");
1615 v[0]=fResolution;
1616 v[1]=fResolution;
1617 v[2]=fResolution;
1618 r.SetPositionErrors(v,"car");
1619
1620 vert.SetId(1);
1621 vert.SetTrackCopy(0);
1622 vert.SetVertexCopy(0);
1623 vert.SetPosition(r);
1624 fEvent->AddVertex(vert,0);
1625 }
1626
1627 Int_t kf=0;
1628 Float_t charge=0,mass=0;
1629 TString name;
1630
1631 Int_t ntypes=4;
1632
1633 // Singular settings for a normal Pythia elementary particle interation
1634 if (!fNucl)
1635 {
1636 ntypes=1;
1637 ncols[0]=1;
1638 }
1639
1640 // Generate all the various collisions
1641 fSelect=0; // Flag to indicate whether the total event is selected or not
1642 Int_t select=0; // Flag to indicate whether the sub-event is selected or not
1643 Int_t first=1; // Flag to indicate the first collision process
1644 TString frame=fFrame;
1645 if (fFrame=="free")
1646 {
1647 frame="3mom"; // Use the Pythia convention for the frame name
1648 if (fWin>0) frame="cms"; // Forced event generation in the CMS
1649 }
1650 pproj=fBeam.Get3Momentum();
1651 ptarg=fTarget.Get3Momentum();
1652 Int_t npart=0,ntk=0;
1653 Double_t dist=0;
1654 for (Int_t itype=0; itype<ntypes; itype++)
1655 {
1656 if (fNucl)
1657 {
1658 if (fFrame=="free")
1659 {
1660 SetMomentum(pproj,1);
1661 SetMomentum(ptarg,2);
1662 }
1663
1664 if (itype==0 && ncols[itype]) Initialize(frame.Data(),"p","p",fWin);
1665 if (itype==1 && ncols[itype]) Initialize(frame.Data(),"n","p",fWin);
1666 if (itype==2 && ncols[itype]) Initialize(frame.Data(),"p","n",fWin);
1667 if (itype==3 && ncols[itype]) Initialize(frame.Data(),"n","n",fWin);
1668
1669 if (fFrame=="free")
1670 {
1671 SetMomentum(pproj,1);
1672 SetMomentum(ptarg,2);
1673 }
1674 }
1675
1676 for (Int_t jcol=0; jcol<ncols[itype]; jcol++)
1677 {
1678
1679 GenerateEvent();
1680
1681 select=IsSelected();
1682 if (select) fSelect=1;
1683
1684 if (first) // Store generator parameter information in the event structure
1685 {
1686 // Enter generator parameters as a device in the event
1687
1688 NcDevice params;
1689 params.SetNameTitle("NcCollider","NcCollider generator parameters");
1690 params.SetSlotName("Medit",1);
1691 params.SetSlotName("Vertexmode",2);
1692 params.SetSlotName("Resolution",3);
1693 params.SetSlotName("Userctrl",4);
1694 params.SetSlotName("Elastic",5);
1695 params.SetSlotName("Multiple",6);
1696 params.SetSlotName("Wxsec",7);
1697 params.SetSlotName("Ecms",8);
1698
1699 params.SetSignal(medit,1);
1700 params.SetSignal(fVertexmode,2);
1701 params.SetSignal(fResolution,3);
1702 params.SetSignal(fUserctrl,4);
1703 params.SetSignal(fElastic,5);
1704 params.SetSignal(fMultiple,6);
1705 params.SetSignal(fWxsec,7);
1706 params.SetSignal(ecms,8);
1707
1708 // Store projectile and target information in the event structure
1709 if (fNucl)
1710 {
1711 fEvent->SetProjectile(fAproj,fZproj,pproj);
1712 fEvent->SetTarget(fAtarg,fZtarg,ptarg);
1713
1714 params.AddNamedSlot("specmode");
1715 params.AddNamedSlot("Specpmin");
1716 params.AddNamedSlot("npart");
1717 params.AddNamedSlot("ncolpp");
1718 params.AddNamedSlot("ncolnp");
1719 params.AddNamedSlot("ncolpn");
1720 params.AddNamedSlot("ncolnn");
1721
1722 params.SetSignal(specmode,"specmode");
1723 params.SetSignal(fSpecpmin,"Specpmin");
1724 params.SetSignal(npt,"npart");
1725 params.SetSignal(ncols[0],"ncolpp");
1726 params.SetSignal(ncols[1],"ncolnp");
1727 params.SetSignal(ncols[2],"ncolpn");
1728 params.SetSignal(ncols[3],"ncolnn");
1729 }
1730 else
1731 {
1732 kf=GetK(1,2);
1733 fEvent->SetProjectile(0,0,pproj,kf);
1734 kf=GetK(2,2);
1735 fEvent->SetTarget(0,0,ptarg,kf);
1736 }
1737
1738 fEvent->AddDevice(params);
1739
1740 first=0;
1741 }
1742
1743 if (medit >= 0) Pyedit(medit); // Define which particles are to be kept
1744
1745 if (mlist>=0 && select)
1746 {
1747 Pylist(mlist);
1748 cout << endl;
1749 }
1750
1751 npart=GetN();
1752 for (Int_t jpart=1; jpart<=npart; jpart++)
1753 {
1754 kf=GetK(jpart,2);
1755 charge=Pychge(kf)/3.;
1756 mass=GetP(jpart,5);
1757 name=GetPyname(kf);
1758
1759 // 3-momentum in GeV/c
1760 v[0]=GetP(jpart,1);
1761 v[1]=GetP(jpart,2);
1762 v[2]=GetP(jpart,3);
1763 p.SetVector(v,"car");
1764
1765 // Production location in meter.
1766 v[0]=GetV(jpart,1)/1000.;
1767 v[1]=GetV(jpart,2)/1000.;
1768 v[2]=GetV(jpart,3)/1000.;
1769 r.SetPosition(v,"car");
1770
1771 ct=GetV(jpart,4)/1000.;
1772
1773 // Boost the track momentum and vertex location into the user defined frame in case of forced CMS processing
1774 if (fFrame=="free" && fWin>0)
1775 {
1776 // Momentum boost
1777 v4.SetInvariant(mass*mass);
1778 v4.Set3Vector(p);
1779 v4=fLorbo.Inverse(v4);
1780 p=v4.Get3Vector();
1781
1782 // Vertex location boost
1783 v4.SetInvariant(pow(ct,2)-r.Dot(r));
1784 v4.Set3Vector(r);
1785 v4=fLorbo.Inverse(v4);
1786 v3=v4.Get3Vector();
1787 r.SetPosition(v3);
1788 }
1789
1790 ntk++;
1791
1792 t.Reset();
1793 t.SetId(ntk);
1794 t.SetParticleCode(kf);
1795 t.SetName(name.Data());
1796 t.SetCharge(charge);
1797 t.SetMass(mass);
1798 t.Set3Momentum(p);
1799 t.SetBeginPoint(r);
1800
1801 fEvent->AddTrack(t);
1802
1803 // Build the vertex structures if requested
1804 if (fVertexmode)
1805 {
1806 // Check if track belongs within the resolution to an existing vertex
1807 Int_t add=0;
1808 for (Int_t jv=1; jv<=fEvent->GetNvertices(); jv++)
1809 {
1810 NcVertex* vx=fEvent->GetVertex(jv);
1811 if (vx)
1812 {
1813 rx=vx->GetPosition();
1814 dist=rx.GetDistance(r);
1815 if (dist < fResolution)
1816 {
1817 NcTrack* tx=fEvent->GetIdTrack(ntk);
1818 if (tx)
1819 {
1820 vx->AddTrack(tx);
1821 add=1;
1822 }
1823 }
1824 }
1825 if (add) break; // No need to look further for vertex candidates
1826 }
1827
1828 // If track was not close enough to an existing vertex
1829 // a new secondary vertex is created
1830 if (!add && fVertexmode>1)
1831 {
1832 NcTrack* tx=fEvent->GetIdTrack(ntk);
1833 if (tx)
1834 {
1835 v[0]=fResolution;
1836 v[1]=fResolution;
1837 v[2]=fResolution;
1838 r.SetPositionErrors(v,"car");
1839 vert.Reset();
1840 vert.SetTrackCopy(0);
1841 vert.SetVertexCopy(0);
1842 vert.SetId((fEvent->GetNvertices())+1);
1843 vert.SetPosition(r);
1844 vert.AddTrack(tx);
1845 fEvent->AddVertex(vert,0);
1846 }
1847 }
1848 }
1849 } // End of loop over the produced particles for each collision
1850 } // End of loop over number of collisions for each type
1851 } // End of loop over collision types
1852
1853 // Link sec. vertices to primary if requested
1854 // Note that also the connecting tracks are automatically created
1855 if (fVertexmode>2)
1856 {
1857 NcVertex* vp=fEvent->GetIdVertex(1); // Primary vertex
1858 if (vp)
1859 {
1860 for (Int_t i=2; i<=fEvent->GetNvertices(); i++)
1861 {
1862 NcVertex* vx=fEvent->GetVertex(i);
1863 if (vx)
1864 {
1865 if (vx->GetId() != 1) vp->AddVertex(vx);
1866 }
1867 }
1868 }
1869 }
1870
1871 // Include the spectator tracks in the event structure.
1872 if (fNucl && specmode)
1873 {
1874 v[0]=0;
1875 v[1]=0;
1876 v[2]=0;
1877 r.SetPosition(v,"car");
1878
1879 zp=fZproj-(ncols[0]+ncols[2]);
1880 if (zp<0) zp=0;
1881 ap=fAproj-(ncols[0]+ncols[1]+ncols[2]+ncols[3]);
1882 if (ap<0) ap=0;
1883 zt=fZtarg-(ncols[0]+ncols[1]);
1884 if (zt<0) zt=0;
1885 at=fAtarg-(ncols[0]+ncols[1]+ncols[2]+ncols[3]);
1886 if (at<0) at=0;
1887
1888 Int_t nspec=0;
1889
1890 if (pproj.GetNorm() > fSpecpmin)
1891 {
1892 kf=2212; // Projectile spectator protons
1893 charge=Pychge(kf)/3.;
1894 mass=GetPMAS(Pycomp(kf),1);
1895 name=GetPyname(kf);
1896 for (Int_t iprojp=1; iprojp<=zp; iprojp++)
1897 {
1898 nspec++;
1899 t.Reset();
1900 t.SetId(-nspec);
1901 t.SetParticleCode(kf);
1902 t.SetName(name.Data());
1903 t.SetTitle("Projectile spectator proton");
1904 t.SetCharge(charge);
1905 t.SetMass(mass);
1906 t.Set3Momentum(pproj);
1907 t.SetBeginPoint(r);
1908
1909 fEvent->AddTrack(t);
1910 }
1911
1912 kf=2112; // Projectile spectator neutrons
1913 charge=Pychge(kf)/3.;
1914 mass=GetPMAS(Pycomp(kf),1);
1915 name=GetPyname(kf);
1916 for (Int_t iprojn=1; iprojn<=(ap-zp); iprojn++)
1917 {
1918 nspec++;
1919 t.Reset();
1920 t.SetId(-nspec);
1921 t.SetParticleCode(kf);
1922 t.SetName(name.Data());
1923 t.SetTitle("Projectile spectator neutron");
1924 t.SetCharge(charge);
1925 t.SetMass(mass);
1926 t.Set3Momentum(pproj);
1927 t.SetBeginPoint(r);
1928
1929 fEvent->AddTrack(t);
1930 }
1931 }
1932
1933 if (ptarg.GetNorm() > fSpecpmin)
1934 {
1935 kf=2212; // Target spectator protons
1936 charge=Pychge(kf)/3.;
1937 mass=GetPMAS(Pycomp(kf),1);
1938 name=GetPyname(kf);
1939 for (Int_t itargp=1; itargp<=zt; itargp++)
1940 {
1941 nspec++;
1942 t.Reset();
1943 t.SetId(-nspec);
1944 t.SetParticleCode(kf);
1945 t.SetName(name.Data());
1946 t.SetTitle("Target spectator proton");
1947 t.SetCharge(charge);
1948 t.SetMass(mass);
1949 t.Set3Momentum(ptarg);
1950 t.SetBeginPoint(r);
1951
1952 fEvent->AddTrack(t);
1953 }
1954
1955 kf=2112; // Target spectator neutrons
1956 charge=Pychge(kf)/3.;
1957 mass=GetPMAS(Pycomp(kf),1);
1958 name=GetPyname(kf);
1959 for (Int_t itargn=1; itargn<=(at-zt); itargn++)
1960 {
1961 nspec++;
1962 t.Reset();
1963 t.SetId(-nspec);
1964 t.SetParticleCode(kf);
1965 t.SetName(name.Data());
1966 t.SetTitle("Target spectator neutron");
1967 t.SetCharge(charge);
1968 t.SetMass(mass);
1969 t.Set3Momentum(ptarg);
1970 t.SetBeginPoint(r);
1971
1972 fEvent->AddTrack(t);
1973 }
1974 }
1975
1976 // Link the spectator tracks to the primary vertex.
1977 if (fVertexmode)
1978 {
1979 NcVertex* vp=fEvent->GetIdVertex(1);
1980 if (vp)
1981 {
1982 for (Int_t ispec=1; ispec<=nspec; ispec++)
1983 {
1984 NcTrack* tx=fEvent->GetIdTrack(-ispec);
1985 if (tx) vp->AddTrack(tx);
1986 }
1987 }
1988 }
1989 }
1990
1991 if (fPrintfreq)
1992 {
1993 if (!(fEventnum%fPrintfreq) && (mlist || fEvent))
1994 {
1995 if (fEvent) printf(" Number of tracks in the event structure : %-i \n",fEvent->GetNtracks());
1996 printf("\n"); // Create empty output line after the event
1997 }
1998 }
1999
2000 // Record the actual beam and target momenta as user data in the event structure
2001 if (fSelect)
2002 {
2003 fEvtuser.SetSignal(fBeam.GetX(1,"sph"),"BeamP");
2004 fEvtuser.SetSignal(fBeam.GetX(2,"sph","rad"),"BeamTheta");
2005 fEvtuser.SetSignal(fBeam.GetX(3,"sph","rad"),"BeamPhi");
2006 fEvtuser.SetSignal(fTarget.GetX(1,"sph"),"TargetP");
2007 fEvtuser.SetSignal(fTarget.GetX(2,"sph","rad"),"TargetTheta");
2008 fEvtuser.SetSignal(fTarget.GetX(3,"sph","rad"),"TargetPhi");
2009 fEvent->SetUserData(fEvtuser);
2010 }
2011
2012 if (fOutTree && fSelect) fOutTree->Fill();
2013
2014 if (fJob && fSelect) fJob->ProcessObject(fEvent);
2015
2016 return fSelect;
2017}
2018
2019NcEvent* NcCollider::GetEvent(Int_t select) const
2020{
2033
2034 if (!select || fSelect)
2035 {
2036 return fEvent;
2037 }
2038 else
2039 {
2040 return 0;
2041 }
2042}
2043
2045{
2051
2052 if (!fOutFile && !fMktree) return;
2053
2054 // Deleting the NcEvent output file also deletes the corresponding Tree
2055 if (fOutFile)
2056 {
2057 if (fOutFile->IsOpen())
2058 {
2059 fOutFile->Write();
2060 fOutFile->Close();
2061 delete fOutFile;
2062 fOutFile=0;
2063 fOutTree=0;
2064 }
2065 }
2066
2067 if (fMktree)
2068 {
2069 fMktree->CloseTree();
2070 delete fMktree;
2071 fMktree=0;
2072 }
2073
2074 printf(" *%-s::EndRun* Output file(s) correctly written and closed. \n",ClassName());
2075}
2076
2077void NcCollider::SetStable(Int_t id,Int_t mode,Int_t cls)
2078{
2113
2114 if (mode==0 || mode==1)
2115 {
2116 Int_t kc=0;
2117 Int_t decay=1-mode;
2118
2119 // Introduce additional c.q. missing decay channels
2120 Int_t idc=7000; // Start entry point in the decay table for the new decay processes
2121 SetPARJ(64,5e-4); // Reduce the allowed minimal mass difference in decays
2122
2123 // Specification of neutron decay data
2124 Double_t ctau=2.6391e14; // Average ctau in mm
2125 kc=Pycomp(2112); // kc code for (anti)neutrons
2126 SetPMAS(kc,4,ctau); // Set average lifetime via ctau in mm
2127 SetMDCY(kc,2,idc); // Set the idc entry point for this particle decay
2128 SetMDCY(kc,3,1); // Number of decay modes
2129 SetMDME(idc,1,1); // Activate this decay channel
2130 SetMDME(idc,2,0); // Use a normal decay matrix element for this decay channel
2131 SetBRAT(idc,1); // Set branching ratio for this decay channel
2132 SetKFDP(idc,1,2212); // The "p" decay product
2133 SetKFDP(idc,2,11); // The "e-" decay product
2134 SetKFDP(idc,3,-12); // The "nue_bar" decay product
2135
2136 if (!id) // Settings for a class of particles
2137 {
2138 if (cls>0 && cls<6)
2139 {
2140 for (Int_t i=1; i<1000; i++)
2141 {
2142 kc=Pycomp(i);
2143 if (kc>0)
2144 {
2145 if (cls==1 && i<10) SetMDCY(kc,1,decay);
2146 if (cls==2 && i>10 && i<20) SetMDCY(kc,1,decay);
2147 if (cls==3 && i>20 && i<26) SetMDCY(kc,1,decay);
2148 if (cls==4 && i>100 && i<1000) SetMDCY(kc,1,decay);
2149 if (cls==5 && i>1000) SetMDCY(kc,1,decay);
2150 }
2151 }
2152 // Special entries for Psi' and Ypsilon'
2153 if (cls==4)
2154 {
2155 kc=Pycomp(100443);
2156 if (kc>0) SetMDCY(kc,1,decay);
2157 kc=Pycomp(100553);
2158 if (kc>0) SetMDCY(kc,1,decay);
2159 }
2160 }
2161 else
2162 {
2163 cout << " *NcCollider::SetStable* Invalid parameter. cls = " << cls << endl;
2164 }
2165 }
2166 else // Settings for individual particles
2167 {
2168 kc=Pycomp(id);
2169 if (kc>0)
2170 {
2171 SetMDCY(kc,1,decay);
2172 }
2173 else
2174 {
2175 cout << " *NcCollider::SetStable* Unknown particle code. id = " << id << endl;
2176 }
2177 }
2178 }
2179 else
2180 {
2181 cout << " *NcCollider::SetStable* Invalid parameter. mode = " << mode << endl;
2182 }
2183}
2184
2186{
2209
2210 if (!id)
2211 {
2212 if (fSelections)
2213 {
2214 delete fSelections;
2215 fSelections=0;
2216 }
2217 }
2218 else
2219 {
2220 Int_t kc=Pycomp(id);
2221 if (!fSelections)
2222 {
2223 fSelections=new TArrayI(1);
2224 fSelections->AddAt(kc,0);
2225 }
2226 else
2227 {
2228 Int_t exist=0;
2229 Int_t size=fSelections->GetSize();
2230 for (Int_t i=0; i<size; i++)
2231 {
2232 if (kc==fSelections->At(i))
2233 {
2234 exist=1;
2235 break;
2236 }
2237 }
2238
2239 if (!exist)
2240 {
2241 fSelections->Set(size+1);
2242 fSelections->AddAt(kc,size);
2243 }
2244 }
2245 }
2246}
2247
2249{
2257
2258 return fSelect;
2259}
2260
2262{
2275
2276 if (GetMSTI(61)) return 0;
2277
2278 if (!fSelections) return 1;
2279
2280 Int_t nsel=fSelections->GetSize();
2281 Int_t npart=GetN();
2282 Int_t kf,kc;
2283
2284 Int_t select=0;
2285 for (Int_t jpart=1; jpart<=npart; jpart++)
2286 {
2287 kf=GetK(jpart,2);
2288 kc=Pycomp(kf);
2289 for (Int_t i=0; i<nsel; i++)
2290 {
2291 if (kc==fSelections->At(i))
2292 {
2293 select=1;
2294 break;
2295 }
2296 }
2297 if (select) break;
2298 }
2299 return select;
2300}
2301
2303{
2316
2317 fSpecpmin=pmin;
2318}
2319
2321{
2327
2328 return fSpecpmin;
2329}
2330
2331TString NcCollider::GetPyname(Int_t kf)
2332{
2344
2345 char name[16];
2346 TString sname;
2347 Pyname(kf,name);
2348 sname=name[0];
2349 for (Int_t i=1; i<16; i++)
2350 {
2351 if (name[i]==' ') break;
2352 sname=sname+name[i];
2353 }
2354 return sname;
2355}
2356
2357void NcCollider::SetJetProtonSpectrum(Double_t pmin,Double_t pmax,TF1* fspec,TH1* hspec,Int_t mode)
2358{
2392
2393 gROOT->cd(); // Make sure to work in memory
2394
2395 fJetPpmin=0;
2396 fJetPpmax=0;
2397
2398 if (fJetPspectrum)
2399 {
2400 delete fJetPspectrum;
2401 fJetPspectrum=0;
2402 }
2403
2404 if (pmax<=pmin && pmin<=0)
2405 {
2406 printf(" *%-s::SetJetProtonSpectrum* Inconsistent input pmin=%-g pmax=%-g \n",ClassName(),pmin,pmax);
2407 return;
2408 }
2409
2410 if (pmax>pmin && !fspec && !hspec)
2411 {
2412 printf(" *%-s::SetJetProtonSpectrum* Inconsistent input pmin=%-g pmax=%-g fspec=0 hspec=0 \n",ClassName(),pmin,pmax);
2413 return;
2414 }
2415
2416 fJetPpmin=pmin;
2417 fJetPpmax=pmax;
2418 if (pmax<=pmin) fJetPpmax=pmin;
2419 fJetPscale=0;
2420
2421 // Momentum distribution specified by a histogram
2422 if (hspec)
2423 {
2424 fJetPscale=mode;
2425 if (mode==1)
2426 {
2427 pmin=log10(pmin);
2428 pmax=log10(pmax);
2429 }
2430 if (mode==2)
2431 {
2432 pmin=log(pmin);
2433 pmax=log(pmax);
2434 }
2435
2436 if (!fspec) // Histogram contains N vs. p distribution
2437 {
2438 fJetPspectrum=(TH1*)hspec->Clone();
2439 }
2440 else // Histogram contains dN/dp distribution scaled by "fspec"
2441 {
2442 TH1F hpbeam=fLab.GetCountsHistogram(*hspec,mode,"",fspec);
2443 fJetPspectrum=(TH1*)hpbeam.Clone();
2444 fJetPspectrum->SetName("JetProton");
2445 }
2446
2447 Int_t nbins=fJetPspectrum->GetNbinsX();
2448 Int_t ibinlow=fJetPspectrum->FindFixBin(pmin);
2449 Int_t ibinup=fJetPspectrum->FindFixBin(pmax);
2450 // Only keep the histogram contents for the momentum range [pmin,pmax]
2451 for (Int_t i=1; i<=nbins; i++)
2452 {
2453 if (i<ibinlow || i>ibinup) fJetPspectrum->SetBinContent(i,0);
2454 }
2455 }
2456
2457 // dN/dp spectrum specified by a function
2458 if (fspec && !hspec && pmax>pmin)
2459 {
2460 fJetPscale=mode;
2461 TString title="Jet proton (beam) dN/dp=";
2462 title+=fspec->GetExpFormula("p");
2463 title.ReplaceAll("x","p");
2464 title+=" spectrum";
2465 if (mode==0) title+=";Momentum [GeV/c];Counts";
2466 if (mode==1)
2467 {
2468 title+=";^{10}Log(Momentum) [GeV/c];Counts";
2469 pmin=log10(pmin);
2470 pmax=log10(pmax);
2471 }
2472 if (mode==2)
2473 {
2474 title+=";Ln(Momentum) [GeV/c];Counts";
2475 pmin=log(pmin);
2476 pmax=log(pmax);
2477 }
2478 TH1F hpbeam=fLab.GetCountsHistogram(*fspec,1000,pmin,pmax,mode);
2479 fJetPspectrum=(TH1*)hpbeam.Clone();
2480 fJetPspectrum->SetTitle(title);
2481 fJetPspectrum->SetName("JetProton");
2482 }
2483}
2484
2485void NcCollider::SetJetGammaSpectrum(Double_t pmin,Double_t pmax,TF1* fspec,TH1* hspec,Int_t mode)
2486{
2520
2521 gROOT->cd(); // Make sure to work in memory
2522
2523 fJetGpmin=0;
2524 fJetGpmax=0;
2525
2526 if (fJetGspectrum)
2527 {
2528 delete fJetGspectrum;
2529 fJetGspectrum=0;
2530 }
2531
2532 if (pmax<=pmin && pmin<=0)
2533 {
2534 printf(" *%-s::SetJetGammaSpectrum* Inconsistent input pmin=%-g pmax=%-g \n",ClassName(),pmin,pmax);
2535 return;
2536 }
2537
2538 if (pmax>pmin && !fspec && !hspec)
2539 {
2540 printf(" *%-s::SetJetGammaSpectrum* Inconsistent input pmin=%-g pmax=%-g fspec=0 hspec=0 \n",ClassName(),pmin,pmax);
2541 return;
2542 }
2543
2544 fJetGpmin=pmin;
2545 fJetGpmax=pmax;
2546 if (pmax<=pmin) fJetGpmax=pmin;
2547 fJetGscale=0;
2548
2549 // Momentum distribution specified by a histogram
2550 if (hspec)
2551 {
2552 fJetGscale=mode;
2553 if (mode==1)
2554 {
2555 pmin=log10(pmin);
2556 pmax=log10(pmax);
2557 }
2558 if (mode==2)
2559 {
2560 pmin=log(pmin);
2561 pmax=log(pmax);
2562 }
2563
2564 if (!fspec) // Histogram contains N vs. p distribution
2565 {
2566 fJetGspectrum=(TH1*)hspec->Clone();
2567 }
2568 else // Histogram contains dN/dp distribution scaled by "fspec"
2569 {
2570 TH1F hptarget=fLab.GetCountsHistogram(*hspec,mode,"",fspec);
2571 fJetGspectrum=(TH1*)hptarget.Clone();
2572 fJetGspectrum->SetName("JetGamma");
2573 }
2574
2575 Int_t nbins=fJetGspectrum->GetNbinsX();
2576 Int_t ibinlow=fJetGspectrum->FindFixBin(pmin);
2577 Int_t ibinup=fJetGspectrum->FindFixBin(pmax);
2578 // Only keep the histogram contents for the momentum range [pmin,pmax]
2579 for (Int_t i=1; i<=nbins; i++)
2580 {
2581 if (i<ibinlow || i>ibinup) fJetGspectrum->SetBinContent(i,0);
2582 }
2583 }
2584
2585 // dN/dp spectrum specified by a function
2586 if (fspec && !hspec && pmax>pmin)
2587 {
2588 fJetGscale=mode;
2589 TString title="Jet gamma (target) dN/dp=";
2590 title+=fspec->GetExpFormula("p");
2591 title.ReplaceAll("x","p");
2592 title+=" spectrum";
2593 if (mode==0) title+=";Momentum [GeV/c];Counts";
2594 if (mode==1)
2595 {
2596 title+=";^{10}Log(Momentum) [GeV/c];Counts";
2597 pmin=log10(pmin);
2598 pmax=log10(pmax);
2599 }
2600 if (mode==2)
2601 {
2602 title+=";Ln(Momentum) [GeV/c];Counts";
2603 pmin=log(pmin);
2604 pmax=log(pmax);
2605 }
2606 TH1F hptarget=fLab.GetCountsHistogram(*fspec,1000,pmin,pmax,0);
2607 fJetGspectrum=(TH1*)hptarget.Clone();
2608 fJetGspectrum->SetTitle(title);
2609 fJetGspectrum->SetName("JetGamma");
2610 }
2611}
2612
2613TH1* NcCollider::GetJetProtonSpectrum(Double_t* pmin,Double_t* pmax)
2614{
2626
2627 if (pmin) *pmin=fJetPpmin;
2628 if (pmax) *pmax=fJetPpmax;
2629
2630 return fJetPspectrum;
2631}
2632
2633TH1* NcCollider::GetJetGammaSpectrum(Double_t* pmin,Double_t* pmax)
2634{
2646
2647 if (pmin) *pmin=fJetGpmin;
2648 if (pmax) *pmax=fJetGpmax;
2649
2650 return fJetGspectrum;
2651}
2652
2653void NcCollider::ProcessJet(Double_t np,Double_t gfrac,TString flux,Double_t dthmax,Int_t nlist,Int_t ntrymax,Int_t wxsec,Double_t finit,Int_t full)
2654{
2724
2725 if (fJetPpmax<=0 || fJetGpmax<=0 || np<1 || gfrac<0 || ntrymax<1)
2726 {
2727 printf(" *%-s::ProcessJet* Inconsistent intialisation. \n",ClassName());
2728 printf(" Momentum range for (beam) protons : [%-g,%-g] GeV/c \n",fJetPpmin,fJetPpmax);
2729 printf(" Momentum range for (target) gammas : [%-g,%-g] GeV/c \n",fJetGpmin,fJetGpmax);
2730 printf(" Number of simulated (beam) protons : %-g \n",np);
2731 printf(" Fraction of (beam) protons used for p+gamma interactions : %-g \n",gfrac);
2732 printf(" Maximum number of phase-space trials per event : %-i \n",ntrymax);
2733 return;
2734 }
2735
2736 printf(" *%-s::ProcessJet* Parameter settings for astrophysical Jet simulation \n",ClassName());
2737 printf(" Multiple partonic interactions flag : %-i \n",GetMultiple());
2738 printf(" Low-Pt, Elastic and Diffractive scattering flag : %-i \n",GetElastic());
2739 printf(" Minimal CMS energy for event generation : %-g GeV \n",GetEcmsMin());
2740 printf(" Number of simulated (beam) protons : %-g \n",np);
2741 printf(" Fraction of (beam) protons used for p+gamma interactions : %-g \n",gfrac);
2742 printf(" Maximum number of phase-space trials per event : %-i \n",ntrymax);
2743 printf(" Final particle species that are recorded : %-s \n",flux.Data());
2744 if (!fJetPspectrum)
2745 {
2746 printf(" Proton (beam) momenta will be mono-energetic at %-g GeV/c \n",fJetPpmax);
2747 }
2748 else
2749 {
2750 printf(" Momentum range for (beam) protons : [%-g,%-g] GeV/c \n",fJetPpmin,fJetPpmax);
2751 }
2752 if (!fJetGspectrum)
2753 {
2754 printf(" Gamma (target) momenta will be mono-energetic at %-g GeV/c \n",fJetGpmax);
2755 }
2756 else
2757 {
2758 printf(" Momentum range for (target) gammas : [%-g,%-g] GeV/c \n",fJetGpmin,fJetGpmax);
2759 }
2760
2761 if (fMktree)
2762 {
2763 fMktree->Select("event","jrun");
2764 fMktree->Select("event","jevt");
2765 fMktree->Select("event","user","BeamP");
2766 fMktree->Select("event","user","BeamTheta");
2767 fMktree->Select("event","user","BeamPhi");
2768 fMktree->Select("event","user","TargetP");
2769 fMktree->Select("event","user","TargetTheta");
2770 fMktree->Select("event","user","TargetPhi");
2771
2772 fMktree->Select("track","p");
2773
2774 if (flux.Contains("nu"))
2775 {
2776 fMktree->UseTracks("nu_mu");
2777 fMktree->UseTracks("nu_mubar");
2778 fMktree->UseTracks("nu_e");
2779 fMktree->UseTracks("nu_ebar");
2780 fMktree->UseTracks("nu_tau");
2781 fMktree->UseTracks("nu_taubar");
2782 fMktree->UseTracks("nu",-1,1);
2783 }
2784 if (flux.Contains("gamma")) fMktree->UseTracks("gamma");
2785 if (flux.Contains("neutron"))
2786 {
2787 fMktree->UseTracks("n0");
2788 fMktree->UseTracks("nbar0");
2789 fMktree->UseTracks("p+");
2790 fMktree->UseTracks("pbar-");
2791 }
2792 }
2793
2795 // Generate both p+p (jrun>0) and p+gamma (jrun<0) processes. //
2797
2798 Int_t jrun=0;
2799 Nc3Vector pbeam;
2800 Nc3Vector ptarget;
2801 Nc3Vector pfixed;
2802 pfixed.SetVector(0,0,0,"car");
2803 Int_t ier=0; // Flag to identify initialisation error
2804 Int_t nevents=0; // Number of events to be generated for each process
2805 Int_t igen=0; // Flag to denote successful generation of an event
2806 Int_t ievt=0; // Counter for successfully generated events
2807 Int_t ntry=0; // Counter for phase-space trials per event
2808 Float_t beamp=fJetPpmax;
2809 Float_t targetp=fJetGpmax;
2810
2811 if (fJetPspectrum || fJetGspectrum) wxsec=1;
2812
2813 // Initialisation of the processes
2814 for (Int_t k=0; k<2; k++)
2815 {
2816 pbeam.SetVector(0,0,fJetPpmax,"car");
2817 ptarget.SetVector(0,0,-fJetGpmax,"car");
2818
2819 if (!k) // p+p process
2820 {
2821 nevents=(1.-gfrac)*np;
2822 jrun=1;
2823 ier=Init("free","p","p",0,&pbeam,&pfixed,wxsec,finit);
2824 }
2825 else // p+gamma process
2826 {
2827 nevents=gfrac*np;
2828 jrun=-1;
2829 ier=Init("free","p","gamma",0,&pbeam,&ptarget,wxsec,finit);
2830 }
2831
2832 if (ier) return;
2833
2834 SetRunNumber(jrun);
2835
2836 // Define several particles as (un)stable according to selected analysis mode
2837 SetStable(0,1,4); // Declare all mesons as stable
2838 if (flux.Contains("nu") || flux.Contains("gamma")) SetStable(0,0,4); // Declare all mesons as unstable
2839 if (!(flux.Contains("gamma"))) SetStable(111,1); // Declare pi0 as stable
2840 if (!(flux.Contains("nu"))) SetStable(211,1); // Declare pi+ and pi- as stable
2841 if (flux.Contains("nu")) SetStable(13,0); // Declare mu+ and mu- as unstable
2842 if (flux.Contains("nu") && !(flux.Contains("neutron"))) SetStable(2112,0); // Declare n and nbar as unstable
2843
2844 // Generation of the events for this process
2845 ievt=0;
2846 ntry=0;
2847 while (ievt<nevents && ntry<ntrymax)
2848 {
2849 // Pick a proton momentum from the beam momentum distribution
2850 if (fJetPspectrum) beamp=fJetPspectrum->GetRandom();
2851 // Convert to linear scale momentum value
2852 if (fJetPscale==1) beamp=pow(10,beamp);
2853 if (fJetPscale==2) beamp=exp(beamp);
2854 pbeam.SetVector(0,0,beamp,"car");
2855 SetMomentum(pbeam,1);
2856
2857 // Pick a photon momentum from the target momentum distribution
2858 if (fJetGspectrum) targetp=fJetGspectrum->GetRandom();
2859 // Convert to linear scale momentum value
2860 if (fJetGscale==1) targetp=pow(10,targetp);
2861 if (fJetGscale==2) targetp=exp(targetp);
2862 ptarget.SetVector(0,0,-targetp,"car");
2863 SetMomentum(ptarget,2);
2864
2865 // Randomisation of the beam or target direction
2866 if (dthmax>0)
2867 {
2868 fLab.RandomPosition(pbeam,0,dthmax,0,360);
2869 SetMomentum(pbeam,1);
2870 }
2871 if (dthmax<0)
2872 {
2873 fLab.RandomPosition(ptarget,180+dthmax,180,0,360);
2874 SetMomentum(ptarget,2);
2875 }
2876
2877 // Fixed target for p+p events
2878 if (!k) SetMomentum(pfixed,2);
2879
2880 if (nlist && ievt<nlist) // Produce Pythia listing for the first "nlist" events of each sample
2881 {
2882 if (!full)
2883 {
2884 igen=MakeEvent(0,1);
2885 }
2886 else
2887 {
2888 igen=MakeEvent(0,1,-1);
2889 }
2890 }
2891 else // No Pythia event listing
2892 {
2893 igen=MakeEvent();
2894 }
2895
2896 if (igen<0) break; // Error
2897 if (!igen) // Event did not pass selection
2898 {
2899 ntry++;
2900 continue;
2901 }
2902
2903 ievt++;
2904 ntry=0;
2905 } // End of loop over the events for this process
2906
2907 // Printout Pythia statistics for this event sample
2908 Pystat(1);
2909 } // End of loop over the processes
2910
2911 EndRun();
2912}
2913
ClassImp(NcCollider)
Handling of 3-vectors in various reference frames.
Definition Nc3Vector.h:15
Double_t GetX(Int_t i, TString f, TString u="rad")
void SetVector(Double_t *v, TString f, TString u="rad")
virtual void Load(Nc3Vector &q)
Double_t Dot(Nc3Vector &q)
Double_t GetNorm()
Handling of Lorentz 4-vectors in various reference frames.
Definition Nc4Vector.h:14
void SetInvariant(Double_t v2, Double_t dv2=0)
void Set3Vector(Nc3Vector &v)
Nc3Vector Get3Vector() const
void AddNamedSlot(TString s)
void SetSlotName(TString s, Int_t j=1)
Pythia based universal (astro)physics event generator.
Definition NcCollider.h:21
void SetRunNumber(Int_t run)
Int_t Init(TString frame, TString beam, TString target, Float_t win, Nc3Vector *pbeam=0, Nc3Vector *ptarget=0, Int_t wxsec=1, Double_t fact=0)
Int_t fPrintfreq
Definition NcCollider.h:69
void SetElastic(Int_t flag)
Float_t fSpecpmin
Definition NcCollider.h:85
Double_t fJetGpmax
Definition NcCollider.h:107
void SetUserControl(Int_t flag)
Int_t fZproj
Definition NcCollider.h:75
virtual ~NcCollider()
NcRandom fRan
Definition NcCollider.h:83
TString fFrame
Definition NcCollider.h:70
void SetEcmsMin(Double_t ecms)
Double_t fJetPpmax
Definition NcCollider.h:105
Int_t fWxsec
Definition NcCollider.h:90
Double_t fJetGpmin
Definition NcCollider.h:106
Int_t GetVertexMode() const
Double_t fResolution
Definition NcCollider.h:66
void SetSpectatorPmin(Float_t pmin)
Double_t GetEcmsMin() const
NcEvent * GetEvent(Int_t select=0) const
Int_t GetSelectionFlag() const
void SetVertexMode(Int_t mode)
void SetMomentum(Nc3Vector &p, Int_t mode)
Double_t fEcmsmin
Definition NcCollider.h:89
NcJob * fJob
Definition NcCollider.h:100
TH1 * fJetPspectrum
Definition NcCollider.h:108
void SetJetGammaSpectrum(Double_t pmin, Double_t pmax=-1, TF1 *fspec=0, TH1 *hspec=0, Int_t mode=0)
void SetStable(Int_t id, Int_t mode=1, Int_t cls=0)
Int_t fUserctrl
Definition NcCollider.h:86
TH1 * GetJetGammaSpectrum(Double_t *pmin=0, Double_t *pmax=0)
Int_t fJetPscale
Definition NcCollider.h:109
Int_t fRunnum
Definition NcCollider.h:67
Float_t fFracnn
Definition NcCollider.h:82
TArrayI * fSelections
Definition NcCollider.h:96
Int_t fAproj
Definition NcCollider.h:76
NcTreeMaker * fMktree
Definition NcCollider.h:99
Double_t GetResolution() const
void SetMultiple(Int_t flag)
NcSignal fEvtuser
Definition NcCollider.h:101
Int_t GetMultiple() const
NcEvent * fEvent
Definition NcCollider.h:84
TTree * fOutTree
Definition NcCollider.h:94
Int_t fElastic
Definition NcCollider.h:87
TH1 * GetJetProtonSpectrum(Double_t *pmin=0, Double_t *pmax=0)
NcAstrolab fLab
Definition NcCollider.h:112
Int_t fAtarg
Definition NcCollider.h:78
Double_t fJetPpmin
Definition NcCollider.h:104
Int_t fMultiple
Definition NcCollider.h:88
Int_t fZtarg
Definition NcCollider.h:77
void SetJetProtonSpectrum(Double_t pmin, Double_t pmax=-1, TF1 *fspec=0, TH1 *hspec=0, Int_t mode=0)
TH1 * fJetGspectrum
Definition NcCollider.h:110
Int_t GetUserControl() const
Float_t GetSpectatorPmin() const
void GetFractions(Float_t zp, Float_t ap, Float_t zt, Float_t at)
Int_t fSelect
Definition NcCollider.h:97
Float_t fFracpn
Definition NcCollider.h:81
Float_t fFracnp
Definition NcCollider.h:80
NcTreeMaker * SetOutputFile(TString fname, Int_t mode=0)
Int_t fEventnum
Definition NcCollider.h:68
Float_t fFracpp
Definition NcCollider.h:79
NcTrack fBeam
Definition NcCollider.h:72
void SetRandomSeed(Int_t iseed)
Int_t IsSelected()
Int_t fJetGscale
Definition NcCollider.h:111
Int_t fNucl
Definition NcCollider.h:74
void SetResolution(Double_t res)
Int_t fVertexmode
Definition NcCollider.h:65
NcBoost fLorbo
Definition NcCollider.h:91
Float_t fWin
Definition NcCollider.h:71
Int_t GetRandomSeed()
void SelectEvent(Int_t id)
Int_t GetRunNumber() const
Float_t GetWin() const
void SetPrintFreq(Int_t n)
NcTrack fTarget
Definition NcCollider.h:73
void ProcessJet(Double_t np, Double_t gfrac, TString flux, Double_t dthmax=0, Int_t nlist=1, Int_t ntrymax=1000, Int_t wxsec=0, Double_t finit=0, Int_t full=0)
TString GetPyname(Int_t kf)
TFile * fOutFile
Definition NcCollider.h:93
Int_t GetPrintFreq() const
Int_t MakeEvent(Int_t npt=0, Int_t mlist=-1, Int_t medit=1)
Int_t GetElastic() const
Signal (Hit) handling of a generic device.
Definition NcDevice.h:14
Creation and investigation of an NCFS generic event structure.
Definition NcEvent.h:15
Int_t GetId() const
Definition NcJet.cxx:1470
void SetId(Int_t id)
Definition NcJet.cxx:1459
void SetTrackCopy(Int_t j)
Definition NcJet.cxx:1413
void AddTrack(NcTrack &t)
Definition NcJet.cxx:313
Base class for top level job in a task based procedure.
Definition NcJob.h:18
Handling of positions (with timestamps) in various reference frames.
Definition NcPosition.h:18
void GetPosition(Double_t *r, TString f, TString u="rad", Float_t s=-1) const
Double_t GetDistance(NcPosition &p, Float_t scale=-1)
void SetPositionErrors(Double_t *e, TString f, TString u="rad")
void SetPosition(Double_t *r, TString f, TString u="rad")
virtual void SetSignal(Double_t sig, Int_t j=1)
Definition NcSignal.cxx:516
Handling of timestamps for (astro)particle physics research.
Definition NcTimestamp.h:20
Double_t GetMJD(Int_t y, Int_t m, Int_t d, Int_t hh, Int_t mm, Int_t ss, Int_t ns) const
Handling of the attributes of a reconstructed particle track.
Definition NcTrack.h:19
void SetCharge(Float_t q)
Definition NcTrack.cxx:444
void SetBeginPoint(NcPosition &p)
Definition NcTrack.cxx:1423
void SetMass(Double_t m, Double_t dm=0)
Definition NcTrack.cxx:430
void SetParticleCode(Int_t code)
Definition NcTrack.cxx:1856
void Set3Momentum(Nc3Vector &p)
Definition NcTrack.cxx:401
virtual void Reset()
Definition NcTrack.cxx:321
void SetId(Int_t id)
Definition NcTrack.cxx:1772
TTask derived class to generate a plain ROOT tree from NCFS generic event structures.
Definition NcTreeMaker.h:17
Creation and investigation of an NcVertex.
Definition NcVertex.h:19
void SetVertexCopy(Int_t j)
Definition NcVertex.cxx:923
virtual void Reset()
Definition NcVertex.cxx:423
void AddVertex(NcVertex &v, Int_t connect=1)
Definition NcVertex.cxx:568