CMS 3D CMS Logo

RoadSearchDetIdHelper Class Reference

#include <TrackingTools/RoadSearchHitAccess/interface/RoadSearchDetIdHelper.h>

List of all members.

Public Member Functions

 RoadSearchDetIdHelper ()
 ~RoadSearchDetIdHelper ()

Static Public Member Functions

static bool detIdsOnSameLayer (DetId id1, DetId id2)
static bool IsGluedRPhi (const DetId id)
static bool IsMatched (const DetId id)
static bool IsSingleRPhi (const DetId id)
static bool IsStereo (const DetId id)
static std::string Print (const DetId id)
static DetId ReturnRPhiId (const DetId id)


Detailed Description

Definition at line 32 of file RoadSearchDetIdHelper.h.


Constructor & Destructor Documentation

RoadSearchDetIdHelper::RoadSearchDetIdHelper (  ) 

Definition at line 19 of file RoadSearchDetIdHelper.cc.

00019                                              {
00020 }

RoadSearchDetIdHelper::~RoadSearchDetIdHelper (  ) 

Definition at line 22 of file RoadSearchDetIdHelper.cc.

00022                                               {
00023 }


Member Function Documentation

bool RoadSearchDetIdHelper::detIdsOnSameLayer ( DetId  id1,
DetId  id2 
) [static]

Definition at line 342 of file RoadSearchDetIdHelper.cc.

References PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::rawId(), HLT_VtxMuL3::result, DetId::subdetId(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

00342                                                                   {
00343   //
00344   // check whether two detids are on the same layer
00345   //
00346 
00347   // return value
00348   bool result = false;
00349 
00350   // check if both rings belong to same subdetector
00351   if ( (unsigned int)id1.subdetId() == StripSubdetector::TIB && 
00352        (unsigned int)id2.subdetId() == StripSubdetector::TIB ) {
00353     // make TIBDetId instance
00354     TIBDetId id1TIB(id1.rawId());
00355     TIBDetId id2TIB(id2.rawId());
00356     // check whether both rings are on the same TIB layer
00357     if ( id1TIB.layer() == id2TIB.layer() ) {
00358       result = true;
00359     }
00360   } else if ( (unsigned int)id1.subdetId() == StripSubdetector::TOB &&
00361               (unsigned int)id2.subdetId() == StripSubdetector::TOB ) {
00362     // make TOBDetId instance
00363     TOBDetId id1TOB(id1.rawId());
00364     TOBDetId id2TOB(id2.rawId());
00365     // check whether both rings are on the same TOB layer
00366     if ( id1TOB.layer() == id2TOB.layer() ) {
00367       result = true;
00368     }
00369   } else if ( (unsigned int)id1.subdetId() == StripSubdetector::TID && 
00370               (unsigned int)id2.subdetId() == StripSubdetector::TID) {
00371     // make TIDDetId instance
00372     TIDDetId id1TID(id1.rawId());
00373     TIDDetId id2TID(id2.rawId());
00374     // check whether both rings are on the same TID wheel
00375     if ( id1TID.wheel() == id2TID.wheel() ) {
00376       result = true;
00377     }
00378   } else if ( (unsigned int)id1.subdetId() == StripSubdetector::TEC &&
00379               (unsigned int)id2.subdetId() == StripSubdetector::TEC ) {
00380     // make TECDetId instance
00381     TECDetId id1TEC(id1.rawId());
00382     TECDetId id2TEC(id2.rawId());
00383     // check whether both rings are on the same TEC wheel
00384     if ( id1TEC.wheel() == id2TEC.wheel() ) {
00385       result = true;
00386     }
00387   } else if ( (unsigned int)id1.subdetId() == PixelSubdetector::PixelBarrel && 
00388               (unsigned int)id2.subdetId() == PixelSubdetector::PixelBarrel) {
00389     // make PXBDetId instance
00390     PXBDetId id1PXB(id1.rawId());
00391     PXBDetId id2PXB(id2.rawId());
00392     // check whether both rings are on the same PXB layer
00393     if ( id1PXB.layer() == id2PXB.layer() ) {
00394       result = true;
00395     }
00396   } else if ( (unsigned int)id1.subdetId() == PixelSubdetector::PixelEndcap &&
00397               (unsigned int)id2.subdetId() == PixelSubdetector::PixelEndcap) {
00398     // make PXFDetId instance
00399     PXFDetId id1PXF(id1.rawId());
00400     PXFDetId id2PXF(id2.rawId());
00401     // check whether both rings are on the same PXF disk
00402     if ( id1PXF.disk() == id2PXF.disk() ) {
00403       result = true;
00404     }
00405   }
00406   
00407   return result;
00408 }

bool RoadSearchDetIdHelper::IsGluedRPhi ( const DetId  id  )  [static]

Definition at line 225 of file RoadSearchDetIdHelper.cc.

References SiStripDetId::glued(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::rawId(), HLT_VtxMuL3::result, StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

Referenced by Print().

00225                                                       {
00226 
00227   // return value
00228   bool result = true;
00229 
00230   if ( (unsigned int)id.subdetId() == StripSubdetector::TIB ) {
00231     TIBDetId tibid(id.rawId()); 
00232     if ( !tibid.glued() ) {
00233       result = false;
00234     } else {
00235       if ( (tibid.rawId()-2) != tibid.glued() ) {
00236         result = false;
00237       }
00238     }
00239   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TOB ) {
00240     TOBDetId tobid(id.rawId()); 
00241     if ( !tobid.glued() ) {
00242       result = false;
00243     } else {
00244       if ( (tobid.rawId()-2) != tobid.glued() ) {
00245         result = false;
00246       }
00247     }
00248   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TID ) {
00249     TIDDetId tidid(id.rawId()); 
00250     if ( !tidid.glued() ) {
00251       result = false;
00252     } else {
00253       if ( (tidid.rawId()-2) != tidid.glued() ) {
00254         result = false;
00255       }
00256     }
00257   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TEC ) {
00258     TECDetId tecid(id.rawId()); 
00259     if ( !tecid.glued() ) {
00260       result = false;
00261     } else {
00262       if ( (tecid.rawId()-2) != tecid.glued() ) {
00263         result = false;
00264       }
00265     }
00266   } else if ( (unsigned int)id.subdetId() == PixelSubdetector::PixelBarrel ) {
00267     result = false;
00268   } else if ( (unsigned int)id.subdetId() == PixelSubdetector::PixelEndcap ) {
00269     result = false;
00270   } 
00271 
00272   return result;
00273 }

bool RoadSearchDetIdHelper::IsMatched ( const DetId  id  )  [static]

Definition at line 125 of file RoadSearchDetIdHelper.cc.

References SiStripDetId::glued(), TIBDetId::layer(), TOBDetId::layer(), HLT_VtxMuL3::result, TIDDetId::ring(), TECDetId::ring(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

Referenced by Print(), and ReturnRPhiId().

00125                                                     {
00126 
00127   // return value
00128   bool result = false;
00129 
00130   if ( (unsigned int)id.subdetId() == StripSubdetector::TIB ) {
00131     TIBDetId tibid(id.rawId()); 
00132     if ( !tibid.glued() ) {
00133       if ( tibid.layer() == 1 ||
00134            tibid.layer() == 2 ) {
00135         result = true;
00136       }
00137     }
00138   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TOB ) {
00139     TOBDetId tobid(id.rawId()); 
00140     if ( !tobid.glued() ) {
00141       if ( tobid.layer() == 1 ||
00142            tobid.layer() == 2 ) {
00143         result = true;
00144       }
00145     }
00146   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TID ) {
00147     TIDDetId tidid(id.rawId()); 
00148     if ( !tidid.glued() ) {
00149       if ( tidid.ring() == 1 ||
00150            tidid.ring() == 2 ) {
00151         result = true;
00152       }
00153     }
00154   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TEC ) {
00155     TECDetId tecid(id.rawId()); 
00156     if ( !tecid.glued() ) {
00157       if ( tecid.ring() == 1 ||
00158            tecid.ring() == 2 ||
00159            tecid.ring() == 5 ) {
00160         result = true;
00161       }
00162     }
00163   }
00164 
00165   return result;
00166 }

bool RoadSearchDetIdHelper::IsSingleRPhi ( const DetId  id  )  [static]

Definition at line 168 of file RoadSearchDetIdHelper.cc.

References SiStripDetId::glued(), TIBDetId::layer(), TOBDetId::layer(), DetId::rawId(), HLT_VtxMuL3::result, TIDDetId::ring(), TECDetId::ring(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

Referenced by Print().

00168                                                        {
00169 
00170   // return value
00171   bool result = true;
00172 
00173   if ( (unsigned int)id.subdetId() == StripSubdetector::TIB ) {
00174     TIBDetId tibid(id.rawId()); 
00175     if ( !tibid.glued() ) {
00176       if ( tibid.layer() == 1 ||
00177            tibid.layer() == 2 ) {
00178         result = false;
00179       }
00180     } else {
00181       result = false;
00182     }
00183   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TOB ) {
00184     TOBDetId tobid(id.rawId()); 
00185     if ( !tobid.glued() ) {
00186       if ( tobid.layer() == 1 ||
00187            tobid.layer() == 2 ) {
00188         result = false;
00189       }
00190     } else {
00191       if ( (tobid.rawId()-2) != tobid.glued() ) {
00192         result = false;
00193       }
00194     }
00195   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TID ) {
00196     TIDDetId tidid(id.rawId()); 
00197     if ( !tidid.glued() ) {
00198       if ( tidid.ring() == 1 ||
00199            tidid.ring() == 2 ) {
00200         result = false;
00201       } 
00202     } else {
00203       if ( (tidid.rawId()-2) != tidid.glued() ) {
00204         result = false;
00205       }
00206     }
00207   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TEC ) {
00208     TECDetId tecid(id.rawId()); 
00209     if ( !tecid.glued() ) {
00210       if ( tecid.ring() == 1 ||
00211            tecid.ring() == 2 ||
00212            tecid.ring() == 5 ) {
00213         result = false;
00214       } 
00215     } else {
00216       if ( (tecid.rawId()-2) != tecid.glued() ) {
00217         result = false;
00218       }
00219     }
00220   }
00221 
00222   return result;
00223 }

bool RoadSearchDetIdHelper::IsStereo ( const DetId  id  )  [static]

Definition at line 275 of file RoadSearchDetIdHelper.cc.

References SiStripDetId::glued(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::rawId(), HLT_VtxMuL3::result, StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

Referenced by Print(), and ReturnRPhiId().

00275                                                    {
00276 
00277   // return value
00278   bool result = true;
00279 
00280   if ( (unsigned int)id.subdetId() == StripSubdetector::TIB ) {
00281     TIBDetId tibid(id.rawId()); 
00282     if ( !tibid.glued() ) {
00283       result = false;
00284     } else {
00285       if ( (tibid.rawId()-1) != tibid.glued() ) {
00286         result = false;
00287       }
00288     }
00289   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TOB ) {
00290     TOBDetId tobid(id.rawId()); 
00291     if ( !tobid.glued() ) {
00292       result = false;
00293     } else {
00294       if ( (tobid.rawId()-1) != tobid.glued() ) {
00295         result = false;
00296       }
00297     }
00298   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TID ) {
00299     TIDDetId tidid(id.rawId()); 
00300     if ( !tidid.glued() ) {
00301       result = false;
00302     } else {
00303       if ( (tidid.rawId()-1) != tidid.glued() ) {
00304         result = false;
00305       }
00306     }
00307   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TEC ) {
00308     TECDetId tecid(id.rawId()); 
00309     if ( !tecid.glued() ) {
00310       result = false;
00311     } else {
00312       if ( (tecid.rawId()-1) != tecid.glued() ) {
00313         result = false;
00314       }
00315     }
00316   } else if ( (unsigned int)id.subdetId() == PixelSubdetector::PixelBarrel ) {
00317     result = false;
00318   } else if ( (unsigned int)id.subdetId() == PixelSubdetector::PixelEndcap ) {
00319     result = false;
00320   }
00321 
00322   return result;
00323 }

std::string RoadSearchDetIdHelper::Print ( const DetId  id  )  [static]

Definition at line 25 of file RoadSearchDetIdHelper.cc.

References PXFDetId::blade(), PXFDetId::disk(), lat::endl(), IsGluedRPhi(), IsMatched(), IsSingleRPhi(), IsStereo(), PXBDetId::ladder(), TIBDetId::layer(), TOBDetId::layer(), PXBDetId::layer(), PXFDetId::module(), TOBDetId::module(), PXBDetId::module(), TIDDetId::module(), TECDetId::module(), TIBDetId::module(), output(), TECDetId::petal(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, TIDDetId::ring(), TECDetId::ring(), TOBDetId::rod(), PXFDetId::side(), TIDDetId::side(), TECDetId::side(), TIBDetId::string(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, TIDDetId::wheel(), and TECDetId::wheel().

00025                                                      {
00026   //
00027   // print DetId composition according to the type
00028   //
00029 
00030   std::ostringstream output;
00031 
00032   if ( (unsigned int)id.subdetId() == StripSubdetector::TIB ) {
00033     TIBDetId tibid(id.rawId()); 
00034     output << "TIB ring Detid: " << id.rawId() 
00035            << " layer: " << tibid.layer() 
00036            << " fw(0)/bw(1): " << tibid.string()[0]
00037            << " int(0)/ext(1): " << tibid.string()[1] 
00038            << " string: " << tibid.string()[2] 
00039            << " module: " << tibid.module();
00040     if ( IsMatched(tibid) ) {
00041       output << " corresponding to matched detunit of glued sensor";
00042     } else if ( IsGluedRPhi(tibid) ) {
00043       output << " corresponding to rphi detunit of glued sensor";
00044     } else if ( IsStereo(tibid) ) {
00045       output << " corresponding to stereo detunit of glued sensor";
00046     } else if ( IsSingleRPhi(tibid) ) {
00047       output << " corresponding to rphi detunit of single sensor";
00048     }
00049     output << std::endl; 
00050   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TOB ) {
00051     TOBDetId tobid(id.rawId()); 
00052     output << "TOB ring Detid: " << id.rawId() 
00053            << " layer: " << tobid.layer() 
00054            << " fw(0)/bw(1): " << tobid.rod()[0]
00055            << " rod: " << tobid.rod()[1] 
00056            << " detector: " << tobid.module();
00057     if ( IsMatched(tobid) ) {
00058       output << " corresponding to matched detunit of glued sensor";
00059     } else if ( IsGluedRPhi(tobid) ) {
00060       output << " corresponding to rphi detunit of glued sensor";
00061     } else if ( IsStereo(tobid) ) {
00062       output << " corresponding to stereo detunit of glued sensor";
00063     } else if ( IsSingleRPhi(tobid) ) {
00064       output << " corresponding to rphi detunit of single sensor";
00065     }
00066     output << std::endl; 
00067   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TID ) {
00068     TIDDetId tidid(id.rawId()); 
00069     output << "TID ring Detid: " << id.rawId() 
00070            << " side neg(1)/pos(2): " << tidid.side() 
00071            << " wheel: " << tidid.wheel()
00072            << " ring: " << tidid.ring()
00073            << " detector fw(0)/bw(1): " << tidid.module()[0]
00074            << " detector: " << tidid.module()[1];
00075     if ( IsMatched(tidid) ) {
00076       output << " corresponding to matched detunit of glued sensor";
00077     } else if ( IsGluedRPhi(tidid) ) {
00078       output << " corresponding to rphi detunit of glued sensor";
00079     } else if ( IsStereo(tidid) ) {
00080       output << " corresponding to stereo detunit of glued sensor";
00081     } else if ( IsSingleRPhi(tidid) ) {
00082       output << " corresponding to rphi detunit of single sensor";
00083     }
00084     output << std::endl; 
00085   } else if ( (unsigned int)id.subdetId() == StripSubdetector::TEC ) {
00086     TECDetId tecid(id.rawId()); 
00087     output << "TEC ring DetId: " << id.rawId() 
00088            << " side neg(1)/pos(2): " << tecid.side() 
00089            << " wheel: " << tecid.wheel()
00090            << " petal fw(0)/bw(1): " << tecid.petal()[0]
00091            << " petal: " << tecid.petal()[1] 
00092            << " ring: " << tecid.ring()
00093            << " module: " << tecid.module();
00094     if ( IsMatched(tecid) ) {
00095       output << " corresponding to matched detunit of glued sensor";
00096     } else if ( IsGluedRPhi(tecid) ) {
00097       output << " corresponding to rphi detunit of glued sensor";
00098     } else if ( IsStereo(tecid) ) {
00099       output << " corresponding to stereo detunit of glued sensor";
00100     } else if ( IsSingleRPhi(tecid) ) {
00101       output << " corresponding to rphi detunit of single sensor";
00102     }
00103     output << std::endl; 
00104   } else if ( (unsigned int)id.subdetId() == PixelSubdetector::PixelBarrel ) {
00105     PXBDetId pxbid(id.rawId()); 
00106     output << "PXB ring DetId: " << id.rawId() 
00107            << " layer: " << pxbid.layer()
00108            << " ladder: " << pxbid.ladder()
00109            << " detector: " << pxbid.module()
00110            << std::endl; 
00111   } else if ( (unsigned int)id.subdetId() == PixelSubdetector::PixelEndcap ) {
00112     PXFDetId pxfid(id.rawId()); 
00113     output << "PXF ring DetId: " << id.rawId() 
00114            << " side: " << pxfid.side()
00115            << " disk: " << pxfid.disk()
00116            << " blade: " << pxfid.blade()
00117            << " detector: " << pxfid.module()
00118            << std::endl; 
00119   }
00120 
00121 
00122   return output.str();
00123 }

DetId RoadSearchDetIdHelper::ReturnRPhiId ( const DetId  id  )  [static]

Definition at line 325 of file RoadSearchDetIdHelper.cc.

References IsMatched(), and IsStereo().

Referenced by Roads::getRoadSeed().

00325                                                         {
00326   //
00327   // return corresponding rphi id
00328   //
00329 
00330   if ( IsMatched(id) ) {
00331     return DetId(id.rawId()+2);
00332   } else if ( IsStereo(id) ) {
00333     return DetId(id.rawId()+1);
00334   } else {
00335     return id;
00336   }
00337 
00338   return id;
00339 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:30:51 2009 for CMSSW by  doxygen 1.5.4