Changeset 6386 for trunk/MagicSoft/Simulation/Detector/Camera
- Timestamp:
- 02/11/05 20:00:01 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx
r6365 r6386 46 46 #include "MRawCrateData.h" 47 47 #include "MMcEvt.hxx" 48 #include "MMcEvtBasic.h" 48 49 #include "MMcTrig.hxx" 49 50 #include "MMcRunHeader.hxx" … … 1102 1103 } 1103 1104 1104 MMcEvt **McEvt = NULL;1105 1106 if (Write_McEvt) { 1107 if (ct_Number>1){1108 McEvt = new MMcEvt *[numberBranches];1109 for (int i=0;i<numberBranches;i++)1110 McEvt[i]=new MMcEvt(); 1111 }1112 else{1113 McEvt = new MMcEvt *[1]; 1114 McEvt[0]=new MMcEvt();1115 1116 }1105 MMcEvt **McEvt = NULL; 1106 MMcEvtBasic **McEvtBasic = NULL; 1107 1108 if (Write_McEvt) 1109 { 1110 McEvt = new MMcEvt *[ct_Number]; 1111 McEvtBasic = new MMcEvtBasic *[ct_Number]; 1112 for (int i = 0; i < ct_Number; i++) 1113 { 1114 McEvt[i] = new MMcEvt(); 1115 McEvtBasic[i] = new MMcEvtBasic(); 1116 } 1117 } 1117 1118 // 1118 1119 // initalize a temporal ROOT file … … 1205 1206 1206 1207 RunHeader->SetMagicNumber(MRawRunHeader::kMagicNumber); 1207 RunHeader->SetFormatVersion( 4);1208 RunHeader->SetFormatVersion(5); 1208 1209 RunHeader->SetSoftVersion((UShort_t) (VERSION*10)); 1209 1210 RunHeader->SetRunType(256); … … 1383 1384 TTree EvtTree("Events","Normal Triggered Events"); 1384 1385 1385 if (Write_McEvt && ct_Number==1){ 1386 1387 EvtTree.Branch("MMcEvt.","MMcEvt", 1388 &McEvt[0]); 1389 } 1390 1391 if (Write_McEvt && ct_Number!=1){ 1392 ibr=0; 1393 for(char branchname[256];ibr<numberBranches;ibr++){ 1394 1395 sprintf(help,"%i",ibr+1); 1396 strcpy (branchname, "MMcEvt;"); 1397 strcat (branchname, & help[0]); 1398 strcat (branchname, "."); 1399 EvtTree.Branch(branchname,"MMcEvt", 1400 &McEvt[ibr]); 1401 } 1402 } 1386 if (Write_McEvt && ct_Number == 1) 1387 { 1388 EvtTree.Branch("MMcEvt.","MMcEvt", &McEvt[0]); 1389 EvtTree.Branch("MMcEvtBasic.","MMcEvtBasic", &McEvtBasic[0]); 1390 } 1391 1392 if (Write_McEvt && ct_Number!=1) 1393 { 1394 ibr=0; 1395 for(char branchname[256]; ibr < numberBranches; ibr++) 1396 { 1397 sprintf(help,"%i",ibr+1); 1398 strcpy (branchname, "MMcEvt;"); 1399 strcat (branchname, & help[0]); 1400 strcat (branchname, "."); 1401 EvtTree.Branch(branchname,"MMcEvt", 1402 &McEvt[ibr]); 1403 } 1404 for(char branchname[256]; ibr < numberBranches; ibr++) 1405 { 1406 sprintf(help,"%i",ibr+1); 1407 strcpy (branchname, "MMcEvtBasic;"); 1408 strcat (branchname, & help[0]); 1409 strcat (branchname, "."); 1410 EvtTree.Branch(branchname,"MMcEvtBasic", 1411 &McEvtBasic[ibr]); 1412 } 1413 } 1403 1414 1404 1415 if(!Trigger_Loop && ct_Number==1){ … … 2332 2343 if (reflector_file_version<6){ 2333 2344 mcevth[0].get_times(&ftime, <ime); 2345 2346 McEvtBasic[0]->Fill((MMcEvt::ParticleId_t) mcevth[0].get_primary(), 2347 mcevth[0].get_energy(), impactD[0], 2348 phiCT[0], thetaCT[0]); 2349 2334 2350 McEvt[0]->Fill( 0, 2335 2351 (UShort_t) mcevth[0].get_primary() , … … 2372 2388 mcevth_2[0].get_times(&ftime, <ime); 2373 2389 chi2=mcevth_2[0].get_NKGfit(&Nmax, &t0, &tmax, &a, &b, &c); 2390 2391 McEvtBasic[0]->Fill((MMcEvt::ParticleId_t) mcevth_2[0].get_primary(), 2392 mcevth_2[0].get_energy(), impactD[0], 2393 mcevth_2[0].get_phi_CT(), 2394 mcevth_2[0].get_theta_CT()); 2395 2374 2396 McEvt[0]->Fill((UInt_t) mcevth_2[0].get_evt_number(), 2375 2397 (UShort_t) mcevth_2[0].get_primary() , … … 2425 2447 } 2426 2448 if (Write_McEvt) 2427 McEvt[0]->Clear() ; 2449 { 2450 McEvt[0]->Clear(); 2451 McEvtBasic[0]->Clear(); 2452 } 2428 2453 } 2429 2454 } … … 2589 2614 // 2590 2615 2591 2592 2616 for (int ict=0;ict<ct_Number;ict++){ 2593 2617 Float_t ftime, ltime; 2594 2618 if (reflector_file_version<6){ 2595 2619 mcevth[ict].get_times(&ftime, <ime); 2620 2621 McEvtBasic[ict]->Fill((MMcEvt::ParticleId_t) mcevth[0].get_primary(), 2622 mcevth[ict].get_energy(), impactD[ict], 2623 phiCT[ict], thetaCT[ict]); 2624 2596 2625 McEvt[ict]->Fill( 0, 2597 2626 (UShort_t) mcevth[0].get_primary() , … … 2632 2661 mcevth_2[ict].get_times(&ftime, <ime); 2633 2662 chi2=mcevth_2[ict].get_NKGfit(&Nmax, &t0, &tmax, &a, &b, &c); 2663 2664 McEvtBasic[ict]->Fill((MMcEvt::ParticleId_t)mcevth_2[ict].get_primary(), 2665 mcevth_2[ict].get_energy(), impactD[ict], 2666 mcevth_2[ict].get_phi_CT(), 2667 mcevth_2[ict].get_theta_CT()); 2668 2669 2634 2670 McEvt[ict]->Fill( (UInt_t) mcevth_2[ict].get_evt_number(), 2635 2671 (UShort_t) mcevth_2[ict].get_primary() , … … 2683 2719 if (Write_RawEvt) EvtData[ict]->ResetPixels(0,0); 2684 2720 if (Write_McTrig) McTrig[ict]->Clear() ; 2685 if (Write_McEvt) McEvt[ict]->Clear() ; 2721 if (Write_McEvt) 2722 { 2723 McEvt[ict]->Clear() ; 2724 McEvtBasic[ict]->Clear(); 2725 } 2686 2726 } 2687 2727 } … … 4983 5023 // 4984 5024 // $Log: not supported by cvs2svn $ 5025 // Revision 1.87 2005/02/10 19:28:10 moralejo 5026 // 5027 // Substituted input card option "write_all_events" by 5028 // "write_all_event_headers". If set, this will make camera to write out 5029 // the event headers of all the processed events, no matter whether they 5030 // have triggered or not. 5031 // 4985 5032 // Revision 1.86 2005/02/10 14:49:21 moralejo 4986 5033 //
Note:
See TracChangeset
for help on using the changeset viewer.