CMS 3D CMS Logo

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

#include <TkCommonModeTopology.h>

Public Member Functions

std::vector< int > & finalStrips ()
 
std::vector< int > & initialStrips ()
 
int numberOfSets () const
 
int numberOfStrips () const
 
int numberOfStripsPerSet () const
 
void setNumberOfSets (int in)
 
void setNumberOfStrips (int in)
 
void setNumberOfStripsPerSet (int in)
 
int setOfStrip (int)
 
 TkCommonModeTopology (int nstrips, int nstripsperset)
 

Private Attributes

std::vector< int > finStrips
 
std::vector< int > initStrips
 
int numberStrips
 
int numberStripsPerSet
 

Detailed Description

Allows any topology for the Common Mode: 128 strips, 64, 32, 16, 8, ....

Definition at line 8 of file TkCommonModeTopology.h.

Constructor & Destructor Documentation

◆ TkCommonModeTopology()

TkCommonModeTopology::TkCommonModeTopology ( int  nstrips,
int  nstripsperset 
)

Definition at line 11 of file TkCommonModeTopology.cc.

12  : numberStrips(nstrips), numberStripsPerSet(nstripsperset) {
13  initStrips.clear();
14  finStrips.clear();
15  for (int i = 0; i < numberOfSets(); i++) {
16  initStrips.push_back(i * numberOfStripsPerSet());
17  finStrips.push_back((i + 1) * numberOfStripsPerSet() - 1);
18  }
19 }

References finStrips, mps_fire::i, initStrips, numberOfSets(), and numberOfStripsPerSet().

Member Function Documentation

◆ finalStrips()

std::vector<int>& TkCommonModeTopology::finalStrips ( )
inline

Definition at line 27 of file TkCommonModeTopology.h.

27 { return finStrips; }

References finStrips.

Referenced by TT6CommonModeCalculator::calculateCommonMode(), and setOfStrip().

◆ initialStrips()

std::vector<int>& TkCommonModeTopology::initialStrips ( )
inline

Definition at line 26 of file TkCommonModeTopology.h.

26 { return initStrips; }

References initStrips.

Referenced by TT6CommonModeCalculator::calculateCommonMode(), and setOfStrip().

◆ numberOfSets()

int TkCommonModeTopology::numberOfSets ( ) const
inline

◆ numberOfStrips()

int TkCommonModeTopology::numberOfStrips ( ) const
inline

Definition at line 19 of file TkCommonModeTopology.h.

19 { return numberStrips; }

References numberStrips.

◆ numberOfStripsPerSet()

int TkCommonModeTopology::numberOfStripsPerSet ( ) const
inline

Definition at line 20 of file TkCommonModeTopology.h.

20 { return numberStripsPerSet; }

References numberStripsPerSet.

Referenced by TkCommonModeTopology().

◆ setNumberOfSets()

void TkCommonModeTopology::setNumberOfSets ( int  in)
inline

Set number of independent groups of strips in APV for CM

Definition at line 17 of file TkCommonModeTopology.h.

References recoMuon::in, numberStrips, and numberStripsPerSet.

◆ setNumberOfStrips()

void TkCommonModeTopology::setNumberOfStrips ( int  in)
inline

Set number of strips in an APV = 128

Definition at line 13 of file TkCommonModeTopology.h.

13 { numberStrips = in; }

References recoMuon::in, and numberStrips.

◆ setNumberOfStripsPerSet()

void TkCommonModeTopology::setNumberOfStripsPerSet ( int  in)
inline

Set number of strips in each group for which CM is to be found

Definition at line 15 of file TkCommonModeTopology.h.

References recoMuon::in, and numberStripsPerSet.

◆ setOfStrip()

int TkCommonModeTopology::setOfStrip ( int  in)

Definition at line 3 of file TkCommonModeTopology.cc.

3  {
4  for (int i = 0; i < numberOfSets(); i++) {
5  if (in >= initialStrips()[i] && in <= finalStrips()[i])
6  return i;
7  }
8  return -1;
9 }

References finalStrips(), mps_fire::i, recoMuon::in, initialStrips(), and numberOfSets().

Referenced by MedianCommonModeCalculator::doIt(), and TT6CommonModeCalculator::doIt().

Member Data Documentation

◆ finStrips

std::vector<int> TkCommonModeTopology::finStrips
private

Definition at line 33 of file TkCommonModeTopology.h.

Referenced by finalStrips(), and TkCommonModeTopology().

◆ initStrips

std::vector<int> TkCommonModeTopology::initStrips
private

Definition at line 32 of file TkCommonModeTopology.h.

Referenced by initialStrips(), and TkCommonModeTopology().

◆ numberStrips

int TkCommonModeTopology::numberStrips
private

◆ numberStripsPerSet

int TkCommonModeTopology::numberStripsPerSet
private
TkCommonModeTopology::initialStrips
std::vector< int > & initialStrips()
Definition: TkCommonModeTopology.h:26
mps_fire.i
i
Definition: mps_fire.py:428
TkCommonModeTopology::initStrips
std::vector< int > initStrips
Definition: TkCommonModeTopology.h:32
TkCommonModeTopology::numberStrips
int numberStrips
Definition: TkCommonModeTopology.h:30
TkCommonModeTopology::finalStrips
std::vector< int > & finalStrips()
Definition: TkCommonModeTopology.h:27
TkCommonModeTopology::numberStripsPerSet
int numberStripsPerSet
Definition: TkCommonModeTopology.h:31
TkCommonModeTopology::numberOfSets
int numberOfSets() const
Definition: TkCommonModeTopology.h:22
recoMuon::in
Definition: RecoMuonEnumerators.h:6
TkCommonModeTopology::numberOfStripsPerSet
int numberOfStripsPerSet() const
Definition: TkCommonModeTopology.h:20
TkCommonModeTopology::finStrips
std::vector< int > finStrips
Definition: TkCommonModeTopology.h:33