CMS 3D CMS Logo

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 Address &adr) const
 Calculate address area in eta/phi space. More...
 
const float Area (const unsigned int station) const
 Calculate station 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 169 of file CSCDQM_Detector.h.

Constructor & Destructor Documentation

◆ Detector()

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.

33  {
34  partitions_x = p_partitions_x;
35  partitions_y = p_partitions_y;
36 
37  unsigned int i = 0;
38  Address adr;
39 
40  adr.mask.layer = false;
41  adr.mask.side = adr.mask.station = adr.mask.ring = adr.mask.chamber = adr.mask.cfeb = adr.mask.hv = true;
42 
44  for (adr.side = 1; adr.side <= N_SIDES; adr.side++) {
45  float sign = +1.0;
46  if (adr.side == 2)
47  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  float z = Z(adr.station, adr.ring);
54  float r_min = RMinHV(adr.station, adr.ring, adr.hv);
55  float r_max = RMaxHV(adr.station, adr.ring, adr.hv);
56  float eta_min = sign * Eta(r_min, z);
57  float eta_max = sign * Eta(r_max, z);
58  float x_min = EtaToX(eta_min);
59  float x_max = EtaToX(eta_max);
60  float phi_min = 0;
61  float phi_max = 0;
62 
63  if (adr.station == 1 && adr.ring == 1 && adr.hv == 1) {
64  phi_min = PhiMinCFEB(adr.station, adr.ring, adr.chamber, 1);
65  phi_max = PhiMaxCFEB(adr.station, adr.ring, adr.chamber, NumberOfChamberCFEBs(adr.station, adr.ring));
66  } else {
67  phi_min = PhiMinCFEB(adr.station, adr.ring, adr.chamber, adr.cfeb);
68  phi_max = PhiMaxCFEB(adr.station, adr.ring, adr.chamber, adr.cfeb);
69  }
70 
71  float y_min = PhiToY(phi_min);
72  float y_max = PhiToY(phi_max);
73 
74  boxes[i].adr = adr;
75 
76  float xboxmin = (x_min < x_max ? x_min : x_max);
77  float xboxmax = (x_max > x_min ? x_max : x_min);
78  float yboxmin = (y_min < y_max ? y_min : y_max);
79  float yboxmax = (y_max > y_min ? y_max : y_min);
80 
81  boxes[i].xmin = xboxmin;
82  boxes[i].xmax = xboxmax;
83  boxes[i].ymin = yboxmin;
84  boxes[i].ymax = yboxmax;
85 
89  unsigned int x1 = int(floor(xboxmin / PARTITION_STEP_X)) + int(partitions_x / 2);
90  unsigned int x2 = int(ceil(xboxmax / PARTITION_STEP_X)) + int(partitions_x / 2);
91  unsigned int y1 = int(floor(yboxmin / PARTITION_STEP_Y));
92  unsigned int y2 = int(ceil(yboxmax / PARTITION_STEP_Y));
93 
94  for (unsigned int x = x1; x < x2; x++) {
95  for (unsigned int y = y1; y < y2; y++) {
96  unsigned int index = PARTITION_INDEX(x, y);
98  if (iter == partitions.end()) {
99  std::vector<unsigned int> v;
100  partitions.insert(std::make_pair(index, v));
101  }
102  partitions[index].push_back(i);
103  }
104  }
105 
106  i++;
107  }
108  }
109  }
110  }
111  }
112  }
113 
115  adr.mask.side = adr.mask.ring = adr.mask.chamber = adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
116  adr.mask.station = true;
117  adr.station = 1;
118  station_area[0] = Area(adr);
119  adr.station = 2;
120  station_area[1] = Area(adr);
121  adr.station = 3;
122  station_area[2] = Area(adr);
123  adr.station = 4;
124  station_area[3] = Area(adr);
125  }

References cscdqm::AddressBox::adr, Area(), boxes, reco::ceil(), cscdqm::AddressMask::cfeb, cscdqm::Address::cfeb, cscdqm::AddressMask::chamber, cscdqm::Address::chamber, Eta(), distMuonTCMETValueMapProducer_cff::eta_max, egammaIdentification::eta_min, EtaToX(), cscdqm::AddressMask::hv, cscdqm::Address::hv, mps_fire::i, createfilelist::int, 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, Validation_hcalonly_cfi::sign, cscdqm::AddressMask::station, cscdqm::Address::station, station_area, findQualityFiles::v, testProducerWithPsetDescEmpty_cfi::x1, testProducerWithPsetDescEmpty_cfi::x2, cscdqm::AddressBox::xmax, cscdqm::AddressBox::xmin, testProducerWithPsetDescEmpty_cfi::y1, testProducerWithPsetDescEmpty_cfi::y2, cscdqm::AddressBox::ymax, cscdqm::AddressBox::ymin, and Z().

Member Function Documentation

◆ AddressFromString()

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 658 of file CSCDQM_Detector.cc.

658  {
659  std::vector<std::string> tokens;
660  Utility::splitString(str_address, ",", tokens);
661 
662  if (tokens.size() != ADDR_SIZE)
663  return false;
664 
665  for (unsigned int r = 0; r < ADDR_SIZE; r++) {
666  std::string token = tokens.at(r);
668  bool mask = false;
669  unsigned int num = 0;
670 
671  if (token != "*") {
672  if (stringToNumber<unsigned int>(num, token, std::dec)) {
673  mask = true;
674  } else {
675  return false;
676  }
677  }
678 
679  switch (r) {
680  case 0:
681  adr.mask.side = mask;
682  adr.side = num;
683  break;
684  case 1:
685  adr.mask.station = mask;
686  adr.station = num;
687  break;
688  case 2:
689  adr.mask.ring = mask;
690  adr.ring = num;
691  break;
692  case 3:
693  adr.mask.chamber = mask;
694  adr.chamber = num;
695  break;
696  case 4:
697  adr.mask.layer = mask;
698  adr.layer = num;
699  break;
700  case 5:
701  adr.mask.cfeb = mask;
702  adr.cfeb = num;
703  break;
704  case 6:
705  adr.mask.hv = mask;
706  adr.hv = num;
707  }
708  }
709 
710  return true;
711  }

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, EgammaValidation_cff::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().

◆ Area() [1/2]

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 182 of file CSCDQM_Detector.cc.

182  {
183  float a = 0;
184  for (unsigned int i = 0; i < N_ELEMENTS; i++) {
185  if (boxes[i].adr == adr) {
186  a += fabs((boxes[i].xmax - boxes[i].xmin) * (boxes[i].ymax - boxes[i].ymin));
187  }
188  }
189  return a;
190  }

References a, boxes, mps_fire::i, N_ELEMENTS, TrackerOfflineValidation_Dqm_cff::xmax, TrackerOfflineValidation_Dqm_cff::xmin, L1TOccupancyClient_cfi::ymax, and L1TOccupancyClient_cfi::ymin.

◆ Area() [2/2]

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 132 of file CSCDQM_Detector.cc.

132  {
133  if (station > 0 && station <= N_STATIONS) {
134  return station_area[station - 1];
135  }
136  return 0;
137  }

References N_STATIONS, relativeConstraints::station, and station_area.

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

◆ Eta()

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

Definition at line 391 of file CSCDQM_Detector.cc.

391  {
392  if (r > 0.0 || z > 0.0) {
393  float sin_theta = r / sqrt(r * r + z * z);
394  float cos_theta = z / sqrt(r * r + z * z);
395  return -log(sin_theta / (cos_theta + 1));
396  }
397  if (r == 0.0)
398  return FLT_MAX;
399  return 0.0;
400  }

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

Referenced by Detector().

◆ EtaToX()

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 407 of file CSCDQM_Detector.cc.

407  {
408  float x_min = -2.5;
409  float x_max = 2.5;
410  float eta_min = -2.5;
411  float eta_max = 2.5;
412  float a = (x_max - x_min) / (eta_max - eta_min);
413  float b = (eta_max * x_min - eta_min * x_max) / (eta_max - eta_min);
414  return a * eta + b;
415  }

References a, b, PVValHelper::eta, distMuonTCMETValueMapProducer_cff::eta_max, and egammaIdentification::eta_min.

Referenced by Detector().

◆ GlobalChamberIndex()

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 147 of file CSCDQM_Detector.cc.

150  {
151  Address adr, iadr;
152  adr.mask.side = adr.mask.station = adr.mask.ring = adr.mask.chamber = true;
153  adr.mask.layer = adr.mask.cfeb = adr.mask.hv = false;
154  adr.layer = adr.cfeb = adr.hv = 0;
155  adr.side = side;
156  adr.station = station;
157  adr.ring = ring;
158  adr.chamber = chamber;
159  iadr = adr;
160 
161  unsigned int i = 1;
162  for (iadr.side = 1; iadr.side <= N_SIDES; iadr.side++) {
163  for (iadr.station = 1; iadr.station <= N_STATIONS; iadr.station++) {
164  for (iadr.ring = 1; iadr.ring <= NumberOfRings(iadr.station); iadr.ring++) {
165  for (iadr.chamber = 1; iadr.chamber <= NumberOfChambers(iadr.station, iadr.ring); iadr.chamber++) {
166  if (iadr == adr) {
167  return i;
168  }
169  i += 1;
170  }
171  }
172  }
173  }
174  return 0;
175  }

References cscdqm::AddressMask::cfeb, cscdqm::Address::cfeb, relativeConstraints::chamber, cscdqm::AddressMask::chamber, cscdqm::Address::chamber, cscdqm::AddressMask::hv, cscdqm::Address::hv, mps_fire::i, cscdqm::AddressMask::layer, cscdqm::Address::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().

◆ NextAddress()

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 337 of file CSCDQM_Detector.cc.

337  {
338  for (; i < N_ELEMENTS; i++) {
339  if (boxes[i].adr == mask) {
340  adr = &boxes[i].adr;
341  i++;
342  return true;
343  }
344  }
345  return false;
346  }

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

◆ NextAddressBox()

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 355 of file CSCDQM_Detector.cc.

355  {
356  for (; i < N_ELEMENTS; i++) {
357  if (boxes[i].adr == mask) {
358  box = &boxes[i];
359  i++;
360  return true;
361  }
362  }
363  return false;
364  }

References boxes, mps_fire::i, and N_ELEMENTS.

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

◆ NextAddressBoxByPartition()

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 374 of file CSCDQM_Detector.cc.

377  {
378  unsigned int index = PARTITION_INDEX(px, py);
379 
381  if (iter != partitions.end()) {
382  if (i < partitions[index].size()) {
383  box = &boxes[partitions[index].at(i)];
384  i++;
385  return true;
386  }
387  }
388  return false;
389  }

References boxes, mps_fire::i, PARTITION_INDEX, partitions, multPhiCorr_741_25nsDY_cfi::px, multPhiCorr_741_25nsDY_cfi::py, and findQualityFiles::size.

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

◆ NumberOfChamberCFEBs()

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 243 of file CSCDQM_Detector.cc.

243  {
244  if (station == 1 && ring == 1)
245  return 4;
246  if (station == 1 && ring == 2)
247  return 5;
248  if (station == 1 && ring == 3)
249  return 4;
250  if (station == 2 && ring == 1)
251  return 5;
252  if (station == 2 && ring == 2)
253  return 5;
254  if (station == 3 && ring == 1)
255  return 5;
256  if (station == 3 && ring == 2)
257  return 5;
258  if (station == 4 && ring == 1)
259  return 5;
260  if (station == 4 && ring == 2)
261  return 5;
262  return 0;
263  }

References relativeConstraints::ring, and relativeConstraints::station.

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

◆ NumberOfChamberHVs()

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 271 of file CSCDQM_Detector.cc.

271  {
272  if (station == 1 && ring == 1)
273  return 2;
274  if (station == 1 && ring == 2)
275  return 3;
276  if (station == 1 && ring == 3)
277  return 3;
278  if (station == 2 && ring == 1)
279  return 3;
280  if (station == 2 && ring == 2)
281  return 5;
282  if (station == 3 && ring == 1)
283  return 3;
284  if (station == 3 && ring == 2)
285  return 5;
286  if (station == 4 && ring == 1)
287  return 3;
288  if (station == 4 && ring == 2)
289  return 5;
290  return 0;
291  }

References relativeConstraints::ring, and relativeConstraints::station.

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

◆ NumberOfChambers()

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 215 of file CSCDQM_Detector.cc.

215  {
216  if (station == 1 && ring == 1)
217  return 36;
218  if (station == 1 && ring == 2)
219  return 36;
220  if (station == 1 && ring == 3)
221  return 36;
222  if (station == 2 && ring == 1)
223  return 18;
224  if (station == 2 && ring == 2)
225  return 36;
226  if (station == 3 && ring == 1)
227  return 18;
228  if (station == 3 && ring == 2)
229  return 36;
230  if (station == 4 && ring == 1)
231  return 18;
232  if (station == 4 && ring == 2)
233  return 36;
234  return 0;
235  }

References relativeConstraints::ring, and relativeConstraints::station.

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().

◆ NumberOfRings()

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 197 of file CSCDQM_Detector.cc.

197  {
198  if (station == 1)
199  return 3;
200  if (station == 2)
201  return 2;
202  if (station == 3)
203  return 2;
204  if (station == 4)
205  return 2;
206  return 0;
207  }

References relativeConstraints::station.

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

◆ PhiMaxCFEB()

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 641 of file CSCDQM_Detector.cc.

641  {
642  float phi_max_cfeb;
643 
644  int n_cfeb = NumberOfChamberCFEBs(station, ring);
645  int n_chambers = NumberOfChambers(station, ring);
646 
647  phi_max_cfeb = 0.0 + 2.0 * 3.14159 / (float)n_chambers * ((float)(chamber - 1) + (float)(cfeb) / (float)n_cfeb);
648 
649  return phi_max_cfeb;
650  }

References relativeConstraints::chamber, dqmMemoryStats::float, NumberOfChamberCFEBs(), NumberOfChambers(), relativeConstraints::ring, and relativeConstraints::station.

Referenced by Detector().

◆ PhiMinCFEB()

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 621 of file CSCDQM_Detector.cc.

621  {
622  float phi_min_cfeb;
623 
624  int n_cfeb = NumberOfChamberCFEBs(station, ring);
625  int n_chambers = NumberOfChambers(station, ring);
626 
627  phi_min_cfeb =
628  0.0 + 2.0 * 3.14159 / ((float)(n_chambers)) * ((float)(chamber - 1) + (float)(cfeb - 1) / (float)(n_cfeb));
629 
630  return phi_min_cfeb;
631  }

References relativeConstraints::chamber, dqmMemoryStats::float, NumberOfChamberCFEBs(), NumberOfChambers(), relativeConstraints::ring, and relativeConstraints::station.

Referenced by Detector().

◆ PhiToY()

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 422 of file CSCDQM_Detector.cc.

422  {
423  float y_min = 0.0;
424  float y_max = 2.0 * 3.14159;
425  float phi_min = 0.0;
426  float phi_max = 2.0 * 3.14159;
427  float a = (y_max - y_min) / (phi_max - phi_min);
428  float b = (phi_max * y_min - phi_min * y_max) / (phi_max - phi_min);
429  return a * phi + b;
430  }

References a, and b.

Referenced by Detector().

◆ PrintAddress()

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

Prints address for debugging.

Parameters
adrAddress to print
Returns

Definition at line 298 of file CSCDQM_Detector.cc.

298  {
299  std::cout << "Side (" << std::boolalpha << adr.mask.side << ")";
300  if (adr.mask.side)
301  std::cout << " = " << adr.side;
302 
303  std::cout << ", Station (" << std::boolalpha << adr.mask.station << ")";
304  if (adr.mask.station)
305  std::cout << " = " << adr.station;
306 
307  std::cout << ", Ring (" << std::boolalpha << adr.mask.ring << ")";
308  if (adr.mask.ring)
309  std::cout << " = " << adr.ring;
310 
311  std::cout << ", Chamber (" << std::boolalpha << adr.mask.chamber << ")";
312  if (adr.mask.chamber)
313  std::cout << " = " << adr.chamber;
314 
315  std::cout << ", Layer (" << std::boolalpha << adr.mask.layer << ")";
316  if (adr.mask.layer)
317  std::cout << " = " << adr.layer;
318 
319  std::cout << ", CFEB (" << std::boolalpha << adr.mask.cfeb << ")";
320  if (adr.mask.cfeb)
321  std::cout << " = " << adr.cfeb;
322 
323  std::cout << ", HV (" << std::boolalpha << adr.mask.hv << ")";
324  if (adr.mask.hv)
325  std::cout << " = " << adr.hv;
326 
327  std::cout << std::endl;
328  }

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.

◆ RMaxHV()

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 542 of file CSCDQM_Detector.cc.

542  {
543  float r_max_hv = 0;
544 
545  if (station == 1 && ring == 1) {
546  if (n_hv == 1)
547  r_max_hv = 1500.0;
548  if (n_hv == 2)
549  r_max_hv = 2565.0;
550  }
551 
552  if (station == 1 && ring == 2) {
553  if (n_hv == 1)
554  r_max_hv = 3368.2;
555  if (n_hv == 2)
556  r_max_hv = 4025.7;
557  if (n_hv == 3)
558  r_max_hv = 4559.9;
559  }
560 
561  if (station == 1 && ring == 3) {
562  if (n_hv == 1)
563  r_max_hv = 5724.1;
564  if (n_hv == 2)
565  r_max_hv = 6230.2;
566  if (n_hv == 3)
567  r_max_hv = 6761.5;
568  }
569 
570  if (station == 2 && ring == 1) {
571  if (n_hv == 1)
572  r_max_hv = 2152.3;
573  if (n_hv == 2)
574  r_max_hv = 2763.7;
575  if (n_hv == 3)
576  r_max_hv = 3365.8;
577  }
578 
579  if (station == 3 && ring == 1) {
580  if (n_hv == 1)
581  r_max_hv = 2164.9;
582  if (n_hv == 2)
583  r_max_hv = 2763.8;
584  if (n_hv == 3)
585  r_max_hv = 3365.8;
586  }
587 
588  if (station == 4 && ring == 1) {
589  if (n_hv == 1)
590  r_max_hv = 2365.9;
591  if (n_hv == 2)
592  r_max_hv = 2865.0;
593  if (n_hv == 3)
594  r_max_hv = 3356.3;
595  }
596 
597  if ((station == 2 || station == 3 || station == 4) && ring == 2) {
598  if (n_hv == 1)
599  r_max_hv = 4446.3;
600  if (n_hv == 2)
601  r_max_hv = 5053.2;
602  if (n_hv == 3)
603  r_max_hv = 5660.1;
604  if (n_hv == 4)
605  r_max_hv = 6267.0;
606  if (n_hv == 5)
607  r_max_hv = 6870.8;
608  }
609 
610  return r_max_hv;
611  }

References relativeConstraints::ring, and relativeConstraints::station.

Referenced by Detector().

◆ RMinHV()

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 464 of file CSCDQM_Detector.cc.

464  {
465  float r_min_hv = 0;
466 
467  if (station == 1 && ring == 1) {
468  if (n_hv == 1)
469  r_min_hv = 1060.0;
470  if (n_hv == 2)
471  r_min_hv = 1500.0;
472  }
473 
474  if (station == 1 && ring == 2) {
475  if (n_hv == 1)
476  r_min_hv = 2815.0;
477  if (n_hv == 2)
478  r_min_hv = 3368.2;
479  if (n_hv == 3)
480  r_min_hv = 4025.7;
481  }
482 
483  if (station == 1 && ring == 3) {
484  if (n_hv == 1)
485  r_min_hv = 5120.0;
486  if (n_hv == 2)
487  r_min_hv = 5724.1;
488  if (n_hv == 3)
489  r_min_hv = 6230.2;
490  }
491 
492  if (station == 2 && ring == 1) {
493  if (n_hv == 1)
494  r_min_hv = 1469.2;
495  if (n_hv == 2)
496  r_min_hv = 2152.3;
497  if (n_hv == 3)
498  r_min_hv = 2763.7;
499  }
500 
501  if (station == 3 && ring == 1) {
502  if (n_hv == 1)
503  r_min_hv = 1668.9;
504  if (n_hv == 2)
505  r_min_hv = 2164.9;
506  if (n_hv == 3)
507  r_min_hv = 2763.8;
508  }
509 
510  if (station == 4 && ring == 1) {
511  if (n_hv == 1)
512  r_min_hv = 1876.1;
513  if (n_hv == 2)
514  r_min_hv = 2365.9;
515  if (n_hv == 3)
516  r_min_hv = 2865.0;
517  }
518 
519  if ((station == 2 || station == 3 || station == 4) && ring == 2) {
520  if (n_hv == 1)
521  r_min_hv = 3640.2;
522  if (n_hv == 2)
523  r_min_hv = 4446.3;
524  if (n_hv == 3)
525  r_min_hv = 5053.2;
526  if (n_hv == 4)
527  r_min_hv = 5660.1;
528  if (n_hv == 5)
529  r_min_hv = 6267.0;
530  }
531 
532  return r_min_hv;
533  }

References relativeConstraints::ring, and relativeConstraints::station.

Referenced by Detector().

◆ Z()

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 438 of file CSCDQM_Detector.cc.

438  {
439  float z_csc = 0;
440 
441  if (station == 1 && ring == 1)
442  z_csc = (5834.5 + 6101.5) / 2.0;
443  if (station == 1 && ring == 2)
444  z_csc = (6790.0 + 7064.3) / 2.0;
445  if (station == 1 && ring == 3)
446  z_csc = 6888.0;
447  if (station == 2)
448  z_csc = (8098.0 + 8346.0) / 2.0;
449  if (station == 3)
450  z_csc = (9414.8 + 9166.8) / 2.0;
451  if (station == 4)
452  z_csc = 10630.0; // has to be corrected
453 
454  return z_csc;
455  }

References relativeConstraints::ring, and relativeConstraints::station.

Referenced by Detector().

Member Data Documentation

◆ boxes

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

Address boxes in epa/phi space

Definition at line 207 of file CSCDQM_Detector.h.

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

◆ partitions

PartitionMap cscdqm::Detector::partitions
private

Map of partitions and list of it covering addresses indexes

Definition at line 219 of file CSCDQM_Detector.h.

Referenced by Detector(), and NextAddressBoxByPartition().

◆ partitions_x

unsigned int cscdqm::Detector::partitions_x
private

Number of partitions in X axis

Definition at line 213 of file CSCDQM_Detector.h.

Referenced by Detector().

◆ partitions_y

unsigned int cscdqm::Detector::partitions_y
private

Number of partitions in Y axis

Definition at line 216 of file CSCDQM_Detector.h.

Referenced by Detector().

◆ station_area

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

Station areas precalculated

Definition at line 210 of file CSCDQM_Detector.h.

Referenced by Area(), and Detector().

DDAxes::y
mps_fire.i
i
Definition: mps_fire.py:428
cscdqm::PartitionMapIterator
PartitionMap::iterator PartitionMapIterator
Definition: CSCDQM_Detector.h:163
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
cscdqm::Utility::splitString
static void splitString(const std::string &str, const std::string &delim, std::vector< std::string > &results)
Split string according to delimiter.
Definition: CSCDQM_Utility.cc:122
cscdqm::Detector::NumberOfChambers
const unsigned int NumberOfChambers(const unsigned int station, const unsigned int ring) const
Returns the number of chambers for the given station and ring.
Definition: CSCDQM_Detector.cc:215
cscdqm::Detector::NumberOfChamberHVs
const unsigned int NumberOfChamberHVs(const unsigned int station, const unsigned int ring) const
Returns the number of HVs per Chamber on given Station/Ring.
Definition: CSCDQM_Detector.cc:271
relativeConstraints.station
station
Definition: relativeConstraints.py:67
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
gather_cfg.cout
cout
Definition: gather_cfg.py:144
egammaIdentification.eta_min
eta_min
Definition: egammaIdentification.py:19
Validation_hcalonly_cfi.sign
sign
Definition: Validation_hcalonly_cfi.py:32
DDAxes::x
findQualityFiles.v
v
Definition: findQualityFiles.py:179
cscdqm::AddressBox::adr
Address adr
Definition: CSCDQM_Detector.h:152
cscdqm::AddressBox::ymax
float ymax
Definition: CSCDQM_Detector.h:156
cscdqm::Utility::trimString
static void trimString(std::string &str)
Trim string.
Definition: CSCDQM_Utility.cc:136
cscdqm::Detector::RMinHV
const float RMinHV(const int station, const int ring, const int n_hv) const
Get R min parameter (used in address eta/phi calculation)
Definition: CSCDQM_Detector.cc:464
N_ELEMENTS
#define N_ELEMENTS
Definition: CSCDQM_Detector.h:54
N_SIDES
#define N_SIDES
Definition: CSCDQM_Detector.h:42
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
testProducerWithPsetDescEmpty_cfi.y1
y1
Definition: testProducerWithPsetDescEmpty_cfi.py:29
PARTITION_STEP_X
#define PARTITION_STEP_X
Definition: CSCDQM_Detector.h:62
cscdqm::Detector::Eta
const float Eta(const float r, const float z) const
Definition: CSCDQM_Detector.cc:391
L1TOccupancyClient_cfi.ymax
ymax
Definition: L1TOccupancyClient_cfi.py:43
reco::ceil
constexpr int32_t ceil(float num)
Definition: constexpr_cmath.h:7
PVValHelper::eta
Definition: PVValidationHelpers.h:69
cscdqm::Detector::NumberOfRings
const unsigned int NumberOfRings(const unsigned int station) const
Returns the number of rings for the given station.
Definition: CSCDQM_Detector.cc:197
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DDAxes::z
PARTITION_STEP_Y
#define PARTITION_STEP_Y
Definition: CSCDQM_Detector.h:63
b
double b
Definition: hdecay.h:118
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cscdqm::Detector::station_area
float station_area[4]
Definition: CSCDQM_Detector.h:210
testProducerWithPsetDescEmpty_cfi.y2
y2
Definition: testProducerWithPsetDescEmpty_cfi.py:30
a
double a
Definition: hdecay.h:119
cscdqm::AddressBox::xmax
float xmax
Definition: CSCDQM_Detector.h:154
createfilelist.int
int
Definition: createfilelist.py:10
distMuonTCMETValueMapProducer_cff.eta_max
eta_max
Definition: distMuonTCMETValueMapProducer_cff.py:9
cscdqm::AddressBox::ymin
float ymin
Definition: CSCDQM_Detector.h:155
cscdqm::Detector::PhiToY
const float PhiToY(const float phi) const
Transform phi coordinate to local canvas coordinate.
Definition: CSCDQM_Detector.cc:422
cscdqm::Detector::NumberOfChamberCFEBs
const unsigned int NumberOfChamberCFEBs(const unsigned int station, const unsigned int ring) const
Returns the number of CFEBs per Chamber on given Station/Ring.
Definition: CSCDQM_Detector.cc:243
PARTITION_INDEX
#define PARTITION_INDEX(x, y)
Definition: CSCDQM_Detector.h:61
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DDAxes::phi
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
L1TOccupancyClient_cfi.ymin
ymin
Definition: L1TOccupancyClient_cfi.py:43
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
cscdqm::Detector::partitions
PartitionMap partitions
Definition: CSCDQM_Detector.h:219
relativeConstraints.ring
ring
Definition: relativeConstraints.py:68
N_STATIONS
#define N_STATIONS
Definition: CSCDQM_Detector.h:43
cscdqm::Detector::RMaxHV
const float RMaxHV(const int station, const int ring, const int n_hv) const
Get R max parameter (used in address eta/phi calculation)
Definition: CSCDQM_Detector.cc:542
relativeConstraints.chamber
chamber
Definition: relativeConstraints.py:53
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
cscdqm::Detector::partitions_y
unsigned int partitions_y
Definition: CSCDQM_Detector.h:216
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10
cscdqm::Detector::Area
const float Area(const unsigned int station) const
Calculate station area in eta/phi space.
Definition: CSCDQM_Detector.cc:132
cscdqm::Detector::Z
const float Z(const int station, const int ring) const
Get Z parameter (used in address eta/phi calculation)
Definition: CSCDQM_Detector.cc:438
ADDR_SIZE
#define ADDR_SIZE
Definition: CSCDQM_Detector.h:51
cscdqm::Detector::partitions_x
unsigned int partitions_x
Definition: CSCDQM_Detector.h:213
cscdqm::Detector::boxes
AddressBox boxes[9540]
Definition: CSCDQM_Detector.h:207
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
cscdqm::Detector::PhiMinCFEB
const float PhiMinCFEB(const int station, const int ring, const int chamber, const int cfeb) const
Get Min phi boundary for particular CFEB.
Definition: CSCDQM_Detector.cc:621
cscdqm::AddressBox::xmin
float xmin
Definition: CSCDQM_Detector.h:153
cscdqm::Detector::EtaToX
const float EtaToX(const float eta) const
Transform eta coordinate to local canvas coordinate.
Definition: CSCDQM_Detector.cc:407
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
cscdqm::Detector::PhiMaxCFEB
const float PhiMaxCFEB(const int station, const int ring, const int chamber, const int cfeb) const
Get Max phi boundary for particular CFEB.
Definition: CSCDQM_Detector.cc:641
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:318