73 virtual void endJob()
override;
124 const auto& ns = alignableTracker.trackerNameSpace();
127 <<
"@SUB=TrackerTreeGenerator::analyze" 128 <<
"There are " << tkGeom->
detIds().size()
130 <<
" detUnits in the Geometry Record";
134 <<
"@SUB=TrackerTreeGenerator::analyze" 135 <<
"Create entry for each module AND one entry for virtual " 136 <<
"double-sided module in addition";
139 <<
"@SUB=TrackerTreeGenerator::analyze" 140 <<
"Create one entry for each physical module, do NOT create additional " 141 <<
"entry for virtual double-sided module";
144 for (
const auto& detId: tkGeom->
detIds()){
150 const auto rawId = detId.
rawId();
151 tkTreeVar.
rawId = rawId;
152 tkTreeVar.
subdetId = detId.subdetId();
156 tkTreeVar.
layer = tTopo->pxbLayer(detId);
157 tkTreeVar.
half = ns.tpb().halfBarrelNumber(rawId);
158 tkTreeVar.
rod = tTopo->pxbLadder(detId);
159 tkTreeVar.
module = tTopo->pxbModule(detId);
162 tkTreeVar.
layer = tTopo->pxfDisk(detId);
163 tkTreeVar.
side = tTopo->pxfSide(detId);
164 tkTreeVar.
half = ns.tpe().halfCylinderNumber(rawId);
165 tkTreeVar.
blade = tTopo->pxfBlade(detId);
166 tkTreeVar.
panel = tTopo->pxfPanel(detId);
167 tkTreeVar.
module = tTopo->pxfModule(detId);
170 tkTreeVar.
layer = tTopo->tibLayer(detId);
171 tkTreeVar.
side = tTopo->tibStringInfo(detId)[0];
172 tkTreeVar.
half = ns.tib().halfShellNumber(rawId);
173 tkTreeVar.
rod = tTopo->tibStringInfo(detId)[2];
174 tkTreeVar.
outerInner = tTopo->tibStringInfo(detId)[1];
175 tkTreeVar.
module = tTopo->tibModule(detId);
177 tkTreeVar.
isRPhi = tTopo->tibIsRPhi(detId);
178 tkTreeVar.
isStereo = tTopo->tibIsStereo(detId);
181 tkTreeVar.
layer = tTopo->tidWheel(detId);
182 tkTreeVar.
side = tTopo->tidSide(detId);
183 tkTreeVar.
ring = tTopo->tidRing(detId);
184 tkTreeVar.
outerInner = tTopo->tidModuleInfo(detId)[0];
185 tkTreeVar.
module = tTopo->tidModuleInfo(detId)[1];
187 tkTreeVar.
isRPhi = tTopo->tidIsRPhi(detId);
188 tkTreeVar.
isStereo = tTopo->tidIsStereo(detId);
191 tkTreeVar.
layer = tTopo->tobLayer(detId);
192 tkTreeVar.
side = tTopo->tobRodInfo(detId)[0];
193 tkTreeVar.
rod = tTopo->tobRodInfo(detId)[1];
194 tkTreeVar.
module = tTopo->tobModule(detId);
196 tkTreeVar.
isRPhi = tTopo->tobIsRPhi(detId);
197 tkTreeVar.
isStereo = tTopo->tobIsStereo(detId);
200 tkTreeVar.
layer = tTopo->tecWheel(detId);
201 tkTreeVar.
side = tTopo->tecSide(detId);
202 tkTreeVar.
ring = tTopo->tecRing(detId);
203 tkTreeVar.
petal = tTopo->tecPetalInfo(detId)[1];
204 tkTreeVar.
outerInner = tTopo->tecPetalInfo(detId)[0];
205 tkTreeVar.
module = tTopo->tecModule(detId);
207 tkTreeVar.
isRPhi = tTopo->tecIsRPhi(detId);
208 tkTreeVar.
isStereo = tTopo->tecIsStereo(detId);
214 lUDirection(1.,0.,0.),
215 lVDirection(0.,1.,0.),
216 lWDirection(0.,0.,1.);
218 gUDirection = surface.
toGlobal(lUDirection),
219 gVDirection = surface.
toGlobal(lVDirection),
220 gWDirection = surface.
toGlobal(lWDirection);
221 double dR(999.), dPhi(999.), dZ(999.);
226 dR = gWDirection.perp() - gPModule.
perp();
228 dZ = gVDirection.z() - gPModule.
z();
234 dR = gUDirection.perp() - gPModule.
perp();
236 dZ = gWDirection.z() - gPModule.
z();
243 dR = gVDirection.perp() - gPModule.
perp();
245 dZ = gWDirection.z() - gPModule.
z();
254 tkTreeVar.
posX = gPModule.
x();
255 tkTreeVar.
posY = gPModule.
y();
256 tkTreeVar.
posZ = gPModule.
z();
259 if(
auto stripGeomDetUnit = dynamic_cast<const StripGeomDetUnit*>(&geomDet)){
266 dynamic_cast<const StripTopology&
>(stripGeomDetUnit->specificTopology());
267 tkTreeVar.
nStrips = topol.nstrips();
293 UInt_t rawId(999), subdetId(999), layer(999), side(999), half(999), rod(999),
294 ring(999), petal(999), blade(999), panel(999), outerInner(999),
295 module(999), nStrips(999);
296 Bool_t isDoubleSide(
false), isRPhi(
false), isStereo(
false);
297 Int_t uDirection(999), vDirection(999), wDirection(999);
298 Float_t posR(999.
F), posPhi(999.
F), posEta(999.
F),
304 "IDs of all modules (ideal geometry)")};
306 trackerTree->Branch(
"SubdetId", &subdetId,
"SubdetId/i");
315 trackerTree->Branch(
"OuterInner", &outerInner,
"OuterInner/i");
317 trackerTree->Branch(
"NStrips", &nStrips,
"NStrips/i");
318 trackerTree->Branch(
"IsDoubleSide", &isDoubleSide,
"IsDoubleSide/O");
319 trackerTree->Branch(
"IsRPhi", &isRPhi,
"IsRPhi/O");
320 trackerTree->Branch(
"IsStereo", &isStereo,
"IsStereo/O");
321 trackerTree->Branch(
"UDirection", &uDirection,
"UDirection/I");
322 trackerTree->Branch(
"VDirection", &vDirection,
"VDirection/I");
323 trackerTree->Branch(
"WDirection", &wDirection,
"WDirection/I");
325 trackerTree->Branch(
"PosPhi", &posPhi,
"PosPhi/F");
326 trackerTree->Branch(
"PosEta", &posEta,
"PosEta/F");
333 subdetId = iTree.subdetId;
342 outerInner = iTree.outerInner;
344 nStrips = iTree.nStrips;
345 isDoubleSide = iTree.isDoubleSide;
346 isRPhi = iTree.isRPhi;
347 isStereo = iTree.isStereo;
348 uDirection = iTree.uDirection;
349 vDirection = iTree.vDirection;
350 wDirection = iTree.wDirection;
352 posPhi = iTree.posPhi;
353 posEta = iTree.posEta;
361 <<
"@SUB=TrackerTreeGenerator::endJob" 362 <<
"TrackerTree contains "<< vTkTreeVar_.size() <<
" entries overall";
const DetIdContainer & detUnitIds() const override
Returm a vector of all GeomDetUnit DetIds.
static const std::string kSharedResource
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
TrackerTreeGenerator(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
edm::ParameterSet config_
const Plane & surface() const
The nominal surface of the GeomDet.
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
const DetIdContainer & detIds() const override
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
T * make(const Args &...args) const
make new ROOT object
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
virtual void beginJob() override
edm::Service< TFileService > fileService
const bool createEntryForDoubleSidedModule_
const TrackerGeomDet * idToDet(DetId) const override
std::vector< TrackerTreeVariables > vTkTreeVar_
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
T const * product() const
~TrackerTreeGenerator()=default
virtual void endJob() override