CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes
HGCalCassette Class Reference

#include <HGCalCassette.h>

Public Member Functions

std::pair< double, double > getShift (int layer, int zside, int cassette, bool scnt=false) const
 
 HGCalCassette (int cassette, const std::vector< double > &shifts)
 
 HGCalCassette ()
 
void setParameter (int cassette, const std::vector< double > &shifts, bool both=true)
 
void setParameterScint (const std::vector< double > &shifts)
 

Static Public Member Functions

static int cassetteIndex (int det, int layer, int zside, int cassette)
 
static int cassetteType (int det, int zside, int cassette)
 

Private Attributes

int cassette_
 
std::vector< double > shifts_
 
std::vector< double > shiftsScnt_
 
bool typeHE_
 

Static Private Attributes

static constexpr int32_t factor_ = 100
 
static constexpr int positEE_ [6] = {2, 1, 0, 5, 4, 3}
 
static constexpr int positHE_ [12] = {5, 4, 3, 2, 1, 0, 11, 10, 9, 8, 7, 6}
 

Detailed Description

Definition at line 8 of file HGCalCassette.h.

Constructor & Destructor Documentation

◆ HGCalCassette() [1/2]

HGCalCassette::HGCalCassette ( int  cassette,
const std::vector< double > &  shifts 
)
inline

Definition at line 10 of file HGCalCassette.h.

References setParameter().

10 { setParameter(cassette, shifts, true); }
void setParameter(int cassette, const std::vector< double > &shifts, bool both=true)
Definition: HGCalCassette.cc:8

◆ HGCalCassette() [2/2]

HGCalCassette::HGCalCassette ( )
inline

Definition at line 11 of file HGCalCassette.h.

11 {}

Member Function Documentation

◆ cassetteIndex()

int HGCalCassette::cassetteIndex ( int  det,
int  layer,
int  zside,
int  cassette 
)
static

Definition at line 68 of file HGCalCassette.cc.

References factor_, nano_mu_digi_cff::layer, and ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::side().

Referenced by HGCalNumberingScheme::getUnitID(), and HGCalNumberingScheme::HGCalNumberingScheme().

68  {
69  int zs = (side > 0) ? factor_ : 0;
70  return (((zs + det) * factor_ + layer) * factor_ + cassette);
71 }
static constexpr int32_t factor_
Definition: HGCalCassette.h:25

◆ cassetteType()

int HGCalCassette::cassetteType ( int  det,
int  zside,
int  cassette 
)
static

Definition at line 73 of file HGCalCassette.cc.

References positEE_, positHE_, and ecaldqm::zside().

Referenced by DDHGCalMixRotatedCassette::positionMix(), DDHGCalMixRotatedFineCassette::positionMix(), DDHGCalMixRotatedLayer::positionMix(), HGCalMixRotatedLayer::positionMix(), HGCalMixRotatedCassette::positionMix(), and HGCalMixRotatedFineCassette::positionMix().

73  {
74  int type = (zside < 0) ? cassette : ((det == 0) ? (1 + positEE_[cassette - 1]) : (1 + positHE_[cassette - 1]));
75  return type;
76 }
static constexpr int positHE_[12]
Definition: HGCalCassette.h:21
int zside(DetId const &)
static constexpr int positEE_[6]
Definition: HGCalCassette.h:20

◆ getShift()

std::pair< double, double > HGCalCassette::getShift ( int  layer,
int  zside,
int  cassette,
bool  scnt = false 
) const

Definition at line 55 of file HGCalCassette.cc.

References cassette_, nano_mu_digi_cff::layer, isotrackTrainRegressor::loc, positEE_, positHE_, shifts_, shiftsScnt_, typeHE_, geometryCSVtoXML::xy, and ecaldqm::zside().

Referenced by HGCalDDDConstants::assignCellTrap(), HGCalDDDConstants::cassetteShiftScintillator(), HGCalDDDConstants::cassetteShiftSilicon(), HGCalDDDConstants::localToGlobal8(), HGCalDDDConstants::locateCell(), HGCalDDDConstants::locateCellTrap(), and HGCalDDDConstants::waferFromPosition().

55  {
56  int locc = (zside < 0) ? (cassette - 1) : (typeHE_ ? positHE_[cassette - 1] : positEE_[cassette - 1]);
57  int loc = 2 * (cassette_ * (layer - 1) + locc);
58  std::pair<double, double> xy = (typeHE_ && scnt) ? (std::make_pair(-zside * shiftsScnt_[loc], shiftsScnt_[loc + 1]))
59  : (std::make_pair(-zside * shifts_[loc], shifts_[loc + 1]));
60 #ifdef EDM_ML_DEBUG
61  edm::LogVerbatim("HGCalGeom") << "HGCalCassette::getShift: Layer " << layer << " zside " << zside << " type "
62  << typeHE_ << " cassette " << cassette << " Loc " << locc << ":" << loc << " shift "
63  << xy.first << ":" << xy.second;
64 #endif
65  return xy;
66 }
Log< level::Info, true > LogVerbatim
static constexpr int positHE_[12]
Definition: HGCalCassette.h:21
int zside(DetId const &)
static constexpr int positEE_[6]
Definition: HGCalCassette.h:20
std::vector< double > shifts_
Definition: HGCalCassette.h:24
std::vector< double > shiftsScnt_
Definition: HGCalCassette.h:24

◆ setParameter()

void HGCalCassette::setParameter ( int  cassette,
const std::vector< double > &  shifts,
bool  both = true 
)

Definition at line 8 of file HGCalCassette.cc.

References reco::HaloData::both, cassette_, dqmiolumiharvest::j, SiStripPI::min, shifts_, shiftsScnt_, and typeHE_.

Referenced by coreTools.RunOnData::__call__(), trackTools.MakeAODTrackCandidates::__call__(), runJetUncertainties.RunJetUncertainties::__call__(), metTools.AddMETCollection::__call__(), cmsswVersionTools.PickRelValInputFiles::__call__(), coreTools.RemoveMCMatching::__call__(), trackTools.MakePATTrackCandidates::__call__(), trigTools.SwitchOnTrigger::__call__(), runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::__call__(), trigTools.SwitchOnTriggerStandAlone::__call__(), tauTools.AddTauCollection::__call__(), trackTools.MakeTrackCandidates::__call__(), trigTools.SwitchOnTriggerMatching::__call__(), trigTools.SwitchOnTriggerMatchingStandAlone::__call__(), trigTools.SwitchOnTriggerMatchEmbedding::__call__(), jetTools.AddJetCollection::__call__(), jetTools.SwitchJetCollection::__call__(), jetTools.UpdateJetCollection::__call__(), jetTools.AddJetID::__call__(), jetTools.SetTagInfos::__call__(), HGCalCassette(), HGCalDDDConstants::HGCalDDDConstants(), and runMETCorrectionsAndUncertainties.RunMETCorrectionsAndUncertainties::jetConfiguration().

8  {
9  cassette_ = cassette;
10  typeHE_ = (cassette_ >= 12);
11  shifts_.insert(shifts_.end(), shifts.begin(), shifts.end());
12  if (both)
13  shiftsScnt_.insert(shiftsScnt_.end(), shifts.begin(), shifts.end());
14 #ifdef EDM_ML_DEBUG
15  edm::LogVerbatim("HGCalGeom") << "# of cassettes = " << cassette_ << " Type " << typeHE_;
16  for (uint32_t j1 = 0; j1 < shifts.size(); j1 += 12) {
17  std::ostringstream st1;
18  if (j1 == 0) {
19  if (both)
20  st1 << " Shifts|ShiftsScnt:";
21  else
22  st1 << " Shifts:";
23  } else {
24  if (both)
25  st1 << " ";
26  else
27  st1 << " ";
28  }
29  uint32_t j2 = std::min((j1 + 12), static_cast<uint32_t>(shifts.size()));
30  for (uint32_t j = j1; j < j2; ++j)
31  st1 << ":" << shifts[j];
32  edm::LogVerbatim("HGCalGeom") << st1.str();
33  }
34 #endif
35 }
Log< level::Info, true > LogVerbatim
std::vector< double > shifts_
Definition: HGCalCassette.h:24
std::vector< double > shiftsScnt_
Definition: HGCalCassette.h:24

◆ setParameterScint()

void HGCalCassette::setParameterScint ( const std::vector< double > &  shifts)

Definition at line 37 of file HGCalCassette.cc.

References dqmiolumiharvest::j, SiStripPI::min, and shiftsScnt_.

37  {
38  shiftsScnt_.insert(shiftsScnt_.end(), shifts.begin(), shifts.end());
39 #ifdef EDM_ML_DEBUG
40  for (uint32_t j1 = 0; j1 < shifts.size(); j1 += 12) {
41  std::ostringstream st1;
42  if (j1 == 0) {
43  st1 << " ShiftsScnt:";
44  } else {
45  st1 << " ";
46  }
47  uint32_t j2 = std::min((j1 + 12), static_cast<uint32_t>(shifts.size()));
48  for (uint32_t j = j1; j < j2; ++j)
49  st1 << ":" << shifts[j];
50  edm::LogVerbatim("HGCalGeom") << st1.str();
51  }
52 #endif
53 }
Log< level::Info, true > LogVerbatim
std::vector< double > shiftsScnt_
Definition: HGCalCassette.h:24

Member Data Documentation

◆ cassette_

int HGCalCassette::cassette_
private

Definition at line 22 of file HGCalCassette.h.

Referenced by getShift(), and setParameter().

◆ factor_

constexpr int32_t HGCalCassette::factor_ = 100
staticprivate

Definition at line 25 of file HGCalCassette.h.

Referenced by cassetteIndex().

◆ positEE_

constexpr int HGCalCassette::positEE_[6] = {2, 1, 0, 5, 4, 3}
staticprivate

Definition at line 20 of file HGCalCassette.h.

Referenced by cassetteType(), and getShift().

◆ positHE_

constexpr int HGCalCassette::positHE_[12] = {5, 4, 3, 2, 1, 0, 11, 10, 9, 8, 7, 6}
staticprivate

Definition at line 21 of file HGCalCassette.h.

Referenced by cassetteType(), and getShift().

◆ shifts_

std::vector<double> HGCalCassette::shifts_
private

Definition at line 24 of file HGCalCassette.h.

Referenced by getShift(), and setParameter().

◆ shiftsScnt_

std::vector<double> HGCalCassette::shiftsScnt_
private

Definition at line 24 of file HGCalCassette.h.

Referenced by getShift(), setParameter(), and setParameterScint().

◆ typeHE_

bool HGCalCassette::typeHE_
private

Definition at line 23 of file HGCalCassette.h.

Referenced by getShift(), and setParameter().