CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
HcalHitRelabeller Class Reference

#include <HcalHitRelabeller.h>

Public Member Functions

 HcalHitRelabeller (const edm::ParameterSet &ps)
 
void process (std::vector< PCaloHit > &hcalHits)
 
DetId relabel (const uint32_t testId) const
 
void setGeometry (const CaloGeometry *&, const HcalDDDRecConstants *&)
 

Private Attributes

const CaloGeometrytheGeometry
 
const HcalDDDRecConstantstheRecNumber
 

Detailed Description

Definition at line 11 of file HcalHitRelabeller.h.

Constructor & Destructor Documentation

HcalHitRelabeller::HcalHitRelabeller ( const edm::ParameterSet ps)

Definition at line 11 of file HcalHitRelabeller.cc.

11 : theGeometry(0), theRecNumber(0) { }
const CaloGeometry * theGeometry
const HcalDDDRecConstants * theRecNumber

Member Function Documentation

void HcalHitRelabeller::process ( std::vector< PCaloHit > &  hcalHits)

Definition at line 13 of file HcalHitRelabeller.cc.

References gather_cfg::cout, TauDecayModes::dec, cuy::ii, DetId::rawId(), relabel(), and theRecNumber.

Referenced by HcalDigitizer::accumulateCaloHits(), ConfigBuilder.ConfigBuilder::addExtraStream(), ConfigBuilder.ConfigBuilder::completeInputCommand(), ConfigBuilder.ConfigBuilder::doNotInlineEventContent(), ConfigBuilder.ConfigBuilder.PrintAllModules::leave(), ConfigBuilder.ConfigBuilder::prepare_HLT(), ConfigBuilder.ConfigBuilder::prepare_LHE(), ConfigBuilder.ConfigBuilder::prepare_PATFILTER(), ConfigBuilder.ConfigBuilder::prepare_VALIDATION(), ConfigBuilder.ConfigBuilder::renameHLTprocessInSequence(), ConfigBuilder.ConfigBuilder::renameInputTagsInSequence(), and ConfigBuilder.ConfigBuilder::scheduleSequence().

13  {
14 
15  if (theRecNumber) {
16  for (unsigned int ii=0; ii<hcalHits.size(); ++ii) {
17 
18 #ifdef DebugLog
19  std::cout << "Hit[" << ii << "] " << std::hex << hcalHits[ii].id() << std::dec << '\n';
20 #endif
21  DetId newid = relabel(hcalHits[ii].id());
22 #ifdef DebugLog
23  std::cout << "Hit " << ii << " out of " << hcalHits.size() << " " << std::hex << newid.rawId() << std::dec << '\n';
24 #endif
25  hcalHits[ii].setID(newid.rawId());
26 #ifdef DebugLog
27  std::cout << "Modified Hit " << hcalHits[ii] << std::endl;
28 #endif
29  }
30  } else {
31  edm::LogWarning("HcalSim") << "HcalHitRelabeller: no valid HcalDDDRecConstants";
32  }
33 
34 }
int ii
Definition: cuy.py:588
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: DetId.h:18
tuple cout
Definition: gather_cfg.py:145
const HcalDDDRecConstants * theRecNumber
DetId relabel(const uint32_t testId) const
DetId HcalHitRelabeller::relabel ( const uint32_t  testId) const

Definition at line 43 of file HcalHitRelabeller.cc.

References gather_cfg::cout, TauDecayModes::dec, HLT_25ns10e33_v2_cff::depth, eta, HcalDDDRecConstants::getHCID(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, phi, DetId::rawId(), jetcorrextractor::sign(), theRecNumber, HcalTestNumbering::unpackHcalIndex(), and z.

Referenced by process().

43  {
44 
45 #ifdef DebugLog
46  std::cout << "Enter HcalHitRelabeller::relabel " << std::endl;
47 #endif
48  HcalDetId hid;
49  int det, z, depth, eta, phi, layer, sign;
50  HcalTestNumbering::unpackHcalIndex(testId,det,z,depth,eta,phi,layer);
51 #ifdef DebugLog
52  std::cout << "det: " << det << " "
53  << "z: " << z << " "
54  << "depth: " << depth << " "
55  << "ieta: " << eta << " "
56  << "iphi: " << phi << " "
57  << "layer: " << layer << std::endl;
58 #endif
59  HcalDDDRecConstants::HcalID id = theRecNumber->getHCID(det,eta,phi,layer,depth);
60  sign=(z==0)?(-1):(1);
61 
62  if (id.subdet==int(HcalBarrel)) {
63  hid=HcalDetId(HcalBarrel,sign*id.eta,id.phi,id.depth);
64  } else if (id.subdet==int(HcalEndcap)) {
65  hid=HcalDetId(HcalEndcap,sign*id.eta,id.phi,id.depth);
66  } else if (id.subdet==int(HcalOuter)) {
67  hid=HcalDetId(HcalOuter,sign*id.eta,id.phi,id.depth);
68  } else if (id.subdet==int(HcalForward)) {
69  hid=HcalDetId(HcalForward,sign*id.eta,id.phi,id.depth);
70  }
71 #ifdef DebugLog
72  std::cout << " new HcalDetId -> hex.RawID = "
73  << std::hex << hid.rawId() << std::dec;
74  std::cout.flush();
75  std::cout << " det, z, depth, eta, phi = " << det << " "
76  << z << " "<< id.depth << " " << id.eta << " "
77  << id.phi << " ---> " << hid << std::endl;
78 #endif
79  return hid;
80 }
double sign(double x)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
HcalID getHCID(int subdet, int ieta, int iphi, int lay, int idepth) const
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
tuple cout
Definition: gather_cfg.py:145
const HcalDDDRecConstants * theRecNumber
void HcalHitRelabeller::setGeometry ( const CaloGeometry *&  geom,
const HcalDDDRecConstants *&  recNum 
)

Definition at line 37 of file HcalHitRelabeller.cc.

References relativeConstraints::geom, theGeometry, and theRecNumber.

Referenced by HcalDigitizer::updateGeometry().

38  {
39  theGeometry = geom;
40  theRecNumber = recNum;
41 }
const CaloGeometry * theGeometry
const HcalDDDRecConstants * theRecNumber

Member Data Documentation

const CaloGeometry* HcalHitRelabeller::theGeometry
private

Definition at line 20 of file HcalHitRelabeller.h.

Referenced by setGeometry().

const HcalDDDRecConstants* HcalHitRelabeller::theRecNumber
private

Definition at line 21 of file HcalHitRelabeller.h.

Referenced by process(), relabel(), and setGeometry().