BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnMwpcRaw2Digit.cxx
Go to the documentation of this file.
1
#include "
BmnMwpcRaw2Digit.h
"
2
3
BmnMwpcRaw2Digit::BmnMwpcRaw2Digit
(
TString
mapName)
4
{
5
6
printf(
"Reading MWPC mapping file ...\n"
);
7
fMapFileName
=
TString
(getenv(
"VMCWORKDIR"
)) +
TString
(
"/input/"
) + mapName;
8
//========== read mapping file ==========//
9
fMapFile
.open((
fMapFileName
).Data());
10
if
(!
fMapFile
.is_open()) {
11
cout <<
"Error opening map-file ("
<<
fMapFileName
<<
")!"
<< endl;
12
}
13
14
TString
dummy;
15
UInt_t
ser;
16
Short_t
station;
17
Short_t
plane;
18
19
fMapFile
>> dummy >> dummy >> dummy;
20
fMapFile
>> dummy;
21
while
(
fMapFile
>> hex >> ser >> dec >> station >> plane) {
22
BmnMwpcMapping
record;
23
record.
serial
= ser;
24
record.
station
= station;
25
record.
plane
= plane;
26
fMap
.push_back(record);
27
}
28
fMapFile
.close();
29
//==================================================//
30
}
31
32
void
BmnMwpcRaw2Digit::FillEvent
(
TClonesArray
* hrb,
TClonesArray
* mwpc)
33
{
34
35
for
(
Int_t
iDig = 0; iDig < hrb->
GetEntriesFast
(); ++iDig) {
36
BmnHRBDigit
* dig = (
BmnHRBDigit
*)hrb->
At
(iDig);
37
for
(
size_t
iMap = 0; iMap <
fMap
.size(); ++iMap) {
38
BmnMwpcMapping
tM =
fMap
[iMap];
39
if
(dig->
GetSerial
() == tM.
serial
) {
40
new
((*mwpc)[mwpc->
GetEntriesFast
()])
41
BmnMwpcDigit
(tM.
station
, tM.
plane
, dig->
GetChannel
(),
42
dig->
GetSample
() * 8);
// dig->GetSample() * 8 -- convert to ns
43
}
44
}
45
}
46
}
Int_t
int Int_t
UInt_t
unsigned int UInt_t
Short_t
short Short_t
BmnHRBDigit
Definition
BmnHRBDigit.h:9
BmnHRBDigit::GetSample
UInt_t GetSample() const
Definition
BmnHRBDigit.h:29
BmnHRBDigit::GetSerial
UInt_t GetSerial() const
Definition
BmnHRBDigit.h:25
BmnHRBDigit::GetChannel
UInt_t GetChannel() const
Definition
BmnHRBDigit.h:27
BmnMwpcDigit
Definition
BmnMwpcDigit.h:16
BmnMwpcRaw2Digit::BmnMwpcRaw2Digit
BmnMwpcRaw2Digit()
Definition
BmnMwpcRaw2Digit.h:37
BmnMwpcRaw2Digit::FillEvent
void FillEvent(TClonesArray *hrb, TClonesArray *mwpc)
Definition
BmnMwpcRaw2Digit.cxx:32
BmnMwpcRaw2Digit::fMapFileName
TString fMapFileName
Definition
BmnMwpcRaw2Digit.h:30
BmnMwpcRaw2Digit::fMap
vector< BmnMwpcMapping > fMap
Definition
BmnMwpcRaw2Digit.h:33
BmnMwpcRaw2Digit::fMapFile
ifstream fMapFile
Definition
BmnMwpcRaw2Digit.h:31
TClonesArray
TObjArray::GetEntriesFast
Int_t GetEntriesFast() const
TObjArray::At
TObject * At(Int_t idx) const override
TString
BmnMwpcRaw2Digit.h
BmnMwpcMapping
Definition
BmnMwpcRaw2Digit.h:21
BmnMwpcMapping::serial
UInt_t serial
Definition
BmnMwpcRaw2Digit.h:22
BmnMwpcMapping::station
Short_t station
Definition
BmnMwpcRaw2Digit.h:23
BmnMwpcMapping::plane
Short_t plane
Definition
BmnMwpcRaw2Digit.h:24
decoder
BmnMwpcRaw2Digit.cxx
Generated on
for BmnRoot by
1.17.0