CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
AnaL1CaloCleaner.cc File Reference
#include <memory>
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CommonTools/UtilAlgos/interface/TFileService.h"
#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
#include "DataFormats/PatCandidates/interface/Muon.h"
#include "DataFormats/METReco/interface/CaloMET.h"
#include "TTree.h"
#include "TFile.h"
#include "Math/VectorUtil.h"

Go to the source code of this file.

Classes

class  AnaL1CaloCleaner
 

Functions

std::pair< double, double > compMEtProjU (const reco::Candidate::LorentzVector &zP4, double metPx, double metPy, int &errorFlag)
 
std::string getKey (const DetId &det)
 
static const
edm::ParameterSetDescriptionFillerPluginFactory::PMaker
< edm::ParameterSetDescriptionFiller
< AnaL1CaloCleaner > > 
s_filler__LINE__ ("AnaL1CaloCleaner")
 
static const
edm::MakerPluginFactory::PMaker
< edm::WorkerMaker
< AnaL1CaloCleaner > > 
s_maker__LINE__ ("AnaL1CaloCleaner")
 

Function Documentation

std::pair<double, double> compMEtProjU ( const reco::Candidate::LorentzVector zP4,
double  metPx,
double  metPy,
int &  errorFlag 
)

Definition at line 107 of file AnaL1CaloCleaner.cc.

Referenced by AnaL1CaloCleaner::analyze(), and MCEmbeddingValidationAnalyzer::plotEntryTypeL1ETM::fillHistograms().

108 {
109  if ( zP4.pt() == 0. ) {
110  edm::LogWarning ("compMEtProjU")
111  << " Failed to compute projection, because Z0 candidate has zero Pt --> returning dummy solution !!";
112  errorFlag = 1;
113  return std::pair<double, double>(0., 0.);
114  }
115 
116  double qX = zP4.px();
117  double qY = zP4.py();
118  double qT = TMath::Sqrt(qX*qX + qY*qY);
119 
120  double uX = -metPx;//(qX + metPx);
121  double uY = -metPy;//(qY + metPy);
122 
123  double u1 = (uX*qX + uY*qY)/qT;
124  double u2 = (uX*qY - uY*qX)/qT;
125 
126  return std::pair<double, double>(u1, u2);
127 }
std::string getKey ( const DetId det)

Definition at line 82 of file AnaL1CaloCleaner.cc.

References DetId::det(), DetId::Ecal, EcalBarrel, EcalEndcap, EcalLaserPnDiode, EcalPreshower, EcalTriggerTower, DetId::Hcal, HcalBarrel, HcalEmpty, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalTriggerTower, and DetId::subdetId().

Referenced by DTCalibrationMap::getConsts().

83 {
84  std::map<int, std::string > detMap_;
85  std::map<int, std::map<int, std::string> > subDetMap_;
86 
87  detMap_[DetId::Hcal]="Hcal";
88  detMap_[DetId::Ecal]="Ecal";
89 
90  subDetMap_[DetId::Ecal][EcalBarrel]="EcalBarrel";
91  subDetMap_[DetId::Ecal][EcalEndcap]="EcalEndcap";
92  subDetMap_[DetId::Ecal][EcalPreshower ]="EcalPreshower";
93  subDetMap_[DetId::Ecal][EcalTriggerTower]="EcalTriggerTower";
94  subDetMap_[DetId::Ecal][EcalLaserPnDiode]="EcalLaserPnDiode";
95 
96  subDetMap_[DetId::Hcal][HcalEmpty]="HcalEmpty";
97  subDetMap_[DetId::Hcal][HcalBarrel]="HcalBarrel";
98  subDetMap_[DetId::Hcal][HcalEndcap]="HcalEndcap";
99  subDetMap_[DetId::Hcal][HcalOuter]="HcalOuter";
100  subDetMap_[DetId::Hcal][HcalForward]="HcalForward";
101  subDetMap_[DetId::Hcal][HcalTriggerTower]="HcalTriggerTower";
102  subDetMap_[DetId::Hcal][HcalOther]="HcalOther";
103 
104  return "H_"+detMap_[det.det()]+"_"+subDetMap_[det.det()][det.subdetId()];
105 }
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< AnaL1CaloCleaner > > s_filler__LINE__ ( "AnaL1CaloCleaner"  )
static
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< AnaL1CaloCleaner > > s_maker__LINE__ ( "AnaL1CaloCleaner"  )
static