SimG4CMS
PPS
src
PPSPixelOrganization.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: PPS
4
// Class : PPSPixelOrganization
5
//
6
// Implementation:
7
// <Notes on implementation>
8
//
9
10
// user include files
11
#include "
SimG4CMS/PPS/interface/PPSPixelOrganization.h
"
12
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
13
#include "
DataFormats/CTPPSDetId/interface/CTPPSPixelDetId.h
"
14
#include "G4VPhysicalVolume.hh"
15
#include "G4VTouchable.hh"
16
17
//
18
// constructors and destructor
19
//
20
PPSPixelOrganization ::PPSPixelOrganization
()
21
: currentUnitID_(-1), currentArm_(-1), currentStation_(-1), currentRP_(-1), currentPlane_(-1) {
22
edm::LogInfo
(
"PPSSim"
) <<
"Creating PPSPixelOrganization"
;
23
}
24
25
//
26
// member functions
27
//
28
29
uint32_t
PPSPixelOrganization ::unitID
(
const
G4Step* aStep) {
30
const
G4VTouchable* touch = aStep->GetPreStepPoint()->GetTouchable();
31
G4VPhysicalVolume* physVol;
32
int
ii
= 0;
33
34
for
(
ii
= 0;
ii
< touch->GetHistoryDepth();
ii
++) {
35
physVol = touch->GetVolume(
ii
);
36
37
edm::LogInfo
(
"PPSSim"
) <<
"physVol="
<< physVol->GetName() <<
", level="
<<
ii
38
<<
", physVol->GetCopyNo()="
<< physVol->GetCopyNo();
39
40
if
(physVol->GetName().contains(
"Envelop"
)) {
41
currentPlane_
= physVol->GetCopyNo() - 1;
42
}
else
if
(physVol->GetName() ==
"RP_box_primary_vacuum"
) {
43
int
cpy_no = physVol->GetCopyNo();
44
currentArm_
= (cpy_no / 100) % 10;
45
currentStation_
= (cpy_no / 10) % 10;
46
currentRP_
= cpy_no % 10;
47
}
48
}
49
50
edm::LogInfo
(
"PPSSim"
) <<
currentArm_
<<
" "
<<
currentRP_
<<
" "
<<
currentPlane_
;
51
52
CTPPSPixelDetId
id
(
currentArm_
,
currentStation_
,
currentRP_
,
currentPlane_
);
53
uint32_t
kk
=
id
.rawId();
54
edm::LogInfo
(
"PPSSim"
) <<
" ID "
<<
kk
;
55
return
id
.rawId();
56
}
PPSPixelOrganization::unitID
uint32_t unitID(const G4Step *aStep) override
Definition:
PPSPixelOrganization.cc:29
MessageLogger.h
PPSPixelOrganization::currentArm_
int currentArm_
Definition:
PPSPixelOrganization.h:37
CTPPSPixelDetId.h
edm::LogInfo
Log< level::Info, false > LogInfo
Definition:
MessageLogger.h:125
PPSPixelOrganization::currentRP_
int currentRP_
Definition:
PPSPixelOrganization.h:39
GetRecoTauVFromDQM_MC_cff.kk
kk
Definition:
GetRecoTauVFromDQM_MC_cff.py:84
CTPPSPixelDetId
Definition:
CTPPSPixelDetId.h:16
PPSPixelOrganization::currentStation_
int currentStation_
Definition:
PPSPixelOrganization.h:38
triggerObjects_cff.id
id
Definition:
triggerObjects_cff.py:31
PPSPixelOrganization.h
PPSPixelOrganization::currentPlane_
int currentPlane_
Definition:
PPSPixelOrganization.h:40
PPSPixelOrganization::PPSPixelOrganization
PPSPixelOrganization()
Definition:
PPSPixelOrganization.cc:20
cuy.ii
ii
Definition:
cuy.py:590
Generated for CMSSW Reference Manual by
1.8.16