CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/SimG4CMS/HcalTestBeam/src/HcalTB02XtalNumberingScheme.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     HcalTestBeam
00004 // Class  :     HcalTB02XtalNumberingScheme
00005 //
00006 // Implementation:
00007 //     Numbering scheme for crystal calorimeter in 2002 test beam
00008 //
00009 // Original Author:
00010 //         Created:  Sun 21 10:14:34 CEST 2006
00011 // $Id: HcalTB02XtalNumberingScheme.cc,v 1.1 2006/06/04 13:59:38 sunanda Exp $
00012 //
00013   
00014 // system include files
00015   
00016 // user include files
00017 #include "SimG4CMS/HcalTestBeam/interface/HcalTB02XtalNumberingScheme.h"
00018 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00019 
00020 //
00021 // constructors and destructor
00022 //
00023 
00024 HcalTB02XtalNumberingScheme::HcalTB02XtalNumberingScheme() : 
00025   HcalTB02NumberingScheme() {
00026   edm::LogInfo("HcalTBSim") << "Creating HcalTB02XtalNumberingScheme";
00027 }
00028 
00029 HcalTB02XtalNumberingScheme::~HcalTB02XtalNumberingScheme() {
00030   edm::LogInfo("HcalTBSim") << "Deleting HcalTB02XtalNumberingScheme";
00031 }
00032 
00033 //
00034 // member functions
00035 //
00036  
00037 int HcalTB02XtalNumberingScheme::getUnitID(const G4Step* aStep) const {
00038 
00039   const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
00040   int idx=touch->GetReplicaNumber(0);
00041   int idl=0;
00042   if (touch->GetHistoryDepth() > 0) idl = touch->GetReplicaNumber(1);
00043   int idunit = idl*100 + idx;
00044   LogDebug("HcalTBSim") << "HcalTB02XtalNumberingScheme:: Row " << idl
00045                         << " Column " << idl << " idunit = " << idunit;
00046   return idunit;
00047 }