PandaRoot
PndEmcWaveformToDigi.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 PndEmcWaveformToDigi. Module to take the ADC waveforms and produces digi.
18 //
19 // Software developed for the BaBar Detector at the SLAC B-Factory.
20 // Adapted for the PANDA experiment at GSI
21 //
22 // Author List:
23 // Phil Strother Original Author
24 // Dima Melnichuk - adaption for PANDA
25 //
26 // Copyright Information:
27 // Copyright (C) 1996 Imperial College
28 //
29 //----------------------------------------------------------------------
30 //#pragma once
31 #ifndef PndEmcWaveformToDigi_H
32 #define PndEmcWaveformToDigi_H
33 
34 #include <PndPersistencyTask.h>
36 #include <string>
37 #include "FairTSBufferFunctional.h"
38 #include <map>
39 #include <list>
40 #include <set>
41 #include "TTree.h"
42 #include "TFile.h"
43 #include "TVectorD.h"
44 
45 class PndEmcHit;
47 class PndEmcWaveform;
48 
49 class TClonesArray;
50 class PndEmcDigiPar;
51 class PndEmcRecoPar;
52 class PndEmcFpgaPar;
53 class PndEmcAbsPSA;
56 
57 
63 {
64 public:
65  // Constructors
66  PndEmcWaveformToDigi(Int_t verbose=0, Bool_t storedigis=kTRUE);
67  // Destructor
68  virtual ~PndEmcWaveformToDigi();
69 
70  virtual InitStatus Init();
71  virtual void Exec(Option_t* opt);
72 
73  void SetStorageOfData(Bool_t val); // Method to specify whether digis are stored or not.
74  void RunTimeBased(){fTimeOrderedDigi = kTRUE;}
75 
76  void UseDigitizationVersion2() { fDigitizationVersion2 = kTRUE;}
77  void SetFakeOnline(bool d=true){fFakeOnline=d;};
78 
85  virtual void SetPSAAlgorithm(PndEmcAbsPSA *psa){fpsaAlgorithm=psa;}
92  virtual void SetPSAAlgorithmFWD(PndEmcAbsPSA *psa){fpsaAlgorithm_fwd=psa;}
100  virtual void SetPSAAlgorithmPMT(PndEmcAbsPSA *psa){fpsaAlgorithm_pmt=psa;}
108  virtual void SetCrystalCalibrator(PndEmcAbsCrystalCalibrator *Cal){fCalibrator=Cal;}
109 
110  virtual void FinishTask();
111 
112 protected:
114  virtual void SetParContainers();
115 private:
116  // don't allow copying (-Weffc++)
117  PndEmcWaveformToDigi(const PndEmcWaveformToDigi&); // no implementation
118  PndEmcWaveformToDigi& operator= (const PndEmcWaveformToDigi&); // no implementation
119 
120  //Double_t GetEventTimebyDigiTime(Double_t digiT, Double_t digiE, Int_t detID, bool PrintOut=false) const;
121  //Int_t GetIdxByEnergy(Double_t energy) const;
122 
123 private:
125  TClonesArray* fWaveformArray;
126  //TClonesArray* fMcTrackArray;
127  TClonesArray* fEvtHeaderArray;
128 
130  TClonesArray* fDigiArray;
131 
132  Double_t fSampleRate;
133  Double_t fSampleRate_PMT;
134  Double_t fSampleRate_FWD;
135  Double_t fEnergyDigiThreshold;
136  Double_t fASIC_Shaping_int_time; //s
137  Double_t fPMT_Shaping_int_time; //s
138  Double_t fPMT_Shaping_diff_time; //s
139  Double_t fCrystal_time_constant; //s
140  Double_t fShashlyk_time_constant; //s
141  Int_t fNumber_of_samples_in_waveform;
142  Int_t fNumber_of_samples_in_waveform_pmt;
143  Int_t fNumber_of_samples_in_waveform_fwd;
144  Double_t fFWD_Shaping_int_time;
145  Double_t fFWD_time_constant;
146 
147  //std::string fDigiPosMethod;// "surface" or "depth"
148  TString fDigiPosMethod;
149  Double_t fEmcDigiRescaleFactor;
150  Double_t fEmcDigiPositionDepthPWO;
151  Double_t fEmcDigiPositionDepthShashlyk;
152 
153  PndEmcAbsPulseshape* fPulseshape;
154  PndEmcAbsPulseshape* fPulseshape_pmt;
155  PndEmcAbsPulseshape* fPulseshape_fwd;
156  PndEmcAbsPSA *fpsaAlgorithm;
157  PndEmcAbsPSA *fpsaAlgorithm_pmt;
158  PndEmcAbsPSA *fpsaAlgorithm_fwd;
159 
160  PndEmcAbsCrystalCalibrator *fCalibrator;
161 
162  PndEmcDigiPar* fDigiPar;
163  PndEmcRecoPar* fRecoPar;
164  PndEmcFpgaPar* fFpgaPar;
166  //PndEmcDigiWriteoutBuffer* fDataBuffer;
167 
169  Int_t fVerbose;
170  Bool_t fStoreDigis;
171  Bool_t fTimeOrderedDigi;
172 
173  Double_t fWfNormalisation; // Waveform normalisation constant
174  Double_t fWfNormalisation_fwd; // Waveform normalisation constant
175  Double_t fWfNormalisation_pmt;
176 
177  BinaryFunctor* fFunctor;
178 
179  //coefficients
180  TVectorD CoeffMod3;
181  TVectorD CoeffMod5;
182  TVectorD CoeffModo;
183 
184  Int_t fEventNo;
185  Double_t fTimeWindow;
186  Double_t fTimeShift;
187  //buffer for undetermined event
188 
189  Int_t totDigisAboveThreshold;
190  Int_t totHits ;
191  Int_t totExpHits ;
192  Int_t totNumOfWave ;
193 
194  Bool_t fDigitizationVersion2;
195  //
196  bool fFakeOnline; // Flag to add ~factor2 of worse resolution .
197  Float_t SmearFakeOnline(Float_t energy);
198 
199  ClassDef(PndEmcWaveformToDigi,1);
200 };
201 
202 #endif
203 
204 
205 
206 
207 
virtual void SetPSAAlgorithmFWD(PndEmcAbsPSA *psa)
Set PSA Algorithm to be used for Forward Endcap.
void SetFakeOnline(bool d=true)
virtual void SetPSAAlgorithmPMT(PndEmcAbsPSA *psa)
Set PSA Algorithm to be used for Forward Shashlik.
stores crystal index coordinates (x,y) or (theta,phi)
virtual void FinishTask()
PndEmcWaveformToDigi(Int_t verbose=0, Bool_t storedigis=kTRUE)
parameter set of Emc digitisation
Definition: PndEmcDigiPar.h:24
virtual void SetCrystalCalibrator(PndEmcAbsCrystalCalibrator *Cal)
Set The Crystal Calibrator to use.
virtual void SetPSAAlgorithm(PndEmcAbsPSA *psa)
Set PSA Algorithm to be used for Barrel and Backward Endcap.
void SetStorageOfData(Bool_t val)
virtual void Exec(Option_t *opt)
virtual void SetParContainers()
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
Takes list of PndEmcWaveform and creates PndEmcDigi.
virtual InitStatus Init()
Abstract interface for a emc calibrator.
Parameter set for Emc Reco.
Definition: PndEmcRecoPar.h:25
virtual ~PndEmcWaveformToDigi()