BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnMwpcRaw2Digit.cxx
Go to the documentation of this file.
1#include "BmnMwpcRaw2Digit.h"
2
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
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 Int_t
unsigned int UInt_t
short Short_t
UInt_t GetSample() const
Definition BmnHRBDigit.h:29
UInt_t GetSerial() const
Definition BmnHRBDigit.h:25
UInt_t GetChannel() const
Definition BmnHRBDigit.h:27
void FillEvent(TClonesArray *hrb, TClonesArray *mwpc)
vector< BmnMwpcMapping > fMap
Int_t GetEntriesFast() const
TObject * At(Int_t idx) const override