BmnRoot
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_MODULES 2
16#define N_CSC_CHANNELS 2048
17
18using std::map;
19using std::string;
20using std::unordered_map;
21using std::vector;
22using namespace TMath;
23
24typedef pair<string, Short_t> LocalCSCMapKey; // {prefix, module}
25
27{
28 // BmnCSCStation* station;
29 map<pair<Short_t, Short_t>, Short_t> shift_map; // {mod, layer} -> strip shift
30 Int_t channel2layer[N_CSC_CHANNELS]; // {mod channel} -> layer
31 // StripMap channel2layer; // {mod channel} -> layer
32 // Int_t channel2layer[N_CSC_MODULES][N_CSC_CHANNELS];
33 Int_t channel2strip[N_CSC_CHANNELS]; // {mod channel} -> strip
34 // StripMap channel2strip; // {mod channel} -> strip
35 // Int_t channel2strip[N_CSC_MODULES][N_CSC_CHANNELS];
36};
37
39{
40 Short_t layer; // X = 0 or X' = 1
41 UInt_t serial;
42 Short_t chan_shift;
43 Short_t module;
46 Short_t station;
47 string prefix;
49};
50
51typedef map<Int_t, BmnCscMapping*> InChanMapCSC; // channel ranges
52
54{
55 public:
56 BmnCscRaw2Digit(Int_t period, Int_t run, TString MapFileName, BmnSetup bmnSetup = kBMNSETUP);
58
59 BmnStatus FillEvent(TClonesArray* adc, TClonesArray* csc);
60 BmnStatus FillProfiles(TClonesArray* adc);
62
63 private:
64 TString fMapFileName;
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;
69 Int_t fEventId;
70
71 unique_ptr<BmnCSCStationSet> fCscStationSet;
72
73 void ProcessDigit(BmnADCDigit* adcDig, BmnCscMapping* cscM, TClonesArray* csc, Bool_t doFill);
74 void ProcessAdc(TClonesArray* csc, Bool_t doFill);
75 BmnStatus ReadMapFile();
76 BmnStatus ReadLocalMap(string& FileName, Int_t* Layers, Int_t* Strips, Int_t& iLay, Int_t& ChanShift);
77 BmnStatus ReadLocalMaps();
78 void MatchMaps();
79 inline void MapStrip(BmnCscMapping* cscM,
80 UInt_t iCh,
81 Int_t iSmpl,
82 Int_t& station,
83 Int_t& module,
84 Int_t& layer,
85 Int_t& strip);
86
87 ClassDef(BmnCscRaw2Digit, 2);
88};
89
90#endif /* BMNCSCRAW2DIGIT_H */
BmnStatus
Definition BmnEnums.h:24
BmnSetup
Definition BmnEnums.h:89
@ kBMNSETUP
Definition BmnEnums.h:90
BmnStatus FillNoisyChannels()
BmnStatus FillProfiles(TClonesArray *adc)
BmnStatus FillEvent(TClonesArray *adc, TClonesArray *csc)
pair< string, Short_t > LocalCSCMapKey
map< Int_t, BmnCscMapping * > InChanMapCSC
#define N_CSC_CHANNELS
-clang-format
Short_t Int_t channel_low
LocalCSC * local_map
map< pair< Short_t, Short_t >, Short_t > shift_map
Int_t channel2layer[N_CSC_CHANNELS]
Int_t channel2strip[N_CSC_CHANNELS]