BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
TofHitCount.cxx
Go to the documentation of this file.
1//---------------------------------------------------------------------------//
2//// BOOST --- BESIII Object_Oriented Simulation Tool /
3////
4////---------------------------------------------------------------------------/
5////
6////Description:
7////Author: Caogf
8////Created: Feb, 2006
9////Modified:
10////Comment:
11////
12//
13#include "Trigger/TofHitCount.h"
14
16#include "Identifier/TofID.h"
17
19#include "RawEvent/DigiEvent.h"
20
21#include <map>
22using namespace std;
23
24TofHitCount* TofHitCount::tof_Pointer = 0;
25
27 if(!tof_Pointer) tof_Pointer = new TofHitCount();
28 return tof_Pointer;
29}
30
32{
33}
35{
36}
37void TofHitCount::setTofDigi(std::vector<int>& vtofHit)
38{
39 barrelHit1.clear();
40 barrelHit2.clear();
41 ecapHit.clear();
42 wcapHit.clear();
43
44 for(std::vector<int>::iterator iter = vtofHit.begin(); iter != vtofHit.end(); iter++) {
45 int tofId = (*iter);
46 int part, layer, im;
47 part = int (tofId/10000.);
48 layer = int ((tofId - part*10000)/1000.);
49 im = int ((tofId - part*10000 - layer*1000)/10.);
50 if(part == 0) {
51 // east end cap: 0-47
52 if(find(ecapHit.begin(),ecapHit.end(),im) == ecapHit.end()) {
53 ecapHit.push_back(im);
54 }
55 }
56 else if (part == 2) {
57 // west end cap: 0-47
58 if(find(wcapHit.begin(),wcapHit.end(),im) == wcapHit.end()) {
59 wcapHit.push_back(im);
60 }
61 }
62 else {
63 if(layer == 0) {
64 //the 1st layer in barrel: 0-87
65 if(find(barrelHit1.begin(),barrelHit1.end(),im) == barrelHit1.end()) {
66 barrelHit1.push_back(im);
67 }
68 }
69 if(layer == 1) {
70 //the 2nd layer in barrel: 0-87
71 if(find(barrelHit2.begin(),barrelHit2.end(),im) == barrelHit2.end()) {
72 barrelHit2.push_back(im);
73 }
74 }
75 }
76 }
77}
EvtStreamInputIterator< typename Generator::result_type > iter(Generator gen, int N=0)
static TofHitCount * get_Tof(void)
Definition: TofHitCount.cxx:26
void setTofDigi(std::vector< int > &vtofHit)
Definition: TofHitCount.cxx:37