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