CMS 3D CMS Logo

DataROOTDumper2.h
Go to the documentation of this file.
1 /*
2  * DataROOTDumper2.h
3  *
4  * Created on: Dec 11, 2019
5  * Author: kbunkow
6  */
7 
8 #ifndef L1T_OmtfP1_TOOLS_DATAROOTDUMPER2_H_
9 #define L1T_OmtfP1_TOOLS_DATAROOTDUMPER2_H_
10 
13 
18 
19 #include "TMap.h"
20 #include "TArrayI.h"
21 #include "TFile.h"
22 #include "TH2.h"
23 
24 #include <functional>
25 
26 class TTree;
27 
28 struct OmtfEvent {
29 public:
30  unsigned int eventNum = 0;
31 
32  //muonPt = 0 means that no muon was matched to the candidate
33  short muonEvent = -1;
34  float muonPt = 0, muonEta = 0, muonPhi = 0, muonPropEta = 0, muonPropPhi = 0;
35  char muonCharge = 0;
36  float muonDxy = 0;
37  float muonRho = 0;
38 
39  float omtfPt = 0, omtfEta = 0, omtfPhi = 0, omtfUPt = 0;
40  char omtfCharge = 0;
41  char omtfProcessor = 0;
42  short omtfScore = 0;
43 
44  short omtfHwEta = 0;
45 
46  char omtfQuality = 0;
47  char omtfRefLayer = 0;
48  char omtfRefHitNum = 0;
49 
50  unsigned int omtfFiredLayers = 0;
51 
52  bool killed = false;
53 
54  float deltaPhi = 0, deltaEta = 0;
55 
56  //float omtfPtCont = 0;
57 
58  struct Hit {
59  union {
60  unsigned long rawData = 0;
61 
62  struct {
63  char layer;
64  char quality;
65  char z;
66  char valid;
67  short eta;
68  short phiDist;
69  };
70  };
71 
72  ~Hit() {}
73  };
74 
75  std::vector<unsigned long> hits;
76 };
77 
79 public:
83 
84  ~DataROOTDumper2() override;
85 
86  void observeProcesorEmulation(unsigned int iProcessor,
87  l1t::tftype mtfType,
88  const std::shared_ptr<OMTFinput>&,
89  const AlgoMuons& algoCandidates,
90  const AlgoMuons& gbCandidates,
91  const std::vector<l1t::RegionalMuonCand>& candMuons) override;
92 
93  void observeEventEnd(const edm::Event& iEvent,
94  std::unique_ptr<l1t::RegionalMuonCandBxCollection>& finalCandidates) override;
95 
96  void endJob() override;
97 
98 private:
99  void initializeTTree();
100 
102 
103  TTree* rootTree = nullptr;
104 
106 
107  unsigned int evntCnt = 0;
108 
109  TH1I* ptGenPos = nullptr;
110  TH1I* ptGenNeg = nullptr;
111 
112  std::vector<TH2*> hitVsPt;
113 
114  bool dumpKilledOmtfCands = false;
115 
116  bool usePropagation = false;
117 };
118 
119 #endif /* L1T_OmtfP1_TOOLS_DATAROOTDUMPER2_H_ */
short muonEvent
float muonPropEta
void endJob() override
CandidateSimMuonMatcher * candidateSimMuonMatcher
char omtfRefHitNum
char omtfQuality
unsigned int omtfFiredLayers
float deltaPhi
DataROOTDumper2(const edm::ParameterSet &edmCfg, const OMTFConfiguration *omtfConfig, CandidateSimMuonMatcher *candidateSimMuonMatcher)
unsigned int evntCnt
int iEvent
Definition: GenABIO.cc:224
unsigned int eventNum
float muonPropPhi
short omtfScore
unsigned long rawData
float deltaEta
char omtfRefLayer
std::vector< TH2 * > hitVsPt
void observeProcesorEmulation(unsigned int iProcessor, l1t::tftype mtfType, const std::shared_ptr< OMTFinput > &, const AlgoMuons &algoCandidates, const AlgoMuons &gbCandidates, const std::vector< l1t::RegionalMuonCand > &candMuons) override
std::vector< AlgoMuonPtr > AlgoMuons
Definition: AlgoMuon.h:176
std::vector< unsigned long > hits
short omtfHwEta
char omtfProcessor
const OMTFConfiguration * omtfConfig
void observeEventEnd(const edm::Event &iEvent, std::unique_ptr< l1t::RegionalMuonCandBxCollection > &finalCandidates) override
~DataROOTDumper2() override