CMS 3D CMS Logo

HLTBJetDQMSource.cc

Go to the documentation of this file.
00001 
00011 #include <vector>
00012 #include <string>
00013 
00014 #include "DQMServices/Core/interface/DQMStore.h"
00015 #include "DQMServices/Core/interface/MonitorElement.h"
00016 #include "FWCore/Framework/interface/Event.h"
00017 #include "FWCore/Framework/interface/EventSetup.h"
00018 #include "FWCore/Framework/interface/LuminosityBlock.h"
00019 #include "FWCore/Framework/interface/Run.h"
00020 #include "DataFormats/Common/interface/Handle.h"
00021 #include "DataFormats/Common/interface/View.h"
00022 #include "DataFormats/BTauReco/interface/TrackIPTagInfo.h"
00023 #include "DataFormats/BTauReco/interface/SoftLeptonTagInfo.h"
00024 #include "DataFormats/BTauReco/interface/JetTag.h"
00025 #include "DataFormats/TrackReco/interface/Track.h"
00026 #include "DataFormats/JetReco/interface/Jet.h"
00027 #include "HLTBJetDQMSource.h"
00028 
00029 HLTBJetDQMSource::HLTBJetDQMSource(const edm::ParameterSet & config) :
00030   m_lifetimeL2Jets(         config.getParameter<edm::InputTag>("lifetimeL2Jets") ),
00031   m_lifetimeL25TagInfo(     config.getParameter<edm::InputTag>("lifetimeL25TagInfo") ),
00032   m_lifetimeL25JetTags(     config.getParameter<edm::InputTag>("lifetimeL25JetTags") ),
00033   m_lifetimeL3TagInfo(      config.getParameter<edm::InputTag>("lifetimeL3TagInfo") ),
00034   m_lifetimeL3JetTags(      config.getParameter<edm::InputTag>("lifetimeL3JetTags") ),
00035   m_softmuonL2Jets(         config.getParameter<edm::InputTag>("softmuonL2Jets") ),
00036   m_softmuonL25TagInfo(     config.getParameter<edm::InputTag>("softmuonL25TagInfo") ),
00037   m_softmuonL25JetTags(     config.getParameter<edm::InputTag>("softmuonL25JetTags") ),
00038   m_softmuonL3TagInfo(      config.getParameter<edm::InputTag>("softmuonL3TagInfo") ),
00039   m_softmuonL3JetTags(      config.getParameter<edm::InputTag>("softmuonL3JetTags") ),
00040   m_performanceL2Jets(      config.getParameter<edm::InputTag>("performanceL2Jets") ),
00041   m_performanceL25TagInfo(  config.getParameter<edm::InputTag>("performanceL25TagInfo") ),
00042   m_performanceL25JetTags(  config.getParameter<edm::InputTag>("performanceL25JetTags") ),
00043   m_performanceL3TagInfo(   config.getParameter<edm::InputTag>("performanceL3TagInfo") ),
00044   m_performanceL3JetTags(   config.getParameter<edm::InputTag>("performanceL3JetTags") ),
00045   m_monitorName(            config.getUntrackedParameter<std::string>("monitorName", "HLT/HLTMonBJet") ),
00046   m_outputFile(             config.getUntrackedParameter<std::string>("outputFile", "HLTBJetDQM.root") ),
00047   m_storeROOT(              config.getUntrackedParameter<bool>("storeROOT", false) ),
00048   m_dbe(),
00049   m_lifetimeL2JetsEnergy(0),
00050   m_lifetimeL2JetsET(0),
00051   m_lifetimeL2JetsEta(0),
00052   m_lifetimeL2JetsPhi(0),
00053   m_lifetimeL25JetsEnergy(0),
00054   m_lifetimeL25JetsET(0),
00055   m_lifetimeL25JetsEta(0),
00056   m_lifetimeL25JetsPhi(0),
00057   m_lifetimeL25TrackMultiplicity(0),
00058   m_lifetimeL25TrackHits(0),
00059   m_lifetimeL25TrackChi2(0),
00060   m_lifetimeL25IP2ndTrack2d(0),
00061   m_lifetimeL25IP2ndTrack2dSig(0),
00062   m_lifetimeL25IP2ndTrack3d(0),
00063   m_lifetimeL25IP2ndTrack3dSig(0),
00064   m_lifetimeL25IP3ndTrack2d(0),
00065   m_lifetimeL25IP3ndTrack2dSig(0),
00066   m_lifetimeL25IP3ndTrack3d(0),
00067   m_lifetimeL25IP3ndTrack3dSig(0),
00068   m_lifetimeL25Discriminator(0),
00069   m_lifetimeL3JetsEnergy(0),
00070   m_lifetimeL3JetsET(0),
00071   m_lifetimeL3JetsEta(0),
00072   m_lifetimeL3JetsPhi(0),
00073   m_lifetimeL3TrackMultiplicity(0),
00074   m_lifetimeL3TrackHits(0),
00075   m_lifetimeL3TrackChi2(0),
00076   m_lifetimeL3IP2ndTrack2d(0),
00077   m_lifetimeL3IP2ndTrack2dSig(0),
00078   m_lifetimeL3IP2ndTrack3d(0),
00079   m_lifetimeL3IP2ndTrack3dSig(0),
00080   m_lifetimeL3IP3ndTrack2d(0),
00081   m_lifetimeL3IP3ndTrack2dSig(0),
00082   m_lifetimeL3IP3ndTrack3d(0),
00083   m_lifetimeL3IP3ndTrack3dSig(0),
00084   m_lifetimeL3Discriminator(0),
00085   m_softmuonL2JetsEnergy(0),
00086   m_softmuonL2JetsET(0),
00087   m_softmuonL2JetsEta(0),
00088   m_softmuonL2JetsPhi(0),
00089   m_softmuonL25JetsEnergy(0),
00090   m_softmuonL25JetsET(0),
00091   m_softmuonL25JetsEta(0),
00092   m_softmuonL25JetsPhi(0),
00093   m_softmuonL25MuonMultiplicity(0),
00094   m_softmuonL25MuonHits(0),
00095   m_softmuonL25MuonChi2(0),
00096   m_softmuonL25MuonDeltaR(0),
00097   m_softmuonL25MuonIP2dSig(0),
00098   m_softmuonL25MuonIP3dSig(0),
00099   m_softmuonL25MuonPtrel(0),
00100   m_softmuonL25Discriminator(0),
00101   m_softmuonL3JetsEnergy(0),
00102   m_softmuonL3JetsET(0),
00103   m_softmuonL3JetsEta(0),
00104   m_softmuonL3JetsPhi(0),
00105   m_softmuonL3MuonMultiplicity(0),
00106   m_softmuonL3MuonHits(0),
00107   m_softmuonL3MuonChi2(0),
00108   m_softmuonL3MuonDeltaR(0),
00109   m_softmuonL3MuonIP2dSig(0),
00110   m_softmuonL3MuonIP3dSig(0),
00111   m_softmuonL3MuonPtrel(0),
00112   m_softmuonL3Discriminator(0),
00113   m_performanceL2JetsEnergy(0),
00114   m_performanceL2JetsET(0),
00115   m_performanceL2JetsEta(0),
00116   m_performanceL2JetsPhi(0),
00117   m_performanceL25JetsEnergy(0),
00118   m_performanceL25JetsET(0),
00119   m_performanceL25JetsEta(0),
00120   m_performanceL25JetsPhi(0),
00121   m_performanceL25MuonMultiplicity(0),
00122   m_performanceL25MuonHits(0),
00123   m_performanceL25MuonChi2(0),
00124   m_performanceL25MuonDeltaR(0),
00125   m_performanceL25MuonIP2dSig(0),
00126   m_performanceL25MuonIP3dSig(0),
00127   m_performanceL25MuonPtrel(0),
00128   m_performanceL25Discriminator(0),
00129   m_performanceL3JetsEnergy(0),
00130   m_performanceL3JetsET(0),
00131   m_performanceL3JetsEta(0),
00132   m_performanceL3JetsPhi(0),
00133   m_performanceL3MuonMultiplicity(0),
00134   m_performanceL3MuonHits(0),
00135   m_performanceL3MuonChi2(0),
00136   m_performanceL3MuonDeltaR(0),
00137   m_performanceL3MuonIP2dSig(0),
00138   m_performanceL3MuonIP3dSig(0),
00139   m_performanceL3MuonPtrel(0),
00140   m_performanceL3Discriminator(0),
00141   m_counterEvent(0),
00142   m_prescaleEvent( config.getUntrackedParameter<unsigned int>("prescale", 0) )
00143 {
00144   if (m_dbe.isAvailable()) {
00145     m_dbe->setVerbose(0);
00146     m_dbe->setCurrentFolder(m_monitorName);
00147   }
00148 }
00149 
00150 HLTBJetDQMSource::~HLTBJetDQMSource() {
00151 }
00152 
00153 void HLTBJetDQMSource::beginJob(const edm::EventSetup & setup) {
00154   if (not m_dbe.isAvailable())
00155     return;
00156 
00157   m_dbe->setCurrentFolder(m_monitorName + "/Lifetime");
00158   m_lifetimeL2JetsEnergy                = book("L2JetEnergy",           "L2 jet energy",                    500,   0.,  500.,  "GeV");
00159   m_lifetimeL2JetsET                    = book("L2JetET",               "L2 jet eT",                        500,   0.,  500.,  "GeV");
00160   m_lifetimeL2JetsEta                   = book("L2JetEta",              "L2 jet eta",                       600,  -3.0,   3.0, "#eta");
00161   m_lifetimeL2JetsPhi                   = book("L2JetPhi",              "L2 jet phi",                       640,  -3.2,   3.2, "#phi");
00162   m_lifetimeL25JetsEnergy               = book("L25JetEnergy",          "L2.5 jet Energy",                  500,   0.,  500.,  "GeV");
00163   m_lifetimeL25JetsET                   = book("L25JetET",              "L2.5 jet ET",                      500,   0.,  500.,  "GeV");
00164   m_lifetimeL25JetsEta                  = book("L25JetEta",             "L2.5 jet eta",                     600,  -3.0,   3.0, "#eta");
00165   m_lifetimeL25JetsPhi                  = book("L25JetPhi",             "L2.5 jet phi",                     640,  -3.2,   3.2, "#phi");
00166   m_lifetimeL25TrackMultiplicity        = book("L25TrackMultiplicity",  "L2.5 pixel tracks multiplicity",    25,   0,    25);
00167   m_lifetimeL25TrackHits                = book("L25TrackHits",          "L2.5 pixel tracks n. of hits",       5,   0,     5);
00168   m_lifetimeL25TrackChi2                = book("L25TrackChi2",          "L2.5 pixel tracks Chi2/DoF",        20,   0.,   20.,  "#chi^2/DoF");
00169   m_lifetimeL25IP2ndTrack2d             = book("L25IP2ndTrack2d",       "L2.5 2nd pixel track 2D IP",       250,  -0.05, 0.20, "cm");
00170   m_lifetimeL25IP2ndTrack2dSig          = book("L25IP2ndTrack2dSig",    "L2.5 2nd pixel track 2D SIP",       40, -30.,   50.);
00171   m_lifetimeL25IP2ndTrack3d             = book("L25IP2ndTrack3d",       "L2.5 2nd pixel track 3D IP",       300,  -1.0,  5.0,  "cm");
00172   m_lifetimeL25IP2ndTrack3dSig          = book("L25IP2ndTrack3dSig",    "L2.5 2nd pixel track 3D SIP",       40, -30.,   50.);
00173   m_lifetimeL25IP3ndTrack2d             = book("L25IP3ndTrack2d",       "L2.5 3rd pixel track 2D IP",       250,  -0.05, 0.20, "cm");
00174   m_lifetimeL25IP3ndTrack2dSig          = book("L25IP3ndTrack2dSig",    "L2.5 3rd pixel track 2D SIP",       40, -30.,   50.);
00175   m_lifetimeL25IP3ndTrack3d             = book("L25IP3ndTrack3d",       "L2.5 3rd pixel track 3D IP",       300,  -1.0,  5.0,  "cm");
00176   m_lifetimeL25IP3ndTrack3dSig          = book("L25IP3ndTrack3dSig",    "L2.5 3rd pixel track 3D SIP",       40, -30.,   50.);
00177   m_lifetimeL25Discriminator            = book("L25Discriminator",      "L2.5 b-tag discriminator",          40, -30.,   50.);
00178   m_lifetimeL3JetsEnergy                = book("L3JetEnergy",           "L3 jet Energy",                    500,   0.,  500.,  "GeV");
00179   m_lifetimeL3JetsET                    = book("L3JetET",               "L3 jet ET",                        500,   0.,  500.,  "GeV");
00180   m_lifetimeL3JetsEta                   = book("L3JetEta",              "L3 jet eta",                       600,  -3.0,   3.0, "#eta");
00181   m_lifetimeL3JetsPhi                   = book("L3JetPhi",              "L3 jet phi",                       640,  -3.2,   3.2, "#phi");
00182   m_lifetimeL3TrackMultiplicity         = book("L3TrackMultiplicity",   "L3 pixel tracks multiplicity",      25,   0,    25);
00183   m_lifetimeL3TrackHits                 = book("L3TrackHits",           "L3 pixel tracks n. of hits",         5,   0,     5);
00184   m_lifetimeL3TrackChi2                 = book("L3TrackChi2",           "L3 pixel tracks Chi2/DoF",          20,   0.,   20.,  "#chi^2/DoF");
00185   m_lifetimeL3IP2ndTrack2d              = book("L3IP2ndTrack2d",        "L3 2nd pixel track 2D IP",         250,  -0.05, 0.20, "cm");
00186   m_lifetimeL3IP2ndTrack2dSig           = book("L3IP2ndTrack2dSig",     "L3 2nd pixel track 2D SIP",        400, -30.,   50.);
00187   m_lifetimeL3IP2ndTrack3d              = book("L3IP2ndTrack3d",        "L3 2nd pixel track 3D IP",         300,  -1.0,  5.0,  "cm");
00188   m_lifetimeL3IP2ndTrack3dSig           = book("L3IP2ndTrack3dSig",     "L3 2nd pixel track 3D SIP",        400, -30.,   50.);
00189   m_lifetimeL3IP3ndTrack2d              = book("L3IP3ndTrack2d",        "L3 3rd pixel track 2D IP",         250,  -0.05, 0.20, "cm");
00190   m_lifetimeL3IP3ndTrack2dSig           = book("L3IP3ndTrack2dSig",     "L3 3rd pixel track 2D SIP",        400, -30.,   50.);
00191   m_lifetimeL3IP3ndTrack3d              = book("L3IP3ndTrack3d",        "L3 3rd pixel track 3D IP",         300,  -1.0,  5.0,  "cm");
00192   m_lifetimeL3IP3ndTrack3dSig           = book("L3IP3ndTrack3dSig",     "L3 3rd pixel track 3D SIP",        400, -30.,   50.);
00193   m_lifetimeL3Discriminator             = book("L3Discriminator",       "L3 b-tag discriminator",           400, -30.,   50.);
00194 
00195   m_dbe->setCurrentFolder(m_monitorName + "/Softmuon");
00196   m_softmuonL2JetsEnergy                = book("L2JetEnergy",           "L2 jet energy",                    500,   0.,  500.,  "GeV");
00197   m_softmuonL2JetsET                    = book("L2JetET",               "L2 jet eT",                        500,   0.,  500.,  "GeV");
00198   m_softmuonL2JetsEta                   = book("L2JetEta",              "L2 jet eta",                       600,  -3.0,   3.0, "#eta");
00199   m_softmuonL2JetsPhi                   = book("L2JetPhi",              "L2 jet phi",                       640,  -3.2,   3.2, "#phi");
00200   m_softmuonL25JetsEnergy               = book("L25JetEnergy",          "L2.5 jet Energy",                  500,   0.,  500.,  "GeV");
00201   m_softmuonL25JetsET                   = book("L25JetET",              "L2.5 jet ET",                      500,   0.,  500.,  "GeV");
00202   m_softmuonL25JetsEta                  = book("L25JetEta",             "L2.5 jet eta",                     600,  -3.0,   3.0, "#eta");
00203   m_softmuonL25JetsPhi                  = book("L25JetPhi",             "L2.5 jet phi",                     640,  -3.2,   3.2, "#phi");
00204   m_softmuonL25MuonMultiplicity         = book("L25MuonMultiplicity",   "L2 muons multiplicity",             25,   0,    25);
00205   m_softmuonL25MuonHits                 = book("L25MuonHits",           "L2 muons n. of hits",               50,   0,    50);
00206   m_softmuonL25MuonChi2                 = book("L25MuonChi2",           "L2 muons Chi2/DoF",                 20,   0.,   20.,  "#chi^2/DoF");
00207   m_softmuonL25MuonDeltaR               = book("L25MuonDeltaR",         "L2 muons DeltaR",                   50,   0.,    5.);
00208   m_softmuonL25MuonIP2dSig              = book("L25MuonIP2dSig",        "L2 muons 2D SIP",                  400, -30.,   50.);
00209   m_softmuonL25MuonIP3dSig              = book("L25MuonIP3dSig",        "L2 muons 3D SIP",                  400, -30.,   50.);
00210   m_softmuonL25MuonPtrel                = book("L25MuonPtrel",          "L2 muons pT_rel",                  100,   0.,   10.);
00211   m_softmuonL25Discriminator            = book("L25Discriminator",      "L2.5 b-tag discriminator",           2,   0,     2);
00212   m_softmuonL3JetsEnergy                = book("L3JetEnergy",           "L3 jet Energy",                    500,   0.,  500.,  "GeV");
00213   m_softmuonL3JetsET                    = book("L3JetET",               "L3 jet ET",                        500,   0.,  500.,  "GeV");
00214   m_softmuonL3JetsEta                   = book("L3JetEta",              "L3 jet eta",                       600,  -3.0,   3.0, "#eta");
00215   m_softmuonL3JetsPhi                   = book("L3JetPhi",              "L3 jet phi",                       640,  -3.2,   3.2, "#phi");
00216   m_softmuonL3MuonMultiplicity          = book("L3MuonMultiplicity",    "L3 muons multiplicity",             25,   0,    25);
00217   m_softmuonL3MuonHits                  = book("L3MuonHits",            "L3 muons n. of hits",               50,   0,    50);
00218   m_softmuonL3MuonChi2                  = book("L3MuonChi2",            "L3 muons Chi2/DoF",                 20,   0.,   20.,  "#chi^2/DoF");
00219   m_softmuonL3MuonDeltaR                = book("L3MuonDeltaR",          "L3 muons DeltaR",                   50,   0.,    5.);
00220   m_softmuonL3MuonIP2dSig               = book("L3MuonIP2dSig",         "L3 muons 2D SIP",                  400, -30.,   50.);
00221   m_softmuonL3MuonIP3dSig               = book("L3MuonIP3dSig",         "L3 muons 3D SIP",                  400, -30.,   50.);
00222   m_softmuonL3MuonPtrel                 = book("L3MuonPtrel",           "L3 muons pT_rel",                  100,   0.,   10.);
00223   m_softmuonL3Discriminator             = book("L3Discriminator",       "L3 b-tag discriminator",           100,   0.,    1.);
00224 
00225   m_dbe->setCurrentFolder(m_monitorName + "/Performance");
00226   m_performanceL2JetsEnergy             = book("L2JetEnergy",           "L2 jet energy",                    500,   0.,  500.,  "GeV");
00227   m_performanceL2JetsET                 = book("L2JetET",               "L2 jet eT",                        500,   0.,  500.,  "GeV");
00228   m_performanceL2JetsEta                = book("L2JetEta",              "L2 jet eta",                       600,  -3.0,   3.0, "#eta");
00229   m_performanceL2JetsPhi                = book("L2JetPhi",              "L2 jet phi",                       640,  -3.2,   3.2, "#phi");
00230   m_performanceL25JetsEnergy            = book("L25JetEnergy",          "L2.5 jet Energy",                  500,   0.,  500.,  "GeV");
00231   m_performanceL25JetsET                = book("L25JetET",              "L2.5 jet ET",                      500,   0.,  500.,  "GeV");
00232   m_performanceL25JetsEta               = book("L25JetEta",             "L2.5 jet eta",                     600,  -3.0,   3.0, "#eta");
00233   m_performanceL25JetsPhi               = book("L25JetPhi",             "L2.5 jet phi",                     640,  -3.2,   3.2, "#phi");
00234   m_performanceL25MuonMultiplicity      = book("L25MuonMultiplicity",   "L2 muons multiplicity",             25,   0,    25);
00235   m_performanceL25MuonHits              = book("L25MuonHits",           "L2 muons n. of hits",               50,   0,    50);
00236   m_performanceL25MuonChi2              = book("L25MuonChi2",           "L2 muons Chi2/DoF",                 20,   0.,   20.,  "#chi^2/DoF");
00237   m_performanceL25MuonDeltaR            = book("L25MuonDeltaR",         "L2 muons DeltaR",                   50,   0.,    5.);
00238   m_performanceL25MuonIP2dSig           = book("L25MuonIP2dSig",        "L2 muons 2D SIP",                  400, -30.,   50.);
00239   m_performanceL25MuonIP3dSig           = book("L25MuonIP3dSig",        "L2 muons 3D SIP",                  400, -30.,   50.);
00240   m_performanceL25MuonPtrel             = book("L25MuonPtrel",          "L2 muons pT_rel",                  100,   0.,   10.);
00241   m_performanceL25Discriminator         = book("L25Discriminator",      "L2.5 b-tag discriminator",           2,   0,     2);
00242   m_performanceL3JetsEnergy             = book("L3JetEnergy",           "L3 jet Energy",                    500,   0.,  500.,  "GeV");
00243   m_performanceL3JetsET                 = book("L3JetET",               "L3 jet ET",                        500,   0.,  500.,  "GeV");
00244   m_performanceL3JetsEta                = book("L3JetEta",              "L3 jet eta",                       600,  -3.0,   3.0, "#eta");
00245   m_performanceL3JetsPhi                = book("L3JetPhi",              "L3 jet phi",                       640,  -3.2,   3.2, "#phi");
00246   m_performanceL3MuonMultiplicity       = book("L3MuonMultiplicity",    "L3 muons multiplicity",             25,   0,    25);
00247   m_performanceL3MuonHits               = book("L3MuonHits",            "L3 muons n. of hits",               50,   0,    50);
00248   m_performanceL3MuonChi2               = book("L3MuonChi2",            "L3 muons Chi2/DoF",                 20,   0.,   20.,  "#chi^2/DoF");
00249   m_performanceL3MuonDeltaR             = book("L3MuonDeltaR",          "L3 muons DeltaR",                   50,   0.,    5.);
00250   m_performanceL3MuonIP2dSig            = book("L3MuonIP2dSig",         "L3 muons 2D SIP",                  400, -30.,   50.);
00251   m_performanceL3MuonIP3dSig            = book("L3MuonIP3dSig",         "L3 muons 3D SIP",                  400, -30.,   50.);
00252   m_performanceL3MuonPtrel              = book("L3MuonPtrel",           "L3 muons pT_rel",                  100,   0.,   10.);
00253   m_performanceL3Discriminator          = book("L3Discriminator",       "L3 b-tag discriminator",             2,   0.,    2.);
00254 
00255 }
00256 
00257 void HLTBJetDQMSource::endJob() { 
00258   if (m_dbe.isAvailable() and m_storeROOT)
00259     m_dbe->save(m_outputFile);
00260 }
00261 
00262 void HLTBJetDQMSource::beginRun(const edm::Run & run, const edm::EventSetup & setup) {
00263 }
00264 
00265 void HLTBJetDQMSource::endRun(const edm::Run & run, const edm::EventSetup & setup) {
00266 }
00267 
00268 void HLTBJetDQMSource::beginLuminosityBlock(const edm::LuminosityBlock & lumi, const edm::EventSetup & setup) {
00269 }
00270 
00271 void HLTBJetDQMSource::endLuminosityBlock(const edm::LuminosityBlock & lumi, const edm::EventSetup & setup) {
00272 }
00273 
00274 void HLTBJetDQMSource::analyze(const edm::Event & event, const edm::EventSetup & setup) {
00275   if (not m_dbe.isAvailable())
00276     return;
00277   
00278   ++m_counterEvent;
00279   if (m_prescaleEvent and m_counterEvent % m_prescaleEvent)
00280     return;
00281 
00282   analyzeLifetime(event, setup);
00283   analyzeSoftmuon(event, setup);
00284   analyzePerformance(event, setup);
00285 }
00286 
00287 void HLTBJetDQMSource::analyzeLifetime(const edm::Event & event, const edm::EventSetup & setup) {
00288   edm::Handle<edm::View<reco::Jet> >                h_lifetimeL2Jets;
00289   edm::Handle<reco::TrackIPTagInfoCollection>       h_lifetimeL25TagInfo;
00290   edm::Handle<reco::JetTagCollection>               h_lifetimeL25JetTags;
00291   edm::Handle<reco::TrackIPTagInfoCollection>       h_lifetimeL3TagInfo;
00292   edm::Handle<reco::JetTagCollection>               h_lifetimeL3JetTags;
00293   
00294   event.getByLabel(m_lifetimeL2Jets,        h_lifetimeL2Jets);
00295   event.getByLabel(m_lifetimeL25TagInfo,    h_lifetimeL25TagInfo);
00296   event.getByLabel(m_lifetimeL25JetTags,    h_lifetimeL25JetTags);
00297   event.getByLabel(m_lifetimeL3TagInfo,     h_lifetimeL3TagInfo);
00298   event.getByLabel(m_lifetimeL3JetTags,     h_lifetimeL3JetTags);
00299 
00300   if (h_lifetimeL2Jets.isValid()) {
00301     for (unsigned int i = 0; i < h_lifetimeL2Jets->size(); ++i) {
00302       const reco::Jet & jet = (*h_lifetimeL2Jets)[i];
00303       m_lifetimeL2JetsEnergy->Fill( jet.energy() );
00304       m_lifetimeL2JetsET->Fill(     jet.et() );
00305       m_lifetimeL2JetsEta->Fill(    jet.eta() );
00306       m_lifetimeL2JetsPhi->Fill(    jet.phi() );
00307     }
00308   }
00309   if (h_lifetimeL25TagInfo.isValid() and h_lifetimeL25JetTags.isValid()) {
00310     for (unsigned int i = 0; i < h_lifetimeL25TagInfo->size(); ++i) {
00311       const reco::TrackIPTagInfo & info   = (*h_lifetimeL25TagInfo)[i];
00312       const reco::Jet & jet = * info.jet();
00313       const reco::TrackRefVector & tracks = info.selectedTracks();
00314       const std::vector<reco::TrackIPTagInfo::TrackIPData> & data = info.impactParameterData();
00315       const reco::JetTag & tag = (*h_lifetimeL25JetTags)[info.jet().key()];
00316       m_lifetimeL25JetsEnergy->Fill( jet.energy() );
00317       m_lifetimeL25JetsET->Fill(     jet.et() );
00318       m_lifetimeL25JetsEta->Fill(    jet.eta() );
00319       m_lifetimeL25JetsPhi->Fill(    jet.phi() );
00320       m_lifetimeL25TrackMultiplicity->Fill( tracks.size() );
00321       for (unsigned int t = 0; t < tracks.size(); ++t) {
00322         m_lifetimeL25TrackHits->Fill( tracks[t]->numberOfValidHits() );
00323         m_lifetimeL25TrackChi2->Fill( tracks[t]->normalizedChi2() );
00324       }
00325       std::vector<size_t> indicesBy2d = info.sortedIndexes(reco::TrackIPTagInfo::IP2DSig);
00326       if (indicesBy2d.size() >= 2) {
00327         m_lifetimeL25IP2ndTrack2d->Fill(    data[indicesBy2d[1]].ip2d.value() );
00328         m_lifetimeL25IP2ndTrack2dSig->Fill( data[indicesBy2d[1]].ip2d.significance() );
00329       }
00330       if (indicesBy2d.size() >= 3) {
00331         m_lifetimeL25IP3ndTrack2d->Fill(    data[indicesBy2d[2]].ip2d.value() );
00332         m_lifetimeL25IP3ndTrack2dSig->Fill( data[indicesBy2d[2]].ip2d.significance() );
00333       }
00334       std::vector<size_t> indicesBy3d = info.sortedIndexes(reco::TrackIPTagInfo::IP3DSig);
00335       if (indicesBy3d.size() >= 2) {
00336         m_lifetimeL25IP2ndTrack3d->Fill(    data[indicesBy3d[1]].ip3d.value() );
00337         m_lifetimeL25IP2ndTrack3dSig->Fill( data[indicesBy3d[1]].ip3d.significance() );
00338       }
00339       if (indicesBy3d.size() >= 3) {
00340         m_lifetimeL25IP3ndTrack3d->Fill(    data[indicesBy3d[2]].ip3d.value() );
00341         m_lifetimeL25IP3ndTrack3dSig->Fill( data[indicesBy3d[2]].ip3d.significance() );
00342       }
00343       m_lifetimeL25Discriminator->Fill( tag.second );
00344     }
00345   }
00346   if (h_lifetimeL3TagInfo.isValid() and h_lifetimeL3JetTags.isValid()) {
00347     for (unsigned int i = 0; i < h_lifetimeL3TagInfo->size(); ++i) {
00348       const reco::TrackIPTagInfo & info   = (*h_lifetimeL3TagInfo)[i];
00349       const reco::Jet & jet = * info.jet();
00350       const reco::TrackRefVector & tracks = info.selectedTracks();
00351       const std::vector<reco::TrackIPTagInfo::TrackIPData> & data = info.impactParameterData();
00352       const reco::JetTag & tag = (*h_lifetimeL3JetTags)[info.jet().key()];
00353       m_lifetimeL3JetsEnergy->Fill( jet.energy() );
00354       m_lifetimeL3JetsET->Fill(     jet.et() );
00355       m_lifetimeL3JetsEta->Fill(    jet.eta() );
00356       m_lifetimeL3JetsPhi->Fill(    jet.phi() );
00357       m_lifetimeL3TrackMultiplicity->Fill( tracks.size() );
00358       for (unsigned int t = 0; t < tracks.size(); ++t) {
00359         m_lifetimeL3TrackHits->Fill( tracks[t]->numberOfValidHits() );
00360         m_lifetimeL3TrackChi2->Fill( tracks[t]->normalizedChi2() );
00361       }
00362       std::vector<size_t> indicesBy2d = info.sortedIndexes(reco::TrackIPTagInfo::IP2DSig);
00363       if (indicesBy2d.size() >= 2) {
00364         m_lifetimeL3IP2ndTrack2d->Fill(    data[indicesBy2d[1]].ip2d.value() );
00365         m_lifetimeL3IP2ndTrack2dSig->Fill( data[indicesBy2d[1]].ip2d.significance() );
00366       }
00367       if (indicesBy2d.size() >= 3) {
00368         m_lifetimeL3IP3ndTrack2d->Fill(    data[indicesBy2d[2]].ip2d.value() );
00369         m_lifetimeL3IP3ndTrack2dSig->Fill( data[indicesBy2d[2]].ip2d.significance() );
00370       }
00371       std::vector<size_t> indicesBy3d = info.sortedIndexes(reco::TrackIPTagInfo::IP3DSig);
00372       if (indicesBy3d.size() >= 2) {
00373         m_lifetimeL3IP2ndTrack3d->Fill(    data[indicesBy3d[1]].ip3d.value() );
00374         m_lifetimeL3IP2ndTrack3dSig->Fill( data[indicesBy3d[1]].ip3d.significance() );
00375       }
00376       if (indicesBy3d.size() >= 3) {
00377         m_lifetimeL3IP3ndTrack3d->Fill(    data[indicesBy3d[2]].ip3d.value() );
00378         m_lifetimeL3IP3ndTrack3dSig->Fill( data[indicesBy3d[2]].ip3d.significance() );
00379       }
00380       m_lifetimeL3Discriminator->Fill( tag.second );
00381     }
00382   }
00383 }
00384 
00385 void HLTBJetDQMSource::analyzeSoftmuon(const edm::Event & event, const edm::EventSetup & setup) {
00386   edm::Handle<edm::View<reco::Jet> >                h_softmuonL2Jets;
00387   edm::Handle<reco::SoftLeptonTagInfoCollection>    h_softmuonL25TagInfo;
00388   edm::Handle<reco::JetTagCollection>               h_softmuonL25JetTags;
00389   edm::Handle<reco::SoftLeptonTagInfoCollection>    h_softmuonL3TagInfo;
00390   edm::Handle<reco::JetTagCollection>               h_softmuonL3JetTags;
00391 
00392   event.getByLabel(m_softmuonL2Jets,        h_softmuonL2Jets);
00393   event.getByLabel(m_softmuonL25TagInfo,    h_softmuonL25TagInfo);
00394   event.getByLabel(m_softmuonL25JetTags,    h_softmuonL25JetTags);
00395   event.getByLabel(m_softmuonL3TagInfo,     h_softmuonL3TagInfo);
00396   event.getByLabel(m_softmuonL3JetTags,     h_softmuonL3JetTags);
00397 
00398   if (h_softmuonL2Jets.isValid()) { 
00399     for (unsigned int i = 0; i < h_softmuonL2Jets->size(); ++i) {
00400       const reco::Jet & jet = (*h_softmuonL2Jets)[i];
00401       m_softmuonL2JetsEnergy->Fill( jet.energy() );
00402       m_softmuonL2JetsET->Fill(     jet.et() );
00403       m_softmuonL2JetsEta->Fill(    jet.eta() );
00404       m_softmuonL2JetsPhi->Fill(    jet.phi() );
00405     }
00406   }
00407   if (h_softmuonL25TagInfo.isValid()) { 
00408     for (unsigned int i = 0; i < h_softmuonL25TagInfo->size(); ++i) {
00409       const reco::SoftLeptonTagInfo & info = (*h_softmuonL25TagInfo)[i];
00410       const reco::Jet & jet = * info.jet();
00411       const reco::JetTag & tag = (*h_softmuonL25JetTags)[info.jet().key()];
00412       m_softmuonL25JetsEnergy->Fill( jet.energy() );
00413       m_softmuonL25JetsET->Fill(     jet.et() );
00414       m_softmuonL25JetsEta->Fill(    jet.eta() );
00415       m_softmuonL25JetsPhi->Fill(    jet.phi() );
00416       m_softmuonL25MuonMultiplicity->Fill( info.leptons() );
00417       for (unsigned int l = 0; l < info.leptons(); ++l) {
00418         m_softmuonL25MuonHits->Fill(    info.lepton(l)->numberOfValidHits() );
00419         m_softmuonL25MuonChi2->Fill(    info.lepton(l)->normalizedChi2() );
00420         m_softmuonL25MuonDeltaR->Fill(  info.properties(l).deltaR );
00421         m_softmuonL25MuonIP2dSig->Fill( info.properties(l).sip2d );
00422         m_softmuonL25MuonIP3dSig->Fill( info.properties(l).sip3d );
00423         m_softmuonL25MuonPtrel->Fill(   info.properties(l).ptRel );
00424       }
00425       m_softmuonL25Discriminator->Fill( tag.second );
00426     }
00427   }
00428   if (h_softmuonL3TagInfo.isValid()) { 
00429     for (unsigned int i = 0; i < h_softmuonL3TagInfo->size(); ++i) {
00430       const reco::SoftLeptonTagInfo & info = (*h_softmuonL3TagInfo)[i];
00431       const reco::Jet & jet = * info.jet();
00432       const reco::JetTag & tag = (*h_softmuonL3JetTags)[info.jet().key()];
00433       m_softmuonL3JetsEnergy->Fill( jet.energy() );
00434       m_softmuonL3JetsET->Fill(     jet.et() );
00435       m_softmuonL3JetsEta->Fill(    jet.eta() );
00436       m_softmuonL3JetsPhi->Fill(    jet.phi() );
00437       m_softmuonL3MuonMultiplicity->Fill( info.leptons() );
00438       for (unsigned int l = 0; l < info.leptons(); ++l) {
00439         m_softmuonL3MuonHits->Fill(    info.lepton(l)->numberOfValidHits() );
00440         m_softmuonL3MuonChi2->Fill(    info.lepton(l)->normalizedChi2() );
00441         m_softmuonL3MuonDeltaR->Fill(  info.properties(l).deltaR );
00442         m_softmuonL3MuonIP2dSig->Fill( info.properties(l).sip2d );
00443         m_softmuonL3MuonIP3dSig->Fill( info.properties(l).sip3d );
00444         m_softmuonL3MuonPtrel->Fill(   info.properties(l).ptRel );
00445       }
00446       m_softmuonL3Discriminator->Fill( tag.second );
00447     }
00448   }
00449 }
00450 
00451 void HLTBJetDQMSource::analyzePerformance(const edm::Event & event, const edm::EventSetup & setup) {
00452   edm::Handle<edm::View<reco::Jet> >                h_performanceL2Jets;
00453   edm::Handle<reco::SoftLeptonTagInfoCollection>    h_performanceL25TagInfo;
00454   edm::Handle<reco::JetTagCollection>               h_performanceL25JetTags;
00455   edm::Handle<reco::SoftLeptonTagInfoCollection>    h_performanceL3TagInfo;
00456   edm::Handle<reco::JetTagCollection>               h_performanceL3JetTags;
00457 
00458   event.getByLabel(m_performanceL2Jets,        h_performanceL2Jets);
00459   event.getByLabel(m_performanceL25TagInfo,    h_performanceL25TagInfo);
00460   event.getByLabel(m_performanceL25JetTags,    h_performanceL25JetTags);
00461   event.getByLabel(m_performanceL3TagInfo,     h_performanceL3TagInfo);
00462   event.getByLabel(m_performanceL3JetTags,     h_performanceL3JetTags);
00463 
00464   if (h_performanceL2Jets.isValid()) { 
00465     for (unsigned int i = 0; i < h_performanceL2Jets->size(); ++i) {
00466       const reco::Jet & jet = (*h_performanceL2Jets)[i];
00467       m_performanceL2JetsEnergy->Fill( jet.energy() );
00468       m_performanceL2JetsET->Fill(     jet.et() );
00469       m_performanceL2JetsEta->Fill(    jet.eta() );
00470       m_performanceL2JetsPhi->Fill(    jet.phi() );
00471     }
00472   }
00473   if (h_performanceL25TagInfo.isValid()) { 
00474     for (unsigned int i = 0; i < h_performanceL25TagInfo->size(); ++i) {
00475       const reco::SoftLeptonTagInfo & info = (*h_performanceL25TagInfo)[i];
00476       const reco::Jet & jet = * info.jet();
00477       const reco::JetTag & tag = (*h_performanceL25JetTags)[info.jet().key()];
00478       m_performanceL25JetsEnergy->Fill( jet.energy() );
00479       m_performanceL25JetsET->Fill(     jet.et() );
00480       m_performanceL25JetsEta->Fill(    jet.eta() );
00481       m_performanceL25JetsPhi->Fill(    jet.phi() );
00482       m_performanceL25MuonMultiplicity->Fill( info.leptons() );
00483       for (unsigned int l = 0; l < info.leptons(); ++l) {
00484         m_performanceL25MuonHits->Fill(    info.lepton(l)->numberOfValidHits() );
00485         m_performanceL25MuonChi2->Fill(    info.lepton(l)->normalizedChi2() );
00486         m_performanceL25MuonDeltaR->Fill(  info.properties(l).deltaR );
00487         m_performanceL25MuonIP2dSig->Fill( info.properties(l).sip2d );
00488         m_performanceL25MuonIP3dSig->Fill( info.properties(l).sip3d );
00489         m_performanceL25MuonPtrel->Fill(   info.properties(l).ptRel );
00490       }
00491       m_performanceL25Discriminator->Fill( tag.second );
00492     }
00493   }
00494   if (h_performanceL3TagInfo.isValid()) { 
00495     for (unsigned int i = 0; i < h_performanceL3TagInfo->size(); ++i) {
00496       const reco::SoftLeptonTagInfo & info = (*h_performanceL3TagInfo)[i];
00497       const reco::Jet & jet = * info.jet();
00498       const reco::JetTag & tag = (*h_performanceL3JetTags)[info.jet().key()];
00499       m_performanceL3JetsEnergy->Fill( jet.energy() );
00500       m_performanceL3JetsET->Fill(     jet.et() );
00501       m_performanceL3JetsEta->Fill(    jet.eta() );
00502       m_performanceL3JetsPhi->Fill(    jet.phi() );
00503       m_performanceL3MuonMultiplicity->Fill( info.leptons() );
00504       for (unsigned int l = 0; l < info.leptons(); ++l) {
00505         m_performanceL3MuonHits->Fill(    info.lepton(l)->numberOfValidHits() );
00506         m_performanceL3MuonChi2->Fill(    info.lepton(l)->normalizedChi2() );
00507         m_performanceL3MuonDeltaR->Fill(  info.properties(l).deltaR );
00508         m_performanceL3MuonIP2dSig->Fill( info.properties(l).sip2d );
00509         m_performanceL3MuonIP3dSig->Fill( info.properties(l).sip3d );
00510         m_performanceL3MuonPtrel->Fill(   info.properties(l).ptRel );
00511       }
00512       m_performanceL3Discriminator->Fill( tag.second );
00513     }
00514   }
00515 }
00516 
00517 MonitorElement * HLTBJetDQMSource::book(const char * name, const char * title , int x_bins, double x_min, double x_max, const char * x_axis) {
00518   MonitorElement * element = m_dbe->book1D(name, title, x_bins, x_min, x_max);
00519   if (x_axis)
00520     element->setAxisTitle(x_axis, 1);
00521   return element;
00522 }
00523 
00524 MonitorElement * HLTBJetDQMSource::book(const char * name, const char * title , int x_bins, double x_min, double x_max, int y_bins, double y_min, double y_max, const char * x_axis, const char * y_axis) {
00525   MonitorElement * element = m_dbe->book2D(name, title, x_bins, x_min, x_max, y_bins, y_min, y_max);
00526   if (x_axis)
00527     element->setAxisTitle(x_axis, 1);
00528   if (y_axis)
00529     element->setAxisTitle(y_axis, 2);
00530   return element;
00531 }
00532 
00533 #include "FWCore/Framework/interface/MakerMacros.h"
00534 DEFINE_FWK_MODULE(HLTBJetDQMSource); 

Generated on Tue Jun 9 17:33:07 2009 for CMSSW by  doxygen 1.5.4