98 |
|
|
99 |
|
|
100 |
|
MySimEvents* MyEvents; |
101 |
< |
Geometry* Geom; |
101 |
> |
Geometry* Geom_Tracker; |
102 |
> |
Geometry* Geom_ECAL; |
103 |
> |
Geometry* Geom_HCAL; |
104 |
|
|
105 |
|
|
106 |
|
std::vector<std::string> SimHitSubdetectors; |
133 |
|
DetId Detid; |
134 |
|
int SubDet; |
135 |
|
|
136 |
< |
MyEvents = new MySimEvents(); |
137 |
< |
Geom = new Geometry(); |
136 |
> |
MyEvents = new MySimEvents(); |
137 |
> |
Geom_Tracker = new Geometry(); |
138 |
> |
Geom_ECAL = new Geometry(); |
139 |
> |
Geom_HCAL = new Geometry(); |
140 |
> |
|
141 |
|
|
142 |
|
edm::ESHandle<TrackerGeometry> tkGeom; |
143 |
|
iSetup.get<TrackerDigiGeometryRecord>().get( tkGeom ); |
178 |
|
|
179 |
|
GlobalVector Pos = GlobalVector(DetUnit->position().basicVector()); |
180 |
|
|
181 |
< |
Geom->Add_TrackerDet(Detid.rawId(), TrapezoidalParam, |
181 |
> |
Geom_Tracker->Add_TrackerDet(Detid.rawId(), TrapezoidalParam, |
182 |
|
Pos.x(), Pos.y(), Pos.z(), |
183 |
|
WidthVector.x() -Pos.x(), WidthVector.y() -Pos.y(), WidthVector.z() -Pos.z(), |
184 |
|
LengthVector.x()-Pos.x(), LengthVector.y()-Pos.y(), LengthVector.z()-Pos.z(), |
198 |
|
{ |
199 |
|
Detid = CaloDets[i]; |
200 |
|
SubDet = Detid.subdetId(); |
196 |
– |
|
197 |
– |
if(Detid.det()!=DetId::Ecal) continue; |
201 |
|
|
202 |
< |
//EcalBarrel=1, EcalEndcap=2, EcalPreshower=3, EcalTriggerTower=4, EcalLaserPnDiode=5 |
203 |
< |
if(SubDet!=EcalBarrel)continue; |
202 |
> |
Geometry* Geom_temp = NULL; |
203 |
> |
if(Detid.det()==DetId::Ecal){ |
204 |
> |
Geom_temp = Geom_ECAL; |
205 |
> |
|
206 |
> |
if(SubDet<1 || SubDet>3){ |
207 |
> |
printf("Don't Save EcalTriggerTower or EcalLaserPnDiode\n"); |
208 |
> |
continue; |
209 |
> |
} |
210 |
> |
}else if(Detid.det()==DetId::Hcal){ |
211 |
> |
Geom_temp = Geom_HCAL; |
212 |
> |
|
213 |
> |
if(SubDet<1 || SubDet>4){ |
214 |
> |
printf("Don't Save HcalEmpty, HcalTriggerTower, HcalOther\n"); |
215 |
> |
continue; |
216 |
> |
} |
217 |
> |
}else{ |
218 |
> |
continue; |
219 |
> |
} |
220 |
|
|
221 |
|
const CaloCellGeometry* CellGeom = CaloGeom->getGeometry(Detid); |
222 |
|
GlobalPoint CellPos = CellGeom->getPosition(); |
204 |
– |
|
223 |
|
const CaloCellGeometry::CornersVec CellCorners = CellGeom->getCorners(); |
224 |
< |
|
225 |
< |
printf("Det = %i Subdet = %i --> %6.2f %6.2f %6.2f - %i\n", Detid.det(), SubDet, CellPos.x(), CellPos.y(), CellPos.z(), CellCorners.size()); |
224 |
> |
|
225 |
> |
Geom_temp->Add_CaloDet(Detid.rawId(), |
226 |
> |
CellPos.x() , CellPos.y() , CellPos.z(), |
227 |
> |
CellCorners[0].x() , CellCorners[0].y() , CellCorners[0].z() , |
228 |
> |
CellCorners[1].x() , CellCorners[1].y() , CellCorners[1].z() , |
229 |
> |
CellCorners[2].x() , CellCorners[2].y() , CellCorners[2].z() , |
230 |
> |
CellCorners[3].x() , CellCorners[3].y() , CellCorners[3].z() , |
231 |
> |
CellCorners[4].x() , CellCorners[4].y() , CellCorners[4].z() , |
232 |
> |
CellCorners[5].x() , CellCorners[5].y() , CellCorners[5].z() , |
233 |
> |
CellCorners[6].x() , CellCorners[6].y() , CellCorners[6].z() , |
234 |
> |
CellCorners[7].x() , CellCorners[7].y() , CellCorners[7].z() ); |
235 |
|
} |
236 |
|
|
237 |
+ |
Geom_Tracker->Save("Tracker.geom"); |
238 |
+ |
Geom_ECAL->Save("ECAL.geom"); |
239 |
+ |
Geom_HCAL->Save("HCAL.geom"); |
240 |
|
|
211 |
– |
Geom->Save("Tracker.geom"); |
241 |
|
|
242 |
|
|
243 |
|
} |