CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BXAnalyzer.h
Go to the documentation of this file.
1 
12 
13 
14 std::vector<std::vector<ConvertedHit>> GroupBX(std::vector<ConvertedHit> ConvHits){
15 
16  std::vector<ConvertedHit> tmp;
17  std::vector<std::vector<ConvertedHit>> output (3,tmp);
18 
19  const int CentralBX = 6;
20 
21  for(std::vector<ConvertedHit>::iterator i = ConvHits.begin();i != ConvHits.end();i++){
22 
23  int diff = i->BX() - CentralBX;
24 
25  if((diff > -3) && (diff < 1))
26  output[0].push_back(*i);
27 
28  if((diff < 3) && (diff > -1))
29  output[2].push_back(*i);
30 
31  if(fabs(diff) < 2)
32  output[1].push_back(*i);
33  }
34 
35  return output;
36 
37 }
38 
39 
40 PatternOutput DeleteDuplicatePatterns(std::vector<PatternOutput> Pout){
41 
42  std::vector<int> tmp (192,0);//was 128
43  std::vector<std::vector<int>> rank (4,tmp), layer(4,tmp),straightness(4,tmp);
44  std::vector<ConvertedHit> Hits;
45 
46  for(int i=0;i<3;i++){
47 
48  bool set = 0;
49 
50  for(int zone=0;zone<4;zone++){
51  for(int strip=0;strip<192;strip++){//was 128
52 
53  if(Pout[i].detected.rank[zone][strip] >= rank[zone][strip]){
54 
55  rank[zone][strip] = Pout[i].detected.rank[zone][strip];
56  layer[zone][strip] = Pout[i].detected.layer[zone][strip];
57  straightness[zone][strip] = Pout[i].detected.straightness[zone][strip];
58  set = 1;
59  }
60  }
61  }
62 
63  if(set && (Pout[i].hits.size() > Hits.size())){
64 
65  std::vector<ConvertedHit> test = Pout[i].hits;
66 
67  for(std::vector<ConvertedHit>::iterator it = test.begin();it != test.end();it++){
68  Hits.push_back(*it);
69  }
70  }
71 
72 
73  }
74 
75  QualityOutput qout;
76 
77  qout.rank = rank;
78  qout.layer = layer;
79  qout.straightness = straightness;
80 
82 
83  output.detected = qout;
84  output.hits = Hits;
85 
86  return output;
87 
88 }
int i
Definition: DBlmapReader.cc:9
list diff
Definition: mps_update.py:85
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
PatternOutput DeleteDuplicatePatterns(std::vector< PatternOutput > Pout)
Definition: BXAnalyzer.h:40
std::vector< std::vector< ConvertedHit > > GroupBX(std::vector< ConvertedHit > ConvHits)
Definition: BXAnalyzer.h:14
QualityOutput detected
std::vector< ConvertedHit > hits