104 createEntryForDoubleSidedModule_(iConfig.getParameter<bool>(
"createEntryForDoubleSidedModule")),
105 theParameterSet( iConfig )
141 <<
"There are " << bareTkGeomPtr->
detIds().size()
142 <<
" dets and "<<bareTkGeomPtr->
detUnitIds().size()
143 <<
" detUnits in the Geometry Record";
146 <<
"double-sided module in addition";
147 else edm::LogInfo(
"TrackerTreeGenerator") <<
"Create one entry for each physical module, do NOT create additional entry for virtual "
148 <<
"double-sided module";
152 std::vector<DetId>::const_iterator iDet;
153 for(iDet = detIdContainer.begin(); iDet != detIdContainer.end(); ++iDet){
155 const DetId& detId = *iDet;
157 const Surface& surface = (&geomDet)->surface();
160 uint32_t rawId = detId.
rawId();
161 tkTreeVar.
rawId = rawId;
166 unsigned int whichHalfBarrel(1), ladderAl(0);
167 if( (rawId>=302056964 && rawId<302059300) || (rawId>=302123268 && rawId<302127140) || (rawId>=302189572 && rawId<302194980) )whichHalfBarrel=2;
169 tkTreeVar.
half = whichHalfBarrel;
172 if(tkTreeVar.
layer==1){
173 if(tkTreeVar.
half==2)ladderAl = tkTreeVar.
rod -5;
174 else if(tkTreeVar.
rod>15)ladderAl = tkTreeVar.
rod -10;
175 else ladderAl = tkTreeVar.
rod;
176 }
else if(tkTreeVar.
layer==2){
177 if(tkTreeVar.
half==2)ladderAl = tkTreeVar.
rod -8;
178 else if(tkTreeVar.
rod>24)ladderAl = tkTreeVar.
rod -16;
179 else ladderAl = tkTreeVar.
rod;
180 }
else if(tkTreeVar.
layer==3){
181 if(tkTreeVar.
half==2)ladderAl = tkTreeVar.
rod -11;
182 else if(tkTreeVar.
rod>33)ladderAl = tkTreeVar.
rod -22;
183 else ladderAl = tkTreeVar.
rod;
185 tkTreeVar.
rodAl = ladderAl;}
188 unsigned int whichHalfCylinder(1), bladeAl(0);
189 if( (rawId>=352394500 && rawId<352406032) || (rawId>=352460036 && rawId<352471568) || (rawId>=344005892 && rawId<344017424) || (rawId>=344071428 && rawId<344082960) )whichHalfCylinder=2;
192 tkTreeVar.
half = whichHalfCylinder;
196 if(tkTreeVar.
half==2)bladeAl = tkTreeVar.
blade -6;
197 else if(tkTreeVar.
blade>18)bladeAl = tkTreeVar.
blade -12;
198 else bladeAl = tkTreeVar.
blade;
202 unsigned int whichHalfShell(1), stringAl(0);
203 if( (rawId>=369120484 && rawId<369120688) || (rawId>=369121540 && rawId<369121776) || (rawId>=369136932 && rawId<369137200) || (rawId>=369137988 && rawId<369138288) ||
204 (rawId>=369153396 && rawId<369153744) || (rawId>=369154436 && rawId<369154800) || (rawId>=369169844 && rawId<369170256) || (rawId>=369170900 && rawId<369171344) ||
205 (rawId>=369124580 && rawId<369124784) || (rawId>=369125636 && rawId<369125872) || (rawId>=369141028 && rawId<369141296) || (rawId>=369142084 && rawId<369142384) ||
206 (rawId>=369157492 && rawId<369157840) || (rawId>=369158532 && rawId<369158896) || (rawId>=369173940 && rawId<369174352) || (rawId>=369174996 && rawId<369175440) ) whichHalfShell=2;
209 tkTreeVar.
half = whichHalfShell;
215 if(tkTreeVar.
half==2){
216 if(tkTreeVar.
layer==1){
218 else if(tkTreeVar.
outerInner==2)stringAl = tkTreeVar.
rod -15;
220 if(tkTreeVar.
layer==2){
222 else if(tkTreeVar.
outerInner==2)stringAl = tkTreeVar.
rod -19;
224 if(tkTreeVar.
layer==3){
226 else if(tkTreeVar.
outerInner==2)stringAl = tkTreeVar.
rod -23;
228 if(tkTreeVar.
layer==4){
230 else if(tkTreeVar.
outerInner==2)stringAl = tkTreeVar.
rod -28;
233 else stringAl = tkTreeVar.
rod;
234 tkTreeVar.
rodAl = stringAl;}
247 tkTreeVar.
side = tobId.
rod()[0];
248 tkTreeVar.
rod = tobId.
rod()[1];
264 LocalPoint lPModule(0.,0.,0.), lUDirection(1.,0.,0.), lVDirection(0.,1.,0.), lWDirection(0.,0.,1.);
266 gUDirection = surface.
toGlobal(lUDirection),
267 gVDirection = surface.
toGlobal(lVDirection),
268 gWDirection = surface.
toGlobal(lWDirection);
269 double dR(999.),
dPhi(999.), dZ(999.);
272 dR = gWDirection.perp() - gPModule.
perp();
274 dZ = gVDirection.z() - gPModule.
z();
279 dR = gUDirection.perp() - gPModule.
perp();
281 dZ = gWDirection.z() - gPModule.
z();
286 dR = gVDirection.perp() - gPModule.
perp();
288 dZ = gWDirection.z() - gPModule.
z();
296 tkTreeVar.
posX = gPModule.
x();
297 tkTreeVar.
posY = gPModule.
y();
298 tkTreeVar.
posZ = gPModule.
z();
301 if(dynamic_cast<const StripGeomDetUnit*>(&geomDet)){
328 UInt_t rawId(999), subdetId(999), layer(999), side(999), half(999), rod(999),
ring(999), petal(999),
329 blade(999), panel(999), outerInner(999),
module(999), rodAl(999), bladeAl(999), nStrips(999);
330 Bool_t isDoubleSide(
false), isRPhi(
false);
331 Int_t uDirection(999), vDirection(999), wDirection(999);
332 Float_t posR(999.
F), posPhi(999.
F), posEta(999.
F), posX(999.
F), posY(999.
F), posZ(999.
F);
336 trackerTree = treeDir.
make<TTree>(
"TrackerTree",
"IDs of all modules (ideal geometry)");
337 trackerTree->Branch(
"RawId", &rawId,
"RawId/i");
338 trackerTree->Branch(
"SubdetId", &subdetId,
"SubdetId/i");
339 trackerTree->Branch(
"Layer", &layer,
"Layer/i");
340 trackerTree->Branch(
"Side", &side,
"Side/i");
341 trackerTree->Branch(
"Half", &half,
"Half/i");
342 trackerTree->Branch(
"Rod", &rod,
"Rod/i");
343 trackerTree->Branch(
"Ring", &
ring,
"Ring/i");
344 trackerTree->Branch(
"Petal", &petal,
"Petal/i");
345 trackerTree->Branch(
"Blade", &blade,
"Blade/i");
346 trackerTree->Branch(
"Panel", &panel,
"Panel/i");
347 trackerTree->Branch(
"OuterInner", &outerInner,
"OuterInner/i");
348 trackerTree->Branch(
"Module", &
module,
"Module/i");
349 trackerTree->Branch(
"RodAl", &rodAl,
"RodAl/i");
350 trackerTree->Branch(
"BladeAl", &bladeAl,
"BladeAl/i");
351 trackerTree->Branch(
"NStrips", &nStrips,
"NStrips/i");
352 trackerTree->Branch(
"IsDoubleSide", &isDoubleSide,
"IsDoubleSide/O");
353 trackerTree->Branch(
"IsRPhi", &isRPhi,
"IsRPhi/O");
354 trackerTree->Branch(
"UDirection", &uDirection,
"UDirection/I");
355 trackerTree->Branch(
"VDirection", &vDirection,
"VDirection/I");
356 trackerTree->Branch(
"WDirection", &wDirection,
"WDirection/I");
357 trackerTree->Branch(
"PosR", &posR,
"PosR/F");
358 trackerTree->Branch(
"PosPhi", &posPhi,
"PosPhi/F");
359 trackerTree->Branch(
"PosEta", &posEta,
"PosEta/F");
360 trackerTree->Branch(
"PosX", &posX,
"PosX/F");
361 trackerTree->Branch(
"PosY", &posY,
"PosY/F");
362 trackerTree->Branch(
"PosZ", &posZ,
"PosZ/F");
364 for(std::vector<TrackerTreeVariables>::const_iterator iTree =
vTkTreeVar_.begin(); iTree !=
vTkTreeVar_.end(); ++iTree){
365 rawId = (*iTree).rawId;
366 subdetId = (*iTree).subdetId;
367 layer = (*iTree).layer;
368 side = (*iTree).side;
369 half = (*iTree).half;
371 ring = (*iTree).ring;
372 petal = (*iTree).petal;
373 blade = (*iTree).blade;
374 panel = (*iTree).panel;
375 outerInner = (*iTree).outerInner;
377 rodAl = (*iTree).rodAl;
378 bladeAl = (*iTree).bladeAl;
379 nStrips = (*iTree).nStrips;
380 isDoubleSide = (*iTree).isDoubleSide;
381 isRPhi = (*iTree).isRPhi;
382 uDirection = (*iTree).uDirection;
383 vDirection = (*iTree).vDirection;
384 wDirection = (*iTree).wDirection;
385 posR = (*iTree).posR;
386 posPhi = (*iTree).posPhi;
387 posEta = (*iTree).posEta;
388 posX = (*iTree).posX;
389 posY = (*iTree).posY;
390 posZ = (*iTree).posZ;
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
virtual int nstrips() const =0
bool isDoubleSide() const
unsigned int panel() const
panel id
unsigned int layer() const
layer id
TrackerTreeGenerator(const edm::ParameterSet &)
bool isDoubleSide() const
#define DEFINE_FWK_MODULE(type)
edm::ParameterSet theParameterSet
unsigned int ladder() const
ladder id
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp, const TrackerTopology *tTopo)
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
std::vector< unsigned int > string() const
string id
unsigned int module() const
det id
unsigned int layer() const
layer id
unsigned int side() const
positive or negative id
std::vector< unsigned int > rod() const
rod id
unsigned int blade() const
blade id
uint32_t rawId() const
get the raw id
std::vector< unsigned int > petal() const
petal id
const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
double dPhi(double phi1, double phi2)
virtual void analyze(const edm::Event &, const edm::EventSetup &)
unsigned int ring() const
ring id
unsigned int module() const
det id
unsigned int module() const
det id
std::vector< unsigned int > module() const
det id
T * make(const Args &...args) const
make new ROOT object
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
unsigned int disk() const
disk id
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
unsigned int module() const
detector id
edm::Service< TFileService > fileService
unsigned int side() const
positive or negative id
T const * product() const
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
const bool createEntryForDoubleSidedModule_
unsigned int ring() const
ring id
std::vector< TrackerTreeVariables > vTkTreeVar_
bool isDoubleSide() const
unsigned int side() const
positive or negative id
unsigned int module() const
detector id
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
bool isDoubleSide() const
unsigned int wheel() const
wheel id
const TrackerGeomDet * idToDet(DetId) const
std::vector< DetId > DetIdContainer