PandaRoot
PndEmcFWEndcapDigi.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 //#pragma once
14 
15 #ifndef PNDEMCFWENDCAPDIGI_H_
16 #define PNDEMCFWENDCAPDIGI_H_
17 
18 #include <PndPersistencyTask.h>
19 #include "PndEmcHighLowPSA.h"
23 
24 #include "FairTask.h"
25 
26 #include "TRandom.h"
27 
28 #include <string>
29 #include <fstream>
30 //#include <vector>
31 
32 class PndEmcHit;
34 class PndEmcWaveform;
35 
36 class TClonesArray;
38 class PndEmcRecoPar;
39 class PndEmcGeoPar;
40 class PndEmcAbsPSA;
43 
53 {
54 public:
55  // Constructors
56  PndEmcFWEndcapDigi(Int_t verbose=0, Bool_t storedigis=kTRUE);
57  // Destructor
58  virtual ~PndEmcFWEndcapDigi();
59 
60  virtual InitStatus Init();
61  virtual void Exec(Option_t* opt);
62 
63  void SetStorageOfData(Bool_t val); // Method to specify whether digis are stored or not.
64  void RunTimeBased(){fTimeOrderedDigi = kTRUE;};
65 
66  void SetPSAAlgorithms(PndEmcAbsPSA* highgain, PndEmcAbsPSA* lowgain) {
67  fHighgainPSA = dynamic_cast<PndEmcPSAFPGASampleAnalyser*>(highgain);
68  fLowgainPSA = dynamic_cast<PndEmcPSAFPGASampleAnalyser*>(lowgain);
69 
70  if (fHighgainPSA == nullptr || fLowgainPSA == nullptr) {
71  std::cerr << "-E- in PndEmcFWEndcapDigi::SetPSAAlgorithms: PSA must be a PndEmcPSAFPGASampleAnalyser. External PSA setting has no effect" << std::endl;
72  }
73  }
74 
76  fCalibrator = dynamic_cast<PndEmcSimCrystalCalibrator*>(Cal);
77  if (fCalibrator == nullptr) {
78  std::cerr << "-E- in PndEmcFWEndcapDigi::SetCrystalCalibrator: Calibrator must be a PndEmcSimCrystalCalibrator. External Calibrator setting has no effect" << std::endl;
79  }
80  };
81 protected:
83  virtual void SetParContainers();
84 private:
85  // don't allow copying (-Weffc++)
86  PndEmcFWEndcapDigi(const PndEmcFWEndcapDigi&); // no implementation
87  PndEmcFWEndcapDigi& operator= (const PndEmcFWEndcapDigi&); // no implementation
88 
89 private:
90 
92  TClonesArray* fWaveformArray;
93 
95  TClonesArray* fDigiArray;
96  TClonesArray* fDigiArray2;
97  TClonesArray* fHitArray;
98 
99  Double_t fEnergyDigiThreshold;
100  TString fDigiPosMethod; //"surface" or "depth"
101  Double_t fEmcDigiRescaleFactor;
102  Double_t fEmcDigiPositionDepthPWO;
103  Double_t fEmcDigiPositionDepthShashlyk;
104 
105  PndEmcPSAFPGASampleAnalyser* fHighgainPSA;
106  PndEmcPSAFPGASampleAnalyser* fLowgainPSA;
107  PndEmcHighLowPSA fHighLowPSA;
108 
109  PndEmcSimCrystalCalibrator *fCalibrator;
110 
111  PndEmcFWEndcapDigiPar* fDigiPar;
112  PndEmcRecoPar* fRecoPar;
113  PndEmcGeoPar* fGeoPar;
114 
116  Int_t fVerbose;
117 
118  Int_t fNrOfEvents;
119  Int_t evtCounter;
120  Int_t nFwDigiProg;
121 
122  Bool_t fStoreDigis;
123  Bool_t fTimeOrderedDigi;
124 
125  std::ofstream Energy;
126 
127  Double_t GetEnergyDepTimeResolution(Double_t);
128 
129  ClassDef(PndEmcFWEndcapDigi,1);
130 };
131 
132 #endif
void SetPSAAlgorithms(PndEmcAbsPSA *highgain, PndEmcAbsPSA *lowgain)
virtual ~PndEmcFWEndcapDigi()
virtual InitStatus Init()
virtual void Exec(Option_t *opt)
Taks to create waveforms from hits.
Wrapping class to manage two independent PSAs for high, resp. low gain.
stores crystal index coordinates (x,y) or (theta,phi)
PndEmcFWEndcapDigi(Int_t verbose=0, Bool_t storedigis=kTRUE)
Task to create digis from waveforms.
parameter set for the FWEndcap variant of waveform simulation
virtual void SetCrystalCalibrator(PndEmcAbsCrystalCalibrator *Cal)
Class to simulate a Calibration.
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
Abstract interface for a emc calibrator.
virtual void SetParContainers()
Parameter set for Emc Reco.
Definition: PndEmcRecoPar.h:25
void SetStorageOfData(Bool_t val)