ProcessHitsMethod.
Process a single energy spot from a frozen shower. The appropriate region of the sensitive detector is calculated and a LArIdentifier is constructed
88 {
89
90
92
95
96
97 Point3D<double> localPosition = globalPosition.z()<0 ? xfNeg*globalPosition : xfPos*globalPosition;
98 Point3D<double> shiftedLocalPosition = localPosition + Point3D<double>(0.0,0.0,
m_emecManager->getFocalToRef()+
m_emecManager->getRefToActive());
99 int zIndex = globalPosition.z()<0 ? 0:1;
100 double eta = shiftedLocalPosition.getEta();
101 double phi = localPosition.getPhi();
102 double z = localPosition.z();
103
106 const EMECDetectorRegion *region = *
e;
108 const EMECDetDescr *regionDescriptor=region->
getDescriptor();
109 const CellBinning & etaBinning=regionDescriptor->
getEtaBinning();
110 if (
eta>etaBinning.getStart() &&
eta<etaBinning.getEnd()) {
111
112 unsigned int etaIndex =
int((
eta - etaBinning.getStart())/etaBinning.getDelta()) + etaBinning.getFirstDivisionNumber();
117 if (
z>zmin &&
z<zmax) {
118 const CellBinning & phiBinning=regionDescriptor->
getPhiBinning();
119 double minPhi=std::min(phiBinning.getStart(), phiBinning.getEnd());
120 double maxPhi=std::max(phiBinning.getStart(), phiBinning.getEnd());
123
126
128 int sWheel =
zIndex==0 ? -wheel: wheel;
129
130
131
132 LArWheelCalculator *wheelCalc=nullptr;
134 int nBins= phiBinning.getNumDivisions();
135 int gapsPerBin = nGaps/
nBins;
136
137
140 }
143 }
146 }
149 }
150 else {
151 throw std::runtime_error("Error, unknown wheel in EndcapFastSimDedicatedSD");
152 }
153
155
156 if (zIndex==0) {
158 if(phiBin < 0) {
160 }
161 }
162
163
164
165
168 << 1
169 << sWheel
170 << samplingIndex
171 << regionIndex
172 << etaIndex
174
176 return;
177 }
178 }
179 }
180
181
182}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
Eigen::Affine3d Transform3D
GeoIntrusivePtr< const EMECCell > EMECCellConstLink
const CellBinning & getEtaBinning() const
The Binning in Eta.
const CellBinning & getPhiBinning() const
The Binning in Phi.
std::vector< constEMECDetectorRegion * >::const_iterator DetectorRegionConstIterator
EMECCellConstLink getEMECCell(unsigned int ieta, unsigned int iphi) const
Access to Cells.
unsigned int getRadialIndex() const
Returns the Radial (Outer Wheel=0,InnerWheel=1) Index.
unsigned int getRegionIndex() const
Returns the Region Index.
EMECDetectorRegion::DetectorSide getEndcapIndex() const
The endcap index.
const EMECDetDescr * getDescriptor() const
Returns the Descriptor for this region.
unsigned int getSamplingIndex() const
Returns the Sampling Layer Index.
LArG4Identifier m_larID
My LAr identifier.
G4ThreeVector GetPosition() const
G4double GetEnergy() const
G4bool SimpleHit(const LArG4Identifier &lar_id, G4double time, G4double energy)
First method translates to this - also for fast sims.
int GetPhiGap(const CLHEP::Hep3Vector &p) const
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setPhiMap phiBin