CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

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::DTPattern ( )

Definition at line 10 of file DTPattern.cc.

10 {}
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
bool debug_
Definition: DTPattern.h:60
RefDTPatternHit seedUp_
Definition: DTPattern.h:50
DTPatternIdentifier id_
Definition: DTPattern.h:56
#define LogDebug(id)
DTPattern::DTPattern ( int  SL1,
int  SL2,
int  diff 
)

Definition at line 20 of file DTPattern.cc.

References debug_, 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
bool debug_
Definition: DTPattern.h:60
RefDTPatternHit seedUp_
Definition: DTPattern.h:50
DTPatternIdentifier id_
Definition: DTPattern.h:56
#define LogDebug(id)
DTPattern::~DTPattern ( )
virtual

Definition at line 69 of file DTPattern.cc.

69 {}

Member Function Documentation

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
bool debug_
Definition: DTPattern.h:60
#define LogDebug(id)
int DTPattern::diff ( ) const
inline

Definition at line 42 of file DTPattern.h.

References id_.

42 { return std::get<2>(id_); }
DTPatternIdentifier id_
Definition: DTPattern.h:56
const std::vector<RefDTPatternHit>& DTPattern::genHits ( ) const
inline

Definition at line 43 of file DTPattern.h.

References genHits_.

Referenced by operator<<().

43 { return genHits_; }
std::vector< RefDTPatternHit > genHits_
Definition: DTPattern.h:53
DTPatternIdentifier DTPattern::id ( void  ) const
inline

Definition at line 39 of file DTPattern.h.

References id_.

Referenced by operator<<().

39 { return id_; }
DTPatternIdentifier id_
Definition: DTPattern.h:56
int DTPattern::latHitIn ( int  slId,
int  chId,
int  allowedVariance 
) const

Definition at line 38 of file DTPattern.cc.

References 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
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
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
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
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

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

bool DTPattern::debug_ = false
private

Definition at line 60 of file DTPattern.h.

Referenced by addHit(), and DTPattern().

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

Definition at line 53 of file DTPattern.h.

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

DTPatternIdentifier DTPattern::id_
private

Definition at line 56 of file DTPattern.h.

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

int DTPattern::recoseedDown_
private

Definition at line 59 of file DTPattern.h.

Referenced by latHitIn(), and setHitDown().

int DTPattern::recoseedUp_
private

Definition at line 58 of file DTPattern.h.

Referenced by setHitUp().

RefDTPatternHit DTPattern::seedDown_
private

Definition at line 51 of file DTPattern.h.

Referenced by DTPattern().

RefDTPatternHit DTPattern::seedUp_
private

Definition at line 50 of file DTPattern.h.

Referenced by DTPattern().