Skip to content

Commit

Permalink
Merge pull request cms-sw#133 from gem-sw/CSC-Trigger-Upgrade-GEM-RPC…
Browse files Browse the repository at this point in the history
…-SLHC11

Csc trigger upgrade gem rpc slhc11
  • Loading branch information
Sven Dildick committed Apr 21, 2014
2 parents 3f8f9f5 + 13c8e7d commit 36f24ee
Show file tree
Hide file tree
Showing 7 changed files with 498 additions and 311 deletions.
227 changes: 227 additions & 0 deletions L1Trigger/CSCTriggerPrimitives/src/CSCGEMRPCTriggerGeometryHelper.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
#include "L1Trigger/CSCTriggerPrimitives/src/CSCGEMRPCTriggerGeometryHelper.h"


CSCGEMRPCTriggerGeometryHelper::CSCGEMRPCTriggerGeometryHelper()
{
}

CSCGEMRPCTriggerGeometryHelper::~CSCGEMRPCTriggerGeometryHelper()
{
}

void CSCGEMRPCTriggerGeometryHelper::setup()
{
return;
}

/*
const double CSCGEMRPCTriggerGeometryHelper::lut_me11_wg_eta_odd[48][3] = {
{0, 2.44005, 2.44688},
{1, 2.38863, 2.45035},
{2, 2.32742, 2.43077},
{3, 2.30064, 2.40389},
{4, 2.2746, 2.37775},
{5, 2.24925, 2.35231},
{6, 2.22458, 2.32754},
{7, 2.20054, 2.30339},
{8, 2.1771, 2.27985},
{9, 2.15425, 2.25689},
{10, 2.13194, 2.23447},
{11, 2.11016, 2.21258},
{12, 2.08889, 2.19119},
{13, 2.06809, 2.17028},
{14, 2.04777, 2.14984},
{15, 2.02788, 2.12983},
{16, 2.00843, 2.11025},
{17, 1.98938, 2.09108},
{18, 1.97073, 2.0723},
{19, 1.95246, 2.0539},
{20, 1.93456, 2.03587},
{21, 1.91701, 2.01818},
{22, 1.8998, 2.00084},
{23, 1.88293, 1.98382},
{24, 1.86637, 1.96712},
{25, 1.85012, 1.95073},
{26, 1.83417, 1.93463},
{27, 1.8185, 1.91882},
{28, 1.80312, 1.90329},
{29, 1.788, 1.88803},
{30, 1.77315, 1.87302},
{31, 1.75855, 1.85827},
{32, 1.74421, 1.84377},
{33, 1.7301, 1.8295},
{34, 1.71622, 1.81547},
{35, 1.70257, 1.80166},
{36, 1.68914, 1.78807},
{37, 1.67592, 1.77469},
{38, 1.66292, 1.76151},
{39, 1.65011, 1.74854},
{40, 1.63751, 1.73577},
{41, 1.62509, 1.72319},
{42, 1.61287, 1.71079},
{43, 1.60082, 1.69857},
{44, 1.59924, 1.68654},
{45, 1.6006, 1.67467},
{46, 1.60151, 1.66297},
{47, 1.60198, 1.65144} };
const double CSCGEMRPCTriggerGeometryHelper::lut_me11_wg_eta_even[48][3] = {
{0, 2.3917, 2.39853},
{1, 2.34037, 2.40199},
{2, 2.27928, 2.38244},
{3, 2.25254, 2.35561},
{4, 2.22655, 2.32951},
{5, 2.20127, 2.30412},
{6, 2.17665, 2.27939},
{7, 2.15267, 2.25529},
{8, 2.12929, 2.2318},
{9, 2.1065, 2.20889},
{10, 2.08425, 2.18652},
{11, 2.06253, 2.16468},
{12, 2.04132, 2.14334},
{13, 2.0206, 2.12249},
{14, 2.00033, 2.1021},
{15, 1.98052, 2.08215},
{16, 1.96113, 2.06262},
{17, 1.94215, 2.04351},
{18, 1.92357, 2.02479},
{19, 1.90538, 2.00645},
{20, 1.88755, 1.98847},
{21, 1.87007, 1.97085},
{22, 1.85294, 1.95357},
{23, 1.83614, 1.93662},
{24, 1.81965, 1.91998},
{25, 1.80348, 1.90365},
{26, 1.78761, 1.88762},
{27, 1.77202, 1.87187},
{28, 1.75672, 1.85641},
{29, 1.74168, 1.84121},
{30, 1.72691, 1.82628},
{31, 1.7124, 1.8116},
{32, 1.69813, 1.79716},
{33, 1.68411, 1.78297},
{34, 1.67032, 1.769},
{35, 1.65675, 1.75526},
{36, 1.64341, 1.74174},
{37, 1.63028, 1.72844},
{38, 1.61736, 1.71534},
{39, 1.60465, 1.70245},
{40, 1.59213, 1.68975},
{41, 1.57981, 1.67724},
{42, 1.56767, 1.66492},
{43, 1.55572, 1.65278},
{44, 1.55414, 1.64082},
{45, 1.55549, 1.62903},
{46, 1.5564, 1.61742},
{47, 1.55686, 1.60596} };
const double CSCGEMRPCTriggerGeometryHelper::lut_me21_wg_eta_odd[112][2] = {
{ 0,2.441},{ 1,2.435},{ 2,2.425},{ 3,2.414},{ 4,2.404},{ 5,2.394},{ 6,2.384},{ 7,2.374},
{ 8,2.365},{ 9,2.355},{10,2.346},{11,2.336},{12,2.327},{13,2.317},{14,2.308},{15,2.299},
{16,2.290},{17,2.281},{18,2.273},{19,2.264},{20,2.255},{21,2.247},{22,2.238},{23,2.230},
{24,2.221},{25,2.213},{26,2.205},{27,2.197},{28,2.189},{29,2.181},{30,2.173},{31,2.165},
{32,2.157},{33,2.149},{34,2.142},{35,2.134},{36,2.127},{37,2.119},{38,2.112},{39,2.104},
{40,2.097},{41,2.090},{42,2.083},{43,2.075},{44,2.070},{45,2.059},{46,2.054},{47,2.047},
{48,2.041},{49,2.034},{50,2.027},{51,2.020},{52,2.014},{53,2.007},{54,2.000},{55,1.994},
{56,1.988},{57,1.981},{58,1.975},{59,1.968},{60,1.962},{61,1.956},{62,1.950},{63,1.944},
{64,1.937},{65,1.931},{66,1.924},{67,1.916},{68,1.909},{69,1.902},{70,1.895},{71,1.888},
{72,1.881},{73,1.875},{74,1.868},{75,1.861},{76,1.854},{77,1.848},{78,1.841},{79,1.835},
{80,1.830},{81,1.820},{82,1.815},{83,1.809},{84,1.803},{85,1.796},{86,1.790},{87,1.784},
{88,1.778},{89,1.772},{90,1.766},{91,1.760},{92,1.754},{93,1.748},{94,1.742},{95,1.736},
{96,1.731},{97,1.725},{98,1.719},{99,1.714},{100,1.708},{101,1.702},{102,1.697},{103,1.691},
{104,1.686},{105,1.680},{106,1.675},{107,1.670},{108,1.664},{109,1.659},{110,1.654},{111,1.648},
};
const double CSCGEMRPCTriggerGeometryHelper::lut_me21_wg_eta_even[112][2] = {
{ 0,2.412},{ 1,2.405},{ 2,2.395},{ 3,2.385},{ 4,2.375},{ 5,2.365},{ 6,2.355},{ 7,2.345},
{ 8,2.335},{ 9,2.325},{10,2.316},{11,2.306},{12,2.297},{13,2.288},{14,2.279},{15,2.270},
{16,2.261},{17,2.252},{18,2.243},{19,2.234},{20,2.226},{21,2.217},{22,2.209},{23,2.200},
{24,2.192},{25,2.184},{26,2.175},{27,2.167},{28,2.159},{29,2.151},{30,2.143},{31,2.135},
{32,2.128},{33,2.120},{34,2.112},{35,2.105},{36,2.097},{37,2.090},{38,2.082},{39,2.075},
{40,2.068},{41,2.060},{42,2.053},{43,2.046},{44,2.041},{45,2.030},{46,2.025},{47,2.018},
{48,2.011},{49,2.005},{50,1.998},{51,1.991},{52,1.985},{53,1.978},{54,1.971},{55,1.965},
{56,1.958},{57,1.952},{58,1.946},{59,1.939},{60,1.933},{61,1.927},{62,1.921},{63,1.915},
{64,1.909},{65,1.902},{66,1.895},{67,1.887},{68,1.880},{69,1.873},{70,1.866},{71,1.859},
{72,1.853},{73,1.846},{74,1.839},{75,1.832},{76,1.826},{77,1.819},{78,1.812},{79,1.806},
{80,1.801},{81,1.792},{82,1.787},{83,1.780},{84,1.774},{85,1.768},{86,1.762},{87,1.756},
{88,1.750},{89,1.744},{90,1.738},{91,1.732},{92,1.726},{93,1.720},{94,1.714},{95,1.708},
{96,1.702},{97,1.697},{98,1.691},{99,1.685},{100,1.680},{101,1.674},{102,1.669},{103,1.663},
{104,1.658},{105,1.652},{106,1.647},{107,1.642},{108,1.636},{109,1.631},{110,1.626},{111,1.621},
};
const double CSCGEMRPCTriggerGeometryHelper::lut_me31_wg_eta_odd[96][2] = {
{ 0,2.421},{ 1,2.415},{ 2,2.406},{ 3,2.397},{ 4,2.388},{ 5,2.379},{ 6,2.371},{ 7,2.362},
{ 8,2.353},{ 9,2.345},{10,2.336},{11,2.328},{12,2.319},{13,2.311},{14,2.303},{15,2.295},
{16,2.287},{17,2.279},{18,2.271},{19,2.263},{20,2.255},{21,2.248},{22,2.240},{23,2.232},
{24,2.225},{25,2.217},{26,2.210},{27,2.203},{28,2.195},{29,2.188},{30,2.181},{31,2.174},
{32,2.169},{33,2.157},{34,2.151},{35,2.142},{36,2.134},{37,2.126},{38,2.118},{39,2.110},
{40,2.102},{41,2.094},{42,2.087},{43,2.079},{44,2.071},{45,2.064},{46,2.056},{47,2.049},
{48,2.041},{49,2.034},{50,2.027},{51,2.019},{52,2.012},{53,2.005},{54,1.998},{55,1.991},
{56,1.984},{57,1.977},{58,1.970},{59,1.964},{60,1.957},{61,1.950},{62,1.944},{63,1.937},
{64,1.932},{65,1.922},{66,1.917},{67,1.911},{68,1.905},{69,1.898},{70,1.892},{71,1.886},
{72,1.880},{73,1.874},{74,1.868},{75,1.861},{76,1.855},{77,1.850},{78,1.844},{79,1.838},
{80,1.832},{81,1.826},{82,1.820},{83,1.815},{84,1.809},{85,1.803},{86,1.798},{87,1.792},
{88,1.787},{89,1.781},{90,1.776},{91,1.770},{92,1.765},{93,1.759},{94,1.754},{95,1.749},
};
const double CSCGEMRPCTriggerGeometryHelper::lut_me31_wg_eta_even[96][2] = {
{ 0,2.447},{ 1,2.441},{ 2,2.432},{ 3,2.423},{ 4,2.414},{ 5,2.405},{ 6,2.396},{ 7,2.388},
{ 8,2.379},{ 9,2.371},{10,2.362},{11,2.354},{12,2.345},{13,2.337},{14,2.329},{15,2.321},
{16,2.313},{17,2.305},{18,2.297},{19,2.289},{20,2.281},{21,2.273},{22,2.266},{23,2.258},
{24,2.251},{25,2.243},{26,2.236},{27,2.228},{28,2.221},{29,2.214},{30,2.207},{31,2.200},
{32,2.195},{33,2.183},{34,2.176},{35,2.168},{36,2.160},{37,2.152},{38,2.144},{39,2.136},
{40,2.128},{41,2.120},{42,2.112},{43,2.104},{44,2.097},{45,2.089},{46,2.082},{47,2.074},
{48,2.067},{49,2.059},{50,2.052},{51,2.045},{52,2.038},{53,2.031},{54,2.023},{55,2.016},
{56,2.009},{57,2.003},{58,1.996},{59,1.989},{60,1.982},{61,1.975},{62,1.969},{63,1.962},
{64,1.957},{65,1.948},{66,1.943},{67,1.936},{68,1.930},{69,1.924},{70,1.917},{71,1.911},
{72,1.905},{73,1.899},{74,1.893},{75,1.887},{76,1.881},{77,1.875},{78,1.869},{79,1.863},
{80,1.857},{81,1.851},{82,1.845},{83,1.840},{84,1.834},{85,1.828},{86,1.823},{87,1.817},
{88,1.811},{89,1.806},{90,1.800},{91,1.795},{92,1.790},{93,1.784},{94,1.779},{95,1.774},
};
const double CSCGEMRPCTriggerGeometryHelper::lut_me41_wg_eta_odd[96][2] = {
{ 0,2.399},{ 1,2.394},{ 2,2.386},{ 3,2.378},{ 4,2.370},{ 5,2.362},{ 6,2.354},{ 7,2.346},
{ 8,2.339},{ 9,2.331},{10,2.323},{11,2.316},{12,2.308},{13,2.301},{14,2.293},{15,2.286},
{16,2.279},{17,2.272},{18,2.264},{19,2.257},{20,2.250},{21,2.243},{22,2.236},{23,2.229},
{24,2.223},{25,2.216},{26,2.209},{27,2.202},{28,2.196},{29,2.189},{30,2.183},{31,2.176},
{32,2.172},{33,2.161},{34,2.157},{35,2.150},{36,2.144},{37,2.138},{38,2.132},{39,2.126},
{40,2.119},{41,2.113},{42,2.107},{43,2.101},{44,2.095},{45,2.089},{46,2.083},{47,2.078},
{48,2.072},{49,2.066},{50,2.060},{51,2.055},{52,2.049},{53,2.043},{54,2.038},{55,2.032},
{56,2.027},{57,2.021},{58,2.016},{59,2.010},{60,2.005},{61,1.999},{62,1.994},{63,1.989},
{64,1.985},{65,1.977},{66,1.973},{67,1.968},{68,1.963},{69,1.958},{70,1.953},{71,1.947},
{72,1.942},{73,1.937},{74,1.932},{75,1.928},{76,1.923},{77,1.918},{78,1.913},{79,1.908},
{80,1.903},{81,1.898},{82,1.894},{83,1.889},{84,1.884},{85,1.879},{86,1.875},{87,1.870},
{88,1.866},{89,1.861},{90,1.856},{91,1.852},{92,1.847},{93,1.843},{94,1.838},{95,1.834},
};
const double CSCGEMRPCTriggerGeometryHelper::lut_me41_wg_eta_even[96][2] = {
{ 0,2.423},{ 1,2.418},{ 2,2.410},{ 3,2.402},{ 4,2.394},{ 5,2.386},{ 6,2.378},{ 7,2.370},
{ 8,2.362},{ 9,2.355},{10,2.347},{11,2.339},{12,2.332},{13,2.324},{14,2.317},{15,2.310},
{16,2.302},{17,2.295},{18,2.288},{19,2.281},{20,2.274},{21,2.267},{22,2.260},{23,2.253},
{24,2.246},{25,2.239},{26,2.233},{27,2.226},{28,2.219},{29,2.213},{30,2.206},{31,2.199},
{32,2.195},{33,2.185},{34,2.180},{35,2.174},{36,2.168},{37,2.161},{38,2.155},{39,2.149},
{40,2.143},{41,2.137},{42,2.131},{43,2.125},{44,2.119},{45,2.113},{46,2.107},{47,2.101},
{48,2.095},{49,2.089},{50,2.084},{51,2.078},{52,2.072},{53,2.067},{54,2.061},{55,2.055},
{56,2.050},{57,2.044},{58,2.039},{59,2.033},{60,2.028},{61,2.023},{62,2.017},{63,2.012},
{64,2.008},{65,2.000},{66,1.996},{67,1.991},{68,1.986},{69,1.981},{70,1.976},{71,1.971},
{72,1.966},{73,1.961},{74,1.956},{75,1.951},{76,1.946},{77,1.941},{78,1.936},{79,1.931},
{80,1.926},{81,1.921},{82,1.917},{83,1.912},{84,1.907},{85,1.902},{86,1.898},{87,1.893},
{88,1.889},{89,1.884},{90,1.879},{91,1.875},{92,1.870},{93,1.866},{94,1.861},{95,1.857},
};
*/
//using namespace cscgemtriggeom;

/*
// loop on all wiregroups to create a LUT <WG,rollMin,rollMax>
const int numberOfWG(cscChamber->layer(1)->geometry()->numberOfWireGroups());
std::cout <<"detId " << cscChamber->id() << std::endl;
for (int i = 0; i< numberOfWG; ++i){
auto lpc(cscChamber->layer(1)->geometry()->localCenterOfWireGroup(i));
auto gpc(cscChamber->layer(1)->toGlobal(lpc));
auto eta(gpc.eta());
std::cout << "{";
if (i<10) std::cout << " ";
std::cout << i << "," << std::fixed << std::setprecision(3) << std::abs(eta) << "},";
if ((i+1)%8==0 and i!=1) std::cout << std::endl;
}
*/
160 changes: 160 additions & 0 deletions L1Trigger/CSCTriggerPrimitives/src/CSCGEMRPCTriggerGeometryHelper.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
#ifndef CSCTriggerPrimitives_CSCGEMRPCTriggerGeometryHelper_h
#define CSCTriggerPrimitives_CSCGEMRPCTriggerGeometryHelper_h

/** \class CSCGEMRPCTriggerGeometryHelper
*
* Collection of LUTs and helper functions for the
* GEM-CSC and CSC-RPC local integrated triggers
* for the Phase-II Muon upgrade
*
* \author Sven Dildick April 2014
*
*/

#include <DataFormats/MuonDetId/interface/CSCTriggerNumbering.h>
#include <Geometry/GEMGeometry/interface/GEMGeometry.h>
#include <Geometry/GEMGeometry/interface/GEMEtaPartitionSpecs.h>
#include <L1Trigger/CSCCommonTrigger/interface/CSCTriggerGeometry.h>
#include <DataFormats/Math/interface/deltaPhi.h>
#include <DataFormats/Math/interface/normalizedPhi.h>

class CSCGeometry;
class GEMGeometry;
class RPCGeometry;

class CSCGEMRPCTriggerGeometryHelper
{
public:
CSCGEMRPCTriggerGeometryHelper();
~CSCGEMRPCTriggerGeometryHelper();

void setup();

void setCSCGeometry(const CSCGeometry *g) { csc_g = g; }
void setGEMGeometry(const GEMGeometry *g) { gem_g = g; }
void setRPCGeometry(const RPCGeometry *g) { rpc_g = g; }

int cscHalfStripToGEMPad(int st, int hs, bool isEven);
int gemPadToCSCHalfStrip(int st, int pad, bool isEven);

int cscHalfStripToRPCStrip(int st, int hs, bool isEven);
int rpcStripToCSCHalfStrip(int st, int pad, bool isEven);

private:
const CSCGeometry* csc_g;
const GEMGeometry* gem_g;
const RPCGeometry* rpc_g;

// ME11 wire groups are slanted --> min & max
static const double me11_wg_eta_odd[48][3];
static const double me11_wg_eta_even[48][3];

// ME21, ME31 and ME41 wire groups run horizontal
static const double me21_wg_eta_odd[112][2];
static const double me21_wg_eta_even[112][2];

static const double me31_wg_eta_odd[96][2];
static const double me31_wg_eta_even[96][2];

static const double me41_wg_eta_odd[96][2];
static const double me41_wg_eta_even[96][2];

// map GEM or RPC rolls onto wiregroups
static const double me11_gem_roll_eta_odd[10][3];
static const double me11_gem_roll_eta_even[10][3];

static const double me21_short_gem_roll_eta_odd[10][3];
static const double me21_short_gem_roll_eta_even[10][3];

static const double me21_long_gem_roll_eta_odd[10][3];
static const double me21_long_gem_roll_eta_even[10][3];

static const double me31_rpc_roll_eta_odd[10][3];
static const double me31_rpc_roll_eta_even[10][3];

static const double me41_rpc_roll_eta_odd[10][3];
static const double me41_rpc_roll_eta_even[10][3];

// map wiregroups onto rolls (GEM or RPC)
static const int me11_wg_gem_roll_odd[10][3];
static const int me11_wg_gem_roll_even[10][3];

static const int me21_short_wg_gem_roll_odd[10][3];
static const int me21_short_wg_gem_roll_even[10][3];

static const int me21_long_wg_gem_roll_odd[10][3];
static const int me21_long_wg_gem_roll_even[10][3];

static const int me31_wg_gem_roll_odd[10][3];
static const int me31_wg_gem_roll_even[10][3];

static const int me41_wg_gem_roll_odd[10][3];
static const int me41_wg_gem_roll_even[10][3];

// map GEM pads or RPC strips to CSC half-strips
static const int me1a_gem_pad_hs[192][2];
static const int me1b_gem_pad_hs[192][2];

static const int me21_gem_pad_hs[192][2];

static const int me31_rpc_strip_hs[192][2];

static const int me41_rpc_strip_hs[192][2];

// map CSC half-strips onto GEM pads or RPC strips
static const int me1a_hs_gem_pad[192][2];

static const int me1b_hs_gem_pad[192][2];

static const int me21_hs_gem_pad[192][2];

static const int me31_hs_rpc_strip[192][2];

static const int me41_hs_rpc_strip[192][2];
};

#endif

/*
// loop on all wiregroups to create a LUT <WG,rollMin,rollMax>
int numberOfWG(cscChamber->layer(1)->geometry()->numberOfWireGroups());
std::cout <<"detId " << cscChamber->id() << std::endl;
for (int i = 0; i< numberOfWG; ++i){
// find low-eta of WG
auto length(cscChamber->layer(1)->geometry()->lengthOfWireGroup(i));
// auto gp(cscChamber->layer(1)->centerOfWireGroup(i));
auto lpc(cscChamber->layer(1)->geometry()->localCenterOfWireGroup(i));
auto wireEnds(cscChamber->layer(1)->geometry()->wireTopology()->wireEnds(i));
auto gpMin(cscChamber->layer(1)->toGlobal(wireEnds.first));
auto gpMax(cscChamber->layer(1)->toGlobal(wireEnds.second));
auto etaMin(gpMin.eta());
auto etaMax(gpMax.eta());
if (etaMax < etaMin)
std::swap(etaMin,etaMax);
//print the eta min and eta max
// std::cout << i << " " << etaMin << " " << etaMax << std::endl;
auto x1(lpc.x() + cos(cscChamber->layer(1)->geometry()->wireAngle())*length/2.);
auto x2(lpc.x() - cos(cscChamber->layer(1)->geometry()->wireAngle())*length/2.);
auto z(lpc.z());
auto y1(cscChamber->layer(1)->geometry()->yOfWireGroup(i,x1));
auto y2(cscChamber->layer(1)->geometry()->yOfWireGroup(i,x2));
auto lp1(LocalPoint(x1,y1,z));
auto lp2(LocalPoint(x2,y2,z));
auto gp1(cscChamber->layer(1)->toGlobal(lp1));
auto gp2(cscChamber->layer(1)->toGlobal(lp2));
auto eta1(gp1.eta());
auto eta2(gp2.eta());
if (eta1 < eta2)
std::swap(eta1,eta2);
std::cout << "{" << i << ", " << eta1 << ", " << eta2 << "},"<< std::endl;
// Std ::cout << "WG "<< i << std::endl;
// wireGroupGEMRollMap_[i] = assignGEMRoll(gp.eta());
}
// // print-out
// for(auto it = wireGroupGEMRollMap_.begin(); it != wireGroupGEMRollMap_.end(); it++) {
// std::cout << "WG "<< it->first << " GEM pad " << it->second << std::endl;
// }
*/
Loading

0 comments on commit 36f24ee

Please sign in to comment.