Changeset 1131 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 12/19/01 15:39:46 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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.