CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
METTester Class Reference

#include <METTester.h>

Inheritance diagram for METTester:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
void FillMETRes ()
 
 METTester (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

bool isGoodTrack (const reco::TrackRef, float d0corr)
 

Private Attributes

edm::EDGetTokenT< reco::BeamSpotbeamSpotToken_
 
edm::EDGetTokenT
< reco::CaloMETCollection
caloMETsToken_
 
edm::EDGetTokenT< edm::View
< reco::GsfElectron > > 
electronToken_
 
edm::EDGetTokenT
< reco::GenMETCollection
genMETsCaloToken_
 
edm::EDGetTokenT
< reco::GenMETCollection
genMETsToken_
 
edm::EDGetTokenT
< reco::GenMETCollection
genMETsTrueToken_
 
edm::InputTag inputBeamSpotLabel_
 
edm::InputTag inputCaloMETLabel_
 
edm::InputTag inputElectronLabel_
 
edm::InputTag inputMETLabel_
 
edm::InputTag inputMuonLabel_
 
edm::InputTag inputTrackLabel_
 
bool isCaloMET
 
bool isGenMET
 
bool isPFMET
 
bool isTcMET
 
double maxchi2_
 
double maxd0_
 
double maxeta_
 
double maxpt_
 
double maxPtErr_
 
MonitorElementmCaloEmEtFraction
 
MonitorElementmCaloEmEtInEB
 
MonitorElementmCaloEmEtInEE
 
MonitorElementmCaloEmEtInHF
 
MonitorElementmCaloEtFractionHadronic
 
MonitorElementmCaloHadEtInEB
 
MonitorElementmCaloHadEtInEE
 
MonitorElementmCaloHadEtInHB
 
MonitorElementmCaloHadEtInHE
 
MonitorElementmCaloHadEtInHF
 
MonitorElementmCaloHadEtInHO
 
MonitorElementmCaloMaxEtInEmTowers
 
MonitorElementmCaloMaxEtInHadTowers
 
MonitorElementmCaloSETInmHF
 
MonitorElementmCaloSETInpHF
 
MonitorElementmChargedEMEtFraction
 
MonitorElementmChargedHadEtFraction
 
MonitorElementmdMET
 
MonitorElementmdMETx
 
MonitorElementmdMETy
 
MonitorElementmdMEy
 
MonitorElementmdMUx
 
MonitorElementmdMUy
 
std::map< std::string,
MonitorElement * > 
me
 
MonitorElementmeleEta
 
MonitorElementmeleHoE
 
MonitorElementmelePt
 
edm::EDGetTokenT
< edm::ValueMap
< reco::MuonMETCorrectionData > > 
met_ValueMap_Token_
 
std::string METType_
 
MonitorElementmfracTrks
 
int minhits_
 
edm::InputTag mInputCollection_
 
MonitorElementmInvisibleEtFraction
 
MonitorElementmMET
 
MonitorElementmMET_Nvtx
 
MonitorElementmMETDeltaPhi_GenMETCalo
 
MonitorElementmMETDeltaPhi_GenMETTrue
 
MonitorElementmMETDifference_GenMETCalo
 
MonitorElementmMETDifference_GenMETTrue
 
MonitorElementmMETDifference_GenMETTrue_MET0to20
 
MonitorElementmMETDifference_GenMETTrue_MET100to150
 
MonitorElementmMETDifference_GenMETTrue_MET150to200
 
MonitorElementmMETDifference_GenMETTrue_MET200to300
 
MonitorElementmMETDifference_GenMETTrue_MET20to40
 
MonitorElementmMETDifference_GenMETTrue_MET300to400
 
MonitorElementmMETDifference_GenMETTrue_MET400to500
 
MonitorElementmMETDifference_GenMETTrue_MET40to60
 
MonitorElementmMETDifference_GenMETTrue_MET60to80
 
MonitorElementmMETDifference_GenMETTrue_MET80to100
 
MonitorElementmMETDifference_GenMETTrue_METResolution
 
MonitorElementmMETFine
 
MonitorElementmMETPhi
 
MonitorElementmMETSig
 
MonitorElementmMEx
 
MonitorElementmMExCorrection
 
MonitorElementmMEy
 
MonitorElementmMEyCorrection
 
MonitorElementmmuChi2
 
MonitorElementmmuD0
 
MonitorElementmmuEta
 
MonitorElementmmuNhits
 
MonitorElementmMuonCorrectionFlag
 
MonitorElementmMuonEtFraction
 
MonitorElementmmuPt
 
MonitorElementmmuSAhits
 
MonitorElementmmuTesthits
 
MonitorElementmnEls
 
MonitorElementmNeutralEMEtFraction
 
MonitorElementmNeutralHadEtFraction
 
MonitorElementmnMus
 
MonitorElementmnMusPis
 
MonitorElementmNvertex
 
std::string mOutputFile
 
MonitorElementmPFchargedHadronEt
 
MonitorElementmPFchargedHadronEtFraction
 
MonitorElementmPFelectronEt
 
MonitorElementmPFelectronEtFraction
 
MonitorElementmPFHFEMEt
 
MonitorElementmPFHFEMEtFraction
 
MonitorElementmPFHFHadronEt
 
MonitorElementmPFHFHadronEtFraction
 
MonitorElementmPFmuonEt
 
MonitorElementmPFmuonEtFraction
 
MonitorElementmPFneutralHadronEt
 
MonitorElementmPFneutralHadronEtFraction
 
MonitorElementmPFphotonEt
 
MonitorElementmPFphotonEtFraction
 
MonitorElementmSumET
 
MonitorElementmtrkAlgo
 
MonitorElementmtrkChi2
 
MonitorElementmtrkD0
 
MonitorElementmtrkEta
 
MonitorElementmtrkNhits
 
MonitorElementmtrkPt
 
MonitorElementmtrkPtErr
 
MonitorElementmtrkQuality
 
edm::EDGetTokenT
< reco::MuonCollection
muonToken_
 
edm::EDGetTokenT
< reco::PFMETCollection
pfMETsToken_
 
edm::EDGetTokenT< std::vector
< reco::Vertex > > 
pvToken_
 
std::string sample_
 
edm::EDGetTokenT
< edm::ValueMap
< reco::MuonMETCorrectionData > > 
tcMet_ValueMap_Token_
 
edm::EDGetTokenT
< reco::METCollection
tcMETsToken_
 
edm::EDGetTokenT
< reco::TrackCollection
trackToken_
 
std::vector< int > trkAlgos_
 
std::vector< int > trkQuality_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 50 of file METTester.h.

Constructor & Destructor Documentation

METTester::METTester ( const edm::ParameterSet iConfig)
explicit

Definition at line 32 of file METTester.cc.

References DQMStore::book1D(), DQMStore::bookProfile(), dbe_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

33 {
34 
35  inputMETLabel_ =iConfig.getParameter<edm::InputTag>("InputMETLabel");
36  METType_ =iConfig.getUntrackedParameter<std::string>("METType");
37  mOutputFile =iConfig.getUntrackedParameter<std::string>("OutputFile","");
38 
39  std::string inputMETCollectionLabel(inputMETLabel_.label());
40 
41  isCaloMET = (std::string("calo")==METType_);
42 // isCorMET = (std::string("cor") ==METType_);
43  isTcMET = (std::string("tc") ==METType_);
44  isPFMET = (std::string("pf") ==METType_);
45  isGenMET = (std::string("gen") ==METType_);
46 
47  if(isTcMET) {
48  inputCaloMETLabel_ =iConfig.getParameter<edm::InputTag>("InputCaloMETLabel");
49  inputTrackLabel_ =iConfig.getParameter<edm::InputTag>("InputTrackLabel");
50  inputMuonLabel_ =iConfig.getParameter<edm::InputTag>("InputMuonLabel");
51  inputElectronLabel_ =iConfig.getParameter<edm::InputTag>("InputElectronLabel");
52  inputBeamSpotLabel_ =iConfig.getParameter<edm::InputTag>("InputBeamSpotLabel");
53  minhits_ =iConfig.getParameter<int>("minhits");
54  maxd0_ =iConfig.getParameter<double>("maxd0");
55  maxchi2_ =iConfig.getParameter<double>("maxchi2");
56  maxeta_ =iConfig.getParameter<double>("maxeta");
57  maxpt_ =iConfig.getParameter<double>("maxpt");
58  maxPtErr_ =iConfig.getParameter<double>("maxPtErr");
59  trkQuality_ =iConfig.getParameter<std::vector<int> >("trkQuality");
60  trkAlgos_ =iConfig.getParameter<std::vector<int> >("trkAlgos");
61  sample_ =iConfig.getUntrackedParameter<std::string>("sample");
62  }
63 
64  pvToken_ = consumes<std::vector<reco::Vertex> >(edm::InputTag("offlinePrimaryVertices"));
65  if (isCaloMET) caloMETsToken_ = consumes<reco::CaloMETCollection> (inputMETLabel_);
66  if (isTcMET) tcMETsToken_ = consumes<reco::METCollection> (inputMETLabel_);
67  if (isPFMET) pfMETsToken_ = consumes<reco::PFMETCollection> (inputMETLabel_);
68  if (isGenMET) genMETsToken_ = consumes<reco::GenMETCollection> (inputMETLabel_);
69  if (isTcMET) {
70  caloMETsToken_ = consumes<reco::CaloMETCollection> (inputCaloMETLabel_);
71  muonToken_ = consumes<reco::MuonCollection>(inputMuonLabel_);
72  trackToken_ = consumes<reco::TrackCollection>(inputTrackLabel_);
73  electronToken_ = consumes<edm::View<reco::GsfElectron > >(inputElectronLabel_);
74  beamSpotToken_ = consumes<reco::BeamSpot>(inputBeamSpotLabel_);
75  tcMet_ValueMap_Token_ = consumes<edm::ValueMap<reco::MuonMETCorrectionData> >(edm::InputTag("muonTCMETValueMapProducer" , "muCorrData"));
76  met_ValueMap_Token_ = consumes<edm::ValueMap<reco::MuonMETCorrectionData> >(edm::InputTag("muonMETValueMapProducer" , "muCorrData"));
77  }
78  genMETsTrueToken_ = consumes<reco::GenMETCollection> (edm::InputTag("genMetTrue"));
79  genMETsCaloToken_ = consumes<reco::GenMETCollection> (edm::InputTag("genMetCalo"));
80  //Events variables
81  mNvertex = 0;
82 
83  //Common variables
84  mMEx = 0;
85  mMEy = 0;
86  mMETSig = 0;
87  mMET = 0;
88  mMETFine = 0;
89  mMET_Nvtx = 0;
90  mMETPhi = 0;
91  mSumET = 0;
96 
97  //CaloMET variables
101  mCaloEmEtFraction = 0;
102  mCaloHadEtInHB = 0;
103  mCaloHadEtInHO = 0;
104  mCaloHadEtInHE = 0;
105  mCaloHadEtInHF = 0;
106  mCaloEmEtInHF = 0;
107  mCaloSETInpHF = 0;
108  mCaloSETInmHF = 0;
109  mCaloEmEtInEE = 0;
110  mCaloEmEtInEB = 0;
111 
112 
113  //GenMET variables
118  mMuonEtFraction=0;
120 
121  //MET variables
122 
123  //PFMET variables
135 
136  //TCMET specific variables
137  mMExCorrection=0;
138  mMEyCorrection=0;
140  mtrkPt=0;
141  mtrkEta=0;
142  mtrkNhits=0;
143  mtrkChi2=0;
144  mtrkD0=0;
145  mtrkQuality=0;
146  mtrkAlgo=0;
147  mtrkPtErr=0;
148  melePt=0;
149  meleEta=0;
150  meleHoE=0;
151 
152  mmuPt=0;
153  mmuEta=0;
154  mmuNhits=0;
155  mmuChi2=0;
156  mmuD0=0;
157  mnMus=0;
158  mnMusPis=0;
159  mnEls=0;
160  mfracTrks=0;
161  mdMET=0;
162  mdMETx=0;
163  mdMETy=0;
164  mdMEy=0;
165  mdMUx=0;
166  mdMUy=0;
167 
168  // get ahold of back-end interface
170 
171  if (dbe_) {
172 
173  dbe_->setCurrentFolder("JetMET/METValidation/"+inputMETLabel_.label());
174 
175  mNvertex = dbe_->book1D("Nvertex","Nvertex",80,0,80);
176  mMEx = dbe_->book1D("MEx","MEx",160,-800,800);
177  mMEy = dbe_->book1D("MEy","MEy",160,-800,800);
178  mMETSig = dbe_->book1D("METSig","METSig",25,0,24.5);
179  mMET = dbe_->book1D("MET", "MET (20 GeV binning)" , 100,0,2000);
180  mMETFine = dbe_->book1D("METFine", "MET (2 GeV binning)" , 1000,0,2000);
181  mMET_Nvtx = dbe_->bookProfile("MET_Nvtx", "MET vs. nvtx", 60, 0., 60., 0., 2000., " ");
182  mMETPhi = dbe_->book1D("METPhi","METPhi",80,-4,4);
183  mSumET = dbe_->book1D("SumET" , "SumET" , 200,0,4000); //10GeV
184  mMETDifference_GenMETTrue = dbe_->book1D("METDifference_GenMETTrue","METDifference_GenMETTrue", 500,-500,500);
185  mMETDeltaPhi_GenMETTrue = dbe_->book1D("METDeltaPhi_GenMETTrue","METDeltaPhi_GenMETTrue", 80,0,4);
186  mMETDifference_GenMETCalo = dbe_->book1D("METDifference_GenMETCalo","METDifference_GenMETCalo", 500,-500,500);
187  mMETDeltaPhi_GenMETCalo = dbe_->book1D("METDeltaPhi_GenMETCalo","METDeltaPhi_GenMETCalo", 80,0,4);
188 
189  mMETDifference_GenMETTrue_MET0to20 = dbe_->book1D("METResolution_GenMETTrue_MET0to20" , "METResolution_GenMETTrue_MET0to20" , 500,-500,500);
190  mMETDifference_GenMETTrue_MET20to40 = dbe_->book1D("METResolution_GenMETTrue_MET20to40" , "METResolution_GenMETTrue_MET20to40" , 500,-500,500);
191  mMETDifference_GenMETTrue_MET40to60 = dbe_->book1D("METResolution_GenMETTrue_MET40to60" , "METResolution_GenMETTrue_MET40to60" , 500,-500,500);
192  mMETDifference_GenMETTrue_MET60to80 = dbe_->book1D("METResolution_GenMETTrue_MET60to80" , "METResolution_GenMETTrue_MET60to80" , 500,-500,500);
193  mMETDifference_GenMETTrue_MET80to100 = dbe_->book1D("METResolution_GenMETTrue_MET80to100" , "METResolution_GenMETTrue_MET80to100" , 500,-500,500);
194  mMETDifference_GenMETTrue_MET100to150 = dbe_->book1D("METResolution_GenMETTrue_MET100to150", "METResolution_GenMETTrue_MET100to150", 500,-500,500);
195  mMETDifference_GenMETTrue_MET150to200 = dbe_->book1D("METResolution_GenMETTrue_MET150to200", "METResolution_GenMETTrue_MET150to200", 500,-500,500);
196  mMETDifference_GenMETTrue_MET200to300 = dbe_->book1D("METResolution_GenMETTrue_MET200to300", "METResolution_GenMETTrue_MET200to300", 500,-500,500);
197  mMETDifference_GenMETTrue_MET300to400 = dbe_->book1D("METResolution_GenMETTrue_MET300to400", "METResolution_GenMETTrue_MET300to400", 500,-500,500);
198  mMETDifference_GenMETTrue_MET400to500 = dbe_->book1D("METResolution_GenMETTrue_MET400to500", "METResolution_GenMETTrue_MET400to500", 500,-500,500);
199  //this will be filled at the end of the job using info from above hists
200  int nBins = 10;
201  float bins[] = {0.,20.,40.,60.,80.,100.,150.,200.,300.,400.,500.};
202  mMETDifference_GenMETTrue_METResolution = dbe_->book1D("METResolution_GenMETTrue_InMETBins","METResolution_GenMETTrue_InMETBins",nBins, bins);
203 
204  if ( isCaloMET) {
205  mCaloMaxEtInEmTowers = dbe_->book1D("CaloMaxEtInEmTowers","CaloMaxEtInEmTowers",300,0,1500); //5GeV
206  mCaloMaxEtInHadTowers = dbe_->book1D("CaloMaxEtInHadTowers","CaloMaxEtInHadTowers",300,0,1500); //5GeV
207  mCaloEtFractionHadronic = dbe_->book1D("CaloEtFractionHadronic","CaloEtFractionHadronic",100,0,1);
208  mCaloEmEtFraction = dbe_->book1D("CaloEmEtFraction","CaloEmEtFraction",100,0,1);
209  mCaloHadEtInHB = dbe_->book1D("CaloHadEtInHB","CaloHadEtInHB", 200, 0, 2000); //5GeV
210  mCaloHadEtInHE = dbe_->book1D("CaloHadEtInHE","CaloHadEtInHE", 100, 0, 500); //5GeV
211  mCaloHadEtInHO = dbe_->book1D("CaloHadEtInHO","CaloHadEtInHO", 100, 0, 200); //5GeV
212  mCaloHadEtInHF = dbe_->book1D("CaloHadEtInHF","CaloHadEtInHF", 100, 0, 200); //5GeV
213  mCaloSETInpHF = dbe_->book1D("CaloSETInpHF","CaloSETInpHF",100, 0, 500);
214  mCaloSETInmHF = dbe_->book1D("CaloSETInmHF","CaloSETInmHF",100, 0, 500);
215  mCaloEmEtInEE = dbe_->book1D("CaloEmEtInEE","CaloEmEtInEE",100, 0, 500); //5GeV
216  mCaloEmEtInEB = dbe_->book1D("CaloEmEtInEB","CaloEmEtInEB",100, 0, 500); //5GeV
217  mCaloEmEtInHF = dbe_->book1D("CaloEmEtInHF","CaloEmEtInHF",100, 0, 500); //5GeV
218  }
219 
220  if(isGenMET){
221  mNeutralEMEtFraction = dbe_->book1D("GenNeutralEMEtFraction", "GenNeutralEMEtFraction", 120, 0.0, 1.2 );
222  mNeutralHadEtFraction = dbe_->book1D("GenNeutralHadEtFraction", "GenNeutralHadEtFraction", 120, 0.0, 1.2 );
223  mChargedEMEtFraction = dbe_->book1D("GenChargedEMEtFraction", "GenChargedEMEtFraction", 120, 0.0, 1.2);
224  mChargedHadEtFraction = dbe_->book1D("GenChargedHadEtFraction", "GenChargedHadEtFraction", 120, 0.0,1.2);
225  mMuonEtFraction = dbe_->book1D("GenMuonEtFraction", "GenMuonEtFraction", 120, 0.0, 1.2 );
226  mInvisibleEtFraction = dbe_->book1D("GenInvisibleEtFraction", "GenInvisibleEtFraction", 120, 0.0, 1.2 );
227  }
228 
229  if (isPFMET){
230  mPFphotonEtFraction = dbe_->book1D("photonEtFraction", "photonEtFraction", 100, 0, 1);
231  mPFphotonEt = dbe_->book1D("photonEt", "photonEt", 100, 0, 1000);
232  mPFneutralHadronEtFraction = dbe_->book1D("neutralHadronEtFraction", "neutralHadronEtFraction", 100, 0, 1);
233  mPFneutralHadronEt = dbe_->book1D("neutralHadronEt", "neutralHadronEt", 100, 0, 1000);
234  mPFelectronEtFraction = dbe_->book1D("electronEtFraction", "electronEtFraction", 100, 0, 1);
235  mPFelectronEt = dbe_->book1D("electronEt", "electronEt", 100, 0, 1000);
236  mPFchargedHadronEtFraction = dbe_->book1D("chargedHadronEtFraction", "chargedHadronEtFraction", 100, 0, 1);
237  mPFchargedHadronEt = dbe_->book1D("chargedHadronEt", "chargedHadronEt", 100, 0, 1000);
238  mPFmuonEtFraction = dbe_->book1D("muonEtFraction", "muonEtFraction", 100, 0, 1);
239  mPFmuonEt = dbe_->book1D("muonEt", "muonEt", 100, 0, 1000);
240  mPFHFHadronEtFraction = dbe_->book1D("HFHadronEtFraction", "HFHadronEtFraction", 100, 0, 1);
241  mPFHFHadronEt = dbe_->book1D("HFHadronEt", "HFHadronEt", 100, 0, 500);
242  mPFHFEMEtFraction = dbe_->book1D("HFEMEtFraction", "HFEMEtFraction", 100, 0, 1);
243  mPFHFEMEt = dbe_->book1D("HFEMEt", "HFEMEt", 100, 0, 300);
244 
245  }
246 
247  if ( isTcMET){
248  //TCMET or MuonCorrectedCaloMET Histograms
249 
250  mMExCorrection = dbe_->book1D("MExCorrection","MExCorrection", 1000, -500.0,500.0);
251  mMEyCorrection = dbe_->book1D("MEyCorrection","MEyCorrection", 1000, -500.0,500.0);
252  mMuonCorrectionFlag = dbe_->book1D("CorrectionFlag", "CorrectionFlag", 6, -0.5, 5.5);
253 
254  if(isTcMET) {//TCMET only histograms
255  mtrkPt = dbe_->book1D("trackPt", "trackPt", 50, 0, 500);
256  mtrkEta = dbe_->book1D("trackEta", "trackEta", 50, -2.5, 2.5);
257  mtrkNhits = dbe_->book1D("trackNhits", "trackNhits", 50, 0, 50);
258  mtrkChi2 = dbe_->book1D("trackNormalizedChi2", "trackNormalizedChi2", 20, 0, 20);
259  mtrkD0 = dbe_->book1D("trackD0", "trackd0", 50, -1, 1);
260  mtrkQuality = dbe_->book1D("trackQuality", "trackQuality", 30, -0.5, 29.5);
261  mtrkAlgo = dbe_->book1D("trackAlgo", "trackAlgo", 6, 3.5, 9.5);
262  mtrkPtErr = dbe_->book1D("trackPtErr", "trackPtErr", 200, 0, 2);
263  melePt = dbe_->book1D("electronPt", "electronPt", 50, 0, 500);
264  meleEta = dbe_->book1D("electronEta", "electronEta", 50, -2.5, 2.5);
265  meleHoE = dbe_->book1D("electronHoverE", "electronHoverE", 25, 0, 0.5);
266  mmuPt = dbe_->book1D("muonPt", "muonPt", 50, 0, 500);
267  mmuEta = dbe_->book1D("muonEta", "muonEta", 50, -2.5, 2.5);
268  mmuNhits = dbe_->book1D("muonNhits", "muonNhits", 50, 0, 50);
269  mmuChi2 = dbe_->book1D("muonNormalizedChi2", "muonNormalizedChi2", 20, 0, 20);
270  mmuD0 = dbe_->book1D("muonD0", "muonD0", 50, -1, 1);
271  mnMus = dbe_->book1D("nMus", "nMus", 5, -0.5, 4.5);
272  mnMusPis = dbe_->book1D("nMusAsPis", "nMusAsPis", 5, -0.5, 4.5);
273  mnEls = dbe_->book1D("nEls", "nEls", 5, -0.5, 4.5);
274  mfracTrks = dbe_->book1D("fracTracks", "fracTracks", 100, 0, 1);
275  mdMETx = dbe_->book1D("dMETx", "difference to caloMETx", 500, -250, 250);
276  mdMETy = dbe_->book1D("dMETy", "difference to caloMETy", 500, -250, 250);
277  mdMET = dbe_->book1D("dMET", "difference to caloMET", 500, -250, 250);
278  mdMUx = dbe_->book1D("dMUx", "dMUx", 500, -250, 250);
279  mdMUy = dbe_->book1D("dMUy", "dMUy", 500, -250, 250);
280  mMuonCorrectionFlag->setBinLabel(1,"Not Corrected");
281  mMuonCorrectionFlag->setBinLabel(2,"Global Fit");
282  mMuonCorrectionFlag->setBinLabel(3,"Tracker Fit");
283  mMuonCorrectionFlag->setBinLabel(4,"SA Fit");
284  mMuonCorrectionFlag->setBinLabel(5,"Treated as Pion");
285  mMuonCorrectionFlag->setBinLabel(6,"Default fit");
286  }
287 // if(isCorMET) {
288 // mmuPt = dbe_->book1D("muonPt", "muonPt", 50, 0, 500);
289 // mmuEta = dbe_->book1D("muonEta", "muonEta", 50, -2.5, 2.5);
290 // mmuNhits = dbe_->book1D("muonNhits", "muonNhits", 50, 0, 50);
291 // mmuChi2 = dbe_->book1D("muonNormalizedChi2", "muonNormalizedChi2", 20, 0, 20);
292 // mmuD0 = dbe_->book1D("muonD0", "muonD0", 50, -1, 1);
293 // mMuonCorrectionFlag->setBinLabel(1,"Not Corrected");
294 // mMuonCorrectionFlag->setBinLabel(2,"Global Fit");
295 // mMuonCorrectionFlag->setBinLabel(3,"Tracker Fit");
296 // mMuonCorrectionFlag->setBinLabel(4,"SA Fit");
297 // mMuonCorrectionFlag->setBinLabel(5,"Treated as Pion");
298 // mMuonCorrectionFlag->setBinLabel(6,"Default fit");
299 // }
300  }
301 
302  else {
303  edm::LogInfo("OutputInfo") << " METType not correctly specified!'";// << outputFile_.c_str();
304  }
305  }
306  if (mOutputFile.empty ())
307  {
308  LogInfo("OutputInfo") << " Histograms will NOT be saved";
309  }
310  else
311  {
312  LogInfo("OutputInfo") << " Histograms will be saved to file:" << mOutputFile;
313  }
314 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * mChargedEMEtFraction
Definition: METTester.h:146
MonitorElement * mMETDifference_GenMETTrue_METResolution
Definition: METTester.h:179
edm::InputTag inputCaloMETLabel_
Definition: METTester.h:76
MonitorElement * mMExCorrection
Definition: METTester.h:183
double maxchi2_
Definition: METTester.h:102
edm::InputTag inputTrackLabel_
Definition: METTester.h:77
MonitorElement * mMuonEtFraction
Definition: METTester.h:148
MonitorElement * mMETPhi
Definition: METTester.h:119
MonitorElement * mMET
Definition: METTester.h:116
MonitorElement * mMETDifference_GenMETTrue
Definition: METTester.h:121
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
MonitorElement * mtrkPtErr
Definition: METTester.h:193
MonitorElement * mMETDifference_GenMETTrue_MET400to500
Definition: METTester.h:178
MonitorElement * mdMETx
Definition: METTester.h:210
MonitorElement * mPFelectronEtFraction
Definition: METTester.h:158
MonitorElement * mMETSig
Definition: METTester.h:115
MonitorElement * mmuD0
Definition: METTester.h:202
MonitorElement * mtrkNhits
Definition: METTester.h:188
MonitorElement * mCaloMaxEtInEmTowers
Definition: METTester.h:127
MonitorElement * mMEy
Definition: METTester.h:114
MonitorElement * mCaloSETInpHF
Definition: METTester.h:138
MonitorElement * mCaloHadEtInHF
Definition: METTester.h:134
edm::EDGetTokenT< edm::View< reco::GsfElectron > > electronToken_
Definition: METTester.h:93
MonitorElement * mdMUx
Definition: METTester.h:213
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * mPFphotonEtFraction
Definition: METTester.h:154
MonitorElement * mnEls
Definition: METTester.h:207
MonitorElement * mPFHFEMEt
Definition: METTester.h:167
MonitorElement * mMETDifference_GenMETTrue_MET40to60
Definition: METTester.h:171
bool isPFMET
Definition: METTester.h:219
MonitorElement * mmuEta
Definition: METTester.h:199
MonitorElement * mCaloEmEtFraction
Definition: METTester.h:130
MonitorElement * mCaloEmEtInEE
Definition: METTester.h:140
std::string METType_
Definition: METTester.h:74
MonitorElement * mCaloSETInmHF
Definition: METTester.h:139
std::vector< int > trkQuality_
Definition: METTester.h:106
MonitorElement * mNeutralEMEtFraction
Definition: METTester.h:144
edm::InputTag inputElectronLabel_
Definition: METTester.h:79
MonitorElement * mMETDifference_GenMETTrue_MET20to40
Definition: METTester.h:170
MonitorElement * mMETDifference_GenMETTrue_MET60to80
Definition: METTester.h:172
MonitorElement * mCaloMaxEtInHadTowers
Definition: METTester.h:128
MonitorElement * mfracTrks
Definition: METTester.h:208
std::vector< int > trkAlgos_
Definition: METTester.h:107
std::string sample_
Definition: METTester.h:72
MonitorElement * mInvisibleEtFraction
Definition: METTester.h:149
MonitorElement * mCaloEtFractionHadronic
Definition: METTester.h:129
MonitorElement * mtrkChi2
Definition: METTester.h:189
bool isTcMET
Definition: METTester.h:218
MonitorElement * mPFmuonEt
Definition: METTester.h:163
MonitorElement * mPFelectronEt
Definition: METTester.h:159
MonitorElement * mnMusPis
Definition: METTester.h:204
MonitorElement * mtrkEta
Definition: METTester.h:187
MonitorElement * mPFphotonEt
Definition: METTester.h:155
MonitorElement * mCaloEmEtInEB
Definition: METTester.h:141
MonitorElement * mCaloHadEtInHE
Definition: METTester.h:133
edm::EDGetTokenT< reco::PFMETCollection > pfMETsToken_
Definition: METTester.h:85
edm::EDGetTokenT< reco::CaloMETCollection > caloMETsToken_
Definition: METTester.h:84
MonitorElement * mPFneutralHadronEtFraction
Definition: METTester.h:156
MonitorElement * mtrkQuality
Definition: METTester.h:191
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: METTester.h:94
MonitorElement * mdMETy
Definition: METTester.h:211
edm::EDGetTokenT< reco::TrackCollection > trackToken_
Definition: METTester.h:92
MonitorElement * mPFHFHadronEt
Definition: METTester.h:165
bool isGenMET
Definition: METTester.h:220
edm::InputTag inputBeamSpotLabel_
Definition: METTester.h:80
MonitorElement * mdMEy
Definition: METTester.h:212
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
Definition: METTester.h:83
edm::EDGetTokenT< reco::GenMETCollection > genMETsToken_
Definition: METTester.h:87
std::string mOutputFile
Definition: METTester.h:71
double maxPtErr_
Definition: METTester.h:105
MonitorElement * mMETDifference_GenMETTrue_MET150to200
Definition: METTester.h:175
MonitorElement * mtrkPt
Definition: METTester.h:186
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1186
bool isCaloMET
Definition: METTester.h:216
MonitorElement * mMETDeltaPhi_GenMETCalo
Definition: METTester.h:124
MonitorElement * mnMus
Definition: METTester.h:203
MonitorElement * mMETDifference_GenMETTrue_MET100to150
Definition: METTester.h:174
MonitorElement * mCaloHadEtInHB
Definition: METTester.h:131
edm::InputTag inputMuonLabel_
Definition: METTester.h:78
MonitorElement * mMETDifference_GenMETTrue_MET300to400
Definition: METTester.h:177
DQMStore * dbe_
MonitorElement * mMETDifference_GenMETCalo
Definition: METTester.h:123
MonitorElement * mCaloHadEtInHO
Definition: METTester.h:132
MonitorElement * mmuPt
Definition: METTester.h:198
double maxpt_
Definition: METTester.h:104
edm::EDGetTokenT< reco::METCollection > tcMETsToken_
Definition: METTester.h:86
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Definition: METTester.h:91
MonitorElement * mPFchargedHadronEt
Definition: METTester.h:161
MonitorElement * mMEx
Definition: METTester.h:113
MonitorElement * melePt
Definition: METTester.h:194
MonitorElement * mChargedHadEtFraction
Definition: METTester.h:147
MonitorElement * mMETDeltaPhi_GenMETTrue
Definition: METTester.h:122
MonitorElement * mPFneutralHadronEt
Definition: METTester.h:157
MonitorElement * mmuNhits
Definition: METTester.h:200
edm::EDGetTokenT< reco::GenMETCollection > genMETsCaloToken_
Definition: METTester.h:89
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > tcMet_ValueMap_Token_
Definition: METTester.h:95
edm::EDGetTokenT< reco::GenMETCollection > genMETsTrueToken_
Definition: METTester.h:88
MonitorElement * mPFmuonEtFraction
Definition: METTester.h:162
std::string const & label() const
Definition: InputTag.h:42
MonitorElement * mMETFine
Definition: METTester.h:117
MonitorElement * mmuChi2
Definition: METTester.h:201
MonitorElement * mNeutralHadEtFraction
Definition: METTester.h:145
MonitorElement * mPFHFEMEtFraction
Definition: METTester.h:166
int minhits_
Definition: METTester.h:100
MonitorElement * mtrkD0
Definition: METTester.h:190
MonitorElement * mMuonCorrectionFlag
Definition: METTester.h:185
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > met_ValueMap_Token_
Definition: METTester.h:96
MonitorElement * mtrkAlgo
Definition: METTester.h:192
MonitorElement * mNvertex
Definition: METTester.h:110
MonitorElement * mMET_Nvtx
Definition: METTester.h:118
double maxeta_
Definition: METTester.h:103
MonitorElement * mPFchargedHadronEtFraction
Definition: METTester.h:160
MonitorElement * mdMET
Definition: METTester.h:209
MonitorElement * mMEyCorrection
Definition: METTester.h:184
MonitorElement * mMETDifference_GenMETTrue_MET0to20
Definition: METTester.h:169
MonitorElement * mSumET
Definition: METTester.h:120
edm::InputTag inputMETLabel_
Definition: METTester.h:73
double maxd0_
Definition: METTester.h:101
MonitorElement * meleHoE
Definition: METTester.h:196
MonitorElement * mdMUy
Definition: METTester.h:214
MonitorElement * mMETDifference_GenMETTrue_MET200to300
Definition: METTester.h:176
MonitorElement * meleEta
Definition: METTester.h:195
MonitorElement * mMETDifference_GenMETTrue_MET80to100
Definition: METTester.h:173
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
MonitorElement * mCaloEmEtInHF
Definition: METTester.h:137
MonitorElement * mPFHFHadronEtFraction
Definition: METTester.h:164

Member Function Documentation

void METTester::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 322 of file METTester.cc.

References reco::CaloMET::CaloSETInmHF(), reco::CaloMET::CaloSETInpHF(), reco::GenMET::ChargedEMEtFraction(), reco::GenMET::ChargedHadEtFraction(), reco::PFMET::chargedHadronEt(), reco::PFMET::chargedHadronEtFraction(), reco::MuonMETCorrectionData::corrX(), reco::MuonMETCorrectionData::corrY(), gather_cfg::cout, reco::PFMET::electronEt(), reco::PFMET::electronEtFraction(), reco::CaloMET::emEtFraction(), reco::CaloMET::emEtInEB(), reco::CaloMET::emEtInEE(), reco::CaloMET::emEtInHF(), reco::CaloMET::etFractionHadronic(), HcalObjRepresent::Fill(), cropTnPTrees::frac, genMetCalo_cfi::genMetCalo, genMetTrue_cff::genMetTrue, edm::Event::getByToken(), reco::CaloMET::hadEtInHB(), reco::CaloMET::hadEtInHE(), reco::CaloMET::hadEtInHF(), reco::CaloMET::hadEtInHO(), reco::PFMET::HFEMEt(), reco::PFMET::HFEMEtFraction(), reco::PFMET::HFHadronEt(), reco::PFMET::HFHadronEtFraction(), reco::GenMET::InvisibleEtFraction(), edm::Ref< C, T, F >::isNonnull(), edm::HandleBase::isValid(), edm::Ref< C, T, F >::key(), reco::CaloMET::maxEtInEmTowers(), reco::CaloMET::maxEtInHadTowers(), CaloMET_cfi::met, reco::MET::mEtSig(), reco::PFMET::muonEt(), reco::PFMET::muonEtFraction(), reco::GenMET::MuonEtFraction(), reco::GenMET::NeutralEMEtFraction(), reco::GenMET::NeutralHadEtFraction(), reco::PFMET::neutralHadronEt(), reco::PFMET::neutralHadronEtFraction(), or, reco::LeafCandidate::phi(), reco::PFMET::photonEt(), reco::PFMET::photonEtFraction(), edm::Handle< T >::product(), reco::LeafCandidate::pt(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::MET::sumEt(), TCMET_cfi::tcMet, and reco::MuonMETCorrectionData::type().

323 { //int counter(0);
325  iEvent.getByToken(pvToken_, pvHandle);
326  if (! pvHandle.isValid())
327  {
328  std::cout << __FUNCTION__ << ":" << __LINE__ << ":pvHandle handle not found!" << std::endl;
329  assert(false);
330  }
331  const int nvtx = pvHandle->size();
332  mNvertex->Fill(nvtx);
333  //Collections for all MET collections
334 
337 // edm::Handle<CaloMETCollection> corMETs;
340 
341  if (isCaloMET or isTcMET) iEvent.getByToken(caloMETsToken_, caloMETs);
342  if (isTcMET) iEvent.getByToken(tcMETsToken_, tcMETs);
343  if (isPFMET) iEvent.getByToken(pfMETsToken_, pfMETs);
344  if (isGenMET) iEvent.getByToken(genMETsToken_, genMETs);
345  if ((isCaloMET or isTcMET) and !caloMETs.isValid()) return;
346  if ((isTcMET) and !tcMETs.isValid()) return;
347 // if ((isCorMET) and !caloMETs.isValid()) return;
348  if ((isPFMET) and !pfMETs.isValid()) return;
349  if ((isGenMET) and !genMETs.isValid()) return;
350 
351  reco::MET met;
352  if (isCaloMET) { met = caloMETs->front();}
353  if (isTcMET) { met = tcMETs->front() ;}
354 // if (isCorMET) { met = caloMETs->front();}
355  if (isPFMET) { met = pfMETs->front() ;}
356  if (isGenMET) { met = genMETs->front() ;}
357 
358  const double SumET = met.sumEt();
359  const double METSig = met.mEtSig();
360  const double MET = met.pt();
361  const double MEx = met.px();
362  const double MEy = met.py();
363  const double METPhi = met.phi();
364  mMEx->Fill(MEx);
365  mMEy->Fill(MEy);
366  mMET->Fill(MET);
367  mMETFine->Fill(MET);
368  mMET_Nvtx->Fill((double)nvtx, MET);
369  mMETPhi->Fill(METPhi);
370  mSumET->Fill(SumET);
371  mMETSig->Fill(METSig);
372 // cout<<"isCaloMET "<<boolalpha<<isCaloMET<<" isGenMET "<<isPFMET<<" isTcMET "<<isTcMET<<" isPFMET "<<isPFMET<<" met:"<<MET<<endl;
373  // Get Generated MET for Resolution plots
375  iEvent.getByToken(genMETsTrueToken_, genTrue);
376  if (genTrue.isValid()) {
377  const GenMETCollection *genmetcol = genTrue.product();
378  const GenMET *genMetTrue = &(genmetcol->front());
379  double genMET = genMetTrue->pt();
380  double genMETPhi = genMetTrue->phi();
381 
382  mMETDifference_GenMETTrue->Fill( MET - genMET );
383  mMETDeltaPhi_GenMETTrue->Fill( TMath::ACos( TMath::Cos( METPhi - genMETPhi ) ) );
384 
385  //pfMET resolution in pfMET bins : Sam, Feb, 2012
386  if (MET > 0 && MET < 20) mMETDifference_GenMETTrue_MET0to20->Fill( MET - genMET );
387  else if (MET > 20 && MET < 40) mMETDifference_GenMETTrue_MET20to40->Fill( MET - genMET );
388  else if (MET > 40 && MET < 60) mMETDifference_GenMETTrue_MET40to60->Fill( MET - genMET );
389  else if (MET > 60 && MET < 80) mMETDifference_GenMETTrue_MET60to80->Fill( MET - genMET );
390  else if (MET > 80 && MET <100) mMETDifference_GenMETTrue_MET80to100->Fill( MET - genMET );
391  else if (MET >100 && MET <150) mMETDifference_GenMETTrue_MET100to150->Fill( MET - genMET );
392  else if (MET >150 && MET <200) mMETDifference_GenMETTrue_MET150to200->Fill( MET - genMET );
393  else if (MET >200 && MET <300) mMETDifference_GenMETTrue_MET200to300->Fill( MET - genMET );
394  else if (MET >300 && MET <400) mMETDifference_GenMETTrue_MET300to400->Fill( MET - genMET );
395  else if (MET >400 && MET <500) mMETDifference_GenMETTrue_MET400to500->Fill( MET - genMET );
396 
397  } else {
398  edm::LogInfo("OutputInfo") << " failed to retrieve data required by MET Task: genMetTrue";
399  }
401  iEvent.getByToken(genMETsCaloToken_, genCalo);
402  if (genCalo.isValid()) {
403  const GenMETCollection *genmetcol = genCalo.product();
404  const GenMET *genMetCalo = &(genmetcol->front());
405  const double genMET = genMetCalo->pt();
406  const double genMETPhi = genMetCalo->phi();
407 
408  mMETDifference_GenMETCalo->Fill( MET - genMET );
409  mMETDeltaPhi_GenMETCalo->Fill( TMath::ACos( TMath::Cos( METPhi - genMETPhi ) ) );
410  } else {
411  edm::LogInfo("OutputInfo") << " failed to retrieve data required by MET Task: genMetCalo";
412  }
413 
414  if ( isCaloMET) {
415  const reco::CaloMET * calomet = &(caloMETs->front());
416  // ==========================================================
417  // Reconstructed MET Information
418  const double caloMaxEtInEMTowers = calomet->maxEtInEmTowers();
419  const double caloMaxEtInHadTowers = calomet->maxEtInHadTowers();
420  const double caloEtFractionHadronic = calomet->etFractionHadronic();
421  const double caloEmEtFraction = calomet->emEtFraction();
422  const double caloHadEtInHB = calomet->hadEtInHB();
423  const double caloHadEtInHO = calomet->hadEtInHO();
424  const double caloHadEtInHE = calomet->hadEtInHE();
425  const double caloHadEtInHF = calomet->hadEtInHF();
426  const double caloEmEtInEB = calomet->emEtInEB();
427  const double caloEmEtInEE = calomet->emEtInEE();
428  const double caloEmEtInHF = calomet->emEtInHF();
429  const double caloSETInpHF = calomet->CaloSETInpHF();
430  const double caloSETInmHF = calomet->CaloSETInmHF();
431 
432  mCaloMaxEtInEmTowers->Fill(caloMaxEtInEMTowers);
433  mCaloMaxEtInHadTowers->Fill(caloMaxEtInHadTowers);
434  mCaloEtFractionHadronic->Fill(caloEtFractionHadronic);
435  mCaloEmEtFraction->Fill(caloEmEtFraction);
436  mCaloHadEtInHB->Fill(caloHadEtInHB);
437  mCaloHadEtInHO->Fill(caloHadEtInHO);
438  mCaloHadEtInHE->Fill(caloHadEtInHE);
439  mCaloHadEtInHF->Fill(caloHadEtInHF);
440  mCaloEmEtInEB->Fill(caloEmEtInEB);
441  mCaloEmEtInEE->Fill(caloEmEtInEE);
442  mCaloEmEtInHF->Fill(caloEmEtInHF);
443  mCaloSETInpHF->Fill(caloSETInpHF);
444  mCaloSETInmHF->Fill(caloSETInmHF);
445  }
446  if (isGenMET)
447  {
448  const GenMET *genmet;
449  // Get Generated MET
450  genmet = &(genMETs->front());
451 
452  const double NeutralEMEtFraction = genmet->NeutralEMEtFraction() ;
453  const double NeutralHadEtFraction = genmet->NeutralHadEtFraction() ;
454  const double ChargedEMEtFraction = genmet->ChargedEMEtFraction () ;
455  const double ChargedHadEtFraction = genmet->ChargedHadEtFraction();
456  const double MuonEtFraction = genmet->MuonEtFraction() ;
457  const double InvisibleEtFraction = genmet->InvisibleEtFraction() ;
458 
459  mNeutralEMEtFraction->Fill( NeutralEMEtFraction );
460  mNeutralHadEtFraction->Fill( NeutralHadEtFraction );
461  mChargedEMEtFraction->Fill( ChargedEMEtFraction );
462  mChargedHadEtFraction->Fill( ChargedHadEtFraction );
463  mMuonEtFraction->Fill( MuonEtFraction );
464  mInvisibleEtFraction->Fill( InvisibleEtFraction );
465  }
466  if(isPFMET)
467  {
468  const reco::PFMET * pfmet = &(pfMETs->front());
470  mPFphotonEt->Fill(pfmet->photonEt());
474  mPFelectronEt->Fill(pfmet->electronEt());
478  mPFmuonEt->Fill(pfmet->muonEt());
480  mPFHFHadronEt->Fill(pfmet->HFHadronEt());
482  mPFHFEMEt->Fill(pfmet->HFEMEt());
483  // Reconstructed MET Information
484 
485  }
486  if(isTcMET)
487  {
488 
489  const CaloMET *caloMet;
490  edm::Handle<CaloMETCollection> hcaloMetcol;
491  iEvent.getByToken(caloMETsToken_, hcaloMetcol);
492 
494  iEvent.getByToken(muonToken_, muon_h);
495 
496  // edm::Handle< edm::View<reco::Track> > track_h;
498  iEvent.getByToken(trackToken_, track_h);
499 
501  iEvent.getByToken(electronToken_, electron_h);
502 
504  iEvent.getByToken(beamSpotToken_, beamSpot_h);
505 
506  const reco::MET * tcMet = &(tcMETs->front());
507 
508  if(!hcaloMetcol.isValid()){
509  edm::LogInfo("OutputInfo") << "falied to retrieve data require by MET Task";
510  edm::LogInfo("OutputInfo") << "MET Taks cannot continue...!";
511  return;
512  }
513  else
514  {
515  const CaloMETCollection *caloMetcol = hcaloMetcol.product();
516  caloMet = &(caloMetcol->front());
517  }
518 
519  if(!muon_h.isValid()){
520  edm::LogInfo("OutputInfo") << "falied to retrieve muon data require by MET Task";
521  edm::LogInfo("OutputInfo") << "MET Taks cannot continue...!";
522  return;
523  }
524 
525  if(!electron_h.isValid()){
526  edm::LogInfo("OutputInfo") << "falied to retrieve electron data require by MET Task";
527  edm::LogInfo("OutputInfo") << "MET Taks cannot continue...!";
528  return;
529  }
530 
531  if(!beamSpot_h.isValid()){
532  edm::LogInfo("OutputInfo") << "falied to retrieve beam spot data require by MET Task";
533  edm::LogInfo("OutputInfo") << "MET Taks cannot continue...!";
534  return;
535  }
536 
537  math::XYZPoint bspot = ( beamSpot_h.isValid() ) ? beamSpot_h->position() : math::XYZPoint(0, 0, 0);
538 
539  //Event selection-----------------------------------------------------------------------
540 
542  iEvent.getByToken(tcMet_ValueMap_Token_, tcMet_ValueMap_Handle);
543 
544  //count muons
545  int nM = 0;
546 
547  for( unsigned int mus = 0; mus < muon_h->size() ; mus++ ) {
548 
549  reco::MuonRef muref( muon_h, mus);
550  if( muref->pt() < 20 ) continue;
551 
552  reco::MuonMETCorrectionData muCorrData = (*tcMet_ValueMap_Handle)[muref];
553  int type = muCorrData.type();
554 
555  if( type == 1 || type == 2 || type == 5 ) ++nM;
556  }
557 
558  //count electrons
559  int nE = 0;
560 
561  for( edm::View<reco::GsfElectron>::const_iterator eleit = electron_h->begin(); eleit != electron_h->end(); eleit++ ) {
562  if( eleit->p4().pt() < 20 ) continue;
563  ++nE;
564  }
565 
566  if( strcmp( sample_.c_str() , "zmm" ) == 0 && nM != 2 ) return;
567 
568  if( strcmp( sample_.c_str() , "zee" ) == 0 && nE != 2 ) return;
569 
570  if( strcmp( sample_.c_str() , "ttbar" ) == 0 && ( nE + nM ) == 0 ) return;
571 
572  const double caloMET = caloMet->pt();
573  const double caloMEx = caloMet->px();
574  const double caloMEy = caloMet->py();
575 
576  mdMETx->Fill(caloMEx-tcMet->px());
577  mdMETy->Fill(caloMEy-tcMet->py());
578  mdMET->Fill(caloMET-tcMet->pt());
579 
580  const unsigned int nTracks = track_h->size();
581  unsigned int nCorrTracks = 0;
582  unsigned int trackCount = 0;
583  for( reco::TrackCollection::const_iterator trkit = track_h->begin(); trkit != track_h->end(); trkit++ ) {
584  mtrkPt->Fill( trkit->pt() );
585  mtrkEta->Fill( trkit->eta() );
586  mtrkNhits->Fill( trkit->numberOfValidHits() );
587  mtrkChi2->Fill( trkit->chi2() / trkit->ndof() );
588 
589  double d0 = -1 * trkit->dxy( bspot );
590 
591  mtrkD0->Fill( d0 );
592 
593  mtrkQuality->Fill( trkit->qualityMask() );
594  mtrkAlgo->Fill( trkit->algo() );
595  mtrkPtErr->Fill( trkit->ptError() / trkit->pt() );
596 
597  reco::TrackRef trkref( track_h, trackCount );
598 
599  if( isGoodTrack( trkref, d0) ) ++nCorrTracks;
600  ++trackCount;
601  }
602 
603  const float frac = (float)nCorrTracks / (float)nTracks;
604  mfracTrks->Fill(frac);
605 
606  int nEls = 0;
607 
608  for( edm::View<reco::GsfElectron>::const_iterator eleit = electron_h->begin(); eleit != electron_h->end(); eleit++ ) {
609  melePt->Fill( eleit->p4().pt() );
610  meleEta->Fill( eleit->p4().eta() );
611  meleHoE->Fill( eleit->hadronicOverEm() );
612 
613  reco::TrackRef el_track = eleit->closestCtfTrackRef();
614 
615  unsigned int ele_idx = el_track.isNonnull() ? el_track.key() : 99999;
616 
617  if( eleit->hadronicOverEm() < 0.1 && ele_idx < nTracks )
618  ++nEls;
619  }
620 
621  mnEls->Fill(nEls);
622 
623  for( reco::MuonCollection::const_iterator muonit = muon_h->begin(); muonit != muon_h->end(); muonit++ ) {
624 
625  const reco::TrackRef siTrack = muonit->innerTrack();
626 
627  mmuPt->Fill( muonit->p4().pt() );
628  mmuEta->Fill( muonit->p4().eta() );
629  mmuNhits->Fill( siTrack.isNonnull() ? siTrack->numberOfValidHits() : -999 );
630  mmuChi2->Fill( siTrack.isNonnull() ? siTrack->chi2()/siTrack->ndof() : -999 );
631 
632  double d0 = siTrack.isNonnull() ? -1 * siTrack->dxy( bspot) : -999;
633 
634  mmuD0->Fill( d0 );
635  }
636 
637  //edm::Handle< edm::ValueMap<reco::MuonMETCorrectionData> > tcMet_ValueMap_Handle;
638  //iEvent.getByToken("muonTCMETValueMapProducer" , "muCorrData", tcMet_ValueMap_Handle);
639 
641  iEvent.getByToken(met_ValueMap_Token_, muon_ValueMap_Handle);
642 
643  const unsigned int nMuons = muon_h->size();
644 
645  int nMus = 0;
646  int nMusPis = 0;
647  double muDx = 0;
648  double muDy = 0;
649  for( unsigned int mus = 0; mus < nMuons; mus++ )
650  {
651  reco::MuonRef muref( muon_h, mus);
652  reco::MuonMETCorrectionData muCorrData = (*tcMet_ValueMap_Handle)[muref];
653  reco::MuonMETCorrectionData muonCorrData = (*muon_ValueMap_Handle)[muref];
654 
655  mMExCorrection -> Fill(muCorrData.corrX());
656  mMEyCorrection -> Fill(muCorrData.corrY());
657 
658  int type = muCorrData.type();
659  mMuonCorrectionFlag-> Fill(type);
660 
661  if( type == 1 || type == 2 || type == 5 ) {
662  ++nMus;
663 
664  if( type == 1 ) {
665  muDx += muonCorrData.corrX() - muref->globalTrack()->px();
666  muDy += muonCorrData.corrY() - muref->globalTrack()->py();
667  }
668  else if( type == 2 ) {
669  muDx += muonCorrData.corrX() - muref->innerTrack()->px();
670  muDy += muonCorrData.corrY() - muref->innerTrack()->py();
671  }
672  else if( type == 5 ) {
673  muDx += muonCorrData.corrX() - muref->px();
674  muDy += muonCorrData.corrY() - muref->py();
675  }
676  }
677  else if( type == 4 )
678  ++nMusPis;
679  }
680 
681  mnMus->Fill(nMus);
682  mnMusPis->Fill(nMusPis);
683  mdMUx->Fill(muDx);
684  mdMUy->Fill(muDy);
685  }
686 
687 // if(isCorMET )
688 // {
701 //
702 // edm::Handle< edm::ValueMap<reco::MuonMETCorrectionData> > corMetGlobalMuons_ValueMap_Handle;
703 // iEvent.getByToken("muonMETValueMapProducer" , "muCorrData", corMetGlobalMuons_ValueMap_Handle);
704 //
705 // edm::Handle< reco::MuonCollection > muon_Handle;
706 // iEvent.getByToken("muons", muon_Handle);
707 //
708 // edm::Handle< reco::BeamSpot > beamSpot_h;
709 // iEvent.getByToken(inputBeamSpotLabel_, beamSpot_h);
710 //
711 // if(!beamSpot_h.isValid()){
712 // edm::LogInfo("OutputInfo") << "beamSpot is NOT Valid";
713 // edm::LogInfo("OutputInfo") << "MET Taks continues anyway...!";
714 // }
715 //
716 // math::XYZPoint bspot = ( beamSpot_h.isValid() ) ? beamSpot_h->position() : math::XYZPoint(0, 0, 0);
717 //
718 // for( reco::MuonCollection::const_iterator muonit = muon_Handle->begin(); muonit != muon_Handle->end(); muonit++ ) {
719 //
720 // const reco::TrackRef siTrack = muonit->innerTrack();
721 // const reco::TrackRef globalTrack = muonit->globalTrack();
722 //
723 // mmuPt->Fill( muonit->p4().pt() );
724 // mmuEta->Fill( muonit->p4().eta() );
725 // mmuNhits->Fill( siTrack.isNonnull() ? siTrack->numberOfValidHits() : -999 );
726 // mmuChi2->Fill( siTrack.isNonnull() ? siTrack->chi2()/siTrack->ndof() : -999 );
727 //
728 // double d0 = siTrack.isNonnull() ? -1 * siTrack->dxy( bspot) : -999;
729 //
730 // mmuD0->Fill( d0 );
731 //
732 // int nHits = globalTrack.isNonnull() ? globalTrack->hitPattern().numberOfValidMuonHits() : -999;
733 // mmuSAhits->Fill( nHits );
734 // }
735 //
736 // const unsigned int nMuons = muon_Handle->size();
737 // for( unsigned int mus = 0; mus < nMuons; mus++ )
738 // {
739 // reco::MuonRef muref( muon_Handle, mus);
740 // reco::MuonMETCorrectionData muCorrData = (*corMetGlobalMuons_ValueMap_Handle)[muref];
741 //
742 // mMExCorrection -> Fill(muCorrData.corrY());
743 // mMEyCorrection -> Fill(muCorrData.corrX());
744 // mMuonCorrectionFlag-> Fill(muCorrData.type());
745 // }
746 // }
747 
748  //This is so dirty I could cry. It should be called only ONCE in endJob. But the MonitorElements don't exist then any more.
749  FillMETRes();
750 }
type
Definition: HCALResponse.h:21
MonitorElement * mChargedEMEtFraction
Definition: METTester.h:146
double hadEtInHE() const
Definition: CaloMET.h:51
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
Collection of Gen MET.
MonitorElement * mMExCorrection
Definition: METTester.h:183
MonitorElement * mMuonEtFraction
Definition: METTester.h:148
tuple met
____________________________________________________________________________||
Definition: CaloMET_cfi.py:7
double HFEMEtFraction() const
Definition: PFMET.h:47
double hadEtInHF() const
Definition: CaloMET.h:53
MonitorElement * mMETPhi
Definition: METTester.h:119
MonitorElement * mMET
Definition: METTester.h:116
MonitorElement * mMETDifference_GenMETTrue
Definition: METTester.h:121
double CaloSETInmHF() const
Definition: CaloMET.h:65
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
MonitorElement * mtrkPtErr
Definition: METTester.h:193
MonitorElement * mMETDifference_GenMETTrue_MET400to500
Definition: METTester.h:178
MonitorElement * mdMETx
Definition: METTester.h:210
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
void FillMETRes()
Definition: METTester.cc:762
MonitorElement * mPFelectronEtFraction
Definition: METTester.h:158
double maxEtInHadTowers() const
Definition: CaloMET.h:40
MonitorElement * mMETSig
Definition: METTester.h:115
MonitorElement * mmuD0
Definition: METTester.h:202
MonitorElement * mtrkNhits
Definition: METTester.h:188
double neutralHadronEtFraction() const
Definition: PFMET.h:32
MonitorElement * mCaloMaxEtInEmTowers
Definition: METTester.h:127
MonitorElement * mMEy
Definition: METTester.h:114
MonitorElement * mCaloSETInpHF
Definition: METTester.h:138
MonitorElement * mCaloHadEtInHF
Definition: METTester.h:134
edm::EDGetTokenT< edm::View< reco::GsfElectron > > electronToken_
Definition: METTester.h:93
double muonEt() const
Definition: PFMET.h:42
MonitorElement * mdMUx
Definition: METTester.h:213
tuple genMetCalo
____________________________________________________________________________||
double MuonEtFraction() const
Definition: GenMET.h:57
MonitorElement * mPFphotonEtFraction
Definition: METTester.h:154
MonitorElement * mnEls
Definition: METTester.h:207
MonitorElement * mPFHFEMEt
Definition: METTester.h:167
double maxEtInEmTowers() const
Definition: CaloMET.h:38
MonitorElement * mMETDifference_GenMETTrue_MET40to60
Definition: METTester.h:171
bool isPFMET
Definition: METTester.h:219
MonitorElement * mmuEta
Definition: METTester.h:199
MonitorElement * mCaloEmEtFraction
Definition: METTester.h:130
MonitorElement * mCaloEmEtInEE
Definition: METTester.h:140
MonitorElement * mCaloSETInmHF
Definition: METTester.h:139
MonitorElement * mNeutralEMEtFraction
Definition: METTester.h:144
virtual double py() const GCC11_FINAL
y coordinate of momentum vector
MonitorElement * mMETDifference_GenMETTrue_MET20to40
Definition: METTester.h:170
MonitorElement * mMETDifference_GenMETTrue_MET60to80
Definition: METTester.h:172
MonitorElement * mCaloMaxEtInHadTowers
Definition: METTester.h:128
MonitorElement * mfracTrks
Definition: METTester.h:208
std::string sample_
Definition: METTester.h:72
MonitorElement * mInvisibleEtFraction
Definition: METTester.h:149
MonitorElement * mCaloEtFractionHadronic
Definition: METTester.h:129
MonitorElement * mtrkChi2
Definition: METTester.h:189
void Fill(long long x)
bool isTcMET
Definition: METTester.h:218
MonitorElement * mPFmuonEt
Definition: METTester.h:163
Collection of Calo MET.
MonitorElement * mPFelectronEt
Definition: METTester.h:159
bool isNonnull() const
Checks for non-null.
Definition: Ref.h:250
MonitorElement * mnMusPis
Definition: METTester.h:204
MonitorElement * mtrkEta
Definition: METTester.h:187
MonitorElement * mPFphotonEt
Definition: METTester.h:155
MonitorElement * mCaloEmEtInEB
Definition: METTester.h:141
MonitorElement * mCaloHadEtInHE
Definition: METTester.h:133
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
double mEtSig() const
Definition: MET.h:50
double HFHadronEtFraction() const
Definition: PFMET.h:44
double sumEt() const
Definition: MET.h:48
edm::EDGetTokenT< reco::PFMETCollection > pfMETsToken_
Definition: METTester.h:85
edm::EDGetTokenT< reco::CaloMETCollection > caloMETsToken_
Definition: METTester.h:84
MonitorElement * mPFneutralHadronEtFraction
Definition: METTester.h:156
double muonEtFraction() const
Definition: PFMET.h:41
MonitorElement * mtrkQuality
Definition: METTester.h:191
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: METTester.h:94
MonitorElement * mdMETy
Definition: METTester.h:211
edm::EDGetTokenT< reco::TrackCollection > trackToken_
Definition: METTester.h:92
double HFHadronEt() const
Definition: PFMET.h:45
MonitorElement * mPFHFHadronEt
Definition: METTester.h:165
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
Definition: MET.h:32
bool isGenMET
Definition: METTester.h:220
double photonEtFraction() const
Definition: PFMET.h:29
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
Definition: METTester.h:83
double ChargedEMEtFraction() const
Definition: GenMET.h:39
edm::EDGetTokenT< reco::GenMETCollection > genMETsToken_
Definition: METTester.h:87
virtual double px() const GCC11_FINAL
x coordinate of momentum vector
double emEtInEB() const
Definition: CaloMET.h:55
MonitorElement * mMETDifference_GenMETTrue_MET150to200
Definition: METTester.h:175
MonitorElement * mtrkPt
Definition: METTester.h:186
bool isCaloMET
Definition: METTester.h:216
MonitorElement * mMETDeltaPhi_GenMETCalo
Definition: METTester.h:124
MonitorElement * mnMus
Definition: METTester.h:203
MonitorElement * mMETDifference_GenMETTrue_MET100to150
Definition: METTester.h:174
MonitorElement * mCaloHadEtInHB
Definition: METTester.h:131
bool isValid() const
Definition: HandleBase.h:76
double CaloSETInpHF() const
Definition: CaloMET.h:63
double InvisibleEtFraction() const
Definition: GenMET.h:63
double HFEMEt() const
Definition: PFMET.h:48
MonitorElement * mMETDifference_GenMETTrue_MET300to400
Definition: METTester.h:177
MonitorElement * mMETDifference_GenMETCalo
Definition: METTester.h:123
double hadEtInHO() const
Definition: CaloMET.h:49
MonitorElement * mCaloHadEtInHO
Definition: METTester.h:132
double electronEt() const
Definition: PFMET.h:36
MonitorElement * mmuPt
Definition: METTester.h:198
edm::EDGetTokenT< reco::METCollection > tcMETsToken_
Definition: METTester.h:86
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Definition: METTester.h:91
MonitorElement * mPFchargedHadronEt
Definition: METTester.h:161
MonitorElement * mMEx
Definition: METTester.h:113
double etFractionHadronic() const
Definition: CaloMET.h:42
MonitorElement * melePt
Definition: METTester.h:194
MonitorElement * mChargedHadEtFraction
Definition: METTester.h:147
double photonEt() const
Definition: PFMET.h:30
MonitorElement * mMETDeltaPhi_GenMETTrue
Definition: METTester.h:122
MonitorElement * mPFneutralHadronEt
Definition: METTester.h:157
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
tuple tcMet
____________________________________________________________________________||
Definition: TCMET_cfi.py:4
key_type key() const
Accessor for product key.
Definition: Ref.h:266
MonitorElement * mmuNhits
Definition: METTester.h:200
edm::EDGetTokenT< reco::GenMETCollection > genMETsCaloToken_
Definition: METTester.h:89
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > tcMet_ValueMap_Token_
Definition: METTester.h:95
edm::EDGetTokenT< reco::GenMETCollection > genMETsTrueToken_
Definition: METTester.h:88
MonitorElement * mPFmuonEtFraction
Definition: METTester.h:162
T const * product() const
Definition: Handle.h:81
double NeutralEMEtFraction() const
Definition: GenMET.h:33
double emEtInEE() const
Definition: CaloMET.h:57
double electronEtFraction() const
Definition: PFMET.h:35
MonitorElement * mMETFine
Definition: METTester.h:117
MonitorElement * mmuChi2
Definition: METTester.h:201
double chargedHadronEtFraction() const
Definition: PFMET.h:38
MonitorElement * mNeutralHadEtFraction
Definition: METTester.h:145
MonitorElement * mPFHFEMEtFraction
Definition: METTester.h:166
MonitorElement * mtrkD0
Definition: METTester.h:190
MonitorElement * mMuonCorrectionFlag
Definition: METTester.h:185
double NeutralHadEtFraction() const
Definition: GenMET.h:45
edm::EDGetTokenT< edm::ValueMap< reco::MuonMETCorrectionData > > met_ValueMap_Token_
Definition: METTester.h:96
MonitorElement * mtrkAlgo
Definition: METTester.h:192
MonitorElement * mNvertex
Definition: METTester.h:110
bool isGoodTrack(const reco::TrackRef, float d0corr)
Definition: METTester.cc:788
MonitorElement * mMET_Nvtx
Definition: METTester.h:118
MonitorElement * mPFchargedHadronEtFraction
Definition: METTester.h:160
MonitorElement * mdMET
Definition: METTester.h:209
double emEtInHF() const
Definition: CaloMET.h:59
MonitorElement * mMEyCorrection
Definition: METTester.h:184
tuple cout
Definition: gather_cfg.py:121
MonitorElement * mMETDifference_GenMETTrue_MET0to20
Definition: METTester.h:169
double neutralHadronEt() const
Definition: PFMET.h:33
MonitorElement * mSumET
Definition: METTester.h:120
double ChargedHadEtFraction() const
Definition: GenMET.h:51
MonitorElement * meleHoE
Definition: METTester.h:196
MonitorElement * mdMUy
Definition: METTester.h:214
virtual float pt() const GCC11_FINAL
transverse momentum
MonitorElement * mMETDifference_GenMETTrue_MET200to300
Definition: METTester.h:176
MonitorElement * meleEta
Definition: METTester.h:195
MonitorElement * mMETDifference_GenMETTrue_MET80to100
Definition: METTester.h:173
double hadEtInHB() const
Definition: CaloMET.h:47
double emEtFraction() const
Definition: CaloMET.h:45
double chargedHadronEt() const
Definition: PFMET.h:39
MonitorElement * mCaloEmEtInHF
Definition: METTester.h:137
MonitorElement * mPFHFHadronEtFraction
Definition: METTester.h:164
void METTester::beginRun ( const edm::Run iRun,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 317 of file METTester.cc.

318 {
319 
320 }
void METTester::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 752 of file METTester.cc.

References cuy::save.

753 {
754  if (!mOutputFile.empty() && &*edm::Service<DQMStore>())
755  {
757  }
758 
759 }
std::string mOutputFile
Definition: METTester.h:71
list save
Definition: cuy.py:1163
void METTester::FillMETRes ( )

Definition at line 762 of file METTester.cc.

763 {
784 
785 }
MonitorElement * mMETDifference_GenMETTrue_METResolution
Definition: METTester.h:179
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * mMETDifference_GenMETTrue_MET400to500
Definition: METTester.h:178
MonitorElement * mMETDifference_GenMETTrue_MET40to60
Definition: METTester.h:171
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * mMETDifference_GenMETTrue_MET20to40
Definition: METTester.h:170
MonitorElement * mMETDifference_GenMETTrue_MET60to80
Definition: METTester.h:172
MonitorElement * mMETDifference_GenMETTrue_MET150to200
Definition: METTester.h:175
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
MonitorElement * mMETDifference_GenMETTrue_MET100to150
Definition: METTester.h:174
MonitorElement * mMETDifference_GenMETTrue_MET300to400
Definition: METTester.h:177
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * mMETDifference_GenMETTrue_MET0to20
Definition: METTester.h:169
MonitorElement * mMETDifference_GenMETTrue_MET200to300
Definition: METTester.h:176
MonitorElement * mMETDifference_GenMETTrue_MET80to100
Definition: METTester.h:173
bool METTester::isGoodTrack ( const reco::TrackRef  track,
float  d0corr 
)
private

Definition at line 788 of file METTester.cc.

References GOODCOLL_filter_cfg::cut, and i.

788  {
789 
790  if( fabs( d0corr ) > maxd0_ ) return false;
791  if( track->numberOfValidHits() < minhits_ ) return false;
792  if( track->normalizedChi2() > maxchi2_ ) return false;
793  if( fabs( track->eta() ) > maxeta_ ) return false;
794  if( track->pt() > maxpt_ ) return false;
795  if( (track->ptError() / track->pt()) > maxPtErr_ ) return false;
796 
797  int cut = 0;
798  for( unsigned int i = 0; i < trkQuality_.size(); i++ ) {
799 
800  cut |= (1 << trkQuality_.at(i));
801  }
802 
803  if( !( ( track->qualityMask() & cut ) == cut ) ) return false;
804 
805  bool isGoodAlgo = false;
806  if( trkAlgos_.size() == 0 ) isGoodAlgo = true;
807  for( unsigned int i = 0; i < trkAlgos_.size(); i++ ) {
808 
809  if( track->algo() == trkAlgos_.at(i) ) isGoodAlgo = true;
810  }
811 
812  if( !isGoodAlgo ) return false;
813 
814  return true;
815  }
int i
Definition: DBlmapReader.cc:9
double maxchi2_
Definition: METTester.h:102
std::vector< int > trkQuality_
Definition: METTester.h:106
std::vector< int > trkAlgos_
Definition: METTester.h:107
double maxPtErr_
Definition: METTester.h:105
double maxpt_
Definition: METTester.h:104
int minhits_
Definition: METTester.h:100
double maxeta_
Definition: METTester.h:103
double maxd0_
Definition: METTester.h:101

Member Data Documentation

edm::EDGetTokenT<reco::BeamSpot> METTester::beamSpotToken_
private

Definition at line 94 of file METTester.h.

edm::EDGetTokenT<reco::CaloMETCollection> METTester::caloMETsToken_
private

Definition at line 84 of file METTester.h.

edm::EDGetTokenT<edm::View<reco::GsfElectron > > METTester::electronToken_
private

Definition at line 93 of file METTester.h.

edm::EDGetTokenT<reco::GenMETCollection> METTester::genMETsCaloToken_
private

Definition at line 89 of file METTester.h.

edm::EDGetTokenT<reco::GenMETCollection> METTester::genMETsToken_
private

Definition at line 87 of file METTester.h.

edm::EDGetTokenT<reco::GenMETCollection> METTester::genMETsTrueToken_
private

Definition at line 88 of file METTester.h.

edm::InputTag METTester::inputBeamSpotLabel_
private

Definition at line 80 of file METTester.h.

edm::InputTag METTester::inputCaloMETLabel_
private

Definition at line 76 of file METTester.h.

edm::InputTag METTester::inputElectronLabel_
private

Definition at line 79 of file METTester.h.

edm::InputTag METTester::inputMETLabel_
private

Definition at line 73 of file METTester.h.

edm::InputTag METTester::inputMuonLabel_
private

Definition at line 78 of file METTester.h.

edm::InputTag METTester::inputTrackLabel_
private

Definition at line 77 of file METTester.h.

bool METTester::isCaloMET
private

Definition at line 216 of file METTester.h.

bool METTester::isGenMET
private

Definition at line 220 of file METTester.h.

bool METTester::isPFMET
private

Definition at line 219 of file METTester.h.

bool METTester::isTcMET
private

Definition at line 218 of file METTester.h.

double METTester::maxchi2_
private

Definition at line 102 of file METTester.h.

double METTester::maxd0_
private

Definition at line 101 of file METTester.h.

double METTester::maxeta_
private

Definition at line 103 of file METTester.h.

double METTester::maxpt_
private

Definition at line 104 of file METTester.h.

double METTester::maxPtErr_
private

Definition at line 105 of file METTester.h.

MonitorElement* METTester::mCaloEmEtFraction
private

Definition at line 130 of file METTester.h.

MonitorElement* METTester::mCaloEmEtInEB
private

Definition at line 141 of file METTester.h.

MonitorElement* METTester::mCaloEmEtInEE
private

Definition at line 140 of file METTester.h.

MonitorElement* METTester::mCaloEmEtInHF
private

Definition at line 137 of file METTester.h.

MonitorElement* METTester::mCaloEtFractionHadronic
private

Definition at line 129 of file METTester.h.

MonitorElement* METTester::mCaloHadEtInEB
private

Definition at line 135 of file METTester.h.

MonitorElement* METTester::mCaloHadEtInEE
private

Definition at line 136 of file METTester.h.

MonitorElement* METTester::mCaloHadEtInHB
private

Definition at line 131 of file METTester.h.

MonitorElement* METTester::mCaloHadEtInHE
private

Definition at line 133 of file METTester.h.

MonitorElement* METTester::mCaloHadEtInHF
private

Definition at line 134 of file METTester.h.

MonitorElement* METTester::mCaloHadEtInHO
private

Definition at line 132 of file METTester.h.

MonitorElement* METTester::mCaloMaxEtInEmTowers
private

Definition at line 127 of file METTester.h.

MonitorElement* METTester::mCaloMaxEtInHadTowers
private

Definition at line 128 of file METTester.h.

MonitorElement* METTester::mCaloSETInmHF
private

Definition at line 139 of file METTester.h.

MonitorElement* METTester::mCaloSETInpHF
private

Definition at line 138 of file METTester.h.

MonitorElement* METTester::mChargedEMEtFraction
private

Definition at line 146 of file METTester.h.

MonitorElement* METTester::mChargedHadEtFraction
private

Definition at line 147 of file METTester.h.

MonitorElement* METTester::mdMET
private

Definition at line 209 of file METTester.h.

MonitorElement* METTester::mdMETx
private

Definition at line 210 of file METTester.h.

MonitorElement* METTester::mdMETy
private

Definition at line 211 of file METTester.h.

MonitorElement* METTester::mdMEy
private

Definition at line 212 of file METTester.h.

MonitorElement* METTester::mdMUx
private

Definition at line 213 of file METTester.h.

MonitorElement* METTester::mdMUy
private

Definition at line 214 of file METTester.h.

std::map<std::string, MonitorElement*> METTester::me
private

Definition at line 66 of file METTester.h.

MonitorElement* METTester::meleEta
private

Definition at line 195 of file METTester.h.

MonitorElement* METTester::meleHoE
private

Definition at line 196 of file METTester.h.

MonitorElement* METTester::melePt
private

Definition at line 194 of file METTester.h.

edm::EDGetTokenT<edm::ValueMap<reco::MuonMETCorrectionData> > METTester::met_ValueMap_Token_
private

Definition at line 96 of file METTester.h.

std::string METTester::METType_
private

Definition at line 74 of file METTester.h.

MonitorElement* METTester::mfracTrks
private

Definition at line 208 of file METTester.h.

int METTester::minhits_
private

Definition at line 100 of file METTester.h.

edm::InputTag METTester::mInputCollection_
private

Definition at line 70 of file METTester.h.

MonitorElement* METTester::mInvisibleEtFraction
private

Definition at line 149 of file METTester.h.

MonitorElement* METTester::mMET
private

Definition at line 116 of file METTester.h.

MonitorElement* METTester::mMET_Nvtx
private

Definition at line 118 of file METTester.h.

MonitorElement* METTester::mMETDeltaPhi_GenMETCalo
private

Definition at line 124 of file METTester.h.

MonitorElement* METTester::mMETDeltaPhi_GenMETTrue
private

Definition at line 122 of file METTester.h.

MonitorElement* METTester::mMETDifference_GenMETCalo
private

Definition at line 123 of file METTester.h.

MonitorElement* METTester::mMETDifference_GenMETTrue
private

Definition at line 121 of file METTester.h.

MonitorElement* METTester::mMETDifference_GenMETTrue_MET0to20
private

Definition at line 169 of file METTester.h.

MonitorElement* METTester::mMETDifference_GenMETTrue_MET100to150
private

Definition at line 174 of file METTester.h.

MonitorElement* METTester::mMETDifference_GenMETTrue_MET150to200
private

Definition at line 175 of file METTester.h.

MonitorElement* METTester::mMETDifference_GenMETTrue_MET200to300
private

Definition at line 176 of file METTester.h.

MonitorElement* METTester::mMETDifference_GenMETTrue_MET20to40
private

Definition at line 170 of file METTester.h.

MonitorElement* METTester::mMETDifference_GenMETTrue_MET300to400
private

Definition at line 177 of file METTester.h.

MonitorElement* METTester::mMETDifference_GenMETTrue_MET400to500
private

Definition at line 178 of file METTester.h.

MonitorElement* METTester::mMETDifference_GenMETTrue_MET40to60
private

Definition at line 171 of file METTester.h.

MonitorElement* METTester::mMETDifference_GenMETTrue_MET60to80
private

Definition at line 172 of file METTester.h.

MonitorElement* METTester::mMETDifference_GenMETTrue_MET80to100
private

Definition at line 173 of file METTester.h.

MonitorElement* METTester::mMETDifference_GenMETTrue_METResolution
private

Definition at line 179 of file METTester.h.

MonitorElement* METTester::mMETFine
private

Definition at line 117 of file METTester.h.

MonitorElement* METTester::mMETPhi
private

Definition at line 119 of file METTester.h.

MonitorElement* METTester::mMETSig
private

Definition at line 115 of file METTester.h.

MonitorElement* METTester::mMEx
private

Definition at line 113 of file METTester.h.

MonitorElement* METTester::mMExCorrection
private

Definition at line 183 of file METTester.h.

MonitorElement* METTester::mMEy
private

Definition at line 114 of file METTester.h.

MonitorElement* METTester::mMEyCorrection
private

Definition at line 184 of file METTester.h.

MonitorElement* METTester::mmuChi2
private

Definition at line 201 of file METTester.h.

MonitorElement* METTester::mmuD0
private

Definition at line 202 of file METTester.h.

MonitorElement* METTester::mmuEta
private

Definition at line 199 of file METTester.h.

MonitorElement* METTester::mmuNhits
private

Definition at line 200 of file METTester.h.

MonitorElement* METTester::mMuonCorrectionFlag
private

Definition at line 185 of file METTester.h.

MonitorElement* METTester::mMuonEtFraction
private

Definition at line 148 of file METTester.h.

MonitorElement* METTester::mmuPt
private

Definition at line 198 of file METTester.h.

MonitorElement* METTester::mmuSAhits
private

Definition at line 205 of file METTester.h.

MonitorElement* METTester::mmuTesthits
private

Definition at line 206 of file METTester.h.

MonitorElement* METTester::mnEls
private

Definition at line 207 of file METTester.h.

MonitorElement* METTester::mNeutralEMEtFraction
private

Definition at line 144 of file METTester.h.

MonitorElement* METTester::mNeutralHadEtFraction
private

Definition at line 145 of file METTester.h.

MonitorElement* METTester::mnMus
private

Definition at line 203 of file METTester.h.

MonitorElement* METTester::mnMusPis
private

Definition at line 204 of file METTester.h.

MonitorElement* METTester::mNvertex
private

Definition at line 110 of file METTester.h.

std::string METTester::mOutputFile
private

Definition at line 71 of file METTester.h.

MonitorElement* METTester::mPFchargedHadronEt
private

Definition at line 161 of file METTester.h.

MonitorElement* METTester::mPFchargedHadronEtFraction
private

Definition at line 160 of file METTester.h.

MonitorElement* METTester::mPFelectronEt
private

Definition at line 159 of file METTester.h.

MonitorElement* METTester::mPFelectronEtFraction
private

Definition at line 158 of file METTester.h.

MonitorElement* METTester::mPFHFEMEt
private

Definition at line 167 of file METTester.h.

MonitorElement* METTester::mPFHFEMEtFraction
private

Definition at line 166 of file METTester.h.

MonitorElement* METTester::mPFHFHadronEt
private

Definition at line 165 of file METTester.h.

MonitorElement* METTester::mPFHFHadronEtFraction
private

Definition at line 164 of file METTester.h.

MonitorElement* METTester::mPFmuonEt
private

Definition at line 163 of file METTester.h.

MonitorElement* METTester::mPFmuonEtFraction
private

Definition at line 162 of file METTester.h.

MonitorElement* METTester::mPFneutralHadronEt
private

Definition at line 157 of file METTester.h.

MonitorElement* METTester::mPFneutralHadronEtFraction
private

Definition at line 156 of file METTester.h.

MonitorElement* METTester::mPFphotonEt
private

Definition at line 155 of file METTester.h.

MonitorElement* METTester::mPFphotonEtFraction
private

Definition at line 154 of file METTester.h.

MonitorElement* METTester::mSumET
private

Definition at line 120 of file METTester.h.

MonitorElement* METTester::mtrkAlgo
private

Definition at line 192 of file METTester.h.

MonitorElement* METTester::mtrkChi2
private

Definition at line 189 of file METTester.h.

MonitorElement* METTester::mtrkD0
private

Definition at line 190 of file METTester.h.

MonitorElement* METTester::mtrkEta
private

Definition at line 187 of file METTester.h.

MonitorElement* METTester::mtrkNhits
private

Definition at line 188 of file METTester.h.

MonitorElement* METTester::mtrkPt
private

Definition at line 186 of file METTester.h.

MonitorElement* METTester::mtrkPtErr
private

Definition at line 193 of file METTester.h.

MonitorElement* METTester::mtrkQuality
private

Definition at line 191 of file METTester.h.

edm::EDGetTokenT<reco::MuonCollection> METTester::muonToken_
private

Definition at line 91 of file METTester.h.

edm::EDGetTokenT<reco::PFMETCollection> METTester::pfMETsToken_
private

Definition at line 85 of file METTester.h.

edm::EDGetTokenT<std::vector<reco::Vertex> > METTester::pvToken_
private

Definition at line 83 of file METTester.h.

std::string METTester::sample_
private

Definition at line 72 of file METTester.h.

edm::EDGetTokenT<edm::ValueMap<reco::MuonMETCorrectionData> > METTester::tcMet_ValueMap_Token_
private

Definition at line 95 of file METTester.h.

edm::EDGetTokenT<reco::METCollection> METTester::tcMETsToken_
private

Definition at line 86 of file METTester.h.

edm::EDGetTokenT<reco::TrackCollection> METTester::trackToken_
private

Definition at line 92 of file METTester.h.

std::vector<int> METTester::trkAlgos_
private

Definition at line 107 of file METTester.h.

std::vector<int> METTester::trkQuality_
private

Definition at line 106 of file METTester.h.