CGEM BOSS 6.6.5.i
BESIII Offline Software System
Loading...
Searching...
No Matches
IndexGar.h
Go to the documentation of this file.
1#ifndef INDEXGAR_H
2#define INDEXGAR_H
3//#include <vector>
4#include <map>
5#include <vector>
6struct IndexGar{
7 int stripX;
8 int stripV;
9 char gridX, gridV; // range 0-24. note that its mark is opposite from strip.
10 char sheet;
11 // grid_v = floor(distX/L_XPitch*5.+2.5);
12 // grid_x = floor(distV/L_VPitch*5.+2.5);
13 //int layer; we dont quite work on layer; but sheet
14 bool operator<(const IndexGar &index) const{
15 //if (this->stripX < index.stripX) return true;
16 //else if (this->stripX > index.stripX) return false;
17 //else if (...)
18
19 return (this->stripX < index.stripX) ||
20 (this->stripX == index.stripX && this->stripV < index.stripV)||
21 (this->stripX == index.stripX && this->stripV == index.stripV && this->gridX < index.gridX)||
22 (this->stripX == index.stripX && this->stripV == index.stripV && this->gridX == index.gridX && this->gridV < index.gridV)||
23 (this->stripX == index.stripX && this->stripV == index.stripV && this->gridX == index.gridX && this->gridV == index.gridV && this->sheet < index.sheet );
24
25 //return (this->stripX < index.stripX) || (this->stripX == index.stripX &&
26 // (this->stripV < index.stripV) || (this->stripV == index.stripV &&
27 // ...
28 // )
29 // )
30 //have to admit this expression sucks
31
32
33 //// just compares from up to down.
34 //return this->stripX < index.stripX ? true : this->stripX != index.stripX ? false :
35 // this->stripV < index.stripV ? true : this->stripV != index.stripV ? false :
36 // this->gridX < index.gridX ? true : this->gridX != index.gridX ? false :
37 // this->gridV < index.gridV ? true : this->gridV != index.gridV ? false :
38 // this->sheet < index.sheet ? true : false;
39 } // hope this gets optimized well..
40};
41typedef std::map<IndexGar, std::vector<int> > HitHistMap;// vector length 2001, last 1 is overflow and underflow.
42
43#endif
std::map< IndexGar, std::vector< int > > HitHistMap
Definition IndexGar.h:41
char gridX
Definition IndexGar.h:9
char sheet
Definition IndexGar.h:10
bool operator<(const IndexGar &index) const
Definition IndexGar.h:14
int stripV
Definition IndexGar.h:8
int stripX
Definition IndexGar.h:7
char gridV
Definition IndexGar.h:9