REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestRawTDSToSignalProcess.h
1 /*************************************************************************
2  * This file is part of the REST software framework. *
3  * *
4  * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5  * For more information see http://gifna.unizar.es/trex *
6  * *
7  * REST is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * REST is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have a copy of the GNU General Public License along with *
18  * REST in $REST_PATH/LICENSE. *
19  * If not, see http://www.gnu.org/licenses/. *
20  * For the list of contributors see $REST_PATH/CREDITS. *
21  *************************************************************************/
22 
23 #ifndef RestCore_TRestRawTDSToSignalProcess
24 #define RestCore_TRestRawTDSToSignalProcess
25 
26 #include "TRestRawToSignalProcess.h"
27 
28 // Struct that holds block header TDS data format
29 struct ANABlockHead {
30  uint64_t TimeStamp;
31  uint64_t RTTicks;
32  uint64_t LTTicks;
33  uint64_t SRate;
34  uint16_t PSize;
35  uint16_t Pretrigger;
36  uint16_t mVdiv[4];
37  uint16_t NEvents;
38  uint16_t NHits;
39  uint8_t NegPolarity[4];
40 };
41 
42 // Struct that holds event header TDS data format
43 struct ANAEventHead {
44  uint64_t clockTicksLT;
45  uint64_t clockTicksRT;
46 };
47 
50  protected:
51  // Time stamp for block header
52  double tNow = 0;
53 
54  // Number of samples per block
55  int nSamples;
56 
57  // Number of acquired channels
58  int nChannels;
59 
60  // Number of points per horizontal axis
61  int pulseDepth;
62 
63  // Event counter
64  int nEvents = 0;
65 
66  // Check if pulses are negative or positive
67  bool negPolarity[4];
68 
69  // Sampling rate in MHz
70  double fRate = 0;
71 
72  // Vertical scale in mV/Division
73  double fScale[4] = {0, 0, 0, 0};
74 
75  public:
76  void Initialize() override;
77  void InitProcess() override;
78  TRestEvent* ProcessEvent(TRestEvent* inputEvent) override;
79  const char* GetProcessName() const override { return "TDSToSignal"; }
80  TRestMetadata* GetProcessMetadata() const { return nullptr; }
81 
82  Bool_t isExternal() { return true; }
83 
86 
87  ClassDefOverride(TRestRawTDSToSignalProcess, 1);
88 };
89 #endif
A base class for any REST event.
Definition: TRestEvent.h:38
A base class for any REST metadata class.
Definition: TRestMetadata.h:74
A process to read binary files produced with TDS (Tektronix oscilloscope) DAQ.
TRestRawTDSToSignalProcess()
Default constructor.
void Initialize() override
Function to initialize input/output event members and define the section name, calls parent TRestRawT...
~TRestRawTDSToSignalProcess()
Default destructor.
TRestEvent * ProcessEvent(TRestEvent *inputEvent) override
The main processing event function.
void InitProcess() override
Process initialization. Read first header block and initializes several variables such as: nSamples,...
A base class for any process reading a binary external file as input to REST.