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 }
EcalSeverityLevel::SeverityLevel severityLevel(const DetId &id) const
Evaluate status from id use channelStatus from DB.
void SetHtMht(const edm::Handle< reco::CaloJetCollection > caloJets, float jetptThreshold)
std::vector< EcalRecHit >::const_iterator const_iterator
void SetMet(const edm::Handle< reco::CaloMETCollection > recoMet)
double sumEt() const
Definition: MET.h:52
void SetECALFlags(const edm::ESHandle< EcalChannelStatus > chStatus, const edm::Handle< EcalRecHitCollection > ebRecHits, const edm::Handle< EcalRecHitCollection > eeRecHits, const EcalSeverityLevelAlgo *sevlv)
double et() const final
transverse energy
const_iterator end() const
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
T const * product() const
Definition: Handle.h:69
L1AnalysisRecoMetDataFormat recoMet_
double phi() const final
momentum azimuthal angle
const_iterator begin() const