test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1AnalysisRecoMet.cc
Go to the documentation of this file.
3 
4 #include <TVector2.h>
5 
6 
8 {
9 }
10 
12 {
13 }
14 
16 {
17  const reco::CaloMETCollection *metCol = recoMet.product();
18  const reco::CaloMET theMet = metCol->front();
19 
20  recoMet_.met = theMet.et();
21  recoMet_.metPhi = theMet.phi();
22  recoMet_.sumEt = theMet.sumEt();
23 
24 }
25 
27 {
28  float mHx = 0.;
29  float mHy = 0.;
30 
31  recoMet_.Ht = 0;
32  recoMet_.mHt = -999;
33  recoMet_.mHtPhi = -999;
34 
35  for (reco::CaloJetCollection::const_iterator calojet = caloJets->begin(); calojet!=caloJets->end(); ++calojet)
36  {
37  if (calojet->pt()>jetptThreshold){
38  mHx += -1.*calojet->px();
39  mHy += -1.*calojet->py();
40  recoMet_.Ht += calojet->pt();
41  }
42  }
43 
44  TVector2 *tv2 = new TVector2(mHx,mHy);
45 
46  recoMet_.mHt = tv2->Mod();
47  recoMet_.mHtPhi= tv2->Phi();
48 
49 }
50 
52  const edm::Handle<EcalRecHitCollection> ebRecHits,
53  const edm::Handle<EcalRecHitCollection> eeRecHits,
54  const EcalSeverityLevelAlgo* sevlv)
55 {
56  int ecalFlag=0;
57 
58  // loop over EB rechits
59  for(EcalRecHitCollection::const_iterator rechit = ebRecHits->begin();
60  rechit != ebRecHits->end();
61  ++rechit){
62 
63  EBDetId eid(rechit->id());
64  //rechit->recoFlag();
65  //rechit->chi2();
66  //rechit->outOfTimeChi2();
67 
68  //int flag = EcalSeverityLevelAlgo::severityLevel( eid, *ebRecHits, *chStatus );
69  int flag = sevlv->severityLevel( eid, *ebRecHits);
70  if (flag>ecalFlag) ecalFlag = flag;
71  }
72 
73  // not clear what flags are in EE.... don't use them yet
74 
75  recoMet_.ecalFlag = ecalFlag;
76 
77 }
78 
79 
80 
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)
virtual double phi() const final
momentum azimuthal angle
double sumEt() const
Definition: MET.h:56
void SetECALFlags(const edm::ESHandle< EcalChannelStatus > chStatus, const edm::Handle< EcalRecHitCollection > ebRecHits, const edm::Handle< EcalRecHitCollection > eeRecHits, const EcalSeverityLevelAlgo *sevlv)
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
T const * product() const
Definition: Handle.h:81
virtual double et() const final
transverse energy