CMS 3D CMS Logo

SiPixelPhase1Analyzer.h
Go to the documentation of this file.
1 #ifndef DQM_TRACKERREMAPPER_SIPIXELPHASE1ANALYZER_H
2 #define DQM_TRACKERREMAPPER_SIPIXELPHASE1ANALYZER_H
3 
11 //
12 // Original Author: Pawel Jurgielewicz
13 // Created: Tue, 21 Feb 2017 09:42:19 GMT
14 //
15 //
16 
17 // system include files
18 #include <memory>
19 
20 // #include <iostream>
21 #include <fstream>
22 #include <string>
23 
24 #include <algorithm>
25 
26 #include <vector>
27 #include <map>
28 
29 // user include files
54 
55 #include "TH2.h"
56 #include "TProfile2D.h"
57 #include "TH2Poly.h"
58 #include "TGraph.h"
59 
60 #define CODE_FORWARD(s, d, b) ((unsigned short)((b << 8) + (d << 4) + s))
61 
62 //#define DEBUG_MODE
63 
64 //
65 // class declaration
66 //
67 
69 
70 class SiPixelPhase1Analyzer : public edm::one::EDAnalyzer<edm::one::SharedResources> {
71 public:
73  ~SiPixelPhase1Analyzer() override;
74 
75  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
76 
77 private:
78  void analyze(const edm::Event&, const edm::EventSetup&) override;
79  void BookHistograms();
80 
81  void BookBarrelHistograms(TDirectory* currentDir, const std::string& currentHistoName);
82  void BookForwardHistograms(TDirectory* currentDir, const std::string& currentHistoName);
83 
84  void BookBins(const TrackerGeometry& theTrackerGeometry, const TrackerTopology* tt);
85  void BookBarrelBins(const TrackerGeometry& theTrackerGeometry, const TrackerTopology* tt);
86  void BookForwardBins(const TrackerGeometry& theTrackerGeometry, const TrackerTopology* tt);
87 
89 
91  const TrackerGeometry& theTrackerGeometry,
92  const TrackerTopology* tt);
93 
94  void FillBarrelBinsAnalyze(const TrackerGeometry& theTrackerGeometry,
95  const TrackerTopology* tt,
96  unsigned rawId,
97  const GlobalPoint& globalPoint);
98  void FillForwardBinsAnalyze(const TrackerGeometry& theTrackerGeometry,
99  const TrackerTopology* tt,
100  unsigned rawId,
101  const GlobalPoint& globalPoint);
102 
103  void FillBarrelBinsRemap(const TrackerGeometry& theTrackerGeometry, const TrackerTopology* tt);
104  void FillForwardBinsRemap(const TrackerGeometry& theTrackerGeometry, const TrackerTopology* tt);
105 
106  // ----------member data ---------------------------
109 
111 
113 
115  std::ofstream debugFile;
116 
118 
120 
121  std::map<uint32_t, TGraph*> bins, binsSummary;
122 
123  std::map<std::string, std::vector<TH2Poly*> > th2PolyBarrel;
124  std::map<std::string, TH2Poly*> th2PolyBarrelSummary;
125 
126 #ifdef DEBUG_MODE
127  std::map<std::string, std::vector<TH2*> > th2PolyBarrelDebug;
128 #endif
129 
130  std::map<std::string, std::vector<TH2Poly*> > pxfTh2PolyForward;
131  std::map<std::string, TH2Poly*> pxfTh2PolyForwardSummary;
132 
133 #ifdef DEBUG_MODE
134  std::map<std::string, std::vector<TH2*> > pxfTh2PolyForwardDebug;
135 #endif
136 
138 
140  mat4 mat[2];
141  unsigned rawId[2];
142  };
143  // used to hold information about elements': ids & matrices which are of the same side, disk and barrel but different panel
144  // to build trapezoidal ring elements
145  std::map<unsigned short, complementaryElements> mapOfComplementaryElements;
146 
147  //Input root file handle;
149 
150  // read input histograms
151  std::vector<unsigned> isBarrelSource;
152  std::vector<std::string> analazedRootFileName;
153  std::vector<std::string> pathToHistograms;
154  std::vector<std::string> baseHistogramName;
155 
156  // temporal functionality
157  void SaveDetectorData(bool isBarrel, unsigned rawId, int shell_hc, int layer_disk, int ladder_blade) {
158  std::ofstream file("det.data", std::ofstream::out);
159 
160  file << isBarrel << "\t" << rawId << "\t" << shell_hc << "\t" << layer_disk << "\t" << ladder_blade << std::endl;
161  }
162 };
163 
164 #endif
SiPixelPhase1Analyzer::baseHistogramName
std::vector< std::string > baseHistogramName
Definition: SiPixelPhase1Analyzer.h:154
OperationMode
OperationMode
Definition: SiPixelPhase1Analyzer.h:68
EDAnalyzer.h
PixelBarrelName.h
MessageLogger.h
SiPixelPhase1Analyzer::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: SiPixelPhase1Analyzer.cc:66
TrackerGeometry.h
PixelTopology.h
groupFilesInBlocks.tt
int tt
Definition: groupFilesInBlocks.py:144
edm::EDGetTokenT< reco::TrackCollection >
TrackerTopology
Definition: TrackerTopology.h:16
MODE_ANALYZE
Definition: SiPixelPhase1Analyzer.h:68
SiPixelPhase1Analyzer::SaveDetectorData
void SaveDetectorData(bool isBarrel, unsigned rawId, int shell_hc, int layer_disk, int ladder_blade)
Definition: SiPixelPhase1Analyzer.h:157
SiPixelPhase1Analyzer::complementaryElements::mat
mat4 mat[2]
Definition: SiPixelPhase1Analyzer.h:140
edm::one::EDAnalyzer
Definition: EDAnalyzer.h:30
edm::Handle< reco::TrackCollection >
SiPixelPhase1Analyzer::complementaryElements::rawId
unsigned rawId[2]
Definition: SiPixelPhase1Analyzer.h:141
SiPixelPhase1Analyzer::BookHistograms
void BookHistograms()
Definition: SiPixelPhase1Analyzer.cc:94
SiPixelPhase1Analyzer::debugFileName
std::string debugFileName
Definition: SiPixelPhase1Analyzer.h:114
SiPixelPhase1Analyzer::BookBarrelBins
void BookBarrelBins(const TrackerGeometry &theTrackerGeometry, const TrackerTopology *tt)
Definition: SiPixelPhase1Analyzer.cc:268
MakerMacros.h
TrackerTopology.h
Track.h
TrackFwd.h
TrapezoidalPlaneBounds.h
SiPixelPhase1Analyzer::FillBins
void FillBins(edm::Handle< reco::TrackCollection > *tracks, const TrackerGeometry &theTrackerGeometry, const TrackerTopology *tt)
Definition: SiPixelPhase1Analyzer.cc:554
Service.h
SiPixelPhase1Analyzer::firstEvent
bool firstEvent
Definition: SiPixelPhase1Analyzer.h:119
SiPixelPhase1Analyzer::th2PolyBarrelSummary
std::map< std::string, TH2Poly * > th2PolyBarrelSummary
Definition: SiPixelPhase1Analyzer.h:124
SiPixelPhase1Analyzer::SiPixelPhase1Analyzer
SiPixelPhase1Analyzer(const edm::ParameterSet &)
Definition: SiPixelPhase1Analyzer.cc:12
RectangularPlaneBounds.h
Point3DBase< float, GlobalTag >
SiPixelPhase1Analyzer::bins
std::map< uint32_t, TGraph * > bins
Definition: SiPixelPhase1Analyzer.h:121
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
mat4.h
TFileService.h
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
mat4
Definition: mat4.h:9
TrackerDigiGeometryRecord.h
SiPixelRecHitCollection.h
SiPixelPhase1Analyzer::isBarrelSource
std::vector< unsigned > isBarrelSource
Definition: SiPixelPhase1Analyzer.h:151
edm::ParameterSet
Definition: ParameterSet.h:47
SiPixelPhase1Analyzer::BookForwardBins
void BookForwardBins(const TrackerGeometry &theTrackerGeometry, const TrackerTopology *tt)
Definition: SiPixelPhase1Analyzer.cc:333
SiPixelPhase1Analyzer::pathToHistograms
std::vector< std::string > pathToHistograms
Definition: SiPixelPhase1Analyzer.h:153
SiPixelPhase1Analyzer::FillBarrelBinsRemap
void FillBarrelBinsRemap(const TrackerGeometry &theTrackerGeometry, const TrackerTopology *tt)
Definition: SiPixelPhase1Analyzer.cc:639
Event.h
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
SiPixelPhase1Analyzer::fs
edm::Service< TFileService > fs
Definition: SiPixelPhase1Analyzer.h:117
SiPixelPhase1Analyzer::FillForwardBinsAnalyze
void FillForwardBinsAnalyze(const TrackerGeometry &theTrackerGeometry, const TrackerTopology *tt, unsigned rawId, const GlobalPoint &globalPoint)
Definition: SiPixelPhase1Analyzer.cc:616
SiPixelPhase1Analyzer::tracksToken
edm::EDGetTokenT< reco::TrackCollection > tracksToken
Definition: SiPixelPhase1Analyzer.h:112
SiPixelPhase1Analyzer::SaveDetectorVertices
void SaveDetectorVertices(const TrackerTopology *tt)
Definition: SiPixelPhase1Analyzer.cc:486
edm::Service< TFileService >
SiPixelPhase1Analyzer::~SiPixelPhase1Analyzer
~SiPixelPhase1Analyzer() override
Definition: SiPixelPhase1Analyzer.cc:51
SiPixelPhase1Analyzer::topoToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
Definition: SiPixelPhase1Analyzer.h:108
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
SiPixelPhase1Analyzer::complementaryElements
Definition: SiPixelPhase1Analyzer.h:139
PixelGeomDetUnit.h
SiPixelPhase1Analyzer::debugFile
std::ofstream debugFile
Definition: SiPixelPhase1Analyzer.h:115
SiPixelPhase1Analyzer::FillForwardBinsRemap
void FillForwardBinsRemap(const TrackerGeometry &theTrackerGeometry, const TrackerTopology *tt)
Definition: SiPixelPhase1Analyzer.cc:735
SiPixelPhase1Analyzer::pxfTh2PolyForward
std::map< std::string, std::vector< TH2Poly * > > pxfTh2PolyForward
Definition: SiPixelPhase1Analyzer.h:130
edm::EventSetup
Definition: EventSetup.h:58
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord >
SiPixelPhase1Analyzer::BookBarrelHistograms
void BookBarrelHistograms(TDirectory *currentDir, const std::string &currentHistoName)
Definition: SiPixelPhase1Analyzer.cc:128
DiskSectorBounds.h
SiPixelPhase1Analyzer::th2PolyBarrel
std::map< std::string, std::vector< TH2Poly * > > th2PolyBarrel
Definition: SiPixelPhase1Analyzer.h:123
Frameworkfwd.h
SiPixelPhase1Analyzer::BookBins
void BookBins(const TrackerGeometry &theTrackerGeometry, const TrackerTopology *tt)
Definition: SiPixelPhase1Analyzer.cc:259
SiPixelPhase1Analyzer::orthoProjectionMatrix
mat4 orthoProjectionMatrix
Definition: SiPixelPhase1Analyzer.h:137
SiPixelPhase1Analyzer::mapOfComplementaryElements
std::map< unsigned short, complementaryElements > mapOfComplementaryElements
Definition: SiPixelPhase1Analyzer.h:145
SiPixelPhase1Analyzer::binsSummary
std::map< uint32_t, TGraph * > binsSummary
Definition: SiPixelPhase1Analyzer.h:121
SiPixelPhase1Analyzer::geomToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: SiPixelPhase1Analyzer.h:107
SiPixelPhase1Analyzer::analazedRootFileName
std::vector< std::string > analazedRootFileName
Definition: SiPixelPhase1Analyzer.h:152
SiPixelPhase1Analyzer
Definition: SiPixelPhase1Analyzer.h:70
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
SiPixelPhase1Analyzer::BookForwardHistograms
void BookForwardHistograms(TDirectory *currentDir, const std::string &currentHistoName)
Definition: SiPixelPhase1Analyzer.cc:189
ParameterSet.h
PXBDetId.h
SiPixelPhase1Analyzer::rootFileHandle
TFile * rootFileHandle
Definition: SiPixelPhase1Analyzer.h:148
PXFDetId.h
SiPixelPhase1Analyzer::FillBarrelBinsAnalyze
void FillBarrelBinsAnalyze(const TrackerGeometry &theTrackerGeometry, const TrackerTopology *tt, unsigned rawId, const GlobalPoint &globalPoint)
Definition: SiPixelPhase1Analyzer.cc:595
SiPixelPhase1Analyzer::pxfTh2PolyForwardSummary
std::map< std::string, TH2Poly * > pxfTh2PolyForwardSummary
Definition: SiPixelPhase1Analyzer.h:131
edm::Event
Definition: Event.h:73
SiPixelPhase1Analyzer::opMode
OperationMode opMode
Definition: SiPixelPhase1Analyzer.h:110
MODE_REMAP
Definition: SiPixelPhase1Analyzer.h:68
runEdmFileComparison.currentDir
currentDir
Definition: runEdmFileComparison.py:187
SiPixelPhase1Analyzer::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: SiPixelPhase1Analyzer.cc:823
PixelEndcapName.h
TrackerGeometry
Definition: TrackerGeometry.h:14