CMS 3D CMS Logo

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

#include <DTPattern.h>

Public Member Functions

void addHit (RefDTPatternHit hit)
 
int diff () const
 
 DTPattern ()
 
 DTPattern (RefDTPatternHit seedUp, RefDTPatternHit seedDown)
 
 DTPattern (int SL1, int SL2, int diff)
 
const std::vector< RefDTPatternHit > & genHits () const
 
DTPatternIdentifier id () const
 
int latHitIn (int slId, int chId, int allowedVariance) const
 
void setHitDown (int chIdDown)
 
void setHitUp (int chIdUp)
 
int sl1 () const
 
int sl2 () const
 
virtual ~DTPattern ()
 

Private Attributes

const bool debug_ = false
 
std::vector< RefDTPatternHitgenHits_
 
DTPatternIdentifier id_
 
int recoseedDown_
 
int recoseedUp_
 
RefDTPatternHit seedDown_
 
RefDTPatternHit seedUp_
 

Friends

std::ostream & operator<< (std::ostream &out, DTPattern const &p)
 

Detailed Description

Definition at line 15 of file DTPattern.h.

Constructor & Destructor Documentation

◆ DTPattern() [1/3]

DTPattern::DTPattern ( )

Definition at line 10 of file DTPattern.cc.

10 {}

◆ DTPattern() [2/3]

DTPattern::DTPattern ( RefDTPatternHit  seedUp,
RefDTPatternHit  seedDown 
)

Definition at line 12 of file DTPattern.cc.

References debug_, id_, and LogDebug.

12  : seedUp_(seedUp), seedDown_(seedDown) {
13  //On creation, pattern is based on seeds, with no hits. Due to traslational simmetry we only need the superlayer indexes as well as the cell index difference
14  id_ = std::make_tuple(std::get<0>(seedUp), std::get<0>(seedDown), std::get<1>(seedUp) - std::get<1>(seedDown));
15  if (debug_)
16  LogDebug("DTPattern") << "Pattern id: " << std::get<0>(id_) << " , " << std::get<1>(id_) << " , "
17  << std::get<2>(id_);
18 }
RefDTPatternHit seedDown_
Definition: DTPattern.h:51
const bool debug_
Definition: DTPattern.h:60
RefDTPatternHit seedUp_
Definition: DTPattern.h:50
DTPatternIdentifier id_
Definition: DTPattern.h:56
#define LogDebug(id)

◆ DTPattern() [3/3]

DTPattern::DTPattern ( int  SL1,
int  SL2,
int  diff 
)

Definition at line 20 of file DTPattern.cc.

References debug_, diff(), id_, LogDebug, seedDown_, and seedUp_.

20  {
21  //On creation, pattern is based on seeds, with no hits. Due to traslational simmetry we only need the superlayer indexes as well as the cell index difference
22  seedUp_ = std::make_tuple(SL1, 0, 0);
23  seedDown_ = std::make_tuple(SL2, diff, 0);
24  id_ = std::make_tuple(SL1, SL2, diff);
25  if (debug_)
26  LogDebug("DTPattern") << "Pattern id: " << std::get<0>(id_) << " , " << std::get<1>(id_) << " , "
27  << std::get<2>(id_);
28 }
RefDTPatternHit seedDown_
Definition: DTPattern.h:51
int diff() const
Definition: DTPattern.h:42
const bool debug_
Definition: DTPattern.h:60
RefDTPatternHit seedUp_
Definition: DTPattern.h:50
DTPatternIdentifier id_
Definition: DTPattern.h:56
#define LogDebug(id)

◆ ~DTPattern()

DTPattern::~DTPattern ( )
virtual

Definition at line 69 of file DTPattern.cc.

69 {}

Member Function Documentation

◆ addHit()

void DTPattern::addHit ( RefDTPatternHit  hit)

Definition at line 30 of file DTPattern.cc.

References debug_, genHits_, and LogDebug.

30  {
31  //Add additional gen level hits in the gen pattern coordinates (untranslated)
32  genHits_.push_back(hit);
33  if (debug_)
34  LogDebug("DTPattern") << "Added gen hit: " << std::get<0>(hit) << " , " << std::get<1>(hit) << " , "
35  << std::get<2>(hit);
36 }
std::vector< RefDTPatternHit > genHits_
Definition: DTPattern.h:53
const bool debug_
Definition: DTPattern.h:60
#define LogDebug(id)

◆ diff()

int DTPattern::diff ( ) const
inline

Definition at line 42 of file DTPattern.h.

References id_.

Referenced by DTPattern().

42 { return std::get<2>(id_); }
DTPatternIdentifier id_
Definition: DTPattern.h:56

◆ genHits()

const std::vector<RefDTPatternHit>& DTPattern::genHits ( ) const
inline

Definition at line 43 of file DTPattern.h.

References genHits_.

43 { return genHits_; }
std::vector< RefDTPatternHit > genHits_
Definition: DTPattern.h:53

◆ id()

DTPatternIdentifier DTPattern::id ( void  ) const
inline

Definition at line 39 of file DTPattern.h.

References id_.

39 { return id_; }
DTPatternIdentifier id_
Definition: DTPattern.h:56

◆ latHitIn()

int DTPattern::latHitIn ( int  slId,
int  chId,
int  allowedVariance 
) const

Definition at line 38 of file DTPattern.cc.

References PseudoBayesGrouping_cfi::allowedVariance, genHits_, recoseedDown_, and groupFilesInBlocks::temp.

38  {
39  //Check if a hit is inside of the pattern for a given pattern width
40  int temp = -999;
41  for (auto it = this->genHits_.begin(); it != this->genHits_.end(); ++it) {
42  if (slId == (std::get<0>(*it) - 1)) {
43  if (chId == (std::get<1>(*it) + recoseedDown_)) {
44  return std::get<2>(*it);
45  }
46  //This is equivalent to an allowed discrete width of the pattern (configured)
47  else if ((chId <= (std::get<1>(*it) + recoseedDown_ + allowedVariance)) &&
48  (chId >= (std::get<1>(*it) + recoseedDown_ - allowedVariance))) {
49  temp = -10;
50  }
51  }
52  }
53  return temp;
54 }
std::vector< RefDTPatternHit > genHits_
Definition: DTPattern.h:53
int recoseedDown_
Definition: DTPattern.h:59

◆ setHitDown()

void DTPattern::setHitDown ( int  chIdDown)
inline

Definition at line 36 of file DTPattern.h.

References recoseedDown_.

36 { recoseedDown_ = chIdDown; }
int recoseedDown_
Definition: DTPattern.h:59

◆ setHitUp()

void DTPattern::setHitUp ( int  chIdUp)
inline

Definition at line 35 of file DTPattern.h.

References recoseedUp_.

35 { recoseedUp_ = chIdUp; }
int recoseedUp_
Definition: DTPattern.h:58

◆ sl1()

int DTPattern::sl1 ( ) const
inline

Definition at line 40 of file DTPattern.h.

References id_.

40 { return std::get<0>(id_); }
DTPatternIdentifier id_
Definition: DTPattern.h:56

◆ sl2()

int DTPattern::sl2 ( ) const
inline

Definition at line 41 of file DTPattern.h.

References id_.

41 { return std::get<1>(id_); }
DTPatternIdentifier id_
Definition: DTPattern.h:56

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
DTPattern const &  p 
)
friend

Definition at line 56 of file DTPattern.cc.

56  {
57  //Friend for printing pattern information trough iostream
58  out << "Pattern id: " << std::get<0>(p.id()) << " , " << std::get<1>(p.id()) << " , " << std::get<2>(p.id())
59  << std::endl;
60  std::vector<RefDTPatternHit> thegenHits = p.genHits();
61  out << "Pattern hits: " << std::endl;
62 
63  for (std::vector<RefDTPatternHit>::iterator itHit = thegenHits.begin(); itHit != thegenHits.end(); itHit++) {
64  out << "[" << std::get<0>(*itHit) << " , " << std::get<1>(*itHit) << " , " << std::get<2>(*itHit) << "]";
65  }
66  return out;
67 }

Member Data Documentation

◆ debug_

const bool DTPattern::debug_ = false
private

Definition at line 60 of file DTPattern.h.

Referenced by addHit(), and DTPattern().

◆ genHits_

std::vector<RefDTPatternHit> DTPattern::genHits_
private

Definition at line 53 of file DTPattern.h.

Referenced by addHit(), genHits(), and latHitIn().

◆ id_

DTPatternIdentifier DTPattern::id_
private

Definition at line 56 of file DTPattern.h.

Referenced by diff(), DTPattern(), id(), sl1(), and sl2().

◆ recoseedDown_

int DTPattern::recoseedDown_
private

Definition at line 59 of file DTPattern.h.

Referenced by latHitIn(), and setHitDown().

◆ recoseedUp_

int DTPattern::recoseedUp_
private

Definition at line 58 of file DTPattern.h.

Referenced by setHitUp().

◆ seedDown_

RefDTPatternHit DTPattern::seedDown_
private

Definition at line 51 of file DTPattern.h.

Referenced by DTPattern().

◆ seedUp_

RefDTPatternHit DTPattern::seedUp_
private

Definition at line 50 of file DTPattern.h.

Referenced by DTPattern().