Changeset 502 for trunk/MagicSoft/Simulation/Detector/Camera
- Timestamp:
- 01/15/01 12:33:34 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
r438 r502 21 21 // 22 22 // $RCSfile: camera.cxx,v $ 23 // $Revision: 1.1 3$23 // $Revision: 1.14 $ 24 24 // $Author: magicsol $ 25 // $Date: 200 0-10-25 08:14:23$25 // $Date: 2001-01-15 12:33:34 $ 26 26 // 27 27 //////////////////////////////////////////////////////////////////////// … … 57 57 #include "TCanvas.h" 58 58 59 #include "TArrayC.h" 60 59 61 #include "MTrigger.hxx" 60 62 #include "MFadc.hxx" 61 63 62 #include "MRawEvt.h" 64 #include "MRawEvtData.h" 65 #include "MRawEvtHeader.h" 66 #include "MRawCrateData.h" 63 67 #include "MMcEvt.h" 64 68 #include "MMcTrig.hxx" … … 224 228 225 229 //@: Properties of the trigger 226 static float Trigger_gate_length = 3.0;230 static float Trigger_gate_length = 6.0; 227 231 static float Trigger_response_ampl = 1.0; 228 232 static float Trigger_response_fwhm = 2.0; 233 static float Trigger_overlaping_time= 0.25; 229 234 230 235 //@: Trigger conditions for a single trigger mode … … 448 453 float fpixelthres[TRIGGER_PIXELS]; 449 454 450 float fadcValues[(Int_t) SLICES_MFADC]; //@< the analog Fadc siganl for pixels455 TArrayC *fadcValues; //@< the analog Fadc siganl for pixels 451 456 452 457 float plateScale_cm2deg; //@< plate scale (deg/cm) … … 535 540 Trigger_Scan = get_Trigger_Scan(); 536 541 537 get_Trigger_properties( &Trigger_gate_length, &Trigger_ response_ampl, &Trigger_response_fwhm);542 get_Trigger_properties( &Trigger_gate_length, &Trigger_overlaping_time, &Trigger_response_ampl, &Trigger_response_fwhm); 538 543 539 544 Trigger_Loop = get_Trigger_Loop(&Trigger_loop_lthres, &Trigger_loop_uthres, &Trigger_loop_lmult, &Trigger_loop_umult, &Trigger_loop_ltop, &Trigger_loop_utop); … … 677 682 678 683 Int_t Lev0, Lev1, Lev2 ; 684 685 fadcValues = new TArrayC(FADC_SLICES); 679 686 680 687 // initialise ROOT … … 684 691 // initialise instance of Trigger and FADC classes 685 692 686 MTrigger Trigger(Trigger_gate_length, Trigger_response_ampl, Trigger_response_fwhm); //@< A instance of the Class MTrigger 693 MTrigger Trigger(Trigger_gate_length, Trigger_overlaping_time, 694 Trigger_response_ampl, Trigger_response_fwhm); //@< A instance of the Class MTrigger 687 695 688 696 // Initialise McTrig information class if we want to save trigger informtion … … 711 719 // Prepare the raw data output 712 720 713 MRawEvt **Evt; 721 // Header file 722 723 MRawEvtHeader **EvtHeader; 714 724 715 725 if (Write_RawEvt) { 716 Evt = new MRawEvt* [icontrigger];726 EvtHeader = new MRawEvtHeader * [icontrigger]; 717 727 718 728 for (i=0;i<icontrigger;i++) { 719 Evt[i] = new MRawEvt(); 729 EvtHeader[i] = new MRawEvtHeader(); 730 } 731 } 732 733 // Header file 734 735 MRawEvtData **EvtData; // Data branch 736 737 if (Write_RawEvt) { 738 EvtData = new MRawEvtData * [icontrigger]; 739 740 for (i=0;i<icontrigger;i++) { 741 EvtData[i] = new MRawEvtData(); 720 742 } 721 743 } … … 800 822 801 823 if (Write_RawEvt){ 802 EvtTree.Branch("MRawEvt","MRawEvt", 803 &Evt[0], bsize, split); 824 EvtTree.Branch("MRawEvtHeader","MRawEvtHeader", 825 &EvtHeader[0], bsize, split); 826 EvtTree.Branch("MRawEvtData","MRawEvtData", 827 &EvtData[0], bsize, split); 804 828 } 805 829 if (Write_McTrig){ … … 823 847 824 848 if (Trigger_Loop && Write_RawEvt){ 825 for(char branchname[1 0],i=0;i<icontrigger;i++){849 for(char branchname[15],i=0;i<icontrigger;i++){ 826 850 827 851 sprintf(help,"%i",i+1); 828 strcpy (branchname, "MRawEvt ");852 strcpy (branchname, "MRawEvtHeader"); 829 853 strcat (branchname, & help[0]); 830 854 strcat (branchname, "."); 831 EvtTree.Branch(branchname,"MRawEvt", 832 &Evt[i], bsize, split); 855 EvtTree.Branch(branchname,"MRawEvtHeader", 856 &EvtHeader[i], bsize, split); 857 } 858 for(char branchname[15],i=0;i<icontrigger;i++){ 859 860 sprintf(help,"%i",i+1); 861 strcpy (branchname, "MRawEvtData"); 862 strcat (branchname, & help[0]); 863 strcat (branchname, "."); 864 EvtTree.Branch(branchname,"MRawEvtData", 865 &EvtData[i], bsize, split); 833 866 } 834 867 } … … 1255 1288 // 1256 1289 1257 Evt [iconcount]->FillHeader ( (UInt_t) (ntshow + nshow),(Float_t) (nshow*10000+iconcount*100+ii),0);1290 EvtHeader[iconcount]->FillHeader ( (UInt_t) (ntshow + nshow),0); 1258 1291 // fill pixel information 1259 1292 for(i=0;i<ct_NPixels;i++){ 1260 for (j=0;j< SLICES_MFADC;j++){1261 fadcValues [j]=fadc.GetFadcSignal(i,j);1293 for (j=0;j<FADC_SLICES;j++){ 1294 fadcValues->AddAt((Char_t) (fadc.GetFadcSignal(i,j)),j); 1262 1295 } 1263 Evt [iconcount]->FillPixel(i+1000*ii,&numPix,fadcValues);1296 EvtData[iconcount]->AddPixel(i+1000*ii,fadcValues,0); 1264 1297 } 1265 1298 } … … 1308 1341 if( Write_RawEvt ){ 1309 1342 for(i=0;i<icontrigger;i++){ 1310 Evt[i]->Clear() ; 1343 EvtHeader[i]->Clear() ; 1344 EvtData[i]->DeletePixels(); 1311 1345 } 1312 1346 } … … 1379 1413 // 1380 1414 1381 Evt [0]->FillHeader ( (UShort_t) (ntshow + nshow) , 20 ) ;1415 EvtHeader[0]->FillHeader ( (UShort_t) (ntshow + nshow) , 20 ) ; 1382 1416 1383 1417 // fill pixel information 1384 1418 1385 1419 for(i=0;i<ct_NPixels;i++){ 1386 for (j=0;j< SLICES_MFADC;j++){1387 fadcValues [j]=fadc.GetFadcSignal(i,j);1420 for (j=0;j<FADC_SLICES;j++){ 1421 fadcValues->AddAt((Char_t) (fadc.GetFadcSignal(i,j)),j); 1388 1422 } 1389 Evt [0]->FillPixel(i,&numPix,fadcValues);1423 EvtData[0]->AddPixel(i+ii*1000,fadcValues,0); 1390 1424 } 1391 1425 } … … 1437 1471 1438 1472 // clear all 1439 if (Write_RawEvt) Evt[0]->Clear() ; 1473 if (Write_RawEvt) EvtHeader[0]->Clear() ; 1474 if (Write_RawEvt) EvtData[0]->DeletePixels(); 1440 1475 if (Write_McEvt) McEvt->Clear() ; 1441 1476 } … … 1517 1552 //-- 1518 1553 1519 HeaderTree.Write() ;1520 EvtTree.Write() ;1521 1554 outfile_temp.Write() ; 1522 1555 outfile_temp.Close() ; 1523 1556 1524 //1525 // initalize the ROOT file1526 //1527 1528 TFile outfile ( rootname , "RECREATE" );1529 HeaderTree.Write() ;1530 EvtTree.Write() ;1531 outfile.Write() ;1532 outfile.Close() ;1533 1557 1534 1558 // close input file … … 2792 2816 int i, j, k, ii; // counters 2793 2817 2794 MTrigger trigger(Trigger_gate_length, Trigger_ response_ampl, Trigger_response_fwhm);2818 MTrigger trigger(Trigger_gate_length, Trigger_overlaping_time, Trigger_response_ampl, Trigger_response_fwhm); 2795 2819 MFadc flashadc; 2796 2820 … … 3072 3096 // 3073 3097 // $Log: not supported by cvs2svn $ 3098 // Revision 1.13 2000/10/25 08:14:23 magicsol 3099 // The routine that produce poisson random numbers to decide how many phe 3100 // form NSB are emmited in each pixel has been replaced. Now a ROOT routine 3101 // is used. 3102 // 3074 3103 // Revision 1.12 2000/09/22 17:40:18 harald 3075 3104 // Added a lot of changes done by oscar. … … 3080 3109 // 3081 3110 // $Log: not supported by cvs2svn $ 3111 // Revision 1.13 2000/10/25 08:14:23 magicsol 3112 // The routine that produce poisson random numbers to decide how many phe 3113 // form NSB are emmited in each pixel has been replaced. Now a ROOT routine 3114 // is used. 3115 // 3082 3116 // Revision 1.10 2000/07/04 14:10:20 MagicSol 3083 3117 // 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.