CMS 3D CMS Logo

L1AnalysisRecoMet.cc
Go to the documentation of this file.
3 
4 #include <TVector2.h>
5 
7 
9 
11  const reco::CaloMETCollection *metCol = recoMet.product();
12  const reco::CaloMET theMet = metCol->front();
13 
14  recoMet_.met = theMet.et();
15  recoMet_.metPhi = theMet.phi();
16  recoMet_.sumEt = theMet.sumEt();
17 }
18 
20  float jetptThreshold) {
21  float mHx = 0.;
22  float mHy = 0.;
23 
24  recoMet_.Ht = 0;
25  recoMet_.mHt = -999;
26  recoMet_.mHtPhi = -999;
27 
28  for (reco::CaloJetCollection::const_iterator calojet = caloJets->begin(); calojet != caloJets->end(); ++calojet) {
29  if (calojet->pt() > jetptThreshold) {
30  mHx += -1. * calojet->px();
31  mHy += -1. * calojet->py();
32  recoMet_.Ht += calojet->pt();
33  }
34  }
35 
36  TVector2 *tv2 = new TVector2(mHx, mHy);
37 
38  recoMet_.mHt = tv2->Mod();
39  recoMet_.mHtPhi = tv2->Phi();
40 }
41 
43  const edm::Handle<EcalRecHitCollection> ebRecHits,
44  const edm::Handle<EcalRecHitCollection> eeRecHits,
45  const EcalSeverityLevelAlgo *sevlv) {
46  int ecalFlag = 0;
47 
48  // loop over EB rechits
49  for (EcalRecHitCollection::const_iterator rechit = ebRecHits->begin(); rechit != ebRecHits->end(); ++rechit) {
50  EBDetId eid(rechit->id());
51  //rechit->recoFlag();
52  //rechit->chi2();
53  //rechit->outOfTimeChi2();
54 
55  //int flag = EcalSeverityLevelAlgo::severityLevel( eid, *ebRecHits, *chStatus );
56  int flag = sevlv->severityLevel(eid, *ebRecHits);
57  if (flag > ecalFlag)
58  ecalFlag = flag;
59  }
60 
61  // not clear what flags are in EE.... don't use them yet
62 
63  recoMet_.ecalFlag = ecalFlag;
64 }
EcalSeverityLevelAlgo
Definition: EcalSeverityLevelAlgo.h:33
edm::SortedCollection< EcalRecHit >::const_iterator
std::vector< EcalRecHit >::const_iterator const_iterator
Definition: SortedCollection.h:80
edm::Handle::product
T const * product() const
Definition: Handle.h:70
EcalSeverityLevelAlgo::severityLevel
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
Definition: EcalSeverityLevelAlgo.cc:85
l1JetRecoTree_cfi.jetptThreshold
jetptThreshold
Definition: l1JetRecoTree_cfi.py:10
L1Analysis::L1AnalysisRecoMet::L1AnalysisRecoMet
L1AnalysisRecoMet()
Definition: L1AnalysisRecoMet.cc:6
EBDetId
Definition: EBDetId.h:17
L1Analysis::L1AnalysisRecoMet::SetMet
void SetMet(const edm::Handle< reco::CaloMETCollection > recoMet)
Definition: L1AnalysisRecoMet.cc:10
reco::MET::sumEt
double sumEt() const
Definition: MET.h:56
edm::Handle< reco::CaloMETCollection >
reco::CaloMET
Definition: CaloMET.h:21
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
L1Analysis::L1AnalysisRecoMet::SetHtMht
void SetHtMht(const edm::Handle< reco::CaloJetCollection > caloJets, float jetptThreshold)
Definition: L1AnalysisRecoMet.cc:19
edm::ESHandle
Definition: DTSurvey.h:22
isolatedTracks_cfi.caloJets
caloJets
Definition: isolatedTracks_cfi.py:33
EcalSeverityLevelAlgo.h
L1AnalysisRecoMet.h
L1Analysis::L1AnalysisRecoMet::~L1AnalysisRecoMet
~L1AnalysisRecoMet()
Definition: L1AnalysisRecoMet.cc:8
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
L1Analysis::L1AnalysisRecoMet::SetECALFlags
void SetECALFlags(const edm::ESHandle< EcalChannelStatus > chStatus, const edm::Handle< EcalRecHitCollection > ebRecHits, const edm::Handle< EcalRecHitCollection > eeRecHits, const EcalSeverityLevelAlgo *sevlv)
Definition: L1AnalysisRecoMet.cc:42
reco::LeafCandidate::et
double et() const final
transverse energy
Definition: LeafCandidate.h:127
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
reco::CaloMETCollection
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
Definition: CaloMETCollection.h:20
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116