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

Last change on this file since 1021 was 1004, checked in by tbretz, 23 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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
19! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)
20!
21! Copyright: MAGIC Software Development, 2000-2001
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
52 fName = name ? name : "MHFadcCam" ;
53 fTitle = title ? title : "Container for ADC spectra histograms" ;
54
55 //
56 // loop over all Pixels and create two histograms
57 // one for the Low and one for the High gain
58 // connect all the histogram with the container fHist
59 //
60 fArray = new TObjArray(577);
61
62 for (Int_t i=0; i<577; i++)
63 (*fArray)[i] = new MHFadcPix(i);
64}
65
66// --------------------------------------------------------------------------
67MHFadcCam::~MHFadcCam ()
68{
69 delete fArray;
70}
71
72// --------------------------------------------------------------------------
73void MHFadcCam::Fill(const MParContainer *par)
74{
75 MRawEvtData *evt = (MRawEvtData*)par;
76
77 MRawEvtPixelIter pixel(evt);
78
79 const Int_t nhisamples = evt->GetNumHiGainSamples();
80 const Int_t nlosamples = evt->GetNumLoGainSamples();
81
82 while (pixel.Next())
83 {
84 const UInt_t id = pixel.GetPixelId();
85
86 for (Int_t i=0; i<nhisamples; i++)
87 FillHi(id, pixel.GetHiGainFadcSamples()[i]);
88
89 if (!pixel.HasLoGain())
90 continue;
91
92 for (Int_t i=0; i<nlosamples; i++)
93 FillLo(id, pixel.GetLoGainFadcSamples()[i]);
94 }
95
96}
97/*void MHFadcCam::SaveHist(char *name)
98{
99 //
100 // save all histogram in this class to a root file
101 //
102
103 //
104 // FIXME: Don't open a file and write to this file!
105 // just Fill the current container (or the two histograms
106 // to an open file. The user must choose a file before.
107 //
108 TFile out( name, "recreate") ;
109
110 //
111 // loop over all pixels and write the files out
112 //
113
114 fHistLo->Write();
115 fHistHi->Write();
116}
117
118 */
Note: See TracBrowser for help on using the repository browser.