source: trunk/MagicSoft/Mars/manalysis/MMcTriggerLvl2Calc.cc@ 1778

Last change on this file since 1778 was 1776, checked in by stamerra, 23 years ago
*** empty log message ***
File size: 4.4 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): Antonio Stamerra 1/2003 <mailto:antono.stamerra@pi.infn.it>
19! Author(s): Marcos Lopez 1/2003 <mailto:marcos@gae.ucm.es>
20!
21! Copyright: MAGIC Software Development, 2000-2003
22!
23!
24\* ======================================================================== */
25
26/////////////////////////////////////////////////////////////////////////////
27// //
28// MTriggerLvl2Calc //
29// This is a task to calculate the 2nd level trigger selection //
30// parameters //
31// //
32// Input containers: //
33// MMcTriggerLvl2 //
34// //
35/////////////////////////////////////////////////////////////////////////////
36
37#include "MMcTriggerLvl2Calc.h"
38#include "MMcTriggerLvl2.h"
39
40
41#include "MParList.h"
42#include "MLog.h"
43#include "MLogManip.h"
44
45#include "MMcEvt.hxx"
46#include "MMcTrig.hxx"
47#include "MMcRunHeader.hxx"
48
49#include <TH1.h>
50
51ClassImp(MMcTriggerLvl2Calc);
52
53// --------------------------------------------------------------------------
54//
55// Default constructor
56//
57//
58MMcTriggerLvl2Calc::MMcTriggerLvl2Calc(const char *name, const char *title)
59{
60 fName = name ? name : "MMcTriggerLvl2Calc";
61 fTitle = title ? title : "Task to Fill the MMcTriggerLvl2 object";
62
63 // AddToBranchList("MMcEvt.fEnergy");
64 //AddToBranchList(Form("%s.fNumFirstLevel", "MMcTrig"));
65 //AddToBranchList(Form("%s.fPixelsFirst[73][4]", "MMcTrig"));
66
67
68 // h1 = new TH1F("h1","h1",30,0,30);
69}
70
71
72// --------------------------------------------------------------------------
73//
74// PreProcess
75//
76//
77Bool_t MMcTriggerLvl2Calc::PreProcess (MParList *pList)
78{
79 // connect the raw data with this task
80
81 fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
82 if (!fMcEvt)
83 {
84 *fLog << err << dbginf << "MMcEvt not found... exit." << endl;
85 return kFALSE;
86 }
87
88 fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig");
89 if (!fMcTrig)
90 {
91 *fLog << err << dbginf << "MMcTrig not found... exit." << endl;
92 return kFALSE;
93 }
94
95 fMMcTriggerLvl2 = (MMcTriggerLvl2*)pList->FindObject("MMcTriggerLvl2");
96 if (!fMMcTriggerLvl2)
97 {
98 *fLog << err << dbginf << "MMcTriggerLvl2 not found... exit." << endl;
99 return kFALSE;
100 }
101
102 return kTRUE;
103}
104
105
106// --------------------------------------------------------------------------
107//
108// Process
109//
110//
111Bool_t MMcTriggerLvl2Calc::Process()
112{
113 //const Float_t energy = fMcEvt->GetEnergy();
114
115 fMMcTriggerLvl2->SetLv1(fMcTrig);
116 fMMcTriggerLvl2->Calc();
117
118 //fMMcTriggerLvl2->DrawLv1();
119 //fMMcTriggerLvl2->DrawCell(fMMcTriggerLvl2->GetBiggerFiredCell() );
120 //fMMcTriggerLvl2->Print();
121
122 // h1->Fill( fMMcTriggerLvl2->GetCellNumberFired(fMMcTriggerLvl2->GetBiggerFiredCell()) );
123
124
125 return kTRUE;
126}
127
128
129// --------------------------------------------------------------------------
130//
131// PostProcess : Display the histogram
132// !to be fixed: create an histogram class!
133//
134Bool_t MMcTriggerLvl2Calc::PostProcess()
135{
136
137 // *fLog << inf << "Filling..." << endl;
138
139 // h1->Draw();
140
141 return kTRUE;
142}
143
Note: See TracBrowser for help on using the repository browser.