Changeset 2292
- Timestamp:
- 07/17/03 19:09:15 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/include-MTrigger/MTrigger.cxx
r1250 r2292 337 337 PixelsSecond[i] = -1; 338 338 } 339 339 340 cout << " end of MTrigger::MTrigger()" << endl ; 340 341 } … … 852 853 } 853 854 855 void MTrigger::SetElecNoise(Float_t factor){ 856 857 UInt_t i; 858 Float_t rausch ; 859 860 rausch = RESPONSE_AMPLITUDE * factor ; 861 862 cout<<"MTrigger::SetElecNoise ... generating database for electroni noise." 863 <<endl; 864 865 for (i=0;i<TRIGGER_PIXELS*TRIGGER_TIME_SLICES*101;i++){ 866 noise[i]=GenElec->Gaus(0., rausch ); 867 } 868 869 cout<<"MTrigger::SetElecNoise ... done"<<endl; 870 871 } 872 854 873 void MTrigger::ElecNoise(Float_t factor) { 855 874 // ============================================================ … … 861 880 862 881 rausch = RESPONSE_AMPLITUDE * factor ; 882 883 UInt_t startslice; 884 885 startslice=GenElec->Integer(TRIGGER_PIXELS*TRIGGER_TIME_SLICES*100); 886 887 863 888 864 889 for ( Int_t i=0 ; i < TRIGGER_PIXELS; i++ ) { … … 867 892 // hitted the first time 868 893 // 894 895 if ( used[i] == FALSE ) { 896 used [i] = TRUE ; 897 898 memcpy( (Float_t*)a_sig[i], 899 (Float_t*)&noise[startslice+TRIGGER_TIME_SLICES*i], 900 TRIGGER_TIME_SLICES*sizeof(Float_t)); 901 memset( (Float_t*)d_sig[i], 902 0, 903 TRIGGER_TIME_SLICES*sizeof(Float_t)); 904 905 } 906 // 907 // Then the noise is introduced for each time slice 908 // 909 else 910 for ( Int_t ii=1 ; ii<TRIGGER_TIME_SLICES; ii++ ) { 869 911 870 if ( used[i] == FALSE ) { 871 used [i] = TRUE ; 872 873 for (Int_t ii=0; ii < TRIGGER_TIME_SLICES; ii++ ) { 874 a_sig[i][ii] = 0. ; 875 d_sig[i][ii] = 0. ; 876 } 877 } 878 // 879 // Then the noise is introduced for each time slice 880 // 881 for ( Int_t ii=1 ; ii<TRIGGER_TIME_SLICES; ii++ ) { 882 883 a_sig [i][ii] += GenElec->Gaus(0., rausch ) ; 884 885 } 912 a_sig [i][ii] += noise[startslice+TRIGGER_TIME_SLICES*i+ii] ; 913 914 } 915 886 916 } 887 917 }
Note:
See TracChangeset
for help on using the changeset viewer.