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 | #include "MHMcTriggerLvl2.h"
|
---|
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 "MGeomCam.h"
|
---|
50 |
|
---|
51 |
|
---|
52 | ClassImp(MMcTriggerLvl2Calc);
|
---|
53 |
|
---|
54 | // --------------------------------------------------------------------------
|
---|
55 | //
|
---|
56 | // Default constructor
|
---|
57 | //
|
---|
58 | //
|
---|
59 | MMcTriggerLvl2Calc::MMcTriggerLvl2Calc(const char *name, const char *title)
|
---|
60 | {
|
---|
61 | fName = name ? name : "MMcTriggerLvl2Calc";
|
---|
62 | fTitle = title ? title : "Task to Fill the MMcTriggerLvl2 object";
|
---|
63 |
|
---|
64 | }
|
---|
65 |
|
---|
66 |
|
---|
67 | // --------------------------------------------------------------------------
|
---|
68 | //
|
---|
69 | // PreProcess
|
---|
70 | //
|
---|
71 | //
|
---|
72 | Bool_t MMcTriggerLvl2Calc::PreProcess (MParList *pList)
|
---|
73 | {
|
---|
74 | // connect the raw data with this task
|
---|
75 |
|
---|
76 | fMcEvt = (MMcEvt*)pList->FindObject("MMcEvt");
|
---|
77 | if (!fMcEvt)
|
---|
78 | {
|
---|
79 | *fLog << err << dbginf << "MMcEvt not found... exit." << endl;
|
---|
80 | return kFALSE;
|
---|
81 | }
|
---|
82 |
|
---|
83 | fMcTrig = (MMcTrig*)pList->FindObject("MMcTrig");
|
---|
84 | if (!fMcTrig)
|
---|
85 | {
|
---|
86 | *fLog << err << dbginf << "MMcTrig not found... exit." << endl;
|
---|
87 | return kFALSE;
|
---|
88 | }
|
---|
89 |
|
---|
90 | fCam = (MGeomCam*)pList->FindObject("MGeomCam");
|
---|
91 | if (!fCam)
|
---|
92 | {
|
---|
93 | *fLog << dbginf << "MGeomCam not found (no geometry information available)... aborting." << endl;
|
---|
94 | return kFALSE;
|
---|
95 | }
|
---|
96 |
|
---|
97 | fMMcTriggerLvl2 = (MMcTriggerLvl2*)pList->FindObject("MMcTriggerLvl2");
|
---|
98 | if (!fMMcTriggerLvl2)
|
---|
99 | {
|
---|
100 | *fLog << err << dbginf << "MMcTriggerLvl2 not found... exit." << endl;
|
---|
101 | return kFALSE;
|
---|
102 | }
|
---|
103 |
|
---|
104 | fMHMcTriggerLvl2 = (MHMcTriggerLvl2*)pList->FindCreateObj("MHMcTriggerLvl2");
|
---|
105 | if (!fMHMcTriggerLvl2)
|
---|
106 | {
|
---|
107 | *fLog << err << dbginf << "MHMcTriggerLvl2 not found... exit." << endl;
|
---|
108 | return kFALSE;
|
---|
109 | }
|
---|
110 |
|
---|
111 | // Check if the variable fCompactNN has been correctly set;
|
---|
112 | // accepted values for fCompactNN are (up to now) 2 and 3.
|
---|
113 | if (fMMcTriggerLvl2->GetCompactNN()<2 || fMMcTriggerLvl2->GetCompactNN()>3)
|
---|
114 | {
|
---|
115 | *fLog << err << dbginf << "fCompactNN is not correctly set ("<<fMMcTriggerLvl2->GetCompactNN() <<") ... exit" <<endl;
|
---|
116 | return kFALSE;
|
---|
117 | }
|
---|
118 | else
|
---|
119 | *fLog << "Compact pixel is set with at least "<<fMMcTriggerLvl2->GetCompactNN() << " NN" <<endl;
|
---|
120 |
|
---|
121 |
|
---|
122 | return kTRUE;
|
---|
123 | }
|
---|
124 |
|
---|
125 |
|
---|
126 | // --------------------------------------------------------------------------
|
---|
127 | //
|
---|
128 | // Process
|
---|
129 | //
|
---|
130 | //
|
---|
131 | Bool_t MMcTriggerLvl2Calc::Process()
|
---|
132 | {
|
---|
133 | //const Float_t energy = fMcEvt->GetEnergy();
|
---|
134 |
|
---|
135 | fMMcTriggerLvl2->SetLv1(fMcTrig);
|
---|
136 |
|
---|
137 | fMMcTriggerLvl2->CalcCompactPixels(fCam);
|
---|
138 |
|
---|
139 | fMMcTriggerLvl2->Calc();
|
---|
140 |
|
---|
141 | //fMMcTriggerLvl2->DrawLv1();
|
---|
142 | //fMMcTriggerLvl2->DrawCell(fMMcTriggerLvl2->GetBiggerFiredCell() );
|
---|
143 | //fMMcTriggerLvl2->Print();
|
---|
144 |
|
---|
145 | return kTRUE;
|
---|
146 | }
|
---|
147 |
|
---|
148 |
|
---|
149 | // --------------------------------------------------------------------------
|
---|
150 | //
|
---|
151 | // PostProcess : Display the histogram
|
---|
152 | // !to be fixed: create an histogram class!
|
---|
153 | //
|
---|
154 | Bool_t MMcTriggerLvl2Calc::PostProcess()
|
---|
155 | {
|
---|
156 |
|
---|
157 | return kTRUE;
|
---|
158 | }
|
---|
159 |
|
---|
160 |
|
---|
161 |
|
---|
162 |
|
---|