Skip to content

Commit

Permalink
Format change: added variable to hold energy of the hottest cell.
Browse files Browse the repository at this point in the history
Methods to retrieve information about energy in HCAL  subdetectors.


---
yaml
---
svn_rev: 94526
current_ref: refs/heads/CMSSW_7_0_X
current_commit: 21b72b9
head_branch: refs/heads/CMSSW_7_0_X
migrated_from: v3
  • Loading branch information
Anton Anastassov committed Sep 23, 2010
1 parent 73bbaf9 commit 3351925
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: 90c10214674639ca7a94515baf184b0cc75e1b69
refs/heads/CMSSW_7_0_X: c84f4398ee69d74a0888a993788b51ee986bfcdf
refs/heads/CMSSW_7_0_X: 21b72b9b2752f72f920b36ad640dc5608154bfcb
23 changes: 21 additions & 2 deletions trunk/DataFormats/CaloTowers/interface/CaloTower.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

/** \class CaloTower
$Date: 2009/04/09 05:03:00 $
$Revision: 1.15 $
$Date: 2010/01/12 20:26:52 $
$Revision: 1.16 $
\author J. Mans - Minnesota
*/

Expand Down Expand Up @@ -62,6 +62,11 @@ class CaloTower : public reco::LeafCandidate {

void setCaloTowerStatus(uint32_t s) { twrStatusWord_ = s; }

// set the hottest cell energy in the tower
void setHottestCellE(double e) { hottestCellE_ = e; }




// getters
CaloTowerDetId id() const { return id_; }
Expand Down Expand Up @@ -109,6 +114,8 @@ class CaloTower : public reco::LeafCandidate {
double hadEt(Point v) const { return hadE_ * sin(p4(v).theta()); }
double outerEt(Point v) const { return (id_.ietaAbs()<16)? outerE_ * sin(p4(v).theta()) : 0.0; }

double hottestCellE() const { return hottestCellE_; }

// Access to p4 comming from HO alone: requested by JetMET to add/subtract HO contributions
// to the tower for cases when the tower collection was created without/with HO

Expand All @@ -129,6 +136,16 @@ class CaloTower : public reco::LeafCandidate {
double hadEnergyHeOuterLayer() const { return (id_.ietaAbs()<18 || id_.ietaAbs()>29)? 0 : outerE_; }
double hadEnergyHeInnerLayer() const { return (id_.ietaAbs()<18 || id_.ietaAbs()>29)? 0 : hadE_ - outerE_; }

// energy in the tower by HCAL subdetector
// This is trivial except for tower 16
// needed by JetMET cleanup in AOD.
double energyInHB() const; // { return (id_.ietaAbs()<16)? outerE_ : 0.0; }
double energyInHE() const;
double energyInHF() const;
double energyInHO() const;



// time (ns) in ECAL/HCAL components of the tower based on weigted sum of the times in the contributing RecHits
float ecalTime() const { return float(ecalTime_) * 0.01; }
float hcalTime() const { return float(hcalTime_) * 0.01; }
Expand Down Expand Up @@ -171,6 +188,8 @@ class CaloTower : public reco::LeafCandidate {
int hcalTime_;

Double32_t emE_, hadE_, outerE_;
// for Jet ID use: hottest cell (ECAl or HCAL)
Double32_t hottestCellE_;

int emLvl1_,hadLvl1_;
std::vector<DetId> constituents_;
Expand Down
36 changes: 36 additions & 0 deletions trunk/DataFormats/CaloTowers/src/CaloTower.cc
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,42 @@ void CaloTower::setCaloTowerStatus(unsigned int numBadHcalChan,unsigned int numB




// energy in the tower by HCAL subdetector
// This is trivia except for tower 16
// needed by JetMET cleanup in AOD.

double CaloTower::energyInHB() const {
if (id_.ietaAbs()<16) return hadE_;
else if (id_.ietaAbs()==16) return hadE_-outerE_;
else return 0.0;
}

double CaloTower::energyInHE() const {
if (id_.ietaAbs()>16 && id_.ietaAbs()<30) return hadE_;
else if (id_.ietaAbs()==16) return outerE_;
else return 0.0;
}

double CaloTower::energyInHF() const {
if (id_.ietaAbs()>29) return energy();
else return 0.0;
}

// this is actual energy contributed to the tower
// (outerEnergy() returns HO energy regardless if it is used or not)
// Note: rounding error may lead to values not identically equal to zero
// when HO was not used

double CaloTower::energyInHO() const {
if (id_.ietaAbs()>15) return 0.0;
else return (energy() - hadE_ -emE_);
}





std::ostream& operator<<(std::ostream& s, const CaloTower& ct) {
return s << ct.id() << ":" << ct.et()
<< " GeV ET (EM=" << ct.emEt() <<
Expand Down

0 comments on commit 3351925

Please sign in to comment.