13 std::vector<std::vector<ConvertedHit>>
GroupBX(std::vector<ConvertedHit> ConvHits){
15 std::vector<ConvertedHit>
tmp;
16 std::vector<std::vector<ConvertedHit>>
output (3,tmp);
18 const int CentralBX = 6;
20 for(std::vector<ConvertedHit>::iterator
i = ConvHits.begin();
i != ConvHits.end();
i++){
22 int diff =
i->BX() - CentralBX;
24 if((diff > -3) && (diff < 1))
25 output[0].push_back(*
i);
27 if((diff < 3) && (diff > -1))
28 output[2].push_back(*
i);
31 output[1].push_back(*
i);
34 for (
int i = 1;
i < 3;
i++) {
35 unsigned int HasAllInNext = 0;
36 for (
unsigned int it = 0; it != output[
i-1].size(); it++) {
38 for (
unsigned int it2 = 0; it2 != output[
i].size(); it2++) {
39 if( output[
i-1][it].
Phi() == output[
i][it2].Phi() &&
40 output[
i-1][it].Theta() == output[
i][it2].Theta() &&
41 output[
i-1][it].Ph_hit() == output[
i][it2].Ph_hit() &&
42 output[
i-1][it].Phzvl() == output[
i][it2].Phzvl() &&
43 output[
i-1][it].Station() == output[
i][it2].Station() &&
44 output[
i-1][it].Sub() == output[
i][it2].Sub() &&
45 output[
i-1][it].Id() == output[
i][it2].Id() &&
46 output[
i-1][it].Quality() == output[
i][it2].Quality() &&
47 output[
i-1][it].Pattern() == output[
i][it2].Pattern() &&
48 output[
i-1][it].Wire() == output[
i][it2].Wire() &&
49 output[
i-1][it].Strip() == output[
i][it2].Strip() &&
50 output[
i-1][it].BX() == output[
i][it2].BX() ) InNext =
true;
52 if (InNext) HasAllInNext++;
54 if (HasAllInNext == output[
i-1].
size()) output[
i-1].
clear();
59 for(std::vector<ConvertedHit>::iterator it = output[
i].
begin();it != output[
i].end();it++){
60 for(std::vector<ConvertedHit>::iterator it2 = it;it2 != output[
i].end();it2++){
62 if(it == it2)
continue;
65 if(it->Station() == it2->Station() && it->Id() == it2->Id() && it->IsNeighbor() == it2->IsNeighbor()){
67 it->SetTheta2(it2->Theta());
68 it2->SetTheta2(it->Theta());
70 it->AddTheta(it2->Theta());
71 it2->AddTheta(it->Theta());
84 std::vector<int>
tmp (192,0);
85 std::vector<std::vector<int>> rank (4,tmp), layer(4,tmp),straightness(4,tmp),bxgroup(4,tmp);
86 std::vector<ConvertedHit> Hits;
92 for(
int zone=0;zone<4;zone++){
93 for(
int strip=0;strip<192;strip++){
95 if(Pout[
i].detected.rank[zone][strip] > rank[zone][strip]){
97 rank[zone][strip] = Pout[
i].detected.rank[zone][strip];
98 layer[zone][strip] = Pout[
i].detected.layer[zone][strip];
99 straightness[zone][strip] = Pout[
i].detected.straightness[zone][strip];
100 bxgroup[zone][strip] =
i+1;
108 std::vector<ConvertedHit>
test = Pout[
i].hits;
110 for(std::vector<ConvertedHit>::iterator it = test.begin();it != test.end();it++){
void clear(CLHEP::HepGenMatrix &m)
Helper function: Reset all elements of a matrix to 0.
std::vector< std::vector< double > > tmp
PatternOutput DeleteDuplicatePatterns(std::vector< PatternOutput > Pout)
std::vector< std::vector< ConvertedHit > > GroupBX(std::vector< ConvertedHit > ConvHits)
std::vector< ConvertedHit > hits
tuple size
Write out results.