CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
12 
17 
18 #include "TMap.h"
19 #include "TArrayI.h"
20 #include "TFile.h"
21 #include "TH2.h"
22 
23 #include <functional>
24 
25 class TTree;
26 
27 struct OmtfEvent {
28 public:
29  double muonPt = 0, muonEta = 0, muonPhi = 0;
30  int muonCharge = 0;
31 
32  int omtfCharge = 0, omtfProcessor = 0, omtfScore = 0;
33  double omtfPt = 0, omtfEta = 0, omtfPhi = 0;
34  unsigned int omtfQuality = 0, omtfRefLayer = 0;
35  unsigned int omtfFiredLayers = 0;
36 
37  float omtfPtCont = 0;
38 
39  struct Hit {
40  union {
41  unsigned long rawData = 0;
42 
43  struct {
44  char layer;
45  char quality;
46  char z;
47  char valid;
48  short eta;
49  short phiDist;
50  };
51  };
52 
53  ~Hit() {}
54  };
55 
56  std::vector<unsigned long> hits;
57 };
58 
60 public:
62 
63  ~DataROOTDumper2() override;
64 
65  void observeEventEnd(const edm::Event& iEvent,
66  std::unique_ptr<l1t::RegionalMuonCandBxCollection>& finalCandidates) override;
67 
68  void endJob() override;
69 
70 private:
71  void initializeTTree(std::string rootFileName);
72  void saveTTree();
73 
74  TFile* rootFile = nullptr;
75  TTree* rootTree = nullptr;
76 
78 
79  unsigned int evntCnt = 0;
80 
81  TH1I* ptGenPos = nullptr;
82  TH1I* ptGenNeg = nullptr;
83 
84  std::vector<TH2*> hitVsPt;
85 };
86 
87 #endif /* L1T_OmtfP1_TOOLS_DATAROOTDUMPER2_H_ */
void endJob() override
double omtfPt
unsigned int omtfFiredLayers
double muonPt
float omtfPtCont
OmtfEvent omtfEvent
double muonPhi
double omtfPhi
unsigned int evntCnt
int iEvent
Definition: GenABIO.cc:224
double omtfEta
unsigned int omtfQuality
void initializeTTree(std::string rootFileName)
unsigned long rawData
std::vector< TH2 * > hitVsPt
DataROOTDumper2(const edm::ParameterSet &edmCfg, const OMTFConfiguration *omtfConfig, std::string rootFileName)
std::vector< unsigned long > hits
double muonEta
unsigned int omtfRefLayer
const OMTFConfiguration * omtfConfig
void observeEventEnd(const edm::Event &iEvent, std::unique_ptr< l1t::RegionalMuonCandBxCollection > &finalCandidates) override
~DataROOTDumper2() override