BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnCscRaw2Digit.h
Go to the documentation of this file.
1#ifndef BMNCSCRAW2DIGIT_H
2#define BMNCSCRAW2DIGIT_H
3
4#include "BmnADCDigit.h"
5#include "BmnAdcProcessor.h"
6#include "BmnCSCDigit.h"
7#include "BmnEnums.h"
8#include "BmnMath.h"
9#include "TClonesArray.h"
10#include "TH1F.h"
11#include "TMath.h"
12#include "TString.h"
13#include "TTree.h"
14
15#define N_CSC_CHANNELS 2048
16
17using std::map;
18using std::string;
19using std::unordered_map;
20using std::vector;
21using namespace TMath;
22
23typedef pair<string, Short_t> LocalCSCMapKey; // {prefix, module}
24
25struct LocalCSC
26{
27 // BmnCSCStation* station;
28 map<pair<uint16_t, int8_t>, uint16_t> shift_map; // {mod, layer} -> strip shift
29 int8_t channel2layer[N_CSC_CHANNELS]; // {mod channel} -> layer
30 // StripMap channel2layer; // {mod channel} -> layer
31 // Int_t channel2layer[N_CSC_MODULES][N_CSC_CHANNELS];
32 int16_t channel2strip[N_CSC_CHANNELS]; // {mod channel} -> strip
33 // StripMap channel2strip; // {mod channel} -> strip
34 // Int_t channel2strip[N_CSC_MODULES][N_CSC_CHANNELS];
35};
36
37struct BmnCscMapping
38{
39 uint32_t serial;
40 uint16_t module;
41 int8_t layer; // X = 0 or X' = 1
42 uint16_t chan_shift;
43 int16_t channel_low;
44 int16_t channel_high;
45 uint16_t station;
46 string prefix;
47 LocalCSC* local_map;
48};
49
50typedef map<Int_t, BmnCscMapping*> InChanMapCSC; // channel ranges
51
53{
54 public:
55 BmnCscRaw2Digit(Int_t period, Int_t run, TString MapFileName, BmnSetup bmnSetup = kBMNSETUP);
57
61
62 private:
63 unique_ptr<BmnCSCStationSet> fCscStationSet;
65 unordered_map<UInt_t, InChanMapCSC> fOuterMap; // serial map
66 // map<UInt_t, > fPrefixMap; // local map prefix map
67 // vector<UInt_t> fSerials;
68 map<LocalCSCMapKey, LocalCSC> fLocalMapsMap;
70
71 void ProcessAdc(TClonesArray* csc, Bool_t doFill);
73 BmnStatus ReadLocalMap(string& FileName, int8_t* Layers, int16_t* Strips, int8_t& iLay, uint16_t& ChanShift);
75 void MatchMaps();
76 inline void MapStrip(BmnCscMapping* cscM, uint16_t iCh, uint16_t iSmpl, int8_t& layer, int16_t& strip);
77
79};
80
81#endif /* BMNCSCRAW2DIGIT_H */
bool Bool_t
int Int_t
#define ClassDef(name, id)
BmnStatus
Define status code.
Definition BmnEnums.h:93
@ kBMNSETUP
Definition BmnEnums.h:166
BmnStatus ReadLocalMap(string &FileName, int8_t *Layers, int16_t *Strips, int8_t &iLay, uint16_t &ChanShift)
BmnStatus ReadLocalMaps()
BmnStatus FillNoisyChannels()
BmnCscRaw2Digit(Int_t period, Int_t run, TString MapFileName, BmnSetup bmnSetup=kBMNSETUP)
BmnStatus ReadMapFile()
void ProcessAdc(TClonesArray *csc, Bool_t doFill)
unordered_map< UInt_t, InChanMapCSC > fOuterMap
BmnStatus FillProfiles(TClonesArray *adc)
map< LocalCSCMapKey, LocalCSC > fLocalMapsMap
BmnStatus FillEvent(TClonesArray *adc, TClonesArray *csc)
void MapStrip(BmnCscMapping *cscM, uint16_t iCh, uint16_t iSmpl, int8_t &layer, int16_t &strip)
unique_ptr< BmnCSCStationSet > fCscStationSet
pair< string, Short_t > LocalCSCMapKey
map< Int_t, BmnCscMapping * > InChanMapCSC
#define N_CSC_CHANNELS
Define enumerations used in tracking.
LocalCSC * local_map
uint16_t chan_shift
int16_t channel2strip[N_CSC_CHANNELS]
int8_t channel2layer[N_CSC_CHANNELS]
map< pair< uint16_t, int8_t >, uint16_t > shift_map