CMS 3D CMS Logo

CentralityDQM.cc
Go to the documentation of this file.
2 
3 #include <memory>
4 
5 // DQM
8 
9 // Framework
16 
17 // Centrality
20 
21 using namespace edm;
22 using namespace reco;
23 using namespace hi;
24 
25 //
26 // -- Constructor
27 //
29  edm::LogInfo("CentralityDQM") << " Starting CentralityDQM "
30  << "\n";
31 
32  centralityTag_ = ps.getParameter<InputTag>("centralitycollection");
33  centralityToken = consumes<reco::Centrality>(centralityTag_);
34 
35  centralityBinTag_ = (ps.getParameter<edm::InputTag>("centralitybincollection"));
36  centralityBinToken = consumes<int>(centralityBinTag_);
37 
38  vertexTag_ = ps.getParameter<InputTag>("vertexcollection");
39  vertexToken = consumes<std::vector<reco::Vertex> >(vertexTag_);
40 
41  eventplaneTag_ = ps.getParameter<InputTag>("eventplanecollection");
42  eventplaneToken = consumes<reco::EvtPlaneCollection>(eventplaneTag_);
43 
44  // just to initialize
45 }
46 
47 //
48 // -- Destructor
49 //
51  edm::LogInfo("CentralityDQM") << " Deleting CentralityDQM "
52  << "\n";
53 }
54 
55 //
56 // -- Book histograms
57 //
59  // void CentralityDQM::bookHistograms(DQMStore* bei){
60 
61  bei.setCurrentFolder("Physics/Centrality/");
62 
63  h_hiNpix = bei.book1D("h_hiNpix", "h_hiNpix", 750, 0, 75000);
64  h_hiNpixelTracks = bei.book1D("h_hiNpixelTracks", "hiNpixelTracks", 500, 0, 5000);
65  h_hiNtracks = bei.book1D("h_hiNtracks", "h_hiNtracks", 500, 0, 5000);
66  h_hiNtracksPtCut = bei.book1D("h_hiNtracksPtCut", "h_hiNtracksPtCut", 500, 0, 5000);
67  h_hiNtracksEtaCut = bei.book1D("h_hiNtracksEtaCut", "h_hiNtracksEtaCut", 500, 0, 5000);
68  h_hiNtracksEtaPtCut = bei.book1D("h_hiNtracksEtaPtCut", "h_hiNtracksEtaPtCut", 500, 0, 5000);
69 
70  h_hiHF = bei.book1D("h_hiHF", "h_hiHF", 900, 0, 9000);
71  h_hiHFplus = bei.book1D("h_hiHFplus", "h_hiHFplus", 900, 0, 9000);
72  h_hiHFminus = bei.book1D("h_hiHFminus", "h_hiHFminus", 900, 0, 9000);
73  h_hiHFplusEta4 = bei.book1D("h_hiHFplusEta4", "h_hiHFplusEta4", 900, 0, 9000);
74  h_hiHFminusEta4 = bei.book1D("h_hiHFminusEta4", "h_hiHFminusEta4", 900, 0, 9000);
75 
76  h_hiHFhit = bei.book1D("h_hiHFhit", "h_hiHFhit", 3000, 0, 300000);
77  h_hiHFhitPlus = bei.book1D("h_hiHFhitPlus", "h_hiHFhitPlus", 2000, 0, 200000);
78  h_hiHFhitMinus = bei.book1D("h_hiHFhitMinus", "h_hiHFhitMinus", 2000, 0, 200000);
79 
80  h_hiEB = bei.book1D("h_hiEB", "h_hiEB", 600, 0, 6000);
81  h_hiET = bei.book1D("h_hiET", "h_hiET", 600, 0, 6000);
82  h_hiEE = bei.book1D("h_hiEE", "h_hiEE", 600, 0, 6000);
83  h_hiEEplus = bei.book1D("h_hiEEplus", "h_hiEEplus", 600, 0, 6000);
84  h_hiEEminus = bei.book1D("h_hiEEminus", "h_hiEEminus", 600, 0, 6000);
85  h_hiZDC = bei.book1D("h_hiZDC", "h_hiZDC", 600, 0, 6000);
86  h_hiZDCplus = bei.book1D("h_hiZDCplus", "h_hiZDCplus", 600, 0, 6000);
87  h_hiZDCminus = bei.book1D("h_hiZDCminus", "h_hiZDCminus", 600, 0, 6000);
88 
89  h_vertex_x = bei.book1D("h_vertex_x", "h_vertex_x", 400, -4, 4);
90  h_vertex_y = bei.book1D("h_vertex_y", "h_vertex_y", 400, -4, 4);
91  h_vertex_z = bei.book1D("h_vertex_z", "h_vertex_z", 400, -40, 40);
92 
93  h_cent_bin = bei.book1D("h_cent_bin", "h_cent_bin", 200, 0, 200);
94 
95  Double_t psirange = 4;
96  bei.setCurrentFolder("Physics/Centrality/EventPlane/");
97  h_ep_HFm2 = bei.book1D("h_ep_HFm2", "h_ep_HFm2", 800, -psirange, psirange);
98  h_ep_HFp2 = bei.book1D("h_ep_HFp2", "h_ep_HFp2", 800, -psirange, psirange);
99  h_ep_trackmid2 = bei.book1D("h_ep_trackmid2", "h_ep_trackmid2", 800, -psirange, psirange);
100  h_ep_trackm2 = bei.book1D("h_ep_trackm2", "h_ep_trackm2", 800, -psirange, psirange);
101  h_ep_trackp2 = bei.book1D("h_ep_trackp2", "h_ep_trackp2", 800, -psirange, psirange);
102  h_ep_HFm3 = bei.book1D("h_ep_HFm3", "h_ep_HFm3", 800, -psirange, psirange);
103  h_ep_HFp3 = bei.book1D("h_ep_HFp3", "h_ep_HFp3", 800, -psirange, psirange);
104  h_ep_trackmid3 = bei.book1D("h_ep_trackmid3", "h_ep_trackmid3", 800, -psirange, psirange);
105 }
106 
107 //
108 // -- Analyze
109 //
111  using namespace edm;
113  iEvent.getByToken(centralityToken, cent); //_centralitytag comes from the cfg
114 
115  edm::Handle<int> cbin;
116  iEvent.getByToken(centralityBinToken, cbin);
117 
118  // as an inputTag and is
119  //"hiCentrality"
121  iEvent.getByToken(eventplaneToken, ep);
122 
123  if (cent.isValid()) {
124  int hibin = -999;
125  if (cbin.isValid())
126  hibin = *cbin;
127 
128  // std::cout<< " ------------------------------------- " << hibin << std::endl;
129 
130  h_cent_bin->Fill(hibin);
131  h_hiNpix->Fill(cent->multiplicityPixel());
132  h_hiNpixelTracks->Fill(cent->NpixelTracks());
133  h_hiNtracks->Fill(cent->Ntracks()); //
134 
135  h_hiNtracksPtCut->Fill(cent->NtracksPtCut());
136  h_hiNtracksEtaCut->Fill(cent->NtracksEtaCut());
137  h_hiNtracksEtaPtCut->Fill(cent->NtracksEtaPtCut());
138 
139  h_hiHF->Fill(cent->EtHFtowerSum());
140  h_hiHFplus->Fill(cent->EtHFtowerSumPlus());
141  h_hiHFminus->Fill(cent->EtHFtowerSumMinus());
142  h_hiHFplusEta4->Fill(cent->EtHFtruncatedPlus());
143  h_hiHFminusEta4->Fill(cent->EtHFtruncatedMinus());
144 
145  h_hiHFhit->Fill(cent->EtHFhitSum());
146  h_hiHFhitPlus->Fill(cent->EtHFhitSumPlus());
147  h_hiHFhitMinus->Fill(cent->EtHFhitSumMinus());
148 
149  h_hiZDC->Fill(cent->zdcSum());
150  h_hiZDCplus->Fill(cent->zdcSumPlus());
151  h_hiZDCminus->Fill(cent->zdcSumMinus());
152 
153  h_hiEEplus->Fill(cent->EtEESumPlus());
154  h_hiEEminus->Fill(cent->EtEESumMinus());
155  h_hiEE->Fill(cent->EtEESum());
156  h_hiEB->Fill(cent->EtEBSum());
157  h_hiET->Fill(cent->EtMidRapiditySum());
158 
160  iEvent.getByToken(vertexToken, vertex);
161  h_vertex_x->Fill(vertex->begin()->x());
162  h_vertex_y->Fill(vertex->begin()->y());
163  h_vertex_z->Fill(vertex->begin()->z());
164  }
165 
166  if (ep.isValid()) {
167  EvtPlaneCollection::const_iterator rp = ep->begin();
168 
169  h_ep_HFm2->Fill(rp[HFm2].angle(0));
170  h_ep_HFp2->Fill(rp[HFp2].angle(0));
171  h_ep_trackmid2->Fill(rp[trackmid2].angle(0));
172  h_ep_trackm2->Fill(rp[trackm2].angle(0));
173  h_ep_trackp2->Fill(rp[trackp2].angle(0));
174 
175  h_ep_HFm3->Fill(rp[HFm3].angle(0));
176  h_ep_HFp3->Fill(rp[HFp3].angle(0));
177  h_ep_trackmid3->Fill(rp[trackmid3].angle(0));
178  }
179 }
reco::Centrality::EtHFhitSumPlus
double EtHFhitSumPlus() const
Definition: Centrality.h:22
MessageLogger.h
hi::trackm2
Definition: HiEvtPlaneList.h:23
hi::trackmid2
Definition: HiEvtPlaneList.h:23
edm::Run
Definition: Run.h:45
LuminosityBlock.h
reco::Centrality::EtHFhitSum
double EtHFhitSum() const
Definition: Centrality.h:21
edm
HLT enums.
Definition: AlignableModifier.h:19
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
reco::Centrality::zdcSum
double zdcSum() const
Definition: Centrality.h:54
reco::Centrality::EtEESumPlus
double EtEESumPlus() const
Definition: Centrality.h:34
DQMStore.h
EDAnalyzer.h
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
reco::Centrality::EtMidRapiditySum
double EtMidRapiditySum() const
Definition: Centrality.h:57
edm::Handle< reco::Centrality >
reco::Centrality::NtracksPtCut
double NtracksPtCut() const
Definition: Centrality.h:47
hi::HFp3
Definition: HiEvtPlaneList.h:24
hi::HFp2
Definition: HiEvtPlaneList.h:23
Service.h
reco::Centrality::EtEBSum
double EtEBSum() const
Definition: Centrality.h:39
reco::Centrality::EtHFtowerSumPlus
double EtHFtowerSumPlus() const
Definition: Centrality.h:25
reco::Centrality::EtHFtruncatedMinus
double EtHFtruncatedMinus() const
Definition: Centrality.h:32
reco::Centrality::EtEESum
double EtEESum() const
Definition: Centrality.h:33
hi::trackmid3
Definition: HiEvtPlaneList.h:24
reco::Centrality::zdcSumPlus
double zdcSumPlus() const
Definition: Centrality.h:55
reco::Centrality::EtHFhitSumMinus
double EtHFhitSumMinus() const
Definition: Centrality.h:23
DQMEDAnalyzer.h
Vertex.h
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
reco::Centrality::NtracksEtaPtCut
double NtracksEtaPtCut() const
Definition: Centrality.h:49
iEvent
int iEvent
Definition: GenABIO.cc:224
reco::Centrality::EtHFtruncatedPlus
double EtHFtruncatedPlus() const
Definition: Centrality.h:31
edm::EventSetup
Definition: EventSetup.h:57
reco::Centrality::NtracksEtaCut
double NtracksEtaCut() const
Definition: Centrality.h:48
hi::HFm3
Definition: HiEvtPlaneList.h:24
reco::Centrality::EtEESumMinus
double EtEESumMinus() const
Definition: Centrality.h:35
hi
Definition: EPCuts.h:4
CentralityDQM::CentralityDQM
CentralityDQM(const edm::ParameterSet &ps)
Definition: CentralityDQM.cc:28
hi::HFm2
Definition: HiEvtPlaneList.h:23
reco::Centrality::NpixelTracks
double NpixelTracks() const
Definition: Centrality.h:50
hi::trackp2
Definition: HiEvtPlaneList.h:24
CentralityDQM::~CentralityDQM
~CentralityDQM() override
Definition: CentralityDQM.cc:50
reco::Centrality::zdcSumMinus
double zdcSumMinus() const
Definition: Centrality.h:56
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
reco::Centrality::multiplicityPixel
double multiplicityPixel() const
Definition: Centrality.h:43
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqm::implementation::IBooker
Definition: DQMStore.h:43
ParameterSet.h
reco::Centrality::EtHFtowerSum
double EtHFtowerSum() const
Definition: Centrality.h:24
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
CentralityDQM::analyze
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
Definition: CentralityDQM.cc:110
reco::Centrality::Ntracks
double Ntracks() const
Definition: Centrality.h:46
SiStripBadComponentsDQMServiceTemplate_cfg.ep
ep
Definition: SiStripBadComponentsDQMServiceTemplate_cfg.py:86
edm::InputTag
Definition: InputTag.h:15
CentralityDQM.h
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
CentralityDQM::bookHistograms
void bookHistograms(DQMStore::IBooker &bei, edm::Run const &, edm::EventSetup const &) override
Definition: CentralityDQM.cc:58
reco::Centrality::EtHFtowerSumMinus
double EtHFtowerSumMinus() const
Definition: Centrality.h:26