Changeset 438 for trunk/MagicSoft/Simulation/Detector
- Timestamp:
- 10/25/00 09:14:23 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
r436 r438 21 21 // 22 22 // $RCSfile: camera.cxx,v $ 23 // $Revision: 1.1 2$24 // $Author: harald$25 // $Date: 2000- 09-22 17:40:18$23 // $Revision: 1.13 $ 24 // $Author: magicsol $ 25 // $Date: 2000-10-25 08:14:23 $ 26 26 // 27 27 //////////////////////////////////////////////////////////////////////// … … 49 49 #include "TROOT.h" 50 50 51 #include "TRandom.h" 51 52 #include "TApplication.h" 52 53 … … 692 693 if (Write_McTrig){ 693 694 694 McTrig = new MMcTrig * [icontrigger];695 McTrig = new MMcTrig * [icontrigger]; 695 696 696 697 for (i=0;i<icontrigger;i++) { … … 698 699 } 699 700 700 HeaderTrig = new MHeaderTrig * [icontrigger];701 HeaderTrig = new MHeaderTrig * [icontrigger]; 701 702 702 703 for (i=0;i<icontrigger;i++) { … … 740 741 741 742 HeaderTree.Branch("MHeaderTrig","MHeaderTrig", 742 &HeaderTrig[0], bsize, split); 743 } 744 743 &HeaderTrig[0], bsize, split); 744 } 745 745 if (Trigger_Loop && Write_McTrig){ 746 746 for(char branchname[10],i=0;i<icontrigger;i++){ 747 // 748 // build the name of the branch for the different trigger conditions 749 // 747 750 748 sprintf(help,"%i",i+1); 751 749 strcpy (branchname, "MHeaderTrig"); 752 strcat (branchname, &help[0]);750 strcat (branchname, & help[0]); 753 751 strcat (branchname, "."); 754 755 752 HeaderTree.Branch(branchname,"MHeaderTrig", 756 753 &HeaderTrig[i], bsize, split); … … 770 767 771 768 } 772 773 774 769 if(Trigger_Loop && Write_McTrig){ 770 775 771 for (int iconcount=0,ithrescount=0;ithrescount<=Trigger_loop_uthres-Trigger_loop_lthres;ithrescount++){ 776 772 for (imulticount=0;imulticount<=Trigger_loop_umult-Trigger_loop_lmult;imulticount++){ … … 789 785 790 786 // Fill the Header Tree with the current leaves of each branch 791 792 787 HeaderTree.Fill() ; 793 788 789 794 790 // create a Tree for the Event data stream 795 791 TTree EvtTree("EvtTree","Events of Run"); 796 792 797 793 if (Write_McEvt){ 794 798 795 EvtTree.Branch("MMcEvt","MMcEvt", 799 796 &McEvt, bsize, split); … … 801 798 802 799 if(!Trigger_Loop){ 800 803 801 if (Write_RawEvt){ 804 802 EvtTree.Branch("MRawEvt","MRawEvt", … … 810 808 } 811 809 } 812 else{ // trigger lopp810 else{ 813 811 if (Write_McTrig){ 814 812 for(char branchname[10],i=0;i<icontrigger;i++){ … … 880 878 &cam, 881 879 nsbrate_phepns ); 882 883 880 if (k != 0){ 884 881 cout << "Error when reading starfield... \nExiting.\n"; … … 892 889 cam.dpixsizefactor[i] * cam.dpixsizefactor[i]; 893 890 } 891 894 892 } 895 893 … … 897 895 // Read the reflector file with the Cherenkov data 898 896 // 899 897 900 898 // select input file 901 899 902 900 if ( Data_From_STDIN ) { 901 903 902 inputfile = stdin; 903 904 904 } 905 905 else{ … … 909 909 if ( inputfile == NULL ) 910 910 error( SIGNATURE, "Cannot open input file: %s\n", inname ); 911 911 912 } 912 913 … … 984 985 985 986 ++nshow; 986 if ( fmod ( nshow, 1000. ) == 0. ) 987 log(SIGNATURE, "Event %d(+%d)\n", nshow, ntshow); 987 log(SIGNATURE, "Event %d(+%d)\n", nshow, ntshow); 988 988 989 989 // get MCEventHeader … … 1037 1037 1038 1038 mcevth.get_deviations ( &thetaCT, &phiCT ); 1039 1039 1040 1040 if ( (thetaCT == 0.) && (phiCT == 0.) ) { 1041 1041 … … 1134 1134 exit(1); 1135 1135 } 1136 1137 if ( fmod ( nshow, 1000. ) == 0. ) 1138 log(SIGNATURE, "End of this event: %d cphs(+%d). . .\n", 1139 ncph, ntcph); 1136 1137 log(SIGNATURE, "End of this event: %d cphs(+%d). . .\n", 1138 ncph, ntcph); 1140 1139 1141 1140 ntcph += ncph; … … 1159 1158 } 1160 1159 1161 if ( fmod ( nshow, 1000. ) == 0. ) 1162 log(SIGNATURE, "Total number of phe: %d \n", inumphe ) ; 1160 cout << "Total number of phes: " << inumphe <<endl; 1163 1161 1164 1162 … … 1175 1173 // TRIGGER HERE 1176 1174 1175 1177 1176 // 1178 1177 // now the noise of the electronic … … 1187 1186 if(Trigger_Loop){ 1188 1187 // Loop over trigger threshold 1189 for (int iconcount=0,ithrescount=Trigger_loop_lthres;ithrescount<=Trigger_loop_uthres;ithrescount++) 1188 for (int iconcount=0,ithrescount=Trigger_loop_lthres;ithrescount<=Trigger_loop_uthres;ithrescount++){ 1190 1189 for (i=0;i<TRIGGER_PIXELS;i++) 1191 1190 fpixelthres[i]=(float) ithrescount; 1192 1193 1191 Trigger.SetThreshold(fpixelthres); 1192 1194 1193 Trigger.Diskriminate(); 1195 1196 1194 // 1197 1195 // look if in all the signals in the trigger signal branch … … 1410 1408 (UShort_t) ncph) ; 1411 1409 } 1412 1413 1410 // We don not count photons out of the camera. 1414 1411 1412 1415 1413 // 1416 1414 // write it out to the file outfile 1417 1415 // 1418 1416 1419 //EvtTree.Fill() ;1420 // huschel1417 EvtTree.Fill() ; 1418 1421 1419 1422 1420 … … 2973 2971 2974 2972 float t; 2973 TRandom random; // Random numbers generator 2974 2975 random.SetSeed ((UInt_t) (RandomNumber*1000)); 2975 2976 2976 2977 ii = *inphe; // avoid dereferencing … … 3028 3029 3029 3030 // randomize 3030 3031 inumnsbphe = ignpoi( inumnsbphe ); 3032 3031 3032 if (inumnsbphe>0.0){ 3033 inumnsbphe = random.Poisson (inumnsbphe ); 3034 } 3035 3033 3036 // create the photoelectrons 3034 3037 … … 3069 3072 // 3070 3073 // $Log: not supported by cvs2svn $ 3074 // Revision 1.12 2000/09/22 17:40:18 harald 3075 // Added a lot of changes done by oscar. 3076 // 3071 3077 // Revision 1.11 2000/09/21 11:47:33 harald 3072 3078 // Oscar found some smaller errors in the calculation of the pixel shape and 3073 3079 // corrected it. 3074 3080 // 3081 // $Log: not supported by cvs2svn $ 3075 3082 // Revision 1.10 2000/07/04 14:10:20 MagicSol 3076 3083 // Some changes have been done in the root output file. The RawEvt tree is only
Note:
See TracChangeset
for help on using the changeset viewer.