CMS 3D CMS Logo

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

#include <HGCNumberingScheme.h>

Inheritance diagram for HGCNumberingScheme:
CaloNumberingScheme

Public Types

enum  HGCNumberingParameters { HGCCellSize }
 

Public Member Functions

int assignCell (float x, float y, int layer)
 maps a hit position to a sequential cell in a trapezoid surface defined by h,b,t More...
 
const HGCalDDDConstantsgetDDDConstants ()
 getter More...
 
std::pair< float, float > getLocalCoords (int cell, int layer)
 inverts the cell number in a trapezoid surface to local coordinates More...
 
virtual uint32_t getUnitID (ForwardSubdetector subdet, int layer, int module, int iz, const G4ThreeVector &pos)
 assigns the det id to a hit More...
 
 HGCNumberingScheme (const DDCompactView &cpv, std::string &name, bool check, int verbose)
 
virtual ~HGCNumberingScheme ()
 
- Public Member Functions inherited from CaloNumberingScheme
 CaloNumberingScheme (int iv=0)
 Constructor with optional verbosity control. More...
 
void setVerbosity (const int)
 Verbosity setting. More...
 
virtual ~CaloNumberingScheme ()
 

Private Member Functions

 HGCNumberingScheme ()
 

Private Attributes

bool check_
 
HGCalDDDConstantshgcons
 
int verbosity
 

Additional Inherited Members

- Protected Attributes inherited from CaloNumberingScheme
int verbosity
 Verbosity field: Zero = quiet, increasing integers mean more output. More...
 

Detailed Description

Definition at line 18 of file HGCNumberingScheme.h.

Member Enumeration Documentation

Enumerator
HGCCellSize 

Definition at line 22 of file HGCNumberingScheme.h.

Constructor & Destructor Documentation

HGCNumberingScheme::HGCNumberingScheme ( const DDCompactView cpv,
std::string &  name,
bool  check,
int  verbose 
)

Definition at line 12 of file HGCNumberingScheme.cc.

References mergeVDriftHistosByStation::name.

14  :
16  hgcons(new HGCalDDDConstants(cpv,name)) {
17  edm::LogInfo("HGCSim") << "Creating HGCNumberingScheme for " << name;
18 }
CaloNumberingScheme(int iv=0)
Constructor with optional verbosity control.
bool check(const std::string &)
HGCalDDDConstants * hgcons
HGCNumberingScheme::~HGCNumberingScheme ( )
virtual

Definition at line 20 of file HGCNumberingScheme.cc.

20  {
21  edm::LogInfo("HGCSim") << "Deleting HGCNumberingScheme";
22 }
HGCNumberingScheme::HGCNumberingScheme ( )
private

Member Function Documentation

int HGCNumberingScheme::assignCell ( float  x,
float  y,
int  layer 
)

maps a hit position to a sequential cell in a trapezoid surface defined by h,b,t

Definition at line 56 of file HGCNumberingScheme.cc.

References HGCalDDDConstants::assignCell(), and hgcons.

56  {
57 
58  std::pair<int,int> phicell = hgcons->assignCell(x,y,layer,0,false);
59  return phicell.second;
60 }
HGCalDDDConstants * hgcons
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
const HGCalDDDConstants* HGCNumberingScheme::getDDDConstants ( )
inline

getter

Definition at line 47 of file HGCNumberingScheme.h.

References hgcons.

47 { return hgcons; }
HGCalDDDConstants * hgcons
std::pair< float, float > HGCNumberingScheme::getLocalCoords ( int  cell,
int  layer 
)

inverts the cell number in a trapezoid surface to local coordinates

Definition at line 63 of file HGCNumberingScheme.cc.

References hgcons, and HGCalDDDConstants::locateCell().

63  {
64 
65  return hgcons->locateCell(cell,layer,0,false);
66 }
HGCalDDDConstants * hgcons
std::pair< float, float > locateCell(int cell, int lay, int subSec, bool reco) const
uint32_t HGCNumberingScheme::getUnitID ( ForwardSubdetector  subdet,
int  layer,
int  module,
int  iz,
const G4ThreeVector &  pos 
)
virtual

assigns the det id to a hit

Definition at line 25 of file HGCNumberingScheme.cc.

References HGCalDDDConstants::assignCell(), check_, gather_cfg::cout, TauDecayModes::dec, hgcons, cmsHarvester::index, HGCalDetId::isValid(), HGCalDDDConstants::isValid(), DetId::rawId(), and verbosity.

Referenced by HGCSD::setDetUnitId().

25  {
26 
27  std::pair<int,int> phicell = hgcons->assignCell(pos.x(),pos.y(),layer,0,false);
28  int phiSector = phicell.first;
29  int icell = phicell.second;
30 
31  //build the index
32  uint32_t index = HGCalDetId(subdet,iz,layer,sector,phiSector,icell).rawId();
33 
34  //check if it fits
35  if ((!HGCalDetId::isValid(subdet,iz,layer,sector,phiSector,icell)) ||
36  (!hgcons->isValid(layer,sector,icell,false))) {
37  index = 0;
38  if (check_ && icell != -1) {
39  edm::LogError("HGCSim") << "[HGCNumberingScheme] ID out of bounds :"
40  << " Subdet= " << subdet << " Zside= " << iz
41  << " Layer= " << layer << " Sector= " << sector
42  << " SubSector= " << phiSector << " Cell= "
43  << icell << " Local position: (" << pos.x()
44  << "," << pos.y() << "," << pos.z() << ")";
45  }
46  }
47  if (verbosity > 0)
48  std::cout << "HGCNumberingScheme::i/p " << subdet << ":" << layer << ":"
49  << sector << ":" << iz << ":" << pos << " o/p " << phiSector
50  << ":" << icell << ":" << std::hex << index << std::dec << " "
51  << HGCalDetId(index) << std::endl;
52  return index;
53 }
bool isValid(int lay, int mod, int cell, bool reco) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
HGCalDDDConstants * hgcons
static bool isValid(ForwardSubdetector subdet, int zp, int lay, int mod, int subsec, int cell)
Definition: HGCalDetId.cc:47
std::pair< int, int > assignCell(float x, float y, int lay, int subSec, bool reco) const
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

bool HGCNumberingScheme::check_
private

Definition at line 53 of file HGCNumberingScheme.h.

Referenced by getUnitID().

HGCalDDDConstants* HGCNumberingScheme::hgcons
private

Definition at line 55 of file HGCNumberingScheme.h.

Referenced by assignCell(), getDDDConstants(), getLocalCoords(), and getUnitID().

int HGCNumberingScheme::verbosity
private

Definition at line 54 of file HGCNumberingScheme.h.

Referenced by getUnitID().