00001
00002
00003
00004
00005
00006
00007
00008 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEBParameters.h"
00009 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TEBNumbering.h"
00010 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TCnaParameters.h"
00011 #include "CalibCalorimetry/EcalCorrelatedNoiseAnalysisAlgos/interface/TCnaRunEB.h"
00012 #include <math.h>
00013
00014 R__EXTERN TCnaRootFile *gCnaRootFile;
00015
00016 ClassImp(TCnaRunEB)
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551
00552
00553
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635
00636
00637
00638
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669
00670
00671
00672
00673
00674
00675
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724 TCnaRunEB::TCnaRunEB()
00725 {
00726
00727 Init();
00728 }
00729
00730 void TCnaRunEB::Init()
00731 {
00732
00733
00734 fCnew = 0;
00735 fCdelete = 0;
00736 fCnaCommand = 0;
00737 fCnaError = 0;
00738
00739 fTTBELL = '\007';
00740
00741
00742 fgMaxCar = (Int_t)512;
00743
00744 Int_t MaxCar = fgMaxCar;
00745 fRootFileName.Resize(MaxCar);
00746 fRootFileName = "?";
00747
00748 MaxCar = fgMaxCar;
00749 fRootFileNameShort.Resize(MaxCar);
00750 fRootFileNameShort = "?";
00751
00752 MaxCar = fgMaxCar;
00753 fAsciiFileName.Resize(MaxCar);
00754 fAsciiFileName = "?";
00755
00756 MaxCar = fgMaxCar;
00757 fAsciiFileNameShort.Resize(MaxCar);
00758 fAsciiFileNameShort = "?";
00759
00760 fDim_name = fgMaxCar;
00761
00762
00763
00764 TCnaParameters* MyParameters = new TCnaParameters(); fCnew++;
00765
00766 fCodePrintNoComment = MyParameters->GetCodePrint("NoComment");
00767 fCodePrintWarnings = MyParameters->GetCodePrint("Warnings ");
00768 fCodePrintComments = MyParameters->GetCodePrint("Comments");
00769 fCodePrintAllComments = MyParameters->GetCodePrint("AllComments");
00770
00771 delete MyParameters; fCdelete++;
00772
00773 fMiscDiag = 0;
00774
00775
00776 fMaxMsgIndexForMiscDiag = (Int_t)10;
00777 fNbOfMiscDiagCounters = (Int_t)50;
00778
00779 fMiscDiag = new Int_t[fNbOfMiscDiagCounters]; fCnew++;
00780 for (Int_t iz=0; iz<fNbOfMiscDiagCounters; iz++){fMiscDiag[iz] = (Int_t)0;}
00781
00782
00783
00784 fT3d_distribs = 0;
00785 fT3d2_distribs = 0;
00786 fT3d1_distribs = 0;
00787
00788 fVal_data = 0;
00789 fVal_dat2 = 0;
00790
00791 fT2d_EvtNbInLoop = 0;
00792 fT1d_EvtNbInLoop = 0;
00793
00794 fT1d_SMtowFromIndex = 0;
00795
00796 fT2d_LastEvtNumber = 0;
00797 fT1d_LastEvtNumber = 0;
00798
00799 fT2d_ev = 0;
00800 fT1d_ev = 0;
00801 fT2d_var = 0;
00802 fT1d_var = 0;
00803
00804 fT3d_his_s = 0;
00805 fT2d_his_s = 0;
00806 fT1d_his_s = 0;
00807
00808 fT2d_xmin = 0;
00809 fT1d_xmin = 0;
00810
00811 fT2d_xmax = 0;
00812 fT1d_xmax = 0;
00813
00814 fT3d_cov_ss = 0;
00815 fT3d2_cov_ss = 0;
00816 fT3d1_cov_ss = 0;
00817
00818 fT3d_cor_ss = 0;
00819 fT3d2_cor_ss = 0;
00820 fT3d1_cor_ss = 0;
00821
00822 fT3d_cov_cc = 0;
00823 fT3d2_cov_cc = 0;
00824 fT3d1_cov_cc = 0;
00825
00826 fT3d_cor_cc = 0;
00827 fT3d2_cor_cc = 0;
00828 fT3d1_cor_cc = 0;
00829
00830 fT2d_cov_cc_mos = 0;
00831 fT2d1_cov_cc_mos = 0;
00832
00833 fT2d_cor_cc_mos = 0;
00834 fT2d1_cor_cc_mos = 0;
00835
00836 fT2d_cov_moscc_mot = 0;
00837 fT2d1_cov_moscc_mot = 0;
00838
00839 fT2d_cor_moscc_mot = 0;
00840 fT2d1_cor_moscc_mot = 0;
00841
00842 fT1d_ev_ev = 0;
00843 fT1d_ev_sig = 0;
00844 fT1d_ev_cor_ss = 0;
00845
00846 fT1d_sig_ev = 0;
00847 fT1d_sig_sig = 0;
00848 fT1d_sig_cor_ss = 0;
00849
00850 fT2d_sv_correc_covss_s = 0;
00851 fT2d1_sv_correc_covss_s = 0;
00852
00853 fT3d_cov_correc_covss_s = 0;
00854 fT3d2_cov_correc_covss_s = 0;
00855 fT3d1_cov_correc_covss_s = 0;
00856
00857 fT3d_cor_correc_covss_s = 0;
00858 fT3d2_cor_correc_covss_s = 0;
00859 fT3d1_cor_correc_covss_s = 0;
00860
00861 fT2dCrysNumbersTable = 0;
00862 fT1dCrysNumbersTable = 0;
00863
00864 fjustap_2d_ev = 0;
00865 fjustap_1d_ev = 0;
00866
00867 fjustap_2d_var = 0;
00868 fjustap_1d_var = 0;
00869
00870 fjustap_2d_cc = 0;
00871 fjustap_1d_cc = 0;
00872
00873 fjustap_2d_ss = 0;
00874 fjustap_1d_ss = 0;
00875
00876
00877
00878 fCodeHeaderAscii = 0;
00879 fCodeRoot = 1;
00880 fCodeCorresp = 2;
00881
00882 fCodeSampTime = 3;
00883
00884 fCodeEv = 4;
00885 fCodeVar = 5;
00886 fCodeEvts = 6;
00887
00888 fCodeCovCss = 7;
00889 fCodeCorCss = 8;
00890 fCodeCovScc = 9;
00891 fCodeCorScc = 10;
00892 fCodeCovSccMos = 11;
00893 fCodeCorSccMos = 12;
00894
00895 fCodeCovMosccMot = 13;
00896 fCodeCorMosccMot = 14;
00897
00898 fCodeEvCorCss = 15;
00899 fCodeSigCorCss = 16;
00900
00901 fCodeSvCorrecCovCss = 17;
00902 fCodeCovCorrecCovCss = 18;
00903 fCodeCorCorrecCovCss = 19;
00904
00905
00906
00907
00908 fTagTowerNumbers = 0;
00909 fTagLastEvtNumber = 0;
00910 fTagEvtNbInLoop = 0;
00911
00912 fTagSampTime = 0;
00913
00914 fTagEv = 0;
00915 fTagVar = 0;
00916 fTagEvts = 0;
00917
00918 fTagCovCss = 0;
00919 fTagCorCss = 0;
00920
00921 fTagCovScc = 0;
00922 fTagCorScc = 0;
00923 fTagCovSccMos = 0;
00924 fTagCorSccMos = 0;
00925
00926 fTagCovMosccMot = 0;
00927 fTagCorMosccMot = 0;
00928
00929 fTagEvEv = 0;
00930 fTagEvSig = 0;
00931 fTagEvCorCss = 0;
00932
00933 fTagSigEv = 0;
00934 fTagSigSig = 0;
00935 fTagSigCorCss = 0;
00936
00937 fTagSvCorrecCovCss = 0;
00938 fTagCovCorrecCovCss = 0;
00939 fTagCorCorrecCovCss = 0;
00940
00941
00942
00943 fFlagPrint = fCodePrintWarnings;
00944
00945 fFileHeader = new TCnaHeaderEB(); fCnew++;
00946
00947 fOpenRootFile = kFALSE;
00948
00949 fReadyToReadData = 0;
00950
00951 fSectChanSizeX = 0;
00952 fSectChanSizeY = 0;
00953 fSectSampSizeX = 0;
00954 fSectSampSizeY = 0;
00955
00956 fUserSamp = 0;
00957 fUserSMEcha = 0;
00958
00959 fSpecialSMTowerNotIndexed = -1;
00960
00961 fTowerIndexBuilt = 0;
00962
00963 }
00964
00965
00966
00967 void TCnaRunEB::fCopy(const TCnaRunEB& rund)
00968 {
00969
00970
00971 #define NOCO
00972 #ifndef NOCO
00973 fFileHeader = rund.fFileHeader;
00974 fOpenRootFile = rund.fOpenRootFile;
00975
00976 fUserSamp = rund.fUserSamp;
00977 fUserSMEcha = rund.fUserSMEcha;
00978
00979 fSectChanSizeX = rund.fSectChanSizeX;
00980 fSectChanSizeY = rund.fSectChanSizeY;
00981 fSectSampSizeX = rund.fSectSampSizeX;
00982 fSectSampSizeY = rund.fSectSampSizeY;
00983
00984 fT1d_SMtowFromIndex = rund.fT1d_SMtowFromIndex;
00985
00986 fT2d_EvtNbInLoop = rund.fT2d_EvtNbInLoop;
00987 fT1d_EvtNbInLoop = rund.fT1d_EvtNbInLoop;
00988
00989 fT3d_distribs = rund.fT3d_distribs;
00990 fT3d2_distribs = rund.fT3d2_distribs;
00991 fT3d1_distribs = rund.fT3d1_distribs;
00992
00993 fVal_data = rund.fVal_data;
00994 fVal_dat2 = rund.fVal_dat2;
00995
00996 fT2d_LastEvtNumber = rund.fT2d_LastEvtNumber;
00997 fT1d_LastEvtNumber = rund.fT1d_LastEvtNumber;
00998
00999 fT2d_ev = rund.fT2d_ev;
01000 fT1d_ev = rund.fT1d_ev;
01001
01002 fT2d_var = rund.fT2d_var;
01003 fT1d_var = rund.fT1d_var;
01004
01005 fT3d_his_s = rund.fT3d_his_s;
01006 fT2d_his_s = rund.fT2d_his_s;
01007 fT1d_his_s = rund.fT1d_his_s;
01008
01009 fT2d_xmin = rund.fT2d_xmin;
01010 fT1d_xmin = rund.fT1d_xmin;
01011 fT2d_xmax = rund.fT2d_xmax;
01012 fT1d_xmax = rund.fT1d_xmax;
01013
01014 fT3d_cov_ss = rund.fT3d_cov_ss;
01015 fT3d2_cov_ss = rund.fT3d2_cov_ss;
01016 fT3d1_cov_ss = rund.fT3d1_cov_ss;
01017
01018 fT3d_cor_ss = rund.fT3d_cor_ss;
01019 fT3d2_cor_ss = rund.fT3d2_cor_ss;
01020 fT3d1_cor_ss = rund.fT3d1_cor_ss;
01021
01022 fT3d_cov_cc = rund.fT3d_cov_cc;
01023 fT3d2_cov_cc = rund.fT3d2_cov_cc;
01024 fT3d1_cov_cc = rund.fT3d1_cov_cc;
01025
01026 fT3d_cor_cc = rund.fT3d_cor_cc;
01027 fT3d2_cor_cc = rund.fT3d2_cor_cc;
01028 fT3d1_cor_cc = rund.fT3d1_cor_cc;
01029
01030 fT2d_cov_cc_mos = rund.fT2d_cov_cc_mos;
01031 fT2d1_cov_cc_mos = rund.fT2d1_cov_cc_mos;
01032
01033 fT2d_cor_cc_mos = rund.fT2d_cor_cc_mos;
01034 fT2d1_cor_cc_mos = rund.fT2d1_cor_cc_mos;
01035
01036 fT2d_cov_moscc_mot = rund.fT2d_cov_moscc_mot;
01037 fT2d1_cov_moscc_mot = rund.fT2d1_cov_moscc_mot;
01038
01039 fT2d_cor_moscc_mot = rund.fT2d_cor_moscc_mot;
01040 fT2d1_cor_moscc_mot = rund.fT2d1_cor_moscc_mot;
01041
01042 fT1d_ev_ev = rund.fT1d_ev_ev;
01043 fT1d_ev_sig = rund.fT1d_ev_sig;
01044 fT1d_ev_cor_ss = rund.fT1d_ev_cor_ss;
01045
01046 fT1d_sig_ev = rund.fT1d_sig_ev;
01047 fT1d_sig_sig = rund.fT1d_sig_sig;
01048 fT1d_sig_cor_ss = rund.fT1d_sig_cor_ss;
01049
01050 fT2d_sv_correc_covss_s = rund.fT2d_sv_correc_covss_s;
01051 fT2d1_sv_correc_covss_s = rund.fT2d1_sv_correc_covss_s;
01052
01053 fT3d_cov_correc_covss_s = rund.fT3d_cov_correc_covss_s;
01054 fT3d2_cov_correc_covss_s = rund.fT3d2_cov_correc_covss_s;
01055 fT3d1_cov_correc_covss_s = rund.fT3d1_cov_correc_covss_s;
01056
01057 fT3d_cor_correc_covss_s = rund.fT3d_cor_correc_covss_s;
01058 fT3d2_cor_correc_covss_s = rund.fT3d2_cor_correc_covss_s;
01059 fT3d1_cor_correc_covss_s = rund.fT3d1_cor_correc_covss_s;
01060
01061 fT2dCrysNumbersTable = rund.fT2dCrysNumbersTable;
01062 fT1dCrysNumbersTable = rund.fT1dCrysNumbersTable;
01063
01064 fjustap_2d_ev = rund.fjustap_2d_ev;
01065 fjustap_1d_ev = rund.fjustap_1d_ev;
01066
01067 fjustap_2d_var = rund.fjustap_2d_var;
01068 fjustap_1d_var = rund.fjustap_1d_var;
01069
01070 fjustap_2d_cc = rund.fjustap_2d_cc;
01071 fjustap_1d_cc = rund.fjustap_1d_cc;
01072
01073 fjustap_2d_ss = rund.fjustap_2d_ss;
01074 fjustap_1d_ss = rund.fjustap_1d_ss;
01075
01076
01077 fCodeHeaderAscii = rund.fCodeHeaderAscii;
01078 fCodeRoot = rund.fCodeRoot;
01079 fCodeSampTime = rund.fCodeSampTime;
01080 fCodeEv = rund.fCodeEv;
01081 fCodeVar = rund.fCodeVar;
01082 fCodeEvts = rund.fCodeEvts;
01083 fCodeCovCss = rund.fCodeCovCss;
01084 fCodeCorCss = rund.fCodeCorCss;
01085 fCodeCovScc = rund.fCodeCovScc;
01086 fCodeCorScc = rund.fCodeCorScc;
01087 fCodeCovSccMos = rund.fCodeCovSccMos;
01088 fCodeCorSccMos = rund.fCodeCorSccMos;
01089 fCodeCovMosccMot = rund.fCodeCovMosccMot;
01090 fCodeCorMosccMot = rund.fCodeCorMosccMot;
01091 fCodeEvCorCss = rund.fCodeEvCorCss;
01092 fCodeSigCorCss = rund.fCodeSigCorCss;
01093 fCodeSvCorrecCovCss = rund.fCodeSvCorrecCovCss;
01094 fCodeCovCorrecCovCss = rund.fCodeCovCorrecCovCss;
01095 fCodeCorCorrecCovCss = rund.fCodeCorCorrecCovCss;
01096 fCodePrintComments = rund.fCodePrintComments;
01097 fCodePrintWarnings = rund.fCodePrintWarnings;
01098 fCodePrintAllComments = rund.fCodePrintAllComments;
01099 fCodePrintNoComment = rund.fCodePrintNoComment;
01100
01101
01102 fTagTowerNumbers = rund.fTagTowerNumbers;
01103 fTagLastEvtNumber = rund.fTagLastEvtNumber;
01104 fTagEvtNbInLoop = rund.fTagEvtNbInLoop;
01105 fTagEv = rund.fTagEv;
01106 fTagVar = rund.fTagVar;
01107 fTagEvts = rund.fTagEvts;
01108 fTagCovCss = rund.fTagCovCss;
01109 fTagCorCss = rund.fTagCorCss;
01110 fTagCovScc = rund.fTagCovScc;
01111 fTagCorScc = rund.fTagCorScc;
01112 fTagCovSccMos = rund.fTagCovSccMos;
01113 fTagCorSccMos = rund.fTagCorSccMos;
01114 fTagCovMosccMot = rund.fTagCovMosccMot;
01115 fTagCorMosccMot = rund.fTagCorMosccMot;
01116 fTagEvEv = rund.fTagEvEv;
01117 fTagEvSig = rund.fTagEvSig;
01118 fTagEvCorCss = rund.fTagEvCorCss;
01119 fTagSigEv = rund.fTagSigEv;
01120 fTagSigSig = rund.fTagSigSig;
01121 fTagSigCorCss = rund.fTagSigCorCss;
01122 fTagSvCorrecCovCss = rund.fTagSvCorrecCovCss;
01123 fTagCovCorrecCovCss = rund.fTagCovCorrecCovCss;
01124 fTagCorCorrecCovCss = rund.fTagCorCorrecCovCss;
01125 fFlagPrint = rund.fFlagPrint;
01126
01127 fRootFileName = rund.fRootFileName;
01128 fRootFileNameShort = rund.fRootFileNameShort;
01129 fAsciiFileName = rund.fAsciiFileName;
01130 fAsciiFileNameShort = rund.fAsciiFileNameShort;
01131
01132 fDim_name = rund.fDim_name;
01133
01134 fCfgResultsRootFilePath = rund.fCfgResultsRootFilePath;
01135 fCfgResultsAsciiFilePath = rund.fCfgResultsAsciiFilePath;
01136
01137 fFileForResultsRootFilePath = rund.fFileForResultsRootFilePath;
01138 fFileForResultsAsciiFilePath = rund.fFileForResultsAsciiFilePath;
01139
01140 fCnew = rund.fCnew;
01141 fCdelete = rund.fCdelete;
01142 #endif // NOCO
01143 }
01144
01145
01146
01147
01148
01149
01150
01151
01152 TCnaRunEB::TCnaRunEB(const TCnaRunEB& dcop)
01153 {
01154 cout << "*TCnaRunEB::TCnaRunEB(const TCnaRunEB& dcop)> "
01155 << " It is time to write a copy constructor" << endl
01156 << " type an integer value and then RETURN to continue"
01157 << endl;
01158
01159 { Int_t cintoto; cin >> cintoto; }
01160
01161 }
01162
01163
01164
01165
01166
01167
01168
01169 TCnaRunEB& TCnaRunEB::operator=(const TCnaRunEB& dcop)
01170 {
01171
01172
01173 fCopy(dcop);
01174 return *this;
01175 }
01176
01177
01178
01179
01180
01181
01182 TCnaRunEB::~TCnaRunEB()
01183 {
01184
01185
01186 if(fFlagPrint == fCodePrintAllComments || fFlagPrint == fCodePrintComments ||
01187 fFlagPrint == fCodePrintWarnings )
01188 {
01189 cout << "*TCnaRunEB::~TCnaRunEB()> Entering destructor." << endl;
01190 }
01191
01192 if(fFlagPrint == fCodePrintAllComments)
01193 {
01194 Int_t misc_czero = 0;
01195 for(Int_t i = 0; i < fNbOfMiscDiagCounters; i++)
01196 {
01197 if( fMiscDiag[i] != 0 )
01198 {
01199 cout << " fMiscDiag Counter "
01200 << setw(3) << i << " = " << setw(9) << fMiscDiag[i]
01201 << " (INFO: alloc on non zero freed zone) " << endl;
01202 }
01203 else
01204 {
01205 misc_czero++;
01206 }
01207 }
01208 cout << " Nb of fMiscDiag counters at zero: "
01209 << misc_czero << " (total nb of counters: "
01210 << fNbOfMiscDiagCounters << ")" << endl;
01211 }
01212
01213 if (fMiscDiag != 0){delete [] fMiscDiag; fCdelete++;}
01214
01215 if (fFileHeader != 0){delete fFileHeader; fCdelete++;}
01216
01217 if (fT1d_SMtowFromIndex != 0){delete [] fT1d_SMtowFromIndex; fCdelete++;}
01218
01219 if (fVal_data != 0){delete [] fVal_data; fCdelete++;}
01220 if (fVal_dat2 != 0){delete [] fVal_dat2; fCdelete++;}
01221
01222 if (fT2d_LastEvtNumber != 0){delete [] fT2d_LastEvtNumber; fCdelete++;}
01223 if (fT1d_LastEvtNumber != 0){delete [] fT1d_LastEvtNumber; fCdelete++;}
01224
01225 if (fT2d_EvtNbInLoop != 0){delete [] fT2d_EvtNbInLoop; fCdelete++;}
01226 if (fT1d_EvtNbInLoop != 0){delete [] fT1d_EvtNbInLoop; fCdelete++;}
01227
01228 if (fT3d_distribs != 0){delete [] fT3d_distribs; fCdelete++;}
01229 if (fT3d2_distribs != 0){delete [] fT3d2_distribs; fCdelete++;}
01230 if (fT3d1_distribs != 0){delete [] fT3d1_distribs; fCdelete++;}
01231
01232 if (fT2d_ev != 0){delete [] fT2d_ev; fCdelete++;}
01233 if (fT1d_ev != 0){delete [] fT1d_ev; fCdelete++;}
01234
01235 if (fT2d_var != 0){delete [] fT2d_var; fCdelete++;}
01236 if (fT1d_var != 0){delete [] fT1d_var; fCdelete++;}
01237
01238 if (fT3d_his_s != 0){delete [] fT3d_his_s; fCdelete++;}
01239 if (fT2d_his_s != 0){delete [] fT2d_his_s; fCdelete++;}
01240 if (fT1d_his_s != 0){delete [] fT1d_his_s; fCdelete++;}
01241
01242 if (fT2d_xmin != 0){delete [] fT2d_xmin; fCdelete++;}
01243 if (fT1d_xmin != 0){delete [] fT1d_xmin; fCdelete++;}
01244 if (fT2d_xmax != 0){delete [] fT2d_xmax; fCdelete++;}
01245 if (fT1d_xmax != 0){delete [] fT1d_xmax; fCdelete++;}
01246
01247 if (fT3d_cov_ss != 0){delete [] fT3d_cov_ss; fCdelete++;}
01248 if (fT3d2_cov_ss != 0){delete [] fT3d2_cov_ss; fCdelete++;}
01249 if (fT3d1_cov_ss != 0){delete [] fT3d1_cov_ss; fCdelete++;}
01250
01251 if (fT3d_cor_ss != 0){delete [] fT3d_cor_ss; fCdelete++;}
01252 if (fT3d2_cor_ss != 0){delete [] fT3d2_cor_ss; fCdelete++;}
01253 if (fT3d1_cor_ss != 0){delete [] fT3d1_cor_ss; fCdelete++;}
01254
01255 if (fT3d_cov_cc != 0){delete [] fT3d_cov_cc; fCdelete++;}
01256 if (fT3d2_cov_cc != 0){delete [] fT3d2_cov_cc; fCdelete++;}
01257 if (fT3d1_cov_cc != 0){delete [] fT3d1_cov_cc; fCdelete++;}
01258
01259 if (fT3d_cor_cc != 0){delete [] fT3d_cor_cc; fCdelete++;}
01260 if (fT3d2_cor_cc != 0){delete [] fT3d2_cor_cc; fCdelete++;}
01261 if (fT3d1_cor_cc != 0){delete [] fT3d1_cor_cc; fCdelete++;}
01262
01263 if (fT2d_cov_cc_mos != 0){delete [] fT2d_cov_cc_mos; fCdelete++;}
01264 if (fT2d1_cov_cc_mos != 0){delete [] fT2d1_cov_cc_mos; fCdelete++;}
01265
01266 if (fT2d_cor_cc_mos != 0){delete [] fT2d_cor_cc_mos; fCdelete++;}
01267 if (fT2d1_cor_cc_mos != 0){delete [] fT2d1_cor_cc_mos; fCdelete++;}
01268
01269 if (fT2d_cov_moscc_mot != 0){delete [] fT2d_cov_moscc_mot; fCdelete++;}
01270 if (fT2d1_cov_moscc_mot != 0){delete [] fT2d1_cov_moscc_mot ; fCdelete++;}
01271
01272 if (fT2d_cor_moscc_mot != 0){delete [] fT2d_cor_moscc_mot ; fCdelete++;}
01273 if (fT2d1_cor_moscc_mot != 0){delete [] fT2d1_cor_moscc_mot; fCdelete++;}
01274
01275 if (fT1d_ev_ev != 0){delete [] fT1d_ev_ev; fCdelete++;}
01276 if (fT1d_ev_sig != 0){delete [] fT1d_ev_sig; fCdelete++;}
01277 if (fT1d_ev_cor_ss != 0){delete [] fT1d_ev_cor_ss; fCdelete++;}
01278
01279 if (fT1d_sig_ev != 0){delete [] fT1d_sig_ev; fCdelete++;}
01280 if (fT1d_sig_sig != 0){delete [] fT1d_sig_sig; fCdelete++;}
01281 if (fT1d_sig_cor_ss != 0){delete [] fT1d_sig_cor_ss; fCdelete++;}
01282
01283 if (fT2d_sv_correc_covss_s != 0){delete [] fT2d_sv_correc_covss_s; fCdelete++;}
01284 if (fT2d1_sv_correc_covss_s != 0){delete [] fT2d1_sv_correc_covss_s; fCdelete++;}
01285
01286 if (fT3d_cov_correc_covss_s != 0){delete [] fT3d_cov_correc_covss_s; fCdelete++;}
01287 if (fT3d2_cov_correc_covss_s != 0){delete [] fT3d2_cov_correc_covss_s; fCdelete++;}
01288 if (fT3d1_cov_correc_covss_s != 0){delete [] fT3d1_cov_correc_covss_s; fCdelete++;}
01289
01290 if (fT3d_cor_correc_covss_s != 0){delete [] fT3d_cor_correc_covss_s; fCdelete++;}
01291 if (fT3d2_cor_correc_covss_s != 0){delete [] fT3d2_cor_correc_covss_s; fCdelete++;}
01292 if (fT3d1_cor_correc_covss_s != 0){delete [] fT3d1_cor_correc_covss_s; fCdelete++;}
01293
01294 if (fT2dCrysNumbersTable != 0){delete [] fT2dCrysNumbersTable; fCdelete++;}
01295 if (fT1dCrysNumbersTable != 0){delete [] fT1dCrysNumbersTable; fCdelete++;}
01296
01297 if (fjustap_2d_ev != 0){delete [] fjustap_2d_ev; fCdelete++;}
01298 if (fjustap_1d_ev != 0){delete [] fjustap_1d_ev; fCdelete++;}
01299 if (fjustap_2d_var != 0){delete [] fjustap_2d_var; fCdelete++;}
01300 if (fjustap_1d_var != 0){delete [] fjustap_1d_var; fCdelete++;}
01301 if (fjustap_2d_cc != 0){delete [] fjustap_2d_cc; fCdelete++;}
01302 if (fjustap_1d_cc != 0){delete [] fjustap_1d_cc; fCdelete++;}
01303 if (fjustap_2d_ss != 0){delete [] fjustap_2d_ss; fCdelete++;}
01304 if (fjustap_1d_ss != 0){delete [] fjustap_1d_ss; fCdelete++;}
01305
01306 if (fTagTowerNumbers != 0){delete [] fTagTowerNumbers; fCdelete++;}
01307 if (fTagLastEvtNumber != 0){delete [] fTagLastEvtNumber; fCdelete++;}
01308 if (fTagEvtNbInLoop != 0){delete [] fTagEvtNbInLoop; fCdelete++;}
01309 if (fTagSampTime != 0){delete [] fTagSampTime; fCdelete++;}
01310 if (fTagEv != 0){delete [] fTagEv; fCdelete++;}
01311 if (fTagVar != 0){delete [] fTagVar; fCdelete++;}
01312 if (fTagEvts != 0){delete [] fTagEvts; fCdelete++;}
01313
01314 if (fTagCovCss != 0){delete [] fTagCovCss; fCdelete++;}
01315 if (fTagCorCss != 0){delete [] fTagCorCss; fCdelete++;}
01316
01317 if (fTagCovScc != 0){delete [] fTagCovScc; fCdelete++;}
01318 if (fTagCorScc != 0){delete [] fTagCorScc; fCdelete++;}
01319 if (fTagCovSccMos != 0){delete [] fTagCovSccMos; fCdelete++;}
01320 if (fTagCorSccMos != 0){delete [] fTagCorSccMos; fCdelete++;}
01321
01322 if (fTagCovMosccMot != 0){delete [] fTagCovMosccMot; fCdelete++;}
01323 if (fTagCorMosccMot != 0){delete [] fTagCorMosccMot; fCdelete++;}
01324
01325 if (fTagEvEv != 0){delete [] fTagEvEv; fCdelete++;}
01326 if (fTagEvSig != 0){delete [] fTagEvSig; fCdelete++;}
01327 if (fTagEvCorCss != 0){delete [] fTagEvCorCss; fCdelete++;}
01328
01329 if (fTagSigEv != 0){delete [] fTagSigEv; fCdelete++;}
01330 if (fTagSigSig != 0){delete [] fTagSigSig; fCdelete++;}
01331 if (fTagSigCorCss != 0){delete [] fTagSigCorCss; fCdelete++;}
01332
01333 if (fTagSvCorrecCovCss != 0){delete [] fTagSvCorrecCovCss; fCdelete++;}
01334 if (fTagCovCorrecCovCss != 0){delete [] fTagCovCorrecCovCss; fCdelete++;}
01335 if (fTagCorCorrecCovCss != 0){delete [] fTagCorCorrecCovCss; fCdelete++;}
01336
01337 if ( fCnew != fCdelete )
01338 {
01339 cout << "!TCnaRunEB::~TCnaRunEB()> WRONG MANAGEMENT OF MEMORY ALLOCATIONS: fCnew = "
01340 << fCnew << ", fCdelete = " << fCdelete << fTTBELL << endl;
01341 }
01342 else
01343 {
01344
01345
01346 }
01347
01348 if(fFlagPrint == fCodePrintComments || fFlagPrint == fCodePrintWarnings )
01349 {
01350 cout << "*TCnaRunEB::~TCnaRunEB()> Exiting destructor." << endl;
01351 }
01352 if(fFlagPrint == fCodePrintAllComments)
01353 {
01354 cout << "*TCnaRunEB::~TCnaRunEB()> Exiting destructor (this = " << this << ")." << endl
01355 << "~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#"
01356 << endl;
01357 }
01358 }
01359
01360
01361
01362
01363
01364
01365
01366
01367
01368
01369
01370
01371
01372 void TCnaRunEB::GetReadyToReadData(TString typ_ana, const Int_t& run_number,
01373 Int_t& nfirst, Int_t& nevents,
01374 const Int_t& super_module)
01375 {
01376
01377
01378
01379 Int_t nentries = 999999999;
01380
01381 GetReadyToReadData(typ_ana, run_number, nfirst, nevents, super_module, nentries);
01382
01383 }
01384
01385
01386 void TCnaRunEB::GetReadyToReadData( TString typ_ana, const Int_t& run_number,
01387 Int_t& nfirst, Int_t& nevents,
01388 const Int_t& super_module, const Int_t& nentries)
01389 {
01390
01391
01392
01393
01394 if ( nfirst < nentries )
01395 {
01396
01397 if (nfirst < 0 )
01398 {
01399 if (fFlagPrint != fCodePrintNoComment){
01400 cout << "!TCnaRunEB::GetReadyToReadData(...) > WARNING/CORRECTION:" << endl
01401 << "! The fisrt taken event number is negative ( = " << nfirst << "). Forced to zero."
01402 << fTTBELL << endl;}
01403 nfirst = 0;
01404 }
01405
01406
01407
01408
01409 Int_t last_taken_event = nfirst + nevents - 1;
01410 Int_t nevents_anc = nevents;
01411
01412 if( last_taken_event > (nentries - 1) )
01413 {
01414 nevents = nentries - nfirst -1;
01415 if (fFlagPrint != fCodePrintNoComment){
01416 cout << endl << "!TCnaRunEB::GetReadyToReadData(...)> WARNING/CORRECTION:" << endl
01417 << "! The number of events (nevents = " << nevents_anc << ") is too large." << endl
01418 << "! Number of last event = nfirst + nevents - 1 = " << nfirst << " + " << nevents_anc
01419 << " - 1 = " << last_taken_event << " > number of entries - 1 = " << nentries-1 << ". "
01420 << endl << "! Number of events forced to the value: nb of events ="
01421 << " nb of entries - first event number - 1 = "
01422 << nevents << "." << endl
01423 << "! WARNING ===> THIS MODIFICATION WILL BE TRANSFERED TO THE RESULT FILE NAME"
01424 << " (ROOT and ASCII FILES)."
01425 << fTTBELL << endl << endl;}
01426 }
01427
01428
01429
01430 Text_t *h_name = "CnaHeader";
01431 Text_t *h_title = "CnaHeader";
01432
01433 TEBParameters* MyEcal = new TEBParameters(); fCnew++;
01434 Int_t n_tow = MyEcal->fMaxTowInSM;
01435 Int_t n_crys = MyEcal->fMaxCrysInTow;
01436 Int_t n_samp = MyEcal->fMaxSampADC;
01437 delete MyEcal; fCdelete++;
01438
01439 if ( n_tow > 0 && n_crys > 0 && n_samp> 0 )
01440 {
01441 fFileHeader = new TCnaHeaderEB(h_name, h_title ,
01442 typ_ana, run_number, nfirst, nevents,
01443 super_module, nentries);
01444
01445
01446
01447
01448
01449
01450
01451
01452
01453
01454
01455
01456
01457
01458
01459
01460
01461
01462 fTagTowerNumbers = new Int_t[1]; fCnew++; fTagTowerNumbers[0] = (Int_t)0;
01463 fTagLastEvtNumber = new Int_t[1]; fCnew++; fTagLastEvtNumber[0] = (Int_t)0;
01464 fTagEvtNbInLoop = new Int_t[1]; fCnew++; fTagEvtNbInLoop[0] = (Int_t)0;
01465
01466 fTagSampTime = new Int_t[fFileHeader->fMaxCrysInSM]; fCnew++;
01467 for (Int_t iz=0; iz<fFileHeader->fMaxCrysInSM; iz++){fTagSampTime[iz] = (Int_t)0;}
01468
01469 fTagEv = new Int_t[1]; fCnew++; fTagEv[0] = (Int_t)0;
01470 fTagVar = new Int_t[1]; fCnew++; fTagVar[0] = (Int_t)0;
01471
01472 fTagEvts = new Int_t[fFileHeader->fMaxCrysInSM]; fCnew++;
01473 for (Int_t iz=0; iz<fFileHeader->fMaxCrysInSM; iz++){fTagEvts[iz] = (Int_t)0;}
01474
01475 fTagCovCss = new Int_t[fFileHeader->fMaxCrysInSM]; fCnew++;
01476 for (Int_t iz=0; iz<fFileHeader->fMaxCrysInSM; iz++){fTagCovCss[iz] = (Int_t)0;}
01477
01478 fTagCorCss = new Int_t[fFileHeader->fMaxCrysInSM]; fCnew++;
01479 for (Int_t iz=0; iz<fFileHeader->fMaxCrysInSM; iz++){fTagCorCss[iz] = (Int_t)0;}
01480
01481 fTagCovScc = new Int_t[fFileHeader->fMaxSampADC]; fCnew++;
01482 for (Int_t iz=0; iz<fFileHeader->fMaxSampADC; iz++){fTagCovScc[iz] = (Int_t)0;}
01483
01484 fTagCorScc = new Int_t[fFileHeader->fMaxSampADC]; fCnew++;
01485 for (Int_t iz=0; iz<fFileHeader->fMaxSampADC; iz++){fTagCorScc[iz] = (Int_t)0;}
01486
01487 fTagCovSccMos = new Int_t[1]; fCnew++; fTagCovSccMos[0] = (Int_t)0;
01488 fTagCorSccMos = new Int_t[1]; fCnew++; fTagCorSccMos[0] = (Int_t)0;
01489 fTagCovMosccMot = new Int_t[1]; fCnew++; fTagCovMosccMot[0] = (Int_t)0;
01490 fTagCorMosccMot = new Int_t[1]; fCnew++; fTagCorMosccMot[0] = (Int_t)0;
01491
01492 fTagEvEv = new Int_t[1]; fCnew++; fTagEvEv[0] = (Int_t)0;
01493 fTagEvSig = new Int_t[1]; fCnew++; fTagEvSig[0] = (Int_t)0;
01494 fTagEvCorCss = new Int_t[1]; fCnew++; fTagEvCorCss[0] = (Int_t)0;
01495
01496 fTagSigEv = new Int_t[1]; fCnew++; fTagSigEv[0] = (Int_t)0;
01497 fTagSigSig = new Int_t[1]; fCnew++; fTagSigSig[0] = (Int_t)0;
01498 fTagSigCorCss = new Int_t[1]; fCnew++; fTagSigCorCss[0] = (Int_t)0;
01499
01500 fTagSvCorrecCovCss = new Int_t[1]; fCnew++; fTagSvCorrecCovCss[0] = (Int_t)0;
01501
01502 fTagCovCorrecCovCss = new Int_t[fFileHeader->fMaxCrysInSM]; fCnew++;
01503 for (Int_t iz=0; iz<fFileHeader->fMaxCrysInSM; iz++){fTagCovCorrecCovCss[iz] = (Int_t)0;}
01504
01505 fTagCorCorrecCovCss = new Int_t[fFileHeader->fMaxCrysInSM]; fCnew++;
01506 for (Int_t iz=0; iz<fFileHeader->fMaxCrysInSM; iz++){fTagCorCorrecCovCss[iz] = (Int_t)0;}
01507
01508
01509
01510
01511
01512
01513
01514 if(fT1d_SMtowFromIndex == 0)
01515 {
01516 fT1d_SMtowFromIndex = new Int_t[fFileHeader->fMaxTowInSM]; fCnew++;
01517 }
01518 for ( Int_t i_tow = 0; i_tow < fFileHeader->fMaxTowInSM; i_tow++ )
01519 {
01520 fT1d_SMtowFromIndex[i_tow] = fSpecialSMTowerNotIndexed;
01521 }
01522
01523
01524
01525
01526
01527
01528
01529
01530
01531
01532
01533 if(fT3d_distribs == 0)
01534 {
01535
01536 fT3d_distribs =
01537 new Double_t**[fFileHeader->fMaxCrysInSM]; fCnew++;
01538 fT3d2_distribs =
01539 new Double_t*[fFileHeader->fMaxCrysInSM*
01540 fFileHeader->fMaxSampADC]; fCnew++;
01541 fT3d1_distribs =
01542 new Double_t[fFileHeader->fMaxCrysInSM*
01543 fFileHeader->fMaxSampADC*
01544 fFileHeader->fNbOfTakenEvts]; fCnew++;
01545
01546 for(Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++){
01547 fT3d_distribs[i_SMEcha] = &fT3d2_distribs[0] + i_SMEcha*fFileHeader->fMaxSampADC;
01548 for(Int_t j_samp = 0 ; j_samp < fFileHeader->fMaxSampADC ; j_samp++){
01549 fT3d2_distribs[fFileHeader->fMaxSampADC*i_SMEcha + j_samp] = &fT3d1_distribs[0]+
01550 fFileHeader->fNbOfTakenEvts*(fFileHeader->fMaxSampADC*i_SMEcha+j_samp);}}
01551 }
01552
01553
01554 for (Int_t iza=0; iza<fFileHeader->fMaxCrysInSM; iza++)
01555 {
01556 for (Int_t izb=0; izb<fFileHeader->fMaxSampADC; izb++)
01557 {
01558 for (Int_t izc=0; izc<fFileHeader->fNbOfTakenEvts; izc++)
01559 {
01560 if( fT3d_distribs[iza][izb][izc] != (Double_t)0 )
01561 {
01562 fMiscDiag[0]++;
01563 fT3d_distribs[iza][izb][izc] = (Double_t)0;
01564 }
01565 }
01566 }
01567 }
01568
01569
01570
01571
01572
01573
01574
01575 if (fT2d_LastEvtNumber == 0)
01576 {
01577 fT2d_LastEvtNumber = new Int_t*[fFileHeader->fMaxCrysInSM]; fCnew++;
01578 fT1d_LastEvtNumber = new Int_t[fFileHeader->fMaxCrysInSM*
01579 fFileHeader->fMaxSampADC]; fCnew++;
01580
01581 for(Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
01582 {
01583 fT2d_LastEvtNumber[i_SMEcha] =
01584 &fT1d_LastEvtNumber[0] + i_SMEcha*fFileHeader->fMaxSampADC;
01585 }
01586
01587
01588 for(Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
01589 {
01590 for(Int_t i_samp = 0 ; i_samp < fFileHeader->fMaxSampADC ; i_samp++)
01591 {
01592 fT2d_LastEvtNumber[i_SMEcha][i_samp] = -1;
01593 }
01594 }
01595 }
01596 else
01597 {
01598 cerr << "!TCnaRunEB::GetReadyToReadData(...)> *** ERROR *** No allocation for fT2d_LastEvtNumber!"
01599 << " Pointer already not NULL " << fTTBELL << endl;
01600 {Int_t cintoto; cout << "Enter: 0 and RETURN to continue or: CTRL C to exit"
01601 << endl; cin >> cintoto;}
01602 }
01603
01604
01605
01606
01607
01608
01609
01610 if (fT2d_EvtNbInLoop == 0)
01611 {
01612 fT2d_EvtNbInLoop = new Int_t*[fFileHeader->fMaxTowInSM]; fCnew++;
01613 fT1d_EvtNbInLoop = new Int_t[fFileHeader->fMaxTowInSM*
01614 fFileHeader->fNbOfTakenEvts]; fCnew++;
01615
01616 for(Int_t i_tow = 0 ; i_tow < fFileHeader->fMaxTowInSM ; i_tow++)
01617 {
01618 fT2d_EvtNbInLoop[i_tow] =
01619 &fT1d_EvtNbInLoop[0] + i_tow*fFileHeader->fNbOfTakenEvts;
01620 }
01621
01622
01623 for(Int_t i_tow = 0 ; i_tow < fFileHeader->fMaxTowInSM ; i_tow++)
01624 {
01625 for(Int_t i_cna_evt = 0 ; i_cna_evt < fFileHeader->fNbOfTakenEvts ; i_cna_evt++)
01626 {
01627 fT2d_EvtNbInLoop[i_tow][i_cna_evt] = -1;
01628 }
01629 }
01630 }
01631 else
01632 {
01633 cerr << "!TCnaRunEB::GetReadyToReadData(...)> *** ERROR *** No allocation for fT2d_EvtNbInLoop!"
01634 << " Pointer already not NULL " << fTTBELL << endl;
01635 {Int_t cintoto; cout << "Enter: 0 and RETURN to continue or: CTRL C to exit"
01636 << endl; cin >> cintoto;}
01637 }
01638 }
01639 else
01640 {
01641 cerr << endl
01642 << "!TCnaRunEB::GetReadyToReadData(...)> "
01643 << " *** ERROR *** " << endl
01644 << " --------------------------------------------------"
01645 << endl
01646 << " NULL or NEGATIVE values for arguments" << endl
01647 << " with expected positive values:" << endl
01648 << " Number of towers in SuperModule = " << fFileHeader->fMaxTowInSM << endl
01649 << " Number of crystals in tower = " << fFileHeader->fMaxCrysInTow << endl
01650 << " Number of samples by channel = " << fFileHeader->fMaxSampADC << endl
01651 << endl
01652 << endl
01653 << " hence, no memory allocation for array member has been performed." << endl;
01654
01655 cout << "Enter: 0 and RETURN to continue or: CTRL C to exit";
01656 Int_t toto;
01657 cin >> toto;
01658 }
01659
01660
01661
01662
01663
01664
01665
01666
01667
01668
01669
01670
01671
01672
01673
01674
01675
01676
01677
01678
01679
01680
01681
01682
01683
01684
01685
01686
01687
01688
01689
01690
01691
01692 fSectChanSizeX = 5;
01693 fSectChanSizeY = 5;
01694 fSectSampSizeX = 10;
01695 fSectSampSizeY = 10;
01696
01697
01698
01699
01700
01701
01702
01703
01704
01705
01706
01707
01708
01709
01710
01711
01712
01713
01714
01715
01716
01717
01718
01719
01720
01721
01722
01723
01724 fNbChanByLine = 5;
01725 fNbSampByLine = 10;
01726
01727
01728 }
01729 else
01730 {
01731 cout << "!TCnaRunEB::GetReadyToReadData(...) *** ERROR ***> "
01732 << " The first taken event number is greater than the number of entries - 1."
01733 << fTTBELL << endl;
01734 }
01735
01736 if(fFlagPrint == fCodePrintAllComments || fFlagPrint == fCodePrintComments ){
01737 cout << endl;
01738 cout << "*TCnaRunEB::GetReadyToReadData(...)>" << endl
01739 << " The method has been called with the following argument values:" << endl
01740 << " Analysis name = "
01741 << fFileHeader->fTypAna << endl
01742 << " Run number = "
01743 << fFileHeader->fRunNumber << endl
01744 << " Number of entries = "
01745 << fFileHeader->fNentries << endl
01746 << " First taken event = "
01747 << fFileHeader->fFirstEvt << endl
01748 << " Number of taken events = "
01749 << fFileHeader->fNbOfTakenEvts << endl
01750 << " SuperModule number = "
01751 << fFileHeader->fSuperModule << endl
01752 << " Number of towers in SM = "
01753 << fFileHeader->fMaxTowInSM << endl
01754 << " Number of crystals in tower = "
01755 << fFileHeader->fMaxCrysInTow << endl
01756 << " Number of samples by channel = "
01757 << fFileHeader->fMaxSampADC << endl
01758 << endl;}
01759
01760 fReadyToReadData = 1;
01761
01762 if(fFlagPrint == fCodePrintAllComments){
01763 cout << "*TCnaRunEB::GetReadyToReadData(...)> Leaving the method"
01764 << endl; }
01765 }
01766
01767
01768
01769
01770
01771
01772
01773
01774
01775
01776
01777
01778
01779
01780
01781
01782 Bool_t TCnaRunEB::BuildEventDistributions(const Int_t& ievent, const Int_t& SMtower,
01783 const Int_t& TowEcha, const Int_t& sample,
01784 const Double_t& adcvalue)
01785 {
01786
01787
01788 Bool_t ret_code = kFALSE;
01789 Int_t i_SMtow = SMtower-1;
01790 Int_t i_trouve = 0;
01791
01792 if(fReadyToReadData == 1)
01793 {
01794 if( SMtower>= 1 && SMtower <= fFileHeader->fMaxTowInSM )
01795 {
01796 if( TowEcha >= 0 && TowEcha < fFileHeader->fMaxCrysInTow )
01797 {
01798 if( sample >= 0 && sample < fFileHeader->fMaxSampADC )
01799 {
01800
01801 if(fT1d_SMtowFromIndex != 0)
01802 {
01803 ret_code = kTRUE;
01804
01805
01806 if( SMtower == fT1d_SMtowFromIndex[i_SMtow] )
01807 {
01808 i_trouve = 1;
01809 }
01810
01811
01812 if (i_trouve != 1 )
01813 {
01814 if ( fT1d_SMtowFromIndex[i_SMtow] == fSpecialSMTowerNotIndexed )
01815 {
01816 fT1d_SMtowFromIndex[i_SMtow] = SMtower;
01817 fFileHeader->fTowerNumbersCalc = 1;
01818 fTagTowerNumbers[0] = 1;
01819 fTowerIndexBuilt++;
01820
01821 if(fFlagPrint == fCodePrintAllComments || fFlagPrint == fCodePrintComments){
01822 cout << "*TCnaRunEB::BuildEventDistributions(...)> event " << ievent
01823 << " : first event for tower " << fT1d_SMtowFromIndex[i_SMtow]
01824 << " (" << fTowerIndexBuilt << " towers found)" << endl;}
01825 ret_code = kTRUE;
01826 }
01827 else
01828 {
01829 cout << "!TCnaRunEB::BuildEventDistributions(...)> *** ERROR ***> IMPOSSIBILITY. "
01830 << " SMtower= " << SMtower << ", fT1d_SMtowFromIndex[" << i_SMtow << "] = "
01831 << fT1d_SMtowFromIndex[i_SMtow]
01832 << ", fTowerIndexBuilt = " << fTowerIndexBuilt
01833 << fTTBELL << endl;
01834 ret_code = kFALSE;
01835 }
01836 }
01837 }
01838 else
01839 {
01840 cout << "!TCnaRunEB, BuildEventDistributions *** ERROR ***> "
01841 << " fT1d_SMtowFromIndex = " << fT1d_SMtowFromIndex
01842 << " fT1d_SMtowFromIndex[] ALLOCATION NOT DONE" << fTTBELL << endl;
01843 ret_code = kFALSE;
01844 }
01845 }
01846 else
01847 {
01848 cout << "!TCnaRunEB::BuildEventDistributions(...) *** ERROR ***> "
01849 << " sample number = " << sample << ". OUT OF BOUNDS"
01850 << " (max = " << fFileHeader->fMaxSampADC << ")"
01851 << fTTBELL << endl;
01852 ret_code = kFALSE;
01853 }
01854 }
01855 else
01856 {
01857 cout << "!TCnaRunEB::BuildEventDistributions(...) *** ERROR ***> "
01858 << " TowEcha number = " << TowEcha << ". OUT OF BOUNDS"
01859 << " (max = " << fFileHeader->fMaxCrysInTow << ")"
01860 << fTTBELL << endl;
01861 ret_code = kFALSE;
01862 }
01863 }
01864 else
01865 {
01866 cout << "!TCnaRunEB::BuildEventDistributions(...) *** ERROR ***> "
01867 << " SMtower number = " << SMtower << ". OUT OF BOUNDS"
01868 << " (max = " << fFileHeader->fMaxTowInSM << ")"
01869 << fTTBELL << endl;
01870 ret_code = kFALSE;
01871 }
01872
01873
01874
01875
01876 if( ret_code == kTRUE )
01877 {
01878
01879 Int_t SMEcha = i_SMtow*fFileHeader->fMaxCrysInTow + TowEcha;
01880
01881 if( SMEcha >= 0 && SMEcha < fFileHeader->fMaxCrysInSM )
01882 {
01883
01884 (fT2d_LastEvtNumber[SMEcha][sample])++;
01885 fTagLastEvtNumber[0] = 1;
01886 fFileHeader->fLastEvtNumberCalc = 1;
01887
01888
01889
01890 Int_t k_event = fT2d_LastEvtNumber[SMEcha][sample];
01891
01892 if ( k_event >= 0 && k_event < fFileHeader->fNbOfTakenEvts )
01893 {
01894 fT2d_EvtNbInLoop[i_SMtow][k_event] = ievent;
01895 }
01896 else
01897 {
01898 cout << "!TCnaRunEB::BuildEventDistributions(...) *** ERROR ***> "
01899 << " last event number = " << k_event << ". OUT OF BOUNDS"
01900 << " (range = [0," << fFileHeader->fNbOfTakenEvts-1
01901 << "]). Channel# = " << SMEcha << ", sample = " << sample
01902 << fTTBELL << endl;
01903 ret_code = kFALSE;
01904 }
01905 fTagEvtNbInLoop[0] = 1;
01906 fFileHeader->fEvtNbInLoopCalc = 1;
01907
01908
01909 if ( ievent >= 0 && ievent < fFileHeader->fNbOfTakenEvts )
01910 {
01911 fT3d_distribs[SMEcha][sample][ievent] = adcvalue;
01912 }
01913 else
01914 {
01915 cout << "!TCnaRunEB::BuildEventDistributions(...) *** ERROR ***> "
01916 << " event number = " << ievent << ". OUT OF BOUNDS"
01917 << " (max = " << fFileHeader->fNbOfTakenEvts << ")"
01918 << fTTBELL << endl;
01919 ret_code = kFALSE;
01920 }
01921 }
01922 else
01923 {
01924 cout << "!TCnaRunEB::BuildEventDistributions(...) *** ERROR ***> "
01925 << " CHANNEL NUMBER OUT OF BOUNDS" << endl
01926 << " SMEcha number = " << SMEcha
01927 << " , SMtower = " << SMtower
01928 << " , TowEcha = " << TowEcha
01929 << " , fFileHeader->fMaxCrysInSM = " << fFileHeader->fMaxCrysInSM
01930 << fTTBELL << endl;
01931 ret_code = kFALSE;
01932
01933 }
01934 }
01935 else
01936 {
01937 cout << "!TCnaRunEB::BuildEventDistributions(...) *** ERROR ***> ret_code = kFALSE "
01938 << fTTBELL << endl;
01939 }
01940 }
01941 else
01942 {
01943 cout << "!TCnaRunEB::BuildEventDistributions(...) *** ERROR ***> GetReadyToReadData(...) not called."
01944 << fTTBELL << endl;
01945 ret_code = kFALSE;
01946 }
01947
01948 if (ret_code == kFALSE)
01949 {
01950 cout << "*> ievent: " << ievent
01951 << ", SMtower: " << SMtower
01952 << ", TowEcha: " << TowEcha
01953 << ", sample: " << sample
01954 << ", adcvalue: " << adcvalue << endl;
01955 }
01956
01957 return ret_code;
01958 }
01959
01960
01961
01962
01963
01964
01965
01966
01967
01968
01969
01970
01971 void TCnaRunEB::GetReadyToCompute()
01972 {
01973
01974
01975
01976
01977
01978
01979
01980
01981
01982
01983
01984
01985 if(fFlagPrint == fCodePrintAllComments)
01986 {
01987 cout << endl << "%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%"
01988 << endl << "*TCnaRunEB::GetReadyToCompute()> (this = " << this << ") " << endl;
01989 }
01990 #define TOBJ
01991 #ifndef TOBJ
01992
01993
01994
01995
01996
01997
01998
01999
02000
02001 Int_t maxichan = fFileHeader->fMaxCrysInSM*fFileHeader->fMaxSampADC;
02002 TObjArray fVal_dat2(maxichan);
02003
02004 for (Int_t i_chan = 0 ; i_chan < fFileHeader->fMaxCrysInSM ; i_chan++)
02005 {
02006 for (Int_t n_sampl = 0 ; n_sampl < fFileHeader->fMaxSampADC ; n_sampl++)
02007 {
02008 Int_t i_new = (fFileHeader->fMaxSampADC)*i_chan + n_sampl;
02009 fVal_dat2[i_new] = new
02010 TDistrib(fFileHeader->fNbOfTakenEvts, fT3d2_distribs[i_new]); fCnew++;
02011 }
02012 }
02013
02014 #endif // TOBJ
02015
02016
02017
02018
02019
02020
02021
02022
02023
02024
02025
02026
02027
02028
02029
02030
02031
02032
02033
02034
02035
02036
02037
02038
02039
02040 if(fFlagPrint == fCodePrintAllComments || fFlagPrint == fCodePrintComments ){
02041 cout << "*TCnaRunEB::GetReadyToCompute()> Starting TDistrib object allocations"
02042 << endl;}
02043
02044
02045
02046
02047
02048
02049 fVal_data = new TDistrib*[fFileHeader->fMaxCrysInSM]; fCnew++;
02050 fVal_dat2 = new TDistrib[fFileHeader->fMaxCrysInSM*fFileHeader->fMaxSampADC]; fCnew++;
02051
02052
02053
02054 for( Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++ )
02055 {
02056 fVal_data[i_SMEcha] = &fVal_dat2[0] + i_SMEcha*fFileHeader->fMaxSampADC;
02057 }
02058
02059
02060
02061 for (Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
02062 {
02063 for (Int_t n_sampl = 0 ; n_sampl < fFileHeader->fMaxSampADC ; n_sampl++)
02064 {
02065
02066
02067
02068
02069
02070
02071
02072 TDistrib* pdata_temp =
02073 new TDistrib( fFileHeader->fNbOfTakenEvts,
02074 fT3d2_distribs[(fFileHeader->fMaxSampADC)*i_SMEcha
02075 + n_sampl] ); fCnew++;
02076
02077
02078
02079
02080 fVal_data[i_SMEcha][n_sampl] = pdata_temp[0];
02081 delete pdata_temp; fCdelete++;
02082 }
02083 }
02084
02085 if(fFlagPrint == fCodePrintAllComments || fFlagPrint == fCodePrintComments ){
02086 cout << "*TCnaRunEB::GetReadyToCompute()> TDistrib object allocations done."
02087 << endl;}
02088
02089 #define RESZ
02090 #ifndef RESZ
02091
02092
02093
02094
02095 Int_t nb_of_resize = 0;
02096 Bool_t ok_resize = kFALSE;
02097
02098 for (Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
02099 {
02100 for (Int_t n_sampl = 0 ; n_sampl < fFileHeader->fMaxSampADC ; n_sampl++)
02101 {
02102 ok_resize = kFALSE;
02103 Int_t nb_evts = fT2d_LastEvtNumber[i_SMEcha][n_sampl]+1;
02104 ok_resize = fVal_data[i_SMEcha][n_sampl].Resize(nb_evts);
02105 if ( ok_resize == kTRUE ) {nb_of_resize++;}
02106 }
02107 }
02108
02109 if (nb_of_resize != 0)
02110 {
02111 cout << "!TCnaRunEB::GetReadyToCompute()> "
02112 << "INFO/warning =!=!=!=!=!=> a resize of TDistrib distribution has been done in "
02113 << nb_of_resize << " cases " << endl
02114 << " (could be due to incorrect numbers of events in data)"
02115 << fTTBELL << endl;
02116 }
02117 else
02118 {
02119 if(fFlagPrint == fCodePrintAllComments){
02120 cout << "!TCnaRunEB::GetReadyToCompute()> "
02121 << "INFO =+=+=+=+=+=> TDistrib distributions: no resize has been done." << endl;}
02122 }
02123
02124
02125 #endif // RESZ
02126
02127
02128 }
02129
02130
02131
02132
02133
02134
02135
02136 void TCnaRunEB::StartStopTime(time_t t_startime, time_t t_stoptime)
02137 {
02138
02139
02140 fFileHeader->fStartTime = t_startime;
02141 fFileHeader->fStopTime = t_stoptime;
02142 }
02143
02144 void TCnaRunEB::StartStopDate(TString c_startdate, TString c_stopdate)
02145 {
02146
02147
02148 fFileHeader->fStartDate = c_startdate;
02149 fFileHeader->fStopDate = c_stopdate;
02150 }
02151
02152
02153
02154
02155
02156
02157
02158
02159
02160
02161
02162
02163
02164
02165
02166
02167 void TCnaRunEB::MakeHistosOfSamplesAsFunctionOfEvent()
02168 {
02169
02170
02171
02172 if(fFlagPrint == fCodePrintAllComments){
02173 cout << "*TCnaRunEB::MakeHistosOfSamplesAsFunctionOfEvent()>"
02174 << " Making of the histograms of the sample value as a funtion of"
02175 << " the event number for all the pairs (SMEcha, samples)" << endl;}
02176
02177
02178
02179
02180 for (Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
02181 {
02182 fTagSampTime[i_SMEcha] = 1; fFileHeader->fSampTimeCalc++;
02183 }
02184 }
02185
02186
02187
02188
02189
02190
02191
02192
02193 void TCnaRunEB::ComputeExpectationValuesOfSamples()
02194 {
02195
02196
02197 if(fFlagPrint == fCodePrintAllComments){
02198 cout << "*TCnaRunEB::ComputeExpectationValuesOfSamples()>"
02199 << " Calculation of the expectation values of the samples"
02200 << " for all the SMEchas" << endl;}
02201
02202
02203 if ( fT2d_ev == 0 ){
02204 Int_t n_samp = fFileHeader->fMaxSampADC;
02205 Int_t n_SMEcha = fFileHeader->fMaxCrysInSM;
02206 fT2d_ev = new Double_t*[n_SMEcha]; fCnew++;
02207 fT1d_ev = new Double_t[n_SMEcha*n_samp]; fCnew++;
02208 for(Int_t i = 0 ; i < n_SMEcha ; i++){
02209 fT2d_ev[i] = &fT1d_ev[0] + i*n_samp;}
02210 }
02211
02212 for(Int_t i_SMEcha=0; i_SMEcha<fFileHeader->fMaxCrysInSM; i_SMEcha++)
02213 {
02214 for(Int_t i_samp=0; i_samp<fFileHeader->fMaxSampADC; i_samp++)
02215 {
02216 if( fT2d_ev[i_SMEcha][i_samp] != (Double_t)0 )
02217 {fMiscDiag[1]++; fT2d_ev[i_SMEcha][i_samp] = (Double_t)0;}
02218 }
02219 }
02220
02221
02222 for (Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
02223 {
02224 for (Int_t i_samp = 0 ; i_samp < fFileHeader->fMaxSampADC ; i_samp++)
02225 {
02226 fT2d_ev[i_SMEcha][i_samp] =
02227 ((fVal_data)[i_SMEcha][i_samp]).ExpectationValue();
02228 }
02229 }
02230 fTagEv[0] = 1; fFileHeader->fEvCalc++;
02231 }
02232
02233
02234
02235
02236
02237
02238
02239
02240 void TCnaRunEB::ComputeVariancesOfSamples()
02241 {
02242
02243
02244 if(fFlagPrint == fCodePrintAllComments){
02245 cout << "*TCnaRunEB::ComputeVariancesOfSamples()>"
02246 << " Calculation of the variances of the samples"
02247 << " for all the SMEchas" << endl;}
02248
02249
02250 if( fT2d_var == 0){
02251 Int_t n_SMEcha = fFileHeader->fMaxCrysInSM;
02252 Int_t n_samp = fFileHeader->fMaxSampADC;
02253 fT2d_var = new Double_t*[n_SMEcha]; fCnew++;
02254 fT1d_var = new Double_t[n_SMEcha*n_samp]; fCnew++;
02255 for(Int_t i_SMEcha = 0 ; i_SMEcha < n_SMEcha ; i_SMEcha++){
02256 fT2d_var[i_SMEcha] = &fT1d_var[0] + i_SMEcha*n_samp;}
02257 }
02258
02259 for(Int_t i_SMEcha=0; i_SMEcha<fFileHeader->fMaxCrysInSM; i_SMEcha++)
02260 {
02261 for(Int_t i_samp=0; i_samp<fFileHeader->fMaxSampADC; i_samp++)
02262 {
02263 if( fT2d_var[i_SMEcha][i_samp] != (Double_t)0 )
02264 {fMiscDiag[2]++; fT2d_var[i_SMEcha][i_samp] = (Double_t)0;}
02265 }
02266 }
02267
02268
02269 for (Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
02270 {
02271 for (Int_t i_samp = 0 ; i_samp < fFileHeader->fMaxSampADC ; i_samp++)
02272 {
02273 fT2d_var[i_SMEcha][i_samp] =
02274 fVal_data[i_SMEcha][i_samp].VarianceValue();
02275 }
02276 }
02277 fTagVar[0] = 1; fFileHeader->fVarCalc++;
02278 }
02279
02280
02281
02282
02283
02284
02285
02286
02287 void TCnaRunEB::MakeHistosOfSampleDistributions()
02288 {
02289
02290
02291 if(fFlagPrint == fCodePrintAllComments){
02292 cout << "*TCnaRunEB::MakeHistosOfSampleDistributions()>"
02293 << " Histograms of ADC distributions for all the pairs (SMEcha,sample)"
02294 << endl;}
02295
02296
02297
02298 if (fT3d_his_s == 0 )
02299 {
02300
02301 fT3d_his_s = new Double_t**[fFileHeader->fMaxCrysInSM]; fCnew++;
02302 fT2d_his_s = new Double_t*[fFileHeader->fMaxCrysInSM*fFileHeader->fMaxSampADC]; fCnew++;
02303 fT1d_his_s = new Double_t[fFileHeader->fMaxCrysInSM*
02304 fFileHeader->fMaxSampADC*
02305 fFileHeader->fNbBinsADC]; fCnew++;
02306
02307 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++){
02308 fT3d_his_s[i_SMEcha] = &fT2d_his_s[0] + i_SMEcha*fFileHeader->fMaxSampADC;
02309 for(Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++){
02310 fT2d_his_s[i_SMEcha*fFileHeader->fMaxSampADC + i_samp] = &fT1d_his_s[0]
02311 + (i_SMEcha*fFileHeader->fMaxSampADC + i_samp)*fFileHeader->fNbBinsADC;}}
02312 }
02313
02314 for(Int_t i_SMEcha=0; i_SMEcha<fFileHeader->fMaxCrysInSM; i_SMEcha++)
02315 {
02316 for(Int_t i_samp=0; i_samp<fFileHeader->fMaxSampADC; i_samp++)
02317 {
02318 for(Int_t i_bin=0; i_bin<fFileHeader->fNbBinsADC; i_bin++)
02319 {
02320 if( fT3d_his_s[i_SMEcha][i_samp][i_bin] != (Double_t)0 )
02321 {fMiscDiag[3]++; fT3d_his_s[i_SMEcha][i_samp][i_bin] = (Double_t)0;}
02322 }
02323 }
02324 }
02325
02326
02327 if( fT1d_xmin == 0 )
02328 {
02329 fT2d_xmin = new Double_t*[fFileHeader->fMaxCrysInSM]; fCnew++;
02330 fT1d_xmin = new Double_t[fFileHeader->fMaxCrysInSM*fFileHeader->fMaxSampADC]; fCnew++;
02331 for (Int_t i1 = 0; i1 < fFileHeader->fMaxCrysInSM; i1++){
02332 fT2d_xmin[i1] = &fT1d_xmin[0] + i1*fFileHeader->fMaxSampADC;}
02333 }
02334
02335 if( fT1d_xmax == 0 )
02336 {
02337 fT2d_xmax = new Double_t*[fFileHeader->fMaxCrysInSM]; fCnew++;
02338 fT1d_xmax = new Double_t[fFileHeader->fMaxCrysInSM*fFileHeader->fMaxSampADC]; fCnew++;
02339 for (Int_t i1 = 0; i1 < fFileHeader->fMaxCrysInSM; i1++){
02340 fT2d_xmax[i1] = &fT1d_xmax[0] + i1*fFileHeader->fMaxSampADC;}
02341 }
02342
02343 for(Int_t i_SMEcha=0; i_SMEcha<fFileHeader->fMaxCrysInSM; i_SMEcha++)
02344 {
02345 for(Int_t i_samp=0; i_samp<fFileHeader->fMaxSampADC; i_samp++)
02346 {
02347 if( fT2d_xmin[i_SMEcha][i_samp] != (Double_t)0 )
02348 {fMiscDiag[4]++; fT2d_xmin[i_SMEcha][i_samp] = (Double_t)0;}
02349
02350 if( fT2d_xmax[i_SMEcha][i_samp] != (Double_t)0 )
02351 {fMiscDiag[5]++; fT2d_xmax[i_SMEcha][i_samp] = (Double_t)0;}
02352 }
02353 }
02354
02355 Double_t xmin = 0;
02356 Double_t xmax = 0;
02357
02358
02359 Double_t* s_histo = new Double_t[fFileHeader->fNbBinsADC]; fCnew++;
02360 for(Int_t i_bin=0; i_bin<fFileHeader->fNbBinsADC; i_bin++)
02361 {
02362 if( s_histo[i_bin] != (Double_t)0 ){fMiscDiag[6]++; s_histo[i_bin] = (Double_t)0;}
02363 }
02364
02365 Int_t total_underflow = 0;
02366 Int_t total_overflow = 0;
02367
02368 Int_t nb_null_sample_chan = 0;
02369 Int_t nb_null_sample_all = 0;
02370
02371 TEBNumbering* MyNumbering = new TEBNumbering(); fCnew++;
02372
02373 for (Int_t SMEcha = 0; SMEcha < fFileHeader->fMaxCrysInSM; SMEcha++)
02374 {
02375 Int_t n_underflow = 0;
02376 Int_t n_overflow = 0;
02377 Int_t nb_null_sample_cases = 0;
02378
02379 for (Int_t i_samp = 0 ; i_samp < fFileHeader->fMaxSampADC; i_samp++)
02380 {
02381 Int_t range_null = 0;
02382 ((fVal_data)[SMEcha][i_samp]).
02383 HistoDistrib(fFileHeader->fNbBinsADC, xmin, xmax,
02384 &s_histo[0], range_null, n_underflow, n_overflow);
02385
02386 if ( n_underflow !=0 ){total_underflow++;}
02387 if ( n_overflow !=0 ){total_overflow++;}
02388
02389 if (range_null != 0 )
02390 {
02391 nb_null_sample_cases++;
02392 nb_null_sample_all++;
02393 }
02394
02395 fT2d_xmin[SMEcha][i_samp]= xmin;
02396 fT2d_xmax[SMEcha][i_samp]= xmax;
02397
02398 for ( Int_t i_bin = 0 ; i_bin < fFileHeader->fNbBinsADC ; i_bin++)
02399 {
02400 fT3d_his_s[SMEcha][i_samp][i_bin] = s_histo[i_bin];
02401 }
02402 }
02403
02404 if ( nb_null_sample_cases != 0 )
02405 {
02406 nb_null_sample_chan++;
02407 if(fFlagPrint == fCodePrintAllComments)
02408 {
02409 Int_t SMTow = MyNumbering->GetSMTowFromSMEcha(SMEcha);
02410 Int_t TowEcha = MyNumbering->GetTowEchaFromSMEcha(SMEcha);
02411
02412 cerr << "!TCnaRunEB::MakeHistosOfSampleDistributions()> WARNING/INFO:"
02413 << " possibility of empty histo in " << nb_null_sample_cases << " case(s)"
02414 << " for SMEcha " << SMEcha << " (tower: " << SMTow
02415 << ", TowEcha: " << TowEcha << ")"
02416 << fTTBELL << endl;
02417 }
02418 }
02419 fTagEvts[SMEcha] = 1; fFileHeader->fEvtsCalc++;
02420 }
02421
02422 if ( nb_null_sample_all != 0 )
02423 {
02424 if(fFlagPrint != fCodePrintNoComment)
02425 {
02426 cerr << "!TCnaRunEB::MakeHistosOfSampleDistributions()> WARNING/INFO:"
02427 << " possibility of empty histo in " << nb_null_sample_all << " case(s)"
02428 << " concerning " << nb_null_sample_chan << " SMEcha(s)" << fTTBELL << endl;
02429 }
02430 }
02431
02432 if (total_underflow != 0)
02433 {
02434 if(fFlagPrint != fCodePrintNoComment)
02435 {
02436 cerr << "!TCnaRunEB::MakeHistosOfSampleDistributions()> WARNING/INFO: "
02437 << total_underflow << " underflow(s) have been detected"
02438 << fTTBELL << endl;
02439 }
02440 }
02441
02442 if (total_overflow != 0)
02443 {
02444 if(fFlagPrint != fCodePrintNoComment)
02445 {
02446 cerr << "!TCnaRunEB::MakeHistosOfSampleDistributions()> WARNING/INFO: "
02447 << total_overflow << " overflow(s) have been detected"
02448 << fTTBELL << endl;
02449 }
02450 }
02451
02452 delete [] s_histo; fCdelete++;
02453 delete MyNumbering; fCdelete++;
02454 }
02455
02456
02457
02458
02459
02460
02461
02462 void TCnaRunEB::ComputeCovariancesBetweenSamples()
02463 {
02464
02465
02466 if(fFlagPrint == fCodePrintAllComments){
02467 cout << "*TCnaRunEB::ComputeCovariancesBetweenSamples()>"
02468 << " Calculation of the covariances between samples"
02469 << " for all the SMEchas" << endl;}
02470
02471
02472 if( fT3d_cov_ss == 0 ){
02473 const Int_t n_samp = fFileHeader->fMaxSampADC;
02474 const Int_t n_SMEcha = fFileHeader->fMaxCrysInSM;
02475 fT3d_cov_ss = new Double_t**[n_SMEcha]; fCnew++;
02476 fT3d2_cov_ss = new Double_t*[n_SMEcha*n_samp]; fCnew++;
02477 fT3d1_cov_ss = new Double_t[n_SMEcha*n_samp*n_samp]; fCnew++;
02478 for(Int_t i = 0 ; i < n_SMEcha ; i++){
02479 fT3d_cov_ss[i] = &fT3d2_cov_ss[0] + i*n_samp;
02480 for(Int_t j = 0 ; j < n_samp ; j++){
02481 fT3d2_cov_ss[n_samp*i+j] = &fT3d1_cov_ss[0]+n_samp*(n_samp*i+j);}}
02482 }
02483
02484
02485
02486 for (Int_t j_SMEcha = 0 ; j_SMEcha < fFileHeader->fMaxCrysInSM ; j_SMEcha++)
02487 {
02488 for (Int_t i_samp = 0 ; i_samp < fFileHeader->fMaxSampADC ; i_samp++)
02489 {
02490 for (Int_t j_samp = 0 ; j_samp <= i_samp; j_samp++)
02491 {
02492 fT3d_cov_ss[j_SMEcha][i_samp][j_samp] =
02493 (fVal_data[j_SMEcha][i_samp]).Covariance(fVal_data[j_SMEcha][j_samp]);
02494 fT3d_cov_ss[j_SMEcha][j_samp][i_samp] = fT3d_cov_ss[j_SMEcha][i_samp][j_samp];
02495 }
02496 }
02497 fTagCovCss[j_SMEcha] = 1; fFileHeader->fCovCssCalc++;
02498 }
02499 }
02500
02501
02502
02503
02504
02505
02506
02507
02508 void TCnaRunEB::ComputeCorrelationsBetweenSamples()
02509 {
02510
02511
02512
02513
02514
02515
02516 if ( fTagCovCss[0] != 1 ){ComputeCovariancesBetweenSamples();
02517 for (Int_t j_SMEcha = 0 ; j_SMEcha < fFileHeader->fMaxCrysInSM ; j_SMEcha++)
02518 {fTagCovCss[j_SMEcha] = 0;}}
02519
02520 if(fFlagPrint == fCodePrintAllComments){
02521 cout << "*TCnaRunEB::ComputeCorrelationsBetweenSamples()>"
02522 << " Calculation of the correlations between samples"
02523 << " for all the SMEchas" << endl;}
02524
02525
02526 if( fT3d_cor_ss == 0){
02527 const Int_t n_samp = fFileHeader->fMaxSampADC;
02528 const Int_t n_SMEcha = fFileHeader->fMaxCrysInSM;
02529 fT3d_cor_ss = new Double_t**[n_SMEcha]; fCnew++;
02530 fT3d2_cor_ss = new Double_t*[n_SMEcha*n_samp]; fCnew++;
02531 fT3d1_cor_ss = new Double_t[n_SMEcha*n_samp*n_samp]; fCnew++;
02532 for(Int_t i = 0 ; i < n_SMEcha ; i++){
02533 fT3d_cor_ss[i] = &fT3d2_cor_ss[0] + i*n_samp;
02534 for(Int_t j = 0 ; j < n_samp ; j++){
02535 fT3d2_cor_ss[n_samp*i+j] = &fT3d1_cor_ss[0]+n_samp*(n_samp*i+j);}}
02536 }
02537
02538
02539
02540
02541 for (Int_t j_SMEcha = 0 ; j_SMEcha < fFileHeader->fMaxCrysInSM ; j_SMEcha++)
02542 {
02543 for (Int_t i_samp = 0 ; i_samp < fFileHeader->fMaxSampADC ; i_samp++)
02544 {
02545 for (Int_t j_samp = 0 ; j_samp <= i_samp ; j_samp++)
02546 {
02547 if((fT3d_cov_ss)[j_SMEcha][i_samp][i_samp] > 0
02548 && (fT3d_cov_ss)[j_SMEcha][j_samp][j_samp] > 0 )
02549 {
02550 fT3d_cor_ss[j_SMEcha][i_samp][j_samp] =
02551 fT3d_cov_ss[j_SMEcha][i_samp][j_samp]/
02552 (fVal_data[j_SMEcha][i_samp].StandardDeviation("corss1") *
02553 fVal_data[j_SMEcha][j_samp].StandardDeviation("corss2"));
02554 }
02555 else
02556 {
02557 (fT3d_cor_ss)[j_SMEcha][i_samp][j_samp] = (Double_t)0;
02558 }
02559 fT3d_cor_ss[j_SMEcha][j_samp][i_samp] = fT3d_cor_ss[j_SMEcha][i_samp][j_samp];
02560 }
02561 }
02562 fTagCorCss[j_SMEcha] = 1; fFileHeader->fCorCssCalc++;
02563 }
02564 }
02565
02566
02567
02568
02569
02570
02571
02572
02573 void TCnaRunEB::ComputeCovariancesBetweenChannels()
02574 {
02575
02576
02577 if(fFlagPrint == fCodePrintAllComments){
02578 cout << "*TCnaRunEB::ComputeCovariancesBetweenChannels()>"
02579 << " Calculation of the covariances between SMEchas"
02580 << " for each sample." << endl;}
02581
02582
02583 if( fT3d_cov_cc == 0 ){
02584 const Int_t n_samp = fFileHeader->fMaxSampADC;
02585 const Int_t n_SMEcha = fFileHeader->fMaxCrysInSM;
02586 fT3d_cov_cc = new Double_t**[n_samp]; fCnew++;
02587 fT3d2_cov_cc = new Double_t*[n_samp*n_SMEcha]; fCnew++;
02588 fT3d1_cov_cc = new Double_t[n_samp*n_SMEcha*n_SMEcha]; fCnew++;
02589 for(Int_t i = 0 ; i < n_samp ; i++){
02590 fT3d_cov_cc[i] = &fT3d2_cov_cc[0] + i*n_SMEcha;
02591 for(Int_t j = 0 ; j < n_SMEcha ; j++){
02592 fT3d2_cov_cc[n_SMEcha*i+j] = &fT3d1_cov_cc[0]+n_SMEcha*(n_SMEcha*i+j);}}
02593 }
02594
02595
02596
02597
02598 for (Int_t k_samp = 0 ; k_samp < fFileHeader->fMaxSampADC ; k_samp++)
02599 {
02600 for (Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
02601 {
02602 for (Int_t j_SMEcha = 0 ; j_SMEcha <= i_SMEcha ; j_SMEcha++)
02603 {
02604 fT3d_cov_cc[k_samp][i_SMEcha][j_SMEcha]
02605 = (fVal_data[i_SMEcha][k_samp]).Covariance(fVal_data[j_SMEcha][k_samp]);
02606 fT3d_cov_cc[k_samp][j_SMEcha][i_SMEcha] = fT3d_cov_cc[k_samp][i_SMEcha][j_SMEcha];
02607 }
02608 }
02609 fTagCovScc[k_samp] = 1; fFileHeader->fCovSccCalc++;
02610 }
02611 }
02612
02613
02614
02615
02616
02617
02618
02619
02620 void TCnaRunEB::ComputeCovariancesBetweenChannelsMeanOverSamples()
02621 {
02622
02623
02624
02625
02626
02627
02628
02629 if ( fTagCovScc[0] != 1 ){ComputeCovariancesBetweenChannels();
02630 for (Int_t k_samp = 0 ; k_samp < fFileHeader->fMaxSampADC ; k_samp++)
02631 {fTagCovScc[k_samp] = 0;}}
02632
02633 if(fFlagPrint == fCodePrintAllComments){
02634 cout << "*TCnaRunEB::ComputeCovariancesBetweenChannelsMeanOverSamples()>"
02635 << " Calculation of the covariances between SMEchas,"
02636 << " Calculation of the average over the samples." << endl;}
02637
02638
02639
02640 if( fT2d_cov_cc_mos == 0 ){
02641 const Int_t n_SMEcha = fFileHeader->fMaxCrysInSM;
02642 fT2d_cov_cc_mos = new Double_t*[n_SMEcha]; fCnew++;
02643 fT2d1_cov_cc_mos = new Double_t[n_SMEcha*n_SMEcha]; fCnew++;
02644 for(Int_t i_SMEcha = 0 ; i_SMEcha < n_SMEcha ; i_SMEcha++){
02645 fT2d_cov_cc_mos[i_SMEcha] = &fT2d1_cov_cc_mos[0] + i_SMEcha*n_SMEcha;}
02646 }
02647
02648 for (Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
02649 {
02650 for (Int_t j_SMEcha = 0 ; j_SMEcha < fFileHeader->fMaxCrysInSM ; j_SMEcha++)
02651 {
02652 if( fT2d_cov_cc_mos[i_SMEcha][j_SMEcha] != (Double_t)0 )
02653 {fMiscDiag[7]++; fT2d_cov_cc_mos[i_SMEcha][j_SMEcha] = (Double_t)0;}
02654 }
02655 }
02656
02657
02658 for (Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
02659 {
02660 for (Int_t j_SMEcha = 0 ; j_SMEcha < fFileHeader->fMaxCrysInSM ; j_SMEcha++)
02661 {
02662 for (Int_t k_samp = 0 ; k_samp < fFileHeader->fMaxSampADC ; k_samp++)
02663 {
02664 fT2d_cov_cc_mos[i_SMEcha][j_SMEcha] =
02665 fT2d_cov_cc_mos[i_SMEcha][j_SMEcha] + fT3d_cov_cc[k_samp][i_SMEcha][j_SMEcha];
02666 }
02667 fT2d_cov_cc_mos[i_SMEcha][j_SMEcha] =
02668 fT2d_cov_cc_mos[i_SMEcha][j_SMEcha]/(Double_t)(fFileHeader->fMaxSampADC);
02669 }
02670 }
02671 fTagCovSccMos[0] = 1; fFileHeader->fCovSccMosCalc++;
02672 }
02673
02674
02675
02676
02677
02678
02679
02680 void TCnaRunEB::ComputeCorrelationsBetweenChannels()
02681 {
02682
02683
02684
02685
02686
02687
02688 if ( fTagCovScc[0] != 1 ){ComputeCovariancesBetweenChannels();
02689 for (Int_t k_samp = 0 ; k_samp < fFileHeader->fMaxSampADC ; k_samp++)
02690 {fTagCovScc[k_samp] = 0;}}
02691
02692
02693
02694 if(fFlagPrint == fCodePrintAllComments){
02695 cout << "*TCnaRunEB::ComputeCorrelationsBetweenChannels()>"
02696 << " Calculation of the correlations between SMEchas"
02697 << " for all the samples." << endl;}
02698
02699
02700 if ( fT3d_cor_cc == 0 ){
02701 const Int_t n_samp = fFileHeader->fMaxSampADC;
02702 const Int_t n_SMEcha = fFileHeader->fMaxCrysInSM;
02703 fT3d_cor_cc = new Double_t**[n_samp]; fCnew++;
02704 fT3d2_cor_cc = new Double_t*[n_samp*n_SMEcha]; fCnew++;
02705 fT3d1_cor_cc = new Double_t[n_samp*n_SMEcha*n_SMEcha]; fCnew++;
02706 for(Int_t i = 0 ; i < n_samp ; i++){
02707 fT3d_cor_cc[i] = &fT3d2_cor_cc[0] + i*n_SMEcha;
02708 for(Int_t j = 0 ; j < n_SMEcha ; j++){
02709 fT3d2_cor_cc[n_SMEcha*i+j] = &fT3d1_cor_cc[0]+n_SMEcha*(n_SMEcha*i+j);}}
02710 }
02711
02712
02713
02714 for (Int_t n_samp = 0 ; n_samp < fFileHeader->fMaxSampADC ; n_samp++)
02715 {
02716 for (Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
02717 {
02718 for (Int_t j_SMEcha = 0 ; j_SMEcha <= i_SMEcha ; j_SMEcha++)
02719 {
02720 if( fT3d_cov_cc[n_samp][i_SMEcha][i_SMEcha] > 0
02721 && fT3d_cov_cc[n_samp][j_SMEcha][j_SMEcha] > 0 )
02722 {
02723 fT3d_cor_cc[n_samp][i_SMEcha][j_SMEcha] =
02724 fT3d_cov_cc[n_samp][i_SMEcha][j_SMEcha]/
02725 ( (Double_t)sqrt(fT3d_cov_cc[n_samp][i_SMEcha][i_SMEcha]) *
02726 (Double_t)sqrt(fT3d_cov_cc[n_samp][j_SMEcha][j_SMEcha]) );
02727 }
02728 else
02729 {
02730 fT3d_cor_cc[n_samp][i_SMEcha][j_SMEcha] = (Double_t)0.;
02731 }
02732
02733 fT3d_cor_cc[n_samp][j_SMEcha][i_SMEcha] = fT3d_cor_cc[n_samp][i_SMEcha][j_SMEcha];
02734 }
02735 }
02736 fTagCorScc[n_samp] = 1; fFileHeader->fCorSccCalc++;
02737 }
02738 }
02739
02740
02741
02742
02743
02744
02745
02746 void TCnaRunEB::ComputeCorrelationsBetweenChannelsMeanOverSamples()
02747 {
02748
02749
02750
02751
02752
02753
02754
02755 if ( fTagCorScc[0] != 1 ){ComputeCorrelationsBetweenChannels();
02756 for (Int_t k_samp = 0 ; k_samp < fFileHeader->fMaxSampADC ; k_samp++)
02757 {fTagCorScc[k_samp] = 0;}}
02758
02759
02760 if(fFlagPrint == fCodePrintAllComments){
02761 cout << "*TCnaRunEB::ComputeCorrelationsBetweenChannelsMeanOverSamples()>"
02762 << " Calculation of the correlations between SMEchas"
02763 << " Calculation of the average over the samples." << endl;}
02764
02765
02766 if( fT2d_cor_cc_mos == 0 ){
02767 const Int_t n_SMEcha = fFileHeader->fMaxCrysInSM;
02768 fT2d_cor_cc_mos = new Double_t*[n_SMEcha]; fCnew++;
02769 fT2d1_cor_cc_mos = new Double_t[n_SMEcha*n_SMEcha]; fCnew++;
02770 for(Int_t i_SMEcha = 0 ; i_SMEcha < n_SMEcha ; i_SMEcha++){
02771 fT2d_cor_cc_mos[i_SMEcha] = &fT2d1_cor_cc_mos[0] + i_SMEcha*n_SMEcha;}
02772 }
02773
02774 for (Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
02775 {
02776 for (Int_t j_SMEcha = 0 ; j_SMEcha < fFileHeader->fMaxCrysInSM ; j_SMEcha++)
02777 {
02778 if( fT2d_cor_cc_mos[i_SMEcha][j_SMEcha] != (Double_t)0 )
02779 {fMiscDiag[8]++; fT2d_cor_cc_mos[i_SMEcha][j_SMEcha] = (Double_t)0;}
02780 }
02781 }
02782
02783
02784
02785 for (Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
02786 {
02787 for (Int_t j_SMEcha = 0 ; j_SMEcha < fFileHeader->fMaxCrysInSM ; j_SMEcha++)
02788 {
02789 for (Int_t k_samp = 0 ; k_samp < fFileHeader->fMaxSampADC ; k_samp++)
02790 {
02791 fT2d_cor_cc_mos[i_SMEcha][j_SMEcha] += fT3d_cor_cc[k_samp][i_SMEcha][j_SMEcha];
02792 }
02793 fT2d_cor_cc_mos[i_SMEcha][j_SMEcha] =
02794 fT2d_cor_cc_mos[i_SMEcha][j_SMEcha]/(Double_t)(fFileHeader->fMaxSampADC);
02795 }
02796 }
02797 fTagCorSccMos[0] = 1; fFileHeader->fCorSccMosCalc++;
02798 }
02799
02800
02801
02802
02803
02804
02805
02806
02807 void TCnaRunEB::ComputeCovariancesBetweenTowersMeanOverSamplesAndChannels()
02808 {
02809
02810
02811
02812
02813
02814
02815
02816 if(fTagCovSccMos[0] != 1){ComputeCovariancesBetweenChannelsMeanOverSamples(); fTagCovSccMos[0]=0;}
02817
02818
02819 if(fFlagPrint == fCodePrintAllComments){
02820 cout << "*TCnaRunEB::ComputeCovariancesBetweenTowersMeanOverSamplesAndChannels()>"
02821 << " Calculation of the averaged covariances between towers,"
02822 << " (average over the samples and over the channels)." << endl;}
02823
02824
02825 if( fT2d_cov_moscc_mot == 0 ){
02826 const Int_t n_tow = fFileHeader->fMaxTowInSM;
02827 fT2d_cov_moscc_mot = new Double_t*[n_tow]; fCnew++;
02828 fT2d1_cov_moscc_mot = new Double_t[n_tow*n_tow]; fCnew++;
02829 for(Int_t i_tow = 0 ; i_tow < n_tow ; i_tow++){
02830 fT2d_cov_moscc_mot[i_tow] = &fT2d1_cov_moscc_mot[0] + i_tow*n_tow;}
02831 }
02832
02833 for(Int_t i_tow=0; i_tow<fFileHeader->fMaxTowInSM; i_tow++)
02834 {
02835 for(Int_t j_tow=0; j_tow<fFileHeader->fMaxTowInSM; j_tow++)
02836 {
02837 if( fT2d_cov_moscc_mot[i_tow][j_tow] != (Double_t)0 )
02838 {fMiscDiag[9]++; fT2d_cov_moscc_mot[i_tow][j_tow] = (Double_t)0;}
02839 }
02840 }
02841
02842
02843 for(Int_t i_tow=0; i_tow<fFileHeader->fMaxTowInSM; i_tow++)
02844 {
02845 for(Int_t j_tow=0; j_tow<fFileHeader->fMaxTowInSM; j_tow++)
02846 {
02847 for(Int_t i_crys=0; i_crys<fFileHeader->fMaxCrysInTow; i_crys++)
02848 {
02849 Int_t i_SMEcha = i_tow*fFileHeader->fMaxCrysInTow + i_crys;
02850 for(Int_t j_crys=0; j_crys<fFileHeader->fMaxCrysInTow; j_crys++)
02851 {
02852 Int_t j_SMEcha = j_tow*fFileHeader->fMaxCrysInTow + j_crys;
02853 fT2d_cov_moscc_mot[i_tow][j_tow] += fT2d_cov_cc_mos[i_SMEcha][j_SMEcha];
02854 }
02855 }
02856 fT2d_cov_moscc_mot[i_tow][j_tow] = fT2d_cov_moscc_mot[i_tow][j_tow]
02857 /((Double_t)(fFileHeader->fMaxCrysInTow*fFileHeader->fMaxCrysInTow));
02858 }
02859 }
02860 fTagCovMosccMot[0] = 1; fFileHeader->fCovMosccMotCalc++;
02861 }
02862
02863
02864
02865
02866
02867
02868
02869
02870
02871 void TCnaRunEB::ComputeCorrelationsBetweenTowersMeanOverSamplesAndChannels()
02872 {
02873
02874
02875
02876
02877
02878
02879
02880 if(fTagCorSccMos[0] != 1){ComputeCorrelationsBetweenChannelsMeanOverSamples(); fTagCorSccMos[0]= 0;}
02881
02882 if(fFlagPrint == fCodePrintAllComments){
02883 cout << "*TCnaRunEB::ComputeCorrelationsBetweenTowersMeanOverSamplesAndChannels()>"
02884 << " Calculation of the averaged correlations between towers,"
02885 << " (average over the samples and over the channels)." << endl;}
02886
02887
02888 if( fT2d_cor_moscc_mot == 0 ){
02889 const Int_t n_tow = fFileHeader->fMaxTowInSM;
02890 fT2d_cor_moscc_mot = new Double_t*[n_tow]; fCnew++;
02891 fT2d1_cor_moscc_mot = new Double_t[n_tow*n_tow]; fCnew++;
02892 for(Int_t i_tow = 0 ; i_tow < n_tow ; i_tow++){
02893 fT2d_cor_moscc_mot[i_tow] = &fT2d1_cor_moscc_mot[0] + i_tow*n_tow;}
02894 }
02895
02896 for(Int_t i_tow=0; i_tow<fFileHeader->fMaxTowInSM; i_tow++)
02897 {
02898 for(Int_t j_tow=0; j_tow<fFileHeader->fMaxTowInSM; j_tow++)
02899 {
02900 if( fT2d_cor_moscc_mot[i_tow][j_tow] != (Double_t)0 )
02901 {fMiscDiag[10]++; fT2d_cor_moscc_mot[i_tow][j_tow] = (Double_t)0;}
02902 }
02903 }
02904
02905
02906
02907 for(Int_t i_tow=0; i_tow<fFileHeader->fMaxTowInSM; i_tow++)
02908 {
02909 for(Int_t j_tow=0; j_tow<fFileHeader->fMaxTowInSM; j_tow++)
02910 {
02911
02912 for(Int_t i_crys=0; i_crys<fFileHeader->fMaxCrysInTow; i_crys++)
02913 {
02914 Int_t i_SMEcha = i_tow*fFileHeader->fMaxCrysInTow + i_crys;
02915 for(Int_t j_crys=0; j_crys<fFileHeader->fMaxCrysInTow; j_crys++)
02916 {
02917 Int_t j_SMEcha = j_tow*fFileHeader->fMaxCrysInTow + j_crys;
02918 fT2d_cor_moscc_mot[i_tow][j_tow] += fT2d_cor_cc_mos[i_SMEcha][j_SMEcha];
02919 }
02920 }
02921
02922 fT2d_cor_moscc_mot[i_tow][j_tow] = fT2d_cor_moscc_mot[i_tow][j_tow]
02923 /((Double_t)(fFileHeader->fMaxCrysInTow*fFileHeader->fMaxCrysInTow));
02924 }
02925 }
02926 fTagCorMosccMot[0] = 1; fFileHeader->fCorMosccMotCalc++;
02927 }
02928
02929
02930
02931
02932
02933
02934
02935 void TCnaRunEB::ComputeExpectationValuesOfExpectationValuesOfSamples()
02936 {
02937
02938
02939
02940
02941 if ( fTagEv[0] != 1 ){ComputeExpectationValuesOfSamples(); fTagEv[0]=0; }
02942
02943
02944 if( fT1d_ev_ev == 0 ){
02945 fT1d_ev_ev = new Double_t[fFileHeader->fMaxCrysInSM]; fCnew++;
02946 }
02947 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
02948 {
02949 if( fT1d_ev_ev[i_SMEcha] != (Double_t)0 )
02950 {fMiscDiag[11]++; fT1d_ev_ev[i_SMEcha] = (Double_t)0;}
02951 }
02952
02953
02954 TVectorD ch_ev(fFileHeader->fMaxSampADC);
02955 TDistrib* amplit = new TDistrib(fFileHeader->fMaxSampADC, ch_ev); fCnew++;
02956
02957 if(fFlagPrint == fCodePrintAllComments){
02958 cout << "*TCnaRunEB::ComputeExpectationValuesOfExpectationValuesOfSamples()>" << endl
02959 << " Calculation of the expectation values of the"
02960 << " expectation values of the samples for all the SMEchas" << endl;}
02961
02962
02963 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
02964 {
02965 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
02966 {
02967 ch_ev(i_samp) = fT2d_ev[i_SMEcha][i_samp];
02968 }
02969
02970 Bool_t ok_refill = amplit->Refill(fFileHeader->fMaxSampADC, ch_ev);
02971 if(ok_refill == kTRUE){fT1d_ev_ev[i_SMEcha] = amplit->ExpectationValue();}
02972 }
02973 delete amplit; fCdelete++;
02974 fTagEvEv[0] = 1; fFileHeader->fEvEvCalc++;
02975 }
02976
02977
02978
02979
02980
02981
02982
02983 void TCnaRunEB::ComputeExpectationValuesOfSigmasOfSamples()
02984 {
02985
02986
02987
02988
02989 if ( fTagVar[0] != 1 ){ComputeVariancesOfSamples(); fTagVar[0]=0; }
02990
02991
02992 if( fT1d_ev_sig == 0 ){
02993 fT1d_ev_sig = new Double_t[fFileHeader->fMaxCrysInSM]; fCnew++;
02994 }
02995 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
02996 {
02997 if( fT1d_ev_sig[i_SMEcha] != (Double_t)0 )
02998 {fMiscDiag[12]++; fT1d_ev_sig[i_SMEcha] = (Double_t)0;}
02999 }
03000
03001
03002 TVectorD ch_sig(fFileHeader->fMaxSampADC);
03003 TDistrib* amplit = new TDistrib(fFileHeader->fMaxSampADC, ch_sig); fCnew++;
03004
03005 if(fFlagPrint == fCodePrintAllComments){
03006 cout << "*TCnaRunEB::ComputeExpectationValuesOfSigmasOfSamples()>" << endl
03007 << " Calculation of the expectation values of the"
03008 << " sigmas of the samples for all the SMEchas" << endl;}
03009
03010
03011 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
03012 {
03013 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
03014 {
03015 if (ch_sig(i_samp) >= (Double_t)0.)
03016 {
03017 ch_sig(i_samp) = (Double_t)sqrt(fT2d_var[i_SMEcha][i_samp]);
03018 }
03019 else
03020 {
03021 ch_sig(i_samp) = (Double_t)(-1.);
03022 cout << "!TCnaRunEB::ComputeExpectationValuesOfSigmasOfSamples() *** ERROR ***> " << endl
03023 << " Negative variance! Sigma forced to -1" << fTTBELL << endl;
03024 }
03025 }
03026
03027 Bool_t ok_refill = amplit->Refill(fFileHeader->fMaxSampADC, ch_sig);
03028 if(ok_refill == kTRUE){fT1d_ev_sig[i_SMEcha] = amplit->ExpectationValue();}
03029 }
03030 delete amplit; fCdelete++;
03031 fTagEvSig[0] = 1; fFileHeader->fEvSigCalc++;
03032 }
03033
03034
03035
03036
03037
03038
03039
03040 void TCnaRunEB::ComputeExpectationValuesOfCorrelationsBetweenSamples()
03041 {
03042
03043
03044
03045
03046 if ( fTagCorCss[0] != 1 ){ComputeCorrelationsBetweenSamples(); fTagCorCss[0]=0;}
03047
03048
03049 if( fT1d_ev_cor_ss == 0 ){
03050 Int_t n_SMEcha = fFileHeader->fMaxCrysInSM;
03051 fT1d_ev_cor_ss = new Double_t[n_SMEcha]; fCnew++;
03052 }
03053 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
03054 {
03055 if( fT1d_ev_cor_ss[i_SMEcha] != (Double_t)0 )
03056 {fMiscDiag[13]++; fT1d_ev_cor_ss[i_SMEcha] = (Double_t)0;}
03057 }
03058
03059
03060
03061 Int_t ndim = (Int_t)(fFileHeader->fMaxSampADC*(fFileHeader->fMaxSampADC - 1)/2);
03062
03063 TVectorD half_cor_ss(ndim);
03064
03065 TDistrib* amplit = new TDistrib(ndim, half_cor_ss); fCnew++;
03066
03067 if(fFlagPrint == fCodePrintAllComments){
03068 cout << "*TCnaRunEB::ComputeExpectationValuesOfCorrelationsBetweenSamples()>" << endl
03069 << " Calculation of the expectation values of the"
03070 << " (sample,sample) correlations for all the SMEchas" << endl;}
03071
03072
03073 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
03074 {
03075 Int_t i_count = 0;
03076 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
03077 {
03078 for (Int_t j_samp = 0; j_samp < i_samp; j_samp++)
03079 {
03080 half_cor_ss(i_count) = fT3d_cor_ss[i_SMEcha][i_samp][j_samp];
03081 i_count++;
03082 }
03083 }
03084
03085 Bool_t ok_refill = amplit->Refill(ndim, half_cor_ss);
03086 if(ok_refill == kTRUE){fT1d_ev_cor_ss[i_SMEcha] = amplit->ExpectationValue();}
03087 }
03088 delete amplit; fCdelete++;
03089 fTagEvCorCss[0] = 1; fFileHeader->fEvCorCssCalc++;
03090 }
03091
03092
03093
03094
03095
03096
03097
03098 void TCnaRunEB::ComputeSigmasOfExpectationValuesOfSamples()
03099 {
03100
03101
03102
03103
03104 if ( fTagEv[0] != 1 ){ComputeExpectationValuesOfSamples(); fTagEv[0]=0; }
03105
03106
03107 if( fT1d_sig_ev == 0 ){
03108 fT1d_sig_ev = new Double_t[fFileHeader->fMaxCrysInSM]; fCnew++;
03109 }
03110
03111 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
03112 {
03113 if( fT1d_sig_ev[i_SMEcha] != (Double_t)0 )
03114 {fMiscDiag[14]++; fT1d_sig_ev[i_SMEcha] = (Double_t)0;}
03115 }
03116
03117
03118 TVectorD ch_ev(fFileHeader->fMaxSampADC);
03119 TDistrib* amplit = new TDistrib(fFileHeader->fMaxSampADC, ch_ev); fCnew++;
03120
03121 if(fFlagPrint == fCodePrintAllComments){
03122 cout << "*TCnaRunEB::ComputeSigmasOfExpectationValuesOfSamples()>" << endl
03123 << " Calculation of the sigmas of the"
03124 << " expectation values of the samples for all the SMEchas" << endl;}
03125
03126
03127 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
03128 {
03129 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
03130 {
03131 ch_ev(i_samp) = fT2d_ev[i_SMEcha][i_samp];
03132 }
03133
03134 Bool_t ok_refill = amplit->Refill(fFileHeader->fMaxSampADC, ch_ev);
03135 if(ok_refill == kTRUE){fT1d_sig_ev[i_SMEcha] = amplit->StandardDeviation();}
03136 }
03137 delete amplit; fCdelete++;
03138 fTagSigEv[0] = 1; fFileHeader->fSigEvCalc++;
03139 }
03140
03141
03142
03143
03144
03145
03146
03147 void TCnaRunEB::ComputeSigmasOfSigmasOfSamples()
03148 {
03149
03150
03151
03152
03153 if ( fTagVar[0] != 1 ){ComputeVariancesOfSamples(); fTagVar[0]=0; }
03154
03155
03156 if( fT1d_sig_sig == 0 ){
03157 fT1d_sig_sig = new Double_t[fFileHeader->fMaxCrysInSM]; fCnew++;
03158 }
03159 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
03160 {
03161 if( fT1d_sig_sig[i_SMEcha] != (Double_t)0 )
03162 {fMiscDiag[15]++; fT1d_sig_sig[i_SMEcha] = (Double_t)0;}
03163 }
03164
03165
03166 TVectorD ch_sig(fFileHeader->fMaxSampADC);
03167 TDistrib* amplit = new TDistrib(fFileHeader->fMaxSampADC, ch_sig); fCnew++;
03168
03169 if(fFlagPrint == fCodePrintAllComments){
03170 cout << "*TCnaRunEB::ComputeSigmasOfSigmasOfSamples()>" << endl
03171 << " Calculation of the sigmas of the"
03172 << " sigmas of the samples for all the SMEchas" << endl;}
03173
03174
03175 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
03176 {
03177 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
03178 {
03179 if (ch_sig(i_samp) >= (Double_t)0.)
03180 {
03181 ch_sig(i_samp) = (Double_t)sqrt(fT2d_var[i_SMEcha][i_samp]);
03182 }
03183 else
03184 {
03185 ch_sig(i_samp) = (Double_t)(-1.);
03186 cout << "!TCnaRunEB::ComputeSigmasOfSigmasOfSamples() *** ERROR ***> " << endl
03187 << " Negative variance! Sigma forced to -1" << fTTBELL << endl;
03188 }
03189 }
03190
03191 Bool_t ok_refill = amplit->Refill(fFileHeader->fMaxSampADC, ch_sig);
03192 if(ok_refill == kTRUE){fT1d_sig_sig[i_SMEcha] = amplit->StandardDeviation();}
03193 }
03194 delete amplit; fCdelete++;
03195 fTagSigSig[0] = 1; fFileHeader->fSigSigCalc++;
03196 }
03197
03198
03199
03200
03201
03202
03203
03204 void TCnaRunEB::ComputeSigmasOfCorrelationsBetweenSamples()
03205 {
03206
03207
03208
03209
03210 if ( fTagCorCss[0] != 1 ){ComputeCorrelationsBetweenSamples(); fTagCorCss[0]=0;}
03211
03212
03213 if( fT1d_sig_cor_ss == 0 ){
03214 Int_t n_SMEcha = fFileHeader->fMaxCrysInSM;
03215 fT1d_sig_cor_ss = new Double_t[n_SMEcha]; fCnew++;
03216 }
03217 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
03218 {
03219 if( fT1d_sig_cor_ss[i_SMEcha] != (Double_t)0 )
03220 {fMiscDiag[16]++; fT1d_sig_cor_ss[i_SMEcha] = (Double_t)0;}
03221 }
03222
03223 if(fFlagPrint == fCodePrintAllComments){
03224 cout << "*TCnaRunEB::ComputeSigmasOfCorrelationsBetweenSamples()>" << endl
03225 << " Calculation of the sigmas of the (sample,sample)"
03226 << " correlations for all the cna_SMEchas" << endl;}
03227
03228
03229
03230 Int_t ndim = (Int_t)(fFileHeader->fMaxSampADC*(fFileHeader->fMaxSampADC - 1)/2);
03231
03232
03233 TVectorD half_cor_ss(ndim);
03234
03235 TDistrib* amplit = new TDistrib(ndim, half_cor_ss); fCnew++;
03236
03237
03238 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
03239 {
03240 Int_t i_count = 0;
03241 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
03242 {
03243 for (Int_t j_samp = 0; j_samp < i_samp; j_samp++)
03244 {
03245 half_cor_ss(i_count) = fT3d_cor_ss[i_SMEcha][i_samp][j_samp];
03246 i_count++;
03247 }
03248 }
03249
03250 Bool_t ok_refill = amplit->Refill(ndim, half_cor_ss);
03251 if(ok_refill == kTRUE){fT1d_sig_cor_ss[i_SMEcha] = amplit->StandardDeviation("SigmaCorss");}
03252 }
03253 delete amplit; fCdelete++;
03254 fTagSigCorCss[0] = 1; fFileHeader->fSigCorCssCalc++;
03255 }
03256
03257
03258
03259
03260
03261
03262
03263
03264 void TCnaRunEB::ComputeCorrectionsToSamplesFromCovss(const Int_t& nb_first_samples)
03265 {
03266
03267
03268
03269
03270 if( fT2d_sv_correc_covss_s == 0 ){
03271 Int_t n_SMEcha = fFileHeader->fMaxCrysInSM;
03272 Int_t n_samp = fFileHeader->fMaxSampADC;
03273 fT2d_sv_correc_covss_s = new Double_t*[n_SMEcha]; fCnew++;
03274 fT2d1_sv_correc_covss_s = new Double_t[n_SMEcha*n_samp]; fCnew++;
03275 for(Int_t i = 0 ; i < n_SMEcha ; i++){
03276 fT2d_sv_correc_covss_s[i] = &fT2d1_sv_correc_covss_s[0] + i*n_samp;}
03277 }
03278
03279 for(Int_t i_SMEcha = 0; i_SMEcha <fFileHeader->fMaxCrysInSM; i_SMEcha++)
03280 {
03281 for(Int_t i_samp = 0; i_samp <fFileHeader->fMaxSampADC; i_samp++)
03282 {
03283 if( fT2d_sv_correc_covss_s[i_SMEcha][i_samp] != (Double_t)0 )
03284 {fMiscDiag[17]++; fT2d_sv_correc_covss_s[i_SMEcha][i_samp] = (Double_t)0;}
03285 }
03286 }
03287
03288 if(fFlagPrint == fCodePrintAllComments){
03289 cout << "*TCnaRunEB::ComputeCorrectionsToSamplesFromCovss()>" << endl
03290 << " Calculation of the correction coefficients to sample values"
03291 << " for all the SMEchas from the (sample,sample) covariances" << endl;}
03292
03293
03294 if ( fTagCovCss[0] != 1 ) { ComputeCovariancesBetweenSamples(); }
03295
03296
03297
03298 for(Int_t i_SMEcha = 0; i_SMEcha <fFileHeader->fMaxCrysInSM; i_SMEcha++)
03299 {
03300
03301 }
03302
03303 fTagSvCorrecCovCss[0] = 1; fFileHeader->fSvCorrecCovCssCalc++;
03304 }
03305
03306
03307
03308
03309
03310
03311
03312
03313 void TCnaRunEB::ComputeCorrectionFactorsToCovss()
03314 {
03315
03316
03317
03318
03319 if (fT3d_cov_correc_covss_s == 0 ){
03320 Int_t n_SMEcha = fFileHeader->fMaxCrysInSM;
03321 Int_t n_samp = fFileHeader->fMaxSampADC;
03322 fT3d_cov_correc_covss_s = new Double_t**[n_SMEcha]; fCnew++;
03323 fT3d2_cov_correc_covss_s = new Double_t*[n_SMEcha*n_samp]; fCnew++;
03324 fT3d1_cov_correc_covss_s = new Double_t[n_SMEcha*n_samp*n_samp]; fCnew++;
03325 for(Int_t i = 0 ; i < n_SMEcha ; i++){
03326 fT3d_cov_correc_covss_s[i] = &fT3d2_cov_correc_covss_s[0] + i*n_samp;
03327 for(Int_t j = 0 ; j < n_samp ; j++){
03328 fT3d2_cov_correc_covss_s[n_samp*i+j] =
03329 &fT3d1_cov_correc_covss_s[0]+n_samp*(n_samp*i+j);}}
03330 }
03331
03332 for(Int_t i_SMEcha = 0; i_SMEcha <fFileHeader->fMaxCrysInSM; i_SMEcha++)
03333 {
03334 for(Int_t i_samp = 0; i_samp <fFileHeader->fMaxSampADC; i_samp++)
03335 {
03336 for(Int_t j_samp = 0; j_samp <fFileHeader->fMaxSampADC; j_samp++)
03337 {
03338 if( fT3d_cov_correc_covss_s[i_SMEcha][i_samp][j_samp] != (Double_t)0 )
03339 {fMiscDiag[18]++; fT3d_cov_correc_covss_s[i_SMEcha][i_samp][j_samp] = (Double_t)0;}
03340 }
03341 }
03342 }
03343
03344
03345
03346
03347 if ( fTagCovCss[0] != 1 ) { ComputeCovariancesBetweenSamples(); }
03348
03349 if(fFlagPrint == fCodePrintAllComments){
03350 cout << "*TCnaRunEB::ComputeCorrectionFactorsToCovss>" << endl
03351 << " Calculation of the correction factors to the"
03352 << " (sample,sample) covariances for all the SMEchas" << endl;}
03353
03354
03355
03356
03357
03358
03359
03360 Double_t** sum_cov = new Double_t*[fFileHeader->fMaxCrysInSM]; fCnew++;
03361 Double_t* sum_cov12 = new Double_t[fFileHeader->fMaxCrysInSM*fFileHeader->fMaxSampADC]; fCnew++;
03362
03363 for(Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
03364 {sum_cov[i_SMEcha] = &sum_cov12[0] + i_SMEcha*fFileHeader->fMaxSampADC;}
03365
03366 for(Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
03367 {
03368 for(Int_t i_samp = 0 ; i_samp < fFileHeader->fMaxCrysInSM ; i_samp++)
03369 {
03370 if( sum_cov[i_SMEcha][i_samp] != (Double_t)0 )
03371 {fMiscDiag[19]++; sum_cov[i_SMEcha][i_samp] = (Double_t)0;}
03372 }
03373 }
03374
03375
03376 for (Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
03377 {
03378
03379 }
03380
03381
03382
03383
03384
03385
03386 Double_t* sum_sum_cov = new Double_t[fFileHeader->fMaxCrysInSM]; fCnew++;
03387 for (Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
03388 {sum_sum_cov[i_SMEcha] = (Double_t)0;}
03389
03390
03391 for (Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
03392 {
03393 for (Int_t m_samp = 0; m_samp < fFileHeader->fMaxSampADC; m_samp++)
03394 {
03395 sum_sum_cov[i_SMEcha] = sum_sum_cov[i_SMEcha] + sum_cov[i_SMEcha][m_samp];
03396 }
03397 }
03398
03399
03400
03401
03402
03403 Double_t*** sum_cov_num1 = new Double_t**[fFileHeader->fMaxCrysInSM]; fCnew++;
03404 Double_t** sum_cov_num12 = new Double_t*[fFileHeader->fMaxCrysInSM*fFileHeader->fMaxSampADC]; fCnew++;
03405 Double_t* sum_cov_num123 =
03406 new Double_t[fFileHeader->fMaxCrysInSM*fFileHeader->fMaxSampADC*fFileHeader->fMaxSampADC]; fCnew++;
03407
03408 for(Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
03409 {
03410 sum_cov_num1[i_SMEcha] = &sum_cov_num12[0] + i_SMEcha*fFileHeader->fMaxSampADC;
03411 for (Int_t i_samp = 0 ; i_samp < fFileHeader->fMaxSampADC; i_samp++)
03412 {
03413 sum_cov_num12[i_SMEcha*fFileHeader->fMaxSampADC + i_samp] =
03414 &sum_cov_num123[0] + (i_SMEcha*fFileHeader->fMaxSampADC + i_samp)*fFileHeader->fMaxSampADC;
03415 }
03416 }
03417
03418 for(Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
03419 {
03420 for(Int_t i_samp = 0 ; i_samp < fFileHeader->fMaxSampADC ; i_samp++)
03421 {
03422 for(Int_t j_samp = 0 ; j_samp < fFileHeader->fMaxSampADC ; j_samp++)
03423 {
03424 if( sum_cov_num1[i_SMEcha][i_samp][j_samp] != (Double_t)0 )
03425 {fMiscDiag[20]++; sum_cov_num1[i_SMEcha][i_samp][j_samp] = (Double_t)0;}
03426 }
03427 }
03428 }
03429
03430
03431 for(Int_t i_SMEcha = 0 ; i_SMEcha < fFileHeader->fMaxCrysInSM ; i_SMEcha++)
03432 {
03433
03434 fTagCovCorrecCovCss[i_SMEcha] = 1; fFileHeader->fCovCorrecCovCssCalc++;
03435 }
03436
03437 delete [] sum_cov; fCdelete++;
03438 delete [] sum_cov12; fCdelete++;
03439 delete [] sum_sum_cov; fCdelete++;
03440 delete [] sum_cov_num1; fCdelete++;
03441 delete [] sum_cov_num12; fCdelete++;
03442 delete [] sum_cov_num123; fCdelete++;
03443 }
03444
03445
03446
03447
03448
03449
03450 void TCnaRunEB::ComputeCorrectionFactorsToCorss()
03451 {
03452
03453
03454
03455
03456 if( fT3d_cor_correc_covss_s == 0 ){
03457 Int_t n_SMEcha = fFileHeader->fMaxCrysInSM;
03458 Int_t n_samp = fFileHeader->fMaxSampADC;
03459 fT3d_cor_correc_covss_s = new Double_t**[n_SMEcha]; fCnew++;
03460 fT3d2_cor_correc_covss_s = new Double_t*[n_SMEcha*n_samp]; fCnew++;
03461 fT3d1_cor_correc_covss_s = new Double_t[n_SMEcha*n_samp*n_samp]; fCnew++;
03462 for(Int_t i = 0 ; i < n_SMEcha ; i++){
03463 fT3d_cor_correc_covss_s[i] = &fT3d2_cor_correc_covss_s[0] + i*n_samp;
03464 for(Int_t j = 0 ; j < n_samp ; j++){
03465 fT3d2_cor_correc_covss_s[n_samp*i+j] =
03466 &fT3d1_cor_correc_covss_s[0]+n_samp*(n_samp*i+j);}}
03467 }
03468
03469 for(Int_t i_SMEcha = 0; i_SMEcha <fFileHeader->fMaxCrysInSM; i_SMEcha++)
03470 {
03471 for(Int_t i_samp = 0; i_samp <fFileHeader->fMaxSampADC; i_samp++)
03472 {
03473 for(Int_t j_samp = 0; j_samp <fFileHeader->fMaxSampADC; j_samp++)
03474 {
03475 if( fT3d_cor_correc_covss_s[i_SMEcha][i_samp][j_samp] != (Double_t)0 )
03476 {fMiscDiag[21]++; fT3d_cor_correc_covss_s[i_SMEcha][i_samp][j_samp] = (Double_t)0;}
03477 }
03478 }
03479 }
03480
03481
03482
03483
03484 if ( fTagCovCss[0] != 1 ) { ComputeCovariancesBetweenSamples(); }
03485
03486
03487
03488
03489 if ( fTagCovCorrecCovCss[0] != 1 ) ComputeCorrectionFactorsToCovss();
03490
03491 if(fFlagPrint == fCodePrintAllComments){
03492 cout << "*TCnaRunEB::ComputeCorrectionFactorsToCorss>" << endl
03493 << " Calculation of the correction factors to the"
03494 << " (sample,sample) correlations for all the SMEchas" << endl;}
03495
03496
03497
03498
03499 for ( Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
03500 {
03501
03502 fTagCorCorrecCovCss[i_SMEcha] = 1; fFileHeader->fCorCorrecCovCssCalc++;
03503 }
03504 }
03505
03506
03507
03508
03509
03510
03511
03512
03513
03514
03515
03516
03517
03518
03519
03520 void TCnaRunEB::GetPathForResultsRootFiles()
03521 {
03522 GetPathForResultsRootFiles("");
03523 }
03524
03525 void TCnaRunEB::GetPathForResultsRootFiles(const TString argFileName)
03526 {
03527
03528
03529
03530
03531 Int_t MaxCar = fgMaxCar;
03532 fCfgResultsRootFilePath.Resize(MaxCar);
03533 fCfgResultsRootFilePath = "?";
03534
03535
03536
03537
03538 if ( argFileName == "" )
03539 {
03540 string cFileNameForCnaPaths = "cna_results_root.cfg";
03541 TString s_file_name = cFileNameForCnaPaths.c_str();
03542 Text_t *t_file_name = (Text_t *)s_file_name.Data();
03543
03544 TString s_path_name = gSystem->Getenv("HOME");
03545
03546 fFileForResultsRootFilePath = s_path_name;
03547 fFileForResultsRootFilePath.Append('/');
03548 fFileForResultsRootFilePath.Append(t_file_name);
03549 }
03550 else
03551 {
03552 fFileForResultsRootFilePath = argFileName.Data();
03553 }
03554
03555
03556
03557
03558 fFcin_rr.open(fFileForResultsRootFilePath.Data());
03559 if(fFcin_rr.fail() == kFALSE)
03560 {
03561 fFcin_rr.clear();
03562 string xResultsFileP;
03563 fFcin_rr >> xResultsFileP;
03564 fCfgResultsRootFilePath = xResultsFileP.c_str();
03565
03566 fCnaCommand++;
03567 cout << " *CNA [" << fCnaCommand << "]> Automatic registration of cna paths -> " << endl
03568 << " Results .root files: " << fCfgResultsRootFilePath.Data() << endl;
03569 fFcin_rr.close();
03570
03571
03572 fMakeResultsFileName(fCodeRoot);
03573 }
03574 else
03575 {
03576 fFcin_rr.clear();
03577 fCnaError++;
03578 cout << fTTBELL << endl
03579 << " ***************************************************************************** " << endl;
03580 cout << " !CNA(TCnaRunEB) (" << fCnaError << ") *** ERROR *** " << endl << endl
03581 << " "
03582 << fFileForResultsRootFilePath.Data() << ": file not found. " << endl
03583 << " "
03584 << endl << endl
03585 << " "
03586 << " The file " << fFileForResultsRootFilePath.Data()
03587 << " is a configuration file for the CNA and"
03588 << " must contain one line with the following syntax:" << endl << endl
03589 << " "
03590 << " path of the results .root files ($HOME/etc...) " << endl
03591 << " "
03592 << " (without slash at the end of line)" << endl
03593 << endl << endl
03594 << " "
03595 << " EXAMPLE:" << endl << endl
03596 << " "
03597 << " $HOME/scratch0/cna/results_root_files" << endl << endl
03598 << " ***************************************************************************** "
03599 << fTTBELL << endl;
03600
03601 fFcin_rr.close();
03602 }
03603 }
03604
03605
03606
03607 void TCnaRunEB::GetPathForResultsAsciiFiles()
03608 {
03609 GetPathForResultsAsciiFiles("");
03610 }
03611
03612 void TCnaRunEB::GetPathForResultsAsciiFiles(const TString argFileName)
03613 {
03614
03615
03616
03617
03618
03619 Int_t MaxCar = fgMaxCar;
03620 fCfgResultsAsciiFilePath.Resize(MaxCar);
03621 fCfgResultsAsciiFilePath = "?";
03622
03623
03624
03625
03626 if ( argFileName == "" )
03627 {
03628 string cFileNameForCnaPaths = "cna_results_ascii.cfg";
03629 TString s_file_name = cFileNameForCnaPaths.c_str();
03630 Text_t *t_file_name = (Text_t *)s_file_name.Data();
03631
03632 TString s_path_name = gSystem->Getenv("HOME");
03633
03634 fFileForResultsAsciiFilePath = s_path_name;
03635 fFileForResultsAsciiFilePath.Append('/');
03636 fFileForResultsAsciiFilePath.Append(t_file_name);
03637 }
03638 else
03639 {
03640 fFileForResultsAsciiFilePath = argFileName.Data();
03641 }
03642
03643
03644
03645
03646 fFcin_ra.open(fFileForResultsAsciiFilePath.Data());
03647 if(fFcin_ra.fail() == kFALSE)
03648 {
03649 fFcin_ra.clear();
03650 string xResultsFileP;
03651 fFcin_ra >> xResultsFileP;
03652 fCfgResultsAsciiFilePath = xResultsFileP.c_str();
03653
03654 fCnaCommand++;
03655 cout << " *CNA [" << fCnaCommand << "]> Automatic registration of cna paths -> " << endl
03656 << " Results .ascii files: " << fCfgResultsAsciiFilePath.Data() << endl;
03657 fFcin_ra.close();
03658
03659
03660 fMakeResultsFileName(fCodeHeaderAscii);
03661 }
03662 else
03663 {
03664 fFcin_ra.clear();
03665 fCnaError++;
03666 cout << fTTBELL << endl
03667 << " ***************************************************************************** " << endl;
03668 cout << " !CNA(TCnaRunEB) (" << fCnaError << ") *** ERROR *** " << endl << endl
03669 << " "
03670 << fFileForResultsAsciiFilePath.Data() << ": file not found. " << endl
03671 << " "
03672 << endl << endl
03673 << " "
03674 << " The file " << fFileForResultsAsciiFilePath.Data()
03675 << " is a configuration file for the CNA and"
03676 << " must contain one line with the following syntax:" << endl << endl
03677 << " "
03678 << " path of the results .ascii files ($HOME/etc...) " << endl
03679 << " "
03680 << " (without slash at the end of line)" << endl
03681 << endl << endl
03682 << " "
03683 << " EXAMPLE:" << endl << endl
03684 << " "
03685 << " $HOME/scratch0/cna/results_ascii_files" << endl << endl
03686 << " ***************************************************************************** "
03687 << fTTBELL << endl;
03688
03689 fFcin_ra.close();
03690 }
03691 }
03692
03693
03694
03695
03696
03697
03698
03699
03700
03701
03702
03703 Bool_t TCnaRunEB::OpenRootFile(Text_t *name, TString status) {
03704
03705
03706 TString s_path;
03707 s_path = fCfgResultsRootFilePath;
03708 s_path.Append('/');
03709 s_path.Append(name);
03710
03711 gCnaRootFile = new TCnaRootFile(s_path.Data(), status); fCnew++;
03712
03713 Bool_t ok_open = kFALSE;
03714
03715 if ( gCnaRootFile->fRootFileStatus == "RECREATE" )
03716 {
03717 ok_open = gCnaRootFile->OpenW();
03718 }
03719 if ( gCnaRootFile->fRootFileStatus == "READ" )
03720 {
03721 ok_open = gCnaRootFile->OpenR();
03722 }
03723
03724 if (!ok_open)
03725 {
03726 cout << "TCnaRunEB::OpenRootFile> Cannot open file " << s_path.Data() << endl;
03727
03728 }
03729 else
03730 {
03731 if(fFlagPrint == fCodePrintAllComments){
03732 cout << "*TCnaRunEB::OpenRootFile> Open ROOT file OK for file " << s_path.Data() << endl;}
03733
03734 fOpenRootFile = kTRUE;
03735 }
03736
03737 return ok_open;
03738 }
03739
03740
03741
03742
03743
03744
03745 Bool_t TCnaRunEB::CloseRootFile(Text_t *name) {
03746
03747
03748 Bool_t ok_close = kFALSE;
03749
03750 if (fOpenRootFile == kTRUE )
03751 {
03752 gCnaRootFile->CloseFile();
03753
03754 if(fFlagPrint == fCodePrintAllComments){
03755 cout << "*TCnaRunEB::CloseRootFile> Close ROOT file OK " << endl;}
03756
03757 delete gCnaRootFile; fCdelete++;
03758 fOpenRootFile = kFALSE;
03759 ok_close = kTRUE;
03760 }
03761 else
03762 {
03763 cout << "*TCnaRunEB::CloseRootFile(...)> no close since no file is open"
03764 << fTTBELL << endl;
03765 }
03766
03767 return ok_close;
03768 }
03769
03770
03771
03772
03773
03774
03775
03776
03777
03778
03779
03780
03781
03782
03783
03784
03785
03786 Bool_t TCnaRunEB::WriteRootFile() {
03787
03788
03789 Bool_t ok_write = kFALSE;
03790 fMakeResultsFileName(fCodeRoot);
03791
03792
03793
03794 Text_t *s_name = (Text_t *)fRootFileNameShort.Data();
03795
03796 if(fFlagPrint != fCodePrintNoComment){
03797 cout << "*TCnaRunEB::WriteRootFile()> Results are going to be written in the ROOT file: " << endl
03798 << " " << fRootFileName.Data() << endl;}
03799
03800 ok_write = WriteRootFile(s_name);
03801
03802 return ok_write;
03803 }
03804
03805
03806
03807
03808
03809 Bool_t TCnaRunEB::WriteRootFile(Text_t *name) {
03810
03811
03812 Text_t *file_name = name;
03813
03814 Bool_t ok_open = kFALSE;
03815 Bool_t ok_write = kFALSE;
03816
03817 if ( fOpenRootFile )
03818 {
03819 cout << "!TCnaRunEB::WriteRootFile(...) *** ERROR ***> Writing on file already open."
03820 << fTTBELL << endl;
03821 }
03822 else
03823 {
03824
03825
03826
03827
03828
03829
03830
03831
03832
03833
03834
03835
03836
03837
03838
03839
03840
03841
03842
03843
03844
03845
03846
03847
03848
03849
03850
03851
03852
03853
03854
03855
03856
03857
03858
03859
03860
03861
03862
03863
03864
03865 ok_open = OpenRootFile(file_name, "RECREATE");
03866
03867 TString typ_name = "?";
03868 Int_t v_nb_times = 0;
03869 Int_t v_dim_one = 0;
03870 Int_t v_dim_two = 0;
03871 Int_t v_size = 0;
03872 Int_t v_tot = 0;
03873 Int_t v_tot_writ = 0;
03874
03875
03876
03877
03878 Int_t MaxCar = fgMaxCar;
03879 typ_name.Resize(MaxCar);
03880 typ_name = "TowerNumbers";
03881 v_nb_times = fFileHeader->fTowerNumbersCalc;
03882 v_dim_one = 1;
03883 v_dim_two = fFileHeader->fMaxTowInSM;
03884 v_size = v_nb_times*v_dim_one*v_dim_two;
03885 v_tot += v_size;
03886
03887 if(fFlagPrint != fCodePrintNoComment){
03888 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
03889 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
03890 << setw(9) << v_size;}
03891
03892 for (Int_t i = 0; i < v_nb_times; i++)
03893 {
03894 if ( fTagTowerNumbers[0] == 1 )
03895 {
03896 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypTowerNumbers;
03897 gCnaRootFile->fCnaIndivResult->fIthElement = i;
03898 gCnaRootFile->fCnaIndivResult->
03899 SetSizeHis(1,fFileHeader->fMaxTowInSM);
03900 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
03901 TRootTowerNumbers();
03902 gCnaRootFile->fCnaResultsTree->Fill();
03903 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
03904 }
03905 }
03906 cout << endl;
03907
03908
03909
03910
03911 MaxCar = fgMaxCar;
03912 typ_name.Resize(MaxCar);
03913 typ_name = "EvEv";
03914 v_nb_times = fFileHeader->fEvEvCalc;
03915 v_dim_one = 1;
03916 v_dim_two = fFileHeader->fMaxCrysInSM;
03917 v_size = v_nb_times*v_dim_one*v_dim_two;
03918 v_tot += v_size;
03919
03920 if(fFlagPrint != fCodePrintNoComment){
03921 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
03922 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
03923 << setw(9) << v_size;}
03924
03925 for (Int_t i = 0; i < v_nb_times; i++)
03926 {
03927 if ( fTagEvEv[0] == 1 )
03928 {
03929 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypEvEv;
03930 gCnaRootFile->fCnaIndivResult->fIthElement = i;
03931 gCnaRootFile->fCnaIndivResult->
03932 SetSizeHis(1,fFileHeader->fMaxCrysInSM);
03933 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
03934 TRootEvEv();
03935 gCnaRootFile->fCnaResultsTree->Fill();
03936 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
03937 }
03938 }
03939 cout << endl;
03940
03941
03942
03943
03944 MaxCar = fgMaxCar;
03945 typ_name.Resize(MaxCar);
03946 typ_name = "EvSig";
03947 v_nb_times = fFileHeader->fEvSigCalc;
03948 v_dim_one = 1;
03949 v_dim_two = fFileHeader->fMaxCrysInSM;
03950 v_size = v_nb_times*v_dim_one*v_dim_two;
03951 v_tot += v_size;
03952
03953 if(fFlagPrint != fCodePrintNoComment){
03954 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
03955 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
03956 << setw(9) << v_size;}
03957
03958 for (Int_t i = 0; i < v_nb_times; i++)
03959 {
03960 if ( fTagEvSig[0] == 1 )
03961 {
03962 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypEvSig;
03963 gCnaRootFile->fCnaIndivResult->fIthElement = i;
03964 gCnaRootFile->fCnaIndivResult->
03965 SetSizeHis(1,fFileHeader->fMaxCrysInSM);
03966 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
03967 TRootEvSig();
03968 gCnaRootFile->fCnaResultsTree->Fill();
03969 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
03970 }
03971 }
03972 cout << endl;
03973
03974
03975
03976
03977 MaxCar = fgMaxCar;
03978 typ_name.Resize(MaxCar);
03979 typ_name = "EvCorCss";
03980 v_nb_times = fFileHeader->fEvCorCssCalc;
03981 v_dim_one = 1;
03982 v_dim_two = fFileHeader->fMaxCrysInSM;
03983 v_size = v_nb_times*v_dim_one*v_dim_two;
03984 v_tot += v_size;
03985
03986 if(fFlagPrint != fCodePrintNoComment){
03987 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
03988 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
03989 << setw(9) << v_size;}
03990
03991 for (Int_t i = 0; i < v_nb_times; i++)
03992 {
03993 if ( fTagEvCorCss[0] == 1 )
03994 {
03995 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypEvCorCss;
03996 gCnaRootFile->fCnaIndivResult->fIthElement = i;
03997 gCnaRootFile->fCnaIndivResult->
03998 SetSizeHis(1,fFileHeader->fMaxCrysInSM);
03999 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
04000 TRootEvCorCss();
04001 gCnaRootFile->fCnaResultsTree->Fill();
04002 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04003 }
04004 }
04005 cout << endl;
04006
04007
04008
04009
04010 MaxCar = fgMaxCar;
04011 typ_name.Resize(MaxCar);
04012 typ_name = "SigEv";
04013 v_nb_times = fFileHeader->fSigEvCalc;
04014 v_dim_one = 1;
04015 v_dim_two = fFileHeader->fMaxCrysInSM;
04016 v_size = v_nb_times*v_dim_one*v_dim_two;
04017 v_tot += v_size;
04018
04019 if(fFlagPrint != fCodePrintNoComment){
04020 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04021 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04022 << setw(9) << v_size;}
04023
04024 for (Int_t i = 0; i < v_nb_times; i++)
04025 {
04026 if ( fTagSigEv[0] == 1 )
04027 {
04028 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypSigEv;
04029 gCnaRootFile->fCnaIndivResult->fIthElement = i;
04030 gCnaRootFile->fCnaIndivResult->
04031 SetSizeHis(1,fFileHeader->fMaxCrysInSM);
04032 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
04033 TRootSigEv();
04034 gCnaRootFile->fCnaResultsTree->Fill();
04035 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04036 }
04037 }
04038 cout << endl;
04039
04040
04041
04042
04043 MaxCar = fgMaxCar;
04044 typ_name.Resize(MaxCar);
04045 typ_name = "SigSig";
04046 v_nb_times = fFileHeader->fSigSigCalc;
04047 v_dim_one = 1;
04048 v_dim_two = fFileHeader->fMaxCrysInSM;
04049 v_size = v_nb_times*v_dim_one*v_dim_two;
04050 v_tot += v_size;
04051
04052 if(fFlagPrint != fCodePrintNoComment){
04053 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04054 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04055 << setw(9) << v_size;}
04056
04057 for (Int_t i = 0; i < v_nb_times; i++)
04058 {
04059 if ( fTagSigSig[0] == 1 )
04060 {
04061 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypSigSig;
04062 gCnaRootFile->fCnaIndivResult->fIthElement = i;
04063 gCnaRootFile->fCnaIndivResult->
04064 SetSizeHis(1,fFileHeader->fMaxCrysInSM);
04065 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
04066 TRootSigSig();
04067 gCnaRootFile->fCnaResultsTree->Fill();
04068 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04069 }
04070 }
04071 cout << endl;
04072
04073
04074
04075
04076 MaxCar = fgMaxCar;
04077 typ_name.Resize(MaxCar);
04078 typ_name = "SigCorCss";
04079 v_nb_times = fFileHeader->fSigCorCssCalc;
04080 v_dim_one = 1;
04081 v_dim_two = fFileHeader->fMaxCrysInSM;
04082 v_size = v_nb_times*v_dim_one*v_dim_two;
04083 v_tot += v_size;
04084
04085 if(fFlagPrint != fCodePrintNoComment){
04086 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04087 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04088 << setw(9) << v_size;}
04089
04090 for (Int_t i = 0; i < v_nb_times; i++)
04091 {
04092 if ( fTagSigCorCss[0] == 1 )
04093 {
04094 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypSigCorCss;
04095 gCnaRootFile->fCnaIndivResult->fIthElement = i;
04096 gCnaRootFile->fCnaIndivResult->
04097 SetSizeHis(1,fFileHeader->fMaxCrysInSM);
04098 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
04099 TRootSigCorCss();
04100 gCnaRootFile->fCnaResultsTree->Fill();
04101 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04102 }
04103 }
04104 cout << endl;
04105
04106
04107
04108
04109 MaxCar = fgMaxCar;
04110 typ_name.Resize(MaxCar);
04111 typ_name = "CovMosccMot";
04112 v_nb_times = fFileHeader->fCovMosccMotCalc;
04113 v_dim_one = fFileHeader->fMaxTowInSM;
04114 v_dim_two = fFileHeader->fMaxTowInSM;
04115 v_size = v_nb_times*v_dim_one*v_dim_two;
04116 v_tot += v_size;
04117
04118 if(fFlagPrint != fCodePrintNoComment){
04119 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04120 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04121 << setw(9) << v_size;}
04122
04123 for (Int_t i = 0; i < v_nb_times; i++)
04124 {
04125 if ( fTagCovMosccMot[0] == 1 )
04126 {
04127 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypCovMosccMot;
04128 gCnaRootFile->fCnaIndivResult->fIthElement = i;
04129 gCnaRootFile->fCnaIndivResult->
04130 SetSizeMat(fFileHeader->fMaxTowInSM,fFileHeader->fMaxTowInSM);
04131 gCnaRootFile->fCnaIndivResult->fMatHis.ReSet(1,1);
04132 TRootCovMosccMot();
04133 gCnaRootFile->fCnaResultsTree->Fill();
04134 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04135 }
04136 }
04137 cout << endl;
04138
04139
04140
04141
04142 MaxCar = fgMaxCar;
04143 typ_name.Resize(MaxCar);
04144 typ_name = "CorMosccMot";
04145 v_nb_times = fFileHeader->fCorMosccMotCalc;
04146 v_dim_one = fFileHeader->fMaxTowInSM;
04147 v_dim_two = fFileHeader->fMaxTowInSM;
04148 v_size = v_nb_times*v_dim_one*v_dim_two;
04149 v_tot += v_size;
04150
04151 if(fFlagPrint != fCodePrintNoComment){
04152 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04153 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04154 << setw(9) << v_size;}
04155
04156 for (Int_t i = 0; i < v_nb_times; i++)
04157 {
04158 if ( fTagCorMosccMot[0] == 1 )
04159 {
04160 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypCorMosccMot;
04161 gCnaRootFile->fCnaIndivResult->fIthElement = i;
04162 gCnaRootFile->fCnaIndivResult->
04163 SetSizeMat(fFileHeader->fMaxTowInSM,fFileHeader->fMaxTowInSM);
04164 gCnaRootFile->fCnaIndivResult->fMatHis.ReSet(1,1);
04165 TRootCorMosccMot();
04166 gCnaRootFile->fCnaResultsTree->Fill();
04167 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04168 }
04169 }
04170 cout << endl;
04171
04172
04173
04174
04175 MaxCar = fgMaxCar;
04176 typ_name.Resize(MaxCar);
04177 typ_name = "LastEvtNumber";
04178 v_nb_times = fFileHeader->fLastEvtNumberCalc;
04179 v_dim_one = fFileHeader->fMaxCrysInSM;
04180 v_dim_two = fFileHeader->fMaxSampADC;
04181 v_size = v_nb_times*v_dim_one*v_dim_two;
04182 v_tot += v_size;
04183
04184 if(fFlagPrint != fCodePrintNoComment){
04185 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04186 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04187 << setw(9) << v_size;}
04188
04189 for (Int_t i = 0; i < v_nb_times; i++)
04190 {
04191 if ( fTagLastEvtNumber[0] == 1 )
04192 {
04193 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypLastEvtNumber;
04194 gCnaRootFile->fCnaIndivResult->fIthElement = i;
04195 gCnaRootFile->fCnaIndivResult->
04196 SetSizeHis(fFileHeader->fMaxCrysInSM,fFileHeader->fMaxSampADC);
04197 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
04198 TRootLastEvtNumber();
04199 gCnaRootFile->fCnaResultsTree->Fill();
04200 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04201 }
04202 }
04203 cout << endl;
04204
04205
04206
04207
04208 MaxCar = fgMaxCar;
04209 typ_name.Resize(MaxCar);
04210 typ_name = "Ev";
04211 v_nb_times = fFileHeader->fEvCalc;
04212 v_dim_one = fFileHeader->fMaxCrysInSM;
04213 v_dim_two = fFileHeader->fMaxSampADC;
04214 v_size = v_nb_times*v_dim_one*v_dim_two;
04215 v_tot += v_size;
04216
04217 if(fFlagPrint != fCodePrintNoComment){
04218 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04219 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04220 << setw(9) << v_size;}
04221
04222 for (Int_t i = 0; i < v_nb_times; i++)
04223 {
04224 if ( fTagEv[0] == 1 )
04225 {
04226 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypEv;
04227 gCnaRootFile->fCnaIndivResult->fIthElement = i;
04228 gCnaRootFile->fCnaIndivResult->
04229 SetSizeHis(fFileHeader->fMaxCrysInSM,fFileHeader->fMaxSampADC);
04230 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
04231 TRootEv();
04232 gCnaRootFile->fCnaResultsTree->Fill();
04233 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04234 }
04235 }
04236 cout << endl;
04237
04238
04239
04240
04241 MaxCar = fgMaxCar;
04242 typ_name.Resize(MaxCar);
04243 typ_name = "Var";
04244 v_nb_times = fFileHeader->fVarCalc;
04245 v_dim_one = fFileHeader->fMaxCrysInSM;
04246 v_dim_two = fFileHeader->fMaxSampADC;
04247 v_size = v_nb_times*v_dim_one*v_dim_two;
04248 v_tot += v_size;
04249
04250 if(fFlagPrint != fCodePrintNoComment){
04251 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04252 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04253 << setw(9) << v_size;}
04254
04255 for (Int_t i = 0; i < v_nb_times; i++)
04256 {
04257 if ( fTagVar[0] == 1 )
04258 {
04259 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypVar;
04260 gCnaRootFile->fCnaIndivResult->fIthElement = i;
04261 gCnaRootFile->fCnaIndivResult->
04262 SetSizeHis(fFileHeader->fMaxCrysInSM,fFileHeader->fMaxSampADC);
04263 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
04264 TRootVar();
04265 gCnaRootFile->fCnaResultsTree->Fill();
04266 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04267 }
04268 }
04269 cout << endl;
04270
04271
04272
04273
04274 MaxCar = fgMaxCar;
04275 typ_name.Resize(MaxCar);
04276 typ_name = "SvCorrecCovCss";
04277 v_nb_times = fFileHeader->fSvCorrecCovCssCalc;
04278 v_dim_one = fFileHeader->fMaxCrysInSM;
04279 v_dim_two = fFileHeader->fMaxSampADC;
04280 v_size = v_nb_times*v_dim_one*v_dim_two;
04281 v_tot += v_size;
04282
04283 if(fFlagPrint != fCodePrintNoComment){
04284 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04285 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04286 << setw(9) << v_size;}
04287
04288 for (Int_t i = 0; i < v_nb_times; i++)
04289 {
04290 if ( fTagSvCorrecCovCss[0] == 1 )
04291 {
04292 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypSvCorrecCovCss;
04293 gCnaRootFile->fCnaIndivResult->fIthElement = i;
04294 gCnaRootFile->fCnaIndivResult->
04295 SetSizeHis(fFileHeader->fMaxCrysInSM,fFileHeader->fMaxSampADC);
04296 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
04297 TRootSvCorrecCovCss();
04298 gCnaRootFile->fCnaResultsTree->Fill();
04299 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04300 }
04301 }
04302 cout << endl;
04303
04304
04305
04306
04307
04308 MaxCar = fgMaxCar;
04309 typ_name.Resize(MaxCar);
04310 typ_name = "CovCss";
04311 v_nb_times = fFileHeader->fCovCssCalc;
04312 v_dim_one = fFileHeader->fMaxSampADC;
04313 v_dim_two = fFileHeader->fMaxSampADC;
04314 v_size = v_nb_times*v_dim_one*v_dim_two;
04315 v_tot += v_size;
04316
04317 if(fFlagPrint != fCodePrintNoComment){
04318 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04319 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04320 << setw(9) << v_size;}
04321
04322 for (Int_t i_SMEcha = 0; i_SMEcha < v_nb_times; i_SMEcha++)
04323 {
04324 if ( fTagCovCss[i_SMEcha] == 1 )
04325 {
04326 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypCovCss;
04327 gCnaRootFile->fCnaIndivResult->fIthElement = i_SMEcha;
04328 gCnaRootFile->fCnaIndivResult->
04329 SetSizeMat(fFileHeader->fMaxSampADC,fFileHeader->fMaxSampADC);
04330 gCnaRootFile->fCnaIndivResult->fMatHis.ReSet(1,1);
04331 TRootCovCss(i_SMEcha);
04332 gCnaRootFile->fCnaResultsTree->Fill();
04333 if( i_SMEcha == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04334 }
04335 }
04336 cout << endl;
04337
04338
04339
04340
04341 MaxCar = fgMaxCar;
04342 typ_name.Resize(MaxCar);
04343 typ_name = "CorCss";
04344 v_nb_times = fFileHeader->fCorCssCalc;
04345 v_dim_one = fFileHeader->fMaxSampADC;
04346 v_dim_two = fFileHeader->fMaxSampADC;
04347 v_size = v_nb_times*v_dim_one*v_dim_two;
04348 v_tot += v_size;
04349
04350 if(fFlagPrint != fCodePrintNoComment){
04351 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04352 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04353 << setw(9) << v_size;}
04354
04355 for (Int_t i_SMEcha = 0; i_SMEcha < v_nb_times; i_SMEcha++)
04356 {
04357 if ( fTagCorCss[i_SMEcha] == 1 )
04358 {
04359 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypCorCss;
04360 gCnaRootFile->fCnaIndivResult->fIthElement = i_SMEcha;
04361 gCnaRootFile->fCnaIndivResult->
04362 SetSizeMat(fFileHeader->fMaxSampADC,fFileHeader->fMaxSampADC);
04363 gCnaRootFile->fCnaIndivResult->fMatHis.ReSet(1,1);
04364 TRootCorCss(i_SMEcha);
04365 gCnaRootFile->fCnaResultsTree->Fill();
04366 if( i_SMEcha == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04367 }
04368 }
04369 cout << endl;
04370
04371
04372
04373
04374 MaxCar = fgMaxCar;
04375 typ_name.Resize(MaxCar);
04376 typ_name = "Evts";
04377 v_nb_times = fFileHeader->fEvtsCalc;
04378 v_dim_one = fFileHeader->fMaxSampADC;
04379 v_dim_two = fFileHeader->fNbBinsADC;
04380 v_size = v_nb_times*v_dim_one*v_dim_two;
04381 v_tot += v_size;
04382
04383 if(fFlagPrint != fCodePrintNoComment){
04384 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04385 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04386 << setw(9) << v_size;}
04387
04388 for (Int_t i_SMEcha = 0; i_SMEcha < v_nb_times; i_SMEcha++)
04389 {
04390 if ( fTagEvts[i_SMEcha] == 1 )
04391 {
04392 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypEvts;
04393 gCnaRootFile->fCnaIndivResult->fIthElement = i_SMEcha;
04394 gCnaRootFile->fCnaIndivResult->
04395 SetSizeHis(fFileHeader->fMaxSampADC,fFileHeader->fNbBinsADC);
04396 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
04397 TRootEvts(i_SMEcha);
04398 gCnaRootFile->fCnaResultsTree->Fill();
04399 if( i_SMEcha == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04400 }
04401 }
04402 cout << endl;
04403
04404
04405
04406
04407 MaxCar = fgMaxCar;
04408 typ_name.Resize(MaxCar);
04409 typ_name = "EvtsXmin";
04410 v_nb_times = fFileHeader->fEvtsCalc;
04411 v_dim_one = 1;
04412 v_dim_two = fFileHeader->fMaxSampADC;
04413 v_size = v_nb_times*v_dim_one*v_dim_two;
04414 v_tot += v_size;
04415
04416 if(fFlagPrint != fCodePrintNoComment){
04417 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04418 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04419 << setw(9) << v_size;}
04420
04421 for (Int_t i_SMEcha = 0; i_SMEcha < v_nb_times; i_SMEcha++)
04422 {
04423 if ( fTagEvts[i_SMEcha] == 1 )
04424 {
04425 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypEvtsXmin;
04426 gCnaRootFile->fCnaIndivResult->fIthElement = i_SMEcha;
04427 gCnaRootFile->fCnaIndivResult->
04428 SetSizeHis(1,fFileHeader->fMaxSampADC);
04429 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
04430 TRootEvtsXmin(i_SMEcha);
04431 gCnaRootFile->fCnaResultsTree->Fill();
04432 if( i_SMEcha == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04433 }
04434 }
04435 cout << endl;
04436
04437
04438
04439
04440 MaxCar = fgMaxCar;
04441 typ_name.Resize(MaxCar);
04442 typ_name = "EvtsXmax";
04443 v_nb_times = fFileHeader->fEvtsCalc;
04444 v_dim_one = 1;
04445 v_dim_two = fFileHeader->fMaxSampADC;
04446 v_size = v_nb_times*v_dim_one*v_dim_two;
04447 v_tot += v_size;
04448
04449 if(fFlagPrint != fCodePrintNoComment){
04450 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04451 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04452 << setw(9) << v_size;}
04453
04454 for (Int_t i_SMEcha = 0; i_SMEcha < v_nb_times; i_SMEcha++)
04455 {
04456 if ( fTagEvts[i_SMEcha] == 1 )
04457 {
04458 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypEvtsXmax;
04459 gCnaRootFile->fCnaIndivResult->fIthElement = i_SMEcha;
04460 gCnaRootFile->fCnaIndivResult->
04461 SetSizeHis(1,fFileHeader->fMaxSampADC);
04462 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
04463 TRootEvtsXmax(i_SMEcha);
04464 gCnaRootFile->fCnaResultsTree->Fill();
04465 if( i_SMEcha == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04466 }
04467 }
04468 cout << endl;
04469
04470
04471
04472
04473 MaxCar = fgMaxCar;
04474 typ_name.Resize(MaxCar);
04475 typ_name = "SampTime";
04476 v_nb_times = fFileHeader->fSampTimeCalc;
04477 v_dim_one = fFileHeader->fMaxSampADC;
04478 v_dim_two = fFileHeader->fNbOfTakenEvts;
04479 v_size = v_nb_times*v_dim_one*v_dim_two;
04480 v_tot += v_size;
04481
04482 if(fFlagPrint != fCodePrintNoComment){
04483 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04484 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04485 << setw(9) << v_size;}
04486
04487 for (Int_t i_SMEcha = 0; i_SMEcha < v_nb_times; i_SMEcha++)
04488 {
04489 if ( fTagSampTime[i_SMEcha] == 1 )
04490 {
04491 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypSampTime;
04492 gCnaRootFile->fCnaIndivResult->fIthElement = i_SMEcha;
04493 gCnaRootFile->fCnaIndivResult->
04494 SetSizeHis(fFileHeader->fMaxSampADC,fFileHeader->fNbOfTakenEvts);
04495 gCnaRootFile->fCnaIndivResult->fMatMat.ReSet(1,1);
04496 TRootSampTime(i_SMEcha);
04497 gCnaRootFile->fCnaResultsTree->Fill();
04498 if( i_SMEcha == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04499 }
04500 }
04501 cout << endl;
04502
04503
04504
04505
04506 MaxCar = fgMaxCar;
04507 typ_name.Resize(MaxCar);
04508 typ_name = "CovSccMos";
04509 v_nb_times = fFileHeader->fCovSccMosCalc;
04510 v_dim_one = fFileHeader->fMaxCrysInSM;
04511 v_dim_two = fFileHeader->fMaxCrysInSM;
04512 v_size = v_nb_times*v_dim_one*v_dim_two;
04513 v_tot += v_size;
04514
04515 if(fFlagPrint != fCodePrintNoComment){
04516 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04517 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04518 << setw(9) << v_size;}
04519
04520 for (Int_t i = 0; i < v_nb_times; i++)
04521 {
04522 if ( fTagCovSccMos[0] == 1 )
04523 {
04524 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypCovSccMos;
04525 gCnaRootFile->fCnaIndivResult->fIthElement = i;
04526 gCnaRootFile->fCnaIndivResult->
04527 SetSizeMat(fFileHeader->fMaxCrysInSM,fFileHeader->fMaxCrysInSM);
04528 gCnaRootFile->fCnaIndivResult->fMatHis.ReSet(1,1);
04529 TRootCovSccMos();
04530 gCnaRootFile->fCnaResultsTree->Fill();
04531 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04532 }
04533 }
04534 cout << endl;
04535
04536
04537
04538
04539 MaxCar = fgMaxCar;
04540 typ_name.Resize(MaxCar);
04541 typ_name = "CorSccMos";
04542 v_nb_times = fFileHeader->fCorSccMosCalc;
04543 v_dim_one = fFileHeader->fMaxCrysInSM;
04544 v_dim_two = fFileHeader->fMaxCrysInSM;
04545 v_size = v_nb_times*v_dim_one*v_dim_two;
04546 v_tot += v_size;
04547
04548 if(fFlagPrint != fCodePrintNoComment){
04549 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04550 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04551 << setw(9) << v_size;}
04552
04553 for (Int_t i = 0; i < v_nb_times; i++)
04554 {
04555 if ( fTagCorSccMos[0] == 1 )
04556 {
04557 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypCorSccMos;
04558 gCnaRootFile->fCnaIndivResult->fIthElement = i;
04559 gCnaRootFile->fCnaIndivResult->
04560 SetSizeMat(fFileHeader->fMaxCrysInSM,fFileHeader->fMaxCrysInSM);
04561 gCnaRootFile->fCnaIndivResult->fMatHis.ReSet(1,1);
04562 TRootCorSccMos();
04563 gCnaRootFile->fCnaResultsTree->Fill();
04564 if( i == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04565 }
04566 }
04567 cout << endl;
04568
04569
04570
04571
04572 MaxCar = fgMaxCar;
04573 typ_name.Resize(MaxCar);
04574 typ_name = "CovCorrecCovCss";
04575 v_nb_times = fFileHeader->fCovCorrecCovCssCalc;
04576 v_dim_one = fFileHeader->fMaxSampADC;
04577 v_dim_two = fFileHeader->fMaxSampADC;
04578 v_size = v_nb_times*v_dim_one*v_dim_two;
04579 v_tot += v_size;
04580
04581 if(fFlagPrint != fCodePrintNoComment){
04582 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04583 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04584 << setw(9) << v_size;}
04585
04586 for (Int_t i_SMEcha = 0; i_SMEcha < v_nb_times; i_SMEcha++)
04587 {
04588 if ( fTagCovCorrecCovCss[i_SMEcha] == 1 )
04589 {
04590 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypCovCorrecCovCss;
04591 gCnaRootFile->fCnaIndivResult->fIthElement = i_SMEcha;
04592 gCnaRootFile->fCnaIndivResult->
04593 SetSizeMat(fFileHeader->fMaxSampADC,fFileHeader->fMaxSampADC);
04594 gCnaRootFile->fCnaIndivResult->fMatHis.ReSet(1,1);
04595 TRootCovCorrecCovCss(i_SMEcha);
04596 gCnaRootFile->fCnaResultsTree->Fill();
04597 if( i_SMEcha == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04598 }
04599 }
04600 cout << endl;
04601
04602
04603
04604
04605 MaxCar = fgMaxCar;
04606 typ_name.Resize(MaxCar);
04607 typ_name = "CorCorrecCovCss";
04608 v_nb_times = fFileHeader->fCorCorrecCovCssCalc;
04609 v_dim_one = fFileHeader->fMaxSampADC;
04610 v_dim_two = fFileHeader->fMaxSampADC;
04611 v_size = v_nb_times*v_dim_one*v_dim_two;
04612 v_tot += v_size;
04613
04614 if(fFlagPrint != fCodePrintNoComment){
04615 cout << "*TCnaRunEB::WriteRootFile()> " << setw(18) << typ_name << ": " << setw(4) << v_nb_times
04616 << " * (" << setw(4) << v_dim_one << "," << setw(4) << v_dim_two << ") = "
04617 << setw(9) << v_size;}
04618
04619 for (Int_t i_SMEcha = 0; i_SMEcha < v_nb_times; i_SMEcha++)
04620 {
04621 if ( fTagCorCorrecCovCss[i_SMEcha] == 1 )
04622 {
04623 gCnaRootFile->fCnaIndivResult->fTypOfCnaResult = cTypCorCorrecCovCss;
04624 gCnaRootFile->fCnaIndivResult->fIthElement = i_SMEcha;
04625 gCnaRootFile->fCnaIndivResult->
04626 SetSizeMat(fFileHeader->fMaxSampADC,fFileHeader->fMaxSampADC);
04627 gCnaRootFile->fCnaIndivResult->fMatHis.ReSet(1,1);
04628 TRootCorCorrecCovCss(i_SMEcha);
04629 gCnaRootFile->fCnaResultsTree->Fill();
04630 if( i_SMEcha == 0 ){cout << " => WRITTEN ON FILE "; v_tot_writ += v_size;}
04631 }
04632 }
04633 cout << endl;
04634
04635
04636
04637 gCnaRootFile->fRootFile->Write();
04638
04639 fFileHeader->Write();
04640
04641
04642 if(fFlagPrint != fCodePrintNoComment){
04643 cout << "*TCnaRunEB::WriteRootFile()> " << setw(20) << "TOTAL: "
04644 << setw(21) << "CALCULATED = " << setw(9) << v_tot
04645 << " => WRITTEN ON FILE = " << setw(9) << v_tot_writ << endl;}
04646
04647 if(fFlagPrint != fCodePrintNoComment){
04648 cout << "*TCnaRunEB::WriteRootFile()> Write OK in file " << file_name << " in directory:" << endl
04649 << " " << fCfgResultsRootFilePath
04650 << endl;}
04651
04652 ok_write = kTRUE;
04653
04654
04655 CloseRootFile(file_name);
04656 }
04657 return ok_write;
04658 }
04659
04660
04661
04662
04663
04664
04665
04666
04667
04668 void TCnaRunEB::TRootTowerNumbers()
04669 {
04670 if (fTagTowerNumbers[0] == 1 )
04671 {
04672 for (Int_t j_tow = 0; j_tow < fFileHeader->fMaxTowInSM; j_tow++)
04673 {
04674 gCnaRootFile->fCnaIndivResult->fMatHis(0, j_tow) =
04675 fT1d_SMtowFromIndex[j_tow];
04676 }
04677 }
04678 }
04679
04680
04681
04682
04683
04684
04685
04686 void TCnaRunEB::TRootLastEvtNumber()
04687 {
04688 if (fTagLastEvtNumber[0] == 1 )
04689 {
04690 for (Int_t j_SMEcha = 0; j_SMEcha < fFileHeader->fMaxCrysInSM; j_SMEcha++)
04691 {
04692 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
04693 {
04694 gCnaRootFile->fCnaIndivResult->fMatHis( j_SMEcha, i_samp) =
04695 fT2d_LastEvtNumber[j_SMEcha][i_samp] + 1;
04696 }
04697 }
04698 }
04699 }
04700
04701
04702
04703
04704
04705
04706
04707 void TCnaRunEB::TRootSampTime(const Int_t& user_SMEcha)
04708 {
04709 if (fTagSampTime[user_SMEcha] == 1 )
04710 {
04711 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
04712 {
04713
04714 for (Int_t j_bin = 0; j_bin < fFileHeader->fNbOfTakenEvts; j_bin++)
04715 {
04716 gCnaRootFile->fCnaIndivResult->fMatHis(i_samp, j_bin) = (Double_t)0.;
04717 }
04718
04719 for (Int_t j_bin = 0; j_bin < fFileHeader->fNbOfTakenEvts; j_bin++)
04720 {
04721 gCnaRootFile->fCnaIndivResult->fMatHis(i_samp, j_bin) =
04722 fT3d_distribs[user_SMEcha][i_samp][j_bin];
04723 }
04724 }
04725 }
04726 }
04727
04728
04729
04730
04731
04732
04733
04734 void TCnaRunEB::TRootEv()
04735 {
04736 if (fTagEv[0] == 1 )
04737 {
04738 for (Int_t j_SMEcha = 0; j_SMEcha < fFileHeader->fMaxCrysInSM; j_SMEcha++)
04739 {
04740 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
04741 {
04742 gCnaRootFile->fCnaIndivResult->fMatHis( j_SMEcha, i_samp) =
04743 fT2d_ev[j_SMEcha][i_samp];
04744 }
04745 }
04746 }
04747 }
04748
04749
04750
04751
04752
04753
04754
04755 void TCnaRunEB::TRootVar()
04756 {
04757 if (fTagVar[0] == 1 )
04758 {
04759 for (Int_t j_SMEcha = 0; j_SMEcha < fFileHeader->fMaxCrysInSM; j_SMEcha++)
04760 {
04761 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
04762 {
04763 gCnaRootFile->fCnaIndivResult->fMatHis( j_SMEcha, i_samp) =
04764 fT2d_var[j_SMEcha][i_samp];
04765 }
04766 }
04767 }
04768 }
04769
04770
04771
04772
04773
04774
04775
04776
04777 void TCnaRunEB::TRootCovMosccMot()
04778 {
04779 if (fTagCovMosccMot[0] == 1 )
04780 {
04781 for (Int_t i_tow = 0; i_tow < fFileHeader->fMaxTowInSM; i_tow++)
04782 {
04783 for (Int_t j_tow = 0; j_tow < fFileHeader->fMaxTowInSM; j_tow++)
04784 {
04785 gCnaRootFile->fCnaIndivResult->fMatMat(i_tow, j_tow) =
04786 fT2d_cov_moscc_mot[i_tow][j_tow];
04787 }
04788 }
04789 }
04790 }
04791
04792
04793
04794
04795
04796
04797
04798
04799 void TCnaRunEB::TRootCorMosccMot()
04800 {
04801 if (fTagCorMosccMot[0] == 1 )
04802 {
04803 for (Int_t i_tow = 0; i_tow < fFileHeader->fMaxTowInSM; i_tow++)
04804 {
04805 for (Int_t j_tow = 0; j_tow < fFileHeader->fMaxTowInSM; j_tow++)
04806 {
04807 gCnaRootFile->fCnaIndivResult->fMatMat(i_tow, j_tow) =
04808 fT2d_cor_moscc_mot[i_tow][j_tow];
04809 }
04810 }
04811 }
04812 }
04813
04814
04815
04816
04817
04818
04819
04820 void TCnaRunEB::TRootEvts(const Int_t& user_SMEcha)
04821 {
04822 if (fTagEvts[user_SMEcha] == 1 )
04823 {
04824 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
04825 {
04826 for (Int_t j_bin = 0; j_bin < fFileHeader->fNbBinsADC; j_bin++)
04827 {
04828 gCnaRootFile->fCnaIndivResult->fMatHis(i_samp, j_bin) =
04829 fT3d_his_s[user_SMEcha][i_samp][j_bin];
04830 }
04831 }
04832 }
04833 }
04834
04835
04836
04837
04838
04839
04840
04841 void TCnaRunEB::TRootEvtsXmin(const Int_t& user_SMEcha)
04842 {
04843 if (fTagEvts[user_SMEcha] == 1 )
04844 {
04845 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
04846 {
04847 gCnaRootFile->fCnaIndivResult->fMatHis(0, i_samp) =
04848 fT2d_xmin[user_SMEcha][i_samp];
04849 }
04850 }
04851 }
04852
04853
04854
04855
04856
04857
04858
04859 void TCnaRunEB::TRootEvtsXmax(const Int_t& user_SMEcha)
04860 {
04861 if (fTagEvts[user_SMEcha] == 1 )
04862 {
04863 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
04864 {
04865 gCnaRootFile->fCnaIndivResult->fMatHis(0, i_samp) =
04866 fT2d_xmax[user_SMEcha][i_samp];
04867 }
04868 }
04869 }
04870
04871
04872
04873
04874
04875
04876
04877 void TCnaRunEB::TRootCovSccMos()
04878 {
04879 if (fTagCovSccMos[0] == 1 )
04880 {
04881 for (Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
04882 {
04883 for (Int_t j_SMEcha = 0; j_SMEcha < fFileHeader->fMaxCrysInSM; j_SMEcha++)
04884 {
04885 gCnaRootFile->fCnaIndivResult->fMatMat(i_SMEcha, j_SMEcha) =
04886 fT2d_cov_cc_mos[i_SMEcha][j_SMEcha];
04887 }
04888 }
04889 }
04890 }
04891
04892
04893
04894
04895
04896
04897
04898 void TCnaRunEB::TRootCorSccMos()
04899 {
04900 if (fTagCorSccMos[0] == 1 )
04901 {
04902 for (Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
04903 {
04904 for (Int_t j_SMEcha = 0; j_SMEcha < fFileHeader->fMaxCrysInSM; j_SMEcha++)
04905 {
04906 gCnaRootFile->fCnaIndivResult->fMatMat(i_SMEcha, j_SMEcha) =
04907 fT2d_cor_cc_mos[i_SMEcha][j_SMEcha];
04908 }
04909 }
04910 }
04911 }
04912
04913
04914
04915
04916
04917
04918
04919 void TCnaRunEB::TRootCovCss(const Int_t& user_SMEcha)
04920 {
04921 if (fTagCovCss[user_SMEcha] == 1 )
04922 {
04923 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
04924 {
04925 for (Int_t j_samp = 0; j_samp < fFileHeader->fMaxSampADC; j_samp++)
04926 {
04927 gCnaRootFile->fCnaIndivResult->fMatMat(i_samp, j_samp) =
04928 fT3d_cov_ss[user_SMEcha][i_samp][j_samp];
04929 }
04930 }
04931 }
04932 }
04933
04934
04935
04936
04937
04938
04939
04940 void TCnaRunEB::TRootCorCss(const Int_t& user_SMEcha)
04941 {
04942 if (fTagCorCss[user_SMEcha] == 1 )
04943 {
04944 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
04945 {
04946 for (Int_t j_samp = 0; j_samp < fFileHeader->fMaxSampADC; j_samp++)
04947 {
04948 gCnaRootFile->fCnaIndivResult->fMatMat(i_samp, j_samp) =
04949 fT3d_cor_ss[user_SMEcha][i_samp][j_samp];
04950 }
04951 }
04952 }
04953 }
04954
04955
04956
04957
04958
04959
04960
04961
04962 void TCnaRunEB::TRootEvEv()
04963 {
04964 if (fTagEvEv[0] == 1 )
04965 {
04966 for (Int_t j_SMEcha = 0; j_SMEcha < fFileHeader->fMaxCrysInSM; j_SMEcha++)
04967 {
04968 gCnaRootFile->fCnaIndivResult->fMatHis(0, j_SMEcha) =
04969 fT1d_ev_ev[j_SMEcha];
04970 }
04971 }
04972 }
04973
04974
04975
04976
04977
04978
04979
04980 void TCnaRunEB::TRootEvSig()
04981 {
04982 if (fTagEvSig[0] == 1 )
04983 {
04984 for (Int_t j_SMEcha = 0; j_SMEcha < fFileHeader->fMaxCrysInSM; j_SMEcha++)
04985 {
04986 gCnaRootFile->fCnaIndivResult->fMatHis(0, j_SMEcha) =
04987 fT1d_ev_sig[j_SMEcha];
04988 }
04989 }
04990 }
04991
04992
04993
04994
04995
04996
04997
04998
04999 void TCnaRunEB::TRootEvCorCss()
05000 {
05001 if (fTagEvCorCss[0] == 1 )
05002 {
05003 for (Int_t j_SMEcha = 0; j_SMEcha < fFileHeader->fMaxCrysInSM; j_SMEcha++)
05004 {
05005 gCnaRootFile->fCnaIndivResult->fMatHis(0, j_SMEcha) =
05006 fT1d_ev_cor_ss[j_SMEcha];
05007 }
05008 }
05009 }
05010
05011
05012
05013
05014
05015
05016
05017
05018 void TCnaRunEB::TRootSigEv()
05019 {
05020 if (fTagSigEv[0] == 1 )
05021 {
05022 for (Int_t j_SMEcha = 0; j_SMEcha < fFileHeader->fMaxCrysInSM; j_SMEcha++)
05023 {
05024 gCnaRootFile->fCnaIndivResult->fMatHis(0, j_SMEcha) =
05025 fT1d_sig_ev[j_SMEcha];
05026 }
05027 }
05028 }
05029
05030
05031
05032
05033
05034
05035
05036
05037 void TCnaRunEB::TRootSigSig()
05038 {
05039 if (fTagSigSig[0] == 1 )
05040 {
05041 for (Int_t j_SMEcha = 0; j_SMEcha < fFileHeader->fMaxCrysInSM; j_SMEcha++)
05042 {
05043 gCnaRootFile->fCnaIndivResult->fMatHis(0, j_SMEcha) =
05044 fT1d_sig_sig[j_SMEcha];
05045 }
05046 }
05047 }
05048
05049
05050
05051
05052
05053
05054
05055
05056 void TCnaRunEB::TRootSigCorCss()
05057 {
05058 if (fTagSigCorCss[0] == 1 )
05059 {
05060 for (Int_t j_SMEcha = 0; j_SMEcha < fFileHeader->fMaxCrysInSM; j_SMEcha++)
05061 {
05062 gCnaRootFile->fCnaIndivResult->fMatHis(0, j_SMEcha) =
05063 fT1d_sig_cor_ss[j_SMEcha];
05064 }
05065 }
05066 }
05067
05068
05069
05070
05071
05072
05073
05074
05075 void TCnaRunEB::TRootSvCorrecCovCss()
05076 {
05077 if (fTagSvCorrecCovCss[0] == 1 )
05078 {
05079 for (Int_t j_SMEcha = 0; j_SMEcha < fFileHeader->fMaxCrysInSM; j_SMEcha++)
05080 {
05081 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
05082 {
05083 gCnaRootFile->fCnaIndivResult->fMatHis(j_SMEcha, i_samp) =
05084 fT2d_sv_correc_covss_s[j_SMEcha][i_samp];
05085 }
05086 }
05087 }
05088 }
05089
05090
05091
05092
05093
05094
05095
05096
05097 void TCnaRunEB::TRootCovCorrecCovCss(const Int_t& user_SMEcha)
05098 {
05099 if (fTagCovCorrecCovCss[0] == 1 )
05100 {
05101 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
05102 {
05103 for (Int_t j_samp = 0; j_samp < fFileHeader->fMaxSampADC; j_samp++)
05104 {
05105 gCnaRootFile->fCnaIndivResult->fMatMat(i_samp, j_samp) =
05106 fT3d_cov_correc_covss_s[user_SMEcha][i_samp][j_samp];
05107 }
05108 }
05109 }
05110 }
05111
05112
05113
05114
05115
05116
05117
05118
05119 void TCnaRunEB::TRootCorCorrecCovCss(const Int_t& user_SMEcha)
05120 {
05121 if (fTagCorCorrecCovCss[0] == 1 )
05122 {
05123 for (Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
05124 {
05125 for (Int_t j_samp = 0; j_samp < fFileHeader->fMaxSampADC; j_samp++)
05126 {
05127 gCnaRootFile->fCnaIndivResult->fMatMat(i_samp, j_samp) =
05128 fT3d_cor_correc_covss_s[user_SMEcha][i_samp][j_samp];
05129 }
05130 }
05131 }
05132 }
05133
05134
05135
05136
05137
05138
05139
05140
05141
05142
05143
05144
05145
05146 void TCnaRunEB::WriteAsciiExpectationValuesOfSamples()
05147 {
05148
05149
05150 if ( fTagEv[0] == 1)
05151 {
05152 Int_t i_code = fCodeEv;
05153 fMakeResultsFileName(i_code);
05154 fAsciiFileWriteHeader(i_code);
05155
05156 Int_t i_lic1 = fNbChanByLine;
05157 Int_t i_lic2 = fNbSampByLine;
05158
05159 fT1dWriteAscii(i_code, i_lic1, i_lic2);
05160 }
05161 else
05162 {
05163 cout << "!TCnaRunEB::WriteAsciiExpectationValuesOfSamples()> "
05164 << " Quantities not calculated. No reason to write an ASCII file."
05165 << fTTBELL << endl;
05166 }
05167 }
05168
05169
05170
05171
05172
05173
05174
05175 void TCnaRunEB::WriteAsciiVariancesOfSamples()
05176 {
05177
05178
05179 if ( fTagVar[0] == 1)
05180 {
05181 Int_t i_code = fCodeVar;
05182 fMakeResultsFileName(i_code);
05183 fAsciiFileWriteHeader(i_code);
05184
05185 Int_t i_lic1 = fNbChanByLine;
05186 Int_t i_lic2 = fNbSampByLine;
05187
05188 fT1dWriteAscii(i_code, i_lic1, i_lic2);
05189 }
05190 else
05191 {
05192 cout << "!TCnaRunEB::WriteAsciiVariancesOfSamples()> "
05193 << " Quantities not calculated. No reason to write an ASCII file."
05194 << fTTBELL << endl;
05195 }
05196 }
05197
05198
05199
05200
05201
05202
05203
05204 void TCnaRunEB::WriteAsciiCovariancesBetweenSamples(const Int_t& user_SMEcha)
05205 {
05206
05207
05208 if (fTagCovCss[user_SMEcha] != 1 ) {ComputeCovariancesBetweenSamples();}
05209 fUserSMEcha = user_SMEcha;
05210 Int_t i_code = fCodeCovCss;
05211 fMakeResultsFileName(i_code);
05212 fAsciiFileWriteHeader(i_code);
05213
05214 Int_t i_pasx = fSectSampSizeX;
05215 Int_t i_pasy = fSectSampSizeY;
05216
05217 fT2dWriteAscii(i_code, i_pasx, i_pasy);
05218 }
05219
05220
05221
05222
05223
05224
05225
05226 void TCnaRunEB::WriteAsciiCorrelationsBetweenSamples(const Int_t& user_SMEcha)
05227 {
05228
05229
05230 if (fTagCorCss[user_SMEcha] != 1 ) {ComputeCorrelationsBetweenSamples();}
05231
05232 fUserSMEcha = user_SMEcha;
05233 Int_t i_code = fCodeCorCss;
05234 fMakeResultsFileName(i_code);
05235 fAsciiFileWriteHeader(i_code);
05236
05237 Int_t i_pasx = fSectSampSizeX;
05238 Int_t i_pasy = fSectSampSizeY;
05239
05240 fT2dWriteAscii(i_code, i_pasx, i_pasy);
05241 }
05242
05243
05244
05245
05246
05247
05248
05249
05250 void TCnaRunEB::WriteAsciiExpectationValuesOfCorrelationsBetweenSamples()
05251 {
05252
05253
05254 if ( fTagEvCorCss[0] == 1)
05255 {
05256 Int_t i_code = fCodeEvCorCss;
05257 fMakeResultsFileName(i_code);
05258 fAsciiFileWriteHeader(i_code);
05259
05260 Int_t i_lic1 = fNbChanByLine;
05261 Int_t i_lic2 = 0;
05262
05263 fT1dWriteAscii(i_code, i_lic1, i_lic2);
05264 }
05265 else
05266 {
05267 cout << "!TCnaRunEB::WriteAsciiExpectationValuesOfCorrelationsBetweenSamples()> "
05268 << " Quantities not calculated. No reason to write an ASCII file."
05269 << fTTBELL << endl;
05270 }
05271 }
05272
05273
05274
05275
05276
05277
05278
05279 void TCnaRunEB::WriteAsciiSigmasOfCorrelationsBetweenSamples()
05280 {
05281
05282
05283 if ( fTagSigCorCss[0] == 1)
05284 {
05285 Int_t i_code = fCodeSigCorCss;
05286 fMakeResultsFileName(i_code);
05287 fAsciiFileWriteHeader(i_code);
05288
05289 Int_t i_lic1 = fNbChanByLine;
05290 Int_t i_lic2 = 0;
05291
05292 fT1dWriteAscii(i_code, i_lic1, i_lic2);
05293 }
05294 else
05295 {
05296 cout << "!TCnaRunEB::WriteAsciiSigmasOfCorrelationsBetweenSamples()> "
05297 << " Quantities not calculated. No reason to write an ASCII file."
05298 << fTTBELL << endl;
05299 }
05300 }
05301
05302
05303
05304
05305
05306
05307
05308
05309 void TCnaRunEB::WriteAsciiSvCorrecCovCss()
05310 {
05311
05312
05313 if ( fTagSvCorrecCovCss[0] == 1)
05314 {
05315 Int_t i_code = fCodeSvCorrecCovCss;
05316 fMakeResultsFileName(i_code);
05317 fAsciiFileWriteHeader(i_code);
05318
05319 Int_t i_lic1 = fNbChanByLine;
05320 Int_t i_lic2 = fNbSampByLine;
05321
05322 fT1dWriteAscii(i_code, i_lic1, i_lic2);
05323 }
05324 else
05325 {
05326 cout << "!TCnaRunEB::WriteAsciiSvCorrecCovCss()> "
05327 << " Quantities not calculated. No reason to write an ASCII file."
05328 << fTTBELL << endl;
05329 }
05330 }
05331
05332
05333
05334
05335
05336
05337
05338
05339 void TCnaRunEB::WriteAsciiCovCorrecCovCss(const Int_t& user_SMEcha)
05340 {
05341
05342
05343 if ( fTagCovCorrecCovCss[0] == 1)
05344 {
05345 Int_t i_code = fCodeCovCorrecCovCss;
05346 fUserSMEcha = user_SMEcha;
05347 fMakeResultsFileName(i_code);
05348 fAsciiFileWriteHeader(i_code);
05349
05350 Int_t i_pasx = fSectSampSizeX;
05351 Int_t i_pasy = fSectSampSizeY;
05352
05353 fT2dWriteAscii(i_code, i_pasx, i_pasy);
05354 }
05355 else
05356 {
05357 cout << "!TCnaRunEB::WriteAsciiCovCorrecCovCss()> "
05358 << " Quantities not calculated. No reason to write an ASCII file."
05359 << fTTBELL << endl;
05360 }
05361 }
05362
05363
05364
05365
05366
05367
05368
05369
05370 void TCnaRunEB::WriteAsciiCorCorrecCovCss(const Int_t& user_SMEcha)
05371 {
05372
05373
05374 if ( fTagCorCorrecCovCss[0] == 1)
05375 {
05376 Int_t i_code = fCodeCorCorrecCovCss;
05377 fUserSMEcha = user_SMEcha;
05378 fMakeResultsFileName(i_code);
05379 fAsciiFileWriteHeader(i_code);
05380
05381 Int_t i_pasx = fSectSampSizeX;
05382 Int_t i_pasy = fSectSampSizeY;
05383
05384 fT2dWriteAscii(i_code, i_pasx, i_pasy);
05385 }
05386 else
05387 {
05388 cout << "!TCnaRunEB::WriteAsciiCorCorrecCovCss()> "
05389 << " Quantities not calculated. No reason to write an ASCII file."
05390 << fTTBELL << endl;
05391 }
05392 }
05393
05394
05395
05396
05397
05398
05399 void TCnaRunEB::WriteAsciiCnaChannelTable()
05400 {
05401
05402
05403 TEBNumbering* MyNumbering = new TEBNumbering(); fCnew++;
05404
05405
05406 if(fFlagPrint != fCodePrintNoComment){
05407 cout << "*TCnaRunEB::WriteAsciiCnaChannelTable()> The correspondance table is made."
05408 << " Number of CNA-channels = " << fFileHeader->fMaxCrysInSM << endl;}
05409
05410 Int_t i_code = fCodeCorresp;
05411 fMakeResultsFileName(i_code);
05412 fAsciiFileWriteHeader(i_code);
05413
05414 for (Int_t i_SMEcha=0; i_SMEcha<fFileHeader->fMaxCrysInSM; i_SMEcha++)
05415 {
05416 Int_t sm_tower = MyNumbering->GetSMTowFromSMEcha(i_SMEcha);
05417 Int_t TowEcha = MyNumbering->GetTowEchaFromSMEcha(i_SMEcha);
05418 if ( TowEcha == 0 )
05419 { fFcout_f << endl;
05420 fFcout_f << " CNA tower# channel# crystal# Number of events" << endl;
05421 fFcout_f << "channel in SM in tower in SM found (required)" << endl << endl;
05422 }
05423 Int_t SMcrys = MyNumbering->GetSMCrysFromSMTowAndTowEcha(sm_tower, TowEcha);
05424 Int_t sample_z = 0;
05425 Int_t nb_of_evts = PickupNumberOfEvents(i_SMEcha, sample_z);
05426 fFcout_f << setw(7) << i_SMEcha
05427 << setw(9) << sm_tower
05428 << setw(11) << TowEcha
05429 << setw(10) << SMcrys
05430 << setw(10) << nb_of_evts
05431 << setw(4) << "(" << setw(6) << fFileHeader->fNbOfTakenEvts << ")" << endl;
05432 }
05433 fFcout_f.close();
05434
05435 if(fFlagPrint != fCodePrintNoComment){
05436 cout << "*TCnaRunEB::WriteAsciiCnaChannelTable()> The CNA correspondance table "
05437 << "has been written in file: " << fAsciiFileName << endl;}
05438
05439 delete MyNumbering; fCdelete++;
05440 }
05441
05442
05443
05444
05445
05446
05447
05448 void TCnaRunEB::PrintComments()
05449 {
05450
05451
05452 fFlagPrint = fCodePrintComments;
05453 cout << "*TCnaRunEB::PrintComments()> Warnings and some comments on init will be printed" << endl;
05454 }
05455
05456 void TCnaRunEB::PrintWarnings()
05457 {
05458
05459
05460 fFlagPrint = fCodePrintWarnings;
05461 cout << "*TCnaRunEB::PrintWarnings()> Warnings will be printed" << endl;
05462 }
05463
05464 void TCnaRunEB::PrintAllComments()
05465 {
05466
05467
05468 fFlagPrint = fCodePrintAllComments;
05469 cout << "*TCnaRunEB::PrintAllComments()> All the comments will be printed" << endl;
05470 }
05471
05472 void TCnaRunEB::PrintNoComment()
05473 {
05474
05475
05476 fFlagPrint = fCodePrintNoComment;
05477 }
05478
05479
05480
05481
05482
05483
05484
05485
05486
05487
05488
05489
05490
05491
05492
05493
05494 void TCnaRunEB::fMakeResultsFileName(const Int_t& i_code)
05495 {
05496
05497
05498
05499
05500
05501
05502
05503
05504
05505
05506
05507
05508
05509
05510
05511
05512
05513
05514
05515
05516
05517
05518
05519
05520
05521 char* f_in = new char[fDim_name]; fCnew++;
05522 char* f_in_short = new char[fDim_name]; fCnew++;
05523
05524
05525
05526
05527 if (i_code == fCodeRoot)
05528 {
05529 if(fCfgResultsRootFilePath == "?")
05530 {
05531 cout << "#TCnaRunEB::fMakeResultsFileName> * * * W A R N I N G * * * " << endl << endl
05532 << " Path for results .root file not defined. Default option will be used here:" << endl
05533 << " your results files will be writen in your HOME directory." << endl << endl
05534 << " In order to write the results file in the file FILE_NAME," << endl
05535 << " you have to call the method GetPathForResultsRootFiles(TString FILE_NAME)" << endl
05536 << " where FILE_NAME is the complete name (/afs/etc...) of a configuration file" << endl
05537 << " which must have only one line containing the path of the .root result files." << endl
05538 << " If the TString FILE_NAME is empty, the configuration file must be " << endl
05539 << " in your HOME directory and must be called: cna_results_root.cfg" << endl
05540 << endl;
05541
05542 TString home_path = gSystem->Getenv("HOME");
05543 fCfgResultsRootFilePath = home_path;
05544 }
05545
05546 if(fCfgResultsRootFilePath.BeginsWith("$HOME"))
05547 {
05548 fCfgResultsRootFilePath.Remove(0,5);
05549 Text_t *t_file_nohome = (Text_t *)fCfgResultsRootFilePath.Data();
05550
05551 TString home_path = gSystem->Getenv("HOME");
05552 fCfgResultsRootFilePath = home_path;
05553 fCfgResultsRootFilePath.Append(t_file_nohome);
05554 }
05555
05556 sprintf(f_in, "%s/%s_%d_%d_%d_SM%d",
05557 fCfgResultsRootFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05558 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05559 sprintf(f_in_short, "%s_%d_%d_%d_SM%d",
05560 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05561 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05562 }
05563
05564
05565
05566 if (i_code == fCodeHeaderAscii)
05567 {
05568 if(fCfgResultsAsciiFilePath == "?")
05569 {
05570 cout << "#TCnaRunEB::fMakeResultsFileName> * * * W A R N I N G * * * " << endl << endl
05571 << " Path for results .ascii file not defined. Default option will be used here:" << endl
05572 << " your results files will be writen in your HOME directory." << endl << endl
05573 << " In order to write the results file in the file FILE_NAME," << endl
05574 << " you have to call the method GetPathForResultsAsciiFiles(TString FILE_NAME)" << endl
05575 << " where FILE_NAME is the complete name (/afs/etc...) of a configuration file" << endl
05576 << " which must have only one line containing the path of the .ascii result files." << endl
05577 << " If the TString FILE_NAME is empty, the configuration file must be " << endl
05578 << " in your HOME directory and must be called: cna_results_ascii.cfg" << endl
05579 << endl;
05580
05581 TString home_path = gSystem->Getenv("HOME");
05582 fCfgResultsAsciiFilePath = home_path;
05583 }
05584
05585 if(fCfgResultsAsciiFilePath.BeginsWith("$HOME"))
05586 {
05587 fCfgResultsAsciiFilePath.Remove(0,5);
05588 Text_t *t_file_nohome = (Text_t *)fCfgResultsAsciiFilePath.Data();
05589
05590 TString home_path = gSystem->Getenv("HOME");
05591 fCfgResultsAsciiFilePath = home_path;
05592 fCfgResultsAsciiFilePath.Append(t_file_nohome);
05593 }
05594
05595 sprintf(f_in, "%s/%s_%d_header_%d_%d_SM%d",
05596 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05597 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05598 sprintf(f_in_short, "%s_%d_header_%d_%d_SM%d",
05599 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05600 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05601 }
05602
05603
05604 if (i_code == fCodeCorresp)
05605 {
05606 sprintf(f_in, "%s/%s_%d_%d_%d_SM%d_cna",
05607 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05608 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05609 sprintf(f_in_short, "%s_%d_%d_%d_SM%d_cna",
05610 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05611 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05612 }
05613
05614 if (i_code == fCodeEv)
05615 {
05616 sprintf(f_in, "%s/%s_%d_ev_%d_%d_SM%d",
05617 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05618 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05619 sprintf(f_in_short, "%s_%d_ev_%d_%d_SM%d",
05620 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05621 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05622 }
05623
05624 if (i_code == fCodeVar)
05625 {
05626 sprintf(f_in, "%s/%s_%d_var_%d_%d_SM%d",
05627 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05628 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05629 sprintf(f_in_short, "%s_%d_var_%d_%d_SM%d",
05630 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05631 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05632 }
05633
05634 if( i_code == fCodeEvts)
05635 {
05636 sprintf(f_in, "%s/%s_%d_evts_s_c%d_%d_%d_SM%d",
05637 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber, fUserSMEcha,
05638 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05639 sprintf(f_in_short, "%s_%d_evts_s_c%d_%d_%d_SM%d",
05640 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber, fUserSMEcha,
05641 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05642 }
05643
05644 if( i_code == fCodeCovSccMos)
05645 {
05646 sprintf(f_in, "%s/%s_%d_cov_cc_mos_%d_%d_SM%d",
05647 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05648 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05649 sprintf(f_in_short, "%s_%d_cov_cc_mos_%d_%d_SM%d",
05650 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05651 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05652 }
05653
05654 if ( i_code == fCodeCorSccMos)
05655 {
05656 sprintf(f_in, "%s/%s_%d_cor_cc_mos_%d_%d_SM%d",
05657 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05658 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05659 sprintf(f_in_short, "%s_%d_cor_cc_mos_%d_%d_SM%d",
05660 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05661 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05662 }
05663
05664 if (i_code == fCodeCovCss)
05665 {
05666 sprintf(f_in, "%s/%s_%d_cov_ss_c%d_%d_%d_SM%d",
05667 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber, fUserSMEcha,
05668 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05669 sprintf(f_in_short, "%s_%d_cov_ss_c%d_%d_%d_SM%d",
05670 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber, fUserSMEcha,
05671 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05672 }
05673
05674 if (i_code == fCodeCorCss)
05675 {
05676 sprintf(f_in, "%s/%s_%d_cor_ss_c%d_%d_%d_SM%d",
05677 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05678 fUserSMEcha, fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05679 sprintf(f_in_short, "%s_%d_cor_ss_c%d_%d_%d_SM%d",
05680 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05681 fUserSMEcha, fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05682 }
05683
05684 if (i_code == fCodeEvCorCss)
05685 {
05686 sprintf(f_in, "%s/%s_%d_ev_cor_ss_%d_%d_SM%d",
05687 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05688 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05689 sprintf(f_in_short, "%s_%d_ev_cor_ss_%d_%d_SM%d",
05690 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05691 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05692 }
05693
05694 if (i_code == fCodeSigCorCss)
05695 {
05696 sprintf(f_in, "%s/%s_%d_sig_cor_ss_%d_%d_SM%d",
05697 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05698 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05699 sprintf(f_in_short, "%s_%d_sig_cor_ss_%d_%d_SM%d",
05700 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05701 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05702 }
05703
05704 if (i_code == fCodeSvCorrecCovCss)
05705 {
05706 sprintf(f_in, "%s/%s_%d_sv_correc_covss_%d_%d_SM%d",
05707 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05708 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05709 sprintf(f_in_short, "%s_%d_sv_correc_covss_%d_%d_SM%d",
05710 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05711 fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05712 }
05713
05714 if (i_code == fCodeCovCorrecCovCss)
05715 {
05716 sprintf(f_in, "%s/%s_%d_cov_correc_covss_c%d_%d_%d_SM%d",
05717 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05718 fUserSMEcha, fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05719 sprintf(f_in_short, "%s_%d_cov_correc_covss_c%d_%d_%d_SM%d",
05720 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05721 fUserSMEcha, fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05722 }
05723
05724 if (i_code == fCodeCorCorrecCovCss)
05725 {
05726 sprintf(f_in, "%s/%s_%d_cor_correc_covss_c%d_%d_%d_SM%d",
05727 fCfgResultsAsciiFilePath.Data(), fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05728 fUserSMEcha, fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05729 sprintf(f_in_short, "%s_%d_cor_correc_covss_c%d_%d_%d_SM%d",
05730 fFileHeader->fTypAna.Data(), fFileHeader->fRunNumber,
05731 fUserSMEcha, fFileHeader->fFirstEvt, fFileHeader->fNbOfTakenEvts, fFileHeader->fSuperModule);
05732 }
05733
05734
05735
05736
05737
05738
05739
05740
05741 char* f_name = new char[fDim_name]; fCnew++;
05742
05743 for (Int_t i = 0 ; i < fDim_name ; i++)
05744 {
05745 f_name[i] = '\0';
05746 }
05747
05748 Int_t ii = 0;
05749 for (Int_t i = 0 ; i < fDim_name ; i++)
05750 {
05751 if ( f_in[i] != '\0' ){f_name[i] = f_in[i]; ii++;}
05752 else {break;}
05753 }
05754
05755 if ( ii+5 < fDim_name )
05756 {
05757
05758
05759
05760 if ( i_code != fCodeRoot || i_code == fCodeCorresp )
05761 {
05762 f_name[ii] = '.'; f_name[ii+1] = 'a';
05763 f_name[ii+2] = 's'; f_name[ii+3] = 'c';
05764 f_name[ii+4] = 'i'; f_name[ii+5] = 'i';
05765
05766 fAsciiFileName = f_name;
05767 }
05768
05769 if ( i_code == fCodeRoot )
05770 {
05771 f_name[ii] = '.'; f_name[ii+1] = 'r';
05772 f_name[ii+2] = 'o'; f_name[ii+3] = 'o'; f_name[ii+4] = 't';
05773
05774 fRootFileName = f_name;
05775 }
05776 }
05777 else
05778 {
05779 cout << "*TCnaRunEB::fMakeResultsFileName(...)> Name too long (for f_name)."
05780 << " No room enough for the extension. (ii = " << ii << ")"
05781 << fTTBELL << endl;
05782 }
05783
05784
05785
05786
05787 char* f_name_short = new char[fDim_name]; fCnew++;
05788
05789 for (Int_t i = 0 ; i < fDim_name ; i++)
05790 {
05791 f_name_short[i] = '\0';
05792 }
05793
05794 ii = 0;
05795 for (Int_t i = 0 ; i < fDim_name ; i++)
05796 {
05797 if ( f_in_short[i] != '\0' ){f_name_short[i] = f_in_short[i]; ii++;}
05798 else {break;}
05799 }
05800
05801 if ( ii+5 < fDim_name )
05802 {
05803
05804
05805
05806 if ( i_code != fCodeRoot || i_code == fCodeCorresp )
05807 {
05808 f_name_short[ii] = '.'; f_name_short[ii+1] = 'a';
05809 f_name_short[ii+2] = 's'; f_name_short[ii+3] = 'c';
05810 f_name_short[ii+4] = 'i'; f_name_short[ii+5] = 'i';
05811
05812 fAsciiFileNameShort = f_name_short;
05813 }
05814
05815
05816 if ( i_code == fCodeRoot )
05817 {
05818 f_name_short[ii] = '.'; f_name_short[ii+1] = 'r';
05819 f_name_short[ii+2] = 'o'; f_name_short[ii+3] = 'o'; f_name_short[ii+4] = 't';
05820
05821 fRootFileNameShort = f_name_short;
05822 }
05823 }
05824 else
05825 {
05826 cout << "*TCnaRunEB::fMakeResultsFileName(...)> Name too long (for f_name_short)."
05827 << " No room enough for the extension. (ii = " << ii << ")"
05828 << fTTBELL << endl;
05829 }
05830
05831 delete [] f_name; fCdelete++;
05832 delete [] f_name_short; fCdelete++;
05833
05834 delete [] f_in; fCdelete++;
05835 delete [] f_in_short; fCdelete++;
05836 }
05837
05838
05839
05840
05841
05842
05843 void TCnaRunEB::fAsciiFileWriteHeader(const Int_t& i_code)
05844 {
05845
05846
05847
05848
05849
05850
05851
05852
05853
05854 fFcout_f.open(fAsciiFileName);
05855
05856 fFcout_f << "*** File: " << fAsciiFileName
05857 << " *** " << endl << endl;
05858 fFcout_f << "*Analysis name : " << fFileHeader->fTypAna << endl;
05859 fFcout_f << "*Run number : " << fFileHeader->fRunNumber << endl;
05860 fFcout_f << "*First taken event : " << fFileHeader->fFirstEvt << endl;
05861 fFcout_f << "*Number of taken events : " << fFileHeader->fNbOfTakenEvts << endl;
05862 fFcout_f << "*Super-module number : " << fFileHeader->fSuperModule << endl;
05863 fFcout_f << "*Time first taken event : " << fFileHeader->fStartTime << endl;
05864 fFcout_f << "*Time last taken event : " << fFileHeader->fStopTime << endl;
05865 fFcout_f << "*Date first taken event : " << fFileHeader->fStartDate << endl;
05866 fFcout_f << "*Date last taken event : " << fFileHeader->fStopDate << endl;
05867 fFcout_f << "*Number of entries : " << fFileHeader->fNentries << endl;
05868 fFcout_f << "*Max nb of towers in SM : " << fFileHeader->fMaxTowInSM << endl;
05869 fFcout_f << "*Max nb of Xtals in tower : " << fFileHeader->fMaxCrysInTow << endl;
05870 fFcout_f << "*Max nb of samples ADC : " << fFileHeader->fMaxSampADC << endl;
05871 fFcout_f << endl;
05872
05873
05874
05875
05876
05877
05878 if(i_code == fCodeHeaderAscii) fFcout_f.close();
05879 }
05880
05881
05882
05883
05884
05885
05886
05887
05888
05889 void TCnaRunEB::fT1dWriteAscii(const Int_t& i_code,
05890 const Int_t& i_lic1, const Int_t& i_lic2 )
05891 {
05892
05893
05894
05895
05896
05897
05898
05899
05900
05901
05902
05903
05904
05905
05906
05907
05908
05909
05910 fFcout_f << setiosflags(ios::showpoint | ios::uppercase);
05911 fFcout_f << setprecision(3) << setw(6);
05912 fFcout_f.setf(ios::dec, ios::basefield);
05913 fFcout_f.setf(ios::fixed, ios::floatfield);
05914 fFcout_f.setf(ios::left, ios::adjustfield);
05915 fFcout_f.setf(ios::right, ios::adjustfield);
05916
05917 cout << setiosflags(ios::showpoint | ios::uppercase);
05918 cout << setprecision(3) << setw(6);
05919 cout.setf(ios::dec, ios::basefield);
05920 cout.setf(ios::fixed, ios::floatfield);
05921 cout.setf(ios::left, ios::adjustfield);
05922 cout.setf(ios::right, ios::adjustfield);
05923
05924 Int_t limit = 0;
05925 Int_t nb_elts = 0;
05926 Int_t i_lico = 0;
05927
05928 TString g_nam0 = "?";
05929 TString g_nam1 = "?";
05930 TString g_nam2 = "?";
05931 TString g_nam3 = "?";
05932 TString g_nam4 = "?";
05933
05934 Int_t nb_pass = 2;
05935
05936
05937
05938
05939
05940
05941
05942
05943
05944 Int_t justap_samp = 0;
05945 if ( fFileHeader->fMaxSampADC%fNbSampByLine == 0 ){
05946 justap_samp = fFileHeader->fMaxSampADC;}
05947 else{
05948 justap_samp = ((fFileHeader->fMaxSampADC/fNbSampByLine)+1)*fNbSampByLine;}
05949
05950 Int_t justap_chan = 0;
05951 if ( fFileHeader->fMaxCrysInSM%fNbChanByLine == 0 ){
05952 justap_chan = fFileHeader->fMaxCrysInSM;}
05953 else{
05954 justap_chan = ((fFileHeader->fMaxCrysInSM/fNbChanByLine)+1)*fNbChanByLine;}
05955
05956
05957 if ( i_code == fCodeEv )
05958 {
05959 if( fjustap_2d_ev == 0 )
05960 {
05961
05962 fjustap_2d_ev = new Double_t*[justap_chan]; fCnew++;
05963 fjustap_1d_ev = new Double_t[justap_chan*justap_samp]; fCnew++;
05964 for(Int_t i = 0 ; i < justap_chan ; i++){
05965 fjustap_2d_ev[i] = &fjustap_1d_ev[0] + i*justap_samp;}
05966 }
05967
05968 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
05969 {
05970 for(Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
05971 {
05972 fjustap_2d_ev[i_SMEcha][i_samp] = fT2d_ev[i_SMEcha][i_samp];
05973 }
05974 }
05975
05976 for(Int_t i_SMEcha = fFileHeader->fMaxCrysInSM; i_SMEcha < justap_chan; i_SMEcha++)
05977 {
05978 for(Int_t i_samp = fFileHeader->fMaxSampADC; i_samp < justap_samp; i_samp++)
05979 {
05980 fjustap_2d_ev[i_SMEcha][i_samp] = (Double_t)0;
05981 }
05982 }
05983 }
05984
05985
05986
05987 if ( i_code == fCodeVar || i_code == fCodeSvCorrecCovCss )
05988 {
05989 if(fjustap_2d_var == 0)
05990 {
05991
05992 fjustap_2d_var = new Double_t*[justap_chan]; fCnew++;
05993 fjustap_1d_var = new Double_t[justap_chan*justap_samp]; fCnew++;
05994 for(Int_t i = 0 ; i < justap_chan ; i++){
05995 fjustap_2d_var[i] = &fjustap_1d_var[0] + i*justap_samp;}
05996 }
05997
05998 for(Int_t i_SMEcha = 0; i_SMEcha < fFileHeader->fMaxCrysInSM; i_SMEcha++)
05999 {
06000 for(Int_t i_samp = 0; i_samp < fFileHeader->fMaxSampADC; i_samp++)
06001 {
06002 if (i_code == fCodeVar){
06003 fjustap_2d_var[i_SMEcha][i_samp] = fT2d_var[i_SMEcha][i_samp];}
06004 if (i_code == fCodeSvCorrecCovCss){
06005 fjustap_2d_var[i_SMEcha][i_samp] =
06006 fT2d_sv_correc_covss_s[i_SMEcha][i_samp];}
06007 }
06008 }
06009
06010 for(Int_t i_SMEcha = fFileHeader->fMaxCrysInSM; i_SMEcha < justap_chan; i_SMEcha++)
06011 {
06012 for(Int_t i_samp = fFileHeader->fMaxSampADC; i_samp < justap_samp; i_samp++)
06013 {
06014 fjustap_2d_var[i_SMEcha][i_samp] = (Double_t)0;
06015 }
06016 }
06017 }
06018
06019
06020
06021
06022 if( i_code == fCodeEv || i_code == fCodeVar || i_code == fCodeSvCorrecCovCss )
06023 {
06024 fFcout_f << "*TCnaRunEB> sample sectors, nb of channels by line = "
06025 << fNbChanByLine <<endl;
06026 fFcout_f << "*TCnaRunEB> channel sectors, nb of samples by line = "
06027 << fNbSampByLine <<endl;
06028 }
06029 if( i_code == fCodeEvCorCss || i_code == fCodeSigCorCss)
06030 {
06031 fFcout_f << "*TCnaRunEB> sample sectors, nb of channels by line = "
06032 << fNbChanByLine <<endl;
06033 }
06034
06035 fFcout_f << endl;
06036
06037
06038 if ( i_code == fCodeEvts || i_code == fCodeEvCorCss
06039 || i_code == fCodeSigCorCss ) {nb_pass = 1;}
06040
06041 for(Int_t i_pass = 0 ; i_pass < nb_pass ; i_pass++)
06042 {
06043 if(i_pass == 0)
06044 {
06045 i_lico = i_lic1;
06046 limit = justap_samp;
06047
06048 if( i_code == fCodeEv ||
06049 i_code == fCodeVar ||
06050 i_code == fCodeSvCorrecCovCss )
06051 {
06052 limit = justap_samp;
06053 nb_elts = justap_chan;
06054 g_nam1 = "sample";
06055 g_nam2 = "channel";
06056 }
06057 if(i_code == fCodeEvCorCss || i_code == fCodeSigCorCss )
06058 {
06059 limit = 1;
06060 nb_elts = justap_chan;
06061 g_nam1 = "channel";
06062 }
06063 if ( i_code == fCodeEvts )
06064 {
06065 limit = fFileHeader->fMaxSampADC;
06066 nb_elts = fFileHeader->fNbBinsADC;
06067 g_nam0 = "channel";
06068 g_nam1 = "sample";
06069 g_nam2 = "bins";
06070 g_nam3 = "xmin=";
06071 g_nam4 = "xmax=";
06072 }
06073 }
06074
06075 if(i_pass == 1)
06076 {
06077 i_lico = i_lic2;
06078 limit = justap_chan;
06079 nb_elts = justap_samp;
06080 g_nam1 = "channel";
06081 g_nam2 = "sample";
06082 }
06083
06084 if(i_lico > nb_elts){i_lico = nb_elts;}
06085
06086 for (Int_t i_dim = 0 ; i_dim < limit ; i_dim++)
06087 {
06088
06089
06090 if ( i_code == fCodeEv)
06091 {
06092 fFcout_f << "*TCnaRunEB> expectation values, ";
06093 }
06094
06095 if ( i_code == fCodeVar)
06096 {
06097 fFcout_f << "*TCnaRunEB> variances, ";
06098 }
06099
06100 if ( i_code == fCodeSvCorrecCovCss)
06101 {
06102 fFcout_f
06103 << "*TCnaRunEB> Sample value correction coefficients, ";
06104 }
06105
06106 if ( i_code == fCodeEvCorCss)
06107 {
06108 fFcout_f
06109 << "*TCnaRunEB> expectation values of the"
06110 << " (sample,sample) correlations, ";
06111 }
06112
06113 if ( i_code == fCodeSigCorCss)
06114 {
06115 fFcout_f << "*TCnaRunEB> sigmas of the"
06116 << " (sample,sample) correlations, ";
06117 }
06118
06119 if ( i_code == fCodeEvts)
06120 {
06121 fFcout_f << "*TCnaRunEB> numbers of events, ";
06122 }
06123
06124
06125
06126
06127
06128
06129 if(i_code == fCodeEvts)
06130 {
06131 fFcout_f << g_nam0 << " "
06132 << fUserSMEcha << ", "
06133 << g_nam1 << " "
06134 << i_dim << ", "
06135 << g_nam2 << " 0 to 99";
06136 }
06137 if(i_code == fCodeEv ||
06138 i_code == fCodeVar ||
06139 i_code == fCodeSvCorrecCovCss)
06140 {
06141 fFcout_f << g_nam1 << " " << i_dim << ", " << g_nam2
06142 << " 0 to " << nb_elts - 1;
06143 }
06144 if ( i_code == fCodeEvCorCss || i_code == fCodeSigCorCss)
06145 {
06146 fFcout_f << g_nam1 << " 0 to " << nb_elts - 1;
06147 }
06148 if(i_code == fCodeEvts)
06149 {
06150 fFcout_f << ", " << g_nam3 << " "
06151 << (fT1d_xmin)[i_dim]
06152 << " , " << g_nam4 << " "
06153 << (fT1d_xmax)[i_dim];
06154 }
06155
06156 fFcout_f << " :" << endl;
06157
06158 Int_t k_lec = 1;
06159
06160 for (Int_t i_elt = 0 ; i_elt < nb_elts ; i_elt++)
06161 {
06162 fFcout_f.width(8);
06163
06164
06165
06166 if ( i_code == fCodeEv)
06167 {
06168 switch (i_pass){
06169 case 0:
06170 fFcout_f << (fjustap_2d_ev)[i_elt][i_dim];
06171 break;
06172 case 1:
06173 fFcout_f << (fjustap_2d_ev)[i_dim][i_elt];
06174 break;
06175 }
06176 }
06177
06178 if ( i_code == fCodeVar || i_code == fCodeSvCorrecCovCss)
06179 {
06180 switch (i_pass){
06181 case 0:
06182 fFcout_f << fjustap_2d_var[i_elt][i_dim];
06183 break;
06184 case 1:
06185 fFcout_f << fjustap_2d_var[i_dim][i_elt];
06186 break;
06187 }
06188 }
06189
06190 if ( i_code == fCodeEvCorCss)
06191 {
06192 fFcout_f << fT1d_ev_cor_ss[i_elt];
06193 }
06194
06195 if ( i_code == fCodeSigCorCss)
06196 {
06197 fFcout_f << fT1d_sig_cor_ss[i_elt];
06198 }
06199
06200 if ( i_code == fCodeEvts)
06201 {
06202 fFcout_f << fT2d_his_s[i_dim][i_elt];
06203 }
06204
06205
06206
06207
06208
06209
06210 fFcout_f << " ";
06211
06212 if ( k_lec >= i_lico )
06213 {
06214 fFcout_f << endl;
06215 k_lec = 1;
06216 }
06217 else
06218 {
06219 k_lec++;
06220 }
06221 }
06222 }
06223 }
06224 fFcout_f << endl;
06225
06226
06227 fFcout_f.close();
06228
06229 if(fFlagPrint == fCodePrintAllComments){
06230 cout << "*TCnaRunEB> The results have been writen in the ASCII file: "
06231 << fAsciiFileName << endl;}
06232 }
06233
06234
06235
06236
06237
06238
06239
06240
06241
06242
06243 void TCnaRunEB::fT2dWriteAscii(const Int_t& i_code,
06244 const Int_t& i_pasx_arg,
06245 const Int_t& i_pasy_arg)
06246 {
06247
06248
06249 Int_t i_pasx = i_pasx_arg;
06250 Int_t i_pasy = i_pasy_arg;
06251
06252
06253
06254 fFcout_f << setiosflags(ios::showpoint | ios::uppercase);
06255 fFcout_f.setf(ios::dec, ios::basefield);
06256 fFcout_f.setf(ios::fixed, ios::floatfield);
06257 fFcout_f.setf(ios::left, ios::adjustfield);
06258 fFcout_f.setf(ios::right, ios::adjustfield);
06259 fFcout_f << setprecision(3) << setw(6);
06260
06261 cout << setiosflags(ios::showpoint | ios::uppercase);
06262 cout.setf(ios::dec, ios::basefield);
06263 cout.setf(ios::fixed, ios::floatfield);
06264 cout.setf(ios::left, ios::adjustfield);
06265 cout.setf(ios::right, ios::adjustfield);
06266 cout << setprecision(3) << setw(6);
06267
06268
06269
06270
06271
06272
06273
06274
06275
06276
06277
06278
06279
06280 Int_t justap_chan = 0;
06281
06282 if ( fFileHeader->fMaxCrysInSM%fSectChanSizeX == 0 ){
06283 justap_chan = fFileHeader->fMaxCrysInSM;}
06284 else{
06285 justap_chan=((fFileHeader->fMaxCrysInSM/fSectChanSizeX)+1)*fSectChanSizeX;}
06286
06287
06288
06289 if ( i_code == fCodeCovScc || i_code == fCodeCorScc||
06290 i_code == fCodeCovSccMos || i_code == fCodeCorSccMos ){
06291 if(fjustap_2d_cc == 0)
06292 {
06293
06294 fjustap_2d_cc = new Double_t*[justap_chan]; fCnew++;
06295 fjustap_1d_cc = new Double_t[justap_chan*justap_chan]; fCnew++;
06296 for(Int_t i = 0 ; i < justap_chan ; i++){
06297 fjustap_2d_cc[i] = &fjustap_1d_cc[0] + i*justap_chan;}
06298 }
06299
06300
06301 for(Int_t i = 0; i < fFileHeader->fMaxCrysInSM; i++){
06302 for(Int_t j = 0; j < fFileHeader->fMaxCrysInSM; j++){
06303 if ( i_code == fCodeCovScc ){
06304 fjustap_2d_cc[i][j] = fT3d_cov_cc[fUserSamp][i][j];}
06305 if ( i_code == fCodeCorScc ){
06306 fjustap_2d_cc[i][j] = fT3d_cor_cc[fUserSamp][i][j];}
06307 if ( i_code == fCodeCovSccMos ){
06308 fjustap_2d_cc[i][j] = fT2d_cov_cc_mos[i][j];}
06309 if ( i_code == fCodeCorSccMos ){
06310 fjustap_2d_cc[i][j] = fT2d_cor_cc_mos[i][j];}
06311 }
06312 }
06313
06314
06315 for(Int_t i = fFileHeader->fMaxCrysInSM; i < justap_chan; i++){
06316 for(Int_t j = fFileHeader->fMaxCrysInSM; j < justap_chan; j++){
06317 fjustap_2d_cc[i][j] = (Double_t)0.;}}
06318 }
06319
06320
06321 Int_t justap_samp = 0;
06322
06323 if ( fFileHeader->fMaxSampADC%fSectSampSizeX == 0 ){
06324 justap_samp = fFileHeader->fMaxSampADC;}
06325 else{
06326 justap_samp=((fFileHeader->fMaxSampADC/fSectSampSizeX)+1)*fSectSampSizeX;}
06327
06328
06329
06330 if (i_code == fCodeCovCss || i_code == fCodeCorCss ||
06331 i_code == fCodeCovCorrecCovCss || i_code == fCodeCorCorrecCovCss){
06332 if(fjustap_2d_ss == 0)
06333 {
06334
06335 fjustap_2d_ss = new Double_t*[justap_samp]; fCnew++;
06336 fjustap_1d_ss = new Double_t[justap_samp*justap_samp]; fCnew++;
06337 for(Int_t i = 0 ; i < justap_samp ; i++){
06338 fjustap_2d_ss[i] = &fjustap_1d_ss[0] + i*justap_samp;}
06339 }
06340
06341 for(Int_t i = 0; i < fFileHeader->fMaxSampADC; i++){
06342 for(Int_t j = 0; j < fFileHeader->fMaxSampADC; j++){
06343 if( i_code == fCodeCovCss ){
06344 fjustap_2d_ss[i][j] = fT3d_cov_ss[fUserSMEcha][i][j];}
06345 if( i_code == fCodeCorCss ){
06346 fjustap_2d_ss[i][j] = fT3d_cor_ss[fUserSMEcha][i][j];}
06347 if( i_code == fCodeCovCorrecCovCss ){
06348 fjustap_2d_ss[i][j] = fT3d_cov_correc_covss_s[fUserSMEcha][i][j];}
06349 if( i_code == fCodeCorCorrecCovCss ){
06350 fjustap_2d_ss[i][j] = fT3d_cor_correc_covss_s[fUserSMEcha][i][j];}
06351 }
06352 }
06353
06354 for(Int_t i = fFileHeader->fMaxSampADC; i < justap_samp; i++){
06355 for(Int_t j = fFileHeader->fMaxSampADC; j < justap_samp; j++){
06356 fjustap_2d_ss[i][j] = (Double_t)0.;}}
06357 }
06358
06359
06360
06361 TEBNumbering* MyNumbering = new TEBNumbering(); fCnew++;
06362
06363
06364
06365 Int_t isx_max = 0;
06366 Int_t isy_max = 0;
06367
06368 if(i_code == fCodeCovScc)
06369 {
06370 fFcout_f << "*TCnaRunEB> Covariance matrix between SMEchas "
06371 << "for sample number " << fUserSamp;
06372
06373
06374 isx_max = justap_chan;
06375 isy_max = justap_chan;
06376 }
06377 if(i_code == fCodeCorScc)
06378 {
06379 fFcout_f << "*TCnaRunEB> Correlation matrix between SMEchas "
06380 << "for sample number " << fUserSamp;
06381
06382
06383 isx_max = justap_chan;
06384 isy_max = justap_chan;
06385 }
06386
06387 if(i_code == fCodeCovSccMos)
06388 {
06389 fFcout_f << "*TCnaRunEB> Covariance matrix between SMEchas "
06390 << "averaged on the samples ";
06391
06392
06393 isx_max = justap_chan;
06394 isy_max = justap_chan;
06395 }
06396 if(i_code == fCodeCorSccMos)
06397 {
06398 fFcout_f << "*TCnaRunEB> Correlation matrix between SMEchas "
06399 << "averaged on the samples ";
06400
06401
06402 isx_max = justap_chan;
06403 isy_max = justap_chan;
06404 }
06405
06406 if(i_code == fCodeCovCss)
06407 {
06408 fFcout_f << "*TCnaRunEB> Covariance matrix between samples "
06409 << "for SMEcha number " << fUserSMEcha
06410 << " (SMTow " << MyNumbering->GetSMTowFromSMEcha(fUserSMEcha)
06411 << " , TowEcha " << MyNumbering->GetTowEchaFromSMEcha(fUserSMEcha) << ")";
06412
06413
06414 isx_max = justap_samp;
06415 isy_max = justap_samp;
06416 }
06417 if(i_code == fCodeCorCss)
06418 {
06419 fFcout_f << "*TCnaRunEB> Correlation matrix between samples "
06420 << "for SMEcha number " << fUserSMEcha
06421 << " (SMTow " << MyNumbering->GetSMTowFromSMEcha(fUserSMEcha)
06422 << " , TowEcha " << MyNumbering->GetTowEchaFromSMEcha(fUserSMEcha) << ")";
06423
06424
06425 isx_max = justap_samp;
06426 isy_max = justap_samp;
06427 }
06428
06429 if(i_code == fCodeCovCorrecCovCss)
06430 {
06431 fFcout_f << "*TCnaRunEB> Correction factors to the covariances "
06432 << "between samples for SMEcha number " << fUserSMEcha
06433 << " (SMTow " << MyNumbering->GetSMTowFromSMEcha(fUserSMEcha)
06434 << " , TowEcha " << MyNumbering->GetTowEchaFromSMEcha(fUserSMEcha) << ")";
06435
06436
06437 isx_max = justap_samp;
06438 isy_max = justap_samp;
06439 }
06440
06441 if(i_code == fCodeCorCorrecCovCss)
06442 {
06443 fFcout_f << "*TCnaRunEB> Correction factors to the correlations "
06444 << "between samples for SMEcha number " << fUserSMEcha
06445 << " (SMTow " << MyNumbering->GetSMTowFromSMEcha(fUserSMEcha)
06446 << " , TowEcha " << MyNumbering->GetTowEchaFromSMEcha(fUserSMEcha) << ")";
06447
06448
06449 isx_max = justap_samp;
06450 isy_max = justap_samp;
06451 }
06452
06453 fFcout_f << endl;
06454
06455
06456
06457
06458
06459
06460 if(i_pasx > isx_max){i_pasx = isx_max;}
06461 Int_t n_sctx;
06462 Int_t max_verix;
06463 n_sctx = isx_max/i_pasx;
06464 max_verix = n_sctx*i_pasx;
06465 if(max_verix < isx_max){ n_sctx++;}
06466
06467
06468
06469
06470
06471
06472 if(i_pasy > isy_max){i_pasy = isy_max;}
06473 Int_t n_scty;
06474 Int_t max_veriy;
06475 n_scty = isy_max/i_pasy;
06476 max_veriy = n_scty*i_pasy;
06477 if(max_veriy < isy_max){ n_scty++;}
06478
06479
06480
06481 if( i_code == fCodeCovCss || i_code == fCodeCorCss ||
06482 i_code == fCodeCovCorrecCovCss || i_code == fCodeCorCorrecCovCss)
06483 {
06484 fFcout_f << "*TCnaRunEB> sector size = " << fSectSampSizeX
06485 << " , number of sectors = " << n_sctx << " x " << n_scty
06486 <<endl;
06487 }
06488 if( i_code == fCodeCovScc || i_code == fCodeCorScc ||
06489 i_code == fCodeCovSccMos || i_code == fCodeCorSccMos )
06490 {
06491 fFcout_f << "*TCnaRunEB> sector size = " << fSectChanSizeX
06492 << " , number of sectors = " << n_sctx << " x " << n_scty
06493 << endl;
06494 }
06495 fFcout_f << endl;
06496
06497
06498
06499 Int_t ix_inf = -i_pasx;
06500
06501 for(Int_t nsx = 0 ; nsx < n_sctx ; nsx++)
06502 {
06503
06504 ix_inf = ix_inf + i_pasx;
06505 Int_t ix_sup = ix_inf + i_pasx;
06506
06507 Int_t iy_inf = -i_pasy;
06508
06509 for(Int_t nsy = 0 ; nsy < n_scty ; nsy++)
06510 {
06511 iy_inf = iy_inf + i_pasy;
06512 Int_t iy_sup = iy_inf + i_pasy;
06513
06514
06515
06516 if(i_code == fCodeCovScc || i_code == fCodeCovCss ||
06517 i_code == fCodeCovCorrecCovCss || i_code == fCodeCorCorrecCovCss )
06518 {fFcout_f << " ";}
06519 if(i_code == fCodeCorScc || i_code == fCodeCorCss)
06520 {fFcout_f << " ";}
06521
06522 for (Int_t iy_c = iy_inf ; iy_c < iy_sup ; iy_c++)
06523 {
06524 if(i_code == fCodeCovScc || i_code == fCodeCovSccMos || i_code == fCodeCovCss ||
06525 i_code == fCodeCovCorrecCovCss ||
06526 i_code == fCodeCorCorrecCovCss)
06527 {fFcout_f.width(8);}
06528 if(i_code == fCodeCorScc || i_code == fCodeCorSccMos || i_code == fCodeCorCss)
06529 {fFcout_f.width(6);}
06530 fFcout_f << iy_c << " ";
06531 }
06532 fFcout_f << endl << endl;
06533
06534 for (Int_t ix_c = ix_inf ; ix_c < ix_sup ; ix_c++)
06535 {
06536 if(i_code == fCodeCovScc|| i_code == fCodeCovSccMos || i_code == fCodeCovCss ||
06537 i_code == fCodeCovCorrecCovCss ||
06538 i_code == fCodeCorCorrecCovCss)
06539 {fFcout_f.width(8);}
06540 if(i_code == fCodeCorScc || i_code == fCodeCorSccMos || i_code == fCodeCorCss)
06541 {fFcout_f.width(6);}
06542 fFcout_f << ix_c << " ";
06543
06544 for (Int_t iy_c = iy_inf ; iy_c < iy_sup ; iy_c++)
06545 {
06546 if(i_code == fCodeCovScc ||
06547 i_code == fCodeCovSccMos ||
06548 i_code == fCodeCovCss ||
06549 i_code == fCodeCovCorrecCovCss ||
06550 i_code == fCodeCorCorrecCovCss ){
06551 fFcout_f.width(8);}
06552
06553 if(i_code == fCodeCorScc || i_code == fCodeCorSccMos || i_code == fCodeCorCss){
06554 fFcout_f.width(6);}
06555
06556 if( i_code == fCodeCovScc || i_code == fCodeCovSccMos || i_code == fCodeCorScc){
06557 fFcout_f << fjustap_2d_cc[ix_c][iy_c] << " ";}
06558
06559 if ( i_code == fCodeCovCss ||
06560 i_code == fCodeCorCss ||
06561 i_code == fCodeCovCorrecCovCss ||
06562 i_code == fCodeCorCorrecCovCss )
06563 {
06564 fFcout_f << fjustap_2d_ss[ix_c][iy_c] << " ";
06565 }
06566 }
06567 fFcout_f << endl;
06568 }
06569 fFcout_f << endl;
06570 }
06571 }
06572
06573
06574
06575 fFcout_f.close();
06576
06577 if(fFlagPrint == fCodePrintAllComments){
06578 cout << "*TCnaRunEB> The results have been writen in the ASCII file: "
06579 << fAsciiFileName << endl;}
06580
06581 delete MyNumbering; fCdelete++;
06582 }
06583
06584
06585
06586
06587
06588
06589
06590
06591
06592
06593
06594
06595
06596
06597
06598
06599
06600
06601 TString TCnaRunEB::GetRootFileNameShort() {return fRootFileNameShort;}
06602
06603 TString TCnaRunEB::GetAnalysisName() {return fFileHeader->fTypAna;}
06604 Int_t TCnaRunEB::GetRunNumber() {return fFileHeader->fRunNumber;}
06605 Int_t TCnaRunEB::GetFirstTakenEvent() {return fFileHeader->fFirstEvt;}
06606 Int_t TCnaRunEB::GetNumberOfTakenEvents(){return fFileHeader->fNbOfTakenEvts;}
06607 Int_t TCnaRunEB::GetSMNumber() {return fFileHeader->fSuperModule;}
06608 Int_t TCnaRunEB::GetNentries() {return fFileHeader->fNentries;}
06609
06610
06611 Int_t TCnaRunEB::PickupNumberOfEvents(const Int_t& SMEcha,
06612 const Int_t& sample)
06613 {
06614 Int_t nb_of_evts = -1;
06615
06616 if( SMEcha >= 0 && SMEcha < fFileHeader->fMaxCrysInSM )
06617 {
06618 if( sample >= 0 && sample < fFileHeader->fMaxSampADC )
06619 {
06620 nb_of_evts = fT2d_LastEvtNumber[SMEcha][sample] + 1;
06621 }
06622 else
06623 {
06624 cout << "!TCnaRunEB::PickupNumberOfEvents()> sample = "
06625 << sample << "OUT OF BOUNDS" << fTTBELL << endl;
06626 }
06627 }
06628 else
06629 {
06630 cout << "!TCnaRunEB::PickupNumberOfEvents()> SMEcha = "
06631 << SMEcha << "OUT OF BOUNDS" << fTTBELL << endl;
06632 }
06633
06634 return nb_of_evts;
06635 }
06636
06637