Changeset 1035 for trunk/MagicSoft/Mars/manalysis
- Timestamp:
- 11/06/01 13:44:26 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/manalysis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.cc
r1017 r1035 43 43 44 44 #include "MPedestalCam.h" 45 #include "MRawRunHeader.h" 45 46 #include "MMcFadcHeader.hxx" 46 47 … … 58 59 Bool_t MMcPedestalCopy::PreProcess(MParList *pList) 59 60 { 60 fMcPedestals = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader"); 61 if (!fMcPedestals) 61 MRawRunHeader *run = (MRawRunHeader*)pList->FindObject("MRawRunHeader"); 62 if (run) 63 { 64 if (run->GetRunType() != kRTMonteCarlo) 65 return kTRUE; 66 } 67 68 const MMcFadcHeader *mcped = (MMcFadcHeader*)pList->FindObject("MMcFadcHeader"); 69 if (!mcped) 62 70 { 63 71 *fLog << dbginf << "MMcFadcHeader not found... aborting." << endl; … … 65 73 } 66 74 67 fPedestals= (MPedestalCam*)pList->FindCreateObj("MPedestalCam");68 if (! fPedestals)75 MPedestalCam *pedcam = (MPedestalCam*)pList->FindCreateObj("MPedestalCam"); 76 if (!pedcam) 69 77 return kFALSE; 70 78 71 return kTRUE; 72 } 79 const int num = mcped->GetNumPixel(); 73 80 74 Bool_t MMcPedestalCopy::Process() 75 { 76 const int num = fMcPedestals->GetNumPixel(); 77 78 fPedestals->InitSize(num); 81 pedcam->InitSize(num); 79 82 80 83 for (int i=0; i<num; i++) 81 84 { 82 MPedestalPix &pix = (* fPedestals)[i];85 MPedestalPix &pix = (*pedcam)[i]; 83 86 84 const Float_t pedest = fMcPedestals->GetPedestal(i);85 const Float_t pedrms = fMcPedestals->GetPedestalRms(i);87 const Float_t pedest = mcped->GetPedestal(i); 88 const Float_t pedrms = mcped->GetPedestalRms(i); 86 89 87 90 const Float_t sigma = pedest*sqrt(num); 88 const Float_t sigrms = sigma/sqrt( 2*num);91 const Float_t sigrms = sigma/sqrt(num*2); 89 92 90 93 pix.SetPedestal(pedest, sigma); 91 94 pix.SetPedestalRms(pedrms, sigrms); 92 93 *fLog << pedest << " " << sigma << " " << pedrms << " " << sigrms << endl;94 95 } 95 96 -
trunk/MagicSoft/Mars/manalysis/MMcPedestalCopy.h
r1017 r1035 23 23 class MMcPedestalCopy : public MTask 24 24 { 25 const MMcFadcHeader *fMcPedestals; // 26 MPedestalCam *fPedestals; // 27 28 TString *fSrc; 25 TString *fSrc; 29 26 30 27 public: … … 32 29 33 30 Bool_t PreProcess(MParList *pList); 34 Bool_t Process();35 31 36 32 ClassDef(MMcPedestalCopy, 0) // Task which copies the pedestals from the MC into the standard container
Note:
See TracChangeset
for help on using the changeset viewer.