Changeset 9216 for trunk/MagicSoft/Mars/datacenter/macros
- Timestamp:
- 01/09/09 21:58:48 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/fillcamera.C
r9144 r9216 50 50 #include <iomanip> 51 51 52 #include <TEnv.h> 52 53 #include <TRegexp.h> 53 54 #include <TObjectTable.h> … … 222 223 TString psfy = Form("%5.2f", pointspready); 223 224 TString psfadd = Form("%5.2f", TMath::Hypot(runheader2->GetPointSpreadX(), runheader2->GetPointSpread())); 225 Int_t mirr = runheader2->GetMirrorFraction(); 224 226 TString mirrfrac = Form("%5.2f", runheader2->GetMirrorFraction()); 227 if (mirr < 0 ) 228 mirrfrac = "NULL"; 225 229 TString misx = Form("%5.2f", misptx); 226 230 TString misy = Form("%5.2f", mispty); 227 231 TString reflector = Form("%5.0i", reflvers); 228 232 TString camera = Form("%5.0i", camvers); 233 Int_t impact = runheader3->GetImpactMax(); 229 234 TString imax = Form("%5.1f", runheader3->GetImpactMax()); 235 if (impact < 0) 236 imax = "NULL"; 230 237 TString numphe = Form("%5.1f", runheader3->GetNumPheFromDNSB()); 231 238 TString pmin = Form("%5.1f", runheader3->GetShowerPhiMin()); … … 257 264 // TString numtrig = Form("%7.0i", TMath::Nint(h.GetBinContent(2))); 258 265 266 UInt_t nsumtrig = (UInt_t)tree2->Draw("Length$(MRawEvtHeader.fTrigPattern[0])","(MRawEvtHeader.fTrigPattern[0]==0xffffdfdf) || (MRawEvtHeader.fTrigPattern[0]==0xffffdede)","goff"); 267 if (nsumtrig<0) 268 { 269 cout << "ERROR - Evaluating sumtrigger events in file: " << fname << endl; 270 return 2; 271 } 272 TString numsumtrig = Form("%7.0i", nsumtrig); 273 if (nsumtrig==0) 274 numsumtrig = "0"; 275 259 276 // Determine observation mode, fake wobble means On mode with mispointing 260 277 TString wobblemod="Wobble"; … … 280 297 // Get zbin 281 298 Float_t zBin=TMath::Nint((1-((TMath::Cos(tmin*TMath::Pi()/180)+TMath::Cos(tmax*TMath::Pi()/180))/2))*100); 299 Float_t zBinmin=TMath::Nint((1-(TMath::Cos(tmin*TMath::Pi()/180)))*100); 300 Float_t zBinmax=TMath::Nint((1-(TMath::Cos(tmax*TMath::Pi()/180)))*100); 282 301 Int_t zBin2=TMath::Nint(zBin); 302 Int_t zBin2Min=TMath::Nint(zBinmin); 303 Int_t zBin2Max=TMath::Nint(zBinmax); 283 304 284 305 // Definition of keys … … 294 315 Int_t viewconeangleokey; 295 316 Int_t spectrumkey; 317 Int_t triggerkey; 296 318 297 319 // Definition of variables to be filled in the db … … 317 339 cout << "NumEvents " << numevt << endl; 318 340 cout << "NumTriggers " << numtrig << endl; 341 cout << "NumSumTriggers " << numsumtrig << endl; 319 342 cout << "NumPheFromDNSB " << numphe << endl; 320 343 cout << "ViewconeAngleInner " << coneanglei << endl; … … 359 382 viewconeangleokey = serv.QueryKeyOfName("ViewconeAngleO", coneangleo.Data()); 360 383 spectrumkey = 1; 384 triggerkey = nsumtrig == 0 ? 2 : 3; 361 385 psfkey = 1; 362 386 spotsizekey = 1; … … 398 422 cout << "coneangleokey: " << viewconeangleokey << endl; 399 423 cout << "spectrumkey: " << spectrumkey << endl; 424 cout << "triggerkey: " << triggerkey << endl; 400 425 cout << endl; 401 426 … … 432 457 cout << "NumEvents " << numevt << endl; 433 458 cout << "NumTriggers " << numtrig << endl; 459 cout << "NumSumTriggers " << numsumtrig << endl; 434 460 cout << "NumPheFromDNSB " << numphe << endl; 435 461 cout << "ViewconeAngleInner " << coneanglei << endl; … … 465 491 spotsizekey = serv.QueryKeyOfName("AddSpotSize", addspot); 466 492 spectrumkey = serv.QueryKeyOfName("Spectrum", slope); 493 triggerkey = nsumtrig == 0 ? 2 : 3; 494 467 495 468 496 if (corsvers==0) … … 502 530 cout << "coneangleokey: " << viewconeangleokey << endl; 503 531 cout << "spectrumkey: " << spectrumkey << endl; 532 cout << "triggerkey: " << triggerkey << endl; 504 533 cout << endl; 505 534 … … 555 584 Form("fELowLim=%s, fEUppLim=%s, fSlopeSpec=%5.2f, " 556 585 "fImpactMax=%s, fNumSimulatedShowers=%d, fNumEvents=%d, " 557 "fNumPheFromDNSB=%s, fZBin=%d, f ThetaMin=%s, "586 "fNumPheFromDNSB=%s, fZBin=%d, fZBinMin=%d, fZBinMax=%d, fThetaMin=%s, " 558 587 "fThetaMax=%s, fPointSpread=%s, " 559 588 "fPedesMean=%s, fLow2HighGain=%s, " … … 561 590 elow.Data(), eupp.Data(), spectrum, 562 591 imax.Data(), numsimshow, numevents, 563 numphe.Data(), zBin2, thetamin.Data(),592 numphe.Data(), zBin2, zBin2Min, zBin2Max, thetamin.Data(), 564 593 thetamax.Data(), psf.Data(), 565 594 ped.Data(), low2high.Data(), … … 571 600 "fReflectorVersionKEY=%d, fCameraVersionKEY=%d, " 572 601 "fObservationModeKEY=%d, fMCParticleKEY=%d, " 573 "fSequenceFirst=0, fNumTriggers=%d, f ViewconeAngleInner=%5.2f, fViewconeAngleOuter=%5.2f, "602 "fSequenceFirst=0, fNumTriggers=%d, fNumSumTriggers=%d, fViewconeAngleInner=%5.2f, fViewconeAngleOuter=%5.2f, " 574 603 "fAtmosphericModelKEY=%d, fAmplFadcKEY=%d, fAddSpotSizeKEY=%d, " 575 "fPSFKEY=%d, fViewconeAngleOKEY=%d, fSpectrumKEY=%d ",604 "fPSFKEY=%d, fViewconeAngleOKEY=%d, fSpectrumKEY=%d, fTriggerFlagKEY=%d ", 576 605 enoise.Data(), 577 606 dnoise.Data(), RunNum, … … 579 608 reflectorkey, camerakey, 580 609 observationkey, particlekey, 581 ntrig, coneai, coneao,610 ntrig, nsumtrig, coneai, coneao, 582 611 atmomodelkey, amplfadckey, spotsizekey, 583 psfkey, viewconeangleokey, spectrumkey );612 psfkey, viewconeangleokey, spectrumkey, triggerkey); 584 613 585 614 TString vars2 = … … 625 654 Form("fELowLim=%s, fEUppLim=%s, fSlopeSpec=%5.2f, " 626 655 "fImpactMax=%s, fNumSimulatedShowers=%d, fNumEvents=%d, " 627 "fNumPheFromDNSB=%s, fZBin=%d, f ThetaMin=%s, "656 "fNumPheFromDNSB=%s, fZBin=%d, fZBinMin=%d, fZBinMax=%d, fThetaMin=%s, " 628 657 "fThetaMax=%s, fPointSpread=%s, " 629 658 "fPedesMean=%s, fLow2HighGain=%s, " … … 631 660 elow.Data(), eupp.Data(), spectrum, 632 661 imax.Data(), numsimshow, numevents, 633 numphe.Data(), zBin2, thetamin.Data(),662 numphe.Data(), zBin2, zBin2Min, zBin2Max, thetamin.Data(), 634 663 thetamax.Data(), psf.Data(), 635 664 ped.Data(), low2high.Data(), … … 641 670 "fReflectorVersionKEY=%d, fCameraVersionKEY=%d, " 642 671 "fObservationModeKEY=%d, fMCParticleKEY=%d, " 643 "fSequenceFirst=0, fNumTriggers=%d, f ViewconeAngleInner=%5.2f, fViewconeAngleOuter=%5.2f, "672 "fSequenceFirst=0, fNumTriggers=%d, fNumSumTriggers=%d, fViewconeAngleInner=%5.2f, fViewconeAngleOuter=%5.2f, " 644 673 "fAtmosphericModelKEY=%d, fAmplFadcKEY=%d, fAddSpotSizeKEY=%d, " 645 "fPSFKEY=%d, fViewconeAngleOKEY=%d, fSpectrumKEY=%d ",674 "fPSFKEY=%d, fViewconeAngleOKEY=%d, fSpectrumKEY=%d, fTriggerFlagKEY=%d ", 646 675 enoise.Data(), 647 676 dnoise.Data(), RunNum, … … 649 678 reflectorkey, camerakey, 650 679 observationkey, particlekey, 651 ntrig, coneai, coneao,680 ntrig, nsumtrig, coneai, coneao, 652 681 atmomodelkey, amplfadckey, spotsizekey, 653 psfkey, viewconeangleokey, spectrumkey );682 psfkey, viewconeangleokey, spectrumkey, triggerkey); 654 683 655 684 TString vars2 = … … 686 715 // delete row; 687 716 688 //link file geht nur f ür data files, cal und ped haben keine psf... müssen aber in alle verzeichnisse verlinkt werden717 //link file geht nur fuer data files, cal und ped haben keine psf... muessen aber in alle verzeichnisse verlinkt werden 689 718 //wieder mit if point 0.5/-1.0 else 690 719 … … 717 746 TString particle = (*row)[0]; //ParticleName abfragen 718 747 TString spec = (*row)[1]; //Spectrum.fSpectrum abfragen 719 TString obsmode; //wird über obskey präzisiert 748 TString obsmode; //wird ueber obskey praezisiert 749 TString trigmode; //wird ueber triggerkey praezisiert 720 750 TString mkdir; 721 751 TString link; … … 778 808 } 779 809 810 switch(triggerkey) 811 { 812 case 2: 813 obsmode += ""; 814 break; 815 case 3: 816 obsmode += "SUM"; 817 break; 818 default: 819 cout << "ERROR - TriggerFlagKEY wrong value" << endl; 820 return 2; 821 } 822 780 823 if (observationkey!=1) 781 824 { … … 858 901 { 859 902 // TEnv env("mcsql.rc"); 860 //TEnv env("sql.rc");861 862 //MSQLMagic serv(env);863 MSQLMagic serv("sql.rc");903 TEnv env("sql.rc"); 904 905 MSQLMagic serv(env); 906 // MSQLMagic serv("sql.rc"); 864 907 if (!serv.IsConnected()) 865 908 {
Note:
See TracChangeset
for help on using the changeset viewer.