CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/SimG4CMS/HcalTestBeam/src/HcalTB04XtalNumberingScheme.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     HcalTestBeam
00004 // Class  :     HcalTB04XtalNumberingScheme
00005 //
00006 // Implementation:
00007 //     Numbering scheme for crystal calorimeter in 2004 test beam
00008 //
00009 // Original Author:
00010 //         Created:  Tue 16 10:14:34 CEST 2006
00011 // $Id: HcalTB04XtalNumberingScheme.cc,v 1.3 2006/11/13 10:32:15 sunanda Exp $
00012 //
00013   
00014 // system include files
00015   
00016 // user include files
00017 #include "SimG4CMS/HcalTestBeam/interface/HcalTB04XtalNumberingScheme.h"
00018 #include "SimG4CMS/Calo/interface/HcalTestNumberingScheme.h"
00019 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00020 
00021 using namespace std;
00022 
00023 //
00024 // constructors and destructor
00025 //
00026 
00027 HcalTB04XtalNumberingScheme::HcalTB04XtalNumberingScheme() : 
00028   EcalNumberingScheme() {
00029   edm::LogInfo("HcalTBSim") << "Creating HcalTB04XtalNumberingScheme";
00030 }
00031 
00032 HcalTB04XtalNumberingScheme::~HcalTB04XtalNumberingScheme() {
00033   edm::LogInfo("HcalTBSim") << "Deleting HcalTB04XtalNumberingScheme";
00034 }
00035 
00036 //
00037 // member functions
00038 //
00039 
00040 uint32_t HcalTB04XtalNumberingScheme::getUnitID(const EcalBaseNumber& baseNumber) const {
00041 
00042   int idx=0, idl=0;
00043   if (baseNumber.getLevels()<1) {
00044     edm::LogWarning("HcalTBSim") << "HcalTB04XtalNumberingScheme::getUnitID: "
00045                                  << "No level found in EcalBaseNumber "
00046                                  << "Returning 0";
00047   } else {
00048     idx = baseNumber.getCopyNumber(0);
00049     if (baseNumber.getLevels() > 1) idl = baseNumber.getCopyNumber(1);
00050   }
00051   int  det = 10;
00052   uint32_t idunit = HcalTestNumbering::packHcalIndex(det,0,1,idl,idx,1);
00053 
00054   LogDebug("HcalTBSim") << "HcalTB04XtalNumberingScheme : Crystal " << idx 
00055                         << " Layer " << idl << " UnitID = 0x" << std::hex
00056                         << idunit << std::dec;
00057   
00058   return idunit;
00059 
00060 }