Changeset 1223 for trunk/MagicSoft
- Timestamp:
- 02/28/02 15:04:52 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
r1195 r1223 21 21 // 22 22 // $RCSfile: camera.cxx,v $ 23 // $Revision: 1.3 1$23 // $Revision: 1.32 $ 24 24 // $Author: blanch $ 25 // $Date: 2002-0 1-18 17:41:02 $25 // $Date: 2002-02-28 15:04:52 $ 26 26 // 27 27 //////////////////////////////////////////////////////////////////////// … … 253 253 254 254 //@: Upper and lower edges of the trigger loop 255 static int Trigger_loop_lthres = 0; 256 static int Trigger_loop_uthres = 10; 255 static float Trigger_loop_lthres = 2.0; 256 static float Trigger_loop_uthres = 10.0; 257 static float Trigger_loop_sthres = 1.0; 257 258 static int Trigger_loop_lmult = 2; 258 259 static int Trigger_loop_umult = 10; … … 472 473 int btrigger = 0; //@< trigger flag 473 474 int ithrescount; //@< counter for loop over threshold trigger 475 float fthrescount; //@< value for loop over threshold trigger 474 476 int imulticount; //@< counter for loop over multiplicity trigger 475 477 int itopocount; //@< counter for loop over topology trigger 478 int isorttopo[3]; //@< sorting the topologies 476 479 int icontrigger; //@< number of trigger conditions to be analised 477 480 UShort_t numPix; //@< number of sets of fadc written counts … … 599 602 get_Trigger_properties( &Trigger_gate_length, &Trigger_overlaping_time, &Trigger_response_ampl, &Trigger_response_fwhm); 600 603 601 Trigger_Loop = get_Trigger_Loop(&Trigger_loop_lthres, &Trigger_loop_uthres, &Trigger_loop_lmult, &Trigger_loop_umult, &Trigger_loop_ltop, &Trigger_loop_utop); 602 603 icontrigger =(Trigger_loop_uthres-Trigger_loop_lthres+1)* 604 Trigger_Loop = get_Trigger_Loop(&Trigger_loop_lthres, &Trigger_loop_uthres, &Trigger_loop_sthres, &Trigger_loop_lmult, &Trigger_loop_umult, &Trigger_loop_ltop, &Trigger_loop_utop); 605 606 icontrigger =((int)((Trigger_loop_uthres-Trigger_loop_lthres) 607 /Trigger_loop_sthres)+1)* 604 608 (Trigger_loop_umult-Trigger_loop_lmult+1)* 605 609 (Trigger_loop_utop-Trigger_loop_ltop+1); 606 610 607 611 if (!Trigger_Loop){ 608 612 get_Trigger_Single (qThreshold, &Trigger_multiplicity, &Trigger_topology); … … 650 654 if (Trigger_Loop) { 651 655 log(SIGNATURE, 652 "%s:\n\t%20s: %i - %i\n\t%20s: %i - %i\n\t%20s: %i - %i\n\t%20s\n",656 "%s:\n\t%20s: from %5.2f to %5.2f by %5.2f step\n\t%20s: %i - %i\n\t%20s: %i - %i\n\t%20s\n", 653 657 "Trigger Loop mode", 654 "Threshold",Trigger_loop_lthres,Trigger_loop_uthres, 658 "Threshold",Trigger_loop_lthres,Trigger_loop_uthres,Trigger_loop_sthres, 655 659 "Multiplicity",Trigger_loop_lmult,Trigger_loop_umult, 656 660 "Topology",Trigger_loop_ltop,Trigger_loop_utop, … … 711 715 int ***ntriggerloop; 712 716 713 ntriggerloop= new int ** [(int) (Trigger_loop_uthres+1-Trigger_loop_lthres)]; 714 for (ithrescount=0;ithrescount<=Trigger_loop_uthres-Trigger_loop_lthres;ithrescount++){ 717 ntriggerloop= new int ** [(int)((Trigger_loop_uthres-Trigger_loop_lthres) 718 /Trigger_loop_sthres)]; 719 for (ithrescount=0, fthrescount=Trigger_loop_lthres;fthrescount<=Trigger_loop_uthres;fthrescount+=Trigger_loop_sthres, ithrescount++){ 715 720 ntriggerloop[ithrescount]= new int * [Trigger_loop_umult-Trigger_loop_lmult+1]; 716 721 for (imulticount=0;imulticount<=Trigger_loop_umult-Trigger_loop_lmult;imulticount++){ … … 722 727 } 723 728 729 // We should be careful that topologies are sort from 730 // the less to the more restrictive one. 731 732 if (Trigger_loop_utop==Trigger_loop_ltop) 733 for(int is=0; is<3;is++) 734 isorttopo[is]=is; 735 else { 736 isorttopo[0]=1; 737 isorttopo[1]=0; 738 isorttopo[2]=2; 739 } 740 724 741 // set all random numbers seeds 725 742 … … 771 788 MMcTrigHeader **HeaderTrig = NULL; 772 789 MMcFadcHeader **HeaderFadc = NULL; 790 773 791 774 792 if (Write_McTrig){ … … 931 949 if(Trigger_Loop && Write_McTrig){ 932 950 933 for (int iconcount=0,ithrescount=0;ithrescount<=Trigger_loop_uthres-Trigger_loop_lthres;ithrescount++){ 951 int iconcount; 952 for (iconcount=0,ithrescount=0,fthrescount=Trigger_loop_lthres;fthrescount<=Trigger_loop_uthres;ithrescount++,fthrescount+=Trigger_loop_sthres){ 934 953 for (imulticount=0;imulticount<=Trigger_loop_umult-Trigger_loop_lmult;imulticount++){ 935 954 for(itopocount=0;itopocount<=Trigger_loop_utop-Trigger_loop_ltop;itopocount++){ 936 HeaderTrig[iconcount]->SetTopology((Short_t) i topocount+Trigger_loop_ltop);955 HeaderTrig[iconcount]->SetTopology((Short_t) isorttopo[itopocount+Trigger_loop_ltop]); 937 956 HeaderTrig[iconcount]->SetMultiplicity((Short_t) imulticount+Trigger_loop_lmult); 938 957 for(int i=0;i<TRIGGER_PIXELS;i++){ 939 958 fpixelthres[i]= 940 ((Float_t)( ithrescount+Trigger_loop_lthres)>=qThreshold[i])?941 (Float_t)( ithrescount+Trigger_loop_lthres):qThreshold[i];942 }959 ((Float_t)(fthrescount)>=qThreshold[i])? 960 (Float_t)(fthrescount):qThreshold[i]; 961 } 943 962 HeaderTrig[iconcount]->SetThreshold( fpixelthres); 944 963 HeaderTrig[iconcount]->SetAmplitud(Trigger_response_ampl); … … 969 988 } 970 989 if(Trigger_Loop && Write_McFADC){ 971 972 for (i nt iconcount=0,ithrescount=0;ithrescount<=Trigger_loop_uthres-Trigger_loop_lthres;ithrescount++){990 int iconcount; 991 for (iconcount=0,ithrescount=0,fthrescount=Trigger_loop_lthres;fthrescount<=Trigger_loop_uthres;ithrescount++, fthrescount+=Trigger_loop_sthres){ 973 992 for (imulticount=0;imulticount<=Trigger_loop_umult-Trigger_loop_lmult;imulticount++){ 974 993 for(itopocount=0;itopocount<=Trigger_loop_utop-Trigger_loop_ltop;itopocount++){ … … 1405 1424 // We study several trigger conditons 1406 1425 if(Trigger_Loop){ 1426 1427 // Set to zero the flag to know if some conditon has triggered 1428 btrigger=0; 1407 1429 // Loop over trigger threshold 1408 for (int iconcount=0,ithrescount=Trigger_loop_lthres;ithrescount<=Trigger_loop_uthres;ithrescount++){ 1430 int iconcount; 1431 for (iconcount=0, ithrescount=0, fthrescount=Trigger_loop_lthres;fthrescount<=Trigger_loop_uthres;ithrescount++, fthrescount+=Trigger_loop_sthres){ 1409 1432 for (i=0;i<TRIGGER_PIXELS;i++) 1410 1433 fpixelthres[i]= 1411 ((Float_t)( ithrescount)>=qThreshold[i])?1412 (Float_t)( ithrescount):qThreshold[i];1434 ((Float_t)(fthrescount)>=qThreshold[i])? 1435 (Float_t)(fthrescount):qThreshold[i]; 1413 1436 Trigger.SetThreshold(fpixelthres); 1414 1437 … … 1425 1448 // Set trigger flags to zero 1426 1449 Lev1=Lev2=0; 1427 btrigger=0;1428 1450 1429 1451 // loop over multiplicity of trigger configuration … … 1440 1462 1441 1463 if(itopocount==0 && imulticount>7) continue; 1442 if(itopocount==2 && imulticount<3) continue; 1443 Trigger.SetTopology(itopocount); 1464 //COBB if(itopocount==2 && imulticount<3) continue; 1465 // It only makes to look for a different topology 1466 // if there are 3 or more N pixels. 1467 if(imulticount<3) 1468 Trigger.SetTopology(1); 1469 else 1470 { 1471 // We should be careful that topologies are sort from 1472 // the less to the more restrictive one. 1473 Trigger.SetTopology(isorttopo[itopocount]); 1474 } 1444 1475 Trigger.ClearFirst(); 1445 1476 … … 1451 1482 if(Lev1>0) { 1452 1483 btrigger= 1; 1453 ntriggerloop[ithrescount -Trigger_loop_lthres][imulticount-Trigger_loop_lmult][itopocount-Trigger_loop_ltop]++;1484 ntriggerloop[ithrescount][imulticount-Trigger_loop_lmult][itopocount-Trigger_loop_ltop]++; 1454 1485 } 1455 1486 … … 1799 1830 log( SIGNATURE, "Fraction of triggers: \n"); 1800 1831 datafile<<"Fraction of triggers: "<<endl; 1801 for (ithrescount= Trigger_loop_lthres;ithrescount<=Trigger_loop_uthres;ithrescount++){1832 for (ithrescount=0, fthrescount=Trigger_loop_lthres;fthrescount<=Trigger_loop_uthres;ithrescount++, fthrescount+=Trigger_loop_sthres){ 1802 1833 for (imulticount=Trigger_loop_lmult;imulticount<=Trigger_loop_umult;imulticount++){ 1803 1834 for(itopocount=Trigger_loop_ltop;itopocount<=Trigger_loop_utop;itopocount++){ 1804 log( SIGNATURE, "Thres % d, Multi %d, Topo %d: %5.1f%% (%d out of %d)\n",1805 ithrescount,imulticount,itopocount,((float)ntriggerloop[ithrescount-Trigger_loop_lthres][imulticount-Trigger_loop_lmult][itopocount-Trigger_loop_ltop] / ((float)ntshow) * 100.0), ntriggerloop[ithrescount-Trigger_loop_lthres][imulticount-Trigger_loop_lmult][itopocount-Trigger_loop_ltop], ntshow);1806 datafile<<"Thres "<< ithrescount<<", Multi "<<imulticount<<", Topo"<<itopocount<<": ";1807 datafile<<((float)ntriggerloop[ithrescount -Trigger_loop_lthres][imulticount-Trigger_loop_lmult][itopocount-Trigger_loop_ltop] / ((float)ntshow) * 100.0)<<"% ("<<ntriggerloop[ithrescount-Trigger_loop_lthres][imulticount-Trigger_loop_lmult][itopocount-Trigger_loop_ltop]<<" out of "<<ntshow<<")"<<endl;1835 log( SIGNATURE, "Thres %5.1f, Multi %d, Topo %d: %5.1f%% (%d out of %d)\n", 1836 fthrescount,imulticount,isorttopo[itopocount],((float)ntriggerloop[ithrescount][imulticount-Trigger_loop_lmult][itopocount-Trigger_loop_ltop] / ((float)ntshow) * 100.0), ntriggerloop[ithrescount][imulticount-Trigger_loop_lmult][itopocount-Trigger_loop_ltop], ntshow); 1837 datafile<<"Thres "<<fthrescount<<", Multi "<<imulticount<<", Topo"<<isorttopo[itopocount]<<": "; 1838 datafile<<((float)ntriggerloop[ithrescount][imulticount-Trigger_loop_lmult][itopocount-Trigger_loop_ltop] / ((float)ntshow) * 100.0)<<"% ("<<ntriggerloop[ithrescount][imulticount-Trigger_loop_lmult][itopocount-Trigger_loop_ltop]<<" out of "<<ntshow<<")"<<endl; 1808 1839 } 1809 1840 } … … 3317 3348 // 3318 3349 // $Log: not supported by cvs2svn $ 3350 // Revision 1.31 2002/01/18 17:41:02 blanch 3351 // The option of adding noise to all pixels or to not adding the noise 3352 // has been added. 3353 // We removed the pixels larger than 577. When there were more than one 3354 // trigger in one shower, the pixel number was increasing. Now it is 3355 // flagged by the variable MMcTrig::fFirstLvlTrig. 3356 // 3319 3357 // Revision 1.30 2001/11/27 09:49:54 blanch 3320 3358 // Fixing bug which was treating wrongly the extension of star photons. … … 3400 3438 // 3401 3439 // $Log: not supported by cvs2svn $ 3440 // Revision 1.31 2002/01/18 17:41:02 blanch 3441 // The option of adding noise to all pixels or to not adding the noise 3442 // has been added. 3443 // We removed the pixels larger than 577. When there were more than one 3444 // trigger in one shower, the pixel number was increasing. Now it is 3445 // flagged by the variable MMcTrig::fFirstLvlTrig. 3446 // 3402 3447 // Revision 1.30 2001/11/27 09:49:54 blanch 3403 3448 // Fixing bug which was treating wrongly the extension of star photons.
Note:
See TracChangeset
for help on using the changeset viewer.