source: trunk/MagicSoft/Mars/mdatacheck/MFillAdcSpect.cc@ 694

Last change on this file since 694 was 666, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 1.5 KB
Line 
1#include "MFillAdcSpect.h"
2
3#include "MLog.h"
4#include "MLogManip.h"
5#include "MParList.h"
6#include "MHistosAdc.h"
7#include "MRawEvtData.h"
8#include "MRawEvtPixelIter.h"
9
10ClassImp(MFillAdcSpect)
11
12 MFillAdcSpect::MFillAdcSpect (const char *name, const char *title) : fRawEvtData(NULL)
13{
14 *fName = name ? name : "MFillAdcSpect";
15 *fTitle = title ? title : "Task to fill the adc spectra with raw data";
16}
17
18Bool_t MFillAdcSpect::PreProcess (MParList *pList)
19{
20 // connect the raw data with this task
21
22 fHistos = (MHistosAdc*)pList->FindCreateObj("MHistosAdc");
23 if (!fHistos)
24 return kFALSE;
25
26 fRawEvtData = (MRawEvtData*)pList->FindCreateObj("MRawEvtData");
27 if (!fRawEvtData)
28 {
29 *fLog << dbginf << " Error: MRawEvtData not found... exit." << endl;
30 return kFALSE ;
31 }
32
33 return kTRUE ;
34
35}
36
37Bool_t MFillAdcSpect::Process()
38{
39 // loop over the pixels and fill the values in the histograms
40
41 MRawEvtPixelIter pixel(fRawEvtData);
42
43 const Int_t nhisamples = fRawEvtData->GetNumHiGainSamples() ;
44 const Int_t nlosamples = fRawEvtData->GetNumLoGainSamples() ;
45
46 // cout << "HighSamples " << iHighSamples ;
47
48 while ( pixel.Next() )
49 {
50 for (Int_t i=0 ; i<nhisamples ; i++ )
51 {
52 fHistos->FillAdcHistHi ( pixel.GetPixelId(),
53 pixel.GetHiGainFadcSamples()[i] );
54 }
55
56 for (Int_t i=0 ; i<nlosamples ; i++ )
57 {
58 fHistos->FillAdcHistLo ( pixel.GetPixelId(),
59 pixel.GetLoGainFadcSamples()[i] );
60 }
61 }
62
63 return kTRUE;
64
65}
Note: See TracBrowser for help on using the repository browser.