CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/Validation/RecoVertex/src/V0Validator.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    V0Validator
00004 // Class:      V0Validator
00005 // 
00013 //
00014 // Original Author:  Brian Drell
00015 //         Created:  Wed Feb 18 17:21:04 MST 2009
00016 // $Id: V0Validator.cc,v 1.8 2010/03/26 22:04:49 drell Exp $
00017 //
00018 //
00019 
00020 
00021 #include "Validation/RecoVertex/interface/V0Validator.h"
00022 #include "DataFormats/VertexReco/interface/VertexFwd.h"
00023 
00024 typedef std::vector<TrackingVertex> TrackingVertexCollection;
00025 typedef edm::Ref<TrackingVertexCollection> TrackingVertexRef;
00026 typedef edm::RefVector<edm::HepMCProduct, HepMC::GenVertex > GenVertexRefVector;
00027 typedef edm::RefVector<edm::HepMCProduct, HepMC::GenParticle > GenParticleRefVector;
00028 
00029 const double piMass = 0.13957018;
00030 const double piMassSquared = piMass*piMass;
00031 const double protonMass = 0.93827203;
00032 const double protonMassSquared = protonMass*protonMass;
00033 
00034 
00035 
00036 V0Validator::V0Validator(const edm::ParameterSet& iConfig) : 
00037   theDQMRootFileName(iConfig.getParameter<std::string>("DQMRootFileName")),
00038   k0sCollectionTag(iConfig.getParameter<edm::InputTag>("kShortCollection")),
00039   lamCollectionTag(iConfig.getParameter<edm::InputTag>("lambdaCollection")),
00040   dirName(iConfig.getParameter<std::string>("dirName")) {
00041   genLam = genK0s = realLamFoundEff = realK0sFoundEff = lamCandFound = 
00042     k0sCandFound = noTPforK0sCand = noTPforLamCand = realK0sFound = realLamFound = 0;
00043   theDQMstore = edm::Service<DQMStore>().operator->();
00044 }
00045 
00046 
00047 V0Validator::~V0Validator() {
00048 
00049 }
00050 
00051 //void V0Validator::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) {
00052 //void V0Validator::beginJob(const edm::EventSetup& iSetup) {
00053 //}
00054 
00055 //void V0Validator::beginJob(const edm::EventSetup& iSetup) {
00056 void V0Validator::beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) {
00057   //std::cout << "Running V0Validator" << std::endl;
00058   //theDQMstore = edm::Service<DQMStore>().operator->();
00059   //std::cout << "In beginJob() at line 1" << std::endl;
00060   //edm::Service<TFileService> fs;
00061 
00062   theDQMstore->cd();
00063   std::string subDirName = dirName + "/EffFakes";
00064   theDQMstore->setCurrentFolder(subDirName.c_str());
00065 
00066   ksEffVsR = theDQMstore->book1D("K0sEffVsR", 
00067                           "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
00068   ksEffVsEta = theDQMstore->book1D("K0sEffVsEta",
00069                             "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
00070   ksEffVsPt = theDQMstore->book1D("K0sEffVsPt",
00071                            "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
00072 
00073   ksTkEffVsR = theDQMstore->book1D("K0sTkEffVsR", 
00074                           "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
00075   ksTkEffVsEta = theDQMstore->book1D("K0sTkEffVsEta",
00076                             "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
00077   ksTkEffVsPt = theDQMstore->book1D("K0sTkEffVsPt",
00078                            "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);
00079 
00080   ksEffVsR_num = theDQMstore->book1D("K0sEffVsR_num", 
00081                           "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
00082   ksEffVsEta_num = theDQMstore->book1D("K0sEffVsEta_num",
00083                             "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
00084   ksEffVsPt_num = theDQMstore->book1D("K0sEffVsPt_num",
00085                            "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
00086 
00087   ksTkEffVsR_num = theDQMstore->book1D("K0sTkEffVsR_num", 
00088                           "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
00089   ksTkEffVsEta_num = theDQMstore->book1D("K0sTkEffVsEta_num",
00090                             "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
00091   ksTkEffVsPt_num = theDQMstore->book1D("K0sTkEffVsPt_num",
00092                            "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);;
00093 
00094 
00095   ksEffVsR_denom = theDQMstore->book1D("K0sEffVsR_denom", 
00096                           "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
00097   ksEffVsEta_denom = theDQMstore->book1D("K0sEffVsEta_denom",
00098                             "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
00099   ksEffVsPt_denom = theDQMstore->book1D("K0sEffVsPt_denom",
00100                            "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
00101 
00102 
00103   lamEffVsR = theDQMstore->book1D("LamEffVsR",
00104                            "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
00105   lamEffVsEta = theDQMstore->book1D("LamEffVsEta",
00106                              "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
00107   lamEffVsPt = theDQMstore->book1D("LamEffVsPt",
00108                             "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
00109 
00110 
00111   lamTkEffVsR = theDQMstore->book1D("LamTkEffVsR",
00112                            "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
00113   lamTkEffVsEta = theDQMstore->book1D("LamTkEffVsEta",
00114                              "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
00115   lamTkEffVsPt = theDQMstore->book1D("LamTkEffVsPt",
00116                             "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
00117 
00118   lamEffVsR_num = theDQMstore->book1D("LamEffVsR_num",
00119                            "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
00120   lamEffVsEta_num = theDQMstore->book1D("LamEffVsEta_num",
00121                              "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
00122   lamEffVsPt_num = theDQMstore->book1D("LamEffVsPt_num",
00123                             "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
00124 
00125 
00126   lamTkEffVsR_num = theDQMstore->book1D("LamTkEffVsR_num",
00127                            "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
00128   lamTkEffVsEta_num = theDQMstore->book1D("LamTkEffVsEta_num",
00129                              "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
00130   lamTkEffVsPt_num = theDQMstore->book1D("LamTkEffVsPt_num",
00131                             "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
00132 
00133 
00134   lamEffVsR_denom = theDQMstore->book1D("LamEffVsR_denom",
00135                            "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
00136   lamEffVsEta_denom = theDQMstore->book1D("LamEffVsEta_denom",
00137                              "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
00138   lamEffVsPt_denom = theDQMstore->book1D("LamEffVsPt_denom",
00139                             "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
00140 
00141   //theDQMstore->cd();
00142   //subDirName = dirName + "/Fake";
00143   //theDQMstore->setCurrentFolder(subDirName.c_str());
00144 
00145 
00146   ksFakeVsR = theDQMstore->book1D("K0sFakeVsR",
00147                            "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
00148   ksFakeVsEta = theDQMstore->book1D("K0sFakeVsEta",
00149                              "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
00150   ksFakeVsPt = theDQMstore->book1D("K0sFakeVsPt",
00151                             "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
00152   ksTkFakeVsR = theDQMstore->book1D("K0sTkFakeVsR",
00153                            "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
00154   ksTkFakeVsEta = theDQMstore->book1D("K0sTkFakeVsEta",
00155                              "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
00156   ksTkFakeVsPt = theDQMstore->book1D("K0sTkFakeVsPt",
00157                             "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
00158 
00159   ksFakeVsR_num = theDQMstore->book1D("K0sFakeVsR_num",
00160                            "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
00161   ksFakeVsEta_num = theDQMstore->book1D("K0sFakeVsEta_num",
00162                              "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
00163   ksFakeVsPt_num = theDQMstore->book1D("K0sFakeVsPt_num",
00164                             "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
00165   ksTkFakeVsR_num = theDQMstore->book1D("K0sTkFakeVsR_num",
00166                            "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
00167   ksTkFakeVsEta_num = theDQMstore->book1D("K0sTkFakeVsEta_num",
00168                              "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
00169   ksTkFakeVsPt_num = theDQMstore->book1D("K0sTkFakeVsPt_num",
00170                             "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
00171 
00172   ksFakeVsR_denom = theDQMstore->book1D("K0sFakeVsR_denom",
00173                            "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
00174   ksFakeVsEta_denom = theDQMstore->book1D("K0sFakeVsEta_denom",
00175                              "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
00176   ksFakeVsPt_denom = theDQMstore->book1D("K0sFakeVsPt_denom",
00177                             "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
00178 
00179   lamFakeVsR = theDQMstore->book1D("LamFakeVsR",
00180                             "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
00181   lamFakeVsEta = theDQMstore->book1D("LamFakeVsEta",
00182                               "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
00183   lamFakeVsPt = theDQMstore->book1D("LamFakeVsPt",
00184                              "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
00185   lamTkFakeVsR = theDQMstore->book1D("LamTkFakeVsR",
00186                             "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
00187   lamTkFakeVsEta = theDQMstore->book1D("LamTkFakeVsEta",
00188                               "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
00189   lamTkFakeVsPt = theDQMstore->book1D("LamTkFakeVsPt",
00190                              "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
00191 
00192   lamFakeVsR_num = theDQMstore->book1D("LamFakeVsR_num",
00193                             "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
00194   lamFakeVsEta_num = theDQMstore->book1D("LamFakeVsEta_num",
00195                               "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
00196   lamFakeVsPt_num = theDQMstore->book1D("LamFakeVsPt_num",
00197                              "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
00198   lamTkFakeVsR_num = theDQMstore->book1D("LamTkFakeVsR_num",
00199                             "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
00200   lamTkFakeVsEta_num = theDQMstore->book1D("LamTkFakeVsEta_num",
00201                               "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
00202   lamTkFakeVsPt_num = theDQMstore->book1D("LamTkFakeVsPt_num",
00203                              "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
00204 
00205   lamFakeVsR_denom = theDQMstore->book1D("LamFakeVsR_denom",
00206                             "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
00207   lamFakeVsEta_denom = theDQMstore->book1D("LamFakeVsEta_denom",
00208                               "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
00209   lamFakeVsPt_denom = theDQMstore->book1D("LamFakeVsPt_denom",
00210                              "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
00211 
00212   theDQMstore->cd();
00213   subDirName = dirName + "/Other";
00214   theDQMstore->setCurrentFolder(subDirName.c_str());
00215 
00216   nKs = theDQMstore->book1D("nK0s",
00217                      "Number of K^{0}_{S} found per event", 60, 0., 60.);
00218   nLam = theDQMstore->book1D("nLam",
00219                       "Number of #Lambda^{0} found per event", 60, 0., 60.);
00220 
00221   ksXResolution = theDQMstore->book1D("ksXResolution",
00222                                "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
00223   ksYResolution = theDQMstore->book1D("ksYResolution",
00224                                "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
00225   ksZResolution = theDQMstore->book1D("ksZResolution",
00226                                "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
00227   lamXResolution = theDQMstore->book1D("lamXResolution",
00228                                 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
00229   lamYResolution = theDQMstore->book1D("lamYResolution",
00230                                 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
00231   lamZResolution = theDQMstore->book1D("lamZResolution",
00232                                 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
00233   ksAbsoluteDistResolution = theDQMstore->book1D("ksRResolution",
00234                                           "Resolution of absolute distance from primary vertex to V0 vertex",
00235                                           100, 0., 50.);
00236   lamAbsoluteDistResolution = theDQMstore->book1D("lamRResolution",
00237                                            "Resolution of absolute distance from primary vertex to V0 vertex",
00238                                            100, 0., 50.);
00239 
00240   ksCandStatus = theDQMstore->book1D("ksCandStatus",
00241                           "Fake type by cand status",
00242                           10, 0., 10.);
00243   lamCandStatus = theDQMstore->book1D("ksCandStatus",
00244                           "Fake type by cand status",
00245                           10, 0., 10.);
00246 
00247   double minKsMass = 0.49767 - 0.07;
00248   double maxKsMass = 0.49767 + 0.07;
00249   double minLamMass = 1.1156 - 0.05;
00250   double maxLamMass = 1.1156 + 0.05;
00251   int ksMassNbins = 100;
00252   double ksMassXmin = minKsMass;
00253   double ksMassXmax = maxKsMass;
00254   int lamMassNbins = 100;
00255   double lamMassXmin = minLamMass;
00256   double lamMassXmax = maxLamMass;
00257 
00258   fakeKsMass = theDQMstore->book1D("ksMassFake",
00259                              "Mass of fake K0S",
00260                              ksMassNbins, minKsMass, maxKsMass);
00261   goodKsMass = theDQMstore->book1D("ksMassGood",
00262                              "Mass of good reco K0S",
00263                              ksMassNbins, minKsMass, maxKsMass);
00264   fakeLamMass = theDQMstore->book1D("lamMassFake",
00265                               "Mass of fake Lambda",
00266                               lamMassNbins, minLamMass, maxLamMass);
00267   goodLamMass = theDQMstore->book1D("lamMassGood",
00268                               "Mass of good Lambda",
00269                               lamMassNbins, minLamMass, maxLamMass);
00270 
00271   ksMassAll = theDQMstore->book1D("ksMassAll",
00272                                   "Invariant mass of all K0S",
00273                                   ksMassNbins, ksMassXmin, ksMassXmax);
00274   lamMassAll = theDQMstore->book1D("lamMassAll",
00275                                    "Invariant mass of all #Lambda^{0}",
00276                                    lamMassNbins, lamMassXmin, lamMassXmax);
00277 
00278   ksFakeDauRadDist = theDQMstore->book1D("radDistFakeKs",
00279                                    "Production radius of daughter particle of Ks fake",
00280                                    100, 0., 15.);
00281   lamFakeDauRadDist = theDQMstore->book1D("radDistFakeLam",
00282                                     "Production radius of daughter particle of Lam fake",
00283                                     100, 0., 15.);
00284 
00285   /*
00286 
00287   ksEffVsRHist = new TH1F("K0sEffVsR", 
00288                           "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
00289   ksEffVsEtaHist = new TH1F("K0sEffVsEta",
00290                             "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
00291   ksEffVsPtHist = new TH1F("K0sEffVsPt",
00292                            "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
00293   ksFakeVsRHist = new TH1F("K0sFakeVsR",
00294                            "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
00295   ksFakeVsEtaHist = new TH1F("K0sFakeVsEta",
00296                              "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
00297   ksFakeVsPtHist = new TH1F("K0sFakeVsPt",
00298                             "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
00299 
00300   ksTkEffVsRHist = new TH1F("K0sTkEffVsR", 
00301                           "K^{0}_{S} Tracking Efficiency vs #rho", 40, 0., 40.);
00302   ksTkEffVsEtaHist = new TH1F("K0sTkEffVsEta",
00303                             "K^{0}_{S} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
00304   ksTkEffVsPtHist = new TH1F("K0sTkEffVsPt",
00305                            "K^{0}_{S} Tracking Efficiency vs p_{T}", 70, 0., 20.);;
00306   ksTkFakeVsRHist = new TH1F("K0sTkFakeVsR",
00307                            "K^{0}_{S} Tracking Fake Rate vs #rho", 40, 0., 40.);
00308   ksTkFakeVsEtaHist = new TH1F("K0sTkFakeVsEta",
00309                              "K^{0}_{S} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
00310   ksTkFakeVsPtHist = new TH1F("K0sTkFakeVsPt",
00311                             "K^{0}_{S} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
00312 
00313   ksEffVsRHist_denom = new TH1F("K0sEffVsR_denom", 
00314                           "K^{0}_{S} Efficiency vs #rho", 40, 0., 40.);
00315   ksEffVsEtaHist_denom = new TH1F("K0sEffVsEta_denom",
00316                             "K^{0}_{S} Efficiency vs #eta", 40, -2.5, 2.5);
00317   ksEffVsPtHist_denom = new TH1F("K0sEffVsPt_denom",
00318                            "K^{0}_{S} Efficiency vs p_{T}", 70, 0., 20.);;
00319   ksFakeVsRHist_denom = new TH1F("K0sFakeVsR_denom",
00320                            "K^{0}_{S} Fake Rate vs #rho", 40, 0., 40.);
00321   ksFakeVsEtaHist_denom = new TH1F("K0sFakeVsEta_denom",
00322                              "K^{0}_{S} Fake Rate vs #eta", 40, -2.5, 2.5);
00323   ksFakeVsPtHist_denom = new TH1F("K0sFakeVsPt_denom",
00324                             "K^{0}_{S} Fake Rate vs p_{T}", 70, 0., 20.);
00325 
00326   lamEffVsRHist = new TH1F("LamEffVsR",
00327                            "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
00328   lamEffVsEtaHist = new TH1F("LamEffVsEta",
00329                              "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
00330   lamEffVsPtHist = new TH1F("LamEffVsPt",
00331                             "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
00332   lamFakeVsRHist = new TH1F("LamFakeVsR",
00333                             "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
00334   lamFakeVsEtaHist = new TH1F("LamFakeVsEta",
00335                               "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
00336   lamFakeVsPtHist = new TH1F("LamFakeVsPt",
00337                              "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
00338 
00339   lamTkEffVsRHist = new TH1F("LamTkEffVsR",
00340                            "#Lambda^{0} TrackingEfficiency vs #rho", 40, 0., 40.);
00341   lamTkEffVsEtaHist = new TH1F("LamTkEffVsEta",
00342                              "#Lambda^{0} Tracking Efficiency vs #eta", 40, -2.5, 2.5);
00343   lamTkEffVsPtHist = new TH1F("LamTkEffVsPt",
00344                             "#Lambda^{0} Tracking Efficiency vs p_{T}", 70, 0., 20.);
00345   lamTkFakeVsRHist = new TH1F("LamTkFakeVsR",
00346                             "#Lambda^{0} Tracking Fake Rate vs #rho", 40, 0., 40.);
00347   lamTkFakeVsEtaHist = new TH1F("LamTkFakeVsEta",
00348                               "#Lambda^{0} Tracking Fake Rate vs #eta", 40, -2.5, 2.5);
00349   lamTkFakeVsPtHist = new TH1F("LamTkFakeVsPt",
00350                              "#Lambda^{0} Tracking Fake Rate vs p_{T}", 70, 0., 20.);
00351 
00352   lamEffVsRHist_denom = new TH1F("LamEffVsR_denom",
00353                            "#Lambda^{0} Efficiency vs #rho", 40, 0., 40.);
00354   lamEffVsEtaHist_denom = new TH1F("LamEffVsEta_denom",
00355                              "#Lambda^{0} Efficiency vs #eta", 40, -2.5, 2.5);
00356   lamEffVsPtHist_denom = new TH1F("LamEffVsPt_denom",
00357                             "#Lambda^{0} Efficiency vs p_{T}", 70, 0., 20.);
00358   lamFakeVsRHist_denom = new TH1F("LamFakeVsR_denom",
00359                             "#Lambda^{0} Fake Rate vs #rho", 40, 0., 40.);
00360   lamFakeVsEtaHist_denom = new TH1F("LamFakeVsEta_denom",
00361                               "#Lambda^{0} Fake Rate vs #eta", 40, -2.5, 2.5);
00362   lamFakeVsPtHist_denom = new TH1F("LamFakeVsPt_denom",
00363                              "#Lambda^{0} Fake Rate vs p_{T}", 70, 0., 20.);
00364 
00365   nKsHist = new TH1F("nK0s",
00366                      "Number of K^{0}_{S} found per event", 60, 0., 60.);
00367   nLamHist = new TH1F("nLam",
00368                       "Number of #Lambda^{0} found per event", 60, 0., 60.);
00369 
00370   ksXResolutionHist = new TH1F("ksXResolution",
00371                                "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
00372   ksYResolutionHist = new TH1F("ksYResolution",
00373                                "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
00374   ksZResolutionHist = new TH1F("ksZResolution",
00375                                "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
00376   lamXResolutionHist = new TH1F("lamXResolution",
00377                                 "Resolution of V0 decay vertex X coordinate", 50, 0., 50.);
00378   lamYResolutionHist = new TH1F("lamYResolution",
00379                                 "Resolution of V0 decay vertex Y coordinate", 50, 0., 50.);
00380   lamZResolutionHist = new TH1F("lamZResolution",
00381                                 "Resolution of V0 decay vertex Z coordinate", 50, 0., 50.);
00382   ksAbsoluteDistResolutionHist = new TH1F("ksRResolution",
00383                                           "Resolution of absolute distance from primary vertex to V0 vertex",
00384                                           100, 0., 50.);
00385   lamAbsoluteDistResolutionHist = new TH1F("lamRResolution",
00386                                            "Resolution of absolute distance from primary vertex to V0 vertex",
00387                                            100, 0., 50.);
00388 
00389   ksCandStatusHist = new TH1F("ksCandStatus",
00390                           "Fake type by cand status",
00391                           10, 0., 10.);
00392   lamCandStatusHist = new TH1F("ksCandStatus",
00393                           "Fake type by cand status",
00394                           10, 0., 10.);
00395 
00396   double minKsMass = 0.49767 - 0.07;
00397   double maxKsMass = 0.49767 + 0.07;
00398   double minLamMass = 1.1156 - 0.05;
00399   double maxLamMass = 1.1156 + 0.05;
00400   fakeKsMassHisto = new TH1F("ksMassFake",
00401                              "Mass of fake K0s",
00402                              100, minKsMass, maxKsMass);
00403   goodKsMassHisto = new TH1F("ksMassGood",
00404                              "Mass of good reco K0s",
00405                              100, minKsMass, maxKsMass);
00406   fakeLamMassHisto = new TH1F("lamMassFake",
00407                               "Mass of fake Lambda",
00408                               100, minLamMass, maxLamMass);
00409   goodLamMassHisto = new TH1F("lamMassGood",
00410                               "Mass of good Lambda",
00411                               100, minLamMass, maxLamMass);
00412 
00413   ksFakeDauRadDistHisto = new TH1F("radDistFakeKs",
00414                                    "Production radius of daughter particle of Ks fake",
00415                                    100, 0., 15.);
00416   lamFakeDauRadDistHisto = new TH1F("radDistFakeLam",
00417                                     "Production radius of daughter particle of Lam fake",
00418                                     100, 0., 15.);*/
00419 
00420 
00421   //std::cout << "Histograms booked" << std::endl;
00422 
00423   /*ksEffVsRHist->Sumw2();
00424   ksEffVsEtaHist->Sumw2();
00425   ksEffVsPtHist->Sumw2();
00426   ksTkEffVsRHist->Sumw2();
00427   ksTkEffVsEtaHist->Sumw2();
00428   ksTkEffVsPtHist->Sumw2();
00429   ksFakeVsRHist->Sumw2();
00430   ksFakeVsEtaHist->Sumw2();
00431   ksFakeVsPtHist->Sumw2();
00432   ksTkFakeVsRHist->Sumw2();
00433   ksTkFakeVsEtaHist->Sumw2();
00434   ksTkFakeVsPtHist->Sumw2();
00435 
00436   lamEffVsRHist->Sumw2();
00437   lamEffVsEtaHist->Sumw2();
00438   lamEffVsPtHist->Sumw2();
00439   lamTkEffVsRHist->Sumw2();
00440   lamTkEffVsEtaHist->Sumw2();
00441   lamTkEffVsPtHist->Sumw2();
00442   lamFakeVsRHist->Sumw2();
00443   lamFakeVsEtaHist->Sumw2();
00444   lamFakeVsPtHist->Sumw2();
00445   lamTkFakeVsRHist->Sumw2();
00446   lamTkFakeVsEtaHist->Sumw2();
00447   lamTkFakeVsPtHist->Sumw2();*/
00448 
00449 }
00450 
00451 void V0Validator::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
00452 
00453   using std::cout;
00454   using std::endl;
00455   using namespace edm;
00456   using namespace std;
00457 
00458   //cout << "In analyze(), getting collections..." << endl;
00459   // Get event setup info, B-field and tracker geometry
00460   ESHandle<MagneticField> bFieldHandle;
00461   iSetup.get<IdealMagneticFieldRecord>().get(bFieldHandle);
00462   ESHandle<GlobalTrackingGeometry> globTkGeomHandle;
00463   iSetup.get<GlobalTrackingGeometryRecord>().get(globTkGeomHandle);
00464 
00465   // Make matching collections
00466   //reco::RecoToSimCollection recSimColl;
00467   //reco::SimToRecoCollection simRecColl;
00468    
00469   Handle<reco::RecoToSimCollection > recotosimCollectionH;
00470   iEvent.getByLabel("trackingParticleRecoTrackAsssociation", recotosimCollectionH);
00471   //recSimColl= *( recotosimCollectionH.product() ); 
00472   
00473   Handle<reco::SimToRecoCollection> simtorecoCollectionH;
00474   iEvent.getByLabel("trackingParticleRecoTrackAsssociation", simtorecoCollectionH);
00475   //simRecColl= *( simtorecoCollectionH.product() );
00476 
00477   edm::Handle<TrackingParticleCollection>  TPCollectionEff ;
00478   iEvent.getByLabel("mergedtruth", "MergedTrackTruth", TPCollectionEff);
00479   const TrackingParticleCollection tPCeff = *( TPCollectionEff.product() );
00480 
00481   edm::ESHandle<TrackAssociatorBase> associatorByHits;
00482   iSetup.get<TrackAssociatorRecord>().get("TrackAssociatorByHits", associatorByHits);
00483 
00484   //VertexAssociatorBase* associatorByTracks;
00485 
00486   //  edm::ESHandle<VertexAssociatorBase> theTracksAssociator;
00487   //  iSetup.get<VertexAssociatorRecord>().get("VertexAssociatorByTracks",theTracksAssociator);
00488   //  associatorByTracks = (VertexAssociatorBase *) theTracksAssociator.product();
00489 
00490   // Get tracks
00491   Handle< View<reco::Track> > trackCollectionH;
00492   iEvent.getByLabel("generalTracks", trackCollectionH);
00493 
00494   Handle<SimTrackContainer> simTrackCollection;
00495   iEvent.getByLabel("g4SimHits", simTrackCollection);
00496   const SimTrackContainer simTC = *(simTrackCollection.product());
00497 
00498   Handle<SimVertexContainer> simVertexCollection;
00499   iEvent.getByLabel("g4SimHits", simVertexCollection);
00500   const SimVertexContainer simVC = *(simVertexCollection.product());
00501 
00502   //Get tracking particles
00503   //  -->tracks
00504   edm::Handle<TrackingParticleCollection>  TPCollectionH ;
00505   iEvent.getByLabel("mergedtruth", "MergedTrackTruth", TPCollectionH);
00506   const View<reco::Track>  tC = *( trackCollectionH.product() );
00507 
00508 //  edm::Handle<TrackingVertexCollection>  TVCollectionH ;
00509 //  iEvent.getByLabel("trackingParticles","VertexTruth",TVCollectionH);
00510 //  const TrackingVertexCollection tVC   = *(TVCollectionH.product());
00511 
00512   // Select the primary vertex, create a new reco::Vertex to hold it
00513   edm::Handle< std::vector<reco::Vertex> > primaryVtxCollectionH;
00514   iEvent.getByLabel("offlinePrimaryVertices", primaryVtxCollectionH);
00515   const reco::VertexCollection primaryVertexCollection   = *(primaryVtxCollectionH.product());
00516 
00517   reco::Vertex* thePrimary = 0;
00518   std::vector<reco::Vertex>::const_iterator iVtxPH = primaryVtxCollectionH->begin();
00519   for(std::vector<reco::Vertex>::const_iterator iVtx = primaryVtxCollectionH->begin();
00520       iVtx < primaryVtxCollectionH->end();
00521       iVtx++) {
00522     if(primaryVtxCollectionH->size() > 1) {
00523       if(iVtx->tracksSize() > iVtxPH->tracksSize()) {
00524         iVtxPH = iVtx;
00525       }
00526     }
00527     else iVtxPH = iVtx;
00528   }
00529   thePrimary = new reco::Vertex(*iVtxPH);
00530 
00531   //cout << "Done with collections, associating reco and sim..." << endl;
00532  
00533 
00534   //reco::RecoToSimCollection r2s = associatorByHits->associateRecoToSim(trackCollectionH,TPCollectionH,&iEvent );
00535   //reco::SimToRecoCollection s2r = associatorByHits->associateSimToReco(trackCollectionH,TPCollectionH,&iEvent );
00536 
00537 //  reco::VertexRecoToSimCollection vr2s = associatorByTracks->associateRecoToSim(primaryVtxCollectionH, TVCollectionH, iEvent, r2s);
00538 //  reco::VertexSimToRecoCollection vs2r = associatorByTracks->associateSimToReco(primaryVtxCollectionH, TVCollectionH, iEvent, s2r);
00539 
00540   //get the V0s;   
00541   edm::Handle<reco::VertexCompositeCandidateCollection> k0sCollection;
00542   edm::Handle<reco::VertexCompositeCandidateCollection> lambdaCollection;
00543   //iEvent.getByLabel("generalV0Candidates", "Kshort", k0sCollection);
00544   //iEvent.getByLabel("generalV0Candidates", "Lambda", lambdaCollection);
00545   iEvent.getByLabel(k0sCollectionTag, k0sCollection);
00546   iEvent.getByLabel(lamCollectionTag, lambdaCollection);
00547 
00548   //make vector of pair of trackingParticles to hold good V0 candidates
00549   std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueK0s;
00550   std::vector< pair<TrackingParticleRef, TrackingParticleRef> > trueLams;
00551   std::vector<double> trueKsMasses;
00552   std::vector<double> trueLamMasses;
00553 
00555   // Do vertex calculations //
00557 /*
00558   if( k0sCollection->size() > 0 ) {
00559     for(reco::VertexCompositeCandidateCollection::const_iterator iK0s = k0sCollection->begin();
00560         iK0s != k0sCollection->end();
00561         iK0s++) {
00562       // Still can't actually associate the V0 vertex with a TrackingVertexCollection.
00563       //  Is this a problem?  You bet.
00564       reco::VertexCompositeCandidate::CovarianceMatrix aErr;
00565       iK0s->fillVertexCovariance(aErr);
00566       reco::Vertex tVtx(iK0s->vertex(), aErr);
00567       reco::VertexCollection *tVtxColl = 0;
00568       tVtxColl->push_back(tVtx);
00569       reco::VertexRef aVtx(tVtxColl, 0);
00570       //if(vr2s.find(iK0s->vertex()) != vr2s.end()) {
00571       if(vr2s.find(aVtx) != vr2s.end()) {
00572         //cout << "Found it in the collection." << endl;
00573         std::vector< std::pair<TrackingVertexRef, double> > vVR 
00574           = (std::vector< std::pair<TrackingVertexRef, double> >) vr2s[aVtx];
00575       }
00576     }
00577   }
00578 */
00580   // Do fake rate calculation //
00582 
00583   //cout << "Starting K0s fake rate calculation" << endl;
00584   // Kshorts
00585   double numK0sFound = 0.;
00586   double mass = 0.;
00587   std::vector<double> radDist;
00588   //  radDist.clear();
00589   //cout << "K0s collection size: " << k0sCollection->size() << endl;
00590   if ( k0sCollection->size() > 0 ) {
00591     //cout << "In loop" << endl;
00592 
00593     vector<reco::TrackRef> theDaughterTracks;
00594     for( reco::VertexCompositeCandidateCollection::const_iterator iK0s = k0sCollection->begin();
00595          iK0s != k0sCollection->end();
00596          iK0s++) {
00597       //cout << "In loop 2" << endl;
00598       // Fill mass of all K0S
00599       ksMassAll->Fill( iK0s->mass() );
00600       // Fill values to be histogrammed
00601       K0sCandpT = (sqrt( iK0s->momentum().perp2() ));
00602       K0sCandEta = iK0s->momentum().eta();
00603       K0sCandR = (sqrt( iK0s->vertex().perp2() ));
00604       K0sCandStatus = 0;
00605       //cout << "MASS" << endl;
00606       mass = iK0s->mass();
00607       //cout << "Pushing back daughters" << endl;
00608 
00609       theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(0)) )).track() );
00610       theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iK0s->daughter(1)) )).track() );
00611        
00612       //cout << "1" << endl;
00613       for (int itrack = 0; itrack < 2; itrack++) {
00614         K0sPiCandStatus[itrack] = 0;
00615       }
00616 
00617       std::vector< std::pair<TrackingParticleRef, double> > tp;
00618       TrackingParticleRef tpref;
00619       TrackingParticleRef firstDauTP;
00620       TrackingVertexRef k0sVtx;
00621 
00622       //cout << "2" << endl;
00623       // Loop through K0s candidate daugher tracks
00624       for(View<reco::Track>::size_type i=0; i<theDaughterTracks.size(); ++i){
00625         // Found track from theDaughterTracks
00626         RefToBase<reco::Track> track( theDaughterTracks.at(i) );
00627         
00628         //if(recSimColl.find(track) != recSimColl.end()) {
00629         if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
00630           //tp = recSimColl[track];
00631           tp = (*recotosimCollectionH)[track];
00632           if (tp.size() != 0) {
00633             K0sPiCandStatus[i] = 1;
00634             tpref = tp.begin()->first;
00635 
00636             //if( simRecColl.find(tpref) == simRecColl.end() ) {
00637             if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
00638               K0sPiCandStatus[i] = 3;
00639             }
00640             //cout << "3" << endl;
00641             TrackingVertexRef parentVertex = tpref->parentVertex();
00642             if(parentVertex.isNonnull()) radDist.push_back(parentVertex->position().R());
00643              
00644             if( parentVertex.isNonnull() ) {
00645               if( k0sVtx.isNonnull() ) {
00646                 if( k0sVtx->position() == parentVertex->position() ) {
00647                   if( parentVertex->nDaughterTracks() == 2 ) {
00648                     if( parentVertex->nSourceTracks() == 0 ) {
00649                       // No source tracks found for K0s vertex; shouldn't happen, but does for evtGen events
00650                       K0sCandStatus = 6;
00651                     }
00652                     
00653                     for( TrackingVertex::tp_iterator iTP = parentVertex->sourceTracks_begin();
00654                          iTP != parentVertex->sourceTracks_end(); iTP++) {
00655                       if( (*iTP)->pdgId() == 310 ) {
00656                         //cout << "4" << endl;
00657                         K0sCandStatus = 1;
00658                         realK0sFound++;
00659                         numK0sFound += 1.;
00660                         std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
00661                         // Pushing back a good V0
00662                         trueK0s.push_back(pair);
00663                         trueKsMasses.push_back(mass);
00664                       }
00665                       else {
00666                         K0sCandStatus = 2;
00667                         if( (*iTP)->pdgId() == 3122 ) {
00668                           K0sCandStatus = 7;
00669                         }
00670                       }
00671                     }
00672                   }
00673                   else {
00674                     // Found a bad match because the mother has too many daughters
00675                     K0sCandStatus = 3;
00676                   }
00677                 }
00678                 else {
00679                   // Found a bad match because the parent vertices from the two tracks are different
00680                   K0sCandStatus = 4;
00681                 }
00682               }
00683               else {
00684                 // if k0sVtx is null, fill it with parentVertex to compare to the parentVertex from the second track
00685                 k0sVtx = parentVertex;
00686                 firstDauTP = tpref;
00687               }
00688             }//parent vertex is null
00689           }//tp size zero
00690         }
00691         else {
00692           //cout << "5" << endl;
00693           K0sPiCandStatus[i] = 2;
00694           noTPforK0sCand++;
00695           K0sCandStatus = 5;
00696           theDaughterTracks.clear();
00697         }
00698       }
00699       //cout << "6" << endl;
00700       theDaughterTracks.clear();
00701       // fill the fake rate histograms
00702       if( K0sCandStatus > 1 ) {
00703         //cout << "7" << endl;
00704         ksFakeVsR_num->Fill(K0sCandR);
00705         ksFakeVsEta_num->Fill(K0sCandEta);
00706         ksFakeVsPt_num->Fill(K0sCandpT);
00707         ksCandStatus->Fill((float) K0sCandStatus);
00708         fakeKsMass->Fill(mass);
00709         for( unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
00710           ksFakeDauRadDist->Fill(radDist[ndx]);
00711         }
00712       }
00713       if( K0sCandStatus == 5 ) {
00714         ksTkFakeVsR_num->Fill(K0sCandR);
00715         ksTkFakeVsEta_num->Fill(K0sCandEta);
00716         ksTkFakeVsPt_num->Fill(K0sCandpT);
00717       }
00718       ksFakeVsR_denom->Fill(K0sCandR);
00719       ksFakeVsEta_denom->Fill(K0sCandEta);
00720       ksFakeVsPt_denom->Fill(K0sCandpT);
00721     }
00722   }
00723   //cout << "Outside loop, why would it fail here?" << endl;
00724   //double numK0sFound = (double) realK0sFound;
00725   //cout << "numK0sFound: " << numK0sFound << endl;
00726   nKs->Fill( (float) numK0sFound );
00727   numK0sFound = 0.;
00728 
00729   //cout << "Starting Lambda fake rate calculation" << endl;
00730 
00731   double numLamFound = 0.;
00732   mass = 0.;
00733   radDist.clear();
00734   // Lambdas
00735   if ( lambdaCollection->size() > 0 ) {
00736     //cout << "In lam loop." << endl;
00737     
00738     vector<reco::TrackRef> theDaughterTracks;
00739     for( reco::VertexCompositeCandidateCollection::const_iterator iLam = lambdaCollection->begin();
00740          iLam != lambdaCollection->end();
00741          iLam++) {
00742       // Fill mass plot with ALL lambdas
00743       lamMassAll->Fill( iLam->mass() );
00744       // Fill values to be histogrammed
00745       LamCandpT = (sqrt( iLam->momentum().perp2() ));
00746       LamCandEta = iLam->momentum().eta();
00747       LamCandR = (sqrt( iLam->vertex().perp2() ));
00748       LamCandStatus = 0;
00749       mass = iLam->mass();
00750       
00751       //cout << "Lam daughter tracks" << endl;
00752       theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(0)) )).track() );
00753       theDaughterTracks.push_back( (*(dynamic_cast<const reco::RecoChargedCandidate *> (iLam->daughter(1)) )).track() );
00754       
00755       for (int itrack = 0; itrack < 2; itrack++) {
00756         LamPiCandStatus[itrack] = 0;
00757       }
00758       
00759       std::vector< std::pair<TrackingParticleRef, double> > tp;
00760       TrackingParticleRef tpref;
00761       TrackingParticleRef firstDauTP;
00762       TrackingVertexRef LamVtx;
00763       // Loop through Lambda candidate daughter tracks
00764       for(View<reco::Track>::size_type i=0; i<theDaughterTracks.size(); ++i){
00765         // Found track from theDaughterTracks
00766         //cout << "Looping over lam daughters" << endl;
00767         RefToBase<reco::Track> track( theDaughterTracks.at(i) );
00768         
00769         //if(recSimColl.find(track) != recSimColl.end()) {
00770         if(recotosimCollectionH->find(track) != recotosimCollectionH->end()) {
00771           //tp = recSimColl[track];
00772           tp = (*recotosimCollectionH)[track];
00773           if (tp.size() != 0) {
00774             LamPiCandStatus[i] = 1;
00775             tpref = tp.begin()->first;
00776 
00777             //if( simRecColl.find(tpref) == simRecColl.end() ) {
00778             if( simtorecoCollectionH->find(tpref) == simtorecoCollectionH->end() ) {
00779               LamPiCandStatus[i] = 3;
00780             }
00781             TrackingVertexRef parentVertex = tpref->parentVertex();
00782             if( parentVertex.isNonnull() ) radDist.push_back(parentVertex->position().R());
00783              
00784             if( parentVertex.isNonnull() ) {
00785               if( LamVtx.isNonnull() ) {
00786                 if( LamVtx->position() == parentVertex->position() ) {
00787                   if( parentVertex->nDaughterTracks() == 2 ) {
00788                     if( parentVertex->nSourceTracks() == 0 ) {
00789                       // No source tracks found for K0s vertex; shouldn't happen, but does for evtGen events
00790                       LamCandStatus = 6;
00791                     }
00792 
00793                     for( TrackingVertex::tp_iterator iTP = parentVertex->sourceTracks_begin();
00794                          iTP != parentVertex->sourceTracks_end(); ++iTP) {
00795                       if( abs((*iTP)->pdgId()) == 3122 ) {
00796                         LamCandStatus = 1;
00797                         realLamFound++;
00798                         numLamFound += 1.;
00799                         std::pair<TrackingParticleRef, TrackingParticleRef> pair(firstDauTP, tpref);
00800                         // Pushing back a good V0
00801                         trueLams.push_back(pair);
00802                         trueLamMasses.push_back(mass);
00803                       }
00804                       else {
00805                         LamCandStatus = 2;
00806                         if( abs((*iTP)->pdgId() ) == 310 ) {
00807                           LamCandStatus = 7;
00808                         }
00809                       }
00810                       //if(iTP != parentVertex->sourceTracks_end()) {
00811                       //cout << "Bogus check 1" << endl;
00812                       //}
00813                     }
00814                   }
00815                   else {
00816                     // Found a bad match because the mother has too many daughters
00817                     LamCandStatus = 3;
00818                   }
00819                 }
00820                 else {
00821                   // Found a bad match because the parent vertices from the two tracks are different
00822                   LamCandStatus = 4;
00823                 }
00824               }
00825               else {
00826                 // if lamVtx is null, fill it with parentVertex to compare to the parentVertex from the second track
00827                 LamVtx = parentVertex;
00828                 firstDauTP = tpref;
00829               }
00830             }//parent vertex is null
00831           }//tp size zero
00832         }
00833         else {
00834           LamPiCandStatus[i] = 2;
00835           noTPforLamCand++;
00836           LamCandStatus = 5;
00837           theDaughterTracks.clear();
00838         }
00839       }
00840       theDaughterTracks.clear();
00841       // fill the fake rate histograms
00842       //cout << "Fill lam fake rate histos" << endl;
00843       if( LamCandStatus > 1 ) {
00844         //cout << "fake 1" << endl;
00845         //cout << "fake 1.5" << endl;
00846         lamFakeVsR_num->Fill(LamCandR);
00847         //cout << "fake 2" << endl;
00848         lamFakeVsEta_num->Fill(LamCandEta);
00849         //cout << "fake 3" << endl;
00850         lamFakeVsPt_num->Fill(LamCandpT);
00851         //cout << "fake 4" << endl;
00852         lamCandStatus->Fill((float) LamCandStatus);
00853         //cout << "fake 5" << endl;
00854         fakeLamMass->Fill(mass);
00855         //cout << "fake 6" << endl;
00856         for( unsigned int ndx = 0; ndx < radDist.size(); ndx++ ) {
00857           lamFakeDauRadDist->Fill(radDist[ndx]);
00858         }
00859       }
00860       //cout << "Fill lam Tk fake histos" << endl;
00861       if( K0sCandStatus == 5 ) {
00862         lamTkFakeVsR_num->Fill(LamCandR);
00863         lamTkFakeVsEta_num->Fill(LamCandEta);
00864         lamTkFakeVsPt_num->Fill(LamCandpT);
00865       }
00866       //cout << "Fill denominators" << endl;
00867       lamFakeVsR_denom->Fill(LamCandR);
00868       lamFakeVsEta_denom->Fill(LamCandEta);
00869       lamFakeVsPt_denom->Fill(LamCandpT);
00870     }
00871   }
00872   //cout << "Filling numLamFound" << endl;
00873   nLam->Fill( (double) numLamFound );
00874   numLamFound = 0.;
00875 
00876 
00878   // Do efficiency calculation //
00880 
00881   //cout << "Starting Lambda efficiency" << endl;
00882   // Lambdas
00883 
00884   for(TrackingParticleCollection::size_type i = 0; i < tPCeff.size(); i++) {
00885     TrackingParticleRef tpr1(TPCollectionEff, i);
00886     TrackingParticle* itp1 = const_cast<TrackingParticle*>(tpr1.get());
00887     if( (itp1->pdgId() == 211 || itp1->pdgId() == 2212)
00888         && itp1->parentVertex().isNonnull()
00889         && abs(itp1->momentum().eta()) < 2.4
00890         && sqrt( itp1->momentum().perp2() ) > 0.9) {
00891       bool isLambda = false;
00892       if( itp1->pdgId() == 2212 ) isLambda = true;
00893       if( itp1->parentVertex()->nDaughterTracks() == 2 ) {
00894 
00895         TrackingVertexRef piCand1Vertex = itp1->parentVertex();
00896         for(TrackingVertex::tp_iterator iTP1 = piCand1Vertex->sourceTracks_begin();
00897             iTP1 != piCand1Vertex->sourceTracks_end(); iTP1++) {
00898           if( abs((*iTP1)->pdgId()) == 3122 ) {
00899             //double motherpT = (*iTP1)->pt();
00900             //       ----->>>>>>Keep going here
00901             for(TrackingParticleCollection::size_type j=0;
00902                 j < tPCeff.size();
00903                 j++) {
00904               TrackingParticleRef tpr2(TPCollectionEff, j);
00905               TrackingParticle* itp2 = const_cast<TrackingParticle*>(tpr2.get());
00906               int particle2pdgId;
00907               if (isLambda) particle2pdgId = -211;
00908               else particle2pdgId = -2212;
00909               if( itp2->pdgId() == particle2pdgId
00910                   && itp2->parentVertex().isNonnull()
00911                   && abs(itp2->momentum().eta()) < 2.4
00912                   && sqrt(itp2->momentum().perp2()) > 0.9) {
00913                 if(itp2->parentVertex() == itp1->parentVertex()) {
00914                   // Found a good pair of Lambda daughters
00915                   TrackingVertexRef piCand2Vertex = itp2->parentVertex();
00916                   for (TrackingVertex::tp_iterator iTP2 = piCand2Vertex->sourceTracks_begin();
00917                        iTP2 != piCand2Vertex->sourceTracks_end(); 
00918                        ++iTP2) {
00919                     LamGenEta = LamGenpT = LamGenR = 0.;
00920                     LamGenStatus = 0;
00921                     for(int ifill = 0;
00922                         ifill < 2;
00923                         ifill++) {
00924                       // do nothing?
00925                     }
00926                     if( abs((*iTP2)->pdgId()) == 3122 ) {
00927                       // found generated Lambda
00928                       
00929                       LamGenpT = sqrt((*iTP2)->momentum().perp2());
00930                       LamGenEta = (*iTP2)->momentum().eta();
00931                       LamGenR = sqrt(itp2->vertex().perp2());
00932                       genLam++;
00933                       if(trueLams.size() > 0) {
00934                         int loop_1 = 0;
00935                         for(std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueLams.begin();
00936                             iEffCheck != trueLams.end();
00937                             iEffCheck++) {
00938                           //cout << "In LOOP" << endl;
00939                           if( itp1->parentVertex() == iEffCheck->first->parentVertex()
00940                               && itp2->parentVertex() == iEffCheck->second->parentVertex() ) {
00941                             realLamFoundEff++;
00942                             //V0Producer found the generated Lambda
00943                             LamGenStatus = 1;
00944                             //cout << "Maybe it's here.." << endl;
00945                             goodLamMass->Fill(trueLamMasses[loop_1]);
00946                             //cout << "Did we make it?" << endl;
00947                             break;
00948                           }
00949                           else {
00950                             //V0Producer didn't find the generated Lambda
00951                             LamGenStatus = 2;
00952                           }
00953                           loop_1++;
00954                         }
00955                       }
00956                       else {
00957                         //No V0 cand found, so V0Producer didn't find the generated Lambda
00958                         LamGenStatus = 2;
00959                       }
00960                       std::vector< std::pair<RefToBase<reco::Track>, double> > rt1;
00961                       std::vector< std::pair<RefToBase<reco::Track>, double> > rt2;
00962                       
00963                       //if( simRecColl.find(tpr1) != simRecColl.end() ) {
00964                       if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
00965                         //rt1 = (std::vector<std::pair<RefToBase<reco::Track>, double> >) simRecColl[tpr1];
00966                         rt1 = (std::vector<std::pair<RefToBase<reco::Track>, double> >) (*simtorecoCollectionH)[tpr1];
00967                         if(rt1.size() != 0) {
00968                           LamPiEff[0] = 1; //Found the first daughter track
00969                           edm::RefToBase<reco::Track> t1 = rt1.begin()->first;
00970                         }
00971                       }
00972                       else {
00973                         LamPiEff[0] = 2;//First daughter not found
00974                       }
00975                       //if( (simRecColl.find(tpr2) != simRecColl.end()) ) {
00976                       if( (simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end()) ) {
00977                         //rt2 = (std::vector<std::pair<RefToBase<reco::Track>, double> >) simRecColl[tpr2];
00978                         rt2 = (std::vector<std::pair<RefToBase<reco::Track>, double> >) (*simtorecoCollectionH)[tpr2];
00979                         if(rt2.size() != 0) {
00980                           LamPiEff[1] = 1;//Found the second daughter track
00981                           edm::RefToBase<reco::Track> t2 = rt2.begin()->first;
00982                         }
00983                       }
00984                       else {
00985                         LamPiEff[1] = 2;//Second daughter not found
00986                       }
00987                       
00988                       if( LamGenStatus == 1
00989                           && (LamPiEff[0] == 2 || LamPiEff[1] == 2) ) {
00990                         // Good Lambda found, but recoTrack->trackingParticle->recoTrack didn't work
00991                         LamGenStatus = 4;
00992                         realLamFoundEff--;
00993                       }
00994                       if( LamGenStatus == 2
00995                           && (LamPiEff[0] == 2 || LamPiEff[1] == 2) ) {
00996                         // Lambda not found because we didn't find a daughter track
00997                         LamGenStatus = 3;
00998                       }
00999                       //cout << "LamGenStatus: " << LamGenStatus << ", LamPiEff[i]: " << LamPiEff[0] << ", " << LamPiEff[1] << endl;
01000                       // Fill histograms
01001                       if(LamGenR > 0.) {
01002                         if(LamGenStatus == 1) {
01003                           lamEffVsR_num->Fill(LamGenR);
01004                         }
01005                         if((double) LamGenStatus < 2.5) {
01006                           lamTkEffVsR_num->Fill(LamGenR);
01007                         }
01008                         lamEffVsR_denom->Fill(LamGenR);
01009                       }
01010                       if(abs(LamGenEta) > 0.) {
01011                         if(LamGenStatus == 1) {
01012                           lamEffVsEta_num->Fill(LamGenEta);
01013                         }
01014                         if((double) LamGenStatus < 2.5) {
01015                           lamTkEffVsEta_num->Fill(LamGenEta);
01016                         }
01017                         lamEffVsEta_denom->Fill(LamGenEta);
01018                       }
01019                       if(LamGenpT > 0.) {
01020                         if(LamGenStatus == 1) {
01021                           lamEffVsPt_num->Fill(LamGenpT);
01022                         }
01023                         if((double) LamGenStatus < 2.5) {
01024                           lamTkEffVsPt_num->Fill(LamGenpT);
01025                         }
01026                         lamEffVsPt_denom->Fill(LamGenpT);
01027                       }
01028                     }
01029                   }
01030                 }
01031               }
01032             }
01033           }
01034         }
01035       }
01036     }
01037   }
01038 
01039   //Kshorts
01040 
01041   //cout << "Starting Kshort efficiency" << endl;
01042   for (TrackingParticleCollection::size_type i=0; i<tPCeff.size(); i++){
01043     TrackingParticleRef tpr1(TPCollectionEff, i);
01044     TrackingParticle* itp1=const_cast<TrackingParticle*>(tpr1.get());
01045     // only count the efficiency for pions with |eta|<2.4 and pT>0.9 GeV. First search for a suitable pi+
01046     if ( itp1->pdgId() == 211 
01047          && itp1->parentVertex().isNonnull() 
01048          && abs(itp1->momentum().eta()) < 2.4 
01049          && sqrt(itp1->momentum().perp2()) > 0.9) {
01050       if ( itp1->parentVertex()->nDaughterTracks() == 2 ) {
01051         TrackingVertexRef piCand1Vertex = itp1->parentVertex();        
01052         //check trackingParticle pion for a Ks mother
01053         for (TrackingVertex::tp_iterator iTP1 = piCand1Vertex->sourceTracks_begin();
01054              iTP1 != piCand1Vertex->sourceTracks_end(); ++iTP1) {
01055           //iTP1 is a TrackingParticle
01056           if ( (*iTP1)->pdgId()==310 ) {
01057             //with a Ks mother found for the pi+, loop through trackingParticles again to find a pi-
01058             for (TrackingParticleCollection::size_type j=0; j<tPCeff.size(); j++){
01059               TrackingParticleRef tpr2(TPCollectionEff, j);
01060               TrackingParticle* itp2=const_cast<TrackingParticle*>(tpr2.get());
01061               
01062               if ( itp2->pdgId() == -211 && itp2->parentVertex().isNonnull()  
01063                    && abs(itp2->momentum().eta()) < 2.4 
01064                    && sqrt(itp2->momentum().perp2()) > 0.9) {
01065                 //check the pi+ and pi- have the same vertex
01066                 if ( itp2->parentVertex() == itp1->parentVertex() ) {
01067                   TrackingVertexRef piCand2Vertex = itp2->parentVertex();              
01068                   for (TrackingVertex::tp_iterator iTP2 = piCand2Vertex->sourceTracks_begin();
01069                        iTP2 != piCand2Vertex->sourceTracks_end(); ++iTP2) {
01070                     //iTP2 is a TrackingParticle
01071                     K0sGenEta = K0sGenpT = K0sGenR = 0.;
01072                     K0sGenStatus = 0;
01073                     if( (*iTP2)->pdgId() == 310 ) {
01074                       K0sGenpT = sqrt( (*iTP2)->momentum().perp2() );
01075                       K0sGenEta = (*iTP2)->momentum().eta();
01076                       K0sGenR = sqrt(itp2->vertex().perp2());
01077                       genK0s++;
01078                       int loop_2 = 0;
01079                       if( trueK0s.size() > 0 ) {
01080                         for( std::vector< pair<TrackingParticleRef, TrackingParticleRef> >::const_iterator iEffCheck = trueK0s.begin();
01081                              iEffCheck != trueK0s.end();
01082                              iEffCheck++) {
01083                           //if the parent vertices for the tracks are the same, then the generated Ks was found
01084                           if (itp1->parentVertex()==iEffCheck->first->parentVertex() &&
01085                               itp2->parentVertex()==iEffCheck->second->parentVertex())  {
01086                             realK0sFoundEff++;
01087                             K0sGenStatus = 1;
01088                             //cout << "Maybe here?" << endl;
01089                             goodKsMass->Fill(trueKsMasses[loop_2]);
01090                             //cout << "We made it...." << endl;
01091                             break;
01092                           }
01093                           else {
01094                             K0sGenStatus = 2;
01095                           }
01096                         }
01097                       }
01098                       else {
01099                         K0sGenStatus = 2;
01100                       }
01101 
01102                       // Check if the generated Ks tracks were found or not
01103                       // by searching the recoTracks list for a match to the trackingParticles
01104 
01105                       std::vector<std::pair<RefToBase<reco::Track>, double> > rt1;
01106                       std::vector<std::pair<RefToBase<reco::Track>, double> > rt2;
01107                       
01108                       //if( simRecColl.find(tpr1) != simRecColl.end() ) {
01109                       if( simtorecoCollectionH->find(tpr1) != simtorecoCollectionH->end() ) {
01110                         rt1 = (std::vector< std::pair<RefToBase<reco::Track>, double> >) (*simtorecoCollectionH)[tpr1];
01111 //simRecColl[tpr1];
01112                         if(rt1.size() != 0) {
01113                           //First pion found
01114                           K0sPiEff[0] = 1;
01115                           edm::RefToBase<reco::Track> t1 = rt1.begin()->first;
01116                         }
01117                       }
01118                       else {
01119                         //First pion not found
01120                         K0sPiEff[0] = 2;
01121                       }
01122                       
01123                       //if( simRecColl.find(tpr2) != simRecColl.end() ) {
01124                       if( simtorecoCollectionH->find(tpr2) != simtorecoCollectionH->end() ) {
01125                         rt2 = (std::vector< std::pair<RefToBase<reco::Track>, double> >) (*simtorecoCollectionH)[tpr2];
01126 //simRecColl[tpr2];
01127                         if(rt2.size() != 0) {
01128                           //Second pion found
01129                           K0sPiEff[1] = 1;
01130                           edm::RefToBase<reco::Track> t2 = rt2.begin()->first;
01131                         }
01132                       }
01133                       else {
01134                         K0sPiEff[1] = 2;
01135                       }
01136                       //cout << "Status: " << K0sGenStatus << ", K0sPiEff[i]: " << K0sPiEff[0] << ", " << K0sPiEff[1] << endl;
01137                       if(K0sGenStatus == 1
01138                          && (K0sPiEff[0] == 2 || K0sPiEff[1] == 2)) {
01139                         K0sGenStatus = 4;
01140                         realK0sFoundEff--;
01141                       }
01142                       if(K0sGenStatus == 2
01143                          && (K0sPiEff[0] == 2 || K0sPiEff[1] == 2)) {
01144                         K0sGenStatus = 3;
01145                       }
01146                       if(K0sPiEff[0] == 1 && K0sPiEff[1] == 1) {
01147                         k0sTracksFound++;
01148                       }
01149                       //Fill Histograms
01150                       if(K0sGenR > 0.) {
01151                         if(K0sGenStatus == 1) {
01152                           ksEffVsR_num->Fill(K0sGenR);
01153                         }
01154                         if((double) K0sGenStatus < 2.5) {                         
01155                           ksTkEffVsR_num->Fill(K0sGenR);
01156                         }
01157                         ksEffVsR_denom->Fill(K0sGenR);
01158                       }
01159                       if(abs(K0sGenEta) > 0.) {
01160                         if(K0sGenStatus == 1) {
01161                           ksEffVsEta_num->Fill(K0sGenEta);
01162                         }
01163                         if((double) K0sGenStatus < 2.5) {
01164                           ksTkEffVsEta_num->Fill(K0sGenEta);
01165                         }
01166                         ksEffVsEta_denom->Fill(K0sGenEta);
01167                       }
01168                       if(K0sGenpT > 0.) {
01169                         if(K0sGenStatus == 1) {
01170                           ksEffVsPt_num->Fill(K0sGenpT);
01171                         }
01172                         if((double) K0sGenStatus < 2.5) {
01173                           ksTkEffVsPt_num->Fill(K0sGenpT);
01174                         }
01175                         ksEffVsPt_denom->Fill(K0sGenpT);
01176                       }
01177                     }
01178                   }
01179                 }
01180               }
01181             }
01182           }
01183         }
01184       }
01185     }
01186   }
01187 
01188   delete thePrimary;
01189 }
01190 
01191 void V0Validator::endRun(const edm::Run& iRun, const edm::EventSetup& iSetup) {
01192   //theDQMstore->showDirStructure();
01193   if(theDQMRootFileName.size() && theDQMstore) {
01194     theDQMstore->save(theDQMRootFileName);
01195   }
01196 }
01197 
01198 
01199 //void V0Validator::endJob() {
01200   //std::cout << "In endJob()" << std::endl;
01201   /*ksEffVsRHist->Divide(ksEffVsRHist_denom);
01202   ksEffVsEtaHist->Divide(ksEffVsEtaHist_denom);
01203   ksEffVsPtHist->Divide(ksEffVsPtHist_denom);
01204   ksTkEffVsRHist->Divide(ksEffVsRHist_denom);
01205   ksTkEffVsEtaHist->Divide(ksEffVsEtaHist_denom);
01206   ksTkEffVsPtHist->Divide(ksEffVsPtHist_denom);
01207   ksFakeVsRHist->Divide(ksFakeVsRHist_denom);
01208   ksFakeVsEtaHist->Divide(ksFakeVsEtaHist_denom);
01209   ksFakeVsPtHist->Divide(ksFakeVsPtHist_denom);
01210   ksTkFakeVsRHist->Divide(ksFakeVsRHist_denom);
01211   ksTkFakeVsEtaHist->Divide(ksFakeVsEtaHist_denom);
01212   ksTkFakeVsPtHist->Divide(ksFakeVsPtHist_denom);
01213 
01214   lamEffVsRHist->Divide(lamEffVsRHist_denom);
01215   lamEffVsEtaHist->Divide(lamEffVsEtaHist_denom);
01216   lamEffVsPtHist->Divide(lamEffVsPtHist_denom);
01217   lamTkEffVsRHist->Divide(lamEffVsRHist_denom);
01218   lamTkEffVsEtaHist->Divide(lamEffVsEtaHist_denom);
01219   lamTkEffVsPtHist->Divide(lamEffVsPtHist_denom);
01220   lamFakeVsRHist->Divide(lamFakeVsRHist_denom);
01221   lamFakeVsEtaHist->Divide(lamFakeVsEtaHist_denom);
01222   lamFakeVsPtHist->Divide(lamFakeVsPtHist_denom);
01223   lamTkFakeVsRHist->Divide(lamFakeVsRHist_denom);
01224   lamTkFakeVsEtaHist->Divide(lamFakeVsEtaHist_denom);
01225   lamTkFakeVsPtHist->Divide(lamFakeVsPtHist_denom);
01226 
01227   theDQMstore->cd();
01228   std::string subDirName = dirName + "/Efficiency";
01229   theDQMstore->setCurrentFolder(subDirName.c_str());
01230 
01231   ksEffVsR = theDQMstore->book1D("KsEffVsR", ksEffVsRHist);
01232   ksEffVsEta = theDQMstore->book1D("KsEffVsEta", ksEffVsEtaHist);
01233   ksEffVsPt = theDQMstore->book1D("KsEffVsPt", ksEffVsPtHist);
01234   ksTkEffVsR = theDQMstore->book1D("KsTkEffVsR", ksTkEffVsRHist);
01235   ksTkEffVsEta = theDQMstore->book1D("KsTkEffVsEta", ksTkEffVsEtaHist);
01236   ksTkEffVsPt = theDQMstore->book1D("KsTkEffVsPt", ksTkEffVsPtHist);
01237 
01238   lamEffVsR = theDQMstore->book1D("LamEffVsR", lamEffVsRHist);
01239   lamEffVsEta = theDQMstore->book1D("LamEffVsEta", lamEffVsEtaHist);
01240   lamEffVsPt = theDQMstore->book1D("LamEffVsPt", lamEffVsPtHist);
01241   lamTkEffVsR = theDQMstore->book1D("LamTkEffVsR", lamTkEffVsRHist);
01242   lamTkEffVsEta = theDQMstore->book1D("LamTkEffVsEta", lamTkEffVsEtaHist);
01243   lamTkEffVsPt = theDQMstore->book1D("LamTkEffVsPt", lamTkEffVsPtHist);
01244 
01245   theDQMstore->cd();
01246   subDirName = dirName + "/Fake";
01247   theDQMstore->setCurrentFolder(subDirName.c_str());
01248 
01249   ksFakeVsR = theDQMstore->book1D("KsFakeVsR", ksFakeVsRHist);
01250   ksFakeVsEta = theDQMstore->book1D("KsFakeVsEta", ksFakeVsEtaHist);
01251   ksFakeVsPt = theDQMstore->book1D("KsFakeVsPt", ksFakeVsPtHist);
01252   ksTkFakeVsR = theDQMstore->book1D("KsTkFakeVsR", ksTkFakeVsRHist);
01253   ksTkFakeVsEta = theDQMstore->book1D("KsTkFakeVsEta", ksTkFakeVsEtaHist);
01254   ksTkFakeVsPt = theDQMstore->book1D("KsTkFakeVsPt", ksTkFakeVsPtHist);
01255 
01256   lamFakeVsR = theDQMstore->book1D("LamFakeVsR", lamFakeVsRHist);
01257   lamFakeVsEta = theDQMstore->book1D("LamFakeVsEta", lamFakeVsEtaHist);
01258   lamFakeVsPt = theDQMstore->book1D("LamFakeVsPt", lamFakeVsPtHist);
01259   lamTkFakeVsR = theDQMstore->book1D("LamTkFakeVsR", lamTkFakeVsRHist);
01260   lamTkFakeVsEta = theDQMstore->book1D("LamTkFakeVsEta", lamTkFakeVsEtaHist);
01261   lamTkFakeVsPt = theDQMstore->book1D("LamTkFakeVsPt", lamTkFakeVsPtHist);
01262 
01263   nKs = theDQMstore->book1D("nK0s", nKsHist);
01264   nLam = theDQMstore->book1D("nLam", nLamHist);
01265 
01266   ksCandStatusME = theDQMstore->book1D("ksCandStatus", ksCandStatusHist);
01267   lamCandStatusME = theDQMstore->book1D("lamCandStatus", lamCandStatusHist);
01268 
01269   fakeKsMass = theDQMstore->book1D("ksMassFake", fakeKsMassHisto);
01270   goodKsMass = theDQMstore->book1D("ksMassGood", goodKsMassHisto);
01271   fakeLamMass = theDQMstore->book1D("lamMassFake", fakeLamMassHisto);
01272   goodLamMass = theDQMstore->book1D("lamMassGood", goodLamMassHisto);
01273 
01274   ksFakeDauRadDist = theDQMstore->book1D("radDistFakeKs", ksFakeDauRadDistHisto);
01275   lamFakeDauRadDist = theDQMstore->book1D("radDistFakeLam", lamFakeDauRadDistHisto);
01276 
01277   // ***************************************/
01278   /*theDQMstore->tag(ksEffVsR->getFullname(), 1);
01279   theDQMstore->tag(ksEffVsEta->getFullname(), 2);
01280   theDQMstore->tag(ksEffVsPt->getFullname(), 3);
01281   theDQMstore->tag(ksTkEffVsR->getFullname(), 4);
01282   theDQMstore->tag(ksTkEffVsEta->getFullname(), 5);
01283   theDQMstore->tag(ksTkEffVsPt->getFullname(), 6);
01284 
01285   theDQMstore->tag(lamEffVsR->getFullname(), 7);
01286   theDQMstore->tag(lamEffVsEta->getFullname(), 8);
01287   theDQMstore->tag(lamEffVsPt->getFullname(), 9);
01288   theDQMstore->tag(lamTkEffVsR->getFullname(), 10);
01289   theDQMstore->tag(lamTkEffVsEta->getFullname(), 11);
01290   theDQMstore->tag(lamTkEffVsPt->getFullname(), 12);
01291 
01292   theDQMstore->tag(ksFakeVsR->getFullname(), 13);
01293   theDQMstore->tag(ksFakeVsEta->getFullname(), 14);
01294   theDQMstore->tag(ksFakeVsPt->getFullname(), 15);
01295   theDQMstore->tag(ksTkFakeVsR->getFullname(), 16);
01296   theDQMstore->tag(ksTkFakeVsEta->getFullname(), 17);
01297   theDQMstore->tag(ksTkFakeVsPt->getFullname(), 18);
01298 
01299   theDQMstore->tag(lamFakeVsR->getFullname(), 19);
01300   theDQMstore->tag(lamFakeVsEta->getFullname(), 20);
01301   theDQMstore->tag(lamFakeVsPt->getFullname(), 21);
01302   theDQMstore->tag(lamTkFakeVsR->getFullname(), 22);
01303   theDQMstore->tag(lamTkFakeVsEta->getFullname(), 23);
01304   theDQMstore->tag(lamTkFakeVsPt->getFullname(), 24);
01305 
01306   theDQMstore->tag(nKs->getFullname(), 25);
01307   theDQMstore->tag(nLam->getFullname(), 26);
01308   
01309   theDQMstore->tag(ksCandStatusME->getFullname(), 27);
01310   theDQMstore->tag(lamCandStatusME->getFullname(), 28);
01311 
01312   theDQMstore->tag(fakeKsMass->getFullname(), 29);
01313   theDQMstore->tag(goodKsMass->getFullname(), 30);
01314   theDQMstore->tag(fakeLamMass->getFullname(), 31);
01315   theDQMstore->tag(goodLamMass->getFullname(), 32);
01316 
01317   theDQMstore->tag(ksFakeDauRadDist->getFullname(), 33);
01318   theDQMstore->tag(lamFakeDauRadDist->getFullname(), 34);*/
01319   /****************************************/
01320 
01321   /*theDQMstore->showDirStructure();
01322     theDQMstore->save(theDQMRootFileName);*/
01323 //}
01324 
01325 //define this as a plug-in
01326 //DEFINE_FWK_MODULE(V0Validator);