source: trunk/MagicSoft/Mars/mhist/MHFadcCam.cc@ 1487

Last change on this file since 1487 was 1303, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 3.2 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>
19! Author(s): Harald Kornmayer 1/2001
20!
21! Copyright: MAGIC Software Development, 2000-2002
22!
23!
24\* ======================================================================== */
25
26///////////////////////////////////////////////////////////////////////
27//
28// MHFadcCam
29//
30// This class contains a list of MHFadcPix.
31//
32///////////////////////////////////////////////////////////////////////
33
34#include "MHFadcCam.h"
35
36#include "MRawEvtData.h"
37#include "MRawEvtPixelIter.h"
38
39ClassImp(MHFadcCam);
40
41// --------------------------------------------------------------------------
42//
43// default constructor
44// creates an a list of histograms for all pixels and both gain channels
45//
46MHFadcCam::MHFadcCam(const char *name, const char *title)
47{
48 //
49 // set the name and title of this object
50 //
51 fName = name ? name : "MHFadcCam";
52 fTitle = title ? title : "Container for ADC spectra histograms";
53
54 //
55 // loop over all Pixels and create two histograms
56 // one for the Low and one for the High gain
57 // connect all the histogram with the container fHist
58 //
59 fArray = new TObjArray(577);
60
61 for (Int_t i=0; i<577; i++)
62 (*fArray)[i] = new MHFadcPix(i+1);
63}
64
65// --------------------------------------------------------------------------
66MHFadcCam::~MHFadcCam()
67{
68 delete fArray;
69}
70
71// --------------------------------------------------------------------------
72//
73// Our own clone function is necessary since root 3.01/06 or Mars 0.4
74// I don't know the reason
75//
76TObject *MHFadcCam::Clone(const char *) const
77{
78 MHFadcCam *cam = new MHFadcCam;
79
80 for (int i=0; i<577; i++)
81 {
82 delete (*cam->fArray)[i];
83 (*cam->fArray)[i] = (MHFadcPix*)(*fArray)[i]->Clone();
84 }
85 return cam;
86}
87
88// --------------------------------------------------------------------------
89Bool_t MHFadcCam::Fill(const MParContainer *par)
90{
91 MRawEvtData *evt = (MRawEvtData*)par;
92
93 MRawEvtPixelIter pixel(evt);
94
95 const Int_t nhisamples = evt->GetNumHiGainSamples();
96 const Int_t nlosamples = evt->GetNumLoGainSamples();
97
98 while (pixel.Next())
99 {
100 const UInt_t id = pixel.GetPixelId();
101
102 for (Int_t i=0; i<nhisamples; i++)
103 FillHi(id, pixel.GetHiGainSamples()[i]);
104
105 if (!pixel.HasLoGain())
106 continue;
107
108 for (Int_t i=0; i<nlosamples; i++)
109 FillLo(id, pixel.GetLoGainSamples()[i]);
110 }
111
112 return kTRUE;
113}
Note: See TracBrowser for help on using the repository browser.