CMS 3D CMS Logo

cscdqm::Detector Class Reference

Detector geometry and addressing related imformation and routines. More...

#include <DQM/CSCMonitorModule/interface/CSCDQM_Detector.h>

List of all members.

Public Member Functions

const bool AddressFromString (const std::string str_address, Address &adr) const
const std::string AddressName (const Address &adr) const
 Get the full name of the address prefixed with CSC_.
const float Area (const Address &adr) const
 Calculate address area in eta/phi space.
const float Area (const unsigned int station) const
 Calculate station area in eta/phi space.
 Detector (const unsigned int p_partitions_x=0, const unsigned int p_partitions_y=0)
 Constructor.
const bool NextAddress (unsigned int &i, const Address *&adr, const Address &mask) const
const bool NextAddressBox (unsigned int &i, const AddressBox *&box, const Address &mask) const
const bool NextAddressBoxByPartition (unsigned int &i, const unsigned int px, const unsigned int py, AddressBox *&box)
const unsigned int NumberOfChamberCFEBs (const unsigned int station, const unsigned int ring) const
 Returns the number of CFEBs per Chamber on given Station/Ring.
const unsigned int NumberOfChamberHVs (const unsigned int station, const unsigned int ring) const
 Returns the number of HVs per Chamber on given Station/Ring.
const unsigned int NumberOfChambers (const unsigned int station, const unsigned int ring) const
 Returns the number of chambers for the given station and ring.
const unsigned int NumberOfRings (const unsigned int station) const
 Returns the number of rings for the given station.
void PrintAddress (const Address &adr) const
 Prints address for debugging.

Private Member Functions

const float Eta (const float r, const float z) const
const float EtaToX (const float eta) const
const float PhiMaxCFEB (const int station, const int ring, const int chamber, const int cfeb) const
const float PhiMinCFEB (const int station, const int ring, const int chamber, const int cfeb) const
const float PhiToY (const float phi) const
const float RMaxHV (const int station, const int ring, const int n_hv) const
const float RMinHV (const int station, const int ring, const int n_hv) const
const float Z (const int station, const int ring) const

Private Attributes

AddressBox boxes [N_ELEMENTS]
PartitionMap partitions
unsigned int partitions_offset
unsigned int partitions_x
unsigned int partitions_y
float station_area [N_STATIONS]
AddressBoxStationPartition station_partitions [N_STATIONS]


Detailed Description

Detector geometry and addressing related imformation and routines.

Definition at line 139 of file CSCDQM_Detector.h.


Constructor & Destructor Documentation

cscdqm::Detector::Detector ( const unsigned int  p_partitions_x = 0,
const unsigned int  p_partitions_y = 0 
)

Constructor.

Parameters:
@return 

Definition at line 28 of file CSCDQM_Detector.cc.

References cscdqm::AddressBox::adr, Area(), boxes, cscdqm::Address::cfeb, cscdqm::AddressMask::cfeb, cscdqm::Address::chamber, cscdqm::AddressMask::chamber, Eta(), EtaToX(), cscdqm::AddressBoxStationPartition::from, cscdqm::AddressMask::hv, cscdqm::Address::hv, i, index, int, iter, cscdqm::AddressMask::layer, cscdqm::Address::mask, N_SIDES, N_STATIONS, NumberOfChamberCFEBs(), NumberOfChamberHVs(), NumberOfChambers(), NumberOfRings(), PARTITION_INDEX, PARTITION_STEP_X, PARTITION_STEP_Y, partitions, partitions_x, partitions_y, PhiMaxCFEB(), PhiMinCFEB(), PhiToY(), cscdqm::AddressMask::ring, cscdqm::Address::ring, RMaxHV(), RMinHV(), cscdqm::Address::side, cscdqm::AddressMask::side, cscdqm::Address::station, cscdqm::AddressMask::station, station_area, station_partitions, cscdqm::AddressBoxStationPartition::to, v, x, cscdqm::AddressBox::xmax, cscdqm::AddressBox::xmin, y, cscdqm::AddressBox::ymax, cscdqm::AddressBox::ymin, Z(), and z.

00028                                                                                        {
00029 
00030   partitions_x = p_partitions_x;
00031   partitions_y = p_partitions_y;
00032 
00033   unsigned int i = 0; 
00034   Address adr;
00035 
00036   adr.mask.layer = false;
00037   adr.mask.side = adr.mask.station = adr.mask.ring = adr.mask.chamber = adr.mask.cfeb = adr.mask.hv = true;
00038 
00039   // Creating real eta/phi boxes for available addresses
00040   for (adr.side = 1; adr.side <= N_SIDES; adr.side++) { 
00041     float sign = +1.0;
00042     if(adr.side == 2) sign = -1.0;
00043     for (adr.station = 1; adr.station <= N_STATIONS; adr.station++) {
00044       station_partitions[adr.station - 1].from[adr.side - 1] = i;
00045       for (adr.ring = 1; adr.ring <= NumberOfRings(adr.station); adr.ring++) { 
00046         for (adr.chamber = 1; adr.chamber <= NumberOfChambers(adr.station, adr.ring); adr.chamber++) {
00047           for (adr.cfeb = 1; adr.cfeb <= NumberOfChamberCFEBs(adr.station, adr.ring); adr.cfeb++) {
00048             for (adr.hv = 1; adr.hv <= NumberOfChamberHVs(adr.station, adr.ring); adr.hv++) {
00049 
00050               float z = Z(adr.station, adr.ring);
00051               float r_min = RMinHV(adr.station, adr.ring, adr.hv);
00052               float r_max = RMaxHV(adr.station, adr.ring, adr.hv);
00053               float eta_min = sign * Eta(r_min, z);
00054               float eta_max = sign * Eta(r_max, z);
00055               float x_min = EtaToX(eta_min);
00056               float x_max = EtaToX(eta_max);
00057               float phi_min = 0;
00058               float phi_max = 0;
00059 
00060               if(adr.station == 1 && adr.ring == 1 && adr.hv == 1) {
00061                 phi_min = PhiMinCFEB(adr.station, adr.ring, adr.chamber, 1);
00062                 phi_max = PhiMaxCFEB(adr.station, adr.ring, adr.chamber, NumberOfChamberCFEBs(adr.station, adr.ring));
00063               } else {
00064                 phi_min = PhiMinCFEB(adr.station, adr.ring, adr.chamber, adr.cfeb);
00065                 phi_max = PhiMaxCFEB(adr.station, adr.ring, adr.chamber, adr.cfeb);
00066               }
00067               float y_min = PhiToY(phi_min);
00068               float y_max = PhiToY(phi_max);
00069                 
00070               boxes[i].adr = adr;
00071 
00072               float xboxmin = (x_min < x_max ? x_min : x_max);
00073               float xboxmax = (x_max > x_min ? x_max : x_min);
00074               float yboxmin = (y_min < y_max ? y_min : y_max);
00075               float yboxmax = (y_max > y_min ? y_max : y_min);
00076 
00077               boxes[i].xmin = xboxmin;
00078               boxes[i].xmax = xboxmax;
00079               boxes[i].ymin = yboxmin;
00080               boxes[i].ymax = yboxmax;
00081 
00082               unsigned int x1 = int(floor(xboxmin / PARTITION_STEP_X)) + int(partitions_x / 2);
00083               unsigned int x2 = int( ceil(xboxmax / PARTITION_STEP_X)) + int(partitions_x / 2);
00084               unsigned int y1 = int(floor(yboxmin / PARTITION_STEP_Y));
00085               unsigned int y2 = int( ceil(yboxmax / PARTITION_STEP_Y));
00086 
00087               for (unsigned int x = x1; x < x2; x++) {
00088                 for (unsigned int y = y1; y < y2; y++) {
00089                   
00090                   unsigned int index = PARTITION_INDEX(x, y);
00091                   PartitionMapIterator iter = partitions.find(index);
00092                   if (iter == partitions.end()) {
00093                     std::vector<unsigned int> v;
00094                     partitions.insert(std::make_pair(index, v));
00095                   }
00096                   partitions[index].push_back(i);
00097 
00098                   //LOGINFO("Debug") << index << " = " << partitions[index]->size();
00099 
00100                 }
00101               }
00102 
00103               i++;
00104 
00105             }
00106           }
00107         }
00108       }
00109       station_partitions[adr.station - 1].to[adr.side - 1] = i - 1;
00110     }
00111 
00112   }
00113 
00114   // Cached the most frequently used areas
00115   adr.mask.side = adr.mask.ring = adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
00116   adr.mask.station = true;
00117   adr.station = 1;
00118   station_area[0] = Area(adr);
00119   adr.station = 2;
00120   station_area[1] = Area(adr);
00121   adr.station = 3;
00122   station_area[2] = Area(adr);
00123   adr.station = 4;
00124   station_area[3] = Area(adr);
00125 
00126 }


Member Function Documentation

const bool cscdqm::Detector::AddressFromString ( const std::string  str_address,
Address adr 
) const

Definition at line 539 of file CSCDQM_Detector.cc.

References ADDR_SIZE, cscdqm::Address::cfeb, cscdqm::AddressMask::cfeb, cscdqm::Address::chamber, cscdqm::AddressMask::chamber, cscdqm::AddressMask::hv, cscdqm::Address::hv, cscdqm::AddressMask::layer, cscdqm::Address::layer, cscdqm::Address::mask, funct::num(), r, cscdqm::AddressMask::ring, cscdqm::Address::ring, cscdqm::Address::side, cscdqm::AddressMask::side, splitString(), cscdqm::Address::station, cscdqm::AddressMask::station, cmsScimarkStop::tokens, and cscdqm::Utility::trimString().

Referenced by cscdqm::Summary::setMaskedHWElements().

00539                                                                                       {
00540   
00541   std::vector<std::string> tokens;
00542   Utility::splitString(str_address, ",", tokens);
00543 
00544   if (tokens.size() != ADDR_SIZE) return false;
00545 
00546   for (unsigned int r = 0; r < ADDR_SIZE; r++) {
00547 
00548     std::string token = tokens.at(r);
00549     Utility::trimString(token);
00550     bool mask = false;
00551     unsigned int num  = 0;
00552 
00553     if (token.compare("*") != 0) {
00554       if(stringToNumber<unsigned int>(num, token, std::dec)) {
00555         mask = true;
00556       } else {
00557         return false;
00558       }
00559     }
00560 
00561     switch (r) {
00562       case 0:
00563         adr.mask.side = mask;
00564         adr.side = num;
00565         break;
00566       case 1:
00567         adr.mask.station = mask;
00568         adr.station = num;
00569         break;
00570       case 2:
00571         adr.mask.ring = mask;
00572         adr.ring = num;
00573         break;
00574       case 3:
00575         adr.mask.chamber = mask;
00576         adr.chamber = num;
00577         break;
00578       case 4:
00579         adr.mask.layer = mask;
00580         adr.layer = num;
00581         break;
00582       case 5:
00583         adr.mask.cfeb = mask;
00584         adr.cfeb = num;
00585         break;
00586       case 6:
00587         adr.mask.hv = mask;
00588         adr.hv = num;
00589     }
00590 
00591   } 
00592 
00593   return true;
00594 
00595 }

const std::string cscdqm::Detector::AddressName ( const Address adr  )  const

Get the full name of the address prefixed with CSC_.

It is being used by summaryReportContent variables

Parameters:
adr Address
Returns:
Address name as string

Definition at line 512 of file CSCDQM_Detector.cc.

References cscdqm::Address::cfeb, cscdqm::AddressMask::cfeb, cscdqm::Address::chamber, cscdqm::AddressMask::chamber, cscdqm::AddressMask::hv, cscdqm::Address::hv, cscdqm::AddressMask::layer, cscdqm::Address::layer, cscdqm::Address::mask, cscdqm::AddressMask::ring, cscdqm::Address::ring, cscdqm::Address::side, cscdqm::AddressMask::side, cscdqm::Address::station, and cscdqm::AddressMask::station.

00512                                                               {
00513   std::ostringstream oss;
00514   oss << "CSC";
00515   if (adr.mask.side) {
00516     oss << "_Side" << (adr.side == 1 ? "Plus" : "Minus");
00517     if (adr.mask.station) {
00518       oss << "_Station" << std::setfill('0') << std::setw(2) << adr.station;
00519       if (adr.mask.ring) {
00520         oss << "_Ring" << std::setfill('0') << std::setw(2) << adr.ring;
00521         if (adr.mask.chamber) {
00522           oss << "_Chamber" << std::setfill('0') << std::setw(2) << adr.chamber;
00523           if (adr.mask.layer) {
00524             oss << "_Layer" << std::setfill('0') << std::setw(2) << adr.layer;
00525             if (adr.mask.cfeb) {
00526               oss << "_CFEB" << std::setfill('0') << std::setw(2) << adr.cfeb;
00527               if (adr.mask.hv) {
00528                 oss << "_HV" << std::setfill('0') << std::setw(2) << adr.hv;
00529               }
00530             }
00531           }
00532         }
00533       }
00534     }
00535   }
00536   return oss.str();
00537 }

const float cscdqm::Detector::Area ( const Address adr  )  const

Calculate address area in eta/phi space.

Parameters:
adr Address
Returns:
Area that is being covered by address

Definition at line 145 of file CSCDQM_Detector.cc.

References a, boxes, i, N_ELEMENTS, gen_jpsi2muons_cfg::ymax, and gen_jpsi2muons_cfg::ymin.

00145                                                    {
00146   float a = 0;
00147   for(unsigned int i = 0; i < N_ELEMENTS; i++ ) {
00148     if (boxes[i].adr == adr) {
00149       a += fabs((boxes[i].xmax - boxes[i].xmin) * (boxes[i].ymax - boxes[i].ymin));
00150     }
00151   }
00152   return a;
00153 }

const float cscdqm::Detector::Area ( const unsigned int  station  )  const

Calculate station area in eta/phi space.

Parameters:
station Station number
Returns:
Area that is being covered by station

Definition at line 133 of file CSCDQM_Detector.cc.

References N_STATIONS, and station_area.

Referenced by Detector(), cscdqm::Summary::GetEfficiencyArea(), and cscdqm::Summary::GetReportingArea().

00133                                                            {
00134   if (station > 0 && station <= N_STATIONS) {
00135     return station_area[station - 1];
00136   }
00137   return 0;
00138 }

const float cscdqm::Detector::Eta ( const float  r,
const float  z 
) const [private]

Definition at line 340 of file CSCDQM_Detector.cc.

References funct::log(), and funct::sqrt().

Referenced by Detector().

00340                                                             {
00341   if(r > 0.0 || z > 0.0) {
00342     float sin_theta, cos_theta;
00343     sin_theta = r/sqrt(r*r+z*z);
00344     cos_theta = z/sqrt(r*r+z*z);
00345     return  - log(sin_theta/(cos_theta + 1));
00346   }
00347   if(r == 0.0) return FLT_MAX;
00348   return 0.0;
00349 }

const float cscdqm::Detector::EtaToX ( const float  eta  )  const [private]

Definition at line 353 of file CSCDQM_Detector.cc.

References a, and b.

Referenced by Detector().

00353                                                   {
00354   float x_min   = -2.5;
00355   float x_max   =  2.5;
00356   float eta_min = -2.5;
00357   float eta_max =  2.5;
00358   float a = (x_max - x_min) / (eta_max - eta_min);
00359   float b = (eta_max * x_min - eta_min * x_max) / (eta_max - eta_min);
00360   return a * eta + b;
00361 }

const bool cscdqm::Detector::NextAddress ( unsigned int i,
const Address *&  adr,
const Address mask 
) const

Definition at line 259 of file CSCDQM_Detector.cc.

References cscdqm::AddressBox::adr, boxes, and N_ELEMENTS.

00259                                                                                                 {
00260   for(; i < N_ELEMENTS; i++ ) {
00261     if (boxes[i].adr == mask) {
00262         adr = &boxes[i].adr;
00263         i++;
00264         return true; 
00265     }
00266   }
00267   return false;
00268 }

const bool cscdqm::Detector::NextAddressBox ( unsigned int i,
const AddressBox *&  box,
const Address mask 
) const

Definition at line 270 of file CSCDQM_Detector.cc.

References boxes, and N_ELEMENTS.

Referenced by cscdqm::Summary::Write().

00270                                                                                                       {
00271 
00272   /*
00273   if (mask.mask.station) {
00274     unsigned int side = 1;
00275     if (mask.mask.side) side = mask.side;
00276     if (i == 0) 
00277       i = station_partitions[mask.station - 1].from[side - 1];
00278     else {
00279       if (mask.mask.side) {
00280         if (i > station_partitions[mask.station - 1].to[side - 1])
00281           i = N_ELEMENTS;
00282       } else {
00283         if (i > station_partitions[mask.station - 1].to[0] && i < station_partitions[mask.station - 1].from[1])
00284           i = station_partitions[mask.station - 1].from[1];
00285         else
00286           if (i > station_partitions[mask.station - 1].to[1])
00287             i = N_ELEMENTS;
00288       }
00289     }    
00290   }
00291   */
00292 
00293   for(; i < N_ELEMENTS; i++ ) {
00294     if (boxes[i].adr == mask) {
00295         box = &boxes[i];
00296         i++;
00297         return true; 
00298       }
00299   }
00300   return false;
00301 }

const bool cscdqm::Detector::NextAddressBoxByPartition ( unsigned int i,
const unsigned int  px,
const unsigned int  py,
AddressBox *&  box 
)

Definition at line 303 of file CSCDQM_Detector.cc.

References boxes, index, iter, PARTITION_INDEX, partitions, and size.

Referenced by cscdqm::Summary::IsPhysicsReady().

00303                                                                                                                                {
00304 
00305 /*
00306 const bool Detector::NextAddressBoxByPartition (
00307     unsigned int& i,
00308     unsigned int& px,
00309     unsigned int& py,
00310     const AddressBox*& box,
00311     const Address& mask,
00312     const float xmin, const float xmax,
00313     const float ymin, const float ymax) {
00314 
00315   for(; i < N_ELEMENTS; i++ ) {
00316     if (boxes[i].adr == mask); else continue; 
00317     if ((xmin < boxes[i].xmin && xmax < boxes[i].xmin) || (xmin > boxes[i].xmax && xmax > boxes[i].xmax)) continue;
00318     if ((ymin < boxes[i].ymin && ymax < boxes[i].ymin) || (ymin > boxes[i].ymax && ymax > boxes[i].ymax)) continue;
00319     box = &boxes[i];
00320     i++;
00321     return true; 
00322   }
00323   return false;
00324   */
00325 
00326   unsigned int index = PARTITION_INDEX(px, py);
00327 
00328   PartitionMapIterator iter = partitions.find(index);
00329   if (iter != partitions.end()) {
00330     if (i < partitions[index].size()) {
00331       box = &boxes[partitions[index].at(i)];
00332       i++;
00333       return true; 
00334     }
00335   }
00336   return false;
00337 
00338 }

const unsigned int cscdqm::Detector::NumberOfChamberCFEBs ( const unsigned int  station,
const unsigned int  ring 
) const

Returns the number of CFEBs per Chamber on given Station/Ring.

Parameters:
station Station number (1...4)
ring Ring number (1...3)
Returns:
Number of CFEBs per Chamber

Definition at line 198 of file CSCDQM_Detector.cc.

Referenced by Detector(), cscdqm::Summary::GetEfficiencyHW(), cscdqm::Summary::GetReportingArea(), cscdqm::Summary::GetValue(), PhiMaxCFEB(), PhiMinCFEB(), and cscdqm::Summary::SetValue().

00198                                                                                                            {
00199   if(station == 1 && ring == 1) return 4;
00200   if(station == 1 && ring == 2) return 5;
00201   if(station == 1 && ring == 3) return 4;
00202   if(station == 2 && ring == 1) return 5;
00203   if(station == 2 && ring == 2) return 5;
00204   if(station == 3 && ring == 1) return 5;
00205   if(station == 3 && ring == 2) return 5;
00206   if(station == 4 && ring == 1) return 5;
00207   return 0;
00208 }

const unsigned int cscdqm::Detector::NumberOfChamberHVs ( const unsigned int  station,
const unsigned int  ring 
) const

Returns the number of HVs per Chamber on given Station/Ring.

Parameters:
station Station number (1...4)
ring Ring number (1...3)
Returns:
Number of HVs per Chamber

Definition at line 216 of file CSCDQM_Detector.cc.

Referenced by Detector(), cscdqm::Summary::GetEfficiencyHW(), cscdqm::Summary::GetReportingArea(), cscdqm::Summary::GetValue(), and cscdqm::Summary::SetValue().

00216                                                                                                          {
00217   if(station == 1 && ring == 1) return 2;
00218   if(station == 1 && ring == 2) return 3;
00219   if(station == 1 && ring == 3) return 3;
00220   if(station == 2 && ring == 1) return 3;
00221   if(station == 2 && ring == 2) return 5;
00222   if(station == 3 && ring == 1) return 3;
00223   if(station == 3 && ring == 2) return 5;
00224   if(station == 4 && ring == 1) return 3;
00225   return 0;
00226 }

const unsigned int cscdqm::Detector::NumberOfChambers ( const unsigned int  station,
const unsigned int  ring 
) const

Returns the number of chambers for the given station and ring.

Parameters:
station Station number (1...4)
ring Ring number (1...3)
Returns:
number of chambers

Definition at line 180 of file CSCDQM_Detector.cc.

Referenced by Detector(), cscdqm::Summary::GetEfficiencyHW(), cscdqm::Summary::GetReportingArea(), cscdqm::Summary::GetValue(), PhiMaxCFEB(), PhiMinCFEB(), cscdqm::Summary::SetValue(), and cscdqm::Summary::WriteChamberState().

00180                                                                                                        {
00181   if(station == 1 && ring == 1) return 36;
00182   if(station == 1 && ring == 2) return 36;
00183   if(station == 1 && ring == 3) return 36;
00184   if(station == 2 && ring == 1) return 18;
00185   if(station == 2 && ring == 2) return 36;
00186   if(station == 3 && ring == 1) return 18;
00187   if(station == 3 && ring == 2) return 36;
00188   if(station == 4 && ring == 1) return 18;
00189   return 0;
00190 }

const unsigned int cscdqm::Detector::NumberOfRings ( const unsigned int  station  )  const

Returns the number of rings for the given station.

Parameters:
station Station number (1, 2, 3, 4)
Returns:
number of rings for the given station

Definition at line 160 of file CSCDQM_Detector.cc.

Referenced by Detector(), cscdqm::Summary::GetEfficiencyHW(), cscdqm::Summary::GetReportingArea(), cscdqm::Summary::GetValue(), cscdqm::Summary::SetValue(), cscdqm::EventProcessor::updateEfficiencyHistos(), and cscdqm::Summary::WriteChamberState().

00160                                                                            {
00161   switch (station) {
00162     case 1:
00163       return 3;
00164     case 2:
00165       return 2;
00166     case 3:
00167       return 2;
00168     case 4:
00169       return 1;
00170   }
00171   return 0;
00172 }

const float cscdqm::Detector::PhiMaxCFEB ( const int  station,
const int  ring,
const int  chamber,
const int  cfeb 
) const [private]

Definition at line 496 of file CSCDQM_Detector.cc.

References NumberOfChamberCFEBs(), and NumberOfChambers().

Referenced by Detector().

00496                                                                                                            {
00497   float phi_max_cfeb;
00498   
00499   int n_cfeb = NumberOfChamberCFEBs(station, ring);
00500   int n_chambers = NumberOfChambers(station, ring);
00501   
00502   phi_max_cfeb = 0.0 + 2.0 * 3.14159 / (float) n_chambers * ((float) (chamber - 1) + (float) (cfeb) / (float) n_cfeb);
00503   
00504   return phi_max_cfeb;
00505 }

const float cscdqm::Detector::PhiMinCFEB ( const int  station,
const int  ring,
const int  chamber,
const int  cfeb 
) const [private]

Definition at line 485 of file CSCDQM_Detector.cc.

References NumberOfChamberCFEBs(), and NumberOfChambers().

Referenced by Detector().

00485                                                                                                            {
00486   float phi_min_cfeb;
00487   
00488   int n_cfeb = NumberOfChamberCFEBs(station, ring);
00489   int n_chambers = NumberOfChambers(station, ring);
00490   
00491   phi_min_cfeb = 0.0 + 2.0 * 3.14159 / ((float) (n_chambers)) * ((float) (chamber - 1) + (float) (cfeb - 1) / (float) (n_cfeb));
00492   
00493   return phi_min_cfeb;
00494 }

const float cscdqm::Detector::PhiToY ( const float  phi  )  const [private]

Definition at line 364 of file CSCDQM_Detector.cc.

References a, and b.

Referenced by Detector().

00364                                                   {
00365   float y_min   = 0.0;
00366   float y_max   = 2.0 * 3.14159;
00367   float phi_min = 0.0;
00368   float phi_max = 2.0 * 3.14159;
00369   float a = (y_max - y_min) / (phi_max - phi_min);
00370   float b = (phi_max * y_min - phi_min * y_max) / (phi_max - phi_min);
00371   return a * phi + b;
00372 }

void cscdqm::Detector::PrintAddress ( const Address adr  )  const

Prints address for debugging.

Parameters:
adr Address to print
Returns:

Definition at line 233 of file CSCDQM_Detector.cc.

References cscdqm::Address::cfeb, cscdqm::AddressMask::cfeb, cscdqm::Address::chamber, cscdqm::AddressMask::chamber, GenMuonPlsPt100GeV_cfg::cout, lat::endl(), cscdqm::AddressMask::hv, cscdqm::Address::hv, cscdqm::AddressMask::layer, cscdqm::Address::layer, cscdqm::Address::mask, cscdqm::AddressMask::ring, cscdqm::Address::ring, cscdqm::Address::side, cscdqm::AddressMask::side, cscdqm::Address::station, and cscdqm::AddressMask::station.

00233                                                     {
00234 
00235   std::cout << "Side (" << std::boolalpha << adr.mask.side << ")"; 
00236   if (adr.mask.side) std::cout <<  " = " << adr.side;
00237 
00238   std::cout << ", Station (" << std::boolalpha << adr.mask.station << ")"; 
00239   if (adr.mask.station) std::cout << " = " << adr.station;
00240 
00241   std::cout << ", Ring (" << std::boolalpha << adr.mask.ring << ")"; 
00242   if (adr.mask.ring) std::cout << " = " << adr.ring;
00243 
00244   std::cout << ", Chamber (" << std::boolalpha << adr.mask.chamber << ")"; 
00245   if (adr.mask.chamber) std::cout << " = " << adr.chamber;
00246 
00247   std::cout << ", Layer (" << std::boolalpha << adr.mask.layer << ")"; 
00248   if (adr.mask.layer) std::cout << " = " << adr.layer;
00249 
00250   std::cout << ", CFEB (" << std::boolalpha << adr.mask.cfeb << ")"; 
00251   if (adr.mask.cfeb) std::cout << " = " << adr.cfeb;
00252 
00253   std::cout << ", HV (" << std::boolalpha << adr.mask.hv << ")"; 
00254   if (adr.mask.hv) std::cout << " = " << adr.hv;
00255 
00256   std::cout << std::endl;
00257 }

const float cscdqm::Detector::RMaxHV ( const int  station,
const int  ring,
const int  n_hv 
) const [private]

Definition at line 436 of file CSCDQM_Detector.cc.

Referenced by Detector().

00436                                                                                     {
00437   float r_max_hv = 0;
00438   
00439   if(station == 1 && ring == 1) {
00440     if(n_hv == 1) r_max_hv = 1500.0;
00441     if(n_hv == 2) r_max_hv = 2565.0;
00442   }
00443   
00444   if(station == 1 && ring == 2) {
00445     if(n_hv == 1) r_max_hv = 3368.2;
00446     if(n_hv == 2) r_max_hv = 4025.7;
00447     if(n_hv == 3) r_max_hv = 4559.9;
00448   }
00449   
00450   if(station == 1 && ring == 3) {
00451     if(n_hv == 1) r_max_hv = 5724.1;
00452     if(n_hv == 2) r_max_hv = 6230.2;
00453     if(n_hv == 3) r_max_hv = 6761.5;
00454   }
00455   
00456   if(station == 2 && ring == 1) {
00457     if(n_hv == 1) r_max_hv = 2152.3;
00458     if(n_hv == 2) r_max_hv = 2763.7;
00459     if(n_hv == 3) r_max_hv = 3365.8;
00460   }
00461   
00462   if(station == 3 && ring == 1) {
00463     if(n_hv == 1) r_max_hv = 2164.9;
00464     if(n_hv == 2) r_max_hv = 2763.8;
00465     if(n_hv == 3) r_max_hv = 3365.8;
00466   }
00467   
00468   if(station == 4 && ring == 1) {
00469     if(n_hv == 1) r_max_hv = 2365.9;
00470     if(n_hv == 2) r_max_hv = 2865.0;
00471     if(n_hv == 3) r_max_hv = 3356.3;
00472   }
00473   
00474   if((station == 2 || station == 3 || station == 4) && ring == 2) {
00475     if(n_hv == 1) r_max_hv = 4446.3;
00476     if(n_hv == 2) r_max_hv = 5053.2;
00477     if(n_hv == 3) r_max_hv = 5660.1;
00478     if(n_hv == 4) r_max_hv = 6267.0;
00479     if(n_hv == 5) r_max_hv = 6870.8;
00480   }
00481   
00482   return r_max_hv;
00483 }

const float cscdqm::Detector::RMinHV ( const int  station,
const int  ring,
const int  n_hv 
) const [private]

Definition at line 387 of file CSCDQM_Detector.cc.

Referenced by Detector().

00387                                                                                     {
00388   float r_min_hv = 0;
00389   
00390   if(station == 1 && ring == 1) {
00391     if(n_hv == 1) r_min_hv = 1060.0;
00392     if(n_hv == 2) r_min_hv = 1500.0;
00393   }
00394   
00395   if(station == 1 && ring == 2) {
00396     if(n_hv == 1) r_min_hv = 2815.0;
00397     if(n_hv == 2) r_min_hv = 3368.2;
00398     if(n_hv == 3) r_min_hv = 4025.7;
00399   }
00400   
00401   if(station == 1 && ring == 3) {
00402     if(n_hv == 1) r_min_hv = 5120.0;
00403     if(n_hv == 2) r_min_hv = 5724.1;
00404     if(n_hv == 3) r_min_hv = 6230.2;
00405   }
00406   
00407   if(station == 2 && ring == 1) {
00408     if(n_hv == 1) r_min_hv = 1469.2;
00409     if(n_hv == 2) r_min_hv = 2152.3;
00410     if(n_hv == 3) r_min_hv = 2763.7;
00411   }
00412   
00413   if(station == 3 && ring == 1) {
00414     if(n_hv == 1) r_min_hv = 1668.9;
00415     if(n_hv == 2) r_min_hv = 2164.9;
00416     if(n_hv == 3) r_min_hv = 2763.8;
00417   }
00418   
00419   if(station == 4 && ring == 1) {
00420     if(n_hv == 1) r_min_hv = 1876.1;
00421     if(n_hv == 2) r_min_hv = 2365.9;
00422     if(n_hv == 3) r_min_hv = 2865.0;
00423   }
00424   
00425   if((station == 2 || station == 3 || station == 4) && ring == 2) {
00426     if(n_hv == 1) r_min_hv = 3640.2;
00427     if(n_hv == 2) r_min_hv = 4446.3;
00428     if(n_hv == 3) r_min_hv = 5053.2;
00429     if(n_hv == 4) r_min_hv = 5660.1;
00430     if(n_hv == 5) r_min_hv = 6267.0;
00431   }
00432   
00433   return r_min_hv;
00434 }

const float cscdqm::Detector::Z ( const int  station,
const int  ring 
) const [private]

Definition at line 374 of file CSCDQM_Detector.cc.

Referenced by Detector().

00374                                                                {
00375   float z_csc = 0;
00376   
00377   if(station == 1 && ring == 1) z_csc = (5834.5 + 6101.5) / 2.0;
00378   if(station == 1 && ring == 2) z_csc = (6790.0 + 7064.3) / 2.0;
00379   if(station == 1 && ring == 3) z_csc = 6888.0;
00380   if(station == 2) z_csc = (8098.0 + 8346.0) / 2.0;
00381   if(station == 3) z_csc = (9414.8 + 9166.8) / 2.0;
00382   if(station == 4) z_csc = 10630.0; // has to be corrected
00383   
00384   return z_csc;
00385 }


Member Data Documentation

AddressBox cscdqm::Detector::boxes[N_ELEMENTS] [private]

Definition at line 173 of file CSCDQM_Detector.h.

Referenced by Area(), Detector(), NextAddress(), NextAddressBox(), and NextAddressBoxByPartition().

PartitionMap cscdqm::Detector::partitions [private]

Definition at line 181 of file CSCDQM_Detector.h.

Referenced by Detector(), and NextAddressBoxByPartition().

unsigned int cscdqm::Detector::partitions_offset [private]

Definition at line 178 of file CSCDQM_Detector.h.

unsigned int cscdqm::Detector::partitions_x [private]

Definition at line 176 of file CSCDQM_Detector.h.

Referenced by Detector().

unsigned int cscdqm::Detector::partitions_y [private]

Definition at line 177 of file CSCDQM_Detector.h.

Referenced by Detector().

float cscdqm::Detector::station_area[N_STATIONS] [private]

Definition at line 174 of file CSCDQM_Detector.h.

Referenced by Area(), and Detector().

AddressBoxStationPartition cscdqm::Detector::station_partitions[N_STATIONS] [private]

Definition at line 182 of file CSCDQM_Detector.h.

Referenced by Detector().


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