ProcessHitsMethod.
Process a single energy spot from a frozen shower. The appropriate region of the sensitive detector is calculated and a LArIdentifier is constructed
93 {
94
95
97
100
101
102 Point3D<double> localPosition = globalPosition.z()<0 ? xfNeg*globalPosition : xfPos*globalPosition;
103 Point3D<double> shiftedLocalPosition = localPosition + Point3D<double>(0.0,0.0,
m_emecManager->getFocalToRef()+
m_emecManager->getRefToActive());
104 int zIndex = globalPosition.z()<0 ? 0:1;
105 double eta = shiftedLocalPosition.getEta();
106 double phi = localPosition.getPhi();
107 double z = localPosition.z();
108
111 const EMECDetectorRegion *region = *
e;
113 const EMECDetDescr *regionDescriptor=region->
getDescriptor();
114 const CellBinning & etaBinning=regionDescriptor->
getEtaBinning();
115 if (
eta>etaBinning.getStart() &&
eta<etaBinning.getEnd()) {
116
117 unsigned int etaIndex =
int((
eta - etaBinning.getStart())/etaBinning.getDelta()) + etaBinning.getFirstDivisionNumber();
122 if (
z>zmin &&
z<zmax) {
123 const CellBinning & phiBinning=regionDescriptor->
getPhiBinning();
124 double minPhi=std::min(phiBinning.getStart(), phiBinning.getEnd());
125 double maxPhi=std::max(phiBinning.getStart(), phiBinning.getEnd());
128
131
133 int sWheel =
zIndex==0 ? -wheel: wheel;
134
135
136
137 LArWheelCalculator *wheelCalc=nullptr;
139 int nBins= phiBinning.getNumDivisions();
140 int gapsPerBin = nGaps/
nBins;
141
142
145 }
148 }
151 }
154 }
155 else {
156 throw std::runtime_error("Error, unknown wheel in EndcapFastSimDedicatedSD");
157 }
158
160
161 if (zIndex==0) {
163 if(phiBin < 0) {
165 }
166 }
167
168
169
170
173 << 1
174 << sWheel
175 << samplingIndex
176 << regionIndex
177 << etaIndex
179
181 return;
182 }
183 }
184 }
185
186
187}
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