28 : theDQMRootFileName(iConfig.getUntrackedParameter<
std::
string>(
"DQMRootFileName")),
30 recoRecoToSimCollectionToken_(
32 recoSimToRecoCollectionToken_(
34 trackingVertexCollection_Token_(
36 vec_recoVertex_Token_(
39 iConfig.getUntrackedParameter<
edm::
InputTag>(
"kShortCollection"))),
41 iConfig.getUntrackedParameter<
edm::
InputTag>(
"lambdaCollection"))) {}
46 double minKsMass = 0.49767 - 0.07;
47 double maxKsMass = 0.49767 + 0.07;
48 double minLamMass = 1.1156 - 0.05;
49 double maxLamMass = 1.1156 + 0.05;
50 int ksMassNbins = 100;
51 double ksMassXmin = minKsMass;
52 double ksMassXmax = maxKsMass;
53 int lamMassNbins = 100;
54 double lamMassXmin = minLamMass;
55 double lamMassXmax = maxLamMass;
62 ibooker.
book1D(
"K0sEffVsR_num",
"K^{0}_{S} Efficiency vs #rho", 80, 0., 40.);
64 ibooker.
book1D(
"K0sEffVsEta_num",
"K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
66 ibooker.
book1D(
"K0sEffVsPt_num",
"K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);
69 ibooker.
book1D(
"K0sTkEffVsR_num",
"K^{0}_{S} Tracking Efficiency vs #rho", 80, 0., 40.);
71 ibooker.
book1D(
"K0sTkEffVsEta_num",
"K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
73 ibooker.
book1D(
"K0sTkEffVsPt_num",
"K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);
76 ibooker.
book1D(
"K0sEffVsR_denom",
"K^{0}_{S} Efficiency vs #rho", 80, 0., 40.);
78 ibooker.
book1D(
"K0sEffVsEta_denom",
"K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
80 ibooker.
book1D(
"K0sEffVsPt_denom",
"K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);
83 ibooker.
book1D(
"K0sFakeVsR_num",
"K^{0}_{S} Fake Rate vs #rho", 80, 0., 40.);
85 ibooker.
book1D(
"K0sFakeVsEta_num",
"K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
87 ibooker.
book1D(
"K0sFakeVsPt_num",
"K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
89 ibooker.
book1D(
"K0sTkFakeVsR_num",
"K^{0}_{S} Tracking Fake Rate vs #rho", 80, 0., 80.);
91 ibooker.
book1D(
"K0sTkFakeVsEta_num",
"K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
93 ibooker.
book1D(
"K0sTkFakeVsPt_num",
"K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
96 ibooker.
book1D(
"K0sFakeVsR_denom",
"K^{0}_{S} Fake Rate vs #rho", 80, 0., 40.);
98 ibooker.
book1D(
"K0sFakeVsEta_denom",
"K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
100 ibooker.
book1D(
"K0sFakeVsPt_denom",
"K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
103 ibooker.
book1D(
"ksMassFake",
"Mass of fake K0S", ksMassNbins, minKsMass, maxKsMass);
105 ibooker.
book1D(
"ksMassGood",
"Mass of good reco K0S", ksMassNbins, minKsMass, maxKsMass);
107 ibooker.
book1D(
"ksMassAll",
"Invariant mass of all K0S", ksMassNbins, ksMassXmin, ksMassXmax);
109 ibooker.
book1D(
"radDistFakeKs",
"Production radius of daughter particle of Ks fake", 100, 0., 15.);
118 ibooker.
book1D(
"LamEffVsR_num",
"#Lambda^{0} Efficiency vs #rho", 80, 0., 40.);
120 ibooker.
book1D(
"LamEffVsEta_num",
"#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
122 ibooker.
book1D(
"LamEffVsPt_num",
"#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
125 ibooker.
book1D(
"LamTkEffVsR_num",
"#Lambda^{0} TrackingEfficiency vs #rho", 80, 0., 40.);
127 ibooker.
book1D(
"LamTkEffVsEta_num",
"#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
129 ibooker.
book1D(
"LamTkEffVsPt_num",
"#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
132 ibooker.
book1D(
"LamEffVsR_denom",
"#Lambda^{0} Efficiency vs #rho", 80, 0., 40.);
134 ibooker.
book1D(
"LamEffVsEta_denom",
"#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
136 ibooker.
book1D(
"LamEffVsPt_denom",
"#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
139 ibooker.
book1D(
"LamFakeVsR_num",
"#Lambda^{0} Fake Rate vs #rho", 80, 0., 40.);
141 ibooker.
book1D(
"LamFakeVsEta_num",
"#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
143 ibooker.
book1D(
"LamFakeVsPt_num",
"#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
145 ibooker.
book1D(
"LamTkFakeVsR_num",
"#Lambda^{0} Tracking Fake Rate vs #rho", 80, 0., 40.);
147 ibooker.
book1D(
"LamTkFakeVsEta_num",
"#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
149 ibooker.
book1D(
"LamTkFakeVsPt_num",
"#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
152 ibooker.
book1D(
"LamFakeVsR_denom",
"#Lambda^{0} Fake Rate vs #rho", 80, 0., 40.);
154 ibooker.
book1D(
"LamFakeVsEta_denom",
"#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
156 ibooker.
book1D(
"LamFakeVsPt_denom",
"#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
160 ibooker.
book1D(
"lamMassFake",
"Mass of fake Lambda", lamMassNbins, minLamMass, maxLamMass);
162 ibooker.
book1D(
"lamMassGood",
"Mass of good Lambda", lamMassNbins, minLamMass, maxLamMass);
165 ibooker.
book1D(
"lamMassAll",
"Invariant mass of all #Lambda^{0}", lamMassNbins, lamMassXmin, lamMassXmax);
167 ibooker.
book1D(
"radDistFakeLam",
"Production radius of daughter particle of Lam fake", 100, 0., 15.);
176 int misreconstructed_particle_pdgid) {
179 int numCandidateFound = 0;
181 float CandidatepT = 0.;
182 float CandidateEta = 0.;
183 float CandidateR = 0.;
184 int CandidateStatus = 0;
185 const unsigned int NUM_DAUGHTERS = 2;
187 for (reco::VertexCompositeCandidateCollection::const_iterator iCandidate =
collection.begin();
191 mass = iCandidate->mass();
192 CandidatepT = (
sqrt(iCandidate->momentum().perp2()));
193 CandidateEta = iCandidate->momentum().eta();
194 CandidateR = (
sqrt(iCandidate->vertex().perp2()));
198 std::array<reco::TrackRef, NUM_DAUGHTERS> theDaughterTracks = {
206 std::array<double, NUM_DAUGHTERS> radDist;
209 radDist = {{-1., -1.}};
213 if (recotosimCollection.
find(
track) != recotosimCollection.
end()) {
214 const std::vector<std::pair<TrackingParticleRef, double> >&
tp = recotosimCollection[
track];
216 tpref =
tp.begin()->first;
220 radDist[
i] = parentVertex->position().R();
222 if (candidateVtx->position() == parentVertex->position()) {
223 if (parentVertex->nDaughterTracks() == 2) {
224 if (parentVertex->nSourceTracks() == 0) {
232 iTP != parentVertex->sourceTracks_end();
234 if (
abs((*iTP)->pdgId()) == particle_pdgid) {
236 numCandidateFound += 1.;
240 if (
abs((*iTP)->pdgId()) == misreconstructed_particle_pdgid) {
259 candidateVtx = parentVertex;
270 if (CandidateStatus > 1) {
281 if (CandidateStatus == 5) {
296 int parent_particle_id,
297 int first_daughter_id,
298 int second_daughter_id,
307 std::set<V0Couple> reconstructed_V0_couples;
309 for (reco::VertexCompositeCandidateCollection::const_iterator iCandidate =
collection.begin();
312 reconstructed_V0_couples.insert(
313 V0Couple((dynamic_cast<const reco::RecoChargedCandidate*>(iCandidate->daughter(0)))->track(),
328 unsigned int candidateEff[2] = {0, 0};
329 for (
auto const& gen_vertex : gen_vertices) {
330 if (gen_vertex.eventId().bunchCrossing() != 0)
332 if (gen_vertex.nDaughterTracks() != 2)
336 if (
std::abs((*source)->pdgId()) == parent_particle_id) {
337 if ((
std::abs((gen_vertex.daughterTracks().at(0))->
pdgId()) == first_daughter_id &&
338 std::abs((gen_vertex.daughterTracks().at(1))->
pdgId()) == second_daughter_id) ||
339 (
std::abs((gen_vertex.daughterTracks().at(0))->
pdgId()) == second_daughter_id &&
340 std::abs((gen_vertex.daughterTracks().at(1))->
pdgId()) == first_daughter_id)) {
341 if ((
std::abs((gen_vertex.daughterTracks().at(0))->momentum().eta()) < 2.4 &&
342 gen_vertex.daughterTracks().at(0)->pt() > 0.9) &&
343 (
std::abs((gen_vertex.daughterTracks().at(1))->momentum().eta()) < 2.4 &&
344 gen_vertex.daughterTracks().at(1)->pt() > 0.9)) {
346 float candidateGenpT =
sqrt((*source)->momentum().perp2());
347 float candidateGenEta = (*source)->momentum().eta();
348 float candidateGenR =
sqrt((*source)->vertex().perp2());
353 std::array<reco::TrackRef, 2> reco_daughter;
355 for (
unsigned int daughter = 0; daughter < 2; ++daughter) {
356 if (simtorecoCollection.
find(gen_vertex.daughterTracks()[daughter]) != simtorecoCollection.
end()) {
357 if (!simtorecoCollection[gen_vertex.daughterTracks()[daughter]].
empty()) {
358 candidateEff[daughter] = 1;
359 reco_daughter[daughter] =
360 simtorecoCollection[gen_vertex.daughterTracks()[daughter]].
begin()->first.castTo<
reco::TrackRef>();
363 candidateEff[daughter] = 2;
366 if ((candidateEff[0] == 1 && candidateEff[1] == 1) && (reco_daughter[0].key() != reco_daughter[1].key()) &&
367 (reconstructed_V0_couples.find(
V0Couple(reco_daughter[0], reco_daughter[1])) !=
368 reconstructed_V0_couples.end())) {
401 std::vector<reco::Vertex>::const_iterator iVtxPH = primaryVtxCollectionH->begin();
402 for (std::vector<reco::Vertex>::const_iterator iVtx = primaryVtxCollectionH->begin();
403 iVtx < primaryVtxCollectionH->end();
405 if (primaryVtxCollectionH->size() > 1) {
406 if (iVtx->tracksSize() > iVtxPH->tracksSize()) {
431 *simtorecoCollectionH.
product());
441 *simtorecoCollectionH.
product());
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::vector< VertexCompositeCandidate > VertexCompositeCandidateCollection
collection of Candidate objects
edm::EDGetTokenT< reco::SimToRecoCollection > recoSimToRecoCollectionToken_
V0Validator(const edm::ParameterSet &)
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > recoVertexCompositeCandidateCollection_k0s_Token_
std::array< MonitorElement *, 2 > candidateStatus_
virtual void setCurrentFolder(std::string const &fullpath)
edm::RefVector< edm::HepMCProduct, HepMC::GenParticle > GenParticleRefVector
std::array< MonitorElement *, 2 > candidateEffVsEta_num_
std::array< MonitorElement *, 2 > candidateFakeVsEta_num_
T const * product() const
std::array< MonitorElement *, 2 > candidateFakeVsR_denom_
std::array< MonitorElement *, 2 > goodCandidateMass
std::array< MonitorElement *, 2 > candidateTkEffVsPt_num_
bool isNonnull() const
Checks for non-null.
std::array< MonitorElement *, 2 > fakeCandidateMass_
edm::AssociationMap< edm::OneToManyWithQualityGeneric< CaloParticleCollection, reco::CaloClusterCollection, std::pair< float, float > > > SimToRecoCollection
std::array< MonitorElement *, 2 > candidateEffVsPt_num_
std::array< MonitorElement *, 2 > candidateEffVsR_denom_
std::array< MonitorElement *, 2 > candidateFakeVsR_num_
bool empty() const
return true if empty
const_iterator find(const key_type &k) const
find element with specified reference key
std::array< MonitorElement *, 2 > candidateFakeDauRadDist_
std::array< MonitorElement *, 2 > candidateTkFakeVsEta_num_
std::array< MonitorElement *, 2 > candidateTkEffVsEta_num_
const_iterator end() const
last iterator over the map (read only)
edm::Ref< TrackingVertexCollection > TrackingVertexRef
std::array< MonitorElement *, 2 > candidateTkEffVsR_num_
std::array< MonitorElement *, 2 > candidateFakeVsPt_num_
std::array< MonitorElement *, 2 > candidateTkFakeVsR_num_
edm::EDGetTokenT< TrackingVertexCollection > trackingVertexCollection_Token_
void analyze(const edm::Event &, const edm::EventSetup &) override
std::array< MonitorElement *, 2 > candidateTkFakeVsPt_num_
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< std::vector< reco::Vertex > > vec_recoVertex_Token_
std::array< MonitorElement *, 2 > nCandidates_
void doFakeRates(const reco::VertexCompositeCandidateCollection &collection, const reco::RecoToSimCollection &recotosimCollection, V0Type t, int particle_pdgid, int misreconstructed_particle_pdgid)
std::array< MonitorElement *, 2 > candidateFakeVsPt_denom_
std::vector< TrackingVertex > TrackingVertexCollection
edm::RefVector< edm::HepMCProduct, HepMC::GenVertex > GenVertexRefVector
std::array< MonitorElement *, 2 > candidateFakeVsEta_denom_
const_iterator begin() const
first iterator over the map (read only)
std::array< MonitorElement *, 2 > candidateEffVsPt_denom_
std::array< MonitorElement *, 2 > candidateMassAll
edm::EDGetTokenT< reco::RecoToSimCollection > recoRecoToSimCollectionToken_
edm::EDGetTokenT< reco::VertexCompositeCandidateCollection > recoVertexCompositeCandidateCollection_lambda_Token_
std::array< MonitorElement *, 2 > candidateEffVsR_num_
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
std::array< MonitorElement *, 2 > candidateEffVsEta_denom_
void doEfficiencies(const TrackingVertexCollection &gen_vertices, V0Type t, int parent_particle_id, int first_daughter_id, int second_daughter_id, const reco::VertexCompositeCandidateCollection &collection, const reco::SimToRecoCollection &simtorecoCollection)
static std::string const source
edm::AssociationMap< edm::OneToManyWithQualityGeneric< reco::CaloClusterCollection, CaloParticleCollection, float > > RecoToSimCollection
std::vector< TrackingVertex > TrackingVertexCollection