CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/DQM/Physics/src/ExoticaDQM.cc

Go to the documentation of this file.
00001 #include "DQM/Physics/src/ExoticaDQM.h"
00002 
00003 #include <memory>
00004 
00005 // DQM
00006 #include "DQMServices/Core/interface/DQMStore.h"
00007 #include "DQMServices/Core/interface/MonitorElement.h"
00008 
00009 // Framework
00010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00011 #include "FWCore/Framework/interface/EventSetup.h"
00012 #include "FWCore/Framework/interface/LuminosityBlock.h"
00013 #include "FWCore/ServiceRegistry/interface/Service.h"
00014 #include "FWCore/ParameterSet/interface/FileInPath.h"
00015 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00016 #include "FWCore/Framework/interface/Run.h"
00017 #include "DataFormats/Provenance/interface/EventID.h"
00018 
00019 // Candidate handling
00020 #include "DataFormats/Candidate/interface/Candidate.h"
00021 #include "DataFormats/Candidate/interface/CandidateFwd.h"
00022 #include "DataFormats/Candidate/interface/OverlapChecker.h"
00023 #include "DataFormats/Candidate/interface/CompositeCandidate.h"
00024 #include "DataFormats/Candidate/interface/CompositeCandidateFwd.h"
00025 #include "DataFormats/Candidate/interface/CandMatchMap.h"
00026 
00027 // Vertex utilities
00028 #include "DataFormats/VertexReco/interface/Vertex.h"
00029 #include "DataFormats/VertexReco/interface/VertexFwd.h"
00030 
00031 // Other
00032 #include "DataFormats/TrackReco/interface/Track.h"
00033 #include "DataFormats/DetId/interface/DetId.h"
00034 #include "DataFormats/Common/interface/RefToBase.h"
00035 
00036 // Math
00037 #include "DataFormats/Math/interface/Vector3D.h"
00038 #include "DataFormats/Math/interface/LorentzVector.h"
00039 #include "DataFormats/GeometryVector/interface/GlobalVector.h"
00040 #include "DataFormats/Common/interface/AssociationVector.h"
00041 #include "DataFormats/Math/interface/Point3D.h"
00042 #include "DataFormats/Math/interface/deltaR.h"
00043 #include "DataFormats/Math/interface/deltaPhi.h"
00044 
00045 // vertexing
00046 
00047 // Transient tracks
00048 #include "TrackingTools/TransientTrack/interface/TransientTrack.h"
00049 #include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h"
00050 #include "TrackingTools/Records/interface/TransientTrackRecord.h"
00051 #include "RecoTracker/Record/interface/TrackerRecoGeometryRecord.h"
00052 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00053 #include "Geometry/Records/interface/MuonGeometryRecord.h"
00054 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00055 
00056 //JetCorrection
00057 #include "JetMETCorrections/Objects/interface/JetCorrector.h"
00058 
00059 // ROOT
00060 #include "TLorentzVector.h"
00061 
00062 // STDLIB
00063 #include <iostream>
00064 #include <iomanip>
00065 #include <stdio.h>
00066 #include <string>
00067 #include <sstream>
00068 #include <math.h>
00069 
00070 using namespace edm;
00071 using namespace std;
00072 using namespace reco; 
00073 using namespace trigger;
00074 
00075 typedef vector<string> vstring;
00076 
00077 struct SortCandByDecreasingPt {
00078   bool operator()( const Candidate &c1, const Candidate &c2) const {
00079     return c1.pt() > c2.pt();
00080   }
00081 };
00082 
00083 
00084 //
00085 // -- Constructor
00086 //
00087 ExoticaDQM::ExoticaDQM(const edm::ParameterSet& ps){
00088 
00089   edm::LogInfo("ExoticaDQM") <<  " Starting ExoticaDQM " << "\n" ;
00090 
00091   bei_ = Service<DQMStore>().operator->();
00092   bei_->setCurrentFolder("Physics/Exotica");
00093   bookHistos(bei_);
00094 
00095   typedef std::vector<edm::InputTag> vtag;
00096 
00097   // Get parameters from configuration file
00098   // Trigger
00099   theTriggerResultsCollection = ps.getParameter<InputTag>("triggerResultsCollection");
00100   //
00101   theTriggerForMultiJetsList  = ps.getParameter<vstring>("triggerMultiJetsList");
00102   theTriggerForLongLivedList  = ps.getParameter<vstring>("triggerLongLivedList");
00103   
00104   //
00105   ElectronLabel_      = ps.getParameter<InputTag>("electronCollection");
00106   PFElectronLabelEI_  = ps.getParameter<InputTag>("pfelectronCollectionEI");
00107   //
00108   MuonLabel_          = ps.getParameter<InputTag>("muonCollection"); 
00109   PFMuonLabelEI_      = ps.getParameter<InputTag>("pfmuonCollectionEI");
00110   //
00111   TauLabel_           = ps.getParameter<InputTag>("tauCollection");
00112   //PFTauLabel_       = ps.getParameter<InputTag>("pftauCollection");
00113   //
00114   PhotonLabel_        = ps.getParameter<InputTag>("photonCollection");
00115   //PFPhotonLabel_    = ps.getParameter<InputTag>("pfphotonCollection");
00116   //
00117   CaloJetLabel_       = ps.getParameter<InputTag>("caloJetCollection");
00118   PFJetLabel_         = ps.getParameter<InputTag>("pfJetCollection");
00119   PFJetLabelEI_       = ps.getParameter<InputTag>("pfJetCollectionEI");
00120   
00121   //
00122   CaloMETLabel_       = ps.getParameter<InputTag>("caloMETCollection");
00123   PFMETLabel_         = ps.getParameter<InputTag>("pfMETCollection");
00124   PFMETLabelEI_       = ps.getParameter<InputTag>("pfMETCollectionEI");
00125   
00126   //Cuts - MultiJets 
00127   jetID                    = new reco::helper::JetIDHelper(ps.getParameter<ParameterSet>("JetIDParams"));
00128   mj_monojet_ptPFJet_      = ps.getParameter<double>("mj_monojet_ptPFJet");
00129   mj_monojet_ptPFMuon_     = ps.getParameter<double>("mj_monojet_ptPFMuon");
00130   mj_monojet_ptPFElectron_ = ps.getParameter<double>("mj_monojet_ptPFElectron");
00131   CaloJetCorService_       = ps.getParameter<std::string>("CaloJetCorService");
00132   PFJetCorService_         = ps.getParameter<std::string>("PFJetCorService");
00133 
00134   // just to initialize
00135   //isValidHltConfig_ = false;
00136 }
00137 
00138 
00139 //
00140 // -- Destructor
00141 //
00142 ExoticaDQM::~ExoticaDQM(){
00143   edm::LogInfo("ExoticaDQM") <<  " Deleting ExoticaDQM " << "\n" ;
00144 }
00145 
00146 
00147 //
00148 // -- Begin Job
00149 //
00150 void ExoticaDQM::beginJob(){
00151   nLumiSecs_ = 0;
00152   nEvents_   = 0;
00153   pi = 3.14159265;
00154 }
00155 
00156 
00157 //
00158 // -- Begin Run
00159 //
00160 void ExoticaDQM::beginRun(Run const& run, edm::EventSetup const& eSetup) {
00161   edm::LogInfo ("ExoticaDQM") <<"[ExoticaDQM]: Begining of Run";
00162   
00163   // passed as parameter to HLTConfigProvider::init(), not yet used
00164   bool isConfigChanged = false;
00165   
00166   // isValidHltConfig_ used to short-circuit analyze() in case of problems
00167   //  const std::string hltProcessName( "HLT" );
00168   const std::string hltProcessName = theTriggerResultsCollection.process();
00169   isValidHltConfig_ = hltConfigProvider_.init( run, eSetup, hltProcessName, isConfigChanged );
00170 
00171 }
00172 
00173 
00174 //
00175 // -- Begin  Luminosity Block
00176 //
00177 void ExoticaDQM::beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, 
00178                                             edm::EventSetup const& context) { 
00179   //edm::LogInfo ("ExoticaDQM") <<"[ExoticaDQM]: Begin of LS transition";
00180 }
00181 
00182 
00183 //
00184 //  -- Book histograms
00185 //
00186 void ExoticaDQM::bookHistos(DQMStore* bei){
00187  
00188   bei->cd();
00189   
00190   //--- Multijets
00191   bei->setCurrentFolder("Physics/Exotica/MultiJets");
00192   mj_monojet_pfchef               = bei->book1D("mj_monojet_pfchef", "PFJetID CHEF", 50, 0.0 , 1.0);
00193   mj_monojet_pfnhef               = bei->book1D("mj_monojet_pfnhef", "PFJetID NHEF", 50, 0.0 , 1.0);
00194   mj_monojet_pfcemf               = bei->book1D("mj_monojet_pfcemf", "PFJetID CEMF", 50, 0.0 , 1.0);
00195   mj_monojet_pfnemf               = bei->book1D("mj_monojet_pfnemf", "PFJetID NEMF", 50, 0.0 , 1.0);
00196   mj_monojet_pfJet1_pt            = bei->book1D("mj_monojet_pfJet1_pt", "Pt of PFJet-1 (GeV)", 40, 0.0 , 1000);
00197   mj_monojet_pfJet2_pt            = bei->book1D("mj_monojet_pfJet2_pt", "Pt of PFJet-2 (GeV)", 40, 0.0 , 1000);
00198   mj_monojet_pfJet1_eta           = bei->book1D("mj_monojet_pfJet1_eta", "#eta(PFJet-1)", 50, -5.0, 5.0);
00199   mj_monojet_pfJet2_eta           = bei->book1D("mj_monojet_pfJet2_eta", "#eta(PFJet-2)", 50, -5.0, 5.0);
00200   mj_monojet_pfJetMulti           = bei->book1D("mj_monojet_pfJetMulti", "No. of PFJets", 10, 0., 10.);
00201   mj_monojet_deltaPhiPFJet1PFJet2 = bei->book1D("mj_monojet_deltaPhiPFJet1PFJet2", "#Delta#phi(PFJet1, PFJet2)", 40, 0., 4.);
00202   mj_monojet_deltaRPFJet1PFJet2   = bei->book1D("mj_monojet_deltaRPFJet1PFJet2", "#DeltaR(PFJet1, PFJet2)", 50, 0., 10.);
00203   mj_monojet_pfmetnomu            = bei->book1D("mj_monojet_pfmetnomu", "PFMET no Mu", 100, 0.0 , 500.0); 
00204   mj_caloMet_et                   = bei->book1D("mj_caloMet", "Calo Missing E_{T}; GeV", 50, 0.0 , 500);
00205   mj_caloMet_phi                  = bei->book1D("mj_caloMet_phi", "Calo Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5 );
00206   mj_pfMet_et                     = bei->book1D("mj_pfMet", "Pf Missing E_{T}; GeV", 50,  0.0 , 500);
00207   mj_pfMet_phi                    = bei->book1D("mj_pfMet_phi", "Pf Missing E_{T} #phi;#phi(MET)", 35, -3.5, 3.5 );
00208   
00209   //
00210   //bei->setCurrentFolder("Physics/Exotica/MultiJetsTrigger"); 
00211  
00212   //--- LongLived
00213   bei->setCurrentFolder("Physics/Exotica/LongLived");
00214   ll_gammajet_sMajMajPhot         = bei->book1D("ll_gammajet_sMajMajPhot", "sMajMajPhot", 50, 0.0 , 5.0);
00215   ll_gammajet_sMinMinPhot         = bei->book1D("ll_gammajet_sMinMinPhot", "sMinMinPhot", 50, 0.0 , 5.0);
00216 
00217   //
00218   //bei->setCurrentFolder("Physics/Exotica/LongLivedTrigger"); 
00219 
00220   //
00221   bei->setCurrentFolder("Physics/Exotica/EIComparison");
00222   ei_pfjet1_pt     = bei->book1D("ei_pfjet1_pt",     "Pt of PFJet-1    (EI) (GeV)", 40, 0.0 , 1000);
00223   ei_pfmet_pt      = bei->book1D("ei_pfmet_pt",      "Pt of PFMET      (EI) (GeV)", 40, 0.0 , 1000);
00224   //ei_pfmuon_pt     = bei->book1D("ei_pfmuon_pt",     "Pt of PFMuon     (EI) (GeV)", 40, 0.0 , 1000);
00225   //ei_pfelectron_pt = bei->book1D("ei_pfelectron_pt", "Pt of PFElectron (EI) (GeV)", 40, 0.0 , 1000);
00226   
00227   bei->cd();
00228 }
00229 
00230 
00231 //
00232 //  -- Analyze 
00233 //
00234 void ExoticaDQM::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup){ 
00235 
00236   // Calo objects
00237   // Electrons
00238   bool ValidCaloElectron = iEvent.getByLabel(ElectronLabel_, ElectronCollection_);
00239   if(!ValidCaloElectron) return;
00240   // Muons
00241   bool ValidCaloMuon = iEvent.getByLabel(MuonLabel_, MuonCollection_);
00242   if(!ValidCaloMuon) return;
00243   // Taus
00244   bool ValidCaloTau = iEvent.getByLabel(TauLabel_, TauCollection_);
00245   if(!ValidCaloTau) return;  
00246   // Photons
00247   bool ValidCaloPhoton = iEvent.getByLabel(PhotonLabel_, PhotonCollection_);
00248   if(!ValidCaloPhoton) return; 
00249   // Jets
00250   bool ValidCaloJet = iEvent.getByLabel(CaloJetLabel_, caloJetCollection_);
00251   if(!ValidCaloJet) return;
00252   calojets = *caloJetCollection_; 
00253   // MET
00254   bool ValidCaloMET = iEvent.getByLabel(CaloMETLabel_, caloMETCollection_);
00255   if(!ValidCaloMET) return;
00256   
00257 
00258   // PF objects
00259   // PFJets
00260   bool ValidPFJet = iEvent.getByLabel(PFJetLabel_, pfJetCollection_);
00261   if(!ValidPFJet) return;
00262   pfjets = *pfJetCollection_; 
00263   // PFMETs
00264   bool ValidPFMET = iEvent.getByLabel(PFMETLabel_, pfMETCollection_);
00265   if(!ValidPFMET) return;
00266   
00267   //#######################################################
00268   // Jet Correction
00269   // Define on-the-fly correction Jet
00270   for(int i=0; i<2; i++){
00271     CaloJetPx[i]   = 0.;
00272     CaloJetPy[i]   = 0.;
00273     CaloJetPt[i]   = 0.;
00274     CaloJetEta[i]  = 0.;
00275     CaloJetPhi[i]  = 0.;
00276     CaloJetEMF[i]  = 0.;
00277     CaloJetfHPD[i] = 0.;
00278     CaloJetn90[i]  = 0.;
00279     PFJetPx[i]     = 0.;
00280     PFJetPy[i]     = 0.;
00281     PFJetPt[i]     = 0.;
00282     PFJetEta[i]    = 0.;
00283     PFJetPhi[i]    = 0.;
00284     PFJetNHEF[i]   = 0.;
00285     PFJetCHEF[i]   = 0.;
00286     PFJetNEMF[i]   = 0.;
00287     PFJetCEMF[i]   = 0.;
00288   }
00289   
00290   //---------- CaloJet Correction (on-the-fly) ----------
00291   const JetCorrector* calocorrector = JetCorrector::getJetCorrector(CaloJetCorService_,iSetup);
00292   CaloJetCollection::const_iterator calojet_ = calojets.begin();
00293   for(; calojet_ != calojets.end(); ++calojet_){
00294     double scale = calocorrector->correction(*calojet_,iEvent, iSetup); 
00295     jetID->calculate(iEvent, *calojet_);
00296     
00297     if(scale*calojet_->pt()>CaloJetPt[0]){
00298       CaloJetPt[1]   = CaloJetPt[0]; 
00299       CaloJetPx[1]   = CaloJetPx[0];
00300       CaloJetPy[1]   = CaloJetPy[0];
00301       CaloJetEta[1]  = CaloJetEta[0];
00302       CaloJetPhi[1]  = CaloJetPhi[0];
00303       CaloJetEMF[1]  = CaloJetEMF[0];
00304       CaloJetfHPD[1] = CaloJetfHPD[0];
00305       CaloJetn90[1]  = CaloJetn90[0];
00306       //
00307       CaloJetPt[0]   = scale*calojet_->pt();
00308       CaloJetPx[0]   = scale*calojet_->px();
00309       CaloJetPy[0]   = scale*calojet_->py();
00310       CaloJetEta[0]  = calojet_->eta();
00311       CaloJetPhi[0]  = calojet_->phi();
00312       CaloJetEMF[0]  = calojet_->emEnergyFraction();
00313       CaloJetfHPD[0] = jetID->fHPD();
00314       CaloJetn90[0]  = jetID->n90Hits();
00315     }
00316     else if(scale*calojet_->pt()<CaloJetPt[0] && scale*calojet_->pt()>CaloJetPt[1] ){
00317       CaloJetPt[1]   = scale*calojet_->pt();
00318       CaloJetPx[1]   = scale*calojet_->px();
00319       CaloJetPy[1]   = scale*calojet_->py();
00320       CaloJetEta[1]  = calojet_->eta();
00321       CaloJetPhi[1]  = calojet_->phi();
00322       CaloJetEMF[1]  = calojet_->emEnergyFraction();
00323       CaloJetfHPD[1] = jetID->fHPD();
00324       CaloJetn90[1]  = jetID->n90Hits();
00325     }
00326     else{}
00327   }
00328   
00329   //
00330   mj_monojet_countPFJet=0;
00331   const JetCorrector* pfcorrector = JetCorrector::getJetCorrector(PFJetCorService_,iSetup);
00332   PFJetCollection::const_iterator pfjet_ = pfjets.begin();
00333   for(; pfjet_ != pfjets.end(); ++pfjet_){
00334     double scale = pfcorrector->correction(*pfjet_,iEvent, iSetup);
00335     if(scale*pfjet_->pt()>PFJetPt[0]){
00336       PFJetPt[1]   = PFJetPt[0];
00337       PFJetPx[1]   = PFJetPx[0];
00338       PFJetPy[1]   = PFJetPy[0];
00339       PFJetEta[1]  = PFJetEta[0];
00340       PFJetPhi[1]  = PFJetPhi[0];
00341       PFJetNHEF[1] = PFJetNHEF[0]; 
00342       PFJetCHEF[1] = PFJetCHEF[0];
00343       PFJetNEMF[1] = PFJetNEMF[0]; 
00344       PFJetCEMF[1] = PFJetCEMF[0];
00345       //
00346       PFJetPt[0]   = scale*pfjet_->pt();
00347       PFJetPx[0]   = scale*pfjet_->px();
00348       PFJetPy[0]   = scale*pfjet_->py();
00349       PFJetEta[0]  = pfjet_->eta();
00350       PFJetPhi[0]  = pfjet_->phi();
00351       PFJetNHEF[0] = pfjet_->neutralHadronEnergyFraction();
00352       PFJetCHEF[0] = pfjet_->chargedHadronEnergyFraction();
00353       PFJetNEMF[0] = pfjet_->neutralEmEnergyFraction();
00354       PFJetCEMF[0] = pfjet_->chargedEmEnergyFraction();
00355     }
00356     else if(scale*pfjet_->pt()<PFJetPt[0] && scale*pfjet_->pt()>PFJetPt[1] ){
00357       PFJetPt[1]   = scale*pfjet_->pt();
00358       PFJetPx[1]   = scale*pfjet_->px();
00359       PFJetPy[1]   = scale*pfjet_->py();
00360       PFJetEta[1]  = pfjet_->eta();
00361       PFJetPhi[1]  = pfjet_->phi(); 
00362       PFJetNHEF[1] = pfjet_->neutralHadronEnergyFraction();
00363       PFJetCHEF[1] = pfjet_->chargedHadronEnergyFraction();
00364       PFJetNEMF[1] = pfjet_->neutralEmEnergyFraction();
00365       PFJetCEMF[1] = pfjet_->chargedEmEnergyFraction();
00366     }
00367     else{}
00368     if(scale*pfjet_->pt()>mj_monojet_ptPFJet_) mj_monojet_countPFJet++;
00369   }
00370   //#######################################################
00371   
00372   
00373   // Analyze
00374   //
00375   analyzeMultiJets(iEvent);
00376   //analyzeMultiJetsTrigger(iEvent);
00377   //
00378   analyzeLongLived(iEvent);
00379   //analyzeLongLivedTrigger(iEvent);
00380 
00381   analyzeEventInterpretation(iEvent, iSetup);
00382 }
00383 
00384 void ExoticaDQM::analyzeMultiJets(const Event & iEvent){ 
00385 
00386   //--- MonoJet
00387   //bool checkLepton = false;
00388   //reco::MuonCollection::const_iterator  muon  = MuonCollection_->begin();
00389   //for(; muon != MuonCollection_->end(); muon++){
00390   //if(muon->pt()<mj_monojet_ptPFMuon_) continue; 
00391   //checkLepton = true; 
00392   //}
00393   //reco::GsfElectronCollection::const_iterator electron = ElectronCollection_->begin();
00394   //for(; electron != ElectronCollection_->end(); electron++){
00395   //if(electron->pt()<mj_monojet_ptPFElectron_) continue; 
00396   //checkLepton = true; 
00397   //}
00398   //if(checkLepton==false){
00399 
00400   if(PFJetPt[0]>0.){
00401     mj_monojet_pfJet1_pt->Fill(PFJetPt[0]);
00402     mj_monojet_pfJet1_eta->Fill(PFJetEta[0]);
00403     mj_monojet_pfchef->Fill(PFJetCHEF[0]);
00404     mj_monojet_pfnhef->Fill(PFJetNHEF[0]); 
00405     mj_monojet_pfcemf->Fill(PFJetCEMF[0]);
00406     mj_monojet_pfnemf->Fill(PFJetNEMF[0]);
00407     mj_monojet_pfJetMulti->Fill(mj_monojet_countPFJet); 
00408   }
00409   if(PFJetPt[1]>0.){
00410     mj_monojet_pfJet2_pt->Fill(PFJetPt[1]);
00411     mj_monojet_pfJet2_eta->Fill(PFJetEta[1]);
00412     mj_monojet_deltaPhiPFJet1PFJet2->Fill(deltaPhi(PFJetPhi[0],PFJetPhi[1]));
00413     mj_monojet_deltaRPFJet1PFJet2->Fill(deltaR(PFJetEta[0],PFJetPhi[0],
00414                                                PFJetEta[1],PFJetPhi[1]));
00415   }
00416   
00417   //--- MET
00418   const CaloMETCollection *calometcol = caloMETCollection_.product();
00419   const CaloMET met = calometcol->front();
00420   mj_caloMet_et->Fill(met.et());
00421   mj_caloMet_phi->Fill(met.phi());
00422   
00423   //
00424   const PFMETCollection *pfmetcol = pfMETCollection_.product();
00425   const PFMET pfmet = pfmetcol->front();
00426   mj_pfMet_et->Fill(pfmet.et());
00427   mj_pfMet_phi->Fill(pfmet.phi());
00428 }
00429 
00430 void ExoticaDQM::analyzeMultiJetsTrigger(const Event & iEvent){
00431 }
00432 
00433 void ExoticaDQM::analyzeLongLived(const Event & iEvent){ 
00434   // SMajMajPho, SMinMinPho
00435   // get ECAL reco hits
00436   Handle<EBRecHitCollection> ecalhitseb;
00437   const EBRecHitCollection* rhitseb=0;
00438   iEvent.getByLabel("reducedEcalRecHitsEB", ecalhitseb);    
00439   rhitseb = ecalhitseb.product(); // get a ptr to the product
00440   //
00441   Handle<EERecHitCollection> ecalhitsee;
00442   const EERecHitCollection* rhitsee=0;
00443   iEvent.getByLabel("reducedEcalRecHitsEE", ecalhitsee);
00444   rhitsee = ecalhitsee.product(); // get a ptr to the product
00445   //
00446   int nPhot = 0;
00447   reco::PhotonCollection::const_iterator photon = PhotonCollection_->begin();
00448   for(; photon != PhotonCollection_->end(); ++photon){
00449     if(photon->energy()<3.) continue;
00450     if(nPhot>=40) continue;
00451     
00452     const Ptr<CaloCluster> theSeed = photon->superCluster()->seed(); 
00453     const EcalRecHitCollection* rechits = ( photon->isEB()) ? rhitseb : rhitsee;
00454     CaloClusterPtr SCseed = photon->superCluster()->seed();
00455     
00456     std::pair<DetId, float> maxRH = EcalClusterTools::getMaximum( *theSeed, &(*rechits) );
00457     
00458     if(maxRH.second) {
00459       Cluster2ndMoments moments = EcalClusterTools::cluster2ndMoments(*SCseed, *rechits);
00460       //std::vector<float> etaphimoments = EcalClusterTools::localCovariances(*SCseed, &(*rechits), &(*topology));
00461       ll_gammajet_sMajMajPhot->Fill(moments.sMaj);
00462       ll_gammajet_sMinMinPhot->Fill(moments.sMin);
00463     }
00464     else{
00465       ll_gammajet_sMajMajPhot->Fill(-100.);
00466       ll_gammajet_sMinMinPhot->Fill(-100.);
00467     }
00468     ++nPhot;
00469   }
00470 
00471 }
00472 
00473 void ExoticaDQM::analyzeLongLivedTrigger(const Event & iEvent){
00474 }
00475 
00476 void ExoticaDQM::analyzeEventInterpretation(const Event & iEvent, const edm::EventSetup& iSetup){  
00477 
00478   // EI
00479   // PFElectrons
00480   bool ValidPFElectronEI = iEvent.getByLabel(PFElectronLabelEI_, pfElectronCollectionEI_);
00481   if(!ValidPFElectronEI) return;
00482   pfelectronsEI = *pfElectronCollectionEI_;
00483 
00484   // PFMuons
00485   bool ValidPFMuonEI = iEvent.getByLabel(PFMuonLabelEI_, pfMuonCollectionEI_);
00486   if(!ValidPFMuonEI) return;
00487   pfmuonsEI = *pfMuonCollectionEI_;
00488   
00489   // PFJets
00490   bool ValidPFJetEI = iEvent.getByLabel(PFJetLabelEI_, pfJetCollectionEI_);
00491   if(!ValidPFJetEI) return;
00492   pfjetsEI = *pfJetCollectionEI_;
00493   
00494   // PFMETs
00495   bool ValidPFMETEI = iEvent.getByLabel(PFMETLabelEI_, pfMETCollectionEI_);
00496   if(!ValidPFMETEI) return;
00497 
00498   // Jet Correction
00499   int countJet = 0;
00500   PFJetEIPt    = -99.;
00501   const JetCorrector* pfcorrectorEI = JetCorrector::getJetCorrector(PFJetCorService_,iSetup);
00502   PFJetCollection::const_iterator pfjet_ = pfjetsEI.begin();
00503   for(; pfjet_ != pfjetsEI.end(); ++pfjet_){
00504     double scale = pfcorrectorEI->correction(*pfjet_,iEvent, iSetup);
00505     if(scale*pfjet_->pt()<PFJetEIPt) continue;
00506     PFJetEIPt   = scale*pfjet_->pt();
00507     PFJetEIPx   = scale*pfjet_->px();
00508     PFJetEIPy   = scale*pfjet_->py();
00509     PFJetEIEta  = pfjet_->eta();
00510     PFJetEIPhi  = pfjet_->phi();
00511     PFJetEINHEF = pfjet_->neutralHadronEnergyFraction();
00512     PFJetEICHEF = pfjet_->chargedHadronEnergyFraction();
00513     PFJetEINEMF = pfjet_->neutralEmEnergyFraction();
00514     PFJetEICEMF = pfjet_->chargedEmEnergyFraction();
00515     countJet++;
00516   }
00517   if(countJet>0){
00518     ei_pfjet1_pt->Fill(PFJetEIPt);
00519   }
00520   
00521   const PFMETCollection *pfmetcolEI = pfMETCollectionEI_.product();
00522   const PFMET pfmetEI = pfmetcolEI->front();
00523   ei_pfmet_pt->Fill(pfmetEI.et());
00524 }
00525 
00526 //
00527 // -- End Luminosity Block
00528 //
00529 void ExoticaDQM::endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& eSetup) {
00530   //edm::LogInfo ("ExoticaDQM") <<"[ExoticaDQM]: End of LS transition, performing the DQM client operation";
00531   nLumiSecs_++;
00532   //edm::LogInfo("ExoticaDQM") << "============================================ " 
00533   //<< endl << " ===> Iteration # " << nLumiSecs_ << " " << lumiSeg.luminosityBlock() 
00534   //<< endl  << "============================================ " << endl;
00535 }
00536 
00537 
00538 //
00539 // -- End Run
00540 //
00541 void ExoticaDQM::endRun(edm::Run const& run, edm::EventSetup const& eSetup){
00542 }
00543 
00544 
00545 //
00546 // -- End Job
00547 //
00548 void ExoticaDQM::endJob(){
00549   //edm::LogInfo("ExoticaDQM") <<"[ExoticaDQM]: endjob called!";
00550 }