#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 |
Definition at line 277 of file ClusterSummary.h.
ClusterSummary::ModuleSelection::ModuleSelection | ( | std::string | gs | ) |
Definition at line 576 of file ClusterSummary.cc.
{ geosearch = gs; }
ClusterSummary::ModuleSelection::~ModuleSelection | ( | ) | [virtual] |
Definition at line 580 of file ClusterSummary.cc.
{}
std::pair< int, int > ClusterSummary::ModuleSelection::IsPixelSelected | ( | int | DetId | ) | [virtual] |
Definition at line 424 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, pos, query::result, PXFDetId::side(), AlCaHLTBitMon_QueryRunRegistry::string, and DetId::subdetId().
{ // true if the module mod is among the selected modules. int isselected = 0; int enumVal = 99999; DetId detId = DetId(detid); // Get the Detid object unsigned int detType=detId.det(); // det type, pixel=1 unsigned int subdetid=detId.subdetId(); //subdetector type, barrel=1, foward=2 if(detType!=1) return std::make_pair(0,99999); // look only at pixels std::string::size_type result = geosearch.find("_"); if(result != std::string::npos) { std::string modStr = geosearch; //Convert to string to use needed methods size_t pos = modStr.find("_", 0); //find the '_' std::string Mod = modStr.substr(0, pos); //find the module std::string Layer = modStr.substr(pos+1, modStr.length()); //find the Layer std::stringstream ss(Layer); int layer_id = 0; ss >> layer_id; /**** Check the Layers of the Barrel ****/ if (subdetid == 1 && Mod == "BPIX"){ PXBDetId pdetId = PXBDetId(detid); // Barell layer = 1,2,3 int layer=pdetId.layer(); if (layer_id == layer){ if (layer_id == 1) enumVal = ClusterSummary::BPIX_1; else if (layer_id == 2) enumVal = ClusterSummary::BPIX_2; else if (layer_id == 3) enumVal = ClusterSummary::BPIX_3; isselected = 1; } } /**** Check the Disk of the endcaps ****/ else if (subdetid == 2 && Mod == "FPIX"){ PXFDetId pdetId = PXFDetId(detid); int disk=pdetId.disk(); //1,2,3 if (layer_id == disk){ if (disk == 1) enumVal = ClusterSummary::FPIX_1; else if (disk == 2) enumVal = ClusterSummary::FPIX_2; else if (disk == 3) enumVal = ClusterSummary::FPIX_3; isselected = 1; } } /**** Check the sides of each Disk of the endcaps ****/ else if (subdetid == 2 && Mod == "FPIXM"){ PXFDetId pdetId = PXFDetId(detid); int side=pdetId.side(); //size=1 for -z, 2 for +z int disk=pdetId.disk(); //1,2,3 if (layer_id == disk && side == 1 ){ if (disk == 1) enumVal = ClusterSummary::FPIXM_1; else if (disk == 2) enumVal = ClusterSummary::FPIXM_2; else if (disk == 3) enumVal = ClusterSummary::FPIXM_3; isselected = 1; } } else if (subdetid == 2 && Mod == "FPIXP"){ PXFDetId pdetId = PXFDetId(detid); int side=pdetId.side(); //size=1 for -z, 2 for +z int disk=pdetId.disk(); //1,2,3 if (layer_id == disk && side == 2){ if (disk == 1) enumVal = ClusterSummary::FPIXP_1; else if (disk == 2) enumVal = ClusterSummary::FPIXP_2; else if (disk == 3) enumVal = ClusterSummary::FPIXP_3; isselected = 1; } } } /**** Check the top and bottom of the endcaps ****/ else if( subdetid == 2 && geosearch.compare("FPIXM")==0 ) { PXFDetId pdetId = PXFDetId(detid); int side=pdetId.side(); //size=1 for -z, 2 for +z if (side == 1){ isselected = 1; enumVal = ClusterSummary::FPIXM; } } else if( subdetid == 2 && geosearch.compare("FPIXP")==0 ) { PXFDetId pdetId = PXFDetId(detid); int side=pdetId.side(); //size=1 for -z, 2 for +z if (side == 2){ isselected = 1; enumVal = ClusterSummary::FPIXP; } } /**** Check the full Barrel and Endcaps ****/ else if(subdetid == 1 && geosearch.compare("BPIX")==0 ) { isselected = 1; enumVal = ClusterSummary::BPIX; } else if(subdetid == 2 && geosearch.compare("FPIX")==0 ) { isselected = 1; enumVal = ClusterSummary::FPIX; } else if( geosearch.compare("PIXEL")==0) { isselected = 1; enumVal = ClusterSummary::PIXEL; } return std::make_pair(isselected, enumVal); }
std::pair< int, int > ClusterSummary::ModuleSelection::IsStripSelected | ( | int | DetId | ) | [virtual] |
Definition at line 130 of file ClusterSummary.cc.
References geosearch, TECDetId::isZMinusSide(), TIDDetId::isZMinusSide(), TIBDetId::layer(), TOBDetId::layer(), Mod(), pos, query::result, relativeConstraints::ring, TIDDetId::ringNumber(), TECDetId::ringNumber(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripDetId::subDetector(), ClusterSummary::TEC, SiStripDetId::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().
{ // true if the module mod is among the selected modules. int isselected = 0; int enumVal = 99999; SiStripDetId subdet(DetId); int subdetid = subdet.subDetector(); std::string::size_type result = geosearch.find("_"); if(result != std::string::npos) { /**** Check to the layers in the modules ****/ std::string modStr = geosearch; //Convert to string to use needed methods size_t pos = modStr.find("_", 0); //find the '_' std::string Mod = modStr.substr(0, pos); //find the module std::string Layer = modStr.substr(pos+1, modStr.length()); //find the Layer std::stringstream ss(Layer); int layer_id = 0; ss >> layer_id; if (SiStripDetId::TIB == subdetid && Mod == "TIB"){ TIBDetId tib(DetId); int layer = tib.layer(); if (layer_id == layer){ if (layer_id == 1) enumVal = ClusterSummary::TIB_1; else if (layer_id == 2) enumVal = ClusterSummary::TIB_2; else if (layer_id == 3) enumVal = ClusterSummary::TIB_3; else if (layer_id == 4) enumVal = ClusterSummary::TIB_4; isselected = 1; } } else if (SiStripDetId::TOB == subdetid && Mod == "TOB"){ TOBDetId tob(DetId); int layer = tob.layer(); if (layer_id == layer){ if (layer_id == 1) enumVal = ClusterSummary::TOB_1; else if (layer_id == 2) enumVal = ClusterSummary::TOB_2; else if (layer_id == 3) enumVal = ClusterSummary::TOB_3; else if (layer_id == 4) enumVal = ClusterSummary::TOB_4; else if (layer_id == 5) enumVal = ClusterSummary::TOB_5; else if (layer_id == 6) enumVal = ClusterSummary::TOB_6; isselected = 1; } } else if (SiStripDetId::TEC == subdetid && Mod == "TECM"){ TECDetId tec(DetId); int side = (tec.isZMinusSide())?-1:1; int layerwheel = tec.wheel(); if (layer_id == layerwheel && side == -1){ if (layer_id == 1) enumVal = ClusterSummary::TECM_1; else if (layer_id == 2) enumVal = ClusterSummary::TECM_2; else if (layer_id == 3) enumVal = ClusterSummary::TECM_3; else if (layer_id == 4) enumVal = ClusterSummary::TECM_4; else if (layer_id == 5) enumVal = ClusterSummary::TECM_5; else if (layer_id == 6) enumVal = ClusterSummary::TECM_6; else if (layer_id == 7) enumVal = ClusterSummary::TECM_7; else if (layer_id == 8) enumVal = ClusterSummary::TECM_8; else if (layer_id == 9) enumVal = ClusterSummary::TECM_9; isselected = 1; } } else if (SiStripDetId::TEC == subdetid && Mod == "TECP"){ TECDetId tec(DetId); int side = (tec.isZMinusSide())?-1:1; int layerwheel = tec.wheel(); if (layer_id == layerwheel && side == 1){ if (layer_id == 1) enumVal = ClusterSummary::TECP_1; else if (layer_id == 2) enumVal = ClusterSummary::TECP_2; else if (layer_id == 3) enumVal = ClusterSummary::TECP_3; else if (layer_id == 4) enumVal = ClusterSummary::TECP_4; else if (layer_id == 5) enumVal = ClusterSummary::TECP_5; else if (layer_id == 6) enumVal = ClusterSummary::TECP_6; else if (layer_id == 7) enumVal = ClusterSummary::TECP_7; else if (layer_id == 8) enumVal = ClusterSummary::TECP_8; else if (layer_id == 9) enumVal = ClusterSummary::TECP_9; isselected = 1; } } // TEC minus ring else if (SiStripDetId::TEC == subdetid && Mod == "TECMR"){ TECDetId tec(DetId); int side = (tec.isZMinusSide())?-1:1; int ring = tec.ringNumber(); if (layer_id == ring && side == -1){ if (layer_id == 1) enumVal = ClusterSummary::TECMR_1; else if (layer_id == 2) enumVal = ClusterSummary::TECMR_2; else if (layer_id == 3) enumVal = ClusterSummary::TECMR_3; else if (layer_id == 4) enumVal = ClusterSummary::TECMR_4; else if (layer_id == 5) enumVal = ClusterSummary::TECMR_5; else if (layer_id == 6) enumVal = ClusterSummary::TECMR_6; else if (layer_id == 7) enumVal = ClusterSummary::TECMR_7; isselected = 1; } } // TEC plus ring else if (SiStripDetId::TEC == subdetid && Mod == "TECPR"){ TECDetId tec(DetId); int side = (tec.isZMinusSide())?-1:1; int ring = tec.ringNumber(); if (layer_id == ring && side == 1){ if (layer_id == 1) enumVal = ClusterSummary::TECPR_1; else if (layer_id == 2) enumVal = ClusterSummary::TECPR_2; else if (layer_id == 3) enumVal = ClusterSummary::TECPR_3; else if (layer_id == 4) enumVal = ClusterSummary::TECPR_4; else if (layer_id == 5) enumVal = ClusterSummary::TECPR_5; else if (layer_id == 6) enumVal = ClusterSummary::TECPR_6; else if (layer_id == 7) enumVal = ClusterSummary::TECPR_7; isselected = 1; } } else if (SiStripDetId::TID == subdetid && Mod == "TIDM"){ TIDDetId tid(DetId); int side = (tid.isZMinusSide())?-1:1; int layerwheel = tid.wheel(); if (layer_id == layerwheel && side == -1){ if (layer_id == 1) enumVal = ClusterSummary::TIDM_1; else if (layer_id == 2) enumVal = ClusterSummary::TIDM_2; else if (layer_id == 3) enumVal = ClusterSummary::TIDM_3; isselected = 1; } } else if (SiStripDetId::TID == subdetid && Mod == "TIDP"){ TIDDetId tid(DetId); int side = (tid.isZMinusSide())?-1:1; int layerwheel = tid.wheel(); if (layer_id == layerwheel && side == 1){ if (layer_id == 1) enumVal = ClusterSummary::TIDP_1; else if (layer_id == 2) enumVal = ClusterSummary::TIDP_2; else if (layer_id == 3) enumVal = ClusterSummary::TIDP_3; isselected = 1; } } // TID minus ring else if (SiStripDetId::TID == subdetid && Mod == "TIDMR"){ TIDDetId tid(DetId); int side = (tid.isZMinusSide())?-1:1; int ring = tid.ringNumber(); if (layer_id == ring && side == -1){ if (layer_id == 1) enumVal = ClusterSummary::TIDMR_1; else if (layer_id == 2) enumVal = ClusterSummary::TIDMR_2; else if (layer_id == 3) enumVal = ClusterSummary::TIDMR_3; isselected = 1; } } // TID plus ring else if (SiStripDetId::TID == subdetid && Mod == "TIDPR"){ TIDDetId tid(DetId); int side = (tid.isZMinusSide())?-1:1; int ring = tid.ringNumber(); if (layer_id == ring && side == 1){ if (layer_id == 1) enumVal = ClusterSummary::TIDPR_1; else if (layer_id == 2) enumVal = ClusterSummary::TIDPR_2; else if (layer_id == 3) enumVal = ClusterSummary::TIDPR_3; isselected = 1; } } } /**** Check the top and bottom for the TEC and TID ****/ else if( SiStripDetId::TEC == subdetid && geosearch.compare("TECM")==0 ) { TECDetId tec(DetId); int side = (tec.isZMinusSide())?-1:1; if (side == -1){ isselected = 1; enumVal = ClusterSummary::TECM; } } else if( SiStripDetId::TEC == subdetid && geosearch.compare("TECP")==0 ) { TECDetId tec(DetId); int side = (tec.isZMinusSide())?-1:1; if (side == 1){ isselected = 1; enumVal = ClusterSummary::TECP; } } else if( SiStripDetId::TID == subdetid && geosearch.compare("TIDM")==0 ) { TIDDetId tid(DetId); int side = (tid.isZMinusSide())?-1:1; if (side == -1){ isselected = 1; enumVal = ClusterSummary::TIDM; } } else if( SiStripDetId::TID == subdetid && geosearch.compare("TIDP")==0 ) { TIDDetId tid(DetId); int side = (tid.isZMinusSide())?-1:1; if (side == 1){ isselected = 1; enumVal = ClusterSummary::TIDP; } } /**** Check the full TOB, TIB, TID, TEC modules ****/ else if( SiStripDetId::TIB == subdetid && geosearch.compare("TIB")==0 ) { isselected = 1; enumVal = ClusterSummary::TIB; } else if( SiStripDetId::TID == subdetid && geosearch.compare("TID")==0 ) { isselected = 1; enumVal = ClusterSummary::TID; } else if( SiStripDetId::TOB == subdetid && geosearch.compare("TOB")==0) { isselected = 1; enumVal = ClusterSummary::TOB; } else if( SiStripDetId::TEC == subdetid && geosearch.compare("TEC")==0) { isselected = 1; enumVal = ClusterSummary::TEC; } else if( geosearch.compare("TRACKER")==0) { isselected = 1; enumVal = ClusterSummary::TRACKER; } return std::make_pair(isselected, enumVal); }
std::string ClusterSummary::ModuleSelection::geosearch [private] |
Definition at line 284 of file ClusterSummary.h.
Referenced by IsStripSelected().