60 gsfElectronCollectionProducer_ = pset.
getParameter<std::string>(
"gsfElectronProducer");
61 gsfElectronCollection_ = pset.
getParameter<std::string>(
"gsfElectronCollection");
63 conversionCollectionProducer_ = pset.
getParameter<std::string>(
"convProducer");
64 conversionCollection_ = pset.
getParameter<std::string>(
"conversionCollection");
67 isRunCentrally_= pset.
getParameter<
bool>(
"isRunCentrally");
70 eleExpectedHitsInnerMax_ = pset.
getParameter<
int>(
"eleExpectedHitsInnerMax");
94 double ptMin = parameters_.getParameter<
double>(
"ptMin");
95 double ptMax = parameters_.getParameter<
double>(
"ptMax");
96 int ptBin = parameters_.getParameter<
int>(
"ptBin");
98 double trackptMin = parameters_.getParameter<
double>(
"trackptMin");
99 double trackptMax = parameters_.getParameter<
double>(
"trackptMax");
100 int trackptBin = parameters_.getParameter<
int>(
"trackptBin");
106 double etaMin = parameters_.getParameter<
double>(
"etaMin");
107 double etaMax = parameters_.getParameter<
double>(
"etaMax");
108 int etaBin = parameters_.getParameter<
int>(
"etaBin");
112 int phiBin = parameters_.getParameter<
int>(
"phiBin");
115 double rhoMin = parameters_.getParameter<
double>(
"rhoMin");
116 double rhoMax = parameters_.getParameter<
double>(
"rhoMax");
117 int rhoBin = parameters_.getParameter<
int>(
"rhoBin");
119 double zMin = parameters_.getParameter<
double>(
"zMin");
120 double zMax = parameters_.getParameter<
double>(
"zMax");
121 int zBin = parameters_.getParameter<
int>(
"zBin");
152 h_elePtAll_ =
dbe_->
book1D(
"elePtAll",
"# of Electrons",ptBin,ptMin,ptMax);
153 h_eleEtaAll_ =
dbe_->
book1D(
"eleEtaAll",
"# of Electrons",etaBin,etaMin,etaMax);
154 h_elePhiAll_ =
dbe_->
book1D(
"elePhiAll",
"# of Electrons",phiBin,phiMin,phiMax);
156 h_elePtPass_ =
dbe_->
book1D(
"elePtPass",
"# of Electrons",ptBin,ptMin,ptMax);
157 h_eleEtaPass_ =
dbe_->
book1D(
"eleEtaPass",
"# of Electrons",etaBin,etaMin,etaMax);
158 h_elePhiPass_ =
dbe_->
book1D(
"elePhiPass",
"# of Electrons",phiBin,phiMin,phiMax);
160 h_elePtFail_ =
dbe_->
book1D(
"elePtFail",
"# of Electrons",ptBin,ptMin,ptMax);
161 h_eleEtaFail_ =
dbe_->
book1D(
"eleEtaFail",
"# of Electrons",etaBin,etaMin,etaMax);
162 h_elePhiFail_ =
dbe_->
book1D(
"elePhiFail",
"# of Electrons",phiBin,phiMin,phiMax);
164 h_convPt_ =
dbe_->
book1D(
"convPt",
"# of Electrons",ptBin,ptMin,ptMax);
165 h_convEta_ =
dbe_->
book1D(
"convEta",
"# of Electrons",etaBin,etaMin,etaMax);
166 h_convPhi_ =
dbe_->
book1D(
"convPhi",
"# of Electrons",phiBin,phiMin,phiMax);
167 h_convRho_ =
dbe_->
book1D(
"convRho",
"# of Electrons",rhoBin,rhoMin,rhoMax);
168 h_convZ_ =
dbe_->
book1D(
"convZ",
"# of Electrons",zBin,zMin,zMax);
169 h_convProb_ =
dbe_->
book1D(
"convProb",
"# of Electrons",100,0.0,1.0);
171 h_convLeadTrackpt_ =
dbe_->
book1D(
"convLeadTrackpt",
"# of Electrons",trackptBin,trackptMin,trackptMax);
172 h_convTrailTrackpt_ =
dbe_->
book1D(
"convTrailTrackpt",
"# of Electrons",trackptBin,trackptMin,trackptMax);
173 h_convLog10TrailTrackpt_ =
dbe_->
book1D(
"convLog10TrailTrackpt",
"# of Electrons",ptBin,-2.0,3.0);
175 h_convLeadTrackAlgo_ =
dbe_->
book1D(
"convLeadTrackAlgo",
"# of Electrons",31,-0.5,30.5);
176 h_convTrailTrackAlgo_ =
dbe_->
book1D(
"convLeadTrackAlgo",
"# of Electrons",31,-0.5,30.5);
205 LogInfo(
"ElectronConversionRejectionValidator") <<
"ElectronConversionRejectionValidator Analyzing event number: " << e.
id() <<
" Global Counter " << nEvt_ <<
"\n";
212 e.
getByLabel(conversionCollectionProducer_, conversionCollection_ , convHandle);
213 if (!convHandle.isValid()) {
214 edm::LogError(
"ElectronConversionRejectionValidator") <<
"Error! Can't get the Conversion collection "<< std::endl;
220 e.
getByLabel(gsfElectronCollectionProducer_, gsfElectronCollection_ , gsfElectronHandle);
222 if (!gsfElectronHandle.isValid()) {
223 edm::LogError(
"ElectronConversionRejectionValidator") <<
"Error! Can't get the Electron collection "<< std::endl;
229 e.
getByLabel(
"offlinePrimaryVertices", vertexHandle);
230 if (!vertexHandle.isValid()) {
231 edm::LogError(
"ElectronConversionRejectionValidator") <<
"Error! Can't get the product primary Vertex Collection "<<
"\n";
238 if (!bsHandle.isValid()) {
239 edm::LogError(
"ElectronConversionRejectionValidator") <<
"Error! Can't get the product beamspot Collection "<<
"\n";
246 for (reco::GsfElectronCollection::const_iterator iele = gsfElectronCollection.begin(); iele!=gsfElectronCollection.end(); ++iele) {
249 if (iele->pt() < elePtMin_)
continue;
250 if (iele->gsfTrack()->trackerExpectedHitsInner().numberOfHits() > eleExpectedHitsInnerMax_)
continue;
251 if (
std::abs(iele->gsfTrack()->dxy(thevtx.position())) > eleD0Max_ )
continue;
254 h_elePtAll_->Fill(iele->pt());
255 h_eleEtaAll_->Fill(iele->eta());
256 h_elePhiAll_->Fill(iele->phi());
263 h_elePtPass_->Fill(iele->pt());
264 h_eleEtaPass_->Fill(iele->eta());
265 h_elePhiPass_->Fill(iele->phi());
274 h_elePtFail_->Fill(iele->pt());
275 h_eleEtaFail_->Fill(iele->eta());
276 h_elePhiFail_->Fill(iele->phi());
280 h_convPt_->Fill(convmom.rho());
281 h_convEta_->Fill(convmom.eta());
282 h_convPhi_->Fill(convmom.phi());
283 h_convRho_->Fill(convref->conversionVertex().position().rho());
284 h_convZ_->Fill(convref->conversionVertex().position().z());
285 h_convProb_->Fill(
ChiSquaredProbability(convref->conversionVertex().chi2(),convref->conversionVertex().ndof()));
288 if (convref->tracks().size()<2)
continue;
295 if (tk1->
pt() >= tk2->
pt()) {
303 h_convLeadTrackpt_->Fill(tklead->
pt());
304 h_convTrailTrackpt_->Fill(tktrail->
pt());
305 h_convLog10TrailTrackpt_->Fill(log10(tktrail->
pt()));
306 h_convLeadTrackAlgo_->Fill(tklead->
algo());
307 h_convTrailTrackAlgo_->Fill(tktrail->
algo());
321 std::string
outputFileName = parameters_.getParameter<std::string>(
"OutputFileName");
322 if ( ! isRunCentrally_ ) {
326 edm::LogInfo(
"ElectronConversionRejectionValidator") <<
"Analyzed " << nEvt_ <<
"\n";
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
virtual void analyze(const edm::Event &, const edm::EventSetup &)
ElectronConversionRejectionValidator(const edm::ParameterSet &)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
TrackAlgorithm algo() const
bool isNull() const
Checks for null.
virtual ~ElectronConversionRejectionValidator()
double pt() const
track transverse momentum
float ChiSquaredProbability(double chiSquared, double nrDOF)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual void endRun(edm::Run &r, edm::EventSetup const &es)
void setCurrentFolder(const std::string &fullpath)
virtual void beginRun(edm::Run const &r, edm::EventSetup const &theEventSetup)