Changeset 711 for trunk/MagicSoft/Mars/mhist/MFillHFadc.cc
- Timestamp:
- 03/30/01 12:01:58 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MFillHFadc.cc
r710 r711 1 //////////////////////////////////////////////////////////////////////// 2 // 3 // MFillHFadc 4 // 5 // This task fill the n time slices from all pixels 6 // (stored in a MRawEvtData container) into histograms. 7 // This histograms (one per pixel) are stored in MHFadcCam, MHFadcPix 8 // 9 //////////////////////////////////////////////////////////////////////// 10 1 11 #include "MFillHFadc.h" 2 12 … … 10 20 ClassImp(MFillHFadc) 11 21 12 22 MFillHFadc::MFillHFadc (const char *name, const char *title) : fRawEvtData(NULL) 13 23 { 14 24 *fName = name ? name : "MFillHFadc"; … … 18 28 Bool_t MFillHFadc::PreProcess (MParList *pList) 19 29 { 20 // connect the raw data with this task 21 22 fHistos = (MHFadcCam*)pList->FindCreateObj("MHFadcCam"); 23 if (!fHistos) 24 return kFALSE; 30 // 31 // The PrProcess function checks for the existance of all necessary 32 // parameter containers 33 // 25 34 26 fRawEvtData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData"); 27 if (!fRawEvtData) 28 { 29 *fLog << dbginf << " Error: MRawEvtData not found... exit." << endl; 30 return kFALSE ; 31 } 35 // 36 // check if all necessary input containers are existing 37 // 38 fRawEvtData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData"); 39 if (!fRawEvtData) 40 { 41 *fLog << dbginf << " Error: MRawEvtData not found... exit." << endl; 42 return kFALSE; 43 } 32 44 33 return kTRUE ; 45 // 46 // check if the output containers are existing, if not craete them 47 // 48 fHistos = (MHFadcCam*)pList->FindCreateObj("MHFadcCam"); 49 if (!fHistos) 50 return kFALSE; 34 51 52 return kTRUE; 35 53 } 36 54 37 55 Bool_t MFillHFadc::Process() 38 56 { 39 // loop over the pixels and fill the values in the histograms 57 // 58 // This process function loops over all pixels in an MRawEvtData 59 // event and fills the values into histograms 60 // 61 62 // loop over the pixels and fill the values in the histograms 40 63 41 MRawEvtPixelIter pixel(fRawEvtData);64 MRawEvtPixelIter pixel(fRawEvtData); 42 65 43 const Int_t nhisamples = fRawEvtData->GetNumHiGainSamples() ;44 const Int_t nlosamples = fRawEvtData->GetNumLoGainSamples() ;66 const Int_t nhisamples = fRawEvtData->GetNumHiGainSamples() ; 67 const Int_t nlosamples = fRawEvtData->GetNumLoGainSamples() ; 45 68 46 // cout << "HighSamples " << iHighSamples ;69 // cout << "HighSamples " << iHighSamples ; 47 70 48 while ( pixel.Next() ) 49 { 50 for (Int_t i=0 ; i<nhisamples ; i++ ) 51 { 52 fHistos->FillHi ( pixel.GetPixelId(), 53 pixel.GetHiGainFadcSamples()[i] ); 54 } 71 while ( pixel.Next() ) 72 { 73 const UInt_t id = pixel.GetPixelId(); 55 74 56 for (Int_t i=0 ; i<nlosamples ; i++ ) 57 { 58 fHistos->FillLo ( pixel.GetPixelId(), 59 pixel.GetLoGainFadcSamples()[i] ); 60 } 61 } 62 63 return kTRUE; 64 65 } 75 for (Int_t i=0; i<nhisamples; i++) 76 fHistos->FillHi(id, pixel.GetHiGainFadcSamples()[i]); 77 78 if (!pixel.HasLoGain()) 79 continue; 80 81 for (Int_t i=0; i<nlosamples; i++) 82 fHistos->FillLo(id, pixel.GetLoGainFadcSamples()[i]); 83 } 84 85 return kTRUE; 86 87 }
Note:
See TracChangeset
for help on using the changeset viewer.