- Timestamp:
- 03/05/01 10:36:52 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
r646 r671 21 21 // 22 22 // $RCSfile: camera.cxx,v $ 23 // $Revision: 1.1 7$24 // $Author: magicsol$25 // $Date: 2001-0 2-23 11:05:57$23 // $Revision: 1.18 $ 24 // $Author: blanch $ 25 // $Date: 2001-03-05 10:36:52 $ 26 26 // 27 27 //////////////////////////////////////////////////////////////////////// … … 209 209 static int Write_McEvt = TRUE; 210 210 static int Write_McTrig = TRUE; 211 static int Write_McFADC = TRUE; 211 212 static int Write_RawEvt = FALSE; 212 213 … … 234 235 static float Trigger_response_fwhm = 2.0; 235 236 static float Trigger_overlaping_time= 0.25; 237 238 //@: Properties of the FADC 239 static float FADC_response_ampl = MFADC_RESPONSE_AMPLITUDE; 240 static float FADC_response_fwhm = MFADC_RESPONSE_FWHM; 236 241 237 242 //@: Trigger conditions for a single trigger mode … … 422 427 423 428 int simulateNSB; //@< Will we simulate NSB? 429 int nphe2NSB; //@< From how many ohe will we simulate NSB? 424 430 float meanNSB; //@< diffuse NSB mean value (phe per ns per central pixel) 425 float diffnsb_phepns[iMAXNUMPIX]; //@< diffuse NSB values for each pixel derived426 //@< from meanNSB431 float diffnsb_phepns[iMAXNUMPIX]; //@< diffuse NSB values for each pixel 432 //@< derived from meanNSB 427 433 float nsbrate_phepns[iMAXNUMPIX][iNUMWAVEBANDS]; //@< non-diffuse nsb 428 434 //@< photoelectron rates … … 435 441 Byte_t trigger_map[((Int_t)(TRIGGER_PIXELS/8))+1];//@< Pixels on when the 436 442 //@< camera triggers 443 Float_t fadc_elecnoise[CAMERA_PIXELS]; //@< Electronic niose for each pixel 444 UChar_t fadc_pedestals[CAMERA_PIXELS]; //@< array for fadc pedestals values 437 445 438 446 float ext[iNUMWAVEBANDS] = { //@< average atmospheric extinction in each waveband … … 551 559 Write_McEvt = get_write_McEvt() ; 552 560 Write_McTrig = get_write_McTrig() ; 561 Write_McFADC = get_write_McFadc() ; 553 562 Write_RawEvt = get_write_RawEvt() ; 554 563 555 564 FADC_Scan = get_FADC_Scan(); 556 565 Trigger_Scan = get_Trigger_Scan(); 566 567 get_FADC_properties( &FADC_response_ampl, &FADC_response_fwhm); 557 568 558 569 get_Trigger_properties( &Trigger_gate_length, &Trigger_overlaping_time, &Trigger_response_ampl, &Trigger_response_fwhm); … … 583 594 qThreshold = get_threshold(); 584 595 qTailCut = get_tail_cut(); 585 simulateNSB = get_nsb( &meanNSB );596 simulateNSB = get_nsb( &meanNSB, &nphe2NSB ); 586 597 countIslands = get_islands_cut( &nIslandsCut ); 587 598 … … 639 650 "Write_McEvt", ONoff(Write_McEvt), 640 651 "Write_McTrig", ONoff(Write_McTrig), 652 "Write_McFADC", ONoff(Write_McFADC), 641 653 "Write_RawEvt", ONoff(Write_RawEvt)); 642 654 … … 716 728 MMcTrig **McTrig; 717 729 MMcTrigHeader **HeaderTrig; 730 MMcFadcHeader **HeaderFadc; 718 731 719 732 if (Write_McTrig){ … … 732 745 } 733 746 734 MFadc fadc ; //@< A instance of the Class MFadc 747 if (Write_McFADC){ 748 749 HeaderFadc = new MMcFadcHeader * [icontrigger]; 750 751 for (i=0;i<icontrigger;i++) { 752 HeaderFadc[i] = new MMcFadcHeader(); 753 } 754 } 755 756 MFadc fadc(FADC_response_ampl,FADC_response_fwhm) ; //@< A instance of the Class MFadc 735 757 736 758 // Set the FADC pedestals for that run … … 743 765 // Prepare the raw data output 744 766 745 // Header file767 // Header branch 746 768 747 769 MRawEvtHeader **EvtHeader; … … 755 777 } 756 778 757 // Header file779 // Data branch 758 780 759 781 MRawEvtData **EvtData; // Data branch … … 801 823 } 802 824 803 // Fill branches 825 if(!Trigger_Loop && Write_McFADC){ 826 827 HeaderTree.Branch("MMcFadcHeader","MMcFadcHeader", 828 &HeaderFadc[0], bsize, split); 829 } 830 if (Trigger_Loop && Write_McFADC){ 831 for(char branchname[20],i=0;i<icontrigger;i++){ 832 833 sprintf(help,"%i",i+1); 834 strcpy (branchname, "MMcFadcHeader"); 835 strcat (branchname, & help[0]); 836 strcat (branchname, "."); 837 HeaderTree.Branch(branchname,"MMcFadcHeader", 838 &HeaderFadc[i], bsize, split); 839 } 840 } 841 842 // Fill branches for MMcTrigHeader 804 843 805 844 if(!Trigger_Loop && Write_McTrig){ … … 837 876 } 838 877 878 // Fill branches for MMcFadcHeader 879 880 for(i=0;i<CAMERA_PIXELS;i++){ 881 fadc_elecnoise[i]=2.0; 882 } 883 fadc.GetPedestals(&fadc_pedestals[0]); 884 885 if(!Trigger_Loop && Write_McFADC){ 886 887 HeaderFadc[0]->SetShape(0.0); 888 HeaderFadc[0]->SetAmplitud(FADC_response_ampl); 889 HeaderFadc[0]->SetFwhm(FADC_response_fwhm); 890 HeaderFadc[0]->SetPedestal(&fadc_pedestals[0],anaPixels); 891 HeaderFadc[0]->SetElecNoise(&fadc_elecnoise[0],anaPixels); 892 } 893 if(Trigger_Loop && Write_McTrig){ 894 895 for (int iconcount=0,ithrescount=0;ithrescount<=Trigger_loop_uthres-Trigger_loop_lthres;ithrescount++){ 896 for (imulticount=0;imulticount<=Trigger_loop_umult-Trigger_loop_lmult;imulticount++){ 897 for(itopocount=0;itopocount<=Trigger_loop_utop-Trigger_loop_ltop;itopocount++){ 898 HeaderFadc[iconcount]->SetShape(0.0); 899 HeaderFadc[iconcount]->SetAmplitud(Trigger_response_ampl); 900 HeaderFadc[iconcount]->SetFwhm(Trigger_response_fwhm); 901 HeaderFadc[iconcount]->SetPedestal(&fadc_pedestals[0],anaPixels); 902 HeaderFadc[iconcount]->SetElecNoise(&fadc_elecnoise[0],anaPixels); 903 iconcount++; 904 } 905 } 906 } 907 } 908 839 909 // Fill the Header Tree with the current leaves of each branch 840 910 HeaderTree.Fill() ; … … 973 1043 for(j=0;j<iNUMWAVEBANDS;j++) 974 1044 nsb_phepns[i]=nsb_phepns[i]+ nsbrate_phepns[i][j]; 975 cout<<"Huschel "<<nsb_phepns[i]<<endl;976 1045 } 977 1046 } … … 1165 1234 inumphe=0; 1166 1235 1167 // NSB simulation1168 1169 if(simulateNSB){1170 1171 // Fill trigger and fadc response in the trigger class from teh database1172 for(i=0;i<cam.inumpixels;i++)1173 if(nsb_phepns[i]>0.0){1174 k=lons.GetResponse(nsb_phepns[i],0.1,1175 & nsb_trigresp[0],& nsb_fadcresp[0]);1176 if(k==0){1177 cout << "Exiting.\n";1178 exit(1);1179 }1180 Trigger.SetNSB(i,nsb_trigresp);1181 fadc.Set(i,nsb_fadcresp);1182 }1183 }// end if(simulateNSB) ...1184 1185 1236 // read the photons and produce the photoelectrons 1186 1237 … … 1202 1253 exit(1); 1203 1254 } 1255 1256 // NSB simulation 1257 1258 if(simulateNSB && nphe2NSB<=inumphe){ 1259 1260 // Fill trigger and fadc response in the trigger class from the database 1261 for(i=0;i<cam.inumpixels;i++) 1262 if(nsb_phepns[i]>0.0){ 1263 k=lons.GetResponse(nsb_phepns[i],0.1, 1264 & nsb_trigresp[0],& nsb_fadcresp[0]); 1265 if(k==0){ 1266 cout << "Exiting.\n"; 1267 exit(1); 1268 } 1269 Trigger.AddNSB(i,nsb_trigresp); 1270 fadc.AddSignal(i,nsb_fadcresp); 1271 } 1272 }// end if(simulateNSB && nphe2NSB<=inumphe) ... 1204 1273 1205 1274 log(SIGNATURE, "End of this event: %d cphs(+%d). . .\n", … … 3146 3215 // 3147 3216 // $Log: not supported by cvs2svn $ 3217 // Revision 1.17 2001/02/23 11:05:57 magicsol 3218 // Small changes due to slightly different output format and the introduction of 3219 // pedesals for teh FADC. 3220 // 3148 3221 // Revision 1.16 2001/01/18 18:44:40 magicsol 3149 3222 // *** empty log message *** … … 3172 3245 // 3173 3246 // $Log: not supported by cvs2svn $ 3247 // Revision 1.17 2001/02/23 11:05:57 magicsol 3248 // Small changes due to slightly different output format and the introduction of 3249 // pedesals for teh FADC. 3250 // 3174 3251 // Revision 1.16 2001/01/18 18:44:40 magicsol 3175 3252 // *** empty log message ***
Note:
See TracChangeset
for help on using the changeset viewer.