103 createEntryForDoubleSidedModule_(iConfig.getParameter<bool>(
"createEntryForDoubleSidedModule")),
104 theParameterSet( iConfig )
135 <<
"There are " << bareTkGeomPtr->
detIds().size()
136 <<
" dets and "<<bareTkGeomPtr->
detUnitIds().size()
137 <<
" detUnits in the Geometry Record";
140 <<
"double-sided module in addition";
141 else edm::LogInfo(
"TrackerTreeGenerator") <<
"Create one entry for each physical module, do NOT create additional entry for virtual "
142 <<
"double-sided module";
146 std::vector<DetId>::const_iterator iDet;
147 for(iDet = detIdContainer.begin(); iDet != detIdContainer.end(); ++iDet){
149 const DetId& detId = *iDet;
151 const Surface& surface = (&geomDet)->surface();
154 uint32_t rawId = detId.
rawId();
155 tkTreeVar.
rawId = rawId;
160 unsigned int whichHalfBarrel(1), ladderAl(0);
161 if( (rawId>=302056964 && rawId<302059300) || (rawId>=302123268 && rawId<302127140) || (rawId>=302189572 && rawId<302194980) )whichHalfBarrel=2;
163 tkTreeVar.
half = whichHalfBarrel;
166 if(tkTreeVar.
layer==1){
167 if(tkTreeVar.
half==2)ladderAl = tkTreeVar.
rod -5;
168 else if(tkTreeVar.
rod>15)ladderAl = tkTreeVar.
rod -10;
169 else ladderAl = tkTreeVar.
rod;
170 }
else if(tkTreeVar.
layer==2){
171 if(tkTreeVar.
half==2)ladderAl = tkTreeVar.
rod -8;
172 else if(tkTreeVar.
rod>24)ladderAl = tkTreeVar.
rod -16;
173 else ladderAl = tkTreeVar.
rod;
174 }
else if(tkTreeVar.
layer==3){
175 if(tkTreeVar.
half==2)ladderAl = tkTreeVar.
rod -11;
176 else if(tkTreeVar.
rod>33)ladderAl = tkTreeVar.
rod -22;
177 else ladderAl = tkTreeVar.
rod;
179 tkTreeVar.
rodAl = ladderAl;}
182 unsigned int whichHalfCylinder(1), bladeAl(0);
183 if( (rawId>=352394500 && rawId<352406032) || (rawId>=352460036 && rawId<352471568) || (rawId>=344005892 && rawId<344017424) || (rawId>=344071428 && rawId<344082960) )whichHalfCylinder=2;
186 tkTreeVar.
half = whichHalfCylinder;
190 if(tkTreeVar.
half==2)bladeAl = tkTreeVar.
blade -6;
191 else if(tkTreeVar.
blade>18)bladeAl = tkTreeVar.
blade -12;
192 else bladeAl = tkTreeVar.
blade;
196 unsigned int whichHalfShell(1), stringAl(0);
197 if( (rawId>=369120484 && rawId<369120688) || (rawId>=369121540 && rawId<369121776) || (rawId>=369136932 && rawId<369137200) || (rawId>=369137988 && rawId<369138288) ||
198 (rawId>=369153396 && rawId<369153744) || (rawId>=369154436 && rawId<369154800) || (rawId>=369169844 && rawId<369170256) || (rawId>=369170900 && rawId<369171344) ||
199 (rawId>=369124580 && rawId<369124784) || (rawId>=369125636 && rawId<369125872) || (rawId>=369141028 && rawId<369141296) || (rawId>=369142084 && rawId<369142384) ||
200 (rawId>=369157492 && rawId<369157840) || (rawId>=369158532 && rawId<369158896) || (rawId>=369173940 && rawId<369174352) || (rawId>=369174996 && rawId<369175440) ) whichHalfShell=2;
203 tkTreeVar.
half = whichHalfShell;
209 if(tkTreeVar.
half==2){
210 if(tkTreeVar.
layer==1){
212 else if(tkTreeVar.
outerInner==2)stringAl = tkTreeVar.
rod -15;
214 if(tkTreeVar.
layer==2){
216 else if(tkTreeVar.
outerInner==2)stringAl = tkTreeVar.
rod -19;
218 if(tkTreeVar.
layer==3){
220 else if(tkTreeVar.
outerInner==2)stringAl = tkTreeVar.
rod -23;
222 if(tkTreeVar.
layer==4){
224 else if(tkTreeVar.
outerInner==2)stringAl = tkTreeVar.
rod -28;
227 else stringAl = tkTreeVar.
rod;
228 tkTreeVar.
rodAl = stringAl;}
241 tkTreeVar.
side = tobId.
rod()[0];
242 tkTreeVar.
rod = tobId.
rod()[1];
258 LocalPoint lPModule(0.,0.,0.), lUDirection(1.,0.,0.), lVDirection(0.,1.,0.), lWDirection(0.,0.,1.);
260 gUDirection = surface.
toGlobal(lUDirection),
261 gVDirection = surface.
toGlobal(lVDirection),
262 gWDirection = surface.
toGlobal(lWDirection);
263 double dR(999.),
dPhi(999.), dZ(999.);
266 dR = gWDirection.perp() - gPModule.
perp();
268 dZ = gVDirection.z() - gPModule.
z();
273 dR = gUDirection.perp() - gPModule.
perp();
275 dZ = gWDirection.z() - gPModule.
z();
280 dR = gVDirection.perp() - gPModule.
perp();
282 dZ = gWDirection.z() - gPModule.
z();
290 tkTreeVar.
posX = gPModule.
x();
291 tkTreeVar.
posY = gPModule.
y();
292 tkTreeVar.
posZ = gPModule.
z();
295 if(dynamic_cast<const StripGeomDetUnit*>(&geomDet)){
322 UInt_t rawId(999), subdetId(999), layer(999), side(999), half(999), rod(999),
ring(999), petal(999),
323 blade(999), panel(999), outerInner(999),
module(999), rodAl(999), bladeAl(999), nStrips(999);
324 Bool_t isDoubleSide(
false), isRPhi(
false);
325 Int_t uDirection(999), vDirection(999), wDirection(999);
326 Float_t posR(999.
F), posPhi(999.
F), posEta(999.
F), posX(999.
F), posY(999.
F), posZ(999.
F);
330 trackerTree = treeDir.
make<TTree>(
"TrackerTree",
"IDs of all modules (ideal geometry)");
331 trackerTree->Branch(
"RawId", &rawId,
"RawId/i");
332 trackerTree->Branch(
"SubdetId", &subdetId,
"SubdetId/i");
333 trackerTree->Branch(
"Layer", &layer,
"Layer/i");
334 trackerTree->Branch(
"Side", &side,
"Side/i");
335 trackerTree->Branch(
"Half", &half,
"Half/i");
336 trackerTree->Branch(
"Rod", &rod,
"Rod/i");
337 trackerTree->Branch(
"Ring", &
ring,
"Ring/i");
338 trackerTree->Branch(
"Petal", &petal,
"Petal/i");
339 trackerTree->Branch(
"Blade", &blade,
"Blade/i");
340 trackerTree->Branch(
"Panel", &panel,
"Panel/i");
341 trackerTree->Branch(
"OuterInner", &outerInner,
"OuterInner/i");
342 trackerTree->Branch(
"Module", &
module,
"Module/i");
343 trackerTree->Branch(
"RodAl", &rodAl,
"RodAl/i");
344 trackerTree->Branch(
"BladeAl", &bladeAl,
"BladeAl/i");
345 trackerTree->Branch(
"NStrips", &nStrips,
"NStrips/i");
346 trackerTree->Branch(
"IsDoubleSide", &isDoubleSide,
"IsDoubleSide/O");
347 trackerTree->Branch(
"IsRPhi", &isRPhi,
"IsRPhi/O");
348 trackerTree->Branch(
"UDirection", &uDirection,
"UDirection/I");
349 trackerTree->Branch(
"VDirection", &vDirection,
"VDirection/I");
350 trackerTree->Branch(
"WDirection", &wDirection,
"WDirection/I");
351 trackerTree->Branch(
"PosR", &posR,
"PosR/F");
352 trackerTree->Branch(
"PosPhi", &posPhi,
"PosPhi/F");
353 trackerTree->Branch(
"PosEta", &posEta,
"PosEta/F");
354 trackerTree->Branch(
"PosX", &posX,
"PosX/F");
355 trackerTree->Branch(
"PosY", &posY,
"PosY/F");
356 trackerTree->Branch(
"PosZ", &posZ,
"PosZ/F");
358 for(std::vector<TrackerTreeVariables>::const_iterator iTree =
vTkTreeVar_.begin(); iTree !=
vTkTreeVar_.end(); ++iTree){
359 rawId = (*iTree).rawId;
360 subdetId = (*iTree).subdetId;
361 layer = (*iTree).layer;
362 side = (*iTree).side;
363 half = (*iTree).half;
365 ring = (*iTree).ring;
366 petal = (*iTree).petal;
367 blade = (*iTree).blade;
368 panel = (*iTree).panel;
369 outerInner = (*iTree).outerInner;
371 rodAl = (*iTree).rodAl;
372 bladeAl = (*iTree).bladeAl;
373 nStrips = (*iTree).nStrips;
374 isDoubleSide = (*iTree).isDoubleSide;
375 isRPhi = (*iTree).isRPhi;
376 uDirection = (*iTree).uDirection;
377 vDirection = (*iTree).vDirection;
378 wDirection = (*iTree).wDirection;
379 posR = (*iTree).posR;
380 posPhi = (*iTree).posPhi;
381 posEta = (*iTree).posEta;
382 posX = (*iTree).posX;
383 posY = (*iTree).posY;
384 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)
Geom::Phi< T > phi() const
edm::ParameterSet theParameterSet
unsigned int ladder() const
ladder id
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
virtual const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
std::vector< unsigned int > petal() const
petal id
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
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp)
const bool createEntryForDoubleSidedModule_
virtual const DetIdContainer & detUnitIds() const
Returm a vector of all GeomDetUnit DetIds.
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
virtual const TrackerGeomDet * idToDet(DetId) const
std::vector< DetId > DetIdContainer