CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CentralityDQM.cc
Go to the documentation of this file.
2 
3 #include <memory>
4 
5 // DQM
9 
10 // Framework
16 
17 // Centrality
21 
22 using namespace edm;
23 using namespace reco;
24 
25 //
26 // -- Constructor
27 //
29 
30  edm::LogInfo("CentralityDQM") << " Starting CentralityDQM "
31  << "\n";
32 
33  centralityTag_ = ps.getParameter<InputTag>("centralitycollection");
34  centralityToken = consumes<reco::Centrality>(centralityTag_);
35 
36  vertexTag_ = ps.getParameter<InputTag>("vertexcollection");
37  vertexToken = consumes<std::vector<reco::Vertex> >(vertexTag_);
38 
39  // just to initialize
40 }
41 
42 //
43 // -- Destructor
44 //
46  edm::LogInfo("CentralityDQM") << " Deleting CentralityDQM "
47  << "\n";
48 }
49 
50 //
51 // -- Book histograms
52 //
54  edm::EventSetup const&) {
55  // void CentralityDQM::bookHistograms(DQMStore* bei){
56 
57  bei.setCurrentFolder("Physics/Centrality/");
58 
59  h_hiNpix = bei.book1D("h_hiNpix", "h_hiNpix", 750, 0, 75000);
60  h_hiNpixelTracks =
61  bei.book1D("h_hiNpixelTracks", "hiNpixelTracks", 500, 0, 5000);
62  h_hiNtracks = bei.book1D("h_hiNtracks", "h_hiNtracks", 500, 0, 5000);
63  h_hiNtracksPtCut =
64  bei.book1D("h_hiNtracksPtCut", "h_hiNtracksPtCut", 500, 0, 5000);
65  h_hiNtracksEtaCut =
66  bei.book1D("h_hiNtracksEtaCut", "h_hiNtracksEtaCut", 500, 0, 5000);
67  h_hiNtracksEtaPtCut =
68  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 =
75  bei.book1D("h_hiHFminusEta4", "h_hiHFminusEta4", 900, 0, 9000);
76 
77  h_hiHFhit = bei.book1D("h_hiHFhit", "h_hiHFhit", 3000, 0, 300000);
78  h_hiHFhitPlus = bei.book1D("h_hiHFhitPlus", "h_hiHFhitPlus", 2000, 0, 200000);
79  h_hiHFhitMinus =
80  bei.book1D("h_hiHFhitMinus", "h_hiHFhitMinus", 2000, 0, 200000);
81 
82  h_hiEB = bei.book1D("h_hiEB", "h_hiEB", 600, 0, 6000);
83  h_hiET = bei.book1D("h_hiET", "h_hiET", 600, 0, 6000);
84  h_hiEE = bei.book1D("h_hiEE", "h_hiEE", 600, 0, 6000);
85  h_hiEEplus = bei.book1D("h_hiEEplus", "h_hiEEplus", 600, 0, 6000);
86  h_hiEEminus = bei.book1D("h_hiEEminus", "h_hiEEminus", 600, 0, 6000);
87  h_hiZDC = bei.book1D("h_hiZDC", "h_hiZDC", 600, 0, 6000);
88  h_hiZDCplus = bei.book1D("h_hiZDCplus", "h_hiZDCplus", 600, 0, 6000);
89  h_hiZDCminus = bei.book1D("h_hiZDCminus", "h_hiZDCminus", 600, 0, 6000);
90 
91  h_vertex_x = bei.book1D("h_vertex_x", "h_vertex_x", 400, -4, 4);
92  h_vertex_y = bei.book1D("h_vertex_y", "h_vertex_y", 400, -4, 4);
93  h_vertex_z = bei.book1D("h_vertex_z", "h_vertex_z", 400, -40, 40);
94 }
95 
96 //
97 // -- Analyze
98 //
100  const edm::EventSetup& iSetup) {
101 
102  using namespace edm;
104  iEvent.getByToken(centralityToken, cent); //_centralitytag comes from the cfg
105  // as an inputTag and is
106  //"hiCentrality"
107 
108  if (!cent.isValid()) return;
109 
110  h_hiNpix->Fill(cent->multiplicityPixel());
111  h_hiNpixelTracks->Fill(cent->NpixelTracks());
112  h_hiNtracks->Fill(cent->Ntracks()); //
113 
114  h_hiNtracksPtCut->Fill(cent->NtracksPtCut());
115  h_hiNtracksEtaCut->Fill(cent->NtracksEtaCut());
116  h_hiNtracksEtaPtCut->Fill(cent->NtracksEtaPtCut());
117 
118  h_hiHF->Fill(cent->EtHFtowerSum());
119  h_hiHFplus->Fill(cent->EtHFtowerSumPlus());
120  h_hiHFminus->Fill(cent->EtHFtowerSumMinus());
121  h_hiHFplusEta4->Fill(cent->EtHFtruncatedPlus());
122  h_hiHFminusEta4->Fill(cent->EtHFtruncatedMinus());
123 
124  h_hiHFhit->Fill(cent->EtHFhitSum());
125  h_hiHFhitPlus->Fill(cent->EtHFhitSumPlus());
126  h_hiHFhitMinus->Fill(cent->EtHFhitSumMinus());
127 
128  h_hiZDC->Fill(cent->zdcSum());
129  h_hiZDCplus->Fill(cent->zdcSumPlus());
130  h_hiZDCminus->Fill(cent->zdcSumMinus());
131 
132  h_hiEEplus->Fill(cent->EtEESumPlus());
133  h_hiEEminus->Fill(cent->EtEESumMinus());
134  h_hiEE->Fill(cent->EtEESum());
135  h_hiEB->Fill(cent->EtEBSum());
136  h_hiET->Fill(cent->EtMidRapiditySum());
137 
139  iEvent.getByToken(vertexToken, vertex);
140  h_vertex_x->Fill(vertex->begin()->x());
141  h_vertex_y->Fill(vertex->begin()->y());
142  h_vertex_z->Fill(vertex->begin()->z());
143 }
T getParameter(std::string const &) const
virtual void bookHistograms(DQMStore::IBooker &bei, edm::Run const &, edm::EventSetup const &) override
CentralityDQM(const edm::ParameterSet &ps)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
int iEvent
Definition: GenABIO.cc:230
virtual void analyze(edm::Event const &e, edm::EventSetup const &eSetup)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
virtual ~CentralityDQM()
Definition: Run.h:41