Skip to content

Commit

Permalink
Try Muon analysis in HB/HE using SIM information
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunanda committed Mar 29, 2017
1 parent 6c373d9 commit 92c9078
Show file tree
Hide file tree
Showing 9 changed files with 1,114 additions and 314 deletions.
710 changes: 405 additions & 305 deletions Calibration/HcalCalibAlgos/plugins/HcalHBHEMuonAnalyzer.cc

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Calibration/IsolatedParticles/interface/FindCaloHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ namespace spr {
template <typename T>
std::vector<typename T::const_iterator> findHit(edm::Handle<T>& hits, DetId thisDet, bool debug=false);

std::vector<std::vector<PCaloHit>::const_iterator> findHit(std::vector<PCaloHit>& hits, DetId thisDet, bool debug=false);

template <typename T>
void findHit(edm::Handle<T>& hits, DetId thisDet, std::vector<typename T::const_iterator>& hit, bool debug=false);

Expand Down
8 changes: 8 additions & 0 deletions Calibration/IsolatedParticles/interface/eHCALMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ namespace spr{
template< typename T>
double eHCALmatrix(const HcalTopology* topology, const DetId& det, edm::Handle<T>& hits, int ieta, int iphi, bool includeHO=false, bool algoNew=true, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false);

double eHCALmatrix(const HcalTopology* topology, const DetId& det, std::vector<PCaloHit>& hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false);

template< typename T>
double eHCALmatrix(const HcalTopology* topology, const DetId& det, edm::Handle<T>& hits, int ietaE, int ietaW, int iphiN, int iphiS, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false);

Expand All @@ -51,6 +53,8 @@ namespace spr{
template <typename T>
double eHCALmatrix(const CaloGeometry* geo, const HcalTopology* topology, const DetId& det0, edm::Handle<T>& hits, int ieta, int iphi, HcalDetId& hotCell, bool includeHO=false, bool useRaw=false, bool debug=false);

double eHCALmatrix(const CaloGeometry* geo, const HcalTopology* topology, const DetId& det0, std::vector<PCaloHit>& hits, int ieta, int iphi, HcalDetId& hotCell, bool includeHO=false, bool debug=false);

template <typename T>
double energyHCALmatrixNew(const HcalTopology* topology, const DetId& det, edm::Handle<T>& hits, int ieta, int iphi, bool includeHO=false, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false);

Expand All @@ -69,12 +73,16 @@ namespace spr{
template <typename T>
void energyHCALCell(HcalDetId detId, edm::Handle<T>& hits, std::vector<std::pair<double,int> >& energyCell, int maxDepth=1, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool useRaw=false, bool debug=false);

void energyHCALCell(HcalDetId detId, std::vector<PCaloHit>& hits, std::vector<std::pair<double,int> >& energyCell, int maxDepth=1, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100, double tMin=-500, double tMax=500, bool debug=false);

template <typename T>
void hitsHCAL(std::vector<DetId>& vdets, edm::Handle<T>& hits, std::vector< typename T::const_iterator>& hitlist, bool debug=false);

HcalDetId getHotCell(std::vector<HBHERecHitCollection::const_iterator>& hit, bool includeHO, bool useRaw=false, bool debug=false);

HcalDetId getHotCell(std::vector<std::vector<PCaloHit>::const_iterator>& hit, bool includeHO, bool useRaw=false, bool debug=false);

double eHCALThreshold(int subdet, double hbThr=-100, double heThr=-100, double hfThr=-100, double hoThr=-100);
}

#include "Calibration/IsolatedParticles/interface/eHCALMatrix.icc"
Expand Down
15 changes: 6 additions & 9 deletions Calibration/IsolatedParticles/interface/eHCALMatrix.icc
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,7 @@ namespace spr{
std::vector< typename T::const_iterator> hit = spr::findHit(hits, vdets[i]);
double energy = 0;
int subdet = ((HcalDetId)(vdets[i].rawId())).subdet();
double eThr = hbThr;
if (subdet == (int)(HcalEndcap)) eThr = heThr;
else if (subdet == (int)(HcalForward)) eThr = hfThr;
else if (subdet == (int)(HcalOuter)) eThr = hoThr;
double eThr = spr::eHCALThreshold(subdet, hbThr, heThr, hfThr, hoThr);
for (unsigned int ihit=0; ihit<hit.size(); ihit++) {
if (hit[ihit] != hits->end()) {
khit++;
Expand All @@ -215,14 +212,14 @@ namespace spr{
void energyHCALCell(HcalDetId detID, edm::Handle<T>& hits, std::vector<std::pair<double,int> >& energyCell, int maxDepth, double hbThr, double heThr, double hfThr, double hoThr, double tMin, double tMax, bool useRaw, bool debug) {
energyCell.clear();
int subdet = detID.subdet();
double eThr = hbThr;
if (subdet == (int)(HcalEndcap)) eThr = heThr;
else if (subdet == (int)(HcalForward)) eThr = hfThr;
else if (subdet == (int)(HcalOuter)) eThr = hoThr;
double eThr = spr::eHCALThreshold(subdet, hbThr, heThr, hfThr, hoThr);
bool hbhe = (detID.ietaAbs() == 16);
int depthHE = (maxDepth <= 6) ? 3 : 4;
if (debug)
std::cout << "energyHCALCell: input ID " << detID << " MaxDepth " << maxDepth << " Threshold (E) " << eThr << " (T) " << tMin << ":" << tMax << std::endl;
for (int i=0; i<maxDepth; i++) {
HcalDetId hcid(detID.subdet(),detID.ieta(),detID.iphi(),i+1);
HcalSubdetector subdet0 = (hbhe) ? ((i+1 >= depthHE) ? HcalEndcap : HcalBarrel) : detID.subdet();
HcalDetId hcid(subdet0,detID.ieta(),detID.iphi(),i+1);
DetId det(hcid.rawId());
std::vector< typename T::const_iterator> hit = spr::findHit(hits, det);
double energy(0);
Expand Down
1 change: 1 addition & 0 deletions Calibration/IsolatedParticles/plugins/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@
<library name="CalibrationIsoTrackCalib" file="IsoTrackCalib.cc"> </library>
<library name="CalibrationIsoTrackCalibration" file="IsoTrackCalibration.cc"> </library>
<library name="CalibrationHcalRaddamMuon" file="HcalRaddamMuon.cc"> </library>
<library name="CalibrationHcalHBHEMuonSimAnalyzer" file="HcalHBHEMuonSimAnalyzer.cc"> </library>

0 comments on commit 92c9078

Please sign in to comment.