PandaRoot
PndEmcAnalysis.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 //---------------------------------------------------------------------- // File and Version Information:
14 // $Id: Exp $
15 //
16 // Description:
17 // Class PndEmcAnalysis. Module to take the hit list for the
18 // calorimeter and make ADC waveforms from them.
19 //
20 // Software developed for the BaBar Detector at the SLAC B-Factory.
21 // Adapted for the PANDA experiment at GSI
22 //
23 // Author List:
24 // Phil Strother Original Author
25 // Dima Melnichuk - adaption for PANDA
26 //
27 // Copyright Information:
28 // Copyright (C) 1996 Imperial College
29 //
30 //----------------------------------------------------------------------
31 //#pragma once
32 #ifndef PndEmcAnalysis_H
33 #define PndEmcAnalysis_H
34 
35 #include "FairTask.h"
37 #include "FairTSBufferFunctional.h"
38 #include <string>
39 #include <map>
40 #include <vector>
41 #include <set>
42 #include "TTree.h"
43 #include "TFile.h"
44 #include "TVectorD.h"
45 #include "TLorentzVector.h"
46 #include "PndEmcDigiCalibrator.h"
47 
48 class PndEmcHit;
50 class PndEmcWaveform;
51 
52 class TClonesArray;
53 class PndEmcDigiPar;
54 class PndEmcRecoPar;
55 class PndEmcFpgaPar;
56 class PndEmcAbsPSA;
58 
59 using namespace std;
60 
61 class PndEmcAnalysis : public FairTask {
62 
63  public:
64  // Constructors
65 
66  PndEmcAnalysis(Int_t verbose = 0, Bool_t storeRootFile = kTRUE);
67 
68  // Destructor
69 
70  virtual ~PndEmcAnalysis();
71 
73  virtual InitStatus Init();
74 
76  virtual void Exec(Option_t *opt);
77 
78  void SetOutput(TString name) { fileName = name; }
79 
80  void RunTimeBased() { fTimeOrderedDigi = kTRUE; }
81 
82  virtual void FinishTask();
83 
84  Bool_t fSaveWave;
85  Bool_t fSaveDigi;
86  Bool_t fSaveBump;
87  Bool_t fSaveTask;
88  Bool_t fSaveHits;
89  Bool_t fSaveMcTruth;
90  Bool_t fSaveReco;
93  Bool_t fSaveJpsiTo3g;
94 
95  private:
96  void SetParContainers();
98  TClonesArray *fEmcHitsArray;
99  TClonesArray *fWaveformArray;
100  TClonesArray *fDigiArray;
101  TClonesArray *fSharedDigiArray;
102  TClonesArray *fClusterArray;
103  TClonesArray *fBumpArray;
104  TClonesArray *fMcTrackArray;
105  TClonesArray *fEvtHeaderArray;
106  TClonesArray *fChargedCand;
107  TClonesArray *fNeutralCand;
108 
109  Int_t fVerbose;
110  Bool_t fStoreRooTFile;
111 
112  PndEmcAnalysis(const PndEmcAnalysis &L);
113  PndEmcAnalysis &operator=(const PndEmcAnalysis &) { return *this; };
114 
115  ClassDef(PndEmcAnalysis, 1);
116 
117  BinaryFunctor *fFunctor;
118 
119  // for time-based analysis
120  Bool_t fTimeOrderedDigi;
121  // event no, how many waveforms in this event, how many pileup waveforms
122  std::map<Int_t, std::pair<Int_t, Int_t>> evtMap;
123  std::set<Int_t> pevtset; // pileup event numbers
124  std::set<Int_t> evtset; // total event numbers
125 
126  TString fileName;
127  TFile *fRootFile;
128  TTree *tHit; // hit information
129  TTree *tDigi; // digi information
130  TTree *tWave; // wave information
131  TTree *tBump; // bump information
132  TTree *tTask; // task summary
133  TTree *tEvtPileup; // pileup at event level
134  TTree *tTaskPileup; // pileup at task level
135  TTree *tMcTruth; // MC Truth
136  TTree *tRec; // reconstruction
137  // for Tree tHit
138  Double_t fHitTime;
139  Double_t fHitEnergy;
140  Double_t fTheta;
141  Double_t fPhi;
142  // variables for Tree tWave
143  Double_t fEvtTime;
144  Int_t fModule;
145  Int_t fHitIndex;
146  Double_t fWaveTime;
147  Double_t fWavePeak;
148  Int_t fWaveLen;
149  Int_t fWaveIdx;
150  Int_t fEventNo;
151  Double_t fBaseline;
152  Int_t fXcor;
153  Int_t fYcor;
154  Int_t fPileupCount;
155  // for Tree tDigi;
156  Double_t fDigiTime;
157  // Double_t fEvtTime;
158  // Int_t fModule;
159  // Double_t fWaveTime;
160  // Double_t fHitEnergy;
161  Double_t fDigiEnergy;
162  Double_t fDistance;
163  // Int_t fWaveIdx;
164  // Int_t fEventNo;
165  TVector3 fPosition;
166  TVector3 fSeedPosition;
167  // for Tree tBump;
168  Double_t fEnergy1C;
169  Double_t fEnergy2C;
170  // Double_t fEvtTime;
171  // Int_t fEventNo ,"EventNO/I");
172  // Int_t fModule ,"Module/I");
173  Double_t fBumpTime1;
174  Double_t fBumpTime2;
175  Double_t fBumpTime3;
176  Double_t fSeedTime;
177  Double_t fBumpEnergy;
178  // TVector3 fPosition;
179  // for Tree tTask
180  Int_t fNumDigi;
181  Int_t fNumBump;
182  Int_t fClusterIdx;
183  Int_t fNumOfSeed;
184  Int_t fDigiMapSize;
185  Int_t fNumOfMatch;
186  Int_t fNumOfDismatch;
187  // for tree task
188  Double_t totDigiEnergy;
189  Double_t totSharedDigiEnergy;
190  // Int_t fEventNo;
191  Int_t fNumOfHits;
192  Int_t fNumWaveform;
193  // Int_t fNumDigi;
194  Int_t fNumSharedDigi;
195  Int_t fNumCluster;
196  // Int_t fNumBump;
197  Int_t fNumMcTrack;
198 
199  // for Tree tTaskPileup
200  Int_t fTotWave;
201  Int_t fPileupWave;
202  Int_t totNumOfWave;
203  Int_t totNumOfSubWave;
204  Int_t totNumOfDigi;
205  Int_t totNumOfBump;
206  Int_t totNumOfSharedDigi;
207  Int_t totNumOfEvents;
208  Int_t totNumOfPileupEvents;
209 
210  // for Tree tRec
211  const static Int_t NElement = 30;
212  Double_t fp4[4 * NElement];
213  Double_t fMcp4[4 * NElement];
214  Double_t fPositionV[3 * NElement];
215  Double_t fEnergy[NElement];
216  Double_t fEnergyC1[NElement];
217  Double_t fEnergyC2[NElement];
218  Double_t fZ201[NElement];
219  Double_t fZ531[NElement];
220  Double_t fLat1[NElement];
221  Int_t fModule1[NElement];
222  Int_t fPDGCode[NElement];
223  Double_t fTheta1[NElement];
224  Double_t fPhi1[NElement];
225  Double_t fRestEnergy1;
226  Double_t fRestEnergy2;
227  Double_t fRestEnergy3;
228  Int_t fNumGT;
229  // for Tree tMcTruth
230  Int_t fDet1[NElement];
231  Int_t fHitEmc1[NElement];
232  Int_t fHitEmc2[NElement];
233  Int_t fNPointV[NElement];
234 
235  // pid data
236 
237  Int_t fchar[NElement];
238  // Double_t fp4[NElement] ;
239  Double_t fpos[NElement];
240  Double_t fmom[NElement];
241  Int_t fmcidx[NElement];
242  Double_t frawe[NElement];
243  Double_t fcale[NElement];
244  Int_t fndigi[NElement];
245  Int_t fmod[NElement];
246  Int_t fcluIdx[NElement];
247  Double_t fe25[NElement];
248  Double_t fe9[NElement];
249  Int_t fnbump[NElement];
250 
251  TTree *tCharged; // charged track
252  TTree *tNeutral; // photons
253 
254  TTree *tAna3g; // specified analysis
255  // jpsi-->3 gamma
256  Int_t fNumberOfGoodPhoton; //
257  Double_t fExternalEnergy; // other energy excluding 3 photon
258 
259  Double_t f4p1[4]; // photon 1
260  Double_t fMc4p1[4]; // photon 1, MC truth
261  Double_t fpos1[3]; // position
262  Double_t fmom1; // momentum amplitude
263  Double_t fenergy1;
264  Double_t femcraw1;
265  Int_t fndigi1; // fired crystals by this photon
266  Int_t fmod1;
267  Int_t fMcTrack1;
268  Double_t fe251;
269  Double_t flat1;
270  Double_t fz201;
271  Double_t fz531;
272 
273  Double_t f4p2[4]; // photon 2
274  Double_t fMc4p2[4]; // photon 2, MC truth
275  Double_t fpos2[3]; // position
276  Double_t fmom2; // momentum amplitude
277  Double_t fenergy2;
278  Double_t femcraw2;
279  Int_t fndigi2; // fired crystals by this photon
280  Int_t fmod2;
281  Int_t fMcTrack2;
282  Double_t fe252;
283  Double_t flat2;
284  Double_t fz202;
285  Double_t fz532;
286 
287  Double_t f4p3[4]; // photon 3
288  Double_t fMc4p3[4]; // photon 3, MC truth
289  Double_t fpos3[3]; // position
290  Double_t fmom3; // momentum amplitude
291  Double_t fenergy3;
292  Double_t femcraw3;
293  Int_t fndigi3; // fired crystals by this photon
294  Int_t fmod3;
295  Int_t fMcTrack3;
296  Double_t fe253;
297  Double_t flat3;
298  Double_t fz203;
299  Double_t fz533;
300 
301  PndEmcDigiCalibrator digiCalibrator;
302 };
303 
304 #endif
Bool_t fSavePidNeutral
STL namespace.
stores crystal index coordinates (x,y) or (theta,phi)
Bool_t fSaveJpsiTo3g
parameter set of Emc digitisation
Definition: PndEmcDigiPar.h:24
represents a simulated waveform in an emc crystal
Baseclass for pulseshapeanalysis ( featureextraction )
Definition: PndEmcAbsPSA.h:33
represents the deposited energy of one emc crystal from simulation
Definition: PndEmcHit.h:40
pulseshape interface
Bool_t fSavePidCharged
Parameter set for Emc Reco.
Definition: PndEmcRecoPar.h:25
void SetOutput(TString name)