Commit a897d76b authored by John Chapman's avatar John Chapman
Browse files

Drop calls which change the internal state of SiHitIdHelper after initialization


Former-commit-id: d7b18364a6267d4e1ca5420d4414669decc05092
parent e181febe
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
#ifndef INDETSIMEVENT_SIHITIDHELPER
#define INDETSIMEVENT_SIHITIDHELPER
//
// This is a helper class to build an identifing integer used by
// This is a helper class to build an identifing integer used by
// the simulation. It inherits from HitIdHelper, in order to get
// all the packing and shifting for free.
// The class is a singleton and a static GetHelper() is provided
// the constructor calls the Initialize() method which sets all the
// all the packing and shifting for free.
// The class is a singleton and a static GetHelper() is provided
// the constructor calls the Initialize() method which sets all the
// field dimensions
// Methods are provided to get access to the SiTracker Geometry
// description
......@@ -26,38 +26,38 @@ class SiHitIdHelper : HitIdHelper {
public:
//
// Access to the helper
static SiHitIdHelper* GetHelper();
static SiHitIdHelper* GetHelper();
//
// Info retrieval:
// Pixel or SCT
bool isPixel(const int& hid);
bool isSCT(const int& hid);
bool isPixel(const int& hid) const;
bool isSCT(const int& hid) const;
// Barrel or Endcap
int getBarrelEndcap(const int& hid);
int getBarrelEndcap(const int& hid) const;
// Layer/Disk
int getLayerDisk(const int& hid);
int getLayerDisk(const int& hid) const;
// eta module
int getEtaModule(const int& hid);
int getEtaModule(const int& hid) const;
// phi module&
int getPhiModule(const int& hid);
int getPhiModule(const int& hid) const;
// side
int getSide(const int& hid);
int getSide(const int& hid) const;
//
// Info packing:
int buildHitId(const int, const int, const int, const int, const int, const int);
int buildHitId(const int, const int, const int, const int, const int, const int) const;
private:
//
// private constructor to have a singleton
SiHitIdHelper();
SiHitIdHelper();
//
// Initialize the helper, only called by the constructor
void Initialize();
void Initialize();
};
#endif // INDETSIMEVENT_SIHITIDHELPER
......@@ -61,61 +61,62 @@ void SiHitIdHelper::Initialize() {
// Info retrieval:
// Pixel or SCT
bool SiHitIdHelper::isPixel(const int& hid){
this->SetID(hid);
int ps = this->GetFieldValue("PixelSCT");
bool SiHitIdHelper::isPixel(const int& hid) const
{
int ps = this->GetFieldValue("PixelSCT", hid);
if (ps ==0 ) return true;
else return false;
}
bool SiHitIdHelper::isSCT(const int& hid){
this->SetID(hid);
int ps = this->GetFieldValue("PixelSCT");
bool SiHitIdHelper::isSCT(const int& hid) const
{
int ps = this->GetFieldValue("PixelSCT", hid);
if (ps ==0 ) return false;
else return true;
}
// Barrel or Endcap
int SiHitIdHelper::getBarrelEndcap(const int& hid){
this->SetID(hid);
return this->GetFieldValue("BarrelEndcap");
int SiHitIdHelper::getBarrelEndcap(const int& hid) const
{
return this->GetFieldValue("BarrelEndcap", hid);
}
// Layer/Disk
int SiHitIdHelper::getLayerDisk(const int& hid) {
this->SetID(hid);
return this->GetFieldValue("LayerDisk");
int SiHitIdHelper::getLayerDisk(const int& hid) const
{
return this->GetFieldValue("LayerDisk", hid);
}
// eta module
int SiHitIdHelper::getEtaModule(const int& hid) {
this->SetID(hid);
return this->GetFieldValue("EtaModule");
int SiHitIdHelper::getEtaModule(const int& hid) const
{
return this->GetFieldValue("EtaModule", hid);
}
// phi module
int SiHitIdHelper::getPhiModule(const int& hid) {
this->SetID(hid);
return this->GetFieldValue("PhiModule");
int SiHitIdHelper::getPhiModule(const int& hid) const
{
return this->GetFieldValue("PhiModule", hid);
}
// side
int SiHitIdHelper::getSide(const int& hid) {
this->SetID(hid);
return this->GetFieldValue("Side");
int SiHitIdHelper::getSide(const int& hid) const
{
return this->GetFieldValue("Side", hid);
}
//
// Info packing:
int SiHitIdHelper::buildHitId(const int Pixel_SCT, const int BrlECap, const int LayerDisk,
const int etaM, const int phiM, const int side) {
this->SetID(0);
this->SetFieldValue("PixelSCT", Pixel_SCT);
this->SetFieldValue("BarrelEndcap", BrlECap);
this->SetFieldValue("LayerDisk", LayerDisk);
this->SetFieldValue("EtaModule", etaM);
this->SetFieldValue("PhiModule", phiM);
this->SetFieldValue("Side", side);
return this->GetID();
const int etaM, const int phiM, const int side) const
{
int theID(0);
this->SetFieldValue("PixelSCT", Pixel_SCT, theID);
this->SetFieldValue("BarrelEndcap", BrlECap, theID);
this->SetFieldValue("LayerDisk", LayerDisk, theID);
this->SetFieldValue("EtaModule", etaM, theID);
this->SetFieldValue("PhiModule", phiM, theID);
this->SetFieldValue("Side", side, theID);
return theID;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment