forked from Shyam-Uniba/Shyam-Uniba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Fun4All_G4_Baseline2_pt.C
1004 lines (852 loc) · 42.1 KB
/
Fun4All_G4_Baseline2_pt.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
================================================================================================================
================================================================================================================
*/
#pragma once
#include "detector_setup.h"
#include <phgenfit/Track.h>
#include <fun4all/Fun4AllDstInputManager.h>
#include <fun4all/Fun4AllDstOutputManager.h>
#include <fun4all/Fun4AllDummyInputManager.h>
#include <fun4all/Fun4AllInputManager.h>
#include <fun4all/Fun4AllNoSyncDstInputManager.h>
#include <fun4all/Fun4AllOutputManager.h>
#include <fun4all/Fun4AllServer.h>
#include <fun4all/SubsysReco.h>
#include <g4detectors/PHG4DetectorSubsystem.h>
#include <g4detectors/PHG4CylinderSubsystem.h>
#include <g4histos/G4HitNtuple.h>
#include <g4main/PHG4ParticleGenerator.h>
#include <g4main/PHG4ParticleGeneratorBase.h>
#include <g4main/PHG4Reco.h>
#include <g4main/PHG4TruthSubsystem.h>
#include <g4main/PHG4SimpleEventGenerator.h>
#include <g4main/PHG4ParticleGun.h>
#include <g4main/HepMCNodeReader.h>
#include <g4main/PHG4TruthSubsystem.h>
#include <g4trackfastsim/PHG4TrackFastSim.h>
#include <g4trackfastsim/PHG4TrackFastSimEval.h>
#include <phool/recoConsts.h>
#include <g4lblvtx/PHG4ParticleGenerator_flat_pT.h>
#include <g4lblvtx/SimpleNtuple.h>
//#include <g4lblvtx/AllSi_Al_support_Subsystem.h>
//#include <g4lblvtx/EicFRichSubsystem.h>
#include <g4_modifieddrich/dRICH_Subsystem.h>
#include "G4_BlackHole.C"
#include "G4_DummymRICH.C"
#include <g4alsupp/Al_support_Subsystem.h>
#include <gem_g4alsupp/GEM_support_Subsystem.h>
#include "G4_Pipe_EIC.C"
#include "G4_DIRC_SMALL.C"
#include "G4_GridPix.C"
#ifdef _EICTOYVST_
#include <EicRootVstSubsystem.h>
#include <EtmOrphans.h>
#endif
#include <g4detectors/PHG4GDMLSubsystem.h>
#include "G4_GEM_EIC_v1.C"
//to include gems
#include <EicToyModelSubsystem.h>
#include <EicRootGemSubsystem.h>
#include <EtmOrphans.h>
//For MPGD from QH
#include <g4exampledetector/PHG4CylinderStripSubsystem.h>
#include <g4exampledetector/CreateCZHitContainer.h>
#include <TrackFastSimEval.h>
R__LOAD_LIBRARY(libeicdetectors.so)
R__LOAD_LIBRARY(libfun4all.so)
R__LOAD_LIBRARY(libg4detectors.so)
R__LOAD_LIBRARY(libg4lblvtx.so)
R__LOAD_LIBRARY(libg4trackfastsim.so)
R__LOAD_LIBRARY(libg4testbench.so)
R__LOAD_LIBRARY(libg4example01detector.so)
R__LOAD_LIBRARY(libg4histos.so)
R__LOAD_LIBRARY(libPHPythia6.so)
//Function to make GEM disk
void MakeGEM(array<double,6> Params, EicRootGemSubsystem *&fgt)
{
//auto sbs = ModifiedGEM();// creates GEM Module with modified material
auto sbs = new GemModule();// creates GEM Module with modified material
sbs->SetDoubleVariable("mDriftFoilCopperThickness", 5 * etm::um);
sbs->SetDoubleVariable("mGemFoilCopperThickness", 5 * etm::um);
sbs->SetDoubleVariable("mGemFoilKaptonThickness", 50 * etm::um);
sbs->SetDoubleVariable("mReadoutSupportThickness", 0 * etm::um);
sbs->SetDoubleVariable("mReadoutKaptonThickness", 50 * etm::um);
sbs->SetDoubleVariable("mFrameThickness", 17 * etm::mm);
sbs->SetDoubleVariable("mFrameBottomEdgeWidth", 10 * etm::mm); //30
sbs->SetDoubleVariable("mFrameTopEdgeWidth", 50 * etm::mm);
sbs->SetDoubleVariable("mFrameSideEdgeWidth", 10 * etm::mm); //15
sbs->SetDoubleVariable("mEntranceWindowThickness", 50 * etm::um); //25 um for both the entrance and exit
sbs->SetDoubleVariable("mActiveWindowBottomWidth", Params[3] * etm::mm);
sbs->SetDoubleVariable("mActiveWindowTopWidth", Params[2] * etm::mm);
sbs->SetDoubleVariable("mActiveWindowHeight", Params[0] * etm::mm);
fgt->AddWheel(sbs, Params[5], Params[1] * etm::mm, Params[4] * etm::mm, 0);
}
//Function to calculate the parameters for GEM disk geometry given the Z position, minimum eta covered, inner radius clearance, and the number of modules
array<double,6> FullGEMParameters(double Z, double EtaMin, double InnerRadius, double NModules)
{
//the extra negative in front is to allow space for the frame to fit within the cylinder/cone. the frame is 50mm thick at its shortest, but when it is angled it becomes larger
double Height = TMath::Abs(Z)*TMath::Tan(2*TMath::ATan(TMath::Exp(-1*EtaMin)));
Height = Height*TMath::Cos(TMath::Pi()/NModules) -50; // This calculation ensure the longest edge fits within eta given, then corrects back to center, and makes space for top frame
//double Height = -50*(1/TMath::Cos(TMath::Pi()/NModules)) + TMath::Abs(Z)*TMath::Tan(2*TMath::ATan(TMath::Exp(-1*EtaMin)));
double ActiveHeight = Height - InnerRadius; //NB: this may not account for the frame material thickness at the outer edge of the module, so it may not precisely get the full eta coverage
double CenterRadius = 0.5*ActiveHeight + InnerRadius;
double TopWidth = 2*Height*TMath::Tan(TMath::Pi()/NModules);
double BottomWidth = (TopWidth/Height)*InnerRadius;
array<double,6 > Params = {ActiveHeight, CenterRadius, TopWidth, BottomWidth, Z, NModules};
return Params;
}
double RadiusFromZEta(double Z, double Eta)
{
double Radius = TMath::Abs(Z)*TMath::Tan(2*TMath::ATan(TMath::Exp(-1*Eta)));
return Radius;
}
double EtaFromZR(double Z, double R)
{
double Eta = -1*TMath::Log(TMath::Tan(0.5*TMath::ATan(R/Z)));
return Eta;
}
void Fun4All_G4_Baseline2_pt(
int nEvents = 3000000, // number of events
double pmin = 0., // GeV/c
double pmax = 30., // GeV/c
double etamin = -3.7,
double etamax = 3.7,
int generatorVersion = 5, // Generator setting
int magnetic_field = 6, // Magnetic field setting
TString out_name = "out_pt") // output filename
{
// ======================================================================================================
gSystem->Load("libfun4all");
gSystem->Load("libg4detectors");
gSystem->Load("libg4testbench");
gSystem->Load("libg4histos");
gSystem->Load("libg4example01detector.so");
gSystem->Load("libg4trackfastsim.so");
gSystem->Load("libeicdetectors.so");
// Input from the user
double mRICHPosition = -152;
const int particle_gen = generatorVersion; // 1 = particle generator, 2 = particle gun, 3 = simple event generator, 4 = pythia8 e+p collision, 5 = particle generator flat in pT
double pix_size_vtx = 10.; // um - size of pixels in vertexing layers
double pix_size_bar = 10.; // um - size of pixels in barrel layers
double pix_size_dis = 10.; // um - size of pixels in disk layers
const int nDisks_per_side = 5;
const int do_projections = _PROJECTION_;
// Parameters for projections
string projname1 = "DIRC"; // Cylindrical surface object name
double projradius1 = 95;// 100;//112;// 80.; // [cm]
//NOTE: these surfaces are black holes. Care must be taken in the choice of dimensions as to not absorb particles within the acceptance of other detectors
double length1 = 310; //200.; // [cm]
// ---
double thinness = 0.01; // black hole thickness, needs to be taken into account for the z positions
// ---
string projname2 = "FOR"; // Forward plane object name
double projzpos2 = 172.5+thinness/2;//315+thinness/2.; // [cm]
//double projzpos2 = 154.5+thinness/2;//315+thinness/2.; // [cm]
double projradius2 = 110;//210.; // [cm]
// ---
string projname3 = "BACK"; // Backward plane object name
double projzpos3 = -(TMath::Abs(mRICHPosition)+thinness/2.);// [cm]
double projradius3 = 200;//95.; // [cm]
// ---
string projname4 = "FOREXIT"; // Backward plane object name
double projzpos4 = 359;// [cm]
double projradius4 = 250.; // [cm]
// ======================================================================================================
// Make the Server
Fun4AllServer *se = Fun4AllServer::instance();
// If you want to fix the random seed for reproducibility
//recoConsts *rc = recoConsts::instance();
//rc->set_IntFlag("RANDOMSEED", 12345);
// ======================================================================================================
// Particle Generator Setup
PHG4ParticleGenerator *gen = new PHG4ParticleGenerator();
gen->set_name(std::string("pi-")); // geantino, pi-, pi+, mu-, mu+, e-., e+, proton, ... (currently passed as an input)
gen->set_vtx(0,0,0); // Vertex generation range
gen->set_mom_range(pmin,pmax); // Momentum generation range in GeV/c
gen->set_z_range(0.,0.);
gen->set_eta_range(etamin,etamax);//4.0
gen->set_phi_range(0,2.*TMath::Pi());
// --------------------------------------------------------------------------------------
// Particle generator flat in pT
PHG4ParticleGenerator_flat_pT *gen_pT = new PHG4ParticleGenerator_flat_pT();
gen_pT->set_name(std::string("pi-")); // geantino, pi-, pi+, mu-, mu+, e-., e+, proton, ... (currently passed as an input)
gen_pT->set_vtx(0,0,0); // Vertex generation range
gen_pT->set_pT_range(pmin,pmax); // Momentum generation range in GeV/c
gen_pT->set_z_range(0.,0.);
gen_pT->set_eta_range(etamin, etamax); // Detector coverage corresponds to |η|< 4
gen_pT->set_phi_range(0.,2.*TMath::Pi());
// ======================================================================================================
if (particle_gen==1){se->registerSubsystem( gen); cout << "Using particle generator" << endl;}
else if(particle_gen==5){se->registerSubsystem(gen_pT); cout << "Using particle generator flat in pT" << endl;}
else{ cout << "Particle generator option requested has not been implemented. Bailing out!" << endl; exit(0); }
// ======================================================================================================
PHG4Reco *g4Reco = new PHG4Reco();
//g4Reco->SetWorldMaterial("G4_Galactic");
EicGeoParData::ImportMediaFile("./EicToyModel/examples/eicroot/media.geo");
// ======================================================================================================
// Magnetic field setting
TString B_label;
if(magnetic_field==1){ // uniform 1.5T
B_label = "_B_1.5T";
g4Reco->set_field(1.5);
}
else if(magnetic_field==2){ // uniform 3.0T
B_label = "_B_3.0T";
g4Reco->set_field(3.0);
}
else if(magnetic_field==3){ // sPHENIX 1.4T map
B_label = "_sPHENIX";
g4Reco->set_field_map(string(getenv("CALIBRATIONROOT")) + string("/Field/Map/sPHENIX.2d.root"), PHFieldConfig::kField2D);
g4Reco->set_field_rescale(-1.4/1.5);
}
else if(magnetic_field==4){ // Beast 3.0T map
B_label = "_Beast";
g4Reco->set_field_map(string(getenv("CALIBRATIONROOT")) + string("/Field/Map/mfield.4col.dat"), PHFieldConfig::kFieldBeast);
}
else if(magnetic_field==5){ // ATHENA 3.0T map (updated BeAST Field map with dual coil configuration)
B_label = "_ATHENA0528";
g4Reco->set_field_map( string("../BeastMagneticField/data/EIC_v.0.1.0_Magnetic_Field_Map_2021_05_28_radial_coords_[cm]_[T].401301.line.Bmap"), PHFieldConfig::kFieldBeast);
}
else if(magnetic_field==6){ // updated BeAST 3.0T map
B_label = "_ATHENA0507";
g4Reco->set_field_map( string("./magfield/EIC_Magnetic_Field_Map_2021_05_07_radial_coords_[cm]_[T].120000.lines.Bmap"), PHFieldConfig::kFieldBeast);
}
else if(magnetic_field==7){ // updated BeAST 3.0T map
B_label = "_ATHENA0507Shifted";
g4Reco->set_field_map( string("../BeastMagneticField/data/ATHENA0507_Shifted.Bmap"), PHFieldConfig::kFieldBeast);
}
else{ // The user did not provide a valid B field setting
cout << "User did not provide a valid magnetic field setting. Set 'magnetic_field'. Bailing out!" << endl;
}
// ======================================================================================================
// Detector setup
PHG4CylinderSubsystem *cyl;
if(do_projections){
PHG4CylinderSubsystem *cyl;
cyl = new PHG4CylinderSubsystem(projname1);
cyl->set_double_param("length", length1);
cyl->set_double_param("radius", projradius1); // dirc radius
cyl->set_double_param("thickness", 0.01); // needs some thickness
cyl->set_string_param("material", "G4_AIR");
//cyl->set_string_param("material", "G4_Galactic");
cyl->SetActive();
cyl->SaveAllHits();
cyl->SuperDetector(projname1);
cyl->set_color(1,0,0,0.7); //reddish
g4Reco->registerSubsystem(cyl);
cyl = new PHG4CylinderSubsystem(projname2);
cyl->set_double_param("length", thinness);
cyl->set_double_param("radius", 10); // beampipe needs to fit here
cyl->set_double_param("thickness", projradius2-10); //
cyl->set_string_param("material", "G4_AIR");
//cyl->set_string_param("material", "G4_Galactic");
cyl->set_double_param("place_z", projzpos2);
cyl->SetActive();
cyl->SaveAllHits();
cyl->SuperDetector(projname2);
cyl->set_color(0,1,1,0.3);
g4Reco->registerSubsystem(cyl);
cyl = new PHG4CylinderSubsystem(projname3);
cyl->set_double_param("length", thinness);
cyl->set_double_param("radius", 10); // beampipe needs to fit here
cyl->set_double_param("thickness", projradius3-10); //
cyl->set_string_param("material", "G4_AIR");
//cyl->set_string_param("material", "G4_Galactic");
cyl->set_double_param("place_z", projzpos3);
cyl->SetActive();
cyl->SaveAllHits();
cyl->SuperDetector(projname3);
cyl->set_color(0,1,1,0.3);
g4Reco->registerSubsystem(cyl);
cyl = new PHG4CylinderSubsystem(projname4);
cyl->set_double_param("length", thinness);
cyl->set_double_param("radius", 15); // beampipe needs to fit here
cyl->set_double_param("thickness", projradius4-15); //
cyl->set_string_param("material", "G4_AIR");
//cyl->set_string_param("material", "G4_Galactic");
cyl->set_double_param("place_z", projzpos4);
cyl->SetActive();
cyl->SaveAllHits();
cyl->SuperDetector(projname4);
cyl->set_color(0,1,1,0.3);
g4Reco->registerSubsystem(cyl);
}
#ifdef _DIRC_
DIRCSetup(g4Reco);
#endif
#ifdef _TPC_
GridPixSetup(g4Reco);
#endif
#ifdef _SIVTX_
//---------------------------
// Vertexing
double si_vtx_r_pos[] = {3.3,4.41,5.51};
const int nVtxLayers = sizeof(si_vtx_r_pos)/sizeof(*si_vtx_r_pos);
//double si_z_vtxlength[] = {42.0, 42.0, 42.0};
double si_z_vtxlength[] = {28, 28, 28};
//double si_thick_vtx = vtx_matBud/100.*9.37;
double si_thick_vtx = 0.05/100.*9.37;
for (int ilayer = 0; ilayer < nVtxLayers ; ilayer++){
cyl = new PHG4CylinderSubsystem("SVTX", ilayer);
cyl->set_string_param("material" , "G4_Si" );
cyl->set_double_param("radius" , si_vtx_r_pos[ilayer] );
cyl->set_double_param("thickness", si_thick_vtx );
cyl->set_double_param("place_z" , 0 );
cyl->set_double_param("length" , si_z_vtxlength[ilayer]);
cyl->SetActive();
cyl->SuperDetector("SVTX");
cyl->set_color(0,0.8,0.1);
g4Reco->registerSubsystem(cyl);
}
#endif
#ifdef _SIBARR_
//---------------------------
// Barrel
double si_r_pos[] = {13.38, 18.0};
const int nTrckLayers = sizeof(si_r_pos)/sizeof(*si_r_pos);
//projective Si Barrel
double barr_prapidity = 1.1;
double si_barr_length_1 = (1-exp(-2*barr_prapidity))/exp(-barr_prapidity)*si_r_pos[0];
double si_barr_length_2 = (1-exp(-2*barr_prapidity))/exp(-barr_prapidity)*si_r_pos[1];
double si_z_length[] = {si_barr_length_1, si_barr_length_2};
//hardcoding the barrel parameters (as long as barr_prapidity is 1.1, these values are already used)
//si_z_length[] = {35.74, 48.08};
cout << "LENGTHS OF SI BARR: " << si_barr_length_1 << " , " << si_barr_length_2 << endl;
//double si_z_length[] = {84.0, 84.0};
//double si_thick_bar = barr_matBud/100.*9.37;
double si_thick_bar = 0.55/100.*9.37;
for (int ilayer = 0; ilayer < nTrckLayers ; ilayer++){
cyl = new PHG4CylinderSubsystem("BARR", ilayer);
cyl->set_string_param("material" , "G4_Si" );
cyl->set_double_param("radius" , si_r_pos[ilayer] );
cyl->set_double_param("thickness", si_thick_bar );
cyl->set_double_param("place_z" , 0 );
cyl->set_double_param("length" , si_z_length[ilayer] - 4);
cyl->SetActive();
cyl->SuperDetector("BARR");
cyl->set_color(0,0.5,1);
g4Reco->registerSubsystem(cyl);
}
#endif
#ifdef _SIDISKS_
//---------------------------
// Disks
/*
double si_z_pos[] = {-121.,-105.4,-89.8,-74.2,-58.6,-43.0,-22.0,22.0,43.0,58.6,74.2,89.8,105.4, 121.};
const int nDisks = sizeof(si_z_pos)/sizeof(*si_z_pos);
double si_r_max[] = {19.0, 19.0, 19.0, 19.0, 19.0, 13.94, 7.13, 7.13, 13.94, 19.0, 19.0, 19.0, 19.0, 19.0};
double si_r_min[] = {9.93, 8.35, 6.67, 4.99, 3.64, 3.64, 3.64, 3.64, 3.64, 3.64, 4.99, 6.67, 8.35, 9.93};
*/
//double si_z_pos[] = {-121., -96.25, -71.5, -46.75, -22.0, 22.0, 46.75, 71.5, 96.25, 121.};
//expanded spacing
//double si_z_pos[] = {-143., -115.5, -88., -60.5, -33, 33, 60.5, 88, 115.5, 143 };
//Asymmetric expanded spacing
//double si_z_pos[] = {-135., -109.5, -84., -58.5, -33, 33, 63., 93., 123., 153 };
double si_z_pos[11] = {-145, -109, -73, -49, -25, 25, 49, 73, 103.67, 134.33, 165};
/*
double SIZMin = 17;//41;
for (int i = 0; i < 6; i++)
{
if (i < 3)
{
double SINegSpacing = (TMath::Abs(mRICHPosition)-2-SIZMin)/4;
//si_z_pos[i] = -1*(TMath::Abs(mRICHPosition)-2) + SINegSpacing*i;
si_z_pos[i] = -1*(SIZMin) - SINegSpacing*i;
}
else
{
//double SIPosSpacing = (153-SIZMin)/4;
//double SIPosSpacing = (145-SIZMin)/4;
double SIPosSpacing = (170-SIZMin)/4;
si_z_pos[i] = SIZMin + SIPosSpacing*(i-3);
}
}
*/
for (int j = 0 ; j< 6; j++) { cout << "Disk "<< j+1 << " : " << si_z_pos[j] << endl;}
//original projective
//double si_z_pos[] = {-121., -99., -77., -55., -33.0, 33.0, 55., 77., 99., 121.};
const int nDisks = sizeof(si_z_pos)/sizeof(*si_z_pos);
//double si_r_max[] = {19.0, 19.0, 19.0, 19.0, 7.13, 7.13, 19.0, 19.0, 19.0, 19.0};
double si_r_max[11]= {43.23, 43.23, 43.23, 36.26, 18.5, 18.5, 36.26, 43.23, 43.23, 43.23, 43.23};
/*
for (int iDisk = 0 ; iDisk < nDisks; iDisk++)
{
//si_r_max[iDisk] = RadiusFromZEta(TMath::Abs(si_z_pos[iDisk]), 2.5);
si_r_max[iDisk] = RadiusFromZEta(TMath::Abs(si_z_pos[iDisk]), 1.1) ;
//Fudge factor added to the end to add a little extra radius to the inner disks and subtract from outer disks to extend to cone and not further
//if (iDisk < 3) si_r_max[iDisk] = RadiusFromZEta(TMath::Abs(si_z_pos[iDisk]), 1.11) - (iDisk-1)*1.1 ;
//else si_r_max[iDisk] = RadiusFromZEta(TMath::Abs(si_z_pos[iDisk]), 1.11) - (iDisk-4)*1.1;
//if (iDisk > 2 && iDisk < 7) si_r_max[iDisk] = RadiusFromZEta(TMath::Abs(si_z_pos[iDisk]), 1.1);
//else si_r_max[iDisk] = RadiusFromZEta(TMath::Abs(si_z_pos[iDisk]), 2.0);
cout << "r max for disk " << iDisk + 1 << " : " << si_r_max[iDisk] << endl;
//if (iDisk == 4 || iDisk == 5) si_r_max[iDisk] = 7.13;
}
*/
//projective Si Disk (only first disk changes)
//double si_r_max[] = {19.0, 19.0, 19.0, 19.0, 16.47, 16.47, 19.0, 19.0, 19.0, 19.0};
//tweaked inner radii (set for mRICH -200 asymmetric, with z min 41)
//double si_r_min[] = {6.25, 6.0, 5.9, 3.64, 3.64, 3.64, 3.84, 6.795, 9.95, 10.5};
//double si_r_min[] = {5.91, 4.7, 3.5, 3.18, 3.18, 3.18, 3.18, 3.5, 4.7, 5.91};
//Order changed from low z to high z -> in to out in neg, then in to out in pos
//double si_r_min[] = { 3.18, 3.18, 4.75, 3.18, 3.18, 6.75};
//hardcode baseline 2
double si_r_min[] = {7.15, 6.25, 3.5, 3.18, 3.18, 3.18, 3.18, 3.5, 8, 10, 11};
//modifying the rear si disks for the study with multiple distances
//for (int i = 0; i < 4; i++)
//{
// si_r_min[i] = (-1.2/47)*(si_z_pos[i]+88) + 5.7;
//}
//Original inner radii
//double si_r_min[] = {9.93, 7.25, 4.65, 3.64, 3.64, 3.64, 3.64, 4.65, 7.25, 9.93};
double si_thick_disk = 0.24/100.*9.37;
for (int ilayer = 0; ilayer < nDisks ; ilayer++){
cyl = new PHG4CylinderSubsystem("FBVS", ilayer);
cyl->set_string_param("material" , "G4_Si" );
cyl->set_double_param("radius" , si_r_min[ilayer]);
cyl->set_double_param("thickness", si_r_max[ilayer]-si_r_min[ilayer]);
cyl->set_double_param("place_z" , si_z_pos[ilayer]);
cyl->set_double_param("length" , si_thick_disk );
cyl->SetActive();
cyl->SuperDetector("FBST");
cyl->set_color(1,0,0);
g4Reco->registerSubsystem(cyl);
}
#endif
#ifdef _ALSUPP_
// Al Support Structure
//Al_support_Subsystem *Al_supp = new Al_support_Subsystem("Al_supp");
//g4Reco->registerSubsystem(Al_supp);
//Experimental GEM Support
GEM_support_Subsystem *GEM_supp = new GEM_support_Subsystem("GEM_supp");
g4Reco->registerSubsystem(GEM_supp);
#endif
// ------------
#ifdef _SIMPLEVST_
//---------------------------
// Barrel
double si_r_pos[] = { 7.0, 14.0, 21, 28.0}; //Simplified Toy Model
const int nTrckLayers = sizeof(si_r_pos)/sizeof(*si_r_pos);
double si_z_length[] = {27.0, 27.0, 54.0, 54.0}; //Simplified Toy Model
double si_thick_bar = 0.55/100.*9.37;
for (int ilayer = 0; ilayer < nTrckLayers ; ilayer++){
cyl = new PHG4CylinderSubsystem("BARR", ilayer);
cyl->set_string_param("material" , "G4_Si" );
cyl->set_double_param("radius" , si_r_pos[ilayer] );
cyl->set_double_param("thickness", si_thick_bar );
cyl->set_double_param("place_z" , 0 );
cyl->set_double_param("length" , si_z_length[ilayer]);
cyl->SetActive();
cyl->SuperDetector("SIMPLEVST");
cyl->set_color(0,0.5,1);
g4Reco->registerSubsystem(cyl);
}
#endif
//---------------------------
// Black hole to suck loopers out of their misery
#ifdef _BLACKHOLE_
//Full Wrap single Cylinder
wrap_with_cylindrical_blackhole(g4Reco,250,-250,380,true);
#endif
#ifdef _RICH_
//EicFRichSubsystem *RICH = new EicFRichSubsystem("RICH");
dRICH_Subsystem *RICH = new dRICH_Subsystem("RICH");
g4Reco->registerSubsystem(RICH);
#endif
#ifdef _MRICH_
//PHG4mRICHSubsystem *mRICH = new PHG4mRICHSubsystem("mRICH", 0);
//g4Reco->registerSubsystem(mRICH);
add_dummymRICH(g4Reco, 200, -186);
#endif
//beampipe as implemented by Rey with slight modification
#ifdef _BEAMPIPE_
PipeInit();
double pipe_radius=0;
pipe_radius = Pipe(g4Reco, pipe_radius , true);
#endif
// ------------
#ifdef _MPGD_
double gap_betweenCZ = 1.5, Gap_betweenlayer = 1.5;
//double thickness = 0.355199;
double thicknessMPGD = 0.36499;
int nCZlayer = 2;
bool use_2Dreadout = true;
if (use_2Dreadout) {
gap_betweenCZ = 0;
nCZlayer = 1;
}
//double BMT_r[6] = {20., 20.+nCZlayer*thicknessMPGD+gap_betweenCZ+Gap_betweenlayer, 50-nCZlayer*thicknessMPGD-gap_betweenCZ-Gap_betweenlayer/2, 50\
+Gap_betweenlayer/2, 80-(nCZlayer*thicknessMPGD+gap_betweenCZ)*2-Gap_betweenlayer, 80-nCZlayer*thicknessMPGD-gap_betweenCZ};
//double BMT_r[6] = { 47.7153, 49.5718, 71.8958, 73.7523, 75.6088, 77.4653 };
//spacing between layers: 1.8565cm
//
//Two layers centered on 50cm and 76cm -> corresponding to approximately 210cm length for outer, and 140 for inner
//double BMT_r[4] = { 49.07175, 50.92825, 75.07175, 76.92825 };
//B2P2N2 4 Layers
double BMT_r[4] = {47.72, 49.57, 75.61, 77.47};
//double BMT_r[5] = { 49.07175, 50.92825, 73.21525, 75.07175, 76.92825 };
//double BMT_r[6] = { 49.07175, 50.92825, 71.35875, 73.21525, 75.07175, 76.92825 };
//double BMT_r[5] = { 47.7153, 49.5718, 73.7523, 75.6088, 77.4653 };
//double BMT_r[4] = { 47.7153, 49.5718, 75.6088, 77.4653 };
/*
for (int iScale = 0; iScale < 6; iScale++)
{
//may want to actually scale only two values in the array, but maintain the spacing betwen layers in groups
BMT_r[iScale] = BMT_r[iScale]*1.2;
}
*/
//double BMT_r[4] = { 71.8958, 73.7523, 75.6088, 77.4653 };
PHG4CylinderStripSubsystem *example01;
//double bmt_length = (1-exp(-2*prapidity))/exp(-prapidity)*80;
const double prapidity =1.1;
//Original projective
//double bmt_length_inner = (1-exp(-2*prapidity))/exp(-prapidity)*BMT_r[0] -2.5;
//double bmt_length_outer = (1-exp(-2*prapidity))/exp(-prapidity)*BMT_r[2] -2.5;
//hardcode baseline 2
double bmt_length_outer = 201.98;// (1-exp(-2*prapidity))/exp(-prapidity)*BMT_r[2] -2.5;
double bmt_length_inner = 127.47;//(1-exp(-2*prapidity))/exp(-prapidity)*BMT_r[0] -2.5;
//scale up
//double bmt_length_inner = (1-exp(-2*prapidity))/exp(-prapidity)*50*1.226 - 10;
//double bmt_length_outer = (1-exp(-2*prapidity))/exp(-prapidity)*78*1.226 - 17;
double bmt_length;
cout << "BMT Inner: " << bmt_length_inner << endl;
cout << "BMT Outer: " << bmt_length_outer << endl;
//const double prapidity =1.0;
//double bmt_length_inner, bmt_length_outer;
//double bmt_length = bmt_length_inner = bmt_length_outer = (1-exp(-2*prapidity))/exp(-prapidity)*80;
//double bmt_length = 250;
for (int ilayer = 0; ilayer< 4; ilayer++){
example01 = new PHG4CylinderStripSubsystem("BMT",ilayer);
example01->set_double_param("radius", BMT_r[ilayer]);
example01->set_string_param("gas", "myMMGas");
//example01->set_double_param("steplimits", 300e-4);
example01->set_double_param("phi0", 15*ilayer);
example01->set_double_param("gap", gap_betweenCZ);
example01->SetActive();
example01->SuperDetector("BMT");
example01->set_int_param("lengthviarapidity",0);
if (ilayer < 2) bmt_length = bmt_length_inner;
else bmt_length = bmt_length_outer;
//bmt_length = (1-exp(-2*prapidity))/exp(-prapidity)*BMT_r[ilayer];
example01->set_double_param("length", bmt_length);
example01->set_double_param("deadzone", 0.2);
example01->set_int_param("nhit", 2);
example01->OverlapCheck(true);
example01->set_int_param("use_2Dreadout",use_2Dreadout);
g4Reco->registerSubsystem(example01);
//example01->Print();
}
#endif
#ifdef _INNERGEMS_
// Forward GEM tracker module(s);
auto fgt = new EicRootGemSubsystem("INNERGEM");
{
fgt->SetActive(true);
{
//fgt->CheckOverlap(); \
//fgt->SetTGeoGeometryCheckPrecision(0.000001 * etm::um); \
// See other GemModule class data in GemGeoParData.h; \
// Compose sectors; parameters are: \
// - layer description (obviously can mix different geometries); \
// - azimuthal segmentation;
// - gas volume center radius; \
// - Z offset from 0.0 (default); \
// - azimuthal rotation from 0.0 (default); \
//FullGEMParameters() will calculate the parameters to define the geometry of the GEM disk based on the Z location, minimum eta coverage, inner radius clearance, and number of modules
//Array definition: Params[] = {ActiveHeight, CenterRadius, TopWidth, BottomWidth, Z, NModules};
//New Design for projective Central tracker with eta = 1.1
//double GEM_Z[3] = {69, 106, 143};
double EtaMinForRing = EtaFromZR(103, 75.5 + 5 + 3 );
cout << "Eta Min for GEM Ring: " << EtaMinForRing << endl;
double EtaForRearOuterRing = EtaFromZR(144.5, 92);
double EtaForForwardOuterRing = EtaFromZR(164.5, 92);
//array<double,6> Params = FullGEMParameters(10*(-102), 1.1, 10*(43.5-1), 12);
array<double,6> Params = FullGEMParameters(10*(-103), EtaMinForRing, 10*(43.5+1), 12);
cout << "Rear Ring 1 Active radius: " << Params[1] - Params[0]/2 << " to " << Params[1] + Params[0]/2 << endl;
MakeGEM(Params, fgt);
Params = FullGEMParameters(10*(-144.5), EtaForRearOuterRing, 10*(43.5+1), 12);
//Params[4] = 10*(-144.5);
cout << "Rear Ring 2 Active radius: " << Params[1] - Params[0]/2 << " to " << Params[1] + Params[0]/2 << endl;
MakeGEM(Params, fgt);
Params = FullGEMParameters(10*(103), EtaMinForRing, 10*(43.5+1), 12);
cout << "Forward Ring 1 Active radius: " << Params[1] - Params[0]/2 << " to " << Params[1] + Params[0]/2 << endl;
MakeGEM(Params, fgt);
Params = FullGEMParameters(10*(164.5), EtaForForwardOuterRing, 10*(43.5+1), 12);
//Params[4] = 10*164.5;
cout << "Forward Ring 1 Active radius: " << Params[1] - Params[0]/2 << " to " << Params[1] + Params[0]/2 << endl;
MakeGEM(Params, fgt);
/*
int NumberOfGEMS = 2;
double ZStart = 85.0;
double SIPosSpacing = (170-SIZMin)/4;
double SINegSpacing = (TMath::Abs(mRICHPosition)-2-SIZMin)/4;
double NegZStart = SIZMin + 3*SINegSpacing;
double PosZStart = SIZMin + 3*SIPosSpacing;
double ForwardZSpacing = (170-PosZStart)/(NumberOfGEMS-1);//34.333;
//double ForwardZSpacing = (145-ZStart)/(NumberOfGEMS-1);//34.333;
//double ForwardZSpacing = (152-ZStart)/(NumberOfGEMS-1);//34.333;
double BackwardZSpacing = (TMath::Abs(mRICHPosition)-2-NegZStart)/(NumberOfGEMS-1);//28.333;
double ZPos = PosZStart;
array<double,6> Params = FullGEMParameters(10*ZPos, 1.1, 10*(RadiusFromZEta(ZPos, 3.5)+2), 12);
for (int iGEM = 0; iGEM < NumberOfGEMS; iGEM++)
{
double TEMPZPos = 0;
ZPos = PosZStart+(iGEM*ForwardZSpacing);
if (ZPos <= 125) TEMPZPos = ZPos -1.716; //subtracted distance is the distance the disks are staggered such that the closer modules aren't exceeding the eta limits
else TEMPZPos = 125;
Params = FullGEMParameters(10*(TEMPZPos), 1.1, 10*(RadiusFromZEta(ZPos, 3.5)+2), 12);
Params[4]=10*(ZPos); //Copying previous parameters but shifting in Z
MakeGEM(Params, fgt);
cout << "Forward Disk " << iGEM+1 << " Active radius: " << Params[1] - Params[0]/2 << " to " << Params[1] + Params[0]/2 << endl;
}
for (int iGEM = 0; iGEM < NumberOfGEMS; iGEM++)
{
double TEMPZPos = 0;
ZPos = -1*NegZStart-(iGEM*BackwardZSpacing);
if (ZPos >= -125) TEMPZPos = ZPos +1.716;
else TEMPZPos = -125;
Params = FullGEMParameters(10*(TEMPZPos), 1.1, 10*(RadiusFromZEta(ZPos, 4)+2), 12);
Params[4]=10*(ZPos); //Copying previous parameters but shifting in Z
MakeGEM(Params, fgt);
cout << "Rear Disk " << iGEM+1 << " Active radius: " << Params[1] - Params[0]/2 << " to " << Params[1] + Params[0]/2 << endl;
}
*/
//Hardcode the GEM Rings
}
g4Reco->registerSubsystem(fgt);
}
#endif
#ifdef _OUTERGEMS_
// Forward GEM tracker module(s);
auto fgt2 = new EicRootGemSubsystem("OUTERGEM");
{
fgt2->SetActive(true);
{
//FullGEMParameters() will calculate the parameters to define the geometry of the GEM disk based on the Z location, minimum eta coverage, inner radius clearance, and number of modules
//Array definition: Params[] = {ActiveHeight, CenterRadius, TopWidth, BottomWidth, Z, NModules};
//Far Hadron Side GEM disk
array<double,6> Params = FullGEMParameters(3620, 1.2, 210, 12);
cout << "Forward Disk Active radius: " << Params[1] - Params[0]/2 << " to " << Params[1] + Params[0]/2 << endl;
MakeGEM(Params, fgt2);
//Params[4]=Params[4]+50; //Copying previous parameters but shifting in Z
//MakeGEM(Params, fgt2);
// cout << "Length: " << Params[0] + 210 << endl;
// cout << "Outer Disk Active radius: " << Params[1] - Params[0]/2 << " to " << Params[1] + Params[0]/2 << endl;
//Far Electron Side GEM disk
// Params = FullGEMParameters(-1900, 1.1, 110, 12);
// cout << "Rear Disk Active radius: " << Params[1] - Params[0]/2 << " to " << Params[1] + Params[0]/2 << endl;
// MakeGEM(Params, fgt2);
// cout << "Top Width: " << Params[2] << endl;
// cout << "Length: " << Params[0] + 210 << endl;
}
g4Reco->registerSubsystem(fgt2);
}
#endif
// Detailed vertex Si tracker from EicToyModel
// EicRoot vertex tracker; be aware: "VST" will also become a SuperDetector name;
#ifdef _EICTOYVST_
auto vst = new EicRootVstSubsystem("VST");
{
vst->SetGeometryType(EicGeoParData::NoStructure);
vst->SetActive(true);
// Barrel layers; hits belonging to these layers will be labeled internally
// according to the sequence of these calls;
{
auto ibcell = new MapsMimosaAssembly();
// See other MapsMimosaAssembly class POD entries in MapsMimosaAssembly.h;
ibcell->SetDoubleVariable("mAssemblyBaseWidth", 17.5 * etm::mm);
// Compose barrel layers; parameters are:
// - cell assembly type;
// - number of staves in this layer;
// - number of chips in a stave;
// - chip center installation radius;
// - additional stave slope around beam line direction; [degree];
// - layer rotation around beam axis "as a whole"; [degree];
vst->AddBarrelLayer(ibcell, 1*3*12, 1*9, 1*3*23.4 * etm::mm, 12.0, 0.0);
vst->AddBarrelLayer(ibcell, 2*3*12, 1*9, 2*3*23.4 * etm::mm, 12.0, 0.0);
vst->AddBarrelLayer(ibcell, 3*3*12, 2*9, 3*3*23.4 * etm::mm, 12.0, 0.0);
vst->AddBarrelLayer(ibcell, 4*3*12, 2*9, 4*3*23.4 * etm::mm, 12.0, 0.0);
}
g4Reco->registerSubsystem(vst);
}
#endif
PHG4TruthSubsystem *truth = new PHG4TruthSubsystem();
g4Reco->registerSubsystem(truth);
se->registerSubsystem(g4Reco);
/*SimpleNtuple *hits = new SimpleNtuple("Hits");
hits->AddNode("SVTX", 0);
hits->AddNode("BARR", 1);
hits->AddNode("BMT", 2);
hits->AddNode("CZBMT", 3);
hits->AddNode("FBST", 4);
hits->AddNode("INNERGEM", 5);
hits->AddNode("OUTERGEM", 6);
hits->AddNode("DIRC_SMALL", 7);
se->registerSubsystem(hits);*/
//---------------------------
// fast pattern recognition and full Kalman filter
// output evaluation file for truth track and reco tracks are PHG4TruthInfoContainer
//---------------------------
PHG4TrackFastSim *kalman = new PHG4TrackFastSim("PHG4TrackFastSim");
kalman->set_use_vertex_in_fitting(false);
kalman->set_sub_top_node_name("BARR");
kalman->set_trackmap_out_name("SvtxTrackMap");
#ifdef _SIVTX_
// add Vertexing Layers
kalman->add_phg4hits(
"G4HIT_SVTX", // const std::string& phg4hitsNames,
PHG4TrackFastSim::Cylinder,
999., // radial-resolution [cm]
pix_size_vtx/10000./sqrt(12.), // azimuthal-resolution [cm]
pix_size_vtx/10000./sqrt(12.), // z-resolution [cm]
1, // efficiency,
0 // noise hits
);
#endif
#ifdef _SIBARR_
// add Barrel Layers
kalman->add_phg4hits(
"G4HIT_BARR", // const std::string& phg4hitsNames,
PHG4TrackFastSim::Cylinder,
999., // radial-resolution [cm]
pix_size_bar/10000./sqrt(12.), // azimuthal-resolution [cm]
pix_size_bar/10000./sqrt(12.), // z-resolution [cm]
1, // efficiency,
0 // noise hits
);
#endif
#ifdef _SIMPLEVST_
// add Barrel Layers
kalman->add_phg4hits(
"G4HIT_SIMPLEVST", // const std::string& phg4hitsNames,
PHG4TrackFastSim::Cylinder,
999., // radial-resolution [cm]
pix_size_bar/10000./sqrt(12.), // azimuthal-resolution [cm]
pix_size_bar/10000./sqrt(12.), // z-resolution [cm]
1, // efficiency,
0 // noise hits
);
#endif
#ifdef _SIDISKS_
// add Disk Layers
kalman->add_phg4hits(
"G4HIT_FBST", // const std::string& phg4hitsNames,
PHG4TrackFastSim::Vertical_Plane,
pix_size_dis/10000./sqrt(12.), // radial-resolution [cm]
pix_size_dis/10000./sqrt(12.), // azimuthal-resolution [cm]
999., // z-resolution [cm]
1, // efficiency,
0 // noise hits
);
#endif
#ifdef _MPGD_
//2D Readout
if(use_2Dreadout)
{
kalman->add_phg4hits(
"G4HIT_BMT", // const std::string& phg4hitsNames,
PHG4TrackFastSim::Cylinder, // const DETECTOR_TYPE phg4dettype,
2.5/2/sqrt(12), // radial-resolution [cm], only used for Vertical Plane Detector Type
150e-4, // azimuthal-resolution [cm]
150e-4, // z-resolution [cm]
1, // efficiency,
0 // noise hits
);
}
else
{
kalman->add_phg4hits(
"G4HIT_CZBMT", // const std::string& phg4hitsNames,
PHG4TrackFastSim::Cylinder, // const DETECTOR_TYPE phg4dettype,
2.5/2/sqrt(12), // radial-resolution [cm], only used for Vertical Plane Detector Type
150e-4, // azimuthal-resolution [cm]
150e-4, // z-resolution [cm]
1, // efficiency,
0 // noise hits
);
}
#endif
#ifdef _INNERGEMS_
// GEM tracker hits;
kalman->add_phg4hits(fgt->GetG4HitName(),
PHG4TrackFastSim::Vertical_Plane,
250e-4, //999. // radial-resolution [cm] (this number is not used in cylindrical geometry)
50e-4, // azimuthal (arc-length) resolution [cm]
999., //70e-4 // longitudinal (z) resolution [cm]
1,// efficiency (fraction)
0);// hit noise
#endif
#ifdef _OUTERGEMS_
// GEM tracker hits;
kalman->add_phg4hits(fgt2->GetG4HitName(),
PHG4TrackFastSim::Vertical_Plane,
250e-4, //999. // radial-resolution [cm] (this number is not used in cylindrical geometry)
50e-4, // azimuthal (arc-length) resolution [cm]
999., //70e-4 // longitudinal (z) resolution [cm]
1,// efficiency (fraction)
0);// hit noise
#endif
#ifdef _TPC_
// GridPix tracker hits;
kalman->add_phg4hits(
"G4HIT_GAS",
PHG4TrackFastSim::Cylinder,
999., // radial-resolution [cm] (this number is not used in cylindrical geometry)
100e-4, // azimuthal (arc-length) resolution [cm]
200e-4, //70e-4 // longitudinal (z) resolution [cm]
0.9,// efficiency (fraction)
0);// hit noise
#endif
#ifdef _EICTOYVST_
// Silicon tracker hits;
kalman->add_phg4hits(vst->GetG4HitName(), // const std::string& phg4hitsNames
PHG4TrackFastSim::Cylinder, // const DETECTOR_TYPE phg4dettype
999., // radial-resolution [cm] (this number is not used in cylindrical geometry)
// 20e-4/sqrt(12) cm = 5.8e-4 cm, to emulate 20x20 um pixels;
//5.8e-4, // azimuthal (arc-length) resolution [cm]
pix_size_vtx/10000./sqrt(12.), // azimuthal-resolution [cm]
//5.8e-4, // longitudinal (z) resolution [cm]
pix_size_vtx/10000./sqrt(12.), // longitudinal (z) resolution [cm]
1, // efficiency (fraction)
0); // hit noise
#endif
if(do_projections){
//NOTE: The output is in cm
kalman->add_cylinder_state(projname1, projradius1); // projection on cylinder (DIRC)
kalman->add_zplane_state (projname2, projzpos2 ); // projection on vertical planes
kalman->add_zplane_state (projname3, projzpos3 ); // projection on vertical planes
kalman->add_zplane_state (projname4, projzpos4 ); // projection on vertical planes
}
//kalman->Verbosity(10);
kalman->set_use_vertex_in_fitting(false);
kalman->set_vertex_xy_resolution(0);
kalman->set_vertex_z_resolution(0);
kalman->enable_vertexing(false); // this is false by default
kalman->set_vertex_min_ndf(2);
se->registerSubsystem(kalman);
std::string outputFile = (std::string)(out_name)+std::string(B_label)+"_FastSimEval.root";
PHG4TrackFastSimEval *fast_sim_eval = new PHG4TrackFastSimEval("FastTrackingEval");
fast_sim_eval->set_filename(outputFile);
if(do_projections){
fast_sim_eval->AddProjection(projname1);
fast_sim_eval->AddProjection(projname2);
fast_sim_eval->AddProjection(projname3);
fast_sim_eval->AddProjection(projname4);
}
se->registerSubsystem(fast_sim_eval);
//se->registerSubsystem(new TrackFastSimEval());
// ======================================================================================================
// IOManagers...
const std::string dst_name = ""+std::string(out_name)+std::string(B_label)+"_G4GEM.root";
Fun4AllDstOutputManager *out = new Fun4AllDstOutputManager("DSTOUT",dst_name);
out->Verbosity(0);
se->registerOutputManager(out);
Fun4AllInputManager *in = new Fun4AllDummyInputManager("JADE");
se->registerInputManager(in);
if (nEvents <= 0) return;
se->run(nEvents);
se->End();