CMS 3D CMS Logo

DTPattern.cc
Go to the documentation of this file.
4 
5 #include <iostream>
6 
7 //------------------------------------------------------------------
8 //--- Constructores y destructores
9 //------------------------------------------------------------------
11 
12 DTPattern::DTPattern(RefDTPatternHit seedUp, RefDTPatternHit seedDown) : 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 }
19 
20 DTPattern::DTPattern(int SL1, int SL2, int diff) {
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 }
29 
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 }
37 
38 int DTPattern::latHitIn(int slId, int chId, int allowedVariance) const {
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 }
55 
56 std::ostream &operator<<(std::ostream &out, DTPattern &p) {
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 }
68 
DTPattern::addHit
void addHit(RefDTPatternHit hit)
Definition: DTPattern.cc:30
DTPattern::latHitIn
int latHitIn(int slId, int chId, int allowedVariance) const
Definition: DTPattern.cc:38
change_name.diff
diff
Definition: change_name.py:13
DTPattern::diff
int diff() const
Definition: DTPattern.h:42
MessageLogger.h
DTPattern::id_
DTPatternIdentifier id_
Definition: DTPattern.h:56
DTPattern::recoseedDown_
int recoseedDown_
Definition: DTPattern.h:59
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
DTPattern::seedDown_
RefDTPatternHit seedDown_
Definition: DTPattern.h:51
operator<<
std::ostream & operator<<(std::ostream &out, DTPattern &p)
Definition: DTPattern.cc:56
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
PseudoBayesGrouping_cfi.allowedVariance
allowedVariance
Definition: PseudoBayesGrouping_cfi.py:12
constants.h
DTPattern
Definition: DTPattern.h:15
DTPattern::~DTPattern
virtual ~DTPattern()
Definition: DTPattern.cc:69
DTPattern::debug_
bool debug_
Definition: DTPattern.h:60
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
DTPattern.h
DTPattern::DTPattern
DTPattern()
Definition: DTPattern.cc:10
DTPattern::genHits_
std::vector< RefDTPatternHit > genHits_
Definition: DTPattern.h:53
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
DTPattern::seedUp_
RefDTPatternHit seedUp_
Definition: DTPattern.h:50
RefDTPatternHit
std::tuple< int, int, int > RefDTPatternHit
Definition: DTPattern.h:10
hit
Definition: SiStripHitEffFromCalibTree.cc:88