CMS 3D CMS Logo

TrackFoldedOccupancyClient.cc
Go to the documentation of this file.
5 //-----------------------------------------------------------------------------------
7 //-----------------------------------------------------------------------------------
8 {
9  edm::LogInfo("TrackFoldedOccupancyClient") << "TrackFoldedOccupancyClient::Deleting TrackFoldedOccupancyClient ";
10  TopFolder_ = iConfig.getParameter<std::string>("FolderName");
11  quality_ = iConfig.getParameter<std::string>("TrackQuality");
12  algoName_ = iConfig.getParameter<std::string>("AlgoName");
13  state_ = iConfig.getParameter<std::string>("MeasurementState");
14  histTag_ = (state_ == "default") ? algoName_ : state_ + "_" + algoName_;
15  conf_ = iConfig;
16 }
17 
18 //-----------------------------------------------------------------------------------
20 //-----------------------------------------------------------------------------------
21 {
22  edm::LogInfo("TrackFoldedOccupancyClient") << "TrackFoldedOccupancyClient::Deleting TrackFoldedOccupancyClient ";
23 }
24 
25 //-----------------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------------
28 {
29  edm::LogInfo("TrackFoldedOccupancyClient") << "TrackFoldedOccupancyClient::beginJob done";
30 }
31 
32 //-----------------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------------
35 {
36  edm::LogInfo("TrackFoldedOccupancyClient") << "TrackFoldedOccupancyClient:: Begining of Run";
37 }
38 
39 //-----------------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------------
42 {
43  ibooker.setCurrentFolder(TopFolder_ + "/" + quality_ + "/GeneralProperties/");
44  int Phi2DBin = conf_.getParameter<int>("Phi2DBin");
45  int Eta2DBin = conf_.getParameter<int>("Eta2DBin");
46  double EtaMin = conf_.getParameter<double>("EtaMin");
47  double EtaMax = conf_.getParameter<double>("EtaMax");
48  double PhiMin = conf_.getParameter<double>("PhiMin");
49  double PhiMax = conf_.getParameter<double>("PhiMax");
50 
51  // use the AlgoName and Quality Name
52  std::string histname = "TkEtaPhi_RelativeDifference_byFoldingmap_" + histTag_;
54  ibooker.book2D(histname, histname, Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax);
57 
58  histname = "TkEtaPhi_RelativeDifference_byFoldingmap_op_" + histTag_;
60  ibooker.book2D(histname, histname, Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax);
63 
64  histname = "TkEtaPhi_Ratio_byFoldingmap_" + histTag_;
65  TkEtaPhi_Ratio_byFoldingmap = ibooker.book2D(histname, histname, Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax);
66  TkEtaPhi_Ratio_byFoldingmap->setAxisTitle("Track #eta", 1);
67  TkEtaPhi_Ratio_byFoldingmap->setAxisTitle("Track #phi", 2);
68 
69  histname = "TkEtaPhi_Ratio_byFoldingmap_op_" + histTag_;
71  ibooker.book2D(histname, histname, Eta2DBin, EtaMin, EtaMax, Phi2DBin, PhiMin, PhiMax);
74 }
75 
76 //-----------------------------------------------------------------------------------
78 //-----------------------------------------------------------------------------------
79 {
80  edm::LogInfo("TrackFoldedOccupancyClient") << "TrackFoldedOccupancyClient::endLuminosityBlock";
81 
82  bookMEs(ibooker);
83  std::string inFolder = TopFolder_ + "/" + quality_ + "/GeneralProperties/";
84 
85  std::string hname;
86  hname = "TrackEtaPhi_";
87  MonitorElement* TrackEtaPhi = igetter.get(inFolder + hname + histTag_);
88 
89  hname = "TrackEtaPhiInverted_";
90  MonitorElement* TrackEtaPhiInverted = igetter.get(inFolder + hname + histTag_);
91 
92  hname = "TrackEtaPhiInvertedoutofphase_";
93  MonitorElement* TrackEtaPhiInvertedoutofphase = igetter.get(inFolder + hname + histTag_);
94 
95  TkEtaPhi_Ratio_byFoldingmap->divide(TrackEtaPhi, TrackEtaPhiInverted, 1., 1., "");
96  TkEtaPhi_Ratio_byFoldingmap_op->divide(TrackEtaPhi, TrackEtaPhiInvertedoutofphase, 1., 1., "");
97 
98  int nx = TrackEtaPhi->getNbinsX();
99  int ny = TrackEtaPhi->getNbinsY();
100 
101  for (int ii = 1; ii <= nx; ii++) {
102  for (int jj = 1; jj <= ny; jj++) {
103  double Sum1 = TrackEtaPhi->getBinContent(ii, jj) + TrackEtaPhiInverted->getBinContent(ii, jj);
104  double Sum2 = TrackEtaPhi->getBinContent(ii, jj) + TrackEtaPhiInvertedoutofphase->getBinContent(ii, jj);
105 
106  double Sub1 = TrackEtaPhi->getBinContent(ii, jj) - TrackEtaPhiInverted->getBinContent(ii, jj);
107  double Sub2 = TrackEtaPhi->getBinContent(ii, jj) - TrackEtaPhiInvertedoutofphase->getBinContent(ii, jj);
108 
109  if (Sum1 == 0 || Sum2 == 0) {
112  } else {
113  double ratio1 = Sub1 / Sum1;
114  double ratio2 = Sub2 / Sum2;
117  }
118  }
119  }
120 }
121 
dqm::impl::MonitorElement::divide
virtual void divide(const MonitorElement *, const MonitorElement *, double, double, const char *)
Replace entries with results of dividing num by denom.
Definition: MonitorElement.cc:744
TrackFoldedOccupancyClient.h
MessageLogger.h
TrackFoldedOccupancyClient::TkEtaPhi_RelativeDifference_byFoldingmap
MonitorElement * TkEtaPhi_RelativeDifference_byFoldingmap
Definition: TrackFoldedOccupancyClient.h:50
TrackFoldedOccupancyClient::quality_
std::string quality_
Definition: TrackFoldedOccupancyClient.h:45
TrackFoldedOccupancyClient::algoName_
std::string algoName_
Definition: TrackFoldedOccupancyClient.h:44
edm::Run
Definition: Run.h:45
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
MonitorTrackInnerTrackMuons_cff.Eta2DBin
Eta2DBin
Definition: MonitorTrackInnerTrackMuons_cff.py:58
FileInPath.h
TrackFoldedOccupancyClient::conf_
edm::ParameterSet conf_
Definition: TrackFoldedOccupancyClient.h:43
MonitorTrackSTAMuons_cfi.PhiMax
PhiMax
Definition: MonitorTrackSTAMuons_cfi.py:230
TrackFoldedOccupancyClient::TkEtaPhi_Ratio_byFoldingmap_op
MonitorElement * TkEtaPhi_Ratio_byFoldingmap_op
Definition: TrackFoldedOccupancyClient.h:53
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
TrackFoldedOccupancyClient::beginRun
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
BeginRun.
Definition: TrackFoldedOccupancyClient.cc:33
Service.h
TrackFoldedOccupancyClient::TkEtaPhi_RelativeDifference_byFoldingmap_op
MonitorElement * TkEtaPhi_RelativeDifference_byFoldingmap_op
Definition: TrackFoldedOccupancyClient.h:51
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
dqm::impl::MonitorElement::getNbinsY
virtual int getNbinsY() const
get # of bins in Y-axis
Definition: MonitorElement.cc:580
TrackFoldedOccupancyClient::bookMEs
void bookMEs(DQMStore::IBooker &ibooker_)
book MEs
Definition: TrackFoldedOccupancyClient.cc:40
TrackFoldedOccupancyClient::dqmEndJob
void dqmEndJob(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_) override
EndJob.
Definition: TrackFoldedOccupancyClient.cc:77
TrackFoldedOccupancyClient::~TrackFoldedOccupancyClient
~TrackFoldedOccupancyClient() override
Destructor.
Definition: TrackFoldedOccupancyClient.cc:19
TrackFoldedOccupancyClient::histTag_
std::string histTag_
Definition: TrackFoldedOccupancyClient.h:47
MonitorTrackSTAMuons_cfi.PhiMin
PhiMin
Definition: MonitorTrackSTAMuons_cfi.py:231
edm::EventSetup
Definition: EventSetup.h:58
TrackFoldedOccupancyClient::TrackFoldedOccupancyClient
TrackFoldedOccupancyClient(const edm::ParameterSet &ps)
Constructor.
Definition: TrackFoldedOccupancyClient.cc:6
TrackFoldedOccupancyClient::TkEtaPhi_Ratio_byFoldingmap
MonitorElement * TkEtaPhi_Ratio_byFoldingmap
Definition: TrackFoldedOccupancyClient.h:52
TrackFoldedOccupancyClient::state_
std::string state_
Definition: TrackFoldedOccupancyClient.h:46
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
writedatasetfile.run
run
Definition: writedatasetfile.py:27
MonitorTrackInnerTrackMuons_cff.EtaMin
EtaMin
Definition: MonitorTrackInnerTrackMuons_cff.py:64
MonitorTrackInnerTrackMuons_cff.EtaMax
EtaMax
Definition: MonitorTrackInnerTrackMuons_cff.py:64
dqm::implementation::IGetter
Definition: DQMStore.h:484
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
MonitorTrackInnerTrackMuons_cff.Phi2DBin
Phi2DBin
Definition: MonitorTrackInnerTrackMuons_cff.py:59
dqm::impl::MonitorElement::getNbinsX
virtual int getNbinsX() const
get # of bins in X-axis
Definition: MonitorElement.cc:574
TrackFoldedOccupancyClient::beginJob
void beginJob(void) override
BeginJob.
Definition: TrackFoldedOccupancyClient.cc:26
findQualityFiles.jj
string jj
Definition: findQualityFiles.py:188
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
TrackFoldedOccupancyClient::TopFolder_
std::string TopFolder_
Definition: TrackFoldedOccupancyClient.h:48
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqm::implementation::IBooker
Definition: DQMStore.h:43
TrackFoldedOccupancyClient
Definition: TrackFoldedOccupancyClient.h:21
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592
cuy.ii
ii
Definition: cuy.py:590