22 #include "TLorentzVector.h" 27 : moduleName_(ps.getUntrackedParameter<
std::
string>(
"moduleName",
"ZEEDetails")),
28 folderName_(ps.getUntrackedParameter<
std::
string>(
"folderName",
"ElectronTracks")),
29 electronTag_(ps.getUntrackedParameter<
edm::
InputTag>(
"electronInputTag",
edm::
InputTag(
"gedGsfElectrons"))),
37 maxEta_(ps.getUntrackedParameter<double>(
"maxEta", 2.4)),
38 minPt_(ps.getUntrackedParameter<double>(
"minPt", 5)),
39 maxDeltaPhiInEB_(ps.getUntrackedParameter<double>(
"maxDeltaPhiInEB", 0.15)),
40 maxDeltaEtaInEB_(ps.getUntrackedParameter<double>(
"maxDeltaEtaInEB", 0.007)),
41 maxHOEEB_(ps.getUntrackedParameter<double>(
"maxHOEEB", 0.12)),
42 maxSigmaiEiEEB_(ps.getUntrackedParameter<double>(
"maxSigmaiEiEEB", 0.01)),
43 maxDeltaPhiInEE_(ps.getUntrackedParameter<double>(
"maxDeltaPhiInEE", 0.1)),
44 maxDeltaEtaInEE_(ps.getUntrackedParameter<double>(
"maxDeltaEtaInEE", 0.009)),
45 maxHOEEE_(ps.getUntrackedParameter<double>(
"maxHOEEB_", .10)),
46 maxSigmaiEiEEE_(ps.getUntrackedParameter<double>(
"maxSigmaiEiEEE", 0.03)),
47 maxNormChi2_(ps.getUntrackedParameter<double>(
"maxNormChi2", 10)),
48 maxD0_(ps.getUntrackedParameter<double>(
"maxD0", 0.02)),
49 maxDz_(ps.getUntrackedParameter<double>(
"maxDz", 20.)),
50 minPixelHits_(ps.getUntrackedParameter<uint32_t>(
"minPixelHits", 1)),
51 minStripHits_(ps.getUntrackedParameter<uint32_t>(
"minStripHits", 8)),
52 maxIso_(ps.getUntrackedParameter<double>(
"maxIso", 0.3)),
53 minPtHighest_(ps.getUntrackedParameter<double>(
"minPtHighest", 24)),
54 minInvMass_(ps.getUntrackedParameter<double>(
"minInvMass", 60)),
55 maxInvMass_(ps.getUntrackedParameter<double>(
"maxInvMass", 120)),
56 trackQuality_(ps.getUntrackedParameter<
std::
string>(
"trackQuality",
"highPurity")),
57 isMC_(ps.getUntrackedParameter<
bool>(
"isMC",
false)),
58 doPUCorrection_(ps.getUntrackedParameter<
bool>(
"doPUCorrection",
false)),
59 puScaleFactorFile_(ps.getUntrackedParameter<
std::
string>(
"puScaleFactorFile",
"PileupScaleFactor.root")) {
63 TH1F* h1 =
dynamic_cast<TH1F*
>(
f1->Get(
"pileupweight"));
64 for (
int i = 1;
i <= h1->GetNbinsX(); ++
i)
65 vpu_.push_back(h1->GetBinContent(
i));
73 Zpt_ = ibook.
book1D(
"Zpt",
"Z-Boson p_{T}", 100, 0.0, 100.0);
75 EoverP_ = ibook.
book3D(
"EoverP",
"EoverP", 48, -2.4, 2.4, 36, -3.2, 3.2, 100, 0, 10);
79 std::vector<TLorentzVector> list;
80 std::vector<int> chrgeList;
81 std::vector<reco::GsfElectron> finalelectrons;
91 for (
auto const& ele : *electronColl) {
92 if (!ele.ecalDriven())
97 if (!(ele.isEB() || ele.isEE()))
100 double hOverE = ele.hadronicOverEm();
101 double sigmaee = ele.sigmaIetaIeta();
102 double deltaPhiIn = ele.deltaPhiSuperClusterTrackAtVtx();
103 double deltaEtaIn = ele.deltaEtaSuperClusterTrackAtVtx();
110 }
else if (ele.isEE()) {
122 double chi2 = trk->chi2();
123 double ndof = trk->ndof();
128 double trkd0 = trk->d0();
130 trkd0 = -(trk->dxy(
beamSpot->position()));
132 edm::LogError(
"ElectronTrackProducer") <<
"Error >> Failed to get BeamSpot for label: " <<
bsTag_;
134 if (std::fabs(trkd0) >=
maxD0_)
157 lv.SetPtEtaPhiE(ele.pt(), ele.eta(), ele.phi(), ele.energy());
159 chrgeList.push_back(ele.charge());
160 finalelectrons.push_back(ele);
171 if (vertexColl->empty()) {
172 edm::LogError(
"DqmTrackStudy") <<
"No good vertex in the event!!";
178 if (!
iEvent.isRealData()) {
183 for (
auto const&
v : *PupInfo) {
184 int bx =
v.getBunchCrossing();
199 for (
unsigned int I = 0;
I != finalelectrons.size();
I++) {
201 finalelectrons[
I].superCluster()->
phi(),
202 finalelectrons[
I].eEleClusterOverPout(),
206 if (list.size() >= 2) {
207 if (chrgeList[0] + chrgeList[1] == 0) {
209 TLorentzVector
zv = list[0] + list[1];
int numberOfValidPixelHits() const
std::string puScaleFactorFile_
const edm::InputTag puSummaryTag_
virtual void setCurrentFolder(std::string const &fullpath)
const std::string trackQuality_
float sumPUPt
sum pt of charged Particles not from PV (for Pu corrections)
const edm::InputTag electronTag_
bool isNonnull() const
Checks for non-null.
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< float > vpu_
Log< level::Error, false > LogError
std::vector< Vertex > VertexCollection
const double maxDeltaPhiInEE_
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
void analyze(edm::Event const &iEvent, edm::EventSetup const &iSetup) override
int numberOfValidStripHits() const
const edm::EDGetTokenT< reco::BeamSpot > bsToken_
const edm::EDGetTokenT< std::vector< PileupSummaryInfo > > puSummaryToken_
const double maxDeltaEtaInEB_
const edm::EDGetTokenT< reco::GsfElectronCollection > electronToken_
const double maxDeltaEtaInEE_
float sumPhotonEt
sum pt of PF photons // old float photonIso ;
const std::complex< double > I
const double maxNormChi2_
#define DEFINE_FWK_MODULE(type)
float sumNeutralHadronEt
sum pt of neutral hadrons // old float neutralHadronIso ;
const double maxDeltaPhiInEB_
const edm::InputTag vertexTag_
static TrackQuality qualityByName(const std::string &name)
ZEEDetails(const edm::ParameterSet &)
const edm::EDGetTokenT< reco::VertexCollection > vertexToken_
const double maxSigmaiEiEEE_
const double minPtHighest_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
const double maxSigmaiEiEEB_
MonitorElement * ZInvMass_
float sumChargedHadronPt
sum-pt of charged Hadron // old float chargedHadronIso ;
const edm::InputTag bsTag_
MonitorElement * book3D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ, FUNC onbooking=NOOP())