CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/SimG4CMS/Forward/src/TotemT2OrganizationGem.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     Forward
00004 // Class  :     TotemT2OrganizationGem
00005 //
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author: 
00010 //         Created:  Tue May 16 10:14:34 CEST 2006
00011 // $Id: TotemT2OrganizationGem.cc,v 1.1 2006/05/17 16:18:58 sunanda Exp $
00012 //
00013 
00014 // system include files
00015 
00016 // user include files
00017 #include "SimG4CMS/Forward/interface/TotemT2OrganizationGem.h"
00018 #include "SimG4CMS/Forward/interface/TotemNumberMerger.h"
00019 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00020 
00021 #include "G4VPhysicalVolume.hh"
00022 #include "G4VTouchable.hh" 
00023 
00024 //
00025 // constructors and destructor
00026 //
00027 
00028 TotemT2OrganizationGem :: TotemT2OrganizationGem() :
00029   _needUpdateUnitID(false), _needUpdateData(false),
00030   _currentUnitID(-1), _currentPlane(-1), _currentCSC(-1),
00031   _currentLayer(-1) {
00032   edm::LogInfo("ForwardSim") << "Creating TotemT2OrganizationGem";
00033 }
00034 
00035 TotemT2OrganizationGem :: ~TotemT2OrganizationGem() {
00036 }
00037 
00038 uint32_t TotemT2OrganizationGem :: GetUnitID(const G4Step* aStep) const {
00039   return const_cast<TotemT2OrganizationGem *>(this)->GetUnitID(aStep);
00040 }
00041 
00042 uint32_t TotemT2OrganizationGem :: GetUnitID(const G4Step* aStep) {
00043 
00044  G4VPhysicalVolume* physVol;
00045  uint32_t UNITA = 0;
00046  const G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
00047  int ii =0;
00048  for( ii = 0; ii < touch->GetHistoryDepth(); ii++ ){
00049    physVol = touch->GetVolume(ii);
00050 
00051 #ifdef SCRIVI
00052    LogDebug("ForwardSim") << "physVol=" << physVol->GetName() << ", level=" 
00053                           << ii << ", physVol->GetCopyNo()=" 
00054                           << physVol->GetCopyNo();
00055 #endif
00056    if (physVol->GetName() == "TotemT2gem") _currentDetectorPosition = 3;
00057  }
00058   
00059  physVol= touch->GetVolume(0);
00060   
00061  if(physVol->GetName() == "TotemT2gem")UNITA = 10 + physVol->GetCopyNo()  ;
00062  if(physVol->GetName() == "TotemT2gem_supporto")UNITA =20 +  physVol->GetCopyNo();
00063  if(physVol->GetName() == "TotemT2gem_detector7r")UNITA = 100 + physVol->GetCopyNo() + (touch->GetVolume(2)->GetCopyNo())*1000;
00064  if(physVol->GetName() == "TotemT2gem_HC7r")UNITA = 200 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00065  if(physVol->GetName() == "TotemT2gem_drift7r")UNITA = 300 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00066  if(physVol->GetName() == "TotemT2gem_driftspace7r")UNITA = 400 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00067  if(physVol->GetName() == "TotemT2gem_GEMa7r")UNITA = 500 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00068  if(physVol->GetName() == "TotemT2gem_GEMb7r")UNITA = 600 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00069  if(physVol->GetName() == "TotemT2gem_GEMc7r")UNITA = 700 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00070  if(physVol->GetName() == "TotemT2gem_GAS7r")UNITA = 800 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00071  if(physVol->GetName() == "TotemT2gem_GEMa17r")UNITA = 900 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00072  if(physVol->GetName() == "TotemT2gem_GEMb17r")UNITA = 1000 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00073  if(physVol->GetName() == "TotemT2gem_GEMc17r")UNITA = 1100 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00074  if(physVol->GetName() == "TotemT2gem_GAS17r")UNITA = 1200 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00075  if(physVol->GetName() == "TotemT2gem_GEMa27r")UNITA = 1300 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00076  if(physVol->GetName() == "TotemT2gem_GEMb27r")UNITA = 1400 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00077  if(physVol->GetName() == "TotemT2gem_GEMc27r")UNITA = 1500 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00078  if(physVol->GetName() == "TotemT2gem_GAS27r")UNITA = 1600 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00079  if(physVol->GetName() == "TotemT2gem_strips7r")UNITA = 1700 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00080  if(physVol->GetName() == "TotemT2gem_isol7r")UNITA = 1800 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00081  if(physVol->GetName() == "TotemT2gem_pads7r")UNITA = 1900 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00082  if(physVol->GetName() == "TotemT2gem_HC17r")UNITA = 2000 + touch->GetVolume(1)->GetCopyNo()+ (touch->GetVolume(3)->GetCopyNo())*1000;
00083 
00084  return UNITA;
00085 }