118 const auto& ns = alignableTracker.trackerNameSpace();
120 edm::LogInfo(
"TrackerTreeGenerator") <<
"@SUB=TrackerTreeGenerator::analyze" 121 <<
"There are " << tkGeom->
detIds().size() <<
" dets and " 122 << tkGeom->
detUnitIds().size() <<
" detUnits in the Geometry Record";
125 edm::LogInfo(
"TrackerTreeGenerator") <<
"@SUB=TrackerTreeGenerator::analyze" 126 <<
"Create entry for each module AND one entry for virtual " 127 <<
"double-sided module in addition";
129 edm::LogInfo(
"TrackerTreeGenerator") <<
"@SUB=TrackerTreeGenerator::analyze" 130 <<
"Create one entry for each physical module, do NOT create additional " 131 <<
"entry for virtual double-sided module";
134 for (
const auto& detId : tkGeom->
detIds()) {
139 const auto rawId = detId.
rawId();
140 tkTreeVar.
rawId = rawId;
141 tkTreeVar.
subdetId = detId.subdetId();
145 tkTreeVar.
layer = tTopo->pxbLayer(detId);
146 tkTreeVar.
half = ns.tpb().halfBarrelNumber(rawId);
147 tkTreeVar.
rod = tTopo->pxbLadder(detId);
148 tkTreeVar.
module = tTopo->pxbModule(detId);
151 tkTreeVar.
layer = tTopo->pxfDisk(detId);
152 tkTreeVar.
side = tTopo->pxfSide(detId);
153 tkTreeVar.
half = ns.tpe().halfCylinderNumber(rawId);
154 tkTreeVar.
blade = tTopo->pxfBlade(detId);
155 tkTreeVar.
panel = tTopo->pxfPanel(detId);
156 tkTreeVar.
module = tTopo->pxfModule(detId);
159 tkTreeVar.
layer = tTopo->tibLayer(detId);
160 tkTreeVar.
side = tTopo->tibStringInfo(detId)[0];
161 tkTreeVar.
half = ns.tib().halfShellNumber(rawId);
162 tkTreeVar.
rod = tTopo->tibStringInfo(detId)[2];
163 tkTreeVar.
outerInner = tTopo->tibStringInfo(detId)[1];
164 tkTreeVar.
module = tTopo->tibModule(detId);
166 tkTreeVar.
isRPhi = tTopo->tibIsRPhi(detId);
167 tkTreeVar.
isStereo = tTopo->tibIsStereo(detId);
170 tkTreeVar.
layer = tTopo->tidWheel(detId);
171 tkTreeVar.
side = tTopo->tidSide(detId);
172 tkTreeVar.
ring = tTopo->tidRing(detId);
173 tkTreeVar.
outerInner = tTopo->tidModuleInfo(detId)[0];
174 tkTreeVar.
module = tTopo->tidModuleInfo(detId)[1];
176 tkTreeVar.
isRPhi = tTopo->tidIsRPhi(detId);
177 tkTreeVar.
isStereo = tTopo->tidIsStereo(detId);
180 tkTreeVar.
layer = tTopo->tobLayer(detId);
181 tkTreeVar.
side = tTopo->tobRodInfo(detId)[0];
182 tkTreeVar.
rod = tTopo->tobRodInfo(detId)[1];
183 tkTreeVar.
module = tTopo->tobModule(detId);
185 tkTreeVar.
isRPhi = tTopo->tobIsRPhi(detId);
186 tkTreeVar.
isStereo = tTopo->tobIsStereo(detId);
189 tkTreeVar.
layer = tTopo->tecWheel(detId);
190 tkTreeVar.
side = tTopo->tecSide(detId);
191 tkTreeVar.
ring = tTopo->tecRing(detId);
192 tkTreeVar.
petal = tTopo->tecPetalInfo(detId)[1];
193 tkTreeVar.
outerInner = tTopo->tecPetalInfo(detId)[0];
194 tkTreeVar.
module = tTopo->tecModule(detId);
196 tkTreeVar.
isRPhi = tTopo->tecIsRPhi(detId);
197 tkTreeVar.
isStereo = tTopo->tecIsStereo(detId);
201 LocalPoint lPModule(0., 0., 0.), lUDirection(1., 0., 0.), lVDirection(0., 1., 0.), lWDirection(0., 0., 1.);
203 gVDirection = surface.
toGlobal(lVDirection), gWDirection = surface.
toGlobal(lWDirection);
204 double dR(999.),
dPhi(999.), dZ(999.);
209 dR = gWDirection.perp() - gPModule.
perp();
211 dZ = gVDirection.z() - gPModule.
z();
217 dR = gUDirection.perp() - gPModule.
perp();
219 dZ = gWDirection.z() - gPModule.
z();
226 dR = gVDirection.perp() - gPModule.
perp();
228 dZ = gWDirection.z() - gPModule.
z();
237 tkTreeVar.
posX = gPModule.
x();
238 tkTreeVar.
posY = gPModule.
y();
239 tkTreeVar.
posZ = gPModule.
z();
241 if (
auto stripGeomDetUnit = dynamic_cast<const StripGeomDetUnit*>(&geomDet)) {
247 auto& topol =
dynamic_cast<const StripTopology&
>(stripGeomDetUnit->specificTopology());
248 tkTreeVar.
nStrips = topol.nstrips();
267 UInt_t rawId(999), subdetId(999), layer(999), side(999), half(999), rod(999),
ring(999), petal(999), blade(999),
269 Bool_t isDoubleSide(
false), isRPhi(
false), isStereo(
false);
270 Int_t uDirection(999), vDirection(999), wDirection(999);
271 Float_t posR(999.
F), posPhi(999.
F), posEta(999.
F),
posX(999.
F),
posY(999.
F), posZ(999.
F);
275 auto trackerTree{treeDir.
make<TTree>(
"TrackerTree",
"IDs of all modules (ideal geometry)")};
277 trackerTree->Branch(
"SubdetId", &subdetId,
"SubdetId/i");
286 trackerTree->Branch(
"OuterInner", &outerInner,
"OuterInner/i");
288 trackerTree->Branch(
"NStrips", &nStrips,
"NStrips/i");
289 trackerTree->Branch(
"IsDoubleSide", &isDoubleSide,
"IsDoubleSide/O");
290 trackerTree->Branch(
"IsRPhi", &isRPhi,
"IsRPhi/O");
291 trackerTree->Branch(
"IsStereo", &isStereo,
"IsStereo/O");
292 trackerTree->Branch(
"UDirection", &uDirection,
"UDirection/I");
293 trackerTree->Branch(
"VDirection", &vDirection,
"VDirection/I");
294 trackerTree->Branch(
"WDirection", &wDirection,
"WDirection/I");
296 trackerTree->Branch(
"PosPhi", &posPhi,
"PosPhi/F");
297 trackerTree->Branch(
"PosEta", &posEta,
"PosEta/F");
304 subdetId = iTree.subdetId;
313 outerInner = iTree.outerInner;
315 nStrips = iTree.nStrips;
316 isDoubleSide = iTree.isDoubleSide;
317 isRPhi = iTree.isRPhi;
318 isStereo = iTree.isStereo;
319 uDirection = iTree.uDirection;
320 vDirection = iTree.vDirection;
321 wDirection = iTree.wDirection;
323 posPhi = iTree.posPhi;
324 posEta = iTree.posEta;
331 edm::LogInfo(
"TrackerTreeGenerator") <<
"@SUB=TrackerTreeGenerator::endJob" 332 <<
"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
static constexpr auto TEC
TrackerTreeGenerator(const edm::ParameterSet &)
~TrackerTreeGenerator() override=default
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
edm::ParameterSet config_
const Plane & surface() const
The nominal surface of the GeomDet.
void analyze(const edm::Event &, const edm::EventSetup &) override
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
#define DEFINE_FWK_MODULE(type)
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
static constexpr auto TOB
static constexpr auto TIB
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
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)
static constexpr auto TID
T const * product() const