forked from alisw/AliRoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhbt_event_processor.f
More file actions
7414 lines (6390 loc) · 263 KB
/
Copy pathhbt_event_processor.f
File metadata and controls
7414 lines (6390 loc) · 263 KB
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
CCC ********************************************************************
CCC Modifications for ALICE-ROOT application at CERN - 12/15/2000
CCC 1. Removed all Fortran Data Structures in favor of labelled
CCC common blocks. The syntax of the structure_variable to
CCC common variable name change is:
CCC In STAR code In ALICE code
CCC A(i).B ==> A_B(i)
CCC A(i).B(j) ==> A_B(j,i)
CCC 2. All remaining references in the comments and write statements
CCC to the data structures are interpreted as applying to the
CCC new common variables.
CCC 3. The UNIX random number generator, ran(), was replaced with
CCC a function which calls a modified version of the CERNLIB
CCC random number generator, ranlux, herein called ranlux2. The
CCC latter allows a user supplied seed value.
CCC 4. Increased the following array sizes for the LHC Pb+Pb design
CCC multiplicity criteria of dN_{ch}/dy = 8000 assuming 80% of
CCC this is pi(+) and pi(-), which are the largest populations
CCC that this code is required to process.
CCC
CCC The following are for the max number of tracks that can be
CCC stored in each sector without overflow:
CCC common_mesh.inc - increased max_trk_save from 30 to 150
CCC common_sec_track.inc - inc. max_trk_sec from 30 to 150
CCC common_sec_track2.inc - inc. max_trk_sec2 from 30 to 150
CCC
CCC The following determine the maximum number of tracks that can
CCC be processed in an event:
CCC common_track.inc - increased trk_maxlen from 6500 to 25000
CCC common_track2.inc - increased trk2_maxlen from 6500 to 25000
CCC
C
C DESCRIPTION OF METHOD:
C =====================
C
C This program produces relativistic heavy-ion collision
C events in which the particle momenta for selected particle ID
C types and for selected kinematic acceptance ranges are randomly
C adjusted such that specified one-body distributions and two-body
C correlation functions are reproduced. The input to the code may
C be a set of events from any STAR event generator, so long as the
C format is in the STAR Geant (GSTAR) text format standard (see
C STAR Note #235). The basic method is similar to that of Metropolis
C et al. and is fully described in Ray and Hoffmann, Phys. Rev. C 54,
C 2582 (1996). Briefly the steps in the algorithm include:
C
C (1) For an initial particle distribution of specified particle
C ID types (maximum of two types allowed) and momentum
C acceptance ranges [given in terms of transverse momentum
C (p_T), azimuthal angle (phi) and pseudorapidity (eta)] the
C momentum vector of one particle is randomly shifted within
C a specified range from its initial value. The shifts are
C done for px, py and pz independently.
C
C (2) New one-body and two-body histograms, as well as the two-body
C correlation function are calculated.
C
C (3) If the random momentum shift results in an improved overall
C chi-square, obtained by comparison with a specified reference
C for the one-body distribution and the two-body correlation
C model, then the new momentum vector is retained. If not,
C then the vector is restored to its starting value.
C
C (4) Steps 1-3 are repeated for each accepted particle in the
C event.
C
C (5) The entire process, steps 1-4, is repeated until either a
C satisfactory fit to the model distributions are obtained or
C the maximum number of iterations is reached.
C
C (6) Once the iterative process is complete, the input event file
C is copied directly to an output event file where the adjusted
C momentum values for the accepted tracks replace that in the
C input file. The event output file is in the GSTAR standard
C text format. This event output file may be processed again
C by this code in order to generate correlations for other
C particle types or for different kinematic ranges. The file
C is suitable for input into the STAR version of Geant-3, called
C GSTAR (STAR Note 235).
C
C In order to reduce cpu demand the particle momenta are sorted into
C momentum space cells or sectors. In forming particle pairs only those
C particles in the same, or adjacent cells are used. For large events
C this vastly reduces the required cpu time. The penalty is that the
C coding becomes more complicated. Much of the present code is devoted
C to the necessary bookeeping chores that must be done in order to
C determine which cell the tracks are in and if they move to new cells
C during the track adjustment procedure. Information about the
C momentum space cells are contained in the data structure /sec_trk_map/.
C
C The sector size must therefore be scaled with the specified correlation
C range. All particles will be paired with all possible partners out
C to Q's equal to the smallest dimension of the momentum space sectors.
C Particle pairs with Q greater than this sector dimension will suffer
C reduced acceptance, finally being completely cut-off for Q ~> 2 times
C the diagonal length thru a sector.
C
C In order to generate momentum correlations for particle types
C having low multiplicity it is necessary for the user to supply this
C code with an artificially enhanced multiplicity along with a track-
C write-output fractional acceptance factor (see input variable
C 'trk_accep'). For example, if the user wants to generate HBT
C correlations for K0-shorts but the assumed multiplicity is too
C low for the present algorithm to work, the user may increase the
C input K0-short multiplicity, for instance by a factor of 5, then
C run the code and set trk_accep = 1/5 = 0.2 in order to randomly
C reject about 80% of the K0-shorts. The track rejection is done
C after the track adjustment procedure is completed. This procedure
C should preserve the built-in correlations in the final output
C event file, although with reduced statistics.
C Another approach for handling low multiplicity events would
C be to combine particles from several events, carry out the track
C adjustment procedure, then separate the tracks into their original
C events. This method must insure that no bias is included due to
C the order of processing the tracks from the first, second, etc.
C events. This latter method, once proven, could be used for
C the low multiplicity particles from any event generator. For
C the present version of the code the low multiplicity HBT studies
C must utilize a Monte Carlo multiplicity generator.
C
C The code may also be used to read in a previously correlated
C set of events and either compute the reference histograms or read in
C the references, and then compute the correlations for each event and
C the inclusive correlations without doing the track momentum adjustment
C procedure. This feature may be used, for example, to study the
C correlations that result in one set of coordinates for events fitted
C to correlations with respect to a different set of coordinates. For
C example, fit the correlations to the Y-K-P form and then evaluate
C the side-out-long correlations, or vice-versa.
C
C TWO-BODY REFERENCE HISTOGRAMS:
C =============================
C
C In order to calculate the correlations, an uncorrelated two-body
C reference spectrum is needed. The program will calculate this
C quantity by forming pairs of particles from different events in the
C input file. For the particle ID type(s) and momentum acceptance
C the code forms all possible pairs (given the cell substructure) by
C mixing particles from event#1 with those in event#2, then particles
C from event#2 are mixed with particles from event#3, then events 3
C and 4 are mixed, and so on. In this way ample statistics may be
C achieved for the reference distributions. These reference distributions
C can be written out to file and re-used in subsequent runs. Since
C all events in the input event file are used in generating the
C reference distribution, it is imperative that these events be physically
C similar.
C
C ONE-BODY REFERENCE HISTOGRAMS:
C =============================
C
C Inclusive sums of the accepted particles for all events in the
C input event file determine the one-body reference distributions.
C These are used to constrain the momentum vector shifts. Although
C the one-body distributions from realistic event generators are fully
C three-dimensional, the present code is restricted to only work with
C the one-dimensional projections onto p_T, phi and eta. In other words,
C the p_T distribution used in this code is formed by integrating
C the particle distributions over (phi,eta) over the momentum acceptance
C range. No particle distribution models are built into the code.
C The one-body reference distributions are either read-in or determined
C from the events in the input event text file.
C
C TWO-BODY CORRELATION MODELS:
C ===========================
C
C The code permits both 1-dimensional and 3-dimensional two-body
C correlation models. These may be fitted separately or simultaneously.
C The source may include a mixture of incoherent and coherent components;
C Coulomb corrections are also included. The general form assumed
C [see Cramer and Kadija, Phys. Rev. C 53, 908 (1996)] is:
C
C C2 = 1 + lambda*(b**2) + 2.0*sqrt(lambda)*[1 - sqrt(lambda)]*b
C
C where lambda is the usual chaoticity parameter. The third term in
C this equation may be turned on or off. Values of lambda < 1.0 may
C be used without the third term being included. For 1-dimensional
C functions b is given by:
C
C b = exp(- Q**2 * R**2 / 2)
C
C where Q is either the invariant 4-momentum difference, the total
C 4-momentum difference (i.e. time-like + space-like) or the
C 3-vector momentum difference. The 3-dimensional functions may be
C of the Bertsch-Pratt ``side-out-longitudinal'' form given by:
C
C b = exp[(- Qside**2 * Rside**2 - Qout**2 * Rout**2
C - Qlong**2 * Rlong**2)/2]
C
C where the ``out-long'' cross term is omitted. The 3D function may
C also be in the Yano-Koonin-Podgoretski (YKP) form given by (for
C pairs in the A+A c.m. frame):
C
C b = exp[(- Qperp**2 * Rperp**2 - Qparallel**2 * Rparallel**2
C - Qtime**2 * Rtime**2)/2]
C
C where
C Qperp = transverse momentum difference
C Qparallel = Qlong = p_{1z} - p_{2z}
C Qtime = E_1 - E_2
C
C The Coulomb correction may be omitted, or included in one of 3 ways:
C
C (1) Point source Gamow factor
C (2) Finite source NA35 model (see Eq.(5) in Z. Phys. C73, 443
C (1997)) where
C
C Coulomb correction = 1 + [G(q) - 1]*exp(-q/Q0)
C
C and G(q) is the Gamow factor and q is the 3-momentum
C vector difference.
C (3) Finite source, Pratt integrated Coulomb wave function
C integrals, interpolated for a specific source radius
C from John Cramer's tables for discrete source radii.
C
C These Coulomb correction factors multiply the above correlation
C function to give the total correlation function to be fitted for
C charged, like pairs. For charged, unlike pairs only the Coulomb
C (attractive) correlation function is used.
C
C BINNING:
C =======
C
C Several types of binning are done in the code. The one-body
C distributions are binned in p_t, phi and eta. The full momentum
C space is subdivided into cells or sectors. The 1D and 3D two-body
C distributions are binned into fine and coarse bins, where the fine
C bins occur at the smaller momentum difference range and the coarse
C bins at the larger. For the 3D distributions the (1,1,1) coarse
C bin must coincide with the 3D fine bins.
C
C SUMMARY OF EXTERNAL FILES:
C =========================
C
C File Unit# File Name Description
C ----------------------------------------------------------------------------
C 1 hbt_parameters.in Input switches and controls
C 2 event_text.in Event generator output in GSTAR text
C 3 event_line.flags Generated tmp file, input line flags
C 4 event_tracks.select Generated tmp file, accep. tracks flg.
C 7 hbt_log.out Generated log file - error reports
C 8 hbt_simulation.out Generated main output file
C 9 hbt_pair_reference.hist Generated pair ref. histograms
C 10 event_hbt_text.out Gen. correlated event text file
C 11 hbt_singles_reference.hist Gen. one-body ref. histograms
C 12 event_text_aux.in Tmp copy of event_text.in per event
C 14 event_tracks_aux.select Tmp copy of event_tracks.select/event
C 21-27 cpp_*.dat (*=06,08...18) Like pair Pratt Coulomb corrections.
C 31-37 cpm_*.dat (*=06,08...18) Unlike pair Pratt Coulomb corrects.
C ----------------------------------------------------------------------------
C
C Source of Data for ALICE Application:
C ====================================
C
C File Unit# File Name For ALICE File or Struc?
C ----------------------------------------------------------------------------
C 1 hbt_parameters.in Call AliHbtp_ function
C 2 event_text.in Call AliHbtp_ function
C 3 event_line.flags File not used
C 4 event_tracks.select File not used
C 7 hbt_log.out File used as is
C 8 hbt_simulation.out File used as is
C 9 hbt_pair_reference.hist File used as is
C 10 event_hbt_text.out Call AliHbtp_ function
C 11 hbt_singles_reference.hist File used as is
C 12 event_text_aux.in File not used
C 14 event_tracks_aux.select File not used
C 21-27 cpp_*.dat (*=06,08...18) Files are used as is
C 31-37 cpm_*.dat (*=06,08...18) Files are used as is
C ----------------------------------------------------------------------------
C
C DESCRIPTION OF INPUT PARAMETERS AND SWITCHES (FILE: hbt_parameters.in):
C ======================================================================
C
C Control Switches:
C ================
C
C ref_control = 1 to read reference histograms from input files
C = 2 to compute reference histograms by track
C mixing from event pairs in the event input file.
C
C switch_1d = 0 to not compute the 1D two-body correlations.
C = 1 to compute this using Q-invariant
C = 2 to compute this using Q-total
C = 3 to compute this using Q-3-vector
C
C switch_3d = 0 to not compute the 3D two-body correlations.
C = 1 to compute this using the side-out-long form
C = 2 to compute this using the YKP form.
C
C switch_type = 1 to fit only the like pair correlations
C = 2 to fit only the unlike pair correlations
C = 3 to fit both the like and unlike pair correl.
C
C switch_coherence = 0 for purely incoherent source (but can have
C lambda < 1.0)
C = 1 for mixed incoherent and coherent source
C
C switch_coulomb = 0 no Coulomb correction
C = 1 Point source Gamow correction only
C = 2 NA35 finite source size correction
C = 3 Pratt/Cramer finite source size correction;
C interpolated from input tables.
C
C switch_fermi_bose = 1 Boson pairs
C = -1 Fermion pairs
C
C trk_accep = 1.0 all adjusted tracks are written out
C < 1.0 only this fraction, on average, of the
C adjusted tracks are written out. Used for
C low multiplicity events.
C
C print_full = 0 for standard, minimal output
C = 1 for full, comprehensive (large) output for
C each event.
C
C print_sector_data = 0 std. sector occupancy data printed out
C = 1 to print sector occupancy and overflow info.
C
C Particle ID and Search Parameters:
C =================================
C
C n_pid_types = 1 or 2 only, # particle types to correlate
C
C pid(1), pid(2) = Geant-3 particle ID code numbers
C
C deltap = maximum range for random momentum shifts in
C GeV/c; px,py,pz independent; Def = 0.1 GeV/c.
C
C maxit = maximum # allowed iterations thru all the
C tracks for each event. Default = 50.
C If maxit=0, then calculate the correlations
C for the input set of events without doing the
C track adjustment procedure.
C
C delchi = min % change in total chi-square for which
C the track adjustment iterations may stop,
C Default = 0.1%.
C
C irand = initial random # seed, default = 12345
C
C Source Function Parameters:
C ==========================
C
C lambda = Chaoticity
C
C R_1d = Spherical source model radius (fm)
C
C Rside,Rout,Rlong = Non-spherical Bertsch-Pratt source model (fm)
C
C Rperp,Rparallel,R0= Non-spherical Yano-Koonin-Podgoretski source
C model (fm).
C
C Q0 = NA35 Coulomb parameter for finite source size
C in (GeV/c) - iff switch_coulomb = 2
C = Spherical Coulomb source radius in (fm) iff
C switch_coulomb = 3, used to interpolate the
C input Pratt/Cramer discrete Coulomb source
C radii tables.
C
C One-body pT, phi, eta Acceptance Bins:
C =====================================
C
C n_pt_bins, pt_min, pt_max = # pt bins, min/max pt accept. (GeV/c)
C
C n_phi_bins,phi_min,phi_max = # phi bins, min/max phi accept. (deg.)
C
C n_eta_bins,eta_min,eta_max = # eta bins, min/max eta accept.
C
C [NOTE: For each the maximum # of bins
C must be .le. 100]
C
C Two-body 1D and 3D Correlation Bins:
C ===================================
C
C n_1d_fine, binsize_1d_fine = # and size (GeV/c), 1D - fine mesh
C
C n_1d_coarse,binsize_1d_coarse = # and size (GeV/c), 1D - coarse mesh
C
C n_3d_fine, binsize_3d_fine = # and size (GeV/c), 3D - fine mesh
C
C n_3d_coarse,binsize_3d_coarse = # and size (GeV/c), 3D - coarse mesh
C
C [NOTE: The maximum # of 1D bins (fine
C + coarse) must be .le. 100;
C The maximum # of 3D bins (either
C fine or coarse) must be .le.10).
C For both 1D and 3D there must be
C at least 1 fine bin and 1 coarse
C bin.]
C n_3d_fine_project = # of 3D-fine bins to integrate over
C to form 1D projections. This value
C must be .le. n_3d_fine.
C
C Momentum Space Track-Sector Cells:
C =================================
C
C n_px_bins,px_min,px_max = #, min,max px bins (GeV/c)
C
C n_py_bins,py_min,py_max = #, min,max py bins (GeV/c)
C
C n_pz_bins,pz_min,pz_max = #, min,max pz bins (GeV/c)
C
C [NOTE: The maximum number of total sectors,
C equal to the product of the x-y-z
C number of cells must be .le.
C sec_maxlen which is defined in the
C /sec_trk_map/ data structure.]
C
C Relative Chi-Square Weights:
C ===========================
C
C chisq_wt_like_1d = 1D, like pairs
C chisq_wt_unlike_1d = 1D, unlike pairs
C chisq_wt_like_3d_fine = 3D, like pairs, fine mesh
C chisq_wt_unlike_3d_fine = 3D, unlike pairs, fine mesh
C chisq_wt_like_3d_coarse = 3D, like pairs, coarse mesh
C chisq_wt_unlike_3d_coarse = 3D, unlike pairs, coarse mesh
C chisq_wt_hist1_1 = summed pt, phi, eta 1-body dist., PID#1
C chisq_wt_hist1_2 = summed pt, phi, eta 1-body dist., PID#2
C
C
C FORMAT for hbt_singles_reference.hist:
C =====================================
C
C The output content for the one-body reference histograms is:
C
C Line 1: n_pid_types,pid(1),pid(2)
C 2: n_pt_bins,pt_min,pt_max
C 3: n_phi_bins,phi_min,phi_max
C 4: n_eta_bins,eta_min,eta_max
C 5: n_part_used_1_ref,n_part_used_2_ref
C
C Then for PID #1: (href1_pt_1(i),i=1,n_pt_bins)
C (One entry per line) (href1_phi_1(i),i=1,n_phi_bins)
C (href1_eta_1(i),i=1,n_eta_bins)
C
C and for PID #2: (href1_pt_2(i),i=1,n_pt_bins)
C (One entry per line) (href1_phi_2(i),i=1,n_phi_bins)
C (href1_eta_2(i),i=1,n_eta_bins)
C
C
C FORMAT for hbt_pair_reference.hist:
C ==================================
C
C The output content for the two-body reference histograms is:
C
C Line 1: n_pid_types,pid(1),pid(2)
C 2: n_pt_bins,pt_min,pt_max
C 3: n_phi_bins,phi_min,phi_max
C 4: n_eta_bins,eta_min,eta_max
C 5: switch_1d,switch_3d,switch_type
C 6: n_1d_fine,n_1d_coarse,n_3d_fine,n_3d_coarse
C 7: binsize_1d_fine,binsize_1d_coarse,
C binsize_3d_fine,binsize_3d_coarse
C 8: num_pairs_like_ref,num_pairs_unlike_ref
C
C The pair distributions (with one entry per line) are:
C
C 1D, like pairs: (href_like_1d(i),i=1,n_1d_total)
C
C 1D, unlike pairs: (href_unlike_1d(i),i=1,n_1d_total)
C
C 3D, like pairs, fine mesh: href_like_3d_fine(i,j,k) ; (i,(j,(k,...)))
C
C 3D, like pairs, coarse mesh: href_like_3d_coarse(i,j,k) ; (i,(j,(k,...)))
C
C 3D, unlike, fine mesh: href_unlike_3d_fine(i,j,k) ; (i,(j,(k,...)))
C
C 3D, unlike, coarse mesh: href_unlike_3d_coarse(i,j,k) ; (i,(j,(k,...)))
C
C*************************************************************************
C*************************************************************************
SUBROUTINE CTEST
implicit none
Include 'common_parameters.inc'
Include 'common_mesh.inc'
Include 'common_histograms.inc'
Include 'common_correlations.inc'
Include 'common_coulomb.inc'
Include 'common_track.inc'
Include 'common_track2.inc'
Include 'common_sec_track.inc'
Include 'common_sec_track2.inc'
Include 'common_particle.inc'
write(*,*) ' '
write(*,*) ' '
write(*,*) ' '
write(*,*) 'Input data in Fort'
write(*,*) ' '
write(*,*) ' '
write(*,*) ' '
write(*,*) ' PARAMETERS'
write(*,*) ' '
write(*,*) 'ref_control',ref_control
write(*,*) 'switch_1d',switch_1d
write(*,*) 'switch_3d',switch_3d
write(*,*) 'switch_type',switch_type
write(*,*) 'switch_coherence',switch_coherence
write(*,*) 'switch_coulomb',switch_coulomb
write(*,*) 'switch_fermi_bose',switch_fermi_bose
write(*,*) 'trk_accep',trk_accep
write(*,*) 'print_full',print_full
write(*,*) 'print_sector_data',print_sector_data
write(*,*) 'n_pid_types',n_pid_types
write(*,*) 'pid(1)', pid(1)
write(*,*) 'pid(2)', pid(2)
write(*,*) 'maxit',maxit
write(*,*) 'irand',irand
write(*,*) 'n_part_1_trk', n_part_1_trk
write(*,*) 'n_part_2_trk ', n_part_2_trk
write(*,*) 'n_part_tot_trk ', n_part_tot_trk
write(*,*) 'n_part_used_1_trk ', n_part_used_1_trk
write(*,*) 'n_part_used_2_trk', n_part_used_2_trk
write(*,*) 'n_part_1_trk2', n_part_1_trk2
write(*,*) 'n_part_2_trk2', n_part_2_trk2
write(*,*) 'n_part_tot_trk2', n_part_tot_trk2
write(*,*) 'n_part_used_1_trk2', n_part_used_1_trk2
write(*,*) 'n_part_used_2_trk2', n_part_used_2_trk2
write(*,*) 'n_part_used_1_ref', n_part_used_1_ref
write(*,*) 'n_part_used_2_ref ', n_part_used_2_ref
write(*,*) 'n_part_used_1_inc', n_part_used_1_inc
write(*,*) 'n_part_used_2_inc', n_part_used_2_inc
write(*,*) 'num_pairs_like', num_pairs_like
write(*,*) 'num_pairs_unlike', num_pairs_unlike
write(*,*) 'num_pairs_like_ref ', num_pairs_like_ref
write(*,*) 'num_pairs_like_inc ', num_pairs_like_inc
write(*,*) 'num_pairs_unlike_inc', num_pairs_unlike_inc
write(*,*) 'event_line_counter', event_line_counter
write(*,*) 'file10_line_counter ',file10_line_counter
write(*,*) 'lambda',lambda
write(*,*) 'R_1d ',R_1d
write(*,*) 'Rside',Rside
write(*,*) 'Rout ', Rout
write(*,*) 'Rlong ', Rlong
write(*,*) 'Rperp ', Rperp
write(*,*) 'Rparallel ', Rparallel
write(*,*) 'R0 ', R0
write(*,*) 'Q0 ', Q0
write(*,*) 'deltap',deltap
write(*,*) 'delchi',delchi
write(*,*) 'pi ', pi
write(*,*) 'rad ', rad
write(*,*) 'hbc ', hbc
write(*,*) 'chisq_wt_like_1d ', chisq_wt_like_1d
write(*,*) 'chisq_wt_unlike_1d ', chisq_wt_unlike_1d
write(*,*) 'chisq_wt_like_3d_fine ',chisq_wt_like_3d_fine
write(*,*) 'chisq_wt_unlike_3d_fine ', chisq_wt_unlike_3d_fine
write(*,*) 'chisq_wt_like_3d_coarse ', chisq_wt_like_3d_coarse
write(*,*) 'chisq_wt_unlike_3d_coarse',chisq_wt_unlike_3d_coarse
write(*,*) 'chisq_wt_hist1_1 ', chisq_wt_hist1_1
write(*,*) 'chisq_wt_hist1_2 ', chisq_wt_hist1_2
write(*,*) ' '
write(*,*) ' '
write(*,*) ' '
write(*,*) ' MESH '
write(*,*) ' '
write(*,*) ' n_pt_bins ', n_pt_bins
write(*,*) ' pt_min ', pt_min
write(*,*) ' pt_max ', pt_max
write(*,*) ' n_phi_bins ', n_phi_bins
write(*,*) ' phi_min ', phi_min
write(*,*) ' phi_max ', phi_max
write(*,*) ' n_eta_bins ', n_eta_bins
write(*,*) ' eta_min', eta_min
write(*,*) ' eta_max', eta_max
write(*,*) ' n_1d_fine ', n_1d_fine
write(*,*) ' binsize_1d_fine ',binsize_1d_fine
write(*,*) ' n_1d_coarse ',n_1d_coarse
write(*,*) ' binsize_1d_coarse ', binsize_1d_coarse
write(*,*) ' n_3d_fine ',n_3d_fine
write(*,*) ' binsize_3d_fine ',binsize_3d_fine
write(*,*) ' n_3d_coarse ', n_3d_coarse
write(*,*) ' binsize_3d_coarse ', binsize_3d_coarse
write(*,*) ' n_3d_fine_project ',n_3d_fine_project
write(*,*) ' n_px_bins ',n_px_bins
write(*,*) ' px_min ',px_min
write(*,*) ' px_max ', px_max
write(*,*) ' n_py_bins ', n_py_bins
write(*,*) ' py_min ', py_min
write(*,*) ' py_max', py_max
write(*,*) ' n_pz_bins ',n_pz_bins
write(*,*) ' pz_min ', pz_min
write(*,*) ' pz_max ', pz_max
write(*,*) ' '
End
SUBROUTINE HBTPROCESSOR
implicit none
Include 'common_parameters.inc'
Include 'common_mesh.inc'
Include 'common_histograms.inc'
Include 'common_correlations.inc'
Include 'common_coulomb.inc'
Include 'common_track.inc'
Include 'common_track2.inc'
Include 'common_sec_track.inc'
Include 'common_sec_track2.inc'
Include 'common_particle.inc'
CCC Set Data I/O control for ALICE or Standalone application
C ALICE = 1 ! This is for the ALICE AliRoot application
CCC ALICE = 0 ! This is for the standalone application
CCC Initialize error code for ALICE application:
errorcode = 0
CCC Open Output Files:
open(unit=7,status='unknown',access='sequential',
1 file='hbt_log.out')
open(unit=8,status='unknown',access='sequential',
1 file='hbt_simulation.out')
CCC Initialize Arrays and Data Structures:
If(ALICE .eq. 1) then
C In fact we not need to call initialization,
C because we can easily assume that is already done
Call alihbtp_initialize
Else If (ALICE .eq. 0) Then
Call initialize
End If
Write(6,100)
CCC Read Input Controls and Parameters:
Call read_data(1)
If(errorcode .eq. 1) Return
CCC Setup values and check input parameter ranges and consistency:
Call set_values
If(errorcode .eq. 1) Return
CCC Produce Basic Output File Header:
Call write_data(1,0)
If(errorcode .eq. 1) Return
Write(6,101)
CCC Read Event Input file and fill flag files:
Call read_data(2)
If(errorcode .eq. 1) Return
Write(6,102)
CCC Get the Reference Histograms and write out if new calculation:
Call getref_hist
If(errorcode .eq. 1) Return
Call write_data(3,0)
If(errorcode .eq. 1) Return
Write(6,103)
Write(6,104)
CCC Compute the correlation model and print out:
Call correl_model
Call write_data(4,0)
If(errorcode .eq. 1) Return
Write(6,105)
CCC Carry out the Track Adjustment/Correlation Fitting Procedure:
Call correlation_fit
Write(6,106)
CCC Final Output of Inclusive Quantities:
Call write_data(6,0)
If(errorcode .eq. 1) Return
CCC Close Output Files:
close(unit=7)
close(unit=8)
CCC Formats:
100 Format(5x,'Read Input Controls, Setup values, check input:')
101 Format(5x,'Read Event Input file and fill flag files:')
102 Format(5x,'Get the Reference Histograms:')
103 Format(5x,'Finished with Reference Histograms:')
104 Format(5x,'Compute the correlation model:')
105 Format(5x,'Start Track Adjustment/Correlation Fitting Procedure:')
106 Format(5x,'Finished with Track Fitting Procedure:')
Return
END
C-------------------------------------------------------------------
subroutine initialize
implicit none
CCC This subroutine sets all arrays and structures to zero:
Include 'common_mesh.inc'
Include 'common_histograms.inc'
Include 'common_correlations.inc'
Include 'common_coulomb.inc'
Include 'common_event_summary.inc'
Include 'common_track.inc'
Include 'common_track2.inc'
Include 'common_sec_track.inc'
Include 'common_sec_track2.inc'
Include 'common_particle.inc'
CCC Local Variable Type Declarations:
integer*4 i,j,k
do i = 1,trk_maxlen
trk_id(i) = 0
trk_px_sec(i) = 0
trk_py_sec(i) = 0
trk_pz_sec(i) = 0
trk_sector(i) = 0
trk_flag(i) = 0
trk_out_flag(i) = 0
trk_merge_flag(i) = 0
trk_ge_pid(i) = 0
trk_start_vertex(i) = 0
trk_stop_vertex(i) = 0
trk_event_line(i) = 0
trk_px(i) = 0.0
trk_py(i) = 0.0
trk_pz(i) = 0.0
trk_E(i) = 0.0
trk_pt(i) = 0.0
trk_phi(i) = 0.0
trk_eta(i) = 0.0
end do
do i = 1,trk2_maxlen
trk2_id(i) = 0
trk2_px_sec(i) = 0
trk2_py_sec(i) = 0
trk2_pz_sec(i) = 0
trk2_sector(i) = 0
trk2_flag(i) = 0
trk2_out_flag(i) = 0
trk2_merge_flag(i) = 0
trk2_ge_pid(i) = 0
trk2_start_vertex(i) = 0
trk2_stop_vertex(i) = 0
trk2_event_line(i) = 0
trk2_px(i) = 0.0
trk2_py(i) = 0.0
trk2_pz(i) = 0.0
trk2_E(i) = 0.0
trk2_pt(i) = 0.0
trk2_phi(i) = 0.0
trk2_eta(i) = 0.0
end do
do i = 1,sec_maxlen
stm_sec_id(i) = 0
stm_n_trk_sec(i) = 0
stm_flag(i) = 0
do j = 1,max_trk_sec
stm_track_id(j,i) = 0
end do
end do
do i = 1,sec_maxlen2
stm2_sec_id(i) = 0
stm2_n_trk_sec(i) = 0
stm2_flag(i) = 0
do j = 1,max_trk_sec2
stm2_track_id(j,i) = 0
end do
end do
do i = 1,part_maxlen
part_id(i) = 0
part_charge(i) = 0
part_mass(i) = 0.0
part_lifetime(i) = 0.0
end do
do i = 1,max_trk_save
old_sec_trkid(i) = 0
new_sec_trkid(i) = 0
end do
do i = 1,max_h_1d
hist_like_1d(i) = 0
hist_unlike_1d(i) = 0
htmp_like_1d(i) = 0
htmp_unlike_1d(i) = 0
href_like_1d(i) = 0
href_unlike_1d(i) = 0
hinc_like_1d(i) = 0
hinc_unlike_1d(i) = 0
hist1_pt_1(i) = 0
hist1_pt_2(i) = 0
hist1_phi_1(i) = 0
hist1_phi_2(i) = 0
hist1_eta_1(i) = 0
hist1_eta_2(i) = 0
htmp1_pt_1(i) = 0
htmp1_pt_2(i) = 0
htmp1_phi_1(i) = 0
htmp1_phi_2(i) = 0
htmp1_eta_1(i) = 0
htmp1_eta_2(i) = 0
href1_pt_1(i) = 0
href1_pt_2(i) = 0
href1_phi_1(i) = 0
href1_phi_2(i) = 0
href1_eta_1(i) = 0
href1_eta_2(i) = 0
hinc1_pt_1(i) = 0
hinc1_pt_2(i) = 0
hinc1_phi_1(i) = 0
hinc1_phi_2(i) = 0
hinc1_eta_1(i) = 0
hinc1_eta_2(i) = 0
end do
do i = 1,max_h_3d
do j = 1,max_h_3d
do k = 1,max_h_3d
hist_like_3d_fine(i,j,k) = 0
hist_unlike_3d_fine(i,j,k) = 0
hist_like_3d_coarse(i,j,k) = 0
hist_unlike_3d_coarse(i,j,k) = 0
htmp_like_3d_fine(i,j,k) = 0
htmp_unlike_3d_fine(i,j,k) = 0
htmp_like_3d_coarse(i,j,k) = 0
htmp_unlike_3d_coarse(i,j,k) = 0
href_like_3d_fine(i,j,k) = 0
href_unlike_3d_fine(i,j,k) = 0
href_like_3d_coarse(i,j,k) = 0
href_unlike_3d_coarse(i,j,k) = 0
hinc_like_3d_fine(i,j,k) = 0
hinc_unlike_3d_fine(i,j,k) = 0
hinc_like_3d_coarse(i,j,k) = 0
hinc_unlike_3d_coarse(i,j,k) = 0
end do
end do
end do
do i = 1,max_c2_1d
c2mod_like_1d(i) = 0.0
c2mod_unlike_1d(i) = 0.0
c2fit_like_1d(i) = 0.0
c2fit_unlike_1d(i) = 0.0
c2err_like_1d(i) = 0.0
c2err_unlike_1d(i) = 0.0
end do
do i = 1,max_c2_3d
do j = 1,max_c2_3d
do k = 1,max_c2_3d
c2mod_like_3d_fine(i,j,k) = 0.0
c2mod_unlike_3d_fine(i,j,k) = 0.0
c2mod_like_3d_coarse(i,j,k) = 0.0
c2mod_unlike_3d_coarse(i,j,k) = 0.0
c2fit_like_3d_fine(i,j,k) = 0.0
c2fit_unlike_3d_fine(i,j,k) = 0.0
c2fit_like_3d_coarse(i,j,k) = 0.0
c2fit_unlike_3d_coarse(i,j,k) = 0.0
c2err_like_3d_fine(i,j,k) = 0.0
c2err_unlike_3d_fine(i,j,k) = 0.0
c2err_like_3d_coarse(i,j,k) = 0.0
c2err_unlike_3d_coarse(i,j,k) = 0.0
end do
end do
end do
do i = 1,max_c2_coul
c2_coul_like(i) = 0.0
c2_coul_unlike(i) = 0.0
q_coul(i) = 0.0
end do
do i = 1,max_events
num_iter(i) = 0.0
n_part_used_1_store(i) = 0.0
n_part_used_2_store(i) = 0.0
num_sec_flagged_store(i) = 0.0
frac_trks_out(i) = 0.0
frac_trks_flag(i) = 0.0
chisq_like_1d_store(i) = 0.0
chisq_unlike_1d_store(i) = 0.0
chisq_like_3d_fine_store(i) = 0.0
chisq_unlike_3d_fine_store(i) = 0.0
chisq_like_3d_coarse_store(i) = 0.0
chisq_unlike_3d_coarse_store(i) = 0.0
chisq_hist1_1_store(i) = 0.0
chisq_hist1_2_store(i) = 0.0
chisq_total_store(i) = 0.0
end do
Return
END
C---------------------------------------------------------------------
subroutine set_values
implicit none
CCC This subroutine sets parameters based on the main input.
CCC The consistency of the input parameters and controls is
CCC checked. Any problems are reported in the Log File,
CCC 'hbt_log.out'. Most inconsistencies or array size limit
CCC overflows will cause the code execution to STOP.
Include 'common_parameters.inc'
Include 'common_mesh.inc'
Include 'common_histograms.inc'
Include 'common_correlations.inc'
Include 'common_coulomb.inc'
Include 'common_track.inc'
Include 'common_track2.inc'
Include 'common_sec_track.inc'
Include 'common_sec_track2.inc'
Include 'common_particle.inc'
CCC Local Variable Type Declarations:
integer*4 iphistep, ptmaxsteps, iptstep
real*4 px1,py1,pz1,E1, pt1,phi1
real*4 px2,py2,pz2,E2
real*4 pt_step,phi_step
real*4 pxstepmin, pxstepmax, pystepmin, pystepmax
CCC Check Input Controls:
if(ref_control .lt. 1 .or. ref_control .gt. 2) then
write(7,101) ref_control
errorcode = 1
Return
end if
if(switch_1d .lt. 0 .or. switch_1d .gt. 3) then
write(7,102) switch_1d
errorcode = 1
Return
end if
if(switch_3d .lt. 0 .or. switch_3d .gt. 2) then
write(7,103) switch_3d
errorcode = 1
Return
end if
if(switch_type .lt. 1 .or. switch_type .gt. 3) then
write(7,104) switch_type
errorcode = 1
Return
end if
if(switch_coherence .lt. 0 .or. switch_coherence .gt. 1) then
write(7,105) switch_coherence
errorcode = 1
Return
end if
if(switch_coulomb .lt. 0 .or. switch_coulomb .gt. 3) then
write(7,106) switch_coulomb
errorcode = 1
Return
end if
if(switch_fermi_bose.ne.-1 .and. switch_fermi_bose.ne.1) then
write(7,107) switch_fermi_bose
errorcode = 1
Return
end if
if(n_pid_types .lt. 1 .or. n_pid_types .gt. 2) then
write(7,108) n_pid_types
errorcode = 1
Return
end if
if(switch_type .ge. 2 .and. n_pid_types .eq. 1) then
write(7,109) switch_type, n_pid_types
errorcode = 1
Return
end if
if(n_pid_types .eq. 1) then
if(pid(1).gt.0 .and. pid(2).gt.0) then
write(7,1091) pid(1),pid(2)
errorcode = 1
Return
end if
end if
if(pid(1).eq.0 .and. pid(2).eq.0) then