BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnTof701Raw2Digit.h
Go to the documentation of this file.
1
#ifndef BMNTOF701RAW2DIGIT_H
2
#define BMNTOF701RAW2DIGIT_H
3
4
#include "BmnMath.h"
5
#include "BmnTDCDigit.h"
6
#include "BmnTof701Digit.h"
7
#include "
Riostream.h
"
8
#include "
TClonesArray.h
"
9
#include "
TString.h
"
10
11
#include <UniDetectorParameter.h>
12
#include <cstdlib>
13
#include <fstream>
14
#include <iostream>
15
#include <map>
16
#include <set>
17
#include <sstream>
18
#include <string>
19
#include <unordered_map>
20
#include <utility>
21
22
// Side of the strip is stored as a bool variable
23
#define TOF701_LEFT true
24
#define TOF701_RIGHT false
25
26
#define TOF701_CHANNEL_NUMBER 64
27
#define TOF701_BIN_NUMBER 1024
28
#define TOF701_MAX_TIME (24.)
// In ns
29
#define TOF701_TDC_TYPE (0xD3)
// TDC64VHL
30
#define TOF701_TDCVXS_TYPE (0xD0)
// TDC72VXS
31
// const UInt_t kTDC64VHLE = 0x53;
32
33
// A simple class to compare the TDCDigits. See .cxx code
34
struct
_Tof701TDCCompare
35
{
36
bool
operator()
(
const
BmnTDCDigit
& a,
const
BmnTDCDigit
& b)
const
;
37
};
38
39
// Map element
40
struct
BmnTof701Map2
41
{
42
Short_t
plane
;
43
Short_t
strip
;
44
Bool_t
side
;
45
BmnTof701Map2
(
Short_t
,
Short_t
,
Bool_t
);
46
BmnTof701Map2
();
47
};
48
49
// TDC parameters
50
struct
BmnTof701TDCParameters
51
{
52
double
INL
[
TOF701_CHANNEL_NUMBER
][
TOF701_BIN_NUMBER
];
// INL
53
BmnTof701Map2
ChannelMap
[
TOF701_CHANNEL_NUMBER
];
// A BmnTof701Map2 for every channel
54
double
t
[
TOF701_CHANNEL_NUMBER
];
// To store the value temporarily. See .cxx code
55
BmnTof701TDCParameters
();
// Simple constructor
56
};
57
58
class
BmnTof701Raw2Digit
59
{
60
public
:
61
BmnTof701Raw2Digit
();
// BmnTof701Raw2Digit main constructor
62
BmnTof701Raw2Digit
(
Int_t
nPeriod,
Int_t
nRun,
Int_t
verbose);
// Calls setRun(...)
63
virtual
~BmnTof701Raw2Digit
();
// Destructor
64
65
Bool_t
setRun
(
Int_t
nPerion,
Int_t
nRun);
// Load mapping and INL from the DB for run #nRun in period #nPeriod
66
Bool_t
setMapFromFile
(
TString
placementMapFile,
TString
mapFile);
// Load mapping from two files
67
void
saveMapToFile
(std::string placementMapFile, std::string mapFile);
// Save the mapping to two files
68
69
void
setINLFromFile
(std::string INLFile);
// Load INL from an INI file
70
void
saveINLToFile
(std::string INLFile,
unsigned
int
TDCSerial);
// Save INL for TDCSerial to an INI file
71
72
void
print
() {}
// Prints some info
73
void
setVerbose
(
Int_t
verbose) {
fVerbose
= verbose; }
74
75
void
FillEvent
(
TClonesArray
* data, unordered_map<UInt_t, Long64_t>* mapTS,
TClonesArray
* Tof701digit);
//
76
77
static
UShort_t
ToGlobalChannel
(
UChar_t
HptdcId,
UChar_t
channel);
78
79
private
:
80
ClassDef
(
BmnTof701Raw2Digit
, 1);
81
void
init
();
// BmnTof701Raw2Digit init function (called in BmnTof701Raw2Digit constructors)
82
Int_t
RunIndex
,
PeriodIndex
,
fVerbose
;
// To store the RunIndex and PeriodIndex and print level
83
UInt_t
fSerialForTS
;
84
std::map<std::pair<UInt_t, UChar_t>,
UInt_t
>
PlacementMap
;
// Stores the placement map
85
std::map<UInt_t, BmnTof701TDCParameters>
86
TDCMap
;
// Stores the TDC mapping (TDC's channel -> plane/strip/side) and INL
87
void
plmap_insert
(
UInt_t
Serial,
UChar_t
Slot,
UInt_t
TDCSerial);
// See .cxx code
88
89
// std::map provides a way to find TDC by Serial and Slot really fast (O(logN))
90
// BmnTof701Parameters could also be found so fast (O(logN))
91
// All other operations (extracting the INL, for example) are already fast because of the structure - O(1)
92
};
93
#endif
/* BMNTOF701RAW2DIGIT_H */
Riostream.h
Bool_t
bool Bool_t
UShort_t
unsigned short UShort_t
Int_t
int Int_t
UChar_t
unsigned char UChar_t
UInt_t
unsigned int UInt_t
Short_t
short Short_t
ClassDef
#define ClassDef(name, id)
TClonesArray.h
TString.h
BmnTDCDigit
Definition
BmnTDCDigit.h:7
BmnTof701Raw2Digit
Definition
BmnTof701Raw2Digit.h:59
BmnTof701Raw2Digit::setMapFromFile
Bool_t setMapFromFile(TString placementMapFile, TString mapFile)
Definition
BmnTof701Raw2Digit.cxx:276
BmnTof701Raw2Digit::saveINLToFile
void saveINLToFile(std::string INLFile, unsigned int TDCSerial)
BmnTof701Raw2Digit::setVerbose
void setVerbose(Int_t verbose)
Definition
BmnTof701Raw2Digit.h:73
BmnTof701Raw2Digit::TDCMap
std::map< UInt_t, BmnTof701TDCParameters > TDCMap
Definition
BmnTof701Raw2Digit.h:86
BmnTof701Raw2Digit::fVerbose
Int_t fVerbose
Definition
BmnTof701Raw2Digit.h:82
BmnTof701Raw2Digit::plmap_insert
void plmap_insert(UInt_t Serial, UChar_t Slot, UInt_t TDCSerial)
Definition
BmnTof701Raw2Digit.cxx:59
BmnTof701Raw2Digit::FillEvent
void FillEvent(TClonesArray *data, unordered_map< UInt_t, Long64_t > *mapTS, TClonesArray *Tof701digit)
Definition
BmnTof701Raw2Digit.cxx:549
BmnTof701Raw2Digit::ToGlobalChannel
static UShort_t ToGlobalChannel(UChar_t HptdcId, UChar_t channel)
Definition
BmnTof701Raw2Digit.cxx:93
BmnTof701Raw2Digit::PeriodIndex
Int_t PeriodIndex
Definition
BmnTof701Raw2Digit.h:82
BmnTof701Raw2Digit::~BmnTof701Raw2Digit
virtual ~BmnTof701Raw2Digit()
Definition
BmnTof701Raw2Digit.cxx:82
BmnTof701Raw2Digit::BmnTof701Raw2Digit
BmnTof701Raw2Digit()
Definition
BmnTof701Raw2Digit.cxx:66
BmnTof701Raw2Digit::setRun
Bool_t setRun(Int_t nPerion, Int_t nRun)
Definition
BmnTof701Raw2Digit.cxx:100
BmnTof701Raw2Digit::fSerialForTS
UInt_t fSerialForTS
Definition
BmnTof701Raw2Digit.h:83
BmnTof701Raw2Digit::init
void init()
Definition
BmnTof701Raw2Digit.cxx:86
BmnTof701Raw2Digit::PlacementMap
std::map< std::pair< UInt_t, UChar_t >, UInt_t > PlacementMap
Definition
BmnTof701Raw2Digit.h:84
BmnTof701Raw2Digit::RunIndex
Int_t RunIndex
Definition
BmnTof701Raw2Digit.h:82
BmnTof701Raw2Digit::saveMapToFile
void saveMapToFile(std::string placementMapFile, std::string mapFile)
BmnTof701Raw2Digit::print
void print()
Definition
BmnTof701Raw2Digit.h:72
BmnTof701Raw2Digit::setINLFromFile
void setINLFromFile(std::string INLFile)
TClonesArray
TString
TOF701_CHANNEL_NUMBER
#define TOF701_CHANNEL_NUMBER
Definition
BmnTof701Raw2Digit.h:26
TOF701_BIN_NUMBER
#define TOF701_BIN_NUMBER
Definition
BmnTof701Raw2Digit.h:27
BmnTof701Map2
Definition
BmnTof701Raw2Digit.h:41
BmnTof701Map2::side
Bool_t side
Definition
BmnTof701Raw2Digit.h:44
BmnTof701Map2::BmnTof701Map2
BmnTof701Map2(Short_t, Short_t, Bool_t)
Definition
BmnTof701Raw2Digit.cxx:21
BmnTof701Map2::BmnTof701Map2
BmnTof701Map2()
Definition
BmnTof701Raw2Digit.cxx:28
BmnTof701Map2::strip
Short_t strip
Definition
BmnTof701Raw2Digit.h:43
BmnTof701Map2::plane
Short_t plane
Definition
BmnTof701Raw2Digit.h:42
BmnTof701TDCParameters::ChannelMap
BmnTof701Map2 ChannelMap[TOF701_CHANNEL_NUMBER]
Definition
BmnTof701Raw2Digit.h:53
BmnTof701TDCParameters::INL
double INL[TOF701_CHANNEL_NUMBER][TOF701_BIN_NUMBER]
Definition
BmnTof701Raw2Digit.h:52
BmnTof701TDCParameters::BmnTof701TDCParameters
BmnTof701TDCParameters()
Definition
BmnTof701Raw2Digit.cxx:37
BmnTof701TDCParameters::t
double t[TOF701_CHANNEL_NUMBER]
Definition
BmnTof701Raw2Digit.h:54
_Tof701TDCCompare
Definition
BmnTof701Raw2Digit.h:35
_Tof701TDCCompare::operator()
bool operator()(const BmnTDCDigit &a, const BmnTDCDigit &b) const
Definition
BmnTof701Raw2Digit.cxx:51
decoder
BmnTof701Raw2Digit.h
Generated on
for BmnRoot by
1.17.0