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 Member Functions | Private Attributes
cscdqm::Detector Class Reference

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

#include <CSCDQM_Detector.h>

Public Member Functions

const bool AddressFromString (const std::string &str_address, Address &adr) const
 Construct address from string. More...
 
const float Area (const unsigned int station) const
 Calculate station area in eta/phi space. More...
 
const float Area (const Address &adr) const
 Calculate address area in eta/phi space. More...
 
 Detector (const unsigned int p_partitions_x=0, const unsigned int p_partitions_y=0)
 Constructor. More...
 
unsigned int GlobalChamberIndex (unsigned int side, unsigned int station, unsigned int ring, unsigned int chamber) const
 Return global chamber index on his geometric location. More...
 
const bool NextAddress (unsigned int &i, const Address *&adr, const Address &mask) const
 Address iterator by mask. More...
 
const bool NextAddressBox (unsigned int &i, const AddressBox *&box, const Address &mask) const
 Address box iterator by mask. More...
 
const bool NextAddressBoxByPartition (unsigned int &i, const unsigned int px, const unsigned int py, AddressBox *&box)
 Address box iterator by partition. More...
 
const unsigned int NumberOfChamberCFEBs (const unsigned int station, const unsigned int ring) const
 Returns the number of CFEBs per Chamber on given Station/Ring. More...
 
const unsigned int NumberOfChamberHVs (const unsigned int station, const unsigned int ring) const
 Returns the number of HVs per Chamber on given Station/Ring. More...
 
const unsigned int NumberOfChambers (const unsigned int station, const unsigned int ring) const
 Returns the number of chambers for the given station and ring. More...
 
const unsigned int NumberOfRings (const unsigned int station) const
 Returns the number of rings for the given station. More...
 
void PrintAddress (const Address &adr) const
 Prints address for debugging. More...
 

Private Member Functions

const float Eta (const float r, const float z) const
 
const float EtaToX (const float eta) const
 Transform eta coordinate to local canvas coordinate. More...
 
const float PhiMaxCFEB (const int station, const int ring, const int chamber, const int cfeb) const
 Get Max phi boundary for particular CFEB. More...
 
const float PhiMinCFEB (const int station, const int ring, const int chamber, const int cfeb) const
 Get Min phi boundary for particular CFEB. More...
 
const float PhiToY (const float phi) const
 Transform phi coordinate to local canvas coordinate. More...
 
const float RMaxHV (const int station, const int ring, const int n_hv) const
 Get R max parameter (used in address eta/phi calculation) More...
 
const float RMinHV (const int station, const int ring, const int n_hv) const
 Get R min parameter (used in address eta/phi calculation) More...
 
const float Z (const int station, const int ring) const
 Get Z parameter (used in address eta/phi calculation) More...
 

Private Attributes

AddressBox boxes [9540]
 
PartitionMap partitions
 
unsigned int partitions_x
 
unsigned int partitions_y
 
float station_area [4]
 

Detailed Description

Detector geometry and addressing related imformation and routines.

Definition at line 183 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
p_partition_xNumber of efficiency partitions on X axis
p_partition_yNumber of efficiency partitions on Y axis
Returns

Creating real eta/phi boxes for available addresses

Address box calculated successfully. Now lets cache its partition elements for performace.

Cached the most frequently used areas

Definition at line 33 of file CSCDQM_Detector.cc.

References cscdqm::AddressBox::adr, Area(), boxes, cscdqm::AddressMask::cfeb, cscdqm::Address::cfeb, cscdqm::AddressMask::chamber, cscdqm::Address::chamber, Eta(), EtaToX(), cscdqm::AddressMask::hv, cscdqm::Address::hv, i, cmsHarvester::index, 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::AddressMask::side, cscdqm::Address::side, jetcorrextractor::sign(), cscdqm::AddressMask::station, cscdqm::Address::station, station_area, findQualityFiles::v, x(), cscdqm::AddressBox::xmax, cscdqm::AddressBox::xmin, cscdqm::AddressBox::ymax, cscdqm::AddressBox::ymin, and Z().

33  {
34 
35  partitions_x = p_partitions_x;
36  partitions_y = p_partitions_y;
37 
38  unsigned int i = 0;
39  Address adr;
40 
41  adr.mask.layer = false;
42  adr.mask.side = adr.mask.station = adr.mask.ring = adr.mask.chamber = adr.mask.cfeb = adr.mask.hv = true;
43 
45  for (adr.side = 1; adr.side <= N_SIDES; adr.side++) {
46  float sign = +1.0;
47  if(adr.side == 2) sign = -1.0;
48  for (adr.station = 1; adr.station <= N_STATIONS; adr.station++) {
49  for (adr.ring = 1; adr.ring <= NumberOfRings(adr.station); adr.ring++) {
50  for (adr.chamber = 1; adr.chamber <= NumberOfChambers(adr.station, adr.ring); adr.chamber++) {
51  for (adr.cfeb = 1; adr.cfeb <= NumberOfChamberCFEBs(adr.station, adr.ring); adr.cfeb++) {
52  for (adr.hv = 1; adr.hv <= NumberOfChamberHVs(adr.station, adr.ring); adr.hv++) {
53 
54  float z = Z(adr.station, adr.ring);
55  float r_min = RMinHV(adr.station, adr.ring, adr.hv);
56  float r_max = RMaxHV(adr.station, adr.ring, adr.hv);
57  float eta_min = sign * Eta(r_min, z);
58  float eta_max = sign * Eta(r_max, z);
59  float x_min = EtaToX(eta_min);
60  float x_max = EtaToX(eta_max);
61  float phi_min = 0;
62  float phi_max = 0;
63 
64  if(adr.station == 1 && adr.ring == 1 && adr.hv == 1) {
65  phi_min = PhiMinCFEB(adr.station, adr.ring, adr.chamber, 1);
66  phi_max = PhiMaxCFEB(adr.station, adr.ring, adr.chamber, NumberOfChamberCFEBs(adr.station, adr.ring));
67  } else {
68  phi_min = PhiMinCFEB(adr.station, adr.ring, adr.chamber, adr.cfeb);
69  phi_max = PhiMaxCFEB(adr.station, adr.ring, adr.chamber, adr.cfeb);
70  }
71 
72  float y_min = PhiToY(phi_min);
73  float y_max = PhiToY(phi_max);
74 
75  boxes[i].adr = adr;
76 
77  float xboxmin = (x_min < x_max ? x_min : x_max);
78  float xboxmax = (x_max > x_min ? x_max : x_min);
79  float yboxmin = (y_min < y_max ? y_min : y_max);
80  float yboxmax = (y_max > y_min ? y_max : y_min);
81 
82  boxes[i].xmin = xboxmin;
83  boxes[i].xmax = xboxmax;
84  boxes[i].ymin = yboxmin;
85  boxes[i].ymax = yboxmax;
86 
90  unsigned int x1 = int(floor(xboxmin / PARTITION_STEP_X)) + int(partitions_x / 2);
91  unsigned int x2 = int( ceil(xboxmax / PARTITION_STEP_X)) + int(partitions_x / 2);
92  unsigned int y1 = int(floor(yboxmin / PARTITION_STEP_Y));
93  unsigned int y2 = int( ceil(yboxmax / PARTITION_STEP_Y));
94 
95  for (unsigned int x = x1; x < x2; x++) {
96  for (unsigned int y = y1; y < y2; y++) {
97 
98  unsigned int index = PARTITION_INDEX(x, y);
99  PartitionMapIterator iter = partitions.find(index);
100  if (iter == partitions.end()) {
101  std::vector<unsigned int> v;
102  partitions.insert(std::make_pair(index, v));
103  }
104  partitions[index].push_back(i);
105 
106  }
107  }
108 
109  i++;
110 
111  }
112  }
113  }
114  }
115  }
116 
117  }
118 
120  adr.mask.side = adr.mask.ring = adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
121  adr.mask.station = true;
122  adr.station = 1;
123  station_area[0] = Area(adr);
124  adr.station = 2;
125  station_area[1] = Area(adr);
126  adr.station = 3;
127  station_area[2] = Area(adr);
128  adr.station = 4;
129  station_area[3] = Area(adr);
130 
131  }
PartitionMap partitions
int i
Definition: DBlmapReader.cc:9
unsigned int partitions_y
PartitionMap::iterator PartitionMapIterator
const float Area(const unsigned int station) const
Calculate station area in eta/phi space.
const float Z(const int station, const int ring) const
Get Z parameter (used in address eta/phi calculation)
unsigned int partitions_x
double sign(double x)
const float RMinHV(const int station, const int ring, const int n_hv) const
Get R min parameter (used in address eta/phi calculation)
const unsigned int NumberOfRings(const unsigned int station) const
Returns the number of rings for the given station.
const float EtaToX(const float eta) const
Transform eta coordinate to local canvas coordinate.
#define PARTITION_INDEX(x, y)
const unsigned int NumberOfChamberCFEBs(const unsigned int station, const unsigned int ring) const
Returns the number of CFEBs per Chamber on given Station/Ring.
#define PARTITION_STEP_Y
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 float PhiMinCFEB(const int station, const int ring, const int chamber, const int cfeb) const
Get Min phi boundary for particular CFEB.
#define N_STATIONS
#define PARTITION_STEP_X
#define N_SIDES
const float Eta(const float r, const float z) const
const float PhiToY(const float phi) const
Transform phi coordinate to local canvas coordinate.
AddressBox boxes[9540]
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 float PhiMaxCFEB(const int station, const int ring, const int chamber, const int cfeb) const
Get Max phi boundary for particular CFEB.
const float RMaxHV(const int station, const int ring, const int n_hv) const
Get R max parameter (used in address eta/phi calculation)

Member Function Documentation

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

Construct address from string.

Parameters
str_addressAddress in string
adrAddress to return
Returns
true if address was successfully created, false - otherwise

Definition at line 572 of file CSCDQM_Detector.cc.

References ADDR_SIZE, cscdqm::AddressMask::cfeb, cscdqm::Address::cfeb, cscdqm::AddressMask::chamber, cscdqm::Address::chamber, TauDecayModes::dec, cscdqm::AddressMask::hv, cscdqm::Address::hv, cscdqm::AddressMask::layer, cscdqm::Address::layer, cscdqm::Address::mask, pileupDistInMC::num, alignCSCRings::r, cscdqm::AddressMask::ring, cscdqm::Address::ring, cscdqm::AddressMask::side, cscdqm::Address::side, cscdqm::Utility::splitString(), cscdqm::AddressMask::station, cscdqm::Address::station, AlCaHLTBitMon_QueryRunRegistry::string, unpackBuffers-CaloStage2::token, and cscdqm::Utility::trimString().

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

572  {
573 
574  std::vector<std::string> tokens;
575  Utility::splitString(str_address, ",", tokens);
576 
577  if (tokens.size() != ADDR_SIZE) return false;
578 
579  for (unsigned int r = 0; r < ADDR_SIZE; r++) {
580 
581  std::string token = tokens.at(r);
582  Utility::trimString(token);
583  bool mask = false;
584  unsigned int num = 0;
585 
586  if (token.compare("*") != 0) {
587  if(stringToNumber<unsigned int>(num, token, std::dec)) {
588  mask = true;
589  } else {
590  return false;
591  }
592  }
593 
594  switch (r) {
595  case 0:
596  adr.mask.side = mask;
597  adr.side = num;
598  break;
599  case 1:
600  adr.mask.station = mask;
601  adr.station = num;
602  break;
603  case 2:
604  adr.mask.ring = mask;
605  adr.ring = num;
606  break;
607  case 3:
608  adr.mask.chamber = mask;
609  adr.chamber = num;
610  break;
611  case 4:
612  adr.mask.layer = mask;
613  adr.layer = num;
614  break;
615  case 5:
616  adr.mask.cfeb = mask;
617  adr.cfeb = num;
618  break;
619  case 6:
620  adr.mask.hv = mask;
621  adr.hv = num;
622  }
623 
624  }
625 
626  return true;
627 
628  }
static void splitString(const std::string &str, const std::string &delim, std::vector< std::string > &results)
Split string according to delimiter.
static void trimString(std::string &str)
Trim string.
#define ADDR_SIZE
const float cscdqm::Detector::Area ( const unsigned int  station) const

Calculate station area in eta/phi space.

Parameters
stationStation number
Returns
Area that is being covered by station

Definition at line 138 of file CSCDQM_Detector.cc.

References N_STATIONS, and station_area.

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

138  {
139  if (station > 0 && station <= N_STATIONS) {
140  return station_area[station - 1];
141  }
142  return 0;
143  }
#define N_STATIONS
const float cscdqm::Detector::Area ( const Address adr) const

Calculate address area in eta/phi space.

Parameters
adrAddress
Returns
Area that is being covered by address

Definition at line 184 of file CSCDQM_Detector.cc.

References a, boxes, i, N_ELEMENTS, SiStripMonitorClusterAlca_cfi::xmax, SiStripMonitorClusterAlca_cfi::xmin, SiStripMonitorClusterAlca_cfi::ymax, and SiStripMonitorClusterAlca_cfi::ymin.

184  {
185  float a = 0;
186  for(unsigned int i = 0; i < N_ELEMENTS; i++ ) {
187  if (boxes[i].adr == adr) {
188  a += fabs((boxes[i].xmax - boxes[i].xmin) * (boxes[i].ymax - boxes[i].ymin));
189  }
190  }
191  return a;
192  }
int i
Definition: DBlmapReader.cc:9
#define N_ELEMENTS
double a
Definition: hdecay.h:121
AddressBox boxes[9540]
const float cscdqm::Detector::Eta ( const float  r,
const float  z 
) const
private

Definition at line 356 of file CSCDQM_Detector.cc.

References dqm-mbProfile::log, and mathSSE::sqrt().

Referenced by Detector().

356  {
357  if(r > 0.0 || z > 0.0) {
358  float sin_theta = r / sqrt(r * r + z * z);
359  float cos_theta = z / sqrt(r * r + z * z);
360  return - log(sin_theta / (cos_theta + 1));
361  }
362  if(r == 0.0) return FLT_MAX;
363  return 0.0;
364  }
T sqrt(T t)
Definition: SSEVec.h:18
const float cscdqm::Detector::EtaToX ( const float  eta) const
private

Transform eta coordinate to local canvas coordinate.

Parameters
etaEta coordinate
Returns
local canvas coordinate

Definition at line 372 of file CSCDQM_Detector.cc.

References a, and b.

Referenced by Detector().

372  {
373  float x_min = -2.5;
374  float x_max = 2.5;
375  float eta_min = -2.5;
376  float eta_max = 2.5;
377  float a = (x_max - x_min) / (eta_max - eta_min);
378  float b = (eta_max * x_min - eta_min * x_max) / (eta_max - eta_min);
379  return a * eta + b;
380  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
unsigned int cscdqm::Detector::GlobalChamberIndex ( unsigned int  side,
unsigned int  station,
unsigned int  ring,
unsigned int  chamber 
) const

Return global chamber index on his geometric location.

Parameters
sideSide (1,2)
stationStation
ringRing\
chamberChamber position
Returns
Global chamber index starting 1. If chamber is not existing - returns 0

Definition at line 153 of file CSCDQM_Detector.cc.

References cscdqm::AddressMask::cfeb, cscdqm::AddressMask::chamber, cscdqm::Address::chamber, cscdqm::AddressMask::hv, i, cscdqm::AddressMask::layer, cscdqm::Address::mask, N_SIDES, N_STATIONS, NumberOfChambers(), NumberOfRings(), relativeConstraints::ring, cscdqm::AddressMask::ring, cscdqm::Address::ring, cscdqm::AddressMask::side, cscdqm::Address::side, relativeConstraints::station, cscdqm::AddressMask::station, and cscdqm::Address::station.

Referenced by cscdqm::EventProcessor::processCSC().

153  {
154  Address adr, iadr;
155  adr.mask.side = adr.mask.station = adr.mask.ring = adr.mask.chamber = true;
156  adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
157  adr.side = side;
158  adr.station = station;
159  adr.ring = ring;
160  adr.chamber = chamber;
161  iadr = adr;
162 
163  unsigned int i = 1;
164  for (iadr.side = 1; iadr.side <= N_SIDES; iadr.side++) {
165  for (iadr.station = 1; iadr.station <= N_STATIONS; iadr.station++) {
166  for (iadr.ring = 1; iadr.ring <= NumberOfRings(iadr.station); iadr.ring++) {
167  for (iadr.chamber = 1; iadr.chamber <= NumberOfChambers(iadr.station, iadr.ring); iadr.chamber++) {
168  if (iadr == adr) {
169  return i;
170  }
171  i += 1;
172  }
173  }
174  }
175  }
176  return 0;
177  }
int i
Definition: DBlmapReader.cc:9
const unsigned int NumberOfRings(const unsigned int station) const
Returns the number of rings for the given station.
#define N_STATIONS
#define N_SIDES
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 bool cscdqm::Detector::NextAddress ( unsigned int &  i,
const Address *&  adr,
const Address mask 
) const

Address iterator by mask.

Parameters
iIterator
adrAddress to return
maskfor addresses
Returns
true if address was found and filled in, false - otherwise

Definition at line 302 of file CSCDQM_Detector.cc.

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

302  {
303  for(; i < N_ELEMENTS; i++ ) {
304  if (boxes[i].adr == mask) {
305  adr = &boxes[i].adr;
306  i++;
307  return true;
308  }
309  }
310  return false;
311  }
int i
Definition: DBlmapReader.cc:9
#define N_ELEMENTS
AddressBox boxes[9540]
const bool cscdqm::Detector::NextAddressBox ( unsigned int &  i,
const AddressBox *&  box,
const Address mask 
) const

Address box iterator by mask.

Parameters
iIterator
adrAddressBox to return
maskfor addresses
Returns
true if address box was found and filled in, false - otherwise

Definition at line 320 of file CSCDQM_Detector.cc.

References boxes, i, and N_ELEMENTS.

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

320  {
321 
322  for(; i < N_ELEMENTS; i++ ) {
323  if (boxes[i].adr == mask) {
324  box = &boxes[i];
325  i++;
326  return true;
327  }
328  }
329  return false;
330  }
int i
Definition: DBlmapReader.cc:9
#define N_ELEMENTS
AddressBox boxes[9540]
const bool cscdqm::Detector::NextAddressBoxByPartition ( unsigned int &  i,
const unsigned int  px,
const unsigned int  py,
AddressBox *&  box 
)

Address box iterator by partition.

Parameters
iIterator
pxPartition x index
pyPartition y index
boxAddressBox to return
Returns
true if address box was found and filled in, false - otherwise

Definition at line 340 of file CSCDQM_Detector.cc.

References boxes, cmsHarvester::index, PARTITION_INDEX, partitions, and findQualityFiles::size.

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

340  {
341 
342  unsigned int index = PARTITION_INDEX(px, py);
343 
344  PartitionMapIterator iter = partitions.find(index);
345  if (iter != partitions.end()) {
346  if (i < partitions[index].size()) {
347  box = &boxes[partitions[index].at(i)];
348  i++;
349  return true;
350  }
351  }
352  return false;
353 
354  }
PartitionMap partitions
int i
Definition: DBlmapReader.cc:9
PartitionMap::iterator PartitionMapIterator
#define PARTITION_INDEX(x, y)
AddressBox boxes[9540]
tuple size
Write out results.
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
stationStation number (1...4)
ringRing number (1...3)
Returns
Number of CFEBs per Chamber

Definition at line 232 of file CSCDQM_Detector.cc.

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

232  {
233  if(station == 1 && ring == 1) return 4;
234  if(station == 1 && ring == 2) return 5;
235  if(station == 1 && ring == 3) return 4;
236  if(station == 2 && ring == 1) return 5;
237  if(station == 2 && ring == 2) return 5;
238  if(station == 3 && ring == 1) return 5;
239  if(station == 3 && ring == 2) return 5;
240  if(station == 4 && ring == 1) return 5;
241  if(station == 4 && ring == 2) return 5;
242  return 0;
243  }
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
stationStation number (1...4)
ringRing number (1...3)
Returns
Number of HVs per Chamber

Definition at line 251 of file CSCDQM_Detector.cc.

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

251  {
252  if(station == 1 && ring == 1) return 2;
253  if(station == 1 && ring == 2) return 3;
254  if(station == 1 && ring == 3) return 3;
255  if(station == 2 && ring == 1) return 3;
256  if(station == 2 && ring == 2) return 5;
257  if(station == 3 && ring == 1) return 3;
258  if(station == 3 && ring == 2) return 5;
259  if(station == 4 && ring == 1) return 3;
260  if(station == 4 && ring == 2) return 5;
261  return 0;
262  }
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
stationStation number (1...4)
ringRing number (1...3)
Returns
number of chambers

Definition at line 213 of file CSCDQM_Detector.cc.

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

213  {
214  if(station == 1 && ring == 1) return 36;
215  if(station == 1 && ring == 2) return 36;
216  if(station == 1 && ring == 3) return 36;
217  if(station == 2 && ring == 1) return 18;
218  if(station == 2 && ring == 2) return 36;
219  if(station == 3 && ring == 1) return 18;
220  if(station == 3 && ring == 2) return 36;
221  if(station == 4 && ring == 1) return 18;
222  if(station == 4 && ring == 2) return 36;
223  return 0;
224  }
const unsigned int cscdqm::Detector::NumberOfRings ( const unsigned int  station) const

Returns the number of rings for the given station.

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

Definition at line 199 of file CSCDQM_Detector.cc.

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

199  {
200  if (station == 1) return 3;
201  if (station == 2) return 2;
202  if (station == 3) return 2;
203  if (station == 4) return 2;
204  return 0;
205  }
const float cscdqm::Detector::PhiMaxCFEB ( const int  station,
const int  ring,
const int  chamber,
const int  cfeb 
) const
private

Get Max phi boundary for particular CFEB.

Parameters
stationStation number
ringRing number
chamberChamber number
cfebCFEB number
Returns
Max phi CFEB boundary

Definition at line 555 of file CSCDQM_Detector.cc.

References NumberOfChamberCFEBs(), and NumberOfChambers().

Referenced by Detector().

555  {
556  float phi_max_cfeb;
557 
558  int n_cfeb = NumberOfChamberCFEBs(station, ring);
559  int n_chambers = NumberOfChambers(station, ring);
560 
561  phi_max_cfeb = 0.0 + 2.0 * 3.14159 / (float) n_chambers * ((float) (chamber - 1) + (float) (cfeb) / (float) n_cfeb);
562 
563  return phi_max_cfeb;
564  }
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 NumberOfChambers(const unsigned int station, const unsigned int ring) const
Returns the number of chambers for the given station and ring.
const float cscdqm::Detector::PhiMinCFEB ( const int  station,
const int  ring,
const int  chamber,
const int  cfeb 
) const
private

Get Min phi boundary for particular CFEB.

Parameters
stationStation number
ringRing number
chamberChamber number
cfebCFEB number
Returns
Min phi CFEB boundary

Definition at line 536 of file CSCDQM_Detector.cc.

References NumberOfChamberCFEBs(), and NumberOfChambers().

Referenced by Detector().

536  {
537  float phi_min_cfeb;
538 
539  int n_cfeb = NumberOfChamberCFEBs(station, ring);
540  int n_chambers = NumberOfChambers(station, ring);
541 
542  phi_min_cfeb = 0.0 + 2.0 * 3.14159 / ((float) (n_chambers)) * ((float) (chamber - 1) + (float) (cfeb - 1) / (float) (n_cfeb));
543 
544  return phi_min_cfeb;
545  }
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 NumberOfChambers(const unsigned int station, const unsigned int ring) const
Returns the number of chambers for the given station and ring.
const float cscdqm::Detector::PhiToY ( const float  phi) const
private

Transform phi coordinate to local canvas coordinate.

Parameters
phiPhi coordinate
Returns
local canvas coordinate

Definition at line 387 of file CSCDQM_Detector.cc.

References a, and b.

Referenced by Detector().

387  {
388  float y_min = 0.0;
389  float y_max = 2.0 * 3.14159;
390  float phi_min = 0.0;
391  float phi_max = 2.0 * 3.14159;
392  float a = (y_max - y_min) / (phi_max - phi_min);
393  float b = (phi_max * y_min - phi_min * y_max) / (phi_max - phi_min);
394  return a * phi + b;
395  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
void cscdqm::Detector::PrintAddress ( const Address adr) const

Prints address for debugging.

Parameters
adrAddress to print
Returns

Definition at line 269 of file CSCDQM_Detector.cc.

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

269  {
270 
271  std::cout << "Side (" << std::boolalpha << adr.mask.side << ")";
272  if (adr.mask.side) std::cout << " = " << adr.side;
273 
274  std::cout << ", Station (" << std::boolalpha << adr.mask.station << ")";
275  if (adr.mask.station) std::cout << " = " << adr.station;
276 
277  std::cout << ", Ring (" << std::boolalpha << adr.mask.ring << ")";
278  if (adr.mask.ring) std::cout << " = " << adr.ring;
279 
280  std::cout << ", Chamber (" << std::boolalpha << adr.mask.chamber << ")";
281  if (adr.mask.chamber) std::cout << " = " << adr.chamber;
282 
283  std::cout << ", Layer (" << std::boolalpha << adr.mask.layer << ")";
284  if (adr.mask.layer) std::cout << " = " << adr.layer;
285 
286  std::cout << ", CFEB (" << std::boolalpha << adr.mask.cfeb << ")";
287  if (adr.mask.cfeb) std::cout << " = " << adr.cfeb;
288 
289  std::cout << ", HV (" << std::boolalpha << adr.mask.hv << ")";
290  if (adr.mask.hv) std::cout << " = " << adr.hv;
291 
292  std::cout << std::endl;
293  }
tuple cout
Definition: gather_cfg.py:145
const float cscdqm::Detector::RMaxHV ( const int  station,
const int  ring,
const int  n_hv 
) const
private

Get R max parameter (used in address eta/phi calculation)

Parameters
stationStation Id
ringRing Id
n_hvHV number
Returns
R max value

Definition at line 479 of file CSCDQM_Detector.cc.

Referenced by Detector().

479  {
480  float r_max_hv = 0;
481 
482  if(station == 1 && ring == 1) {
483  if(n_hv == 1) r_max_hv = 1500.0;
484  if(n_hv == 2) r_max_hv = 2565.0;
485  }
486 
487  if(station == 1 && ring == 2) {
488  if(n_hv == 1) r_max_hv = 3368.2;
489  if(n_hv == 2) r_max_hv = 4025.7;
490  if(n_hv == 3) r_max_hv = 4559.9;
491  }
492 
493  if(station == 1 && ring == 3) {
494  if(n_hv == 1) r_max_hv = 5724.1;
495  if(n_hv == 2) r_max_hv = 6230.2;
496  if(n_hv == 3) r_max_hv = 6761.5;
497  }
498 
499  if(station == 2 && ring == 1) {
500  if(n_hv == 1) r_max_hv = 2152.3;
501  if(n_hv == 2) r_max_hv = 2763.7;
502  if(n_hv == 3) r_max_hv = 3365.8;
503  }
504 
505  if(station == 3 && ring == 1) {
506  if(n_hv == 1) r_max_hv = 2164.9;
507  if(n_hv == 2) r_max_hv = 2763.8;
508  if(n_hv == 3) r_max_hv = 3365.8;
509  }
510 
511  if(station == 4 && ring == 1) {
512  if(n_hv == 1) r_max_hv = 2365.9;
513  if(n_hv == 2) r_max_hv = 2865.0;
514  if(n_hv == 3) r_max_hv = 3356.3;
515  }
516 
517  if((station == 2 || station == 3 || station == 4) && ring == 2) {
518  if(n_hv == 1) r_max_hv = 4446.3;
519  if(n_hv == 2) r_max_hv = 5053.2;
520  if(n_hv == 3) r_max_hv = 5660.1;
521  if(n_hv == 4) r_max_hv = 6267.0;
522  if(n_hv == 5) r_max_hv = 6870.8;
523  }
524 
525  return r_max_hv;
526  }
const float cscdqm::Detector::RMinHV ( const int  station,
const int  ring,
const int  n_hv 
) const
private

Get R min parameter (used in address eta/phi calculation)

Parameters
stationStation Id
ringRing Id
n_hvHV number
Returns
R min value

Definition at line 423 of file CSCDQM_Detector.cc.

Referenced by Detector().

423  {
424  float r_min_hv = 0;
425 
426  if(station == 1 && ring == 1) {
427  if(n_hv == 1) r_min_hv = 1060.0;
428  if(n_hv == 2) r_min_hv = 1500.0;
429  }
430 
431  if(station == 1 && ring == 2) {
432  if(n_hv == 1) r_min_hv = 2815.0;
433  if(n_hv == 2) r_min_hv = 3368.2;
434  if(n_hv == 3) r_min_hv = 4025.7;
435  }
436 
437  if(station == 1 && ring == 3) {
438  if(n_hv == 1) r_min_hv = 5120.0;
439  if(n_hv == 2) r_min_hv = 5724.1;
440  if(n_hv == 3) r_min_hv = 6230.2;
441  }
442 
443  if(station == 2 && ring == 1) {
444  if(n_hv == 1) r_min_hv = 1469.2;
445  if(n_hv == 2) r_min_hv = 2152.3;
446  if(n_hv == 3) r_min_hv = 2763.7;
447  }
448 
449  if(station == 3 && ring == 1) {
450  if(n_hv == 1) r_min_hv = 1668.9;
451  if(n_hv == 2) r_min_hv = 2164.9;
452  if(n_hv == 3) r_min_hv = 2763.8;
453  }
454 
455  if(station == 4 && ring == 1) {
456  if(n_hv == 1) r_min_hv = 1876.1;
457  if(n_hv == 2) r_min_hv = 2365.9;
458  if(n_hv == 3) r_min_hv = 2865.0;
459  }
460 
461  if((station == 2 || station == 3 || station == 4) && ring == 2) {
462  if(n_hv == 1) r_min_hv = 3640.2;
463  if(n_hv == 2) r_min_hv = 4446.3;
464  if(n_hv == 3) r_min_hv = 5053.2;
465  if(n_hv == 4) r_min_hv = 5660.1;
466  if(n_hv == 5) r_min_hv = 6267.0;
467  }
468 
469  return r_min_hv;
470  }
const float cscdqm::Detector::Z ( const int  station,
const int  ring 
) const
private

Get Z parameter (used in address eta/phi calculation)

Parameters
stationStation Id
ringRing Id
Returns
Z value

Definition at line 403 of file CSCDQM_Detector.cc.

Referenced by Detector().

403  {
404  float z_csc = 0;
405 
406  if(station == 1 && ring == 1) z_csc = (5834.5 + 6101.5) / 2.0;
407  if(station == 1 && ring == 2) z_csc = (6790.0 + 7064.3) / 2.0;
408  if(station == 1 && ring == 3) z_csc = 6888.0;
409  if(station == 2) z_csc = (8098.0 + 8346.0) / 2.0;
410  if(station == 3) z_csc = (9414.8 + 9166.8) / 2.0;
411  if(station == 4) z_csc = 10630.0; // has to be corrected
412 
413  return z_csc;
414  }

Member Data Documentation

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

Address boxes in epa/phi space

Definition at line 218 of file CSCDQM_Detector.h.

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

PartitionMap cscdqm::Detector::partitions
private

Map of partitions and list of it covering addresses indexes

Definition at line 230 of file CSCDQM_Detector.h.

Referenced by Detector(), and NextAddressBoxByPartition().

unsigned int cscdqm::Detector::partitions_x
private

Number of partitions in X axis

Definition at line 224 of file CSCDQM_Detector.h.

Referenced by Detector().

unsigned int cscdqm::Detector::partitions_y
private

Number of partitions in Y axis

Definition at line 227 of file CSCDQM_Detector.h.

Referenced by Detector().

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

Station areas precalculated

Definition at line 221 of file CSCDQM_Detector.h.

Referenced by Area(), and Detector().