Skip to content

Commit

Permalink
pACentrality DQM in 81X
Browse files Browse the repository at this point in the history
  • Loading branch information
smdogra committed Nov 3, 2016
1 parent c97e46b commit a53c7c0
Show file tree
Hide file tree
Showing 5 changed files with 256 additions and 0 deletions.
5 changes: 5 additions & 0 deletions DQM/Physics/python/CentralitypADQM_cfi.py
@@ -0,0 +1,5 @@
import FWCore.ParameterSet.Config as cms
CentralitypADQM = cms.EDAnalyzer("CentralitypADQM",
centralitycollection = cms.InputTag("pACentrality"),
vertexcollection = cms.InputTag("offlinePrimaryVertices")
)
7 changes: 7 additions & 0 deletions DQM/Physics/python/DQMPhysics_cff.py
Expand Up @@ -15,6 +15,7 @@
from DQM.Physics.ExoticaDQM_cfi import *
from DQM.Physics.B2GDQM_cfi import *
from DQM.Physics.CentralityDQM_cfi import *
from DQM.Physics.CentralitypADQM_cfi import *
from DQM.Physics.topJetCorrectionHelper_cfi import *

dqmPhysics = cms.Sequence( bphysicsOniaDQM
Expand All @@ -34,13 +35,19 @@
*ExoticaDQM
*B2GDQM
)

from Configuration.Eras.Modifier_phase1Pixel_cff import phase1Pixel
phase1Pixel.toReplaceWith(dqmPhysics, dqmPhysics.copyAndExclude([ # FIXME
ewkMuDQM, # Excessive printouts because 2017 doesn't have HLT yet
ewkElecDQM, # Excessive printouts because 2017 doesn't have HLT yet
ewkMuLumiMonitorDQM, # Excessive printouts because 2017 doesn't have HLT yet
]))

from Configuration.Eras.Modifier_pA_2016_cff import pA_2016
dqmPhysicsPA = dqmPhysics.copy()
dqmPhysicsPA += CentralitypADQM
pA_2016.toReplaceWith(dqmPhysics, dqmPhysicspA)

bphysicsOniaDQMHI = bphysicsOniaDQM.clone(vertex=cms.InputTag("hiSelectedVertex"))
dqmPhysicsHI = cms.Sequence(bphysicsOniaDQMHI+CentralityDQM)

Expand Down
135 changes: 135 additions & 0 deletions DQM/Physics/src/CentralitypADQM.cc
@@ -0,0 +1,135 @@
#include "DQM/Physics/src/CentralitypADQM.h"

#include <memory>

// DQM
#include "DQMServices/Core/interface/DQMStore.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"

// Framework
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/LuminosityBlock.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"

// Centrality
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "DataFormats/VertexReco/interface/Vertex.h"

using namespace edm;
using namespace reco;
using namespace hi;

//
// -- Constructor
//
CentralitypADQM::CentralitypADQM(const edm::ParameterSet& ps) {

edm::LogInfo("CentralitypADQM") << " Starting CentralitypADQM " << "\n";

centralityTag_ = ps.getParameter<InputTag>("centralitycollection");
centralityToken = consumes<reco::Centrality>(centralityTag_);

vertexTag_ = ps.getParameter<InputTag>("vertexcollection");
vertexToken = consumes<std::vector<reco::Vertex> >(vertexTag_);
// just to initialize
}

//
// -- Destructor
//
CentralitypADQM::~CentralitypADQM() {
edm::LogInfo("CentralitypADQM") << " Deleting CentralitypADQM " << "\n";
}

//
// -- Book histograms
//
void CentralitypADQM::bookHistograms(DQMStore::IBooker& bei, edm::Run const&,
edm::EventSetup const&) {
// void CentralitypADQM::bookHistograms(DQMStore* bei){

bei.setCurrentFolder("Physics/CentralitypA/");

h_hiNpix = bei.book1D("h_hiNpix", "h_hiNpix", 750, 0, 75000);
// h_hiNpixelTracks = bei.book1D("h_hiNpixelTracks", "hiNpixelTracks", 500, 0, 5000);
h_hiNtracks = bei.book1D("h_hiNtracks", "h_hiNtracks", 500, 0, 5000);
h_hiNtracksPtCut =
bei.book1D("h_hiNtracksPtCut", "h_hiNtracksPtCut", 500, 0, 5000);
h_hiNtracksEtaCut =
bei.book1D("h_hiNtracksEtaCut", "h_hiNtracksEtaCut", 500, 0, 5000);
h_hiNtracksEtaPtCut =
bei.book1D("h_hiNtracksEtaPtCut", "h_hiNtracksEtaPtCut", 500, 0, 5000);

h_hiHF = bei.book1D("h_hiHF", "h_hiHF", 900, 0, 9000);
h_hiHFplus = bei.book1D("h_hiHFplus", "h_hiHFplus", 900, 0, 9000);
h_hiHFminus = bei.book1D("h_hiHFminus", "h_hiHFminus", 900, 0, 9000);
h_hiHFplusEta4 = bei.book1D("h_hiHFplusEta4", "h_hiHFplusEta4", 900, 0, 9000);
h_hiHFminusEta4 =
bei.book1D("h_hiHFminusEta4", "h_hiHFminusEta4", 900, 0, 9000);

h_hiHFhit = bei.book1D("h_hiHFhit", "h_hiHFhit", 3000, 0, 300000);
h_hiHFhitPlus = bei.book1D("h_hiHFhitPlus", "h_hiHFhitPlus", 2000, 0, 200000);
h_hiHFhitMinus =
bei.book1D("h_hiHFhitMinus", "h_hiHFhitMinus", 2000, 0, 200000);

h_hiEB = bei.book1D("h_hiEB", "h_hiEB", 600, 0, 6000);
h_hiET = bei.book1D("h_hiET", "h_hiET", 600, 0, 6000);
h_hiEE = bei.book1D("h_hiEE", "h_hiEE", 600, 0, 6000);
h_hiEEplus = bei.book1D("h_hiEEplus", "h_hiEEplus", 600, 0, 6000);
h_hiEEminus = bei.book1D("h_hiEEminus", "h_hiEEminus", 600, 0, 6000);
h_hiZDC = bei.book1D("h_hiZDC", "h_hiZDC", 600, 0, 6000);
h_hiZDCplus = bei.book1D("h_hiZDCplus", "h_hiZDCplus", 600, 0, 6000);
h_hiZDCminus = bei.book1D("h_hiZDCminus", "h_hiZDCminus", 600, 0, 6000);

h_vertex_x = bei.book1D("h_vertex_x", "h_vertex_x", 400, -4, 4);
h_vertex_y = bei.book1D("h_vertex_y", "h_vertex_y", 400, -4, 4);
h_vertex_z = bei.book1D("h_vertex_z", "h_vertex_z", 400, -40, 40);
}

// -- Analyze

void CentralitypADQM::analyze(const edm::Event& iEvent,const edm::EventSetup& iSetup) {

using namespace edm;
edm::Handle<reco::Centrality> cent;
iEvent.getByToken(centralityToken, cent); //_centralitytag comes from the cfg

if(cent.isValid()){
h_hiNpix->Fill(cent->multiplicityPixel());
h_hiNtracks->Fill(cent->Ntracks());

h_hiNtracksPtCut->Fill(cent->NtracksPtCut());
h_hiNtracksEtaCut->Fill(cent->NtracksEtaCut());
h_hiNtracksEtaPtCut->Fill(cent->NtracksEtaPtCut());

h_hiHF->Fill(cent->EtHFtowerSum());
h_hiHFplus->Fill(cent->EtHFtowerSumPlus());
h_hiHFminus->Fill(cent->EtHFtowerSumMinus());
h_hiHFplusEta4->Fill(cent->EtHFtruncatedPlus());
h_hiHFminusEta4->Fill(cent->EtHFtruncatedMinus());

h_hiHFhit->Fill(cent->EtHFhitSum());
h_hiHFhitPlus->Fill(cent->EtHFhitSumPlus());
h_hiHFhitMinus->Fill(cent->EtHFhitSumMinus());

h_hiZDC->Fill(cent->zdcSum());
h_hiZDCplus->Fill(cent->zdcSumPlus());
h_hiZDCminus->Fill(cent->zdcSumMinus());

h_hiEEplus->Fill(cent->EtEESumPlus());
h_hiEEminus->Fill(cent->EtEESumMinus());
h_hiEE->Fill(cent->EtEESum());
h_hiEB->Fill(cent->EtEBSum());
h_hiET->Fill(cent->EtMidRapiditySum());

edm::Handle<std::vector<reco::Vertex> > vertex;
iEvent.getByToken(vertexToken, vertex);
h_vertex_x->Fill(vertex->begin()->x());
h_vertex_y->Fill(vertex->begin()->y());
h_vertex_z->Fill(vertex->begin()->z());
}
}
107 changes: 107 additions & 0 deletions DQM/Physics/src/CentralitypADQM.h
@@ -0,0 +1,107 @@
#ifndef CentralitypADQM_H
#define CentralitypADQM_H

#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "DataFormats/Common/interface/Handle.h"

#include "DataFormats/HeavyIonEvent/interface/Centrality.h"
#include "DataFormats/VertexReco/interface/Vertex.h"

#include "DQMServices/Core/interface/DQMStore.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include "DQMServices/Core/interface/DQMEDAnalyzer.h"

#include "DataFormats/HeavyIonEvent/interface/EvtPlane.h"
#include "RecoHI/HiEvtPlaneAlgos/interface/HiEvtPlaneList.h"
class DQMStore;

class CentralitypADQM : public DQMEDAnalyzer {

public:
explicit CentralitypADQM(const edm::ParameterSet& ps);
virtual ~CentralitypADQM();

protected:
virtual void analyze(edm::Event const& e, edm::EventSetup const& eSetup) override;

private:
virtual void bookHistograms(DQMStore::IBooker& bei, edm::Run const&,
edm::EventSetup const&) override;

// void bookHistos(DQMStore * bei );
// DQMStore* bei_;

edm::InputTag centralityTag_;
edm::EDGetTokenT<reco::Centrality> centralityToken;
edm::Handle<reco::Centrality> centrality_;

edm::InputTag vertexTag_;
edm::EDGetTokenT<std::vector<reco::Vertex> > vertexToken;
edm::Handle<std::vector<reco::Vertex> > vertex_;

edm::InputTag eventplaneTag_;
edm::EDGetTokenT<reco::EvtPlaneCollection> eventplaneToken;

edm::InputTag centralityBinTag_;
edm::EDGetTokenT<int> centralityBinToken;
edm::Handle<int>centralityBin_;


///////////////////////////
// Histograms
///////////////////////////

// Histograms - Centrality
MonitorElement* h_hiNpix;
MonitorElement* h_hiNpixelTracks;
MonitorElement* h_hiNtracks;
MonitorElement* h_hiNtracksPtCut;
MonitorElement* h_hiNtracksEtaCut;
MonitorElement* h_hiNtracksEtaPtCut;
MonitorElement* h_hiHF;
MonitorElement* h_hiHFplus;
MonitorElement* h_hiHFminus;
MonitorElement* h_hiHFplusEta4;
MonitorElement* h_hiHFminusEta4;
MonitorElement* h_hiHFhit;
MonitorElement* h_hiHFhitPlus;
MonitorElement* h_hiHFhitMinus;
MonitorElement* h_hiEB;
MonitorElement* h_hiET;
MonitorElement* h_hiEE;
MonitorElement* h_hiEEplus;
MonitorElement* h_hiEEminus;
MonitorElement* h_hiZDC;
MonitorElement* h_hiZDCplus;
MonitorElement* h_hiZDCminus;

MonitorElement* h_vertex_x;
MonitorElement* h_vertex_y;
MonitorElement* h_vertex_z;

MonitorElement* h_cent_bin;

MonitorElement* h_ep_HFm1;
MonitorElement* h_ep_HFp1;
MonitorElement* h_ep_trackm1;
MonitorElement* h_ep_trackp1;
MonitorElement* h_ep_castor1;

MonitorElement* h_ep_HFm2;
MonitorElement* h_ep_HFp2;
MonitorElement* h_ep_trackmid2;
MonitorElement* h_ep_trackm2;
MonitorElement* h_ep_trackp2;
MonitorElement* h_ep_castor2;

MonitorElement* h_ep_HFm3;
MonitorElement* h_ep_HFp3;
MonitorElement* h_ep_trackmid3;

};

#endif
2 changes: 2 additions & 0 deletions DQM/Physics/src/plugins.cc
Expand Up @@ -20,6 +20,7 @@
#include "DQM/Physics/src/ExoticaDQM.h"
#include "DQM/Physics/src/B2GDQM.h"
#include "DQM/Physics/src/CentralityDQM.h"
#include "DQM/Physics/src/CentralitypADQM.h"

DEFINE_FWK_MODULE(BPhysicsOniaDQM);
DEFINE_FWK_MODULE(EwkDQM);
Expand All @@ -41,6 +42,7 @@ DEFINE_FWK_MODULE(HiggsDQM);
DEFINE_FWK_MODULE(ExoticaDQM);
DEFINE_FWK_MODULE(B2GDQM);
DEFINE_FWK_MODULE(CentralityDQM);
DEFINE_FWK_MODULE(CentralitypADQM);

// Local Variables:
// show-trailing-whitespace: t
Expand Down

0 comments on commit a53c7c0

Please sign in to comment.