source: trunk/MagicSoft/Mars/mbadpixels/MBadPixelsMerge.cc@ 3246

Last change on this file since 3246 was 3068, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 3.3 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 02/2004 <mailto:tbretz@astro.uni.wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2004
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MBadPixelsMerge
28//
29// Merges in ReInit two bad pixel containers together:
30// 1) The contents of the container given in the constructor is in ReInit
31// merged into MBadPixelsCam from the parameter list (aka run-headers)
32// 2) MBadPixelsCam from the parameter list (aka run-headers) is merged
33// into the container given in the constructor. While the contents
34// to which 1) refers are still untouched.
35//
36// Input Containers:
37// MBadPixelsCam
38//
39// Output Containers:
40// MBadPixelsCam
41//
42/////////////////////////////////////////////////////////////////////////////
43#include "MBadPixelsMerge.h"
44
45#include "MLog.h"
46#include "MLogManip.h"
47
48#include "MParList.h"
49#include "MBadPixelsCam.h"
50
51ClassImp(MBadPixelsMerge);
52
53using namespace std;
54
55const TString MBadPixelsMerge::fgDefName = "MBadPixelsMerge";
56const TString MBadPixelsMerge::fgDefTitle = "Merge extra- and intra-loop pixels";
57
58// --------------------------------------------------------------------------
59//
60// Constructor. A copy of the given MBadPixelsCam is created. This copy
61// is - in ReInit - merged into the MBadPixelsCam which is found in the
62// parameter list. In addition the pointer is stored and all MBadPixelsCam
63// which are processed in ReInit are merged into this container.
64//
65MBadPixelsMerge::MBadPixelsMerge(MBadPixelsCam *bad, const char *name, const char *title)
66 : fDest(bad)
67{
68 fName = name ? name : fgDefName.Data();
69 fTitle = title ? title : fgDefTitle.Data();
70
71 fSource = new MBadPixelsCam;
72 bad->Copy(*fSource);
73}
74
75// --------------------------------------------------------------------------
76//
77// Delete the copy of the primer MBadPixelsCam
78//
79MBadPixelsMerge::~MBadPixelsMerge()
80{
81 delete fSource;
82}
83
84// --------------------------------------------------------------------------
85//
86// 1) Get MBadPixelCam from the parameter list, if it doesn't yet exist,
87// it will be created.
88// 2) Merge MBasPixelsCam into the primer container given in the constructor
89// 3) Merge the primer container given in the constructor into MBadPixelsCam
90//
91Bool_t MBadPixelsMerge::ReInit(MParList *pList)
92{
93 MBadPixelsCam *cam = (MBadPixelsCam*)pList->FindCreateObj("MBadPixelsCam");
94 if (!cam)
95 return kFALSE;
96
97 fDest->Merge(*cam);
98 cam->Merge(*fSource);
99
100 return kTRUE;
101}
Note: See TracBrowser for help on using the repository browser.