62 gsfElecToken_ = consumes<reco::GsfElectronCollection>(
64 gsfElectronCollection_));
65 convToken_ = consumes<reco::ConversionCollection>(
67 conversionCollection_));
69 isRunCentrally_= pset.
getParameter<
bool>(
"isRunCentrally");
72 eleExpectedHitsInnerMax_ = pset.
getParameter<
int>(
"eleExpectedHitsInnerMax");
74 offline_pvToken_ = consumes<reco::VertexCollection>(
77 beamspotToken_ = consumes<reco::BeamSpot>(
91 double ptMin = parameters_.getParameter<
double>(
"ptMin");
92 double ptMax = parameters_.getParameter<
double>(
"ptMax");
93 int ptBin = parameters_.getParameter<
int>(
"ptBin");
95 double trackptMin = parameters_.getParameter<
double>(
"trackptMin");
96 double trackptMax = parameters_.getParameter<
double>(
"trackptMax");
97 int trackptBin = parameters_.getParameter<
int>(
"trackptBin");
99 double etaMin = parameters_.getParameter<
double>(
"etaMin");
100 double etaMax = parameters_.getParameter<
double>(
"etaMax");
101 int etaBin = parameters_.getParameter<
int>(
"etaBin");
105 int phiBin = parameters_.getParameter<
int>(
"phiBin");
108 double rhoMin = parameters_.getParameter<
double>(
"rhoMin");
109 double rhoMax = parameters_.getParameter<
double>(
"rhoMax");
110 int rhoBin = parameters_.getParameter<
int>(
"rhoBin");
112 double zMin = parameters_.getParameter<
double>(
"zMin");
113 double zMax = parameters_.getParameter<
double>(
"zMax");
114 int zBin = parameters_.getParameter<
int>(
"zBin");
125 h_elePtAll_ = ibooker.
book1D(
"elePtAll",
"# of Electrons", ptBin, ptMin, ptMax);
126 h_eleEtaAll_ = ibooker.
book1D(
"eleEtaAll",
"# of Electrons", etaBin, etaMin, etaMax);
127 h_elePhiAll_ = ibooker.
book1D(
"elePhiAll",
"# of Electrons", phiBin, phiMin, phiMax);
129 h_elePtPass_ = ibooker.
book1D(
"elePtPass",
"# of Electrons", ptBin, ptMin, ptMax);
130 h_eleEtaPass_ = ibooker.
book1D(
"eleEtaPass",
"# of Electrons", etaBin, etaMin, etaMax);
131 h_elePhiPass_ = ibooker.
book1D(
"elePhiPass",
"# of Electrons", phiBin, phiMin, phiMax);
133 h_elePtFail_ = ibooker.
book1D(
"elePtFail",
"# of Electrons", ptBin, ptMin, ptMax);
134 h_eleEtaFail_ = ibooker.
book1D(
"eleEtaFail",
"# of Electrons",etaBin, etaMin, etaMax);
135 h_elePhiFail_ = ibooker.
book1D(
"elePhiFail",
"# of Electrons", phiBin, phiMin, phiMax);
137 h_convPt_ = ibooker.
book1D(
"convPt",
"# of Electrons", ptBin, ptMin, ptMax);
138 h_convEta_ = ibooker.
book1D(
"convEta",
"# of Electrons", etaBin, etaMin, etaMax);
139 h_convPhi_ = ibooker.
book1D(
"convPhi",
"# of Electrons", phiBin, phiMin, phiMax);
140 h_convRho_ = ibooker.
book1D(
"convRho",
"# of Electrons", rhoBin, rhoMin, rhoMax);
141 h_convZ_ = ibooker.
book1D(
"convZ",
"# of Electrons", zBin, zMin, zMax);
142 h_convProb_ = ibooker.
book1D(
"convProb",
"# of Electrons", 100, 0.0, 1.0);
144 h_convLeadTrackpt_ = ibooker.
book1D(
"convLeadTrackpt",
"# of Electrons", trackptBin,
145 trackptMin, trackptMax);
147 h_convTrailTrackpt_ = ibooker.
book1D(
"convTrailTrackpt",
"# of Electrons", trackptBin,
148 trackptMin, trackptMax);
150 h_convLog10TrailTrackpt_ = ibooker.
book1D(
"convLog10TrailTrackpt",
"# of Electrons",
153 h_convLeadTrackAlgo_ = ibooker.
book1D(
"convLeadTrackAlgo",
"# of Electrons", 31, -0.5, 30.5);
154 h_convTrailTrackAlgo_ = ibooker.
book1D(
"convLeadTrackAlgo",
"# of Electrons", 31, -0.5, 30.5);
163 LogInfo(
"ElectronConversionRejectionValidator")
164 <<
"ElectronConversionRejectionValidator Analyzing event number: "
165 << e.
id() <<
" Global Counter " << nEvt_ <<
"\n";
170 if (!convHandle.isValid()) {
172 <<
"Error! Can't get the Conversion collection "<< std::endl;
178 e.
getByToken(gsfElecToken_, gsfElectronHandle);
180 if (!gsfElectronHandle.isValid()) {
182 <<
"Error! Can't get the Electron collection "<< std::endl;
189 if (!vertexHandle.isValid()) {
191 <<
"Error! Can't get the product primary Vertex Collection "<<
"\n";
198 if (!bsHandle.isValid()) {
200 <<
"Error! Can't get the product beamspot Collection "<<
"\n";
207 for (reco::GsfElectronCollection::const_iterator iele = gsfElectronCollection.begin(); iele!=gsfElectronCollection.end(); ++iele) {
210 if (iele->pt() < elePtMin_)
continue;
212 if (
std::abs(iele->gsfTrack()->dxy(thevtx.position())) > eleD0Max_ )
continue;
215 h_elePtAll_->Fill(iele->pt());
216 h_eleEtaAll_->Fill(iele->eta());
217 h_elePhiAll_->Fill(iele->phi());
224 h_elePtPass_->Fill(iele->pt());
225 h_eleEtaPass_->Fill(iele->eta());
226 h_elePhiPass_->Fill(iele->phi());
235 h_elePtFail_->Fill(iele->pt());
236 h_eleEtaFail_->Fill(iele->eta());
237 h_elePhiFail_->Fill(iele->phi());
241 h_convPt_->Fill(convmom.rho());
242 h_convEta_->Fill(convmom.eta());
243 h_convPhi_->Fill(convmom.phi());
244 h_convRho_->Fill(convref->conversionVertex().position().rho());
245 h_convZ_->Fill(convref->conversionVertex().position().z());
246 h_convProb_->Fill(
ChiSquaredProbability(convref->conversionVertex().chi2(),convref->conversionVertex().ndof()));
249 if (convref->tracks().size()<2)
continue;
256 if (tk1->
pt() >= tk2->
pt()) {
264 h_convLeadTrackpt_->Fill(tklead->
pt());
265 h_convTrailTrackpt_->Fill(tktrail->
pt());
266 h_convLog10TrailTrackpt_->Fill(log10(tktrail->
pt()));
267 h_convLeadTrackAlgo_->Fill(tklead->
algo());
268 h_convTrailTrackAlgo_->Fill(tktrail->
algo());
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
ElectronConversionRejectionValidator(const edm::ParameterSet &)
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
TrackAlgorithm algo() const
virtual ~ElectronConversionRejectionValidator()
double pt() const
track transverse momentum
MonitorElement * book1D(Args &&...args)
Abs< T >::type abs(const T &t)
float ChiSquaredProbability(double chiSquared, double nrDOF)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
bool isNull() const
Checks for null.
void bookHistograms(DQMStore::IBooker &bei, edm::Run const &, edm::EventSetup const &) override
void setCurrentFolder(const std::string &fullpath)