test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ClusterSummary::ModuleSelection Class Reference

#include <ClusterSummary.h>

Public Member Functions

virtual std::pair< int, int > IsPixelSelected (int DetId)
 
virtual std::pair< int, int > IsStripSelected (int DetId)
 
 ModuleSelection (std::string gs)
 
virtual ~ModuleSelection ()
 

Private Attributes

std::string geosearch
 

Detailed Description

Definition at line 278 of file ClusterSummary.h.

Constructor & Destructor Documentation

ClusterSummary::ModuleSelection::ModuleSelection ( std::string  gs)

Definition at line 662 of file ClusterSummary.cc.

References trackerHitRTTI::gs.

ClusterSummary::ModuleSelection::~ModuleSelection ( )
virtual

Definition at line 666 of file ClusterSummary.cc.

666 {}

Member Function Documentation

std::pair< int, int > ClusterSummary::ModuleSelection::IsPixelSelected ( int  DetId)
virtual

Definition at line 510 of file ClusterSummary.cc.

References ClusterSummary::BPIX, ClusterSummary::BPIX_1, ClusterSummary::BPIX_2, ClusterSummary::BPIX_3, DetId::det(), PXFDetId::disk(), ClusterSummary::FPIX, ClusterSummary::FPIX_1, ClusterSummary::FPIX_2, ClusterSummary::FPIX_3, ClusterSummary::FPIXM, ClusterSummary::FPIXM_1, ClusterSummary::FPIXM_2, ClusterSummary::FPIXM_3, ClusterSummary::FPIXP, ClusterSummary::FPIXP_1, ClusterSummary::FPIXP_2, ClusterSummary::FPIXP_3, PXBDetId::layer(), Mod(), ClusterSummary::PIXEL, query::result, PXFDetId::side(), contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and DetId::subdetId().

510  {
511 
512  // true if the module mod is among the selected modules.
513  int isselected = 0;
514  int enumVal = 99999;
515 
516  DetId detId = DetId(detid); // Get the Detid object
517  unsigned int detType=detId.det(); // det type, pixel=1
518  unsigned int subdetid=detId.subdetId(); //subdetector type, barrel=1, foward=2
519 
520  if(detType!=1) return std::make_pair(0,99999); // look only at pixels
521 
523 
524  if(result != std::string::npos) {
525 
526  std::string modStr = geosearch; //Convert to string to use needed methods
527  size_t pos = modStr.find("_", 0); //find the '_'
528  std::string Mod = modStr.substr(0, pos); //find the module
529  std::string Layer = modStr.substr(pos+1, modStr.length()); //find the Layer
530 
531  std::stringstream ss(Layer);
532  int layer_id = 0;
533 
534  ss >> layer_id;
535 
536  /****
537  Check the Layers of the Barrel
538  ****/
539 
540  if (subdetid == 1 && Mod == "BPIX"){
541 
542  PXBDetId pdetId = PXBDetId(detid);
543  // Barell layer = 1,2,3
544  int layer=pdetId.layer();
545 
546  if (layer_id == layer){
547 
548  if (layer_id == 1) enumVal = ClusterSummary::BPIX_1;
549  else if (layer_id == 2) enumVal = ClusterSummary::BPIX_2;
550  else if (layer_id == 3) enumVal = ClusterSummary::BPIX_3;
551 
552  isselected = 1;
553  }
554  }
555 
556  /****
557  Check the Disk of the endcaps
558  ****/
559  else if (subdetid == 2 && Mod == "FPIX"){
560 
561  PXFDetId pdetId = PXFDetId(detid);
562  int disk=pdetId.disk(); //1,2,3
563 
564  if (layer_id == disk){
565 
566  if (disk == 1) enumVal = ClusterSummary::FPIX_1;
567  else if (disk == 2) enumVal = ClusterSummary::FPIX_2;
568  else if (disk == 3) enumVal = ClusterSummary::FPIX_3;
569 
570  isselected = 1;
571 
572  }
573  }
574 
575  /****
576  Check the sides of each Disk of the endcaps
577  ****/
578 
579  else if (subdetid == 2 && Mod == "FPIXM"){
580 
581  PXFDetId pdetId = PXFDetId(detid);
582  int side=pdetId.side(); //size=1 for -z, 2 for +z
583  int disk=pdetId.disk(); //1,2,3
584 
585  if (layer_id == disk && side == 1 ){
586 
587  if (disk == 1) enumVal = ClusterSummary::FPIXM_1;
588  else if (disk == 2) enumVal = ClusterSummary::FPIXM_2;
589  else if (disk == 3) enumVal = ClusterSummary::FPIXM_3;
590 
591  isselected = 1;
592 
593  }
594  }
595 
596  else if (subdetid == 2 && Mod == "FPIXP"){
597 
598  PXFDetId pdetId = PXFDetId(detid);
599  int side=pdetId.side(); //size=1 for -z, 2 for +z
600  int disk=pdetId.disk(); //1,2,3
601 
602  if (layer_id == disk && side == 2){
603 
604  if (disk == 1) enumVal = ClusterSummary::FPIXP_1;
605  else if (disk == 2) enumVal = ClusterSummary::FPIXP_2;
606  else if (disk == 3) enumVal = ClusterSummary::FPIXP_3;
607 
608  isselected = 1;
609 
610  }
611  }
612  }
613 
614  /****
615  Check the top and bottom of the endcaps
616  ****/
617 
618  else if( subdetid == 2 && geosearch.compare("FPIXM")==0 ) {
619 
620  PXFDetId pdetId = PXFDetId(detid);
621  int side=pdetId.side(); //size=1 for -z, 2 for +z
622 
623  if (side == 1){
624  isselected = 1;
625  enumVal = ClusterSummary::FPIXM;
626  }
627  }
628 
629  else if( subdetid == 2 && geosearch.compare("FPIXP")==0 ) {
630 
631  PXFDetId pdetId = PXFDetId(detid);
632  int side=pdetId.side(); //size=1 for -z, 2 for +z
633 
634  if (side == 2){
635  isselected = 1;
636  enumVal = ClusterSummary::FPIXP;
637  }
638  }
639 
640 
641  /****
642  Check the full Barrel and Endcaps
643  ****/
644 
645  else if(subdetid == 1 && geosearch.compare("BPIX")==0 ) {
646  isselected = 1;
647  enumVal = ClusterSummary::BPIX;
648  }
649  else if(subdetid == 2 && geosearch.compare("FPIX")==0 ) {
650  isselected = 1;
651  enumVal = ClusterSummary::FPIX;
652  }
653  else if( geosearch.compare("PIXEL")==0) {
654  isselected = 1;
655  enumVal = ClusterSummary::PIXEL;
656  }
657 
658 
659  return std::make_pair(isselected, enumVal);
660 }
uint16_t size_type
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
SeedingLayerSetsHits::SeedingLayer Layer
Definition: LayerTriplets.h:14
double Mod(double phi)
autoexplaining
tuple result
Definition: query.py:137
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
Definition: DetId.h:18
unsigned int side() const
positive or negative id
Definition: PXFDetId.h:38
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
std::pair< int, int > ClusterSummary::ModuleSelection::IsStripSelected ( int  DetId)
virtual

Definition at line 216 of file ClusterSummary.cc.

References geosearch, TIDDetId::isZMinusSide(), TECDetId::isZMinusSide(), TOBDetId::layer(), TIBDetId::layer(), Mod(), query::result, relativeConstraints::ring, TIDDetId::ringNumber(), TECDetId::ringNumber(), contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, SiStripDetId::subDetector(), SiStripDetId::TEC, ClusterSummary::TEC, ClusterSummary::TECM, ClusterSummary::TECM_1, ClusterSummary::TECM_2, ClusterSummary::TECM_3, ClusterSummary::TECM_4, ClusterSummary::TECM_5, ClusterSummary::TECM_6, ClusterSummary::TECM_7, ClusterSummary::TECM_8, ClusterSummary::TECM_9, ClusterSummary::TECMR_1, ClusterSummary::TECMR_2, ClusterSummary::TECMR_3, ClusterSummary::TECMR_4, ClusterSummary::TECMR_5, ClusterSummary::TECMR_6, ClusterSummary::TECMR_7, ClusterSummary::TECP, ClusterSummary::TECP_1, ClusterSummary::TECP_2, ClusterSummary::TECP_3, ClusterSummary::TECP_4, ClusterSummary::TECP_5, ClusterSummary::TECP_6, ClusterSummary::TECP_7, ClusterSummary::TECP_8, ClusterSummary::TECP_9, ClusterSummary::TECPR_1, ClusterSummary::TECPR_2, ClusterSummary::TECPR_3, ClusterSummary::TECPR_4, ClusterSummary::TECPR_5, ClusterSummary::TECPR_6, ClusterSummary::TECPR_7, SiStripDetId::TIB, ClusterSummary::TIB, ClusterSummary::TIB_1, ClusterSummary::TIB_2, ClusterSummary::TIB_3, ClusterSummary::TIB_4, SiStripDetId::TID, ClusterSummary::TID, ClusterSummary::TIDM, ClusterSummary::TIDM_1, ClusterSummary::TIDM_2, ClusterSummary::TIDM_3, ClusterSummary::TIDMR_1, ClusterSummary::TIDMR_2, ClusterSummary::TIDMR_3, ClusterSummary::TIDP, ClusterSummary::TIDP_1, ClusterSummary::TIDP_2, ClusterSummary::TIDP_3, ClusterSummary::TIDPR_1, ClusterSummary::TIDPR_2, ClusterSummary::TIDPR_3, SiStripDetId::TOB, ClusterSummary::TOB, ClusterSummary::TOB_1, ClusterSummary::TOB_2, ClusterSummary::TOB_3, ClusterSummary::TOB_4, ClusterSummary::TOB_5, ClusterSummary::TOB_6, ClusterSummary::TRACKER, TIDDetId::wheel(), and TECDetId::wheel().

216  {
217 
218  // true if the module mod is among the selected modules.
219  int isselected = 0;
220  int enumVal = 99999;
221 
222  SiStripDetId subdet(DetId);
223  int subdetid = subdet.subDetector();
224 
226 
227  if(result != std::string::npos) {
228 
229  /****
230  Check to the layers in the modules
231  ****/
232 
233  std::string modStr = geosearch; //Convert to string to use needed methods
234  size_t pos = modStr.find("_", 0); //find the '_'
235  std::string Mod = modStr.substr(0, pos); //find the module
236  std::string Layer = modStr.substr(pos+1, modStr.length()); //find the Layer
237 
238  std::stringstream ss(Layer);
239  int layer_id = 0;
240 
241  ss >> layer_id;
242 
243  if (SiStripDetId::TIB == subdetid && Mod == "TIB"){
244 
245  TIBDetId tib(DetId);
246  int layer = tib.layer();
247  if (layer_id == layer){
248 
249  if (layer_id == 1) enumVal = ClusterSummary::TIB_1;
250  else if (layer_id == 2) enumVal = ClusterSummary::TIB_2;
251  else if (layer_id == 3) enumVal = ClusterSummary::TIB_3;
252  else if (layer_id == 4) enumVal = ClusterSummary::TIB_4;
253 
254  isselected = 1;
255  }
256  }
257 
258  else if (SiStripDetId::TOB == subdetid && Mod == "TOB"){
259 
260  TOBDetId tob(DetId);
261  int layer = tob.layer();
262  if (layer_id == layer){
263 
264  if (layer_id == 1) enumVal = ClusterSummary::TOB_1;
265  else if (layer_id == 2) enumVal = ClusterSummary::TOB_2;
266  else if (layer_id == 3) enumVal = ClusterSummary::TOB_3;
267  else if (layer_id == 4) enumVal = ClusterSummary::TOB_4;
268  else if (layer_id == 5) enumVal = ClusterSummary::TOB_5;
269  else if (layer_id == 6) enumVal = ClusterSummary::TOB_6;
270 
271  isselected = 1;
272  }
273  }
274 
275  else if (SiStripDetId::TEC == subdetid && Mod == "TECM"){
276 
277  TECDetId tec(DetId);
278  int side = (tec.isZMinusSide())?-1:1;
279  int layerwheel = tec.wheel();
280 
281  if (layer_id == layerwheel && side == -1){
282 
283  if (layer_id == 1) enumVal = ClusterSummary::TECM_1;
284  else if (layer_id == 2) enumVal = ClusterSummary::TECM_2;
285  else if (layer_id == 3) enumVal = ClusterSummary::TECM_3;
286  else if (layer_id == 4) enumVal = ClusterSummary::TECM_4;
287  else if (layer_id == 5) enumVal = ClusterSummary::TECM_5;
288  else if (layer_id == 6) enumVal = ClusterSummary::TECM_6;
289  else if (layer_id == 7) enumVal = ClusterSummary::TECM_7;
290  else if (layer_id == 8) enumVal = ClusterSummary::TECM_8;
291  else if (layer_id == 9) enumVal = ClusterSummary::TECM_9;
292 
293  isselected = 1;
294  }
295  }
296 
297  else if (SiStripDetId::TEC == subdetid && Mod == "TECP"){
298 
299  TECDetId tec(DetId);
300  int side = (tec.isZMinusSide())?-1:1;
301  int layerwheel = tec.wheel();
302 
303  if (layer_id == layerwheel && side == 1){
304 
305  if (layer_id == 1) enumVal = ClusterSummary::TECP_1;
306  else if (layer_id == 2) enumVal = ClusterSummary::TECP_2;
307  else if (layer_id == 3) enumVal = ClusterSummary::TECP_3;
308  else if (layer_id == 4) enumVal = ClusterSummary::TECP_4;
309  else if (layer_id == 5) enumVal = ClusterSummary::TECP_5;
310  else if (layer_id == 6) enumVal = ClusterSummary::TECP_6;
311  else if (layer_id == 7) enumVal = ClusterSummary::TECP_7;
312  else if (layer_id == 8) enumVal = ClusterSummary::TECP_8;
313  else if (layer_id == 9) enumVal = ClusterSummary::TECP_9;
314 
315  isselected = 1;
316  }
317  }
318 
319  // TEC minus ring
320  else if (SiStripDetId::TEC == subdetid && Mod == "TECMR"){
321 
322  TECDetId tec(DetId);
323  int side = (tec.isZMinusSide())?-1:1;
324  int ring = tec.ringNumber();
325 
326  if (layer_id == ring && side == -1){
327 
328  if (layer_id == 1) enumVal = ClusterSummary::TECMR_1;
329  else if (layer_id == 2) enumVal = ClusterSummary::TECMR_2;
330  else if (layer_id == 3) enumVal = ClusterSummary::TECMR_3;
331  else if (layer_id == 4) enumVal = ClusterSummary::TECMR_4;
332  else if (layer_id == 5) enumVal = ClusterSummary::TECMR_5;
333  else if (layer_id == 6) enumVal = ClusterSummary::TECMR_6;
334  else if (layer_id == 7) enumVal = ClusterSummary::TECMR_7;
335 
336  isselected = 1;
337  }
338  }
339 
340  // TEC plus ring
341  else if (SiStripDetId::TEC == subdetid && Mod == "TECPR"){
342 
343  TECDetId tec(DetId);
344  int side = (tec.isZMinusSide())?-1:1;
345  int ring = tec.ringNumber();
346  if (layer_id == ring && side == 1){
347 
348  if (layer_id == 1) enumVal = ClusterSummary::TECPR_1;
349  else if (layer_id == 2) enumVal = ClusterSummary::TECPR_2;
350  else if (layer_id == 3) enumVal = ClusterSummary::TECPR_3;
351  else if (layer_id == 4) enumVal = ClusterSummary::TECPR_4;
352  else if (layer_id == 5) enumVal = ClusterSummary::TECPR_5;
353  else if (layer_id == 6) enumVal = ClusterSummary::TECPR_6;
354  else if (layer_id == 7) enumVal = ClusterSummary::TECPR_7;
355 
356  isselected = 1;
357  }
358  }
359 
360  else if (SiStripDetId::TID == subdetid && Mod == "TIDM"){
361 
362  TIDDetId tid(DetId);
363  int side = (tid.isZMinusSide())?-1:1;
364  int layerwheel = tid.wheel();
365 
366  if (layer_id == layerwheel && side == -1){
367 
368  if (layer_id == 1) enumVal = ClusterSummary::TIDM_1;
369  else if (layer_id == 2) enumVal = ClusterSummary::TIDM_2;
370  else if (layer_id == 3) enumVal = ClusterSummary::TIDM_3;
371 
372  isselected = 1;
373  }
374  }
375 
376  else if (SiStripDetId::TID == subdetid && Mod == "TIDP"){
377 
378  TIDDetId tid(DetId);
379  int side = (tid.isZMinusSide())?-1:1;
380  int layerwheel = tid.wheel();
381 
382  if (layer_id == layerwheel && side == 1){
383 
384  if (layer_id == 1) enumVal = ClusterSummary::TIDP_1;
385  else if (layer_id == 2) enumVal = ClusterSummary::TIDP_2;
386  else if (layer_id == 3) enumVal = ClusterSummary::TIDP_3;
387 
388  isselected = 1;
389  }
390  }
391 
392  // TID minus ring
393  else if (SiStripDetId::TID == subdetid && Mod == "TIDMR"){
394  TIDDetId tid(DetId);
395  int side = (tid.isZMinusSide())?-1:1;
396  int ring = tid.ringNumber();
397  if (layer_id == ring && side == -1){
398 
399  if (layer_id == 1) enumVal = ClusterSummary::TIDMR_1;
400  else if (layer_id == 2) enumVal = ClusterSummary::TIDMR_2;
401  else if (layer_id == 3) enumVal = ClusterSummary::TIDMR_3;
402 
403  isselected = 1;
404  }
405  }
406 
407  // TID plus ring
408  else if (SiStripDetId::TID == subdetid && Mod == "TIDPR"){
409  TIDDetId tid(DetId);
410  int side = (tid.isZMinusSide())?-1:1;
411  int ring = tid.ringNumber();
412 
413  if (layer_id == ring && side == 1){
414 
415  if (layer_id == 1) enumVal = ClusterSummary::TIDPR_1;
416  else if (layer_id == 2) enumVal = ClusterSummary::TIDPR_2;
417  else if (layer_id == 3) enumVal = ClusterSummary::TIDPR_3;
418 
419  isselected = 1;
420  }
421  }
422  }
423 
424  /****
425  Check the top and bottom for the TEC and TID
426  ****/
427 
428  else if( SiStripDetId::TEC == subdetid && geosearch.compare("TECM")==0 ) {
429 
430  TECDetId tec(DetId);
431  int side = (tec.isZMinusSide())?-1:1;
432 
433  if (side == -1){
434  isselected = 1;
435  enumVal = ClusterSummary::TECM;
436  }
437  }
438 
439  else if( SiStripDetId::TEC == subdetid && geosearch.compare("TECP")==0 ) {
440 
441  TECDetId tec(DetId);
442  int side = (tec.isZMinusSide())?-1:1;
443 
444  if (side == 1){
445  isselected = 1;
446  enumVal = ClusterSummary::TECP;
447  }
448  }
449 
450 
451  else if( SiStripDetId::TID == subdetid && geosearch.compare("TIDM")==0 ) {
452 
453  TIDDetId tid(DetId);
454  int side = (tid.isZMinusSide())?-1:1;
455 
456  if (side == -1){
457  isselected = 1;
458  enumVal = ClusterSummary::TIDM;
459  }
460  }
461 
462 
463  else if( SiStripDetId::TID == subdetid && geosearch.compare("TIDP")==0 ) {
464 
465  TIDDetId tid(DetId);
466  int side = (tid.isZMinusSide())?-1:1;
467 
468  if (side == 1){
469  isselected = 1;
470  enumVal = ClusterSummary::TIDP;
471  }
472  }
473 
474  /****
475  Check the full TOB, TIB, TID, TEC modules
476  ****/
477 
478  else if( SiStripDetId::TIB == subdetid && geosearch.compare("TIB")==0 ) {
479  isselected = 1;
480  enumVal = ClusterSummary::TIB;
481  }
482  else if( SiStripDetId::TID == subdetid && geosearch.compare("TID")==0 ) {
483  isselected = 1;
484  enumVal = ClusterSummary::TID;
485  }
486  else if( SiStripDetId::TOB == subdetid && geosearch.compare("TOB")==0) {
487  isselected = 1;
488  enumVal = ClusterSummary::TOB;
489  }
490  else if( SiStripDetId::TEC == subdetid && geosearch.compare("TEC")==0) {
491  isselected = 1;
492  enumVal = ClusterSummary::TEC;
493  }
494  else if( geosearch.compare("TRACKER")==0) {
495  isselected = 1;
496  enumVal = ClusterSummary::TRACKER;
497  }
498 
499 
500  return std::make_pair(isselected, enumVal);
501 }
uint16_t size_type
SeedingLayerSetsHits::SeedingLayer Layer
Definition: LayerTriplets.h:14
double Mod(double phi)
autoexplaining
tuple result
Definition: query.py:137
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
Definition: DetId.h:18

Member Data Documentation

std::string ClusterSummary::ModuleSelection::geosearch
private

Definition at line 285 of file ClusterSummary.h.

Referenced by IsStripSelected().