Changeset 1131 for trunk/MagicSoft/Mars
- Timestamp:
- 12/19/01 15:39:46 (23 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/macros/MagicHillas.C
r1103 r1131 68 68 // read.AddFile("data/cer000019.root"); 69 69 70 MMcPedestalCopy pcopy;71 MMcPedestalNSB 72 MCerPhotCalc ncalc;73 MImgCleanStd clean;74 MHillasCalc hcalc;75 MFillH hfill("MHillas", "MHHillas");76 MFillH sfill("MHillas", "MHStarMap");70 MMcPedestalCopy pcopy; 71 MMcPedestalNSBAdd pnsb; 72 MCerPhotCalc ncalc; 73 MImgCleanStd clean; 74 MHillasCalc hcalc; 75 MFillH hfill("MHillas", "MHHillas"); 76 MFillH sfill("MHillas", "MHStarMap"); 77 77 78 78 // … … 104 104 if (!evtloop.Eventloop()) 105 105 return; 106 106 107 tlist.PrintStatistics(); 107 108 -
trunk/MagicSoft/Mars/macros/readMagic.C
r1103 r1131 38 38 plist.AddToList(&tlist); 39 39 40 MReadMarsFile read("Events", "~/data/camera.root");41 MMcPedestalCopy pcopy;42 MMcPedestalNSB 43 MCerPhotCalc ncalc;44 MClone clone("MCerPhotEvt");45 MImgCleanStd clean;46 MHillasCalc hcalc;40 MReadMarsFile read("Events", "~/data/camera.root"); 41 MMcPedestalCopy pcopy; 42 MMcPedestalNSBAdd pnsb; 43 MCerPhotCalc ncalc; 44 MClone clone("MCerPhotEvt"); 45 MImgCleanStd clean; 46 MHillasCalc hcalc; 47 47 48 48 tlist.AddToList(&read); -
trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc
r1123 r1131 64 64 } 65 65 66 Bool_t MMcPedestalCopy::CheckRunType(MParList *pList) const 67 { 68 MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 69 if (!run) 70 { 71 *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl; 72 return kTRUE; 73 } 74 75 return run->GetRunType() == kRTMonteCarlo; 76 } 77 66 78 Bool_t MMcPedestalCopy::PreProcess(MParList *pList) 67 79 { 68 ReInit(pList); 80 if (!CheckRunType(pList)) 81 { 82 *fLog << warn << dbginf << " MMcPedestalCopy is for Monte Carlo files only... "; 83 *fLog << "removing task from list." << endl; 84 return kSKIP; 85 } 86 87 fPedCam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam"); 88 if (!fPedCam) 89 return kFALSE; 90 91 fMcPed = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader"); 92 if (!fMcPed) 93 { 94 *fLog << warn << dbginf << "MMcFadcHeader not found... aborting." << endl; 95 return kFALSE; 96 } 69 97 70 98 return kTRUE; … … 73 101 Bool_t MMcPedestalCopy::ReInit(MParList *pList) 74 102 { 75 MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 76 if (run) 77 { 78 if (run->GetRunType() != kRTMonteCarlo) 79 { 80 *fLog << warn << dbginf << "MMcPedestalCopy is for Monte Carlo files only... removing this task from list." << endl; 81 return kSKIP; 82 } 83 } 84 else 85 *fLog << warn << dbginf << "Warning - cannot check file type, MRawRunHeader not found." << endl; 86 87 88 const MMcFadcHeader *mcped = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader"); 89 if (!mcped) 90 { 91 *fLog << warn << dbginf << "MMcFadcHeader not found... aborting." << endl; 92 return kFALSE; 93 } 94 95 MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam"); 96 if (!pedcam) 103 if (!CheckRunType(pList)) 97 104 return kFALSE; 98 105 99 const int num = mcped->GetNumPixel();106 const int num = fMcPed->GetNumPixel(); 100 107 101 pedcam->InitSize(num); 102 103 *fLog << "Pixels: " << num << endl; 108 fPedCam->InitSize(num); 104 109 105 110 for (int i=0; i<num; i++) 106 111 { 107 MPedestalPix &pix = (* pedcam)[i];112 MPedestalPix &pix = (*fPedCam)[i]; 108 113 109 114 // Here one should compute the Pedestal taking into account how 110 115 // the MC makes the transformation analogic-digital for the FADC. 111 116 112 const Float_t pedest = mcped->GetPedestal(i);117 const Float_t pedest = fMcPed->GetPedestal(i); 113 118 const Float_t pedrms = pedest/sqrt(num); 114 119 115 const Float_t sigma = mcped->GetPedestalRms(i);120 const Float_t sigma = fMcPed->GetPedestalRms(i); 116 121 const Float_t sigrms = sigma/sqrt(num*2); 117 122 -
trunk/MagicSoft/Mars/manalysis/MMcPedestalNSB.cc
r1118 r1131 63 63 } 64 64 65 Bool_t MMcPedestalNSB:: PreProcess(MParList *pList)65 Bool_t MMcPedestalNSB::ReInit(MParList *pList) 66 66 { 67 67 MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader");
Note:
See TracChangeset
for help on using the changeset viewer.