Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:06

0001 // -*- C++ -*-
0002 //
0003 // Package:     HcalTestBeam
0004 // Class  :     HcalTB04XtalNumberingScheme
0005 //
0006 // Implementation:
0007 //     Numbering scheme for crystal calorimeter in 2004 test beam
0008 //
0009 // Original Author:
0010 //         Created:  Tue 16 10:14:34 CEST 2006
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "SimG4CMS/Calo/interface/HcalTestNumberingScheme.h"
0017 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0018 #include "SimG4CMS/HcalTestBeam/interface/HcalTB04XtalNumberingScheme.h"
0019 
0020 //#define EDM_ML_DEBUG
0021 
0022 //
0023 // constructors and destructor
0024 //
0025 
0026 HcalTB04XtalNumberingScheme::HcalTB04XtalNumberingScheme() : EcalNumberingScheme() {
0027 #ifdef EDM_ML_DEBUG
0028   edm::LogVerbatim("HcalTBSim") << "Creating HcalTB04XtalNumberingScheme";
0029 #endif
0030 }
0031 
0032 HcalTB04XtalNumberingScheme::~HcalTB04XtalNumberingScheme() {
0033 #ifdef EDM_ML_DEBUG
0034   edm::LogVerbatim("HcalTBSim") << "Deleting HcalTB04XtalNumberingScheme";
0035 #endif
0036 }
0037 
0038 //
0039 // member functions
0040 //
0041 
0042 uint32_t HcalTB04XtalNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const {
0043   int idx = 0, idl = 0;
0044   if (baseNumber.getLevels() < 1) {
0045     edm::LogWarning("HcalTBSim") << "HcalTB04XtalNumberingScheme::getUnitID: "
0046                                  << "No level found in EcalBaseNumber "
0047                                  << "Returning 0";
0048   } else {
0049     idx = baseNumber.getCopyNumber(0);
0050     if (baseNumber.getLevels() > 1)
0051       idl = baseNumber.getCopyNumber(1);
0052   }
0053   int det = 10;
0054   uint32_t idunit = HcalTestNumbering::packHcalIndex(det, 0, 1, idl, idx, 1);
0055 
0056 #ifdef EDM_ML_DEBUG
0057   edm::LogVerbatim("HcalTBSim") << "HcalTB04XtalNumberingScheme : Crystal " << idx << " Layer " << idl << " UnitID = 0x"
0058                                 << std::hex << idunit << std::dec;
0059 #endif
0060   return idunit;
0061 }