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